/* style.css : the look of the whole site. Colours are set once, just below. */

:root {
  --pine: #0b2723;
  --pine-2: #123a34;
  --pine-3: #1c5147;
  --red: #d7263d;
  --red-dark: #a31a2d;
  --gold: #ffd166;
  --snow: #f6f9fb;
  --muted: #bcd3cd;
  --panel: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 209, 102, 0.38);
  --radius: 16px;
  --font: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, sans-serif;
  --snow-tile: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cg fill='white'%3E%3Ccircle cx='20' cy='30' r='2.2'/%3E%3Ccircle cx='90' cy='10' r='1.5'/%3E%3Ccircle cx='150' cy='60' r='2.6'/%3E%3Ccircle cx='60' cy='110' r='1.8'/%3E%3Ccircle cx='180' cy='140' r='2'/%3E%3Ccircle cx='110' cy='170' r='2.4'/%3E%3Ccircle cx='30' cy='180' r='1.4'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html.locked body { visibility: hidden; }

html {
  min-height: 100%;
  background-color: var(--pine);
  background-image: radial-gradient(1300px 760px at 50% -12%, var(--pine-3), var(--pine) 62%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body {
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.5;
  color: var(--snow);
  min-height: 100vh;
  position: relative;
}

/* gentle snowfall (two layers); switched off for people who prefer less motion */
body::before, body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: var(--snow-tile);
}
body::before { opacity: 0.45; background-size: 200px 200px; animation: snow-a 22s linear infinite; }
body::after  { opacity: 0.30; background-size: 340px 340px; animation: snow-b 36s linear infinite; }
@keyframes snow-a { to { background-position: 40px 200px; } }
@keyframes snow-b { to { background-position: -60px 340px; } }

@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none; }
  * { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}

main, header, footer, section { position: relative; z-index: 1; }

h1, h2, h3 { line-height: 1.15; margin: 0 0 0.4em; letter-spacing: 0.01em; }
h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); }
h2 { font-size: 1.5rem; color: var(--gold); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 0.9em; }
a { color: var(--gold); }
.lead { color: var(--muted); font-size: 1.15rem; }

.wrap { width: min(1180px, 100% - 48px); margin-inline: auto; }
.kicker {
  text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.85rem;
  color: var(--gold); font-weight: 700; margin: 0 0 0.5em;
}

/* a candy-cane stripe divider */
.cane {
  height: 8px; border-radius: 99px; margin: 22px 0;
  background: repeating-linear-gradient(135deg, var(--red) 0 14px, var(--snow) 14px 28px);
  opacity: 0.9;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  font: inherit; font-weight: 700; font-size: 1.05rem;
  padding: 0.7em 1.5em; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--gold); color: #2a1f00; text-decoration: none;
  box-shadow: 0 4px 0 #b88a1e, 0 8px 18px rgba(0, 0, 0, 0.3);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #b88a1e, 0 12px 22px rgba(0, 0, 0, 0.3); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #b88a1e; }
.btn.red { background: var(--red); color: #fff; box-shadow: 0 4px 0 var(--red-dark), 0 8px 18px rgba(0, 0, 0, 0.3); }
.btn.ghost { background: transparent; color: var(--snow); border: 2px solid var(--line); box-shadow: none; }
:where(a, button, input):focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* ---------- control bar (sound, captions, home) ---------- */
#controls {
  position: fixed; top: 12px; right: 14px; z-index: 50;
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
}
.ctl {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 0.9rem; font-weight: 700;
  color: var(--snow); background: rgba(5, 20, 18, 0.72);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px 7px 11px; cursor: pointer; text-decoration: none;
}
.ctl:hover { background: rgba(5, 20, 18, 0.92); border-color: var(--gold); }
.ctl.is-off { color: #ffb3bd; }
.ctl-sound .slash { display: none; }
.ctl-sound.is-off .slash { display: inline; }
.ctl-sound.is-off .waves { display: none; }

/* ---------- captions ---------- */
#captions {
  position: fixed; left: 50%; bottom: 22px; z-index: 60;
  transform: translate(-50%, 12px);
  width: min(920px, 92vw); text-align: center;
  background: rgba(0, 0, 0, 0.86); color: #fff;
  font-size: 1.35rem; line-height: 1.35;
  padding: 12px 20px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
#captions.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- picture slots ---------- */
.art {
  position: relative; overflow: hidden; border-radius: var(--radius);
  aspect-ratio: var(--ratio, 3 / 2); background: var(--pine-2);
}
.art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art.art-missing {
  border: 2px dashed var(--line);
  background: repeating-linear-gradient(135deg, rgba(255,255,255,0.05) 0 16px, rgba(255,255,255,0.0) 16px 32px), var(--pine-2);
  display: grid; place-items: center; text-align: center; color: var(--muted);
}
.art-tag { display: grid; gap: 4px; padding: 10px; font-size: 0.95rem; }
.art-tag strong { color: var(--gold); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; }
.art-tag small { opacity: 0.85; font-size: 0.78rem; }

/* ---------- code screen ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 56px 20px 28px; }
.gate-card {
  width: min(560px, 100%); text-align: center;
  background: rgba(6, 24, 21, 0.78); backdrop-filter: blur(4px);
  border: 2px solid var(--line); border-radius: 22px; padding: 22px 32px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.gate-card .art { width: min(350px, 100%); margin: 0 auto 10px; --ratio: 16 / 9; }
.gate-card .art.has-art { background: transparent; aspect-ratio: auto; border-radius: 0; overflow: visible; }
.gate-card .art.has-art img { height: auto; object-fit: contain; }
.gate-card .art-tag { font-size: 0.8rem; gap: 3px; padding: 8px; }
.gate-card .art-tag small { font-size: 0.7rem; }
.gate-card h1 { font-size: clamp(1.8rem, 3.6vw, 2.4rem); }
.gate-card p.lead { color: var(--muted); }
.gate-form { display: grid; gap: 14px; margin-top: 18px; }
.gate-form label { font-weight: 700; color: var(--gold); text-align: left; }
.gate-form input {
  font: inherit; font-size: 1.25rem; letter-spacing: 0.08em; text-align: center;
  padding: 0.65em 0.8em; border-radius: 12px; border: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.95); color: #10211e;
}
.gate-error { min-height: 1.6em; margin: 0; color: #ffb3bd; font-weight: 700; }
.shake { animation: shake 0.4s; }
@keyframes shake { 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(4px); } }

/* ---------- main page ---------- */
.hub-head { padding: 62px 0 10px; text-align: center; }
.hub-head h1 { text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); }

.briefing {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 28px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 22px;
}
.briefing .art { --ratio: 16 / 9; }
.briefing-text h2 { margin-bottom: 0.3em; }
.briefing-text p { font-size: 1.12rem; }
.briefing-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.section-title { text-align: center; margin: 34px 0 16px; }
.roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; max-width: 1060px; margin-inline: auto; }
.role-card {
  position: relative; display: grid; gap: 8px; align-content: start; text-decoration: none; color: var(--snow);
  background: var(--panel); border: 2px solid var(--line); border-radius: 20px; padding: 12px 12px 16px;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.role-card:hover, .role-card:focus-visible { transform: translateY(-6px); border-color: var(--gold); background: rgba(255, 255, 255, 0.11); }
.role-card .art { --ratio: 2 / 3; }
.role-card .num {
  position: absolute; top: 22px; left: 22px; z-index: 2;
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--snow); font-weight: 800; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}
.role-card p { margin: 4px 4px 0; color: var(--snow); font-weight: 700; }
.role-card .go { margin: 0 4px; }
.role-card .done-badge {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: var(--gold); color: #2a1f00; font-weight: 800; font-size: 0.82rem;
  padding: 3px 12px; border-radius: 999px; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}
.role-card .go { color: var(--gold); font-weight: 700; }
.role-card:hover .go { text-decoration: underline; }

.event {
  margin-top: 34px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 22px 26px;
}
.event dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 12px 0 0; }
.event dt { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem; color: var(--gold); font-weight: 700; }
.event dd { margin: 2px 0 0; font-size: 1.2rem; }
.event .tba { color: var(--muted); font-style: italic; }
.event-actions { margin-top: 18px; }
footer.site-foot { text-align: center; color: var(--muted); font-size: 0.9rem; padding: 34px 0 90px; }

/* ---------- game pages ---------- */
.game-shell { padding: 64px 0 90px; }
.back { display: inline-block; margin-bottom: 14px; font-weight: 700; }
.stage {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 26px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 22px; margin-top: 18px;
}
.stage .art { --ratio: 16 / 9; }

/* ---------- sound test page ---------- */
.sfx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-top: 20px; }

/* ---------- narrower windows ---------- */
@media (max-width: 900px) {
  .briefing, .stage { grid-template-columns: 1fr; }
  .roles, .event dl { grid-template-columns: 1fr; }
  #controls { position: absolute; }
}
