/* Passport Party — shared design tokens & components (big screen + phones) */
:root {
  /* An explorer's field journal: night jungle, parchment, torchlight and brass */
  --ink: #0e1410;
  --ink-2: #151d17;
  --ink-3: #1f2a21;
  --panel: rgba(244, 234, 210, 0.06);
  --panel-2: rgba(244, 234, 210, 0.1);
  --line: rgba(244, 234, 210, 0.15);
  --text: #f4ead2;
  --muted: #b8ad92;
  --dim: #7d7561;
  --gold: #f28c28;      /* torch: the main accent */
  --brass: #d9b26a;
  --ember: #e4572e;
  --teal: #2fb58a;      /* jade */
  --violet: #4f7fd9;    /* lapis */
  --rose: #e07a9a;
  --good: #52c97d;
  --bad: #e5484d;
  --parchment: #f1e3c1;
  --parchment-2: #e2cc9b;
  --sepia: #2e2113;
  /* Answer colours always pair with a shape so colour-blind players are fine */
  --a0: #f28c28; --a1: #2fb58a; --a2: #d64545; --a3: #4f7fd9;
  --radius: 14px;
  --poster: 'Alfa Slab One', 'Rockwell', 'Roboto Slab', Georgia, serif;
  --display: 'Bitter', 'Rockwell', Georgia, serif;
  --type: 'Special Elite', 'Courier New', monospace;
  --ui: 'Lexend', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* Background: a contour map at night, lit by a warm torch glow from below */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(110% 80% at 50% 115%, #3a2410 0%, #1a1c12 38%, var(--ink) 70%); }
.sky::before, .sky::after, .sky i {
  content: ''; position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%;
  filter: blur(90px); opacity: 0.22; mix-blend-mode: screen; animation: drift 38s ease-in-out infinite alternate;
}
.sky::before { background: var(--gold); bottom: -42vmax; left: -10vmax; opacity: 0.16; }
.sky::after { background: var(--teal); top: -44vmax; right: -22vmax; opacity: 0.12; animation-duration: 46s; animation-delay: -12s; }
.sky i { background: var(--brass); top: 35%; left: 60%; width: 40vmax; height: 40vmax; opacity: 0.06; animation-duration: 52s; }
.sky b { position: absolute; inset: -10%; opacity: 0.16; background: url('/img/contours.svg') center / 900px auto repeat; animation: drift 120s linear infinite alternate; }
body[data-tone='hot'] .sky::before { background: var(--ember); opacity: 0.24; }
@keyframes drift { to { transform: translate(12vmax, 8vmax) scale(1.15); } }

/* Logo: a compass and the name in poster type */
.brand { font-family: var(--poster); font-weight: 400; letter-spacing: 0.01em; display: inline-flex; align-items: center; gap: 0.35em; color: var(--parchment); text-shadow: 0 0.06em 0 #000; }
.brand em { font-style: normal; color: var(--gold); }
.brand .dot { width: 1.05em; height: 1.05em; border-radius: 0; background: url('/img/compass.svg') center / contain no-repeat; display: inline-block; box-shadow: none; filter: drop-shadow(0 0.08em 0.15em rgba(0,0,0,0.5)); }

.btn {
  border: 0; border-radius: 12px; padding: 0.85em 1.6em; font-weight: 800; letter-spacing: 0.02em;
  background: linear-gradient(180deg, #f8a046, var(--gold)); color: #1d1206; box-shadow: inset 0 -0.22em 0 rgba(0,0,0,0.25), 0 10px 26px -12px rgba(242, 140, 40, 0.8);
  transition: transform 0.15s, filter 0.15s, opacity 0.2s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: default; filter: grayscale(0.5); }
.btn.ghost { background: var(--panel-2); color: var(--text); box-shadow: none; border: 1px solid var(--line); }
.btn.small { padding: 0.5em 1em; font-size: 0.85em; }
.btn:focus-visible, .chip:focus-visible, input:focus-visible, .opt:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }

.chip {
  display: inline-flex; align-items: center; gap: 0.45em; border: 1px solid var(--line); background: var(--panel);
  border-radius: 10px; padding: 0.45em 0.9em; font-weight: 700; font-size: 0.9em; color: var(--muted); transition: all 0.15s;
}
.chip[aria-pressed='true'] { background: rgba(242, 140, 40, 0.16); border-color: var(--gold); color: var(--text); }
.chip:disabled { opacity: 0.4; }

.field {
  width: 100%; background: rgba(0, 0, 0, 0.3); border: 1.5px solid var(--line); border-radius: 14px;
  padding: 0.9em 1em; font-size: 1.1em; font-weight: 700; outline: none; transition: border-color 0.15s;
}
.field:focus { border-color: var(--gold); }

.avatar {
  --c: var(--gold); width: 2.6em; height: 2.6em; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--c) 55%, white), var(--c));
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 6px 18px -6px var(--c); font-size: 1em; flex: none; overflow: hidden; position: relative;
}
.avatar span { font-size: 1.35em; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.25)); }
.avatar img { width: 100%; height: 100%; object-fit: cover; background: #fffaf0; }
.avatar.off { filter: grayscale(1) brightness(0.6); }

/* Answer shapes */
.shape { width: 1.1em; height: 1.1em; display: inline-block; background: currentColor; flex: none; }
.shape.s0 { clip-path: polygon(50% 6%, 96% 92%, 4% 92%); }
.shape.s1 { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.shape.s2 { border-radius: 50%; }
.shape.s3 { border-radius: 3px; transform: scale(0.85); }

.ref { font-family: var(--display); font-style: italic; color: var(--brass); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(140%); background: var(--parchment); color: var(--sepia);
  padding: 0.8em 1.2em; border-radius: 14px; font-weight: 700; z-index: 100; transition: transform 0.3s cubic-bezier(.2, 1.4, .4, 1);
  max-width: calc(100vw - 32px); text-align: center; box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.6);
}
.toast.show { transform: translateX(-50%) translateY(0); }

.conn { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 90; background: var(--ember); color: #fff; font-weight: 800; font-size: 0.8rem; padding: 6px 14px; border-radius: 999px; }

@keyframes pop { 0% { transform: scale(0.3); opacity: 0; } 70% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
.rise { animation: rise 0.5s cubic-bezier(.2, .9, .3, 1) both; }
.pop { animation: pop 0.45s cubic-bezier(.2, 1.4, .4, 1) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
