/* Type 'Em's own colors (its build's stylesheet): night page, navy cards, gold. */
:root {
  --page: #0a0c22;
  --navy: #0f1d4a;
  --gold: #e7b84a;
  --gold-hi: #f6dc8a;
  --cream: #fbf1d6;
  --line: #d8aa43;
  --muted: #d9cfae;
  --bad: #ffb3a1;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--page);
  color: var(--cream);
  font: 16px/1.4 Georgia, Palatino, "Palatino Linotype", serif;
}
/* A blurred copy of the title art fills wide screens; the real art sits in the column. */
body::before {
  content: "";
  position: fixed;
  inset: -40px;
  background: url("door/title-bg.webp") center / cover no-repeat;
  filter: blur(28px) brightness(0.45);
  z-index: -2;
}
/* One screen tall, never scrolling on its own. The title and the panels are placed by door.js
   from where the characters are drawn in the art (title-bg: head tops at 28% of its height,
   feet and blanket end at 60%, grass below): the title high in the sky above their heads,
   the panel on the grass below their feet, nothing over the characters. */
.door {
  position: relative;
  width: min(100vw, 560px);
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: url("door/title-bg.webp") center top / cover no-repeat;
}
.door.tall { height: auto; overflow: visible; }   /* a lobby taller than the grass: the page scrolls */
/* Tap 'Em's cream-edged green pill/circular controls, beside the artwork when
   there is room. Narrow screens keep them on the clear top edge of the art. */
.door-controls { position: fixed; z-index: 20; top: max(8px, env(safe-area-inset-top)); left: max(12px, calc((100vw - 560px) / 2 + 12px)); display: flex; align-items: center; gap: 8px; }
.door-audio-controls { position: fixed; z-index: 20; top: calc(max(8px, env(safe-area-inset-top)) + 52px); right: max(12px, calc((100vw - 560px) / 2 + 12px)); display: flex; align-items: center; gap: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.door-nav-button { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 2px solid #f2d9a8; border-radius: 999px; background: linear-gradient(#4fa35e, #2e7d3e); box-shadow: 0 3px 0 #1f5a2b, 0 5px 12px #2443332e; color: #fff; padding: 0 16px 0 10px; font: 800 14px/1.1 system-ui, sans-serif; text-decoration: none; white-space: nowrap; cursor: pointer; }
.door-nav-button svg { width: 22px; height: 22px; flex: none; }
.door-nav-button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.door-nav-button:active { transform: translateY(2px); box-shadow: 0 1px 0 #1f5a2b; }
.door-music, .door-sfx, .door-fullscreen { width: 44px; padding: 0; border-radius: 50%; }
.door-music[aria-pressed="false"], .door-sfx[aria-pressed="false"] { filter: saturate(.3) brightness(1.05); opacity: .75; }
.door-music[disabled] { cursor: wait; }
.door-music[aria-pressed="false"] .music-on, .door-music[aria-pressed="true"] .music-off { display: none; }
.door-sfx[aria-pressed="false"] .sfx-on, .door-sfx[aria-pressed="true"] .sfx-off { display: none; }
@media (min-width: 772px) {
  .door-audio-controls { top: max(8px, env(safe-area-inset-top)); left: calc(50% + 280px + 10px); right: auto; flex-direction: column; }
  .door-audio-controls .music-adjust { width: 88px; }
}
@media (min-width: 1120px) {
  .door-audio-controls { flex-direction: row; }
  .door-audio-controls .music-adjust { width: 112px; }
}
@media (max-width: 771px) and (max-height: 640px) {
  .door-exit { width: 44px; padding: 0; }
  .door-exit span { display: none; }
  .door-audio-controls { top: max(8px, env(safe-area-inset-top)); }
  .door-audio-controls .music-adjust { width: 76px; padding: 0 10px; }
}
@media (min-width: 1100px) { .door-controls { left: auto; right: calc(50% + 280px + 10px); } }
.logo, .door .panel { position: absolute; left: 50%; transform: translateX(-50%); }
.logo { width: 420px; height: auto; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.7)); }
.door:not(.placed) .logo, .door:not(.placed) .panel { visibility: hidden; }   /* until placed: no jump */
.panel {
  width: min(400px, calc(100% - 32px));
  background: linear-gradient(#142257f2, #0c1638f6);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}
.panel.lobby { width: min(460px, calc(100% - 24px)); }
.btn {
  appearance: none;
  display: block;
  width: 100%;
  min-height: 48px;
  border: 2px solid #fff0b0;
  border-radius: 999px;
  background: linear-gradient(#f9dc7a, #d99a1f);
  color: #2a1c00;
  font: 800 20px/1 Georgia, Palatino, serif;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  padding: 13px 18px;
  cursor: pointer;
  box-shadow: 0 4px 0 #7a5410, 0 8px 18px rgba(0, 0, 0, 0.45);
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #7a5410; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.btn.small { width: auto; min-height: 44px; font-size: 14px; padding: 10px 14px; }
.btn.ghost { background: transparent; color: var(--gold-hi); border-color: var(--line); box-shadow: none; font-size: 15px; }
.note { margin: 0; text-align: center; color: var(--muted); }
.note:empty { display: none; }
.note.bad { color: var(--bad); }
.note a { color: var(--gold-hi); }
.fine { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.code-row { display: flex; align-items: baseline; justify-content: space-between; }
.label { margin: 0; color: var(--gold-hi); text-transform: uppercase; letter-spacing: 0.12em; font-size: 13px; }
.code { font: 800 40px/1 Georgia, serif; letter-spacing: 0.18em; color: var(--gold-hi); }
.join { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.join-row { display: flex; gap: 8px; }
.join-row input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--gold-hi);
  padding: 0 14px;
  font: 800 26px/1 Georgia, Palatino, serif;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-align: center;
}
.join-row input::placeholder { color: rgba(246, 220, 138, 0.3); }
.join-row input:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.join-row .btn.small { min-height: 48px; min-width: 96px; }
.invite { display: flex; gap: 8px; }
.invite input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--cream);
  padding: 0 10px;
  font-size: 14px;
}
.seats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.seats li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 4px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(231, 184, 74, 0.1);
  overflow: hidden;
}
.seats li.open { border-style: dashed; color: var(--muted); background: transparent; }
.seats li img, .seats li .dot { width: 28px; height: 28px; border-radius: 50%; flex: none; object-fit: cover; }
.seats li .dot { background: var(--gold); color: #2a1c00; display: grid; place-items: center; font-weight: 800; }
.seats li .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seats li .tag { margin-left: auto; font-size: 12px; color: var(--gold-hi); }
.seats li.away { opacity: 0.5; }
.actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
.actions #start { grid-column: 1 / -1; }
.music-adjust { display: flex; align-items: center; gap: 10px; width: 112px; min-height: 44px; padding: 0 12px; border: 2px solid #f2d9a8; border-radius: 999px; background: linear-gradient(#d7bd7a, #b99b5f); box-shadow: 0 3px 0 #6f552e; color: #233e2a; font: 800 12px/1 system-ui, sans-serif; }
.music-adjust span { white-space: nowrap; }
.music-adjust output { min-width: 4ch; text-align: right; }
.music-adjust input { appearance: none; -webkit-appearance: none; flex: 1; min-width: 40px; width: 100%; height: 40px; margin: 0; background: transparent; cursor: pointer; }
.music-adjust input::-webkit-slider-runnable-track { height: 8px; border: 1px solid #806b40; border-radius: 999px; background: linear-gradient(90deg, #398347 var(--v,40%), #fff1c6 var(--v,40%)); }
.music-adjust input::-moz-range-track { height: 8px; border: 1px solid #806b40; border-radius: 999px; background: linear-gradient(90deg, #398347 var(--v,40%), #fff1c6 var(--v,40%)); }
.music-adjust input::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border: 2px solid #31643b; border-radius: 50%; background: #fff1c6; box-shadow: 0 2px 3px #0003; }
.music-adjust input::-moz-range-thumb { width: 16px; height: 16px; border: 2px solid #31643b; border-radius: 50%; background: #fff1c6; box-shadow: 0 2px 3px #0003; }
.music-adjust input:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 999px; }
@media (prefers-reduced-motion: reduce) { .btn:active, .door-nav-button:active { transform: none; } }
