
:root {
  --ink: #171219;
  --cream: #f5efe5;
  --paper: #fffaf1;
  --pink: #ff4fa3;
  --orange: #ff5a1f;
  --yellow: #f1c645;
  --purple: #6c35d9;
  --purple-dark: #2d1554;
  --green: #9df23e;
  --cyan: #36b8d4;
  --muted: #665f68;
  --line: 3px solid var(--ink);
  --shadow: 8px 8px 0 var(--ink);
  --soft-shadow: 0 18px 60px rgba(23, 18, 25, .18);
  --font-display: "Archivo Black", Impact, sans-serif;
  --font-body: Inter, Arial, sans-serif;
  --topbar-height: 78px;
  --focus: 4px solid var(--green);
}

* { box-sizing: border-box; }
html {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  min-width: 320px;
  color: var(--ink);
  background: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}
button, input { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: var(--focus); outline-offset: 4px; }
img { display: block; max-width: 100%; }
@supports (overflow: clip) {
  html, body { overflow-x: clip; }
}
p, h1, h2, h3 { margin-top: 0; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 9999;
  padding: .75rem 1rem;
  color: var(--ink);
  background: var(--green);
  border: var(--line);
  font-weight: 800;
}
.skip-link:focus { top: 1rem; }

.game-shell { min-height: 100vh; background: var(--cream); overflow: visible; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem clamp(.8rem, 2.5vw, 2.4rem);
  color: var(--cream);
  background: rgba(23, 18, 25, .97);
  border-bottom: 3px solid var(--cream);
}
.brand-button, .icon-button, .help-button {
  appearance: none;
  border: 0;
  cursor: pointer;
}
.brand-button { display: flex; align-items: center; gap: .7rem; padding: 0; color: inherit; background: transparent; text-align: left; }
.brand-eye { position: relative; width: 42px; height: 27px; display: grid; place-items: center; background: var(--yellow); border-radius: 70% 30% 70% 30%; transform: rotate(45deg); }
.brand-eye span { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); box-shadow: inset 0 0 0 4px var(--pink); }
.brand-copy { display: grid; line-height: 1; }
.brand-copy strong { font-family: var(--font-display); font-size: 1.05rem; text-transform: uppercase; }
.brand-copy small { color: var(--yellow); font-size: .69rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: .4rem; }
.icon-button { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .55rem .75rem; color: var(--cream); background: transparent; border-radius: 99px; font-weight: 700; }
.icon-button:hover { background: rgba(255,255,255,.1); }
.icon-button > span:first-child { min-width: 25px; height: 25px; display: grid; place-items: center; border: 2px solid currentColor; border-radius: 50%; font-size: .78rem; }
.control-label { font-size: .78rem; }
.help-button { min-height: 44px; padding: .55rem 1rem; color: var(--ink); background: var(--yellow); border: 2px solid var(--cream); border-radius: 999px; font-weight: 900; }
.help-button:hover { background: var(--green); }

#app { min-height: calc(100vh - var(--topbar-height)); }
.screen { position: relative; min-height: calc(100vh - var(--topbar-height)); padding: clamp(2rem, 6vw, 6rem) clamp(1rem, 5vw, 5rem); isolation: isolate; }
.screen--contained { display: grid; place-items: center; }
.content-wrap { width: min(1180px, 100%); margin: 0 auto; }
.narrow-wrap { width: min(760px, 100%); margin: 0 auto; }
.eyebrow { margin-bottom: .65rem; font-size: .78rem; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; }
.display-title { margin-bottom: 1rem; font-family: var(--font-display); font-size: clamp(3.1rem, 10vw, 9.4rem); line-height: .82; text-transform: uppercase; }
.display-title span { display: block; color: var(--yellow); -webkit-text-stroke: 2px var(--ink); text-shadow: 6px 6px 0 var(--pink); }
.section-title { margin-bottom: 1rem; font-family: var(--font-display); font-size: clamp(2.25rem, 6vw, 5.2rem); line-height: .95; }
.lead { max-width: 720px; font-size: clamp(1.1rem, 2vw, 1.4rem); }
.muted { color: var(--muted); }

.button { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: .65rem; padding: .8rem 1.25rem; border: var(--line); border-radius: 0; font-weight: 900; text-decoration: none; cursor: pointer; box-shadow: 5px 5px 0 var(--ink); transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.button:hover { transform: translate(2px,2px); box-shadow: 3px 3px 0 var(--ink); }
.button:active { transform: translate(5px,5px); box-shadow: 0 0 0 var(--ink); }
.button--primary { color: var(--ink); background: var(--yellow); }
.button--primary:hover { background: var(--green); }
.button--dark { color: var(--cream); background: var(--ink); }
.button--pink { background: var(--pink); }
.button--ghost { background: transparent; }
.button--danger { color: var(--cream); background: #a71f37; }
.button[disabled] { opacity: .48; cursor: not-allowed; filter: grayscale(.4); }
.button[disabled]:hover { transform: none; box-shadow: 5px 5px 0 var(--ink); }
.button-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.text-button { padding: .25rem; border: 0; background: transparent; text-decoration: underline; cursor: pointer; font-weight: 700; }

/* Home poster */
.screen--home { min-height: calc(100vh - var(--topbar-height)); display: grid; align-items: center; color: var(--cream); background: var(--purple-dark); overflow: hidden; }
.screen--home::before { content: ""; position: absolute; inset: 0; z-index: -2; background: radial-gradient(circle at 15% 10%, rgba(255,79,163,.35), transparent 28%), radial-gradient(circle at 86% 70%, rgba(157,242,62,.18), transparent 25%), linear-gradient(120deg, transparent 0 47%, rgba(255,255,255,.05) 47% 49%, transparent 49% 100%); background-size: auto, auto, 40px 40px; }
.rain-layer { position: absolute; inset: -100px 0 0; z-index: -1; opacity: .25; pointer-events: none; background-image: repeating-linear-gradient(105deg, transparent 0 34px, rgba(245,239,229,.7) 35px 37px, transparent 38px 70px); background-size: 180px 120px; animation: rain-slide 5s linear infinite; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(250px, .7fr); align-items: center; gap: clamp(2rem, 5vw, 6rem); }
.home-copy { position: relative; z-index: 2; }
.home-copy .lead { color: #fff8; }
.home-actions { margin-top: 2rem; }
.home-poster { position: relative; min-height: 540px; }
.poster-card { position: absolute; border: var(--line); box-shadow: var(--shadow); }
.poster-card--big { inset: 7% 9% 6% 5%; display: grid; place-items: center; overflow: hidden; background: var(--pink); transform: rotate(4deg); }
.poster-card--big::before { content: ""; position: absolute; inset: -20%; background: repeating-conic-gradient(var(--orange) 0 8deg, var(--pink) 8deg 16deg); opacity: .65; animation: slow-spin 35s linear infinite; }
.poster-card--big::after { content: "KEEP THE NIGHT A GOOD ONE"; position: absolute; inset: auto 0 1.2rem; padding: .8rem; color: var(--cream); background: var(--ink); font-family: var(--font-display); text-align: center; letter-spacing: .06em; }
.poster-eye { position: relative; width: 240px; height: 150px; display: grid; place-items: center; background: var(--yellow); border: 9px solid var(--ink); border-radius: 70% 30% 70% 30%; transform: rotate(45deg); }
.poster-eye::before { content: ""; width: 76px; height: 76px; border-radius: 50%; background: var(--purple); border: 9px solid var(--ink); box-shadow: inset 0 0 0 16px var(--cream); }
.sticker { position: absolute; z-index: 4; display: grid; place-items: center; padding: .75rem 1rem; border: var(--line); box-shadow: 4px 4px 0 var(--ink); font-family: var(--font-display); text-align: center; text-transform: uppercase; }
.sticker--one { top: 2%; right: 0; width: 130px; height: 130px; background: var(--green); border-radius: 50%; transform: rotate(12deg); animation: float 4s ease-in-out infinite; }
.sticker--two { bottom: 5%; left: 0; background: var(--yellow); transform: rotate(-8deg); animation: float 5s -1.6s ease-in-out infinite; }
.resume-strip { margin-top: 1.4rem; max-width: 670px; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; padding: 1rem; color: var(--ink); background: var(--cream); border: var(--line); box-shadow: 5px 5px 0 var(--pink); }
.resume-strip p { margin: 0; flex: 1; }

/* Intro + profile */
.screen--intro { background: var(--yellow); }
.intro-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(2rem, 6vw, 7rem); align-items: center; }
.intro-number { position: relative; aspect-ratio: 1; display: grid; place-items: center; background: var(--purple); border: var(--line); box-shadow: var(--shadow); transform: rotate(-3deg); }
.intro-number span { font-family: var(--font-display); font-size: clamp(8rem, 20vw, 16rem); line-height: .7; color: var(--pink); -webkit-text-stroke: 5px var(--ink); }
.intro-number::after { content: "FIRST NIGHT"; position: absolute; right: -2rem; bottom: 2rem; padding: .55rem 1rem; color: var(--cream); background: var(--ink); font-weight: 900; letter-spacing: .14em; transform: rotate(7deg); }
.principle-list { display: grid; gap: .8rem; margin: 2rem 0; }
.principle { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem; background: rgba(245,239,229,.55); border-left: 8px solid var(--ink); }
.principle strong { font-family: var(--font-display); font-size: 1.35rem; line-height: 1; }

.screen--profile { background: var(--pink); }
.profile-card { width: min(760px, 100%); padding: clamp(1.4rem, 5vw, 4rem); background: var(--cream); border: var(--line); box-shadow: 14px 14px 0 var(--purple-dark); }
.profile-form { display: grid; gap: 1rem; margin-top: 2rem; }
.input-label { font-weight: 900; }
.text-input { min-height: 62px; width: 100%; padding: .85rem 1rem; color: var(--ink); background: var(--paper); border: 4px solid var(--ink); font-size: 1.2rem; font-weight: 700; }
.privacy-note { display: flex; gap: .7rem; align-items: flex-start; padding: 1rem; background: var(--yellow); border: 2px solid var(--ink); font-size: .9rem; }

/* Avatar selection */
.screen--avatars { background: var(--cream); }
.avatar-header { display: flex; justify-content: space-between; gap: 2rem; align-items: end; margin-bottom: 2rem; }
.avatar-header > div:first-child { max-width: 800px; }
.avatar-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.2rem; }
.avatar-card { position: relative; min-height: 100%; display: grid; grid-template-rows: auto 1fr; padding: 0; overflow: hidden; color: var(--ink); background: var(--paper); border: var(--line); text-align: left; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
.avatar-card:hover { transform: translateY(-5px) rotate(-.5deg); box-shadow: 7px 7px 0 var(--ink); }
.avatar-card[aria-checked="true"] { background: var(--yellow); box-shadow: 9px 9px 0 var(--pink); transform: translateY(-5px); }
.avatar-card[aria-checked="true"]::after { content: "Selected ✓"; position: absolute; top: .65rem; right: .65rem; padding: .35rem .55rem; color: var(--cream); background: var(--ink); font-size: .72rem; font-weight: 900; text-transform: uppercase; }
.avatar-portrait { aspect-ratio: 1.05; width: 100%; object-fit: cover; background: var(--pink); border-bottom: var(--line); }
.avatar-info { padding: 1rem; }
.avatar-info h3 { margin-bottom: .25rem; font-family: var(--font-display); font-size: 1.35rem; }
.avatar-info p { margin-bottom: .5rem; font-size: .88rem; }
.avatar-info small { color: var(--muted); font-weight: 700; }
.avatar-actions { position: sticky; bottom: 1rem; z-index: 5; margin-top: 2rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding: 1rem; background: rgba(245,239,229,.94); border: var(--line); box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.selection-status { display: flex; align-items: center; gap: .8rem; font-weight: 800; }
.selection-status img { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--ink); }

/* Tutorial */
.screen--tutorial { background: var(--orange); }
.tutorial-card { width: min(960px, 100%); display: grid; grid-template-columns: .8fr 1.2fr; background: var(--cream); border: var(--line); box-shadow: 14px 14px 0 var(--purple-dark); }
.tutorial-copy { padding: clamp(1.4rem, 4vw, 3rem); }
.tutorial-scene { position: relative; min-height: 500px; overflow: hidden; background: linear-gradient(#6c35d9 0 58%, #f1c645 58% 100%); border-left: var(--line); }
.tutorial-scene::before { content: ""; position: absolute; left: 8%; right: 8%; bottom: 12%; height: 110px; background: var(--pink); border: var(--line); border-radius: 35px; box-shadow: 7px 7px 0 var(--ink); }
.tutorial-table { position: absolute; left: 25%; right: 12%; bottom: 9%; height: 35px; background: var(--ink); }
.tutorial-phone { position: absolute; right: 18%; bottom: 18%; width: 78px; height: 120px; display: grid; place-items: center; color: var(--cream); background: var(--ink); border: 5px solid var(--cream); border-radius: 15px; box-shadow: 5px 5px 0 var(--pink); transform: rotate(9deg); cursor: pointer; animation: phone-nudge 2.2s ease-in-out infinite; }
.tutorial-phone::after { content: "!"; display: grid; place-items: center; width: 30px; height: 30px; color: var(--ink); background: var(--yellow); border-radius: 50%; font-weight: 900; }
.tutorial-result { margin-top: 1.5rem; padding: 1rem; background: var(--green); border: var(--line); }

/* Stage intro */
.screen--stage-intro { display: grid; align-items: center; color: var(--cream); background: var(--ink); overflow: hidden; }
.stage-intro-grid { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: clamp(2rem, 6vw, 7rem); }
.stage-poster-preview { position: relative; min-height: 570px; display: grid; place-items: center; }
.stage-poster-preview::before { content: ""; position: absolute; inset: 7% 0 0 8%; background: var(--pink); border: 4px solid var(--cream); transform: rotate(5deg); }
.stage-poster-preview::after { content: ""; position: absolute; inset: 0 8% 8% 0; z-index: -1; background: var(--yellow); border: 4px solid var(--cream); transform: rotate(-4deg); }
.stage-poster-preview img { position: relative; z-index: 2; width: 90%; height: 480px; object-fit: cover; border: 4px solid var(--cream); box-shadow: 14px 14px 0 var(--purple); }
.stage-facts { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.5rem 0 2rem; }
.fact-chip { padding: .55rem .8rem; color: var(--ink); background: var(--green); border: 2px solid var(--cream); font-weight: 800; }

/* Game stage */
.screen--game { padding: 0; background: #22182c; }
.game-hud { position: sticky; top: var(--topbar-height); z-index: 30; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; padding: .8rem clamp(.8rem, 2vw, 1.5rem); color: var(--cream); background: rgba(23,18,25,.96); border-bottom: 3px solid var(--cream); }
.stage-id { min-width: max-content; }
.stage-id strong { display: block; font-family: var(--font-display); font-size: 1rem; }
.stage-id small { color: var(--yellow); font-weight: 800; }
.progress-track { position: relative; height: 13px; overflow: hidden; background: #ffffff24; border: 2px solid var(--cream); }
.progress-track span { display: block; height: 100%; width: 0; background: var(--green); transition: width .3s ease; }
.hud-count { min-width: max-content; font-weight: 800; }
.scene-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; min-height: calc(100vh - var(--topbar-height) - 72px); }
.scene-column { position: relative; min-width: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.scene-instructions { position: absolute; z-index: 15; top: 1rem; left: 1rem; max-width: min(480px, calc(100% - 2rem)); padding: .75rem 1rem; color: var(--ink); background: rgba(245,239,229,.94); border: var(--line); box-shadow: 5px 5px 0 var(--ink); font-size: .88rem; }
.scene-instructions p { margin: 0; }
.scene-viewport {
  position: relative;
  min-height: 590px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  background: #171219;
  scrollbar-color: var(--pink) var(--ink);
}
.scene-canvas { position: relative; width: max(100%, 1100px); min-width: 1100px; aspect-ratio: 16 / 9; overflow: hidden; }
.scene-art { width: 100%; height: 100%; object-fit: cover; user-select: none; }
.player-in-scene { position: absolute; z-index: 4; left: 2%; bottom: 2%; width: 9.5%; min-width: 95px; max-height: 44%; object-fit: contain; filter: drop-shadow(0 12px 5px rgba(23,18,25,.35)); pointer-events: none; }
.hotspot { position: absolute; z-index: 6; padding: 0; border: 2px dashed transparent; background: rgba(245,239,229,.01); cursor: pointer; }
.hotspot::before { content: ""; position: absolute; inset: 10%; border: 3px solid var(--cream); border-radius: 50%; opacity: 0; box-shadow: 0 0 0 4px var(--ink), 0 0 0 8px var(--pink); transition: opacity .16s ease, transform .16s ease; transform: scale(.78); }
.hotspot:hover::before, .hotspot:focus-visible::before, .hotspot.is-hinted::before { opacity: .92; transform: scale(1); }
.hotspot.is-found::after { content: "✓"; position: absolute; top: 0; right: 0; width: 34px; height: 34px; display: grid; place-items: center; color: var(--ink); background: var(--green); border: 3px solid var(--ink); border-radius: 50%; font-weight: 900; }
.hotspot-label { position: absolute; left: 50%; bottom: -12px; min-width: max-content; max-width: 180px; padding: .35rem .55rem; color: var(--cream); background: var(--ink); border: 2px solid var(--cream); font-size: .72rem; font-weight: 800; opacity: 0; transform: translate(-50%, 8px); pointer-events: none; }
.hotspot.is-found .hotspot-label, .hotspot:focus-visible .hotspot-label { opacity: 1; transform: translate(-50%, 0); }
.scene-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .7rem; padding: .8rem; color: var(--cream); background: var(--ink); border-top: 3px solid var(--cream); }
.scene-toolbar-group { display: flex; flex-wrap: wrap; gap: .6rem; }
.scene-tool { min-height: 44px; padding: .55rem .8rem; color: var(--cream); background: transparent; border: 2px solid var(--cream); cursor: pointer; font-weight: 800; }
.scene-tool:hover { color: var(--ink); background: var(--yellow); }
.score-panel { padding: 1.2rem; color: var(--ink); background: var(--yellow); border-left: 3px solid var(--cream); }
.score-panel h2 { font-family: var(--font-display); font-size: 1.5rem; }
.player-chip { display: grid; grid-template-columns: 70px 1fr; gap: .8rem; align-items: center; margin-bottom: 1.3rem; padding: .8rem; background: var(--cream); border: var(--line); }
.player-chip img { width: 70px; height: 70px; object-fit: cover; border: 2px solid var(--ink); }
.player-chip strong { display: block; font-family: var(--font-display); font-size: 1rem; }
.player-chip small { display: block; }
.skill-list { display: grid; gap: .95rem; }
.skill-row { display: grid; grid-template-columns: 1fr auto; gap: .35rem; }
.skill-row strong { font-size: .82rem; }
.skill-row output { font-weight: 900; }
.skill-bar { grid-column: 1 / -1; height: 12px; overflow: hidden; background: rgba(23,18,25,.2); border: 2px solid var(--ink); }
.skill-bar span { display: block; height: 100%; width: 0; background: var(--pink); transition: width .3s ease; }
.stage-action-card { margin-top: 1.4rem; padding: 1rem; background: var(--cream); border: var(--line); }
.stage-action-card p { font-size: .88rem; }
.stage-action-card .button { width: 100%; }
.text-scene { min-height: 590px; padding: clamp(1rem, 3vw, 2.5rem); color: var(--ink); background: var(--cream); }
.text-scene-list { display: grid; gap: .85rem; margin-top: 1.5rem; }
.text-hotspot { width: 100%; min-height: 64px; display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 1rem; background: var(--paper); border: var(--line); text-align: left; cursor: pointer; }
.text-hotspot.is-found { background: #e5f8ca; }
.text-hotspot span:last-child { font-weight: 900; }

/* Dialogs */
dialog { max-width: none; max-height: none; padding: 0; border: 0; background: transparent; }
dialog::backdrop { background: rgba(23,18,25,.78); backdrop-filter: blur(6px); }
.game-dialog { width: min(680px, calc(100% - 1.2rem)); }
.game-dialog--wide { width: min(1050px, calc(100% - 1.2rem)); }
.game-dialog--decision { width: min(800px, calc(100% - 1rem)); }
.dialog-poster, .decision-card { position: relative; max-height: min(88vh, 900px); overflow: auto; padding: clamp(1.3rem, 4vw, 3rem); border: 4px solid var(--ink); box-shadow: 12px 12px 0 var(--ink); }
.dialog-poster--yellow { background: var(--yellow); }
.dialog-poster--cream { background: var(--cream); }
.dialog-poster--purple { color: var(--cream); background: var(--purple-dark); border-color: var(--cream); box-shadow: 12px 12px 0 var(--pink); }
.dialog-close { position: relative; z-index: 4; float: right; width: 44px; height: 44px; display: grid; place-items: center; margin: -.35rem -.35rem .85rem 1rem; padding: 0; color: var(--ink); background: var(--cream); border: var(--line); border-radius: 50%; cursor: pointer; font-size: 1.7rem; line-height: 1; font-weight: 900; }
.dialog-close--light { border-color: var(--cream); }

/* Keep popup titles clear of the 44px close control at every viewport size. */
.dialog-poster > h2,
.decision-card > h2 {
  overflow-wrap: anywhere;
}

.dialog-lead { font-size: 1.12rem; }
.numbered-list { display: grid; gap: 1rem; padding: 0; list-style: none; }
.numbered-list li { display: grid; grid-template-columns: 58px 1fr; gap: 1rem; align-items: start; }
.numbered-list li > span { display: grid; place-items: center; width: 58px; height: 58px; color: var(--cream); background: var(--ink); border-radius: 50%; font-family: var(--font-display); }
.numbered-list p { margin: .25rem 0 0; }
.keyboard-note { padding: .8rem; background: rgba(245,239,229,.55); border-left: 7px solid var(--ink); }
.setting-list { display: grid; gap: .7rem; margin: 1.5rem 0 2rem; }
.switch-row { position: relative; min-height: 76px; display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; padding: .8rem 1rem; background: var(--paper); border: 2px solid var(--ink); cursor: pointer; }
.switch-row > span:first-child { display: grid; }
.switch-row small { color: var(--muted); }
.switch-row input { position: absolute; opacity: 0; }
.switch { position: relative; width: 58px; height: 32px; background: #c8c2ba; border: 3px solid var(--ink); border-radius: 99px; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: var(--ink); border-radius: 50%; transition: transform .18s ease; }
.switch-row input:checked + .switch { background: var(--green); }
.switch-row input:checked + .switch::after { transform: translateX(26px); }
.switch-row:has(input:focus-visible) { outline: var(--focus); outline-offset: 3px; }
.support-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; margin: 1.5rem 0; }
.support-card { padding: 1rem; color: var(--ink); background: var(--cream); border: 3px solid var(--ink); }
.support-card--pending { background: #d8d1e3; }
.support-card h3 { margin-bottom: .5rem; font-family: var(--font-display); font-size: 1rem; }
.support-card p { font-size: .88rem; }
.support-card a { color: inherit; font-weight: 900; }
.pending-label { display: inline-block; padding: .3rem .45rem; background: var(--yellow); border: 2px solid var(--ink); font-size: .72rem; font-weight: 900; text-transform: uppercase; }
.disclaimer { padding: 1rem; border: 2px solid var(--cream); font-size: .82rem; }
.decision-card { overflow: visible; padding-top: 4rem; background: var(--cream); }
.decision-avatar { position: absolute; top: -52px; left: clamp(1rem, 5vw, 3rem); width: 100px; height: 100px; overflow: hidden; background: var(--yellow); border: var(--line); border-radius: 50%; box-shadow: 6px 6px 0 var(--pink); }
.decision-avatar img { width: 100%; height: 100%; object-fit: cover; }
.decision-context { padding: .8rem 1rem; background: var(--yellow); border-left: 7px solid var(--ink); }
.decision-options { display: grid; gap: .7rem; margin-top: 1.4rem; }
.decision-option { min-height: 62px; display: grid; grid-template-columns: 38px 1fr; gap: .8rem; align-items: center; padding: .8rem; background: var(--paper); border: 3px solid var(--ink); text-align: left; cursor: pointer; font-weight: 700; }
.decision-option:hover { background: var(--yellow); }
.option-letter { width: 36px; height: 36px; display: grid; place-items: center; color: var(--cream); background: var(--ink); border-radius: 50%; font-family: var(--font-display); }
.decision-option[disabled] { opacity: .55; cursor: default; }
.decision-option.is-selected { opacity: 1; background: var(--yellow); box-shadow: 5px 5px 0 var(--ink); }
.decision-feedback { margin-top: 1.5rem; padding: 1.2rem; background: var(--green); border: var(--line); }
.decision-feedback h3 { font-family: var(--font-display); font-size: 1.4rem; }
.feedback-score { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1rem 0; }
.feedback-score span { padding: .3rem .5rem; background: var(--cream); border: 2px solid var(--ink); font-size: .75rem; font-weight: 900; }
.discovery-dialog-card { text-align: center; }
.discovery-icon { width: 85px; height: 85px; display: grid; place-items: center; margin: 0 auto 1rem; color: var(--cream); background: var(--purple); border: var(--line); border-radius: 50%; box-shadow: 5px 5px 0 var(--pink); font-size: 2.2rem; }

/* Summary and roadmap */
.screen--summary { color: var(--cream); background: var(--purple-dark); }
.summary-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.result-card { position: sticky; top: 110px; padding: 1.3rem; color: var(--ink); background: var(--yellow); border: 4px solid var(--cream); box-shadow: 13px 13px 0 var(--pink); }
.result-card-avatar { height: 270px; display: grid; place-items: end center; overflow: hidden; background: var(--pink); border: var(--line); }
.result-card-avatar img { max-height: 94%; }
.result-rank { display: inline-block; margin: 1rem 0 .5rem; padding: .35rem .55rem; color: var(--cream); background: var(--ink); font-weight: 900; text-transform: uppercase; }
.result-card h2 { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.5rem); line-height: .95; }
.summary-panel { display: grid; gap: 1rem; }
.summary-block { padding: 1.2rem; color: var(--ink); background: var(--cream); border: var(--line); }
.summary-block h3 { font-family: var(--font-display); }
.summary-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: .7rem; }
.stat { padding: .85rem; text-align: center; background: var(--yellow); border: 2px solid var(--ink); }
.stat strong { display: block; font-family: var(--font-display); font-size: 1.8rem; }
.achievement-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .7rem; }
.achievement-card { display: grid; grid-template-columns: 52px 1fr; gap: .75rem; align-items: center; padding: .8rem; background: var(--paper); border: 2px solid var(--ink); }
.achievement-icon { width: 52px; height: 52px; display: grid; place-items: center; color: var(--cream); background: var(--purple); border: 2px solid var(--ink); border-radius: 50%; font-size: 1.4rem; }
.achievement-card h4 { margin: 0; font-size: .95rem; }
.achievement-card p { margin: .2rem 0 0; font-size: .78rem; }
.missed-list { margin: 0; padding-left: 1.2rem; }
.missed-list li + li { margin-top: .45rem; }
.roadmap { margin-top: 3rem; }
.stage-preview-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1rem; }
.stage-preview { position: relative; min-height: 280px; padding: 1rem; overflow: hidden; color: var(--ink); background: var(--cream); border: var(--line); }
.stage-preview::before { content: attr(data-stage); position: absolute; right: -.1em; bottom: -.25em; color: rgba(23,18,25,.07); font-family: var(--font-display); font-size: 9rem; line-height: 1; }
.stage-preview h3 { position: relative; font-family: var(--font-display); font-size: 1.6rem; }
.locked-chip { position: relative; display: inline-block; padding: .35rem .5rem; color: var(--cream); background: var(--ink); font-size: .72rem; font-weight: 900; text-transform: uppercase; }

.toast-region { position: fixed; z-index: 1000; right: 1rem; bottom: 1rem; width: min(390px, calc(100% - 2rem)); display: grid; gap: .7rem; pointer-events: none; }
.toast { display: grid; grid-template-columns: 58px 1fr; gap: .8rem; align-items: center; padding: .85rem; color: var(--ink); background: var(--green); border: var(--line); box-shadow: 7px 7px 0 var(--ink); animation: toast-in .35s ease both; }
.toast-icon { width: 58px; height: 58px; display: grid; place-items: center; color: var(--cream); background: var(--purple); border: 2px solid var(--ink); border-radius: 50%; font-size: 1.5rem; }
.toast strong { display: block; font-family: var(--font-display); font-size: .95rem; }
.toast p { margin: .15rem 0 0; font-size: .78rem; }

.site-footer { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 1rem clamp(1rem,5vw,5rem); color: var(--cream); background: var(--ink); border-top: 3px solid var(--cream); font-size: .82rem; }
.site-footer p { margin: 0; }
.site-footer .text-button { color: var(--cream); }

@keyframes rain-slide { to { background-position: 180px 120px; } }
@keyframes slow-spin { to { transform: rotate(360deg); } }
@keyframes float { 50% { transform: translateY(-12px) rotate(8deg); } }
@keyframes phone-nudge { 50% { transform: translateY(-10px) rotate(4deg); box-shadow: 9px 9px 0 var(--pink); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px); } }

/* User preferences */
body.pref-large-text { font-size: 19px; }
body.pref-high-contrast { --cream: #fff; --paper: #fff; --pink: #ffdf00; --orange: #ffdf00; --yellow: #ffdf00; --purple: #000; --purple-dark: #000; --green: #ffdf00; --cyan: #fff; --muted: #222; }
body.pref-high-contrast .scene-art { filter: contrast(1.2) saturate(.55); }
body.pref-reduced-motion *,
body.pref-reduced-motion *::before,
body.pref-reduced-motion *::after { scroll-behavior: auto !important; animation: none !important; transition-duration: .01ms !important; }

@media (max-width: 1100px) {
  .screen--game, .scene-layout, .scene-column { min-height: 0; overflow: visible; }
  .control-label { display: none; }
  .avatar-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scene-layout { grid-template-columns: minmax(0,1fr); }
  .score-panel { display: grid; grid-template-columns: 220px 1fr 240px; gap: 1rem; align-items: start; border-left: 0; border-top: 3px solid var(--cream); }
  .player-chip { margin: 0; }
  .stage-action-card { margin: 0; }
  .scene-viewport, .text-scene { min-height: 620px; }
  .stage-preview-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 800px) {
  :root { --topbar-height: 67px; }
  .topbar { min-height: var(--topbar-height); }
  .brand-copy small { display: none; }
  .help-button { padding: .45rem .7rem; }
  .home-grid, .intro-grid, .tutorial-card, .stage-intro-grid, .summary-grid { grid-template-columns: 1fr; }
  .home-poster { min-height: 400px; }
  .poster-eye { width: 190px; height: 120px; }
  .intro-number { max-width: 400px; }
  .avatar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .avatar-header { display: block; }
  .tutorial-scene { min-height: 380px; border-left: 0; border-top: var(--line); }
  .stage-poster-preview { min-height: 390px; order: -1; }
  .stage-poster-preview img { height: 340px; }
  .game-hud { top: var(--topbar-height); grid-template-columns: 1fr auto; }
  .game-hud .progress-track { grid-column: 1 / -1; grid-row: 2; }
  .scene-instructions { position: static; max-width: none; box-shadow: none; border: 0; border-bottom: var(--line); }
  .scene-viewport, .text-scene { min-height: 535px; }
  .score-panel { grid-template-columns: 1fr; }
  .player-chip { display: none; }
  .skill-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .stage-action-card { grid-column: 1 / -1; }
  .result-card { position: static; }
  .support-grid, .achievement-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .brand-copy strong { font-size: .82rem; }
  .brand-eye { width: 34px; height: 23px; }
  .topbar-actions { gap: .1rem; }
  .icon-button { padding: .4rem; }
  .help-button span { display: none; }
  .screen { padding-inline: .85rem; }
  .display-title { font-size: clamp(3rem, 18vw, 5rem); }
  .home-poster { min-height: 350px; }
  .poster-card--big { inset: 6% 3% 8% 4%; }
  .sticker--one { width: 100px; height: 100px; font-size: .75rem; }
  .avatar-grid { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .avatar-info { padding: .7rem; }
  .avatar-info h3 { font-size: 1rem; }
  .avatar-info p { font-size: .76rem; }
  .avatar-info small { font-size: .68rem; }
  .avatar-card[aria-checked="true"]::after { top: .3rem; right: .3rem; font-size: .57rem; }
  .avatar-actions { bottom: .5rem; padding: .7rem; }
  .selection-status { width: 100%; }
  .avatar-actions .button-row { width: 100%; }
  .avatar-actions .button { flex: 1; padding-inline: .6rem; }
  .scene-canvas { min-width: 970px; }
  .scene-viewport, .text-scene { min-height: 470px; }
  .scene-toolbar { display: grid; }
  .scene-toolbar-group { display: grid; grid-template-columns: repeat(2,1fr); }
  .scene-tool { font-size: .78rem; }
  .summary-stats { grid-template-columns: 1fr; }
  .stage-preview-grid { grid-template-columns: 1fr; }
  .site-footer { display: grid; text-align: center; }
  .decision-card { padding: 3.5rem .8rem 1rem; }
  .decision-avatar { width: 82px; height: 82px; top: -36px; }
  .decision-option { grid-template-columns: 34px 1fr; font-size: .9rem; }
}

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

/* --------------------------------------------------------------------------
   Good Night Out poster system — original game interpretation
   -------------------------------------------------------------------------- */
:root {
  --ink: #111111;
  --cream: #f4f1e8;
  --paper: #f8f4ea;
  --pink: #d65b9d;
  --orange: #f06a00;
  --yellow: #f3b900;
  --purple: #5a205f;
  --purple-dark: #401747;
  --green: #a9b51d;
  --cyan: #0169aa;
  --blue: #0169aa;
  --line: 4px solid var(--ink);
  --shadow: 10px 10px 0 var(--ink);
  --focus: 4px solid var(--yellow);
}

body {
  background: var(--ink);
  background-image: linear-gradient(105deg, rgba(255,255,255,.025) 49%, rgba(0,0,0,.035) 50%, transparent 51%);
  background-size: 210px 100%;
}

.game-shell { background: var(--cream); }
.topbar { background: #111; border-bottom-color: var(--cream); }
.brand-eye { background: var(--pink); border: 3px solid var(--cream); border-radius: 50%; transform: none; }
.brand-eye::before, .brand-eye::after { content: ""; position: absolute; top: 6px; width: 7px; height: 11px; border-radius: 50%; background: var(--ink); }
.brand-eye::before { left: 9px; }
.brand-eye::after { right: 9px; }
.brand-eye span { position: absolute; bottom: 5px; width: 18px; height: 8px; background: transparent; border: 0; border-bottom: 3px solid var(--ink); border-radius: 50%; box-shadow: none; }
.brand-copy small { color: var(--yellow); }
.help-button { color: var(--ink); background: var(--green); border-color: var(--cream); }
.help-button:hover { background: var(--yellow); }

.screen::after,
.dialog-poster::after,
.decision-card::after,
.summary-block::after,
.profile-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .13;
  mix-blend-mode: multiply;
  background:
    linear-gradient(103deg, transparent 0 46%, rgba(0,0,0,.14) 49%, rgba(255,255,255,.15) 51%, transparent 55%),
    linear-gradient(7deg, transparent 0 66%, rgba(0,0,0,.11) 69%, rgba(255,255,255,.1) 71%, transparent 75%);
  background-size: 100% 100%;
}
.screen > *, .dialog-poster > *, .decision-card > *, .summary-block > *, .profile-card > * { position: relative; z-index: 1; }
.summary-block, .profile-card { position: relative; overflow: hidden; }

.campaign-stamp {
  display: inline-block;
  margin-bottom: 1.2rem;
  padding: .55rem .8rem .45rem;
  color: var(--ink);
  background: var(--pink);
  border: 5px solid var(--cream);
  outline: 4px solid var(--ink);
  border-radius: 13px;
  box-shadow: 5px 5px 0 rgba(0,0,0,.35);
  font-family: var(--font-display);
  font-size: .95rem;
  line-height: 1;
  text-transform: uppercase;
  transform: rotate(-3deg);
}
.campaign-stamp--small { margin-bottom: .8rem; font-size: .72rem; border-width: 3px; outline-width: 2px; }

.screen--home {
  background: var(--blue);
  background-image:
    radial-gradient(circle at 78% 18%, var(--pink) 0 4px, transparent 5px),
    radial-gradient(circle at 78% 18%, var(--pink) 0 8px, transparent 9px),
    linear-gradient(105deg, transparent 0 49%, rgba(0,0,0,.08) 50%, transparent 52%);
  background-size: 28px 28px, 56px 56px, 100% 100%;
}
.screen--home::before {
  background:
    radial-gradient(circle at 10% 90%, rgba(214,91,157,.9), transparent 22%),
    radial-gradient(circle at 85% 12%, rgba(169,181,29,.9), transparent 25%),
    linear-gradient(160deg, transparent 0 57%, rgba(90,32,95,.75) 58% 100%);
}
.home-copy .lead { color: var(--cream); font-weight: 700; }
.display-title { font-size: clamp(3.5rem, 10vw, 9rem); text-shadow: 0 8px 0 rgba(0,0,0,.15); }
.display-title span { color: var(--cream); -webkit-text-stroke: 0; text-shadow: none; }
.home-poster { min-height: 600px; }
.poster-card--big {
  background: var(--green);
  border: 10px solid var(--cream);
  outline: 6px solid var(--ink);
  box-shadow: 16px 16px 0 rgba(0,0,0,.35);
  transform: rotate(4deg);
}
.poster-card--big::before {
  inset: -5%;
  background:
    radial-gradient(circle at 25% 24%, var(--pink) 0 5px, transparent 6px),
    radial-gradient(circle at 25% 24%, var(--pink) 0 10px, transparent 11px),
    linear-gradient(35deg, var(--green) 0 48%, #97a313 49% 51%, var(--green) 52%);
  background-size: 34px 34px, 72px 72px, 100% 100%;
  opacity: .85;
  animation: none;
}
.poster-card--big::after { content: "GOOD NIGHT OUT ★"; background: var(--purple); color: var(--cream); border-top: 6px solid var(--cream); }
.poster-smiley { position: relative; z-index: 2; width: 255px; aspect-ratio: 1; border-radius: 50%; background: var(--pink); border: 9px solid var(--cream); outline: 7px solid var(--ink); }
.poster-smiley span { position: absolute; top: 28%; width: 30px; height: 68px; border-radius: 50%; background: var(--ink); }
.poster-smiley span:first-child { left: 25%; transform: rotate(-8deg); }
.poster-smiley span:nth-child(2) { right: 25%; transform: rotate(8deg); }
.poster-smiley i { position: absolute; left: 24%; right: 24%; bottom: 22%; height: 56px; border-bottom: 10px solid var(--ink); border-radius: 50%; }
.sticker--one { background: var(--orange); color: var(--ink); border-radius: 50%; border: 8px solid var(--cream); outline: 5px solid var(--ink); }
.sticker--two { color: var(--ink); background: var(--yellow); border: 6px solid var(--cream); outline: 4px solid var(--ink); }
.sticker-eye { position: absolute; right: -5%; bottom: 10%; z-index: 5; display: flex; transform: rotate(9deg); }
.sticker-eye span { width: 90px; height: 125px; border-radius: 50%; background: var(--cream); border: 7px solid var(--ink); box-shadow: 0 0 0 5px var(--cream); }
.sticker-eye span::after { content: ""; display: block; width: 38px; height: 68px; margin: 26px auto 0; border-radius: 50%; background: var(--ink); }
.resume-strip { background: var(--cream); box-shadow: 8px 8px 0 var(--purple); }

.screen--intro { background: var(--green); }
.intro-number { background: var(--purple); border: 8px solid var(--cream); outline: 5px solid var(--ink); }
.intro-number span { color: var(--cream); -webkit-text-stroke: 0; }
.intro-number small { position: absolute; bottom: 12%; font-family: var(--font-display); font-size: 1rem; text-transform: uppercase; color: var(--yellow); }
.intro-number::after { content: "THE FULL NIGHT"; background: var(--pink); color: var(--ink); }
.principle { background: rgba(244,241,232,.82); border-left-width: 10px; }
.screen--profile { background: var(--purple); }
.profile-card { background: var(--cream); box-shadow: 16px 16px 0 var(--green); }
.privacy-note { background: var(--green); }

.screen--avatars {
  background: var(--cream);
  background-image: radial-gradient(circle, rgba(214,91,157,.28) 0 3px, transparent 4px);
  background-size: 25px 25px;
}
.avatar-card { background: var(--cream); border-width: 5px; }
.avatar-card:nth-child(4n+1) .avatar-portrait { background: var(--blue); }
.avatar-card:nth-child(4n+2) .avatar-portrait { background: var(--pink); }
.avatar-card:nth-child(4n+3) .avatar-portrait { background: var(--green); }
.avatar-card:nth-child(4n) .avatar-portrait { background: var(--orange); }
.avatar-card[aria-checked="true"] { background: var(--yellow); box-shadow: 10px 10px 0 var(--purple); }
.avatar-actions { background: rgba(244,241,232,.96); }

.screen--tutorial { background: var(--orange); }
.tutorial-card { box-shadow: 16px 16px 0 var(--purple); }
.tutorial-scene { background: linear-gradient(var(--blue) 0 58%, var(--green) 58% 100%); }
.tutorial-result { background: var(--yellow); }

.stage-theme { color: var(--cream); background: var(--purple); }
.stage-theme--halls { background: var(--purple); }
.stage-theme--journey { background: var(--blue); }
.stage-theme--queue { background: var(--green); color: var(--ink); }
.stage-theme--night-out { background: #071c43; }
.stage-theme--journey-home { background: var(--purple); }
.stage-theme--queue .text-button--light { color: var(--ink); }
.text-button--light { color: var(--cream); }
.stage-poster-preview::before { background: var(--pink); border-width: 7px; }
.stage-poster-preview::after { background: var(--green); border-width: 7px; }
.stage-poster-preview img { border: 8px solid var(--cream); outline: 5px solid var(--ink); box-shadow: 15px 15px 0 rgba(0,0,0,.4); }
.stage-number-sticker { position: absolute; z-index: 4; right: 2%; bottom: 6%; width: 92px; height: 92px; display: grid; place-items: center; color: var(--ink); background: var(--yellow); border: 7px solid var(--cream); outline: 5px solid var(--ink); border-radius: 50%; font-family: var(--font-display); font-size: 2.3rem; transform: rotate(8deg); }
.fact-chip { background: var(--yellow); border-width: 3px; }

.screen--game { background: #111; }
.game-hud { background: var(--purple); }
.progress-track span { background: var(--yellow); }
.scene-viewport { background: var(--ink); }
.scene-art { filter: saturate(1.03) contrast(1.01); }
.hotspot::before { border-width: 5px; box-shadow: 0 0 0 5px var(--ink), 0 0 0 10px var(--yellow); }
.hotspot.is-found::after { background: var(--green); border-width: 4px; }
.hotspot-label { border-width: 3px; }
.score-panel { background: var(--green); }
.stage-game-theme--journey .score-panel { background: var(--blue); color: var(--cream); }
.stage-game-theme--journey .skill-bar { border-color: var(--cream); }
.stage-game-theme--journey .skill-row strong { color: var(--cream); }
.stage-game-theme--journey .stage-action-card, .stage-game-theme--journey .player-chip { color: var(--ink); }
.stage-game-theme--queue .score-panel { background: var(--yellow); }
.stage-game-theme--night-out .score-panel { background: var(--pink); }
.stage-game-theme--journey-home .score-panel { background: var(--green); }
.skill-bar span { background: var(--purple); }
.scene-tool:hover { background: var(--green); }

.dialog-poster, .decision-card { border-width: 7px; }
.dialog-poster--purple { background: var(--blue); box-shadow: 14px 14px 0 var(--pink); }
.decision-card { background: var(--cream); }
.decision-avatar { background: var(--pink); box-shadow: 7px 7px 0 var(--green); }
.decision-context { background: var(--green); }
.decision-option { border-width: 4px; }
.decision-option:hover { background: var(--yellow); }
.decision-feedback { background: var(--green); }
.discovery-icon { background: var(--blue); box-shadow: 6px 6px 0 var(--pink); }

.screen--summary { background: var(--blue); }
.stage-summary-theme--halls { background: var(--purple); }
.stage-summary-theme--journey { background: var(--blue); }
.stage-summary-theme--queue { background: var(--green); color: var(--ink); }
.stage-summary-theme--night-out { background: #071c43; }
.stage-summary-theme--journey-home { background: var(--purple); }
.result-card { background: var(--green); border-width: 8px; outline: 5px solid var(--ink); box-shadow: 15px 15px 0 var(--pink); }
.result-card-avatar { background: var(--pink); }
.result-rank { background: var(--purple); }
.summary-block { border-width: 5px; }
.stat { background: var(--yellow); border-width: 3px; }
.achievement-icon { background: var(--blue); }

.roadmap { padding-top: 2rem; border-top: 5px solid currentColor; }
.stage-preview-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stage-preview {
  appearance: none;
  width: 100%;
  min-height: 290px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .75rem;
  color: var(--ink);
  background: var(--cream);
  border: 5px solid var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 7px 7px 0 rgba(0,0,0,.35);
  transition: transform .16s ease, box-shadow .16s ease;
}
.stage-preview:hover:not(:disabled) { transform: translateY(-5px) rotate(-.5deg); box-shadow: 10px 12px 0 var(--ink); }
.stage-preview:disabled { opacity: .55; cursor: not-allowed; filter: grayscale(.5); }
.stage-preview::before { display: none; }
.stage-preview:nth-child(1) { background: var(--purple); color: var(--cream); }
.stage-preview:nth-child(2) { background: var(--blue); color: var(--cream); }
.stage-preview:nth-child(3) { background: var(--green); }
.stage-preview:nth-child(4) { background: #071c43; color: var(--cream); }
.stage-preview:nth-child(5) { background: var(--orange); }
.stage-preview.is-complete { outline: 5px solid var(--yellow); }
.stage-preview.is-current { box-shadow: 10px 10px 0 var(--pink); }
.stage-preview-number { margin-top: auto; font-family: var(--font-display); font-size: 4.5rem; line-height: .8; opacity: .24; }
.stage-preview h3 { margin: 0; font-size: 1.45rem; }
.stage-preview p { font-size: .88rem; }
.stage-preview small { font-weight: 900; }
.locked-chip { background: var(--ink); color: var(--cream); border: 2px solid currentColor; }

.screen--final {
  color: var(--cream);
  background: var(--blue);
  background-image:
    radial-gradient(circle at 85% 15%, var(--pink) 0 4px, transparent 5px),
    linear-gradient(150deg, transparent 0 55%, var(--purple) 56% 100%);
  background-size: 28px 28px, 100% 100%;
}
.final-grid { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); gap: clamp(2rem,5vw,5rem); align-items: start; }
.final-poster { position: sticky; top: 110px; padding: clamp(1.2rem,3vw,2rem); color: var(--ink); background: var(--green); border: 9px solid var(--cream); outline: 6px solid var(--ink); box-shadow: 18px 18px 0 var(--pink); transform: rotate(-1deg); }
.final-poster h1 { margin: .5rem 0; font-family: var(--font-display); font-size: clamp(3rem,7vw,6rem); line-height: .85; text-transform: uppercase; }
.final-poster img { width: 100%; height: 330px; object-fit: contain; background: var(--pink); border: 5px solid var(--ink); }
.final-poster h2 { margin: 1rem 0 .4rem; font-family: var(--font-display); font-size: 1.5rem; }
.final-score { display: inline-block; padding: .55rem .8rem; background: var(--yellow); border: 3px solid var(--ink); font-weight: 900; }
.final-content { display: grid; gap: 1rem; }
.final-content .summary-block { color: var(--ink); }
.final-confetti { position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(circle, var(--yellow) 0 4px, transparent 5px), radial-gradient(circle, var(--pink) 0 5px, transparent 6px); background-position: 0 0, 17px 22px; background-size: 74px 74px, 96px 96px; opacity: .2; }
.roadmap--final { color: var(--cream); margin-top: 5rem; }

.paper-crease { position: absolute; z-index: -1; width: 70%; height: 35%; pointer-events: none; opacity: .14; filter: blur(1px); }
.paper-crease--one { left: -10%; top: 30%; background: linear-gradient(12deg, transparent 47%, #000 49%, #fff 50%, transparent 53%); }
.paper-crease--two { right: -10%; bottom: 5%; background: linear-gradient(-8deg, transparent 47%, #000 49%, #fff 50%, transparent 53%); }

@media (max-width: 1200px) {
  .stage-preview-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .final-grid { grid-template-columns: 1fr; }
  .final-poster { position: static; transform: none; }
  .stage-preview-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 800px) {
  .poster-smiley { width: 190px; }
  .sticker-eye span { width: 62px; height: 88px; }
  .sticker-eye span::after { width: 25px; height: 45px; margin-top: 20px; }
  .stage-number-sticker { width: 72px; height: 72px; font-size: 1.8rem; }
}
@media (max-width: 560px) {
  .campaign-stamp { font-size: .72rem; }
  .home-poster { min-height: 390px; }
  .poster-smiley { width: 155px; }
  .sticker-eye { right: -10%; bottom: 4%; }
  .stage-preview-grid { grid-template-columns: 1fr; }
  .stage-preview { min-height: 230px; }
  .final-poster img { height: 260px; }
}

/* Preserve the stacked HUD beneath the sticky global controls. */
.screen--game > .game-hud {
  position: sticky;
  top: var(--topbar-height);
  z-index: 30;
}


/* --------------------------------------------------------------------------
   Gameplay scrolling and transform-safety patch
   -------------------------------------------------------------------------- */
html,
body {
  min-height: 100%;
  overflow-y: auto;
}

.game-shell,
.screen--game,
.scene-layout,
.scene-column {
  overflow-y: visible;
}

.scene-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

@media (max-width: 1100px) {
  .screen--game,
  .scene-layout,
  .scene-column {
    min-height: 0;
  }
}

/* ==========================================================================\n   Ready to Roll — Halls bonus mini-game\n   ========================================================================== */
.screen--mini-game {
  min-height: auto;
  color: var(--cream);
  background:
    radial-gradient(circle at 8% 16%, var(--pink) 0 4px, transparent 5px) 0 0 / 24px 24px,
    linear-gradient(135deg, transparent 0 46%, rgba(255, 255, 255, .07) 47% 49%, transparent 50% 100%),
    var(--blue, #0169aa);
  overflow: hidden;
}

.mini-game-wrap { position: relative; z-index: 2; }

.mini-game-backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: grid;
  align-content: space-around;
  justify-items: end;
  overflow: hidden;
  pointer-events: none;
  opacity: .08;
}

.mini-game-backdrop span {
  margin-right: -2vw;
  font-family: var(--font-display);
  font-size: clamp(7rem, 22vw, 20rem);
  line-height: .68;
  color: var(--cream);
  text-transform: uppercase;
}

.mini-game-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

.mini-game-header .lead { max-width: 780px; }

.tram-due-card {
  width: min(230px, 100%);
  padding: 1rem 1.15rem;
  color: var(--ink);
  background: var(--lime, #a9b51d);
  border: 5px solid var(--ink);
  box-shadow: 9px 9px 0 var(--pink);
  text-align: center;
  transform: rotate(2deg);
}

.tram-due-card span,
.tram-due-card small { display: block; font-weight: 900; text-transform: uppercase; }
.tram-due-card strong { display: block; font-family: var(--font-display); font-size: 2.2rem; line-height: 1; }
.tram-due-card small { margin-top: .55rem; font-size: .7rem; }

.mini-game-progress {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1.5rem;
  border: 4px solid var(--ink);
  background: var(--ink);
  gap: 4px;
}

.mini-game-progress span {
  padding: .85rem 1rem;
  color: var(--ink);
  background: var(--cream);
  font-weight: 900;
  text-transform: uppercase;
  opacity: .65;
}

.mini-game-progress span.is-active { background: var(--yellow); opacity: 1; }

.packing-game,
.plan-game,
.ready-complete {
  color: var(--ink);
  background: var(--cream);
  border: 5px solid var(--ink);
  box-shadow: 12px 12px 0 var(--purple-dark);
}

.packing-game { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); }
.pack-tray { padding: clamp(1.2rem, 3vw, 2.2rem); border-right: 5px solid var(--ink); }
.pack-zones { display: grid; grid-template-rows: repeat(3, minmax(150px, auto)); }

.mini-section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.mini-section-heading h2,
.ready-complete h2 {
  margin-bottom: .5rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: .95;
}

.mini-count {
  flex: 0 0 auto;
  padding: .45rem .65rem;
  background: var(--yellow);
  border: 3px solid var(--ink);
  font-weight: 900;
}

.pack-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; margin-top: 1.4rem; }

.pack-item {
  min-height: 96px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: .8rem;
  align-items: center;
  padding: .8rem;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  text-align: left;
  cursor: grab;
  box-shadow: 4px 4px 0 var(--ink);
}

.pack-item:hover,
.pack-item.is-selected { background: var(--yellow); transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--pink); }
.pack-item.is-selected::after { content: "Selected"; justify-self: start; grid-column: 2; padding: .2rem .4rem; color: var(--cream); background: var(--ink); font-size: .7rem; font-weight: 900; text-transform: uppercase; }
.pack-item.is-dragging { opacity: .5; cursor: grabbing; }
.pack-item-icon { width: 46px; height: 46px; display: grid; place-items: center; background: var(--pink); border: 3px solid var(--ink); border-radius: 50%; font-family: var(--font-display); font-size: 1.4rem; }
.pack-item strong,
.pack-item small { display: block; }
.pack-item small { margin-top: .25rem; color: var(--muted); line-height: 1.3; }
.pack-empty { padding: 1.2rem; background: var(--green); border: 3px solid var(--ink); }

.pack-zone {
  width: 100%;
  min-height: 150px;
  display: grid;
  align-content: start;
  gap: .8rem;
  padding: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 0;
  border-bottom: 4px solid var(--ink);
  text-align: left;
  cursor: pointer;
}

.pack-zone:last-child { border-bottom: 0; }
.pack-zone:hover,
.pack-zone:focus-visible,
.pack-zone.is-drag-over { background: var(--yellow); }
.pack-zone.has-items { background: color-mix(in srgb, var(--green) 28%, var(--paper)); }
.pack-zone-heading { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: .75rem; align-items: center; }
.pack-zone-heading > span:first-child { width: 40px; height: 40px; display: grid; place-items: center; color: var(--cream); background: var(--purple-dark); border: 3px solid var(--ink); border-radius: 50%; font-weight: 900; }
.pack-zone-heading strong,
.pack-zone-heading small { display: block; }
.pack-zone-heading strong { font-family: var(--font-display); font-size: 1.15rem; text-transform: uppercase; }
.pack-zone-heading small { margin-top: .2rem; line-height: 1.25; }
.pack-zone-items { display: flex; flex-wrap: wrap; gap: .45rem; }
.packed-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .5rem; background: var(--cream); border: 2px solid var(--ink); font-size: .78rem; font-weight: 800; }
.pack-zone-placeholder { color: var(--muted); font-size: .82rem; font-weight: 700; }

.mini-game-feedback {
  margin: 1.5rem 0;
  padding: 1rem 1.2rem;
  color: var(--ink);
  border: 4px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}

.mini-game-feedback p { margin: .25rem 0 0; }
.mini-game-feedback--success { background: var(--green); }
.mini-game-feedback--retry { background: var(--yellow); }

.plan-game { margin-top: 1.5rem; padding: clamp(1.2rem, 3vw, 2.2rem); }
.plan-game.is-locked { opacity: .8; background: #ddd5c9; }
.locked-message { margin: 0; padding: 1rem; background: var(--paper); border: 3px dashed var(--ink); font-weight: 800; }
.plan-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; margin: 1.2rem 0 1.5rem; }
.plan-fieldset { min-width: 0; margin: 0; padding: 1rem; border: 4px solid var(--ink); }
.plan-fieldset legend { padding: 0 .45rem; font-family: var(--font-display); font-size: 1.05rem; }
.plan-options { display: grid; gap: .65rem; }
.plan-option { min-height: 66px; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: .65rem; align-items: center; padding: .7rem; color: var(--ink); background: var(--paper); border: 3px solid var(--ink); text-align: left; cursor: pointer; }
.plan-option:hover,
.plan-option.is-selected { background: var(--yellow); box-shadow: 4px 4px 0 var(--pink); }
.option-marker { width: 30px; height: 30px; display: grid; place-items: center; background: var(--cream); border: 3px solid var(--ink); border-radius: 50%; font-weight: 900; }

.ready-complete {
  display: grid;
  grid-template-columns: minmax(190px, .55fr) minmax(0, 1.45fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(1.4rem, 5vw, 4rem);
}

.ready-complete-stamp {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 1rem;
  color: var(--ink);
  background: var(--pink);
  border: 7px solid var(--ink);
  border-radius: 50%;
  box-shadow: 10px 10px 0 var(--yellow);
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 3.2rem);
  line-height: .9;
  text-align: center;
  transform: rotate(-4deg);
}

.ready-check-list { display: grid; gap: .55rem; padding: 0; list-style: none; }
.ready-check-list li { display: flex; gap: .6rem; align-items: center; font-weight: 800; }
.ready-check-list li::before { content: "✓"; width: 29px; height: 29px; display: grid; place-items: center; background: var(--green); border: 2px solid var(--ink); border-radius: 50%; }
.ready-complete .feedback-score { margin: 1.2rem 0; }

body.pref-high-contrast .screen--mini-game { background: #000; }
body.pref-high-contrast .pack-zone.has-items { background: #fff; }

@media (max-width: 900px) {
  .mini-game-header { grid-template-columns: 1fr; }
  .tram-due-card { width: 100%; transform: none; }
  .packing-game { grid-template-columns: 1fr; }
  .pack-tray { border-right: 0; border-bottom: 5px solid var(--ink); }
  .pack-zones { grid-template-rows: none; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pack-zone { min-height: 180px; border-right: 4px solid var(--ink); border-bottom: 0; }
  .pack-zone:last-child { border-right: 0; }
}

@media (max-width: 700px) {
  .mini-game-progress,
  .plan-columns,
  .ready-complete { grid-template-columns: 1fr; }
  .pack-items { grid-template-columns: 1fr; }
  .pack-zones { grid-template-columns: 1fr; }
  .pack-zone { min-height: 140px; border-right: 0; border-bottom: 4px solid var(--ink); }
  .pack-zone:last-child { border-bottom: 0; }
  .mini-section-heading { display: grid; }
  .mini-count { justify-self: start; }
  .ready-complete-stamp { width: min(230px, 80%); justify-self: center; }
}

@media (max-width: 480px) {
  .screen--mini-game { padding-inline: .8rem; }
  .pack-item { grid-template-columns: 42px minmax(0, 1fr); }
  .mini-game-progress span { font-size: .82rem; }
}

/* Development-only final-screen bypass notice */
.dev-bypass-notice {
  position: relative;
  z-index: 20;
  margin: 1rem auto 0;
  width: min(1180px, calc(100% - 2rem));
  padding: .85rem 1rem;
  color: var(--ink);
  background: var(--yellow);
  border: var(--line);
  box-shadow: 5px 5px 0 var(--ink);
  font-weight: 700;
}

.dev-bypass-notice code {
  padding: .12rem .3rem;
  color: var(--cream);
  background: var(--ink);
  font-size: .9em;
}

/* ==========================================================================
   Pigeon Panic — final bonus arcade game
   ========================================================================== */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.bonus-unlock-card {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 1.2rem;
  align-items: center;
  margin: 1.5rem 0;
  padding: 1.2rem;
  color: var(--ink);
  background: var(--yellow);
  border: 5px solid var(--ink);
  box-shadow: 9px 9px 0 var(--pink);
}

.bonus-unlock-card h3 {
  margin-bottom: .35rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  text-transform: uppercase;
}

.bonus-unlock-card p { margin-bottom: .45rem; }
.bonus-best { font-size: .92rem; }

.bonus-unlock-pigeon {
  position: relative;
  width: 96px;
  height: 78px;
  background: var(--lime, #a9b51d);
  border: 5px solid var(--ink);
  border-radius: 54% 46% 51% 49%;
  transform: rotate(-4deg);
}

.bonus-unlock-pigeon::before {
  content: "";
  position: absolute;
  right: -7px;
  top: -16px;
  width: 52px;
  height: 52px;
  background: var(--cream);
  border: 5px solid var(--ink);
  border-radius: 50%;
}

.pigeon-eye {
  position: absolute;
  z-index: 2;
  right: 10px;
  top: 2px;
  width: 10px;
  height: 10px;
  background: var(--ink);
  border-radius: 50%;
}

.pigeon-beak {
  position: absolute;
  z-index: 2;
  right: -29px;
  top: 17px;
  width: 30px;
  height: 22px;
  background: var(--orange);
  border: 4px solid var(--ink);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.screen--bonus-intro,
.screen--bonus-result,
.screen--pigeon-game {
  min-height: auto;
}

.screen--bonus-intro {
  color: var(--cream);
  background:
    radial-gradient(circle at 9% 14%, rgba(244, 239, 223, .18) 0 3px, transparent 4px) 0 0 / 25px 25px,
    var(--blue, #0169aa);
  overflow: hidden;
}

.bonus-rain {
  position: absolute;
  inset: -80px 0 0;
  z-index: -1;
  pointer-events: none;
  opacity: .18;
  background-image: repeating-linear-gradient(105deg, transparent 0 39px, var(--cream) 40px 42px, transparent 43px 80px);
  background-size: 170px 130px;
  animation: bonus-rain-slide 7s linear infinite;
}

.bonus-intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}

.bonus-intro-copy { position: relative; z-index: 2; }

.bonus-display-title {
  margin: .7rem 0 1rem;
  font-family: var(--font-display);
  font-size: clamp(4rem, 11vw, 9.5rem);
  line-height: .78;
 
  text-transform: uppercase;
}

.bonus-display-title span {
  display: block;
  color: var(--yellow);
  -webkit-text-stroke: 3px var(--ink);
  text-shadow: 7px 7px 0 var(--pink);
}

.bonus-rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin: 1.6rem 0;
}

.bonus-rules > div {
  min-height: 140px;
  display: grid;
  align-content: start;
  gap: .35rem;
  padding: .9rem;
  color: var(--ink);
  background: var(--cream);
  border: 4px solid var(--ink);
  box-shadow: 5px 5px 0 var(--pink);
}

.bonus-rules span { font-size: 2rem; }
.bonus-rules strong,
.bonus-rules small { display: block; }
.bonus-rules strong { font-family: var(--font-display); text-transform: uppercase; }
.bonus-rules small { line-height: 1.3; }
.bonus-record { display: inline-block; padding: .65rem .85rem; color: var(--ink); background: var(--lime, #a9b51d); border: 3px solid var(--ink); }
.bonus-access-note { max-width: 760px; margin-top: 1.2rem; color: rgba(244, 239, 223, .85); font-size: .88rem; }

.pigeon-poster {
  position: relative;
  min-height: 590px;
  overflow: hidden;
  background: var(--purple-dark);
  border: 7px solid var(--ink);
  box-shadow: 15px 15px 0 var(--pink);
  transform: rotate(2deg);
}

.pigeon-poster::before {
  content: "CHIPS CHIPS CHIPS CHIPS";
  position: absolute;
  inset: auto -20% 3%;
  color: rgba(244, 239, 223, .13);
  font-family: var(--font-display);
  font-size: 5.4rem;
  line-height: .75;
  transform: rotate(-11deg);
}

.pigeon-poster-sun {
  position: absolute;
  inset: 9% auto auto 11%;
  width: 250px;
  aspect-ratio: 1;
  background: repeating-conic-gradient(var(--yellow) 0 9deg, var(--orange) 9deg 18deg);
  border: 7px solid var(--ink);
  border-radius: 50%;
  animation: slow-spin 38s linear infinite;
}

.pigeon-character {
  position: absolute;
  left: 50%;
  bottom: 8%;
  width: 285px;
  height: 220px;
  background: var(--lime, #a9b51d);
  border: 8px solid var(--ink);
  border-radius: 55% 45% 48% 52%;
  transform: translateX(-50%) rotate(-3deg);
}

.pigeon-character::before {
  content: "";
  position: absolute;
  right: -10px;
  top: -78px;
  width: 145px;
  height: 145px;
  background: var(--cream);
  border: 8px solid var(--ink);
  border-radius: 50%;
}

.pigeon-wing {
  position: absolute;
  left: 25px;
  top: 75px;
  width: 140px;
  height: 105px;
  background: var(--purple);
  border: 7px solid var(--ink);
  border-radius: 60% 40% 55% 45%;
  transform: rotate(-18deg);
}

.pigeon-face-eye {
  position: absolute;
  z-index: 2;
  top: -26px;
  width: 18px;
  height: 18px;
  background: var(--ink);
  border-radius: 50%;
}

.pigeon-face-eye--one { right: 72px; }
.pigeon-face-eye--two { right: 30px; }

.pigeon-face-beak {
  position: absolute;
  z-index: 2;
  right: -65px;
  top: 7px;
  width: 72px;
  height: 52px;
  background: var(--orange);
  border: 7px solid var(--ink);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.pigeon-leg {
  position: absolute;
  bottom: -68px;
  width: 8px;
  height: 75px;
  background: var(--pink);
  border: 2px solid var(--ink);
}
.pigeon-leg--one { left: 95px; }
.pigeon-leg--two { right: 85px; }

.chip-sticker {
  position: absolute;
  padding: .5rem .7rem;
  color: var(--ink);
  background: var(--yellow);
  border: 4px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  font-family: var(--font-display);
  font-size: 1.4rem;
}
.chip-sticker--one { right: 7%; top: 9%; transform: rotate(12deg); }
.chip-sticker--two { left: 5%; bottom: 12%; background: var(--pink); transform: rotate(-9deg); }

.screen--pigeon-game {
  padding-block: 1.2rem 2.5rem;
  color: var(--cream);
  background: var(--purple-dark);
}

.pigeon-game-wrap { width: min(1120px, 100%); }
.pigeon-game-header { display: flex; justify-content: space-between; gap: 1.5rem; align-items: end; margin-bottom: 1rem; }
.pigeon-game-header h1 { margin: 0; font-family: var(--font-display); font-size: clamp(2.5rem, 7vw, 5.3rem); line-height: .85; text-transform: uppercase; }

.pigeon-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(80px, 1fr));
  color: var(--ink);
  background: var(--ink);
  border: 4px solid var(--cream);
  gap: 3px;
}
.pigeon-hud > div { min-width: 88px; padding: .55rem .7rem; background: var(--yellow); text-align: center; }
.pigeon-hud small,
.pigeon-hud strong { display: block; }
.pigeon-hud small { font-size: .65rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.pigeon-hud strong { font-family: var(--font-display); font-size: 1.65rem; line-height: 1; }

.pigeon-canvas-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--blue, #0169aa);
  border: 6px solid var(--cream);
  box-shadow: 12px 12px 0 var(--pink);
}

#pigeon-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  touch-action: none;
  cursor: ew-resize;
}

.pigeon-live {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  max-width: min(360px, calc(100% - 2rem));
  min-height: 0;
  padding: 0;
  pointer-events: none;
}
.pigeon-live:not(:empty) { padding: .55rem .7rem; color: var(--ink); background: var(--yellow); border: 3px solid var(--ink); font-weight: 900; }

.pigeon-controls { display: grid; grid-template-columns: 1fr auto 1fr; gap: .75rem; margin-top: 1.2rem; }
.pigeon-move-button {
  min-height: 62px;
  padding: .8rem 1rem;
  color: var(--ink);
  background: var(--lime, #a9b51d);
  border: 4px solid var(--cream);
  font-family: var(--font-display);
  font-size: 1.2rem;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}
.pigeon-move-button:hover,
.pigeon-move-button:active { background: var(--yellow); }
.pigeon-move-button:first-child { text-align: left; }
.pigeon-move-button:last-child { text-align: right; }

.pigeon-game-footer { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-top: 1rem; }
.pigeon-game-footer p { margin: 0; color: rgba(244, 239, 223, .82); font-size: .9rem; }
.pigeon-game-footer .text-button { color: var(--cream); }

.screen--bonus-result {
  color: var(--ink);
  background: var(--yellow);
  overflow: hidden;
}

.bonus-result-burst {
  position: absolute;
  right: -12vw;
  top: -18vw;
  width: 58vw;
  aspect-ratio: 1;
  z-index: -1;
  background: repeating-conic-gradient(var(--pink) 0 8deg, var(--orange) 8deg 16deg);
  border-radius: 50%;
  opacity: .85;
}

.bonus-result-grid { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr); gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.pigeon-result-poster { position: relative; min-height: 570px; display: grid; align-content: start; padding: 2rem; overflow: hidden; color: var(--cream); background: var(--purple-dark); border: 7px solid var(--ink); box-shadow: 14px 14px 0 var(--pink); transform: rotate(-2deg); }
.pigeon-result-score { display: block; margin-top: 1rem; font-family: var(--font-display); font-size: clamp(7rem, 20vw, 13rem); line-height: .72; color: var(--yellow); -webkit-text-stroke: 4px var(--ink); }
.pigeon-result-poster > span { font-family: var(--font-display); font-size: 1.4rem; text-transform: uppercase; }
.result-pigeon { position: absolute; right: -20px; bottom: -25px; width: 260px; height: 190px; background: var(--lime, #a9b51d); border: 7px solid var(--ink); border-radius: 55% 45% 48% 52%; }
.result-pigeon::before { content: ""; position: absolute; right: 0; top: -72px; width: 130px; height: 130px; background: var(--cream); border: 7px solid var(--ink); border-radius: 50%; }
.result-pigeon::after { content: ""; position: absolute; right: -62px; top: -18px; width: 70px; height: 50px; background: var(--orange); border: 7px solid var(--ink); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.result-pigeon span { position: absolute; z-index: 2; right: 42px; top: -31px; width: 16px; height: 16px; background: var(--ink); border-radius: 50%; }

.bonus-result-copy { position: relative; z-index: 2; }
.bonus-result-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: 1.4rem 0; }
.bonus-result-stats > div { padding: 1rem; color: var(--ink); background: var(--cream); border: 4px solid var(--ink); }
.bonus-result-stats small,
.bonus-result-stats strong { display: block; color: var(--ink); }
.bonus-result-stats small { font-size: .72rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.bonus-result-stats strong { font-family: var(--font-display); font-size: 2.2rem; }

body.pref-reduced-motion .bonus-rain,
body.pref-reduced-motion .pigeon-poster-sun { animation: none; }
body.pref-high-contrast .screen--bonus-intro,
body.pref-high-contrast .screen--pigeon-game { background: #000; }
body.pref-high-contrast .bonus-unlock-card,
body.pref-high-contrast .bonus-rules > div,
body.pref-high-contrast .pigeon-hud > div { background: #fff; color: #000; }

@keyframes bonus-rain-slide { to { transform: translateY(130px); } }

@media (max-width: 960px) {
  .bonus-unlock-card { grid-template-columns: 90px minmax(0, 1fr); }
  .bonus-unlock-card .button { grid-column: 1 / -1; }
  .bonus-intro-grid,
  .bonus-result-grid { grid-template-columns: 1fr; }
  .pigeon-poster { width: min(560px, 100%); justify-self: center; }
  .pigeon-result-poster { width: min(560px, 100%); justify-self: center; }
  .pigeon-game-header { display: grid; }
  .pigeon-hud { width: 100%; }
}

@media (max-width: 700px) {
  .bonus-rules,
  .bonus-result-stats { grid-template-columns: 1fr; }
  .bonus-rules > div { min-height: 0; grid-template-columns: 42px 1fr; }
  .bonus-rules span { grid-row: 1 / span 2; }
  .pigeon-poster { min-height: 470px; }
  .pigeon-character { width: 220px; height: 170px; }
  .pigeon-character::before { width: 112px; height: 112px; top: -58px; }
  .pigeon-wing { width: 110px; height: 82px; }
  .pigeon-face-eye { top: -15px; }
  .pigeon-face-eye--one { right: 57px; }
  .pigeon-face-eye--two { right: 24px; }
  .pigeon-face-beak { right: -51px; top: 9px; width: 58px; height: 41px; }
  .pigeon-controls { grid-template-columns: 1fr 1fr; }
  .pigeon-controls #pigeon-pause { grid-column: 1 / -1; grid-row: 2; }
  .pigeon-game-footer { display: grid; }
}

@media (max-width: 520px) {
  .bonus-unlock-card { grid-template-columns: 1fr; }
  .bonus-unlock-pigeon { justify-self: center; }
  .bonus-display-title { font-size: clamp(3.5rem, 20vw, 5.4rem); }
  .pigeon-poster { min-height: 420px; transform: none; }
  .pigeon-poster-sun { width: 190px; }
  .pigeon-hud { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pigeon-result-poster { min-height: 470px; transform: none; }
  .result-pigeon { width: 220px; height: 160px; }
}
