@font-face {
  font-family: Bricolage;
  src: url("/jugar/bricolage.woff2") format("woff2");
  font-display: swap;
  font-weight: 400 800;
}

:root {
  --ink: #271f1a;
  --muted: #514337;
  --yellow: #f7dd7b;
  --paper: #fffae9;
  --red: #7f3227;
  --accent: #bd4d36;
  --grid: #53401919;
  --rule: #a68c573d;
  --display: Bricolage, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--yellow);
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: center top;
}
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:where(a, button, input, summary):focus-visible {
  outline: 3px solid #394f78;
  outline-offset: 4px;
}
.skip {
  position: absolute;
  z-index: 4;
  inset: .5rem auto auto 1rem;
  padding: .6rem 1rem;
  color: var(--paper);
  background: var(--ink);
  transform: translateY(-160%);
}
.skip:focus { transform: none; }

.masthead { padding-inline: max(24px, calc((100% - 1200px) / 2)); }
.masthead-inner {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #624b2a57;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font: 800 2rem/.95 var(--display);
  text-decoration: none;
  letter-spacing: -.072em;
}
.brand-dot { color: var(--red); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 34px;
  border: 2px solid;
  border-radius: 2px 6px 3px 2px;
  background: var(--paper);
  transform: rotate(-8deg);
  box-shadow: 2px 2px 0 var(--ink);
}
.brand-mark i {
  width: 12px;
  height: 10px;
  border-top: 2px solid;
  border-bottom: 2px solid;
  transform: rotate(0);
}
nav { display: flex; gap: 6px; align-items: center; }
nav button {
  min-height: 44px;
  padding: 8px 15px;
  color: var(--ink);
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 700;
}
nav button:hover, nav button[aria-pressed="true"] { border-color: var(--ink); background: var(--paper); }

main {
  width: min(100% - 48px, 1120px);
  margin: 0 auto;
  flex: 1;
  display: grid;
  align-content: center;
  padding-block: 36px 62px;
}
.messages p { margin: 0 0 16px; }
.notice { color: var(--muted); font-size: .88rem; font-weight: 650; }
.notice:empty, .feedback:empty { margin: 0; }
.notice.ready {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.notice.offline, .error {
  padding: 10px 14px;
  max-width: 62ch;
  border-left: 4px solid var(--red);
  background: var(--paper);
  color: var(--red);
  overflow-wrap: anywhere;
}
.feedback { font-weight: 650; }

.menu {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  align-items: center;
  gap: clamp(24px, 5.5vw, 94px);
}
.hero-copy { position: relative; }
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 24px;
  color: var(--ink);
  font-size: .93rem;
  font-weight: 700;
}
.kicker span { width: 19px; height: 2px; background: var(--red); }
h1, h2 { font-family: var(--display); letter-spacing: -.045em; }
h1 { margin: 0; line-height: .96; }
.menu h1 { font-size: clamp(4.5rem, 8.6vw, 8.1rem); font-weight: 800; letter-spacing: -.079em; }
.menu h1 em { font-style: normal; color: var(--red); }
.menu h1 em span { color: var(--ink); }
.lead {
  max-width: 37ch;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.6vw, 1.24rem);
}
.desk-art {
  position: relative;
  width: min(100%, 435px);
  height: 128px;
  margin-top: 14px;
  pointer-events: none;
}
.paper-plane {
  position: absolute;
  right: 3%;
  top: 4%;
  width: 140px;
  height: 84px;
  transform: rotate(-13deg);
  filter: drop-shadow(4px 5px 0 #74482235);
}
.paper-plane i, .paper-plane b, .paper-plane span { position: absolute; inset: 0; }
.paper-plane i { background: var(--ink); clip-path: polygon(0 39%, 100% 0, 66% 100%, 47% 72%, 35% 88%, 31% 57%); }
.paper-plane b { background: var(--paper); clip-path: polygon(5% 39%, 96% 5%, 34% 54%); }
.paper-plane span { background: var(--paper); clip-path: polygon(45% 65%, 96% 5%, 65% 94%); }
.paper-plane::after { content: ""; position: absolute; inset: 0; background: #e48667; clip-path: polygon(34% 57%, 90% 11%, 42% 65%, 36% 82%); }
.paper-trail {
  position: absolute;
  top: 48%;
  left: 14%;
  width: 53%;
  height: 43%;
  border: 2px dashed #7b4836a6;
  clip-path: inset(27% 0 0 0);
  border-radius: 49%;
  transform: rotate(-11deg);
}
.spark { position: absolute; display: block; width: 20px; height: 20px; background: var(--red); clip-path: polygon(45% 0, 55% 0, 55% 45%, 100% 45%, 100% 55%, 55% 55%, 55% 100%, 45% 100%, 45% 55%, 0 55%, 0 45%, 45% 45%); transform: rotate(16deg); }
.spark-one { top: 5%; right: 43%; }
.spark-two { top: 77%; right: 4%; width: 13px; height: 13px; }

.room-sheet {
  position: relative;
  isolation: isolate;
  border-radius: 4px 4px 34px 4px;
  border: 2px solid var(--ink);
  background-color: var(--paper);
  box-shadow: 8px 9px 0 #482d20;
}
.menu .room-sheet {
  background-image: linear-gradient(90deg, transparent 29px, #b95e503f 29px 30px, transparent 30px), repeating-linear-gradient(0deg, transparent 0 27px, var(--rule) 27px 28px);
}
.paper-hole {
  position: absolute;
  top: 20px;
  left: 9px;
  width: 12px;
  height: 12px;
  border: 1px solid #52362284;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: inset 1px 2px #6848284a;
}
.paper-fold {
  position: absolute;
  width: 33px;
  height: 33px;
  right: -1px;
  bottom: -1px;
  background: #edcc7e;
  clip-path: polygon(0 0, 100% 0, 0 100%);
  border: 1px solid var(--ink);
  border-radius: 5px 1px 0 0;
  pointer-events: none;
}
.sheet-content { padding: clamp(29px, 4vw, 46px) clamp(29px, 4vw, 47px) 25px max(44px, 10%); }
.sheet-label {
  display: block;
  color: var(--red);
  font: 700 .73rem/1.4 ui-monospace, Consolas, monospace;
  letter-spacing: .13em;
}
.sheet-content h2 { font-size: clamp(1.9rem, 3.2vw, 2.85rem); line-height: 1; margin: 10px 0 7px; }
.sheet-lead { margin: 0 0 24px; color: var(--muted); }
.primary, .secondary, .quiet {
  border: 1.5px solid var(--ink);
  border-radius: 7px;
  min-height: 48px;
  padding: 9px 16px;
  font-weight: 750;
  transition: background-color 140ms, box-shadow 140ms, transform 140ms;
}
.primary { color: var(--paper); background: var(--ink); box-shadow: 3px 3px 0 var(--accent); }
.primary:hover:enabled { background: #443128; transform: translateY(-2px); }
.primary:active:enabled, .secondary:active:enabled { transform: translate(1px, 2px); box-shadow: none; }
.primary:disabled { color: #fff9e8; background: #6a5a51; box-shadow: none; }
#create { width: 100%; display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding-inline: 18px; }
.arrow { font-size: 1.5rem; line-height: 1; }
.secondary { color: var(--ink); background: #fae093; }
.secondary:hover:enabled { background: #f2c956; transform: translateY(-2px); }
.secondary:disabled { opacity: .63; }
.quiet { color: var(--ink); background: transparent; border-color: transparent; text-decoration: underline; text-underline-offset: .2em; }
.quiet:hover { background: #f3e7c6; }
.small { min-height: 44px; font-size: .9rem; }
#join-form { border-top: 1px dashed #8a7256; margin: 25px 0 0; padding-top: 19px; }
label, .label { display: block; margin: 0 0 7px; font-weight: 700; }
input {
  min-width: 0;
  min-height: 48px;
  width: 100%;
  border: 1px solid #837255;
  border-radius: 7px;
  padding: 9px 12px;
  background: #fffefa;
  color: var(--ink);
}
input::placeholder { color: #786953; opacity: 1; }
.join-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
#join-code, .room-code { text-transform: uppercase; font: 700 1rem/1.4 ui-monospace, Consolas, monospace; letter-spacing: .14em; }
.hint { color: var(--muted); font-size: .88rem; }
#code-help { margin: 6px 0; }
.guest-line {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  padding: 9px 0 0;
  margin-top: 14px;
  border: 0;
  border-top: 1px solid var(--rule);
  min-height: 47px;
  background: transparent;
  text-align: left;
  color: var(--muted);
  font-size: .85rem;
}
.guest-line strong { color: var(--ink); overflow-wrap: anywhere; }
.guest-dot { flex: 0 0 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.guest-edit { margin-left: auto; font-weight: 650; text-decoration: underline; text-underline-offset: .2em; }

.interior { width: min(100%, 880px); margin-inline: auto; padding: clamp(24px, 5vw, 54px); }
.interior h1 { font-size: clamp(2.6rem, 7vw, 5rem); }
.interior h2 { font-size: 1.45rem; margin-block: 0 8px; }
.room-heading, .players-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.badge { border: 1px solid; padding: 4px 10px; border-radius: 99px; font-size: .8rem; font-weight: 700; background: #f8e4a6; }
.invite {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 24px;
  padding-block: 20px;
  margin-block: 20px;
  border-block: 1px dashed #8a7256;
}
.invite input { margin-bottom: 8px; }
.room-code { display: block; font-size: clamp(1.35rem, 4vw, 2rem); margin-bottom: 8px; }
.players { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.players li { display: flex; min-width: 0; gap: 10px; align-items: center; border-bottom: 1px solid var(--rule); padding: 10px 0; }
.avatar { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 50%; background: #f6db87; font-weight: 800; }
.player-text { min-width: 0; overflow-wrap: anywhere; }
.player-name { display: block; font-weight: 700; }
.player-detail { display: block; color: var(--muted); font-size: .8rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-block: 18px 0; }
.started { border-left: 4px solid var(--accent); padding: 12px 16px; background: #f7e7b5; }
.started p { margin: 0; }
.profile-sheet { max-width: 620px; }
.profile-form { margin-block: 24px; }
footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  column-gap: 24px;
  width: min(100% - 48px, 1200px);
  margin-inline: auto;
  padding-block: 7px 14px;
  border-top: 1px solid #624b2a57;
  color: #574523;
  font-size: .8rem;
}
footer p { margin-block: 9px; }
footer details { margin-left: auto; max-width: 44ch; }
footer summary { cursor: pointer; min-height: 44px; align-content: center; font-weight: 700; }

@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) { [data-enter] { animation: enter 290ms ease-out both; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

@media (max-width: 870px) {
  .menu { grid-template-columns: minmax(0, 1fr) minmax(0, 390px); gap: 26px; }
  .menu h1 { font-size: clamp(3.2rem, 9.2vw, 5.8rem); }
}
@media (max-width: 670px) {
  .masthead { padding-inline: 18px; }
  .masthead-inner { min-height: 65px; }
  .brand { gap: 8px; font-size: 1.55rem; }
  .brand-mark { width: 23px; height: 27px; }
  nav button { padding-inline: 9px; font-size: .84rem; }
  main, footer { width: calc(100% - 40px); }
  main { padding-block: 29px 38px; }
  .menu, .invite, .players { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { padding-right: 0; }
  .menu h1 { font-size: clamp(3.2rem, 11vw, 5rem); }
  .kicker { margin-bottom: 13px; }
  .lead { margin-top: 15px; }
  .desk-art { position: absolute; right: 0; top: 18%; width: 110px; height: 63px; }
  .paper-plane { width: 63px; height: 44px; }
  .paper-trail { width: 51%; height: 32%; }
  .spark-one { width: 12px; height: 12px; right: 73%; }
  .spark-two { width: 8px; height: 8px; right: 6%; top: 83%; }
  .sheet-content { padding: 23px 23px 27px 37px; }
  .menu .room-sheet {
    background-image: linear-gradient(90deg, transparent 24px, #b95e503f 24px 25px, transparent 25px), repeating-linear-gradient(0deg, transparent 0 27px, var(--rule) 27px 28px);
  }
  .room-sheet { box-shadow: 5px 6px 0 #482d20; }
  .paper-hole { left: 7px; }
  .invite { gap: 18px; }
  .actions button { flex-grow: 1; }
}
@media (max-width: 355px) {
  .brand { font-size: 1.39rem; }
  nav { gap: 1px; }
  nav button { padding-inline: 7px; }
  .desk-art { width: 72px; right: -1px; }
  .paper-plane { width: 50px; height: 34px; }
  .sheet-content { padding-right: 17px; }
  .join-row { gap: 6px; }
  .join-row button { padding-inline: 11px; }
}
