:root {
  color-scheme: dark;
  --ink: #061018;
  --ink-2: #0b1721;
  --panel: rgba(12, 27, 38, 0.92);
  --panel-solid: #0e202c;
  --line: rgba(203, 246, 255, 0.16);
  --paper: #ecfbf7;
  --muted: #93aeb2;
  --acid: #d8ff45;
  --acid-deep: #9fc821;
  --coral: #ff5b4d;
  --orange: #ff943b;
  --aqua: #4ce8dc;
  --blue: #4ea4ff;
  --violet: #b775ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  --display: "Archivo Black", Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  --body: "DM Sans", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--body);
  background: var(--ink);
  color: var(--paper);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--ink); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; overflow-x: hidden; background:
  radial-gradient(circle at 12% -10%, rgba(76, 232, 220, 0.13), transparent 30rem),
  linear-gradient(180deg, #061018 0%, #08131b 55%, #050b10 100%); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, a, label, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--aqua); outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: 0.48; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: var(--display); letter-spacing: -0.045em; line-height: 0.94; }
p { line-height: 1.58; }
::selection { color: var(--ink); background: var(--acid); }

.logo { display: inline-flex; align-items: baseline; gap: 0; padding: 0; border: 0; background: none; cursor: pointer; font-family: var(--display); font-size: clamp(1.25rem, 3vw, 2rem); letter-spacing: -0.08em; }
.logo__sip { color: var(--paper); }
.logo__slash { color: var(--coral); transform: rotate(8deg); margin: 0 0.04em; }
.logo__wreck { color: var(--acid); }
.logo--compact { font-size: 1.3rem; }

.app-header { position: relative; z-index: 20; display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 0 clamp(1rem, 4vw, 3.5rem); border-bottom: 1px solid var(--line); background: rgba(6, 16, 24, 0.72); backdrop-filter: blur(18px); }
.app-header__trailing { display: flex; align-items: center; gap: 0.75rem; }
.text-link, .site-footer button { padding: 0; border: 0; background: none; color: var(--muted); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.14em; cursor: pointer; }
.text-link:hover, .site-footer button:hover { color: var(--acid); }

.button { position: relative; display: inline-flex; min-height: 52px; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.85rem 1.25rem; overflow: hidden; border: 1px solid transparent; border-radius: 0.75rem; font-family: var(--display); font-size: 0.82rem; letter-spacing: 0.02em; line-height: 1; cursor: pointer; transition: transform 160ms ease, filter 160ms ease, background 160ms ease, border 160ms ease; }
.button:not(:disabled):hover { transform: translateY(-2px); filter: brightness(1.08); }
.button:not(:disabled):active { transform: translateY(1px) scale(0.985); }
.button--primary { color: #101900; background: var(--acid); box-shadow: 0 10px 30px rgba(216, 255, 69, 0.15); }
.button--secondary { color: var(--paper); background: #17303e; border-color: rgba(236, 251, 247, 0.2); }
.button--danger { color: white; background: var(--coral); }
.button--success { color: #00130f; background: var(--aqua); }
.button--ghost { color: var(--muted); background: transparent; border-color: var(--line); }
.button--chaos { color: #fff; background: var(--violet); }
.button--block { width: 100%; }
.button--small { width: 36px; min-height: 36px; padding: 0; border-radius: 50%; font-size: 1.2rem; }
.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.button-stack { display: grid; gap: 0.75rem; }

.panel { position: relative; border: 1px solid var(--line); border-radius: 1.25rem; background: linear-gradient(180deg, rgba(18, 42, 56, 0.92), rgba(10, 25, 35, 0.92)); box-shadow: var(--shadow); }
.eyebrow { margin: 0 0 0.65rem; color: var(--aqua); font-size: 0.68rem; font-weight: 900; letter-spacing: 0.18em; line-height: 1.2; }

.marketing-page { min-height: 100vh; }
.hero { position: relative; min-height: calc(100vh - 76px); display: flex; flex-direction: column; justify-content: center; padding: clamp(4rem, 9vw, 8rem) clamp(1rem, 7vw, 7rem); overflow: hidden; border-bottom: 1px solid var(--line); isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -2; background:
  linear-gradient(112deg, rgba(6, 16, 24, 0.1) 0 55%, rgba(6, 16, 24, 0.88) 86%),
  repeating-linear-gradient(90deg, transparent 0 14.8%, rgba(255,255,255,0.025) 15% 15.2%, transparent 15.4% 30%); }
.hero::after { content: ""; position: absolute; left: -10%; right: -10%; bottom: -13rem; height: 22rem; z-index: -1; border-radius: 50% 50% 0 0; background: rgba(76, 232, 220, 0.08); box-shadow: 0 -36px 0 rgba(78, 164, 255, 0.03), 0 -72px 0 rgba(76, 232, 220, 0.02); animation: tide 6s ease-in-out infinite alternate; }
.hero__signal { position: absolute; top: 2rem; right: clamp(1rem, 7vw, 7rem); display: flex; align-items: center; gap: 0.3rem; color: var(--coral); font-size: 0.65rem; font-weight: 900; letter-spacing: 0.12em; }
.hero__signal i { width: 4px; height: 10px; border-radius: 99px; background: currentColor; animation: signal 1s ease-in-out infinite alternate; }
.hero__signal i:nth-child(3) { height: 17px; animation-delay: .2s; }
.hero__signal i:nth-child(4) { height: 24px; animation-delay: .4s; }
.hero__kicker { margin-bottom: 1.4rem; color: var(--coral); font-size: 0.72rem; font-weight: 900; letter-spacing: 0.18em; }
.hero h1 { max-width: 1050px; margin: 0; font-size: clamp(3.25rem, 10vw, 9.5rem); }
.hero h1 span { color: var(--paper); }
.hero h1 em { color: var(--acid); font-style: normal; }
.hero__intro { max-width: 620px; margin: 2rem 0 1.75rem; color: #b9ced0; font-size: clamp(1rem, 2vw, 1.28rem); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero__actions .button { min-width: 190px; }
.hero__note { margin: 1rem 0 0; color: #6f8e95; font-size: 0.78rem; font-weight: 700; }
.hero__wreck { position: absolute; right: -2rem; bottom: 2.5rem; width: min(38vw, 480px); height: 300px; opacity: 0.95; pointer-events: none; }
.hero__phone { position: absolute; display: grid; place-content: center; width: 150px; height: 265px; padding: 1rem; border: 5px solid #020609; border-radius: 2rem; background: #102733; box-shadow: 0 30px 70px rgba(0,0,0,.45); color: var(--muted); text-align: center; font-size: .68rem; font-weight: 900; letter-spacing: .12em; }
.hero__phone strong { display: block; margin-top: .55rem; color: var(--paper); font-family: var(--display); font-size: 1.3rem; letter-spacing: -.05em; line-height: .92; }
.hero__phone--one { right: 14rem; bottom: -3rem; transform: rotate(-12deg); }
.hero__phone--two { right: 7rem; bottom: 1.5rem; z-index: 2; transform: rotate(4deg); background: var(--coral); color: #52150f; }
.hero__phone--two strong { color: white; }
.hero__phone--three { right: 0; bottom: -3.5rem; transform: rotate(15deg); }
.mechanics-strip { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 1500px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 3rem); }
.mechanics-strip article { min-height: 230px; padding: 2.2rem 1.5rem; border-right: 1px solid var(--line); }
.mechanics-strip article:first-child { border-left: 1px solid var(--line); }
.mechanics-strip span { color: var(--coral); font-size: .7rem; font-weight: 900; }
.mechanics-strip h2 { margin: 3.25rem 0 .7rem; font-size: 1.25rem; }
.mechanics-strip p { color: var(--muted); font-size: .88rem; }
.how-it-hits { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; max-width: 1300px; margin: 0 auto; padding: clamp(5rem, 10vw, 9rem) clamp(1rem, 5vw, 5rem); }
.how-it-hits h2 { max-width: 600px; margin-bottom: 1.4rem; font-size: clamp(2.4rem, 6vw, 5.2rem); }
.how-it-hits p:not(.eyebrow) { max-width: 600px; color: #a8c0c3; font-size: 1.05rem; }
.role-stack { position: relative; min-height: 380px; }
.role-stack span { position: absolute; display: flex; flex-direction: column; justify-content: flex-end; width: 64%; min-height: 180px; padding: 1.5rem; border: 1px solid var(--line); border-radius: 1.25rem; background: #10232f; box-shadow: var(--shadow); }
.role-stack span:nth-child(1) { left: 0; top: 0; transform: rotate(-7deg); }
.role-stack span:nth-child(2) { right: 0; top: 5rem; z-index: 2; transform: rotate(4deg); background: var(--coral); color: white; }
.role-stack span:nth-child(3) { left: 2rem; bottom: 0; transform: rotate(-2deg); }
.role-stack small { color: var(--aqua); font-size: .65rem; font-weight: 900; letter-spacing: .18em; }
.role-stack span:nth-child(2) small { color: #651912; }
.role-stack strong { margin-top: .6rem; font-family: var(--display); font-size: clamp(1.3rem, 3vw, 2.6rem); line-height: .95; }
.site-footer { display: flex; align-items: center; justify-content: space-between; padding: 2rem clamp(1rem, 4vw, 3.5rem); border-top: 1px solid var(--line); color: #55737b; font-size: .7rem; font-weight: 900; letter-spacing: .12em; }

.entry-page, .lobby-page, .content-page { min-height: 100vh; }
.entry-shell { width: min(760px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) 0; }
.entry-heading { margin-bottom: 2rem; }
.entry-heading h1 { margin-bottom: 1rem; font-size: clamp(2.8rem, 9vw, 6rem); }
.entry-heading > p:last-child { max-width: 580px; color: var(--muted); }
.entry-shell > .panel { padding: clamp(1.2rem, 4vw, 2rem); }
.entry-form { display: grid; gap: 1.7rem; }
.field { display: grid; gap: .65rem; }
.field > span, fieldset > legend { color: #cde0e0; font-size: .78rem; font-weight: 800; }
.field input, .field select, .relationships select, .compact-form select, .impersonator-bar select, .grant-power select, .test-player-editor input, .test-player-editor select { width: 100%; min-height: 50px; padding: .8rem 1rem; border: 1px solid rgba(236, 251, 247, .16); border-radius: .7rem; background: #07131b; color: var(--paper); }
.field input::placeholder, textarea::placeholder { color: #4f6a71; }
.field--code input { font-family: var(--display); font-size: 2rem; letter-spacing: .22em; text-align: center; text-transform: uppercase; }
.field--range > span { display: flex; justify-content: space-between; }
.field--range > span strong { color: var(--acid); }
.field--range input[type="range"] { min-height: 18px; padding: 0; accent-color: var(--acid); }
.field small { color: var(--muted); }
.avatar-picker, .play-style, .toggle-grid, .relationships { min-width: 0; margin: 0; padding: 0; border: 0; }
.avatar-picker legend, .play-style legend, .toggle-grid legend, .relationships legend { margin-bottom: .8rem; }
.avatar-picker__grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: .45rem; }
.avatar-picker__option { position: relative; display: grid; place-items: center; aspect-ratio: 1; border: 1px solid var(--line); border-radius: .75rem; background: #07131b; cursor: pointer; transition: transform 150ms ease, border 150ms ease, background 150ms ease; }
.avatar-picker__option input, .choice-card input, .toggle-chip input { position: absolute; opacity: 0; pointer-events: none; }
.avatar-picker__option span { font-size: 1.45rem; }
.avatar-picker__option--selected { border-color: var(--acid); background: rgba(216,255,69,.11); transform: translateY(-3px); }
.play-style__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; }
.choice-card { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: .7rem; align-items: center; min-height: 100px; padding: 1rem; border: 1px solid var(--line); border-radius: .85rem; background: #07131b; cursor: pointer; transition: border 150ms ease, background 150ms ease, transform 150ms ease; }
.choice-card:hover { transform: translateY(-2px); }
.choice-card--selected { border-color: var(--aqua); background: rgba(76,232,220,.09); }
.choice-card__icon { font-size: 1.5rem; }
.choice-card__copy { display: grid; gap: .22rem; }
.choice-card__copy strong { font-size: .82rem; }
.choice-card__copy small { color: var(--muted); font-size: .68rem; line-height: 1.35; }
.choice-card__check { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--aqua); color: #002823; font-size: .72rem; opacity: 0; transform: scale(.7); transition: all 150ms ease; }
.choice-card--selected .choice-card__check { opacity: 1; transform: scale(1); }
.play-style--compact .choice-card { min-height: 58px; padding: .6rem; }
.play-style--compact .choice-card__copy small { display: none; }
.error-panel { display: grid; grid-template-columns: auto 1fr; gap: 1rem; margin-bottom: 1rem; padding: 1.2rem; border-color: rgba(255,91,77,.4); }
.error-panel__icon { font-size: 2rem; }
.error-panel h2 { margin-bottom: .45rem; font-size: 1.25rem; }
.error-panel p:not(.eyebrow) { color: #d3b4b1; }

.loading-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 1.5rem; padding: 2rem; text-align: center; }
.loading-screen p { color: var(--muted); font-weight: 800; }
.sonar { position: relative; width: 120px; height: 120px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(76,232,220,.3); }
.sonar::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 30px var(--acid); }
.sonar span { position: absolute; inset: 14%; border: 1px solid rgba(76,232,220,.25); border-radius: 50%; animation: sonar 2.1s ease-out infinite; }
.sonar span:nth-child(2) { animation-delay: .7s; }
.sonar span:nth-child(3) { animation-delay: 1.4s; }
.sonar--small { width: 88px; height: 88px; }

.connection-pill, .test-badge { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .7rem; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: .62rem; font-weight: 900; letter-spacing: .12em; }
.connection-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--aqua); box-shadow: 0 0 12px var(--aqua); animation: pulse 1.6s ease infinite; }
.test-badge { border-color: rgba(255,148,59,.45); color: var(--orange); }
.lobby-shell { width: min(1400px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(2.5rem, 6vw, 5rem) 0; }
.lobby-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 2rem; }
.lobby-title h1 { margin-bottom: 0; font-size: clamp(2.6rem, 7vw, 5.5rem); }
.self-style { padding: .65rem 1rem; border: 1px solid var(--line); border-radius: 99px; color: #c7dbdc; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.inline-message { margin-bottom: 1rem; padding: .9rem 1rem; border: 1px solid rgba(76,232,220,.28); border-radius: .75rem; background: rgba(76,232,220,.08); color: #bdfbf6; }
.lobby-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 410px); gap: 1rem; align-items: start; }
.lobby-grid__main { display: grid; gap: 1rem; }
.lobby-grid__main > .panel, .lobby-grid__side > .panel { padding: clamp(1rem, 3vw, 1.5rem); }
.lobby-grid__side { position: sticky; top: 1rem; }
.room-code { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1.5rem; min-height: 260px; padding: clamp(1.5rem, 4vw, 2.5rem); border: 1px solid var(--line); border-radius: 1.25rem; overflow: hidden; background: var(--acid); color: #111900; box-shadow: var(--shadow); }
.room-code .eyebrow { color: #52610d; }
.room-code__copy > strong { display: block; margin: .3rem 0 .7rem; font-family: var(--display); font-size: clamp(3rem, 9vw, 6.8rem); letter-spacing: .12em; line-height: .86; }
.room-code__copy p:not(.eyebrow) { color: #43500a; }
.room-code .button--secondary { background: #0c1715; }
.room-code .button--ghost { border-color: rgba(17,25,0,.25); color: #1f2c00; }
.room-code img { width: 200px; height: 200px; padding: .6rem; border-radius: 1rem; background: white; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-heading h2 { margin: 0; font-size: 1.55rem; }
.section-heading > span { color: var(--aqua); font-size: .68rem; font-weight: 900; }
.roster { display: grid; gap: .5rem; }
.roster-player { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: .75rem; min-height: 68px; padding: .7rem; border: 1px solid transparent; border-radius: .8rem; background: rgba(4,13,19,.5); }
.roster-player--self { border-color: rgba(216,255,69,.2); background: rgba(216,255,69,.05); }
.presence-dot { width: 7px; height: 7px; border-radius: 50%; background: #47565b; }
.presence-dot--online { background: var(--aqua); box-shadow: 0 0 10px var(--aqua); }
.roster-player__avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: .65rem; background: #112a37; font-size: 1.35rem; }
.roster-player__name { display: grid; gap: .17rem; }
.roster-player__name strong { font-size: .88rem; }
.roster-player__name small { color: var(--muted); font-size: .68rem; }
.panel-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 1rem; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.panel-toggle span { display: grid; gap: .25rem; }
.panel-toggle small { color: var(--aqua); font-size: .58rem; font-weight: 900; letter-spacing: .18em; }
.panel-toggle strong { font-size: .78rem; }
.panel-toggle i { font-style: normal; font-size: 1.4rem; }
.preferences-content { display: grid; gap: 1.5rem; padding-top: 1.5rem; }
.toggle-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.toggle-grid legend { width: 100%; }
.toggle-chip { position: relative; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: .7rem; font-weight: 800; cursor: pointer; }
.toggle-chip--active { border-color: var(--aqua); background: rgba(76,232,220,.1); color: var(--paper); }
.relationships { display: grid; gap: .5rem; }
.relationships label { display: grid; grid-template-columns: 1fr 180px; align-items: center; gap: 1rem; }
.relationships label > span { font-size: .8rem; font-weight: 700; }
.host-controls { display: grid; gap: 1.25rem; }
.host-controls h2 { margin-bottom: .3rem; font-size: 2rem; }
.segmented { display: grid; grid-template-columns: repeat(2, 1fr); gap: .35rem; }
.segmented button { min-height: 42px; border: 1px solid var(--line); border-radius: .55rem; background: #07131b; color: var(--muted); font-size: .7rem; font-weight: 900; cursor: pointer; }
.segmented button.active { border-color: var(--acid); background: rgba(216,255,69,.12); color: var(--acid); }
.segmented--intensity button { display: grid; gap: .15rem; place-items: center; padding: .55rem .35rem; }
.segmented--intensity button strong { font-size: .68rem; }
.segmented--intensity button small { font-size: .5rem; letter-spacing: .1em; opacity: .72; }
.field-help { color: var(--muted); font-size: .68rem; line-height: 1.4; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.switch-row span { display: grid; gap: .2rem; }
.switch-row strong { font-size: .78rem; }
.switch-row small { color: var(--muted); font-size: .65rem; }
.switch-row input { width: 42px; height: 24px; accent-color: var(--acid); }
.waiting-panel { min-height: 360px; display: grid; place-content: center; justify-items: center; text-align: center; }
.waiting-panel h2 { max-width: 280px; margin: 1.5rem 0 .8rem; font-size: 1.7rem; }
.waiting-panel p { max-width: 280px; color: var(--muted); }

.live-game-page { min-height: 100vh; }
.sync-error { position: fixed; top: 1rem; left: 50%; z-index: 100; display: flex; align-items: center; gap: .8rem; width: min(92vw, 620px); padding: .8rem 1rem; transform: translateX(-50%); border: 1px solid rgba(255,91,77,.55); border-radius: .75rem; background: #2d1516; color: #ffd6d2; box-shadow: var(--shadow); font-size: .78rem; }
.sync-error button { margin-left: auto; border: 0; background: none; color: white; font-weight: 900; cursor: pointer; }
.game-menu-button { position: fixed; top: max(1rem, env(safe-area-inset-top)); right: 1rem; z-index: 80; width: 44px; height: 44px; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; background: rgba(6,16,24,.65); backdrop-filter: blur(12px); cursor: pointer; }
.game-menu { position: fixed; top: 4.7rem; right: 1rem; z-index: 79; display: grid; gap: .6rem; width: min(300px, calc(100vw - 2rem)); padding: 1rem; border: 1px solid var(--line); border-radius: 1rem; background: #0a1a24; box-shadow: var(--shadow); }
.game-menu > span { color: var(--muted); font-size: .68rem; font-weight: 800; }
.game-screen { position: relative; min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); overflow: hidden; isolation: isolate; background: #07131b; }
.game-screen::before { content: ""; position: absolute; inset: 0; z-index: -3; background: radial-gradient(circle at 50% 20%, rgba(76,232,220,.11), transparent 36rem), #07131b; }
.game-screen--danger::before { background: radial-gradient(circle at 50% 20%, rgba(255,91,77,.2), transparent 38rem), #160c0d; }
.game-screen--secret::before { background: radial-gradient(circle at 50% 20%, rgba(183,117,255,.22), transparent 38rem), #110b1a; }
.game-screen--chaos::before { background: conic-gradient(from 140deg at 50% 30%, rgba(255,91,77,.16), rgba(183,117,255,.18), rgba(76,232,220,.16), rgba(255,91,77,.16)), #0c0a13; }
.game-screen--final::before { background: radial-gradient(circle at 50% 10%, rgba(216,255,69,.2), transparent 36rem), #070a05; }
.game-screen__ambient { position: absolute; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.game-screen__ambient i { position: absolute; width: 22rem; height: 22rem; border: 1px solid rgba(255,255,255,.06); border-radius: 50%; animation: drift 12s ease-in-out infinite alternate; }
.game-screen__ambient i:nth-child(1) { left: -12rem; top: 10%; }
.game-screen__ambient i:nth-child(2) { right: -14rem; top: 40%; animation-delay: -4s; }
.game-screen__ambient i:nth-child(3) { left: 30%; bottom: -17rem; animation-delay: -8s; }
.game-screen__status { display: flex; width: min(680px, 100%); min-height: 54px; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 3.4rem 0 .25rem; }
.game-screen__status > div:first-child { display: grid; gap: .12rem; }
.game-screen__status span { color: var(--aqua); font-size: .58rem; font-weight: 900; letter-spacing: .15em; }
.game-screen__status strong { font-size: .66rem; letter-spacing: .08em; }
.countdown { display: grid; place-items: center; width: 46px; height: 46px; border: 2px solid var(--aqua); border-radius: 50%; color: var(--aqua); font-family: var(--display); }
.countdown--urgent { border-color: var(--coral); color: var(--coral); animation: urgent .6s ease infinite alternate; }
.chaos-meter { width: 100%; }
.game-screen > .chaos-meter { width: min(680px, 100%); margin: .4rem 0 1.1rem; }
.chaos-meter__label { display: flex; justify-content: space-between; margin-bottom: .34rem; color: var(--muted); font-size: .56rem; font-weight: 900; letter-spacing: .14em; }
.chaos-meter__label strong { color: var(--paper); }
.chaos-meter__track { height: 8px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.08); }
.chaos-meter__track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--aqua), var(--acid), var(--orange), var(--coral)); box-shadow: 0 0 18px rgba(255,91,77,.35); transition: width 500ms cubic-bezier(.2,.8,.2,1); }
.game-card { width: min(680px, 100%); margin: auto 0; padding: clamp(1.2rem, 5vw, 2.4rem); border: 1px solid rgba(255,255,255,.16); border-radius: clamp(1.2rem, 4vw, 2rem); background: rgba(10,26,36,.82); box-shadow: 0 30px 100px rgba(0,0,0,.38); backdrop-filter: blur(24px); animation: cardIn 480ms cubic-bezier(.18,.86,.31,1.16) both; }
.game-screen--danger .game-card { background: rgba(48,15,17,.84); }
.game-screen--secret .game-card { border-color: rgba(183,117,255,.35); background: rgba(30,15,47,.86); }
.game-screen--chaos .game-card { border-color: rgba(255,148,59,.35); }
.game-screen--final .game-card { border-color: rgba(216,255,69,.4); }
.game-card__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin-bottom: 1.7rem; }
.role-chip, .style-chip, .severity-chip { padding: .38rem .55rem; border: 1px solid var(--line); border-radius: 99px; color: var(--muted); font-size: .54rem; font-weight: 900; letter-spacing: .1em; }
.style-chip { border-color: rgba(216,255,69,.25); color: var(--acid); }
.severity-chip { border: 1px solid rgba(255,255,255,.18); border-radius: 99px; color: var(--paper); font-size: .54rem; font-weight: 950; letter-spacing: .08em; }
.severity-chip--1 { border-color: rgba(111,224,255,.35); }
.severity-chip--2 { border-color: rgba(216,255,69,.38); }
.severity-chip--3 { border-color: rgba(255,191,71,.42); }
.severity-chip--4 { border-color: rgba(255,91,71,.48); }
.severity-chip--5 { border-color: rgba(255,71,184,.55); box-shadow: 0 0 18px rgba(255,71,184,.12); }
.game-card__eyebrow { margin-bottom: .65rem; color: var(--coral); font-size: .66rem; font-weight: 900; letter-spacing: .17em; }
.game-screen--secret .game-card__eyebrow { color: #d9b3ff; }
.game-card h1 { margin-bottom: 1.25rem; font-size: clamp(2.3rem, 9vw, 5rem); overflow-wrap: anywhere; }
.game-card__body { margin-bottom: 1rem; color: #e2f1ef; font-size: clamp(1.05rem, 3vw, 1.35rem); font-weight: 650; line-height: 1.44; white-space: pre-line; }
.game-card__detail { margin-bottom: 1.25rem; padding-left: .8rem; border-left: 2px solid var(--aqua); color: var(--muted); font-size: .8rem; }
.response-progress { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .65rem; margin: 1rem 0; }
.response-progress::before { content: ""; grid-column: 1; grid-row: 1; height: 7px; border-radius: 99px; background: rgba(255,255,255,.08); }
.response-progress > span { grid-column: 1; grid-row: 1; height: 7px; border-radius: 99px; background: var(--aqua); }
.response-progress strong { font-size: .75rem; }
.response-progress small { color: var(--muted); font-size: .64rem; }
.game-options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .6rem; margin: 1.2rem 0; }
.game-option { display: grid; gap: .3rem; min-height: 72px; align-content: center; padding: .8rem; border: 1px solid var(--line); border-radius: .75rem; background: #07131b; text-align: left; cursor: pointer; transition: transform 150ms ease, border 150ms ease, background 150ms ease; }
.game-option:hover { transform: translateY(-2px); }
.game-option--selected { border-color: var(--acid); background: rgba(216,255,69,.1); box-shadow: inset 0 0 0 1px var(--acid); }
.game-option strong { font-size: .8rem; }
.game-option small { color: var(--muted); font-size: .64rem; }
.answer-box { position: relative; display: grid; gap: .5rem; margin: 1rem 0; }
.answer-box > span { font-size: .7rem; font-weight: 900; }
.answer-box textarea { width: 100%; resize: vertical; padding: 1rem; border: 1px solid var(--line); border-radius: .75rem; background: #061018; color: var(--paper); }
.answer-box small { position: absolute; right: .65rem; bottom: .55rem; color: var(--muted); font-size: .58rem; }
.game-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .65rem; margin-top: 1.3rem; }
.waiting-copy { display: flex; align-items: center; gap: .65rem; margin: 1.2rem 0 0; color: var(--muted); font-size: .72rem; font-weight: 700; }
.waiting-copy span { width: 8px; height: 8px; border-radius: 50%; background: var(--aqua); animation: pulse 1.2s ease infinite; }
.active-rules, .mission-dock, .power-dock { width: min(680px, 100%); margin-top: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: 1rem; background: rgba(6,16,24,.7); }
.active-rules > div { display: flex; gap: .5rem; overflow-x: auto; }
.active-rules > div span { flex: 0 0 auto; max-width: 270px; padding: .6rem .75rem; border-radius: .6rem; background: #112733; color: #c8dadb; font-size: .68rem; }
.mission-dock { display: grid; gap: .65rem; border-color: rgba(183,117,255,.38); background: rgba(31,16,48,.82); }
.mission-dock strong { font-size: .82rem; line-height: 1.4; }
.power-dock { border-color: rgba(255,148,59,.34); background: rgba(35,18,8,.8); }
.power-dock__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: .55rem; margin-top: .7rem; }
.power-card { min-height: 112px; display: grid; grid-template-columns: auto 1fr; gap: .25rem .55rem; align-content: center; padding: .8rem; border: 1px solid rgba(255,148,59,.26); border-radius: .75rem; background: #17130e; color: var(--text); text-align: left; cursor: pointer; transition: transform 160ms ease, border-color 160ms ease, background 160ms ease; }
.power-card:hover:not(:disabled), .power-card:focus-visible { transform: translateY(-2px); border-color: var(--orange); background: #21170d; }
.power-card:disabled { opacity: .48; cursor: wait; }
.power-card > span { grid-row: span 2; font-size: 1.35rem; }
.power-card strong { font-family: var(--display); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; }
.power-card small { grid-column: 1 / -1; margin-top: .3rem; color: #b9aaa0; font-size: .62rem; line-height: 1.35; }
.player-footer { margin-top: 1rem; color: #526e75; font-size: .57rem; font-weight: 800; letter-spacing: .12em; }
.player-footer strong { color: #78949a; }

.game-screen--compact { min-height: 640px; padding: .5rem; }
.game-screen--compact .game-screen__status { min-height: 36px; padding-right: .2rem; }
.game-screen--compact .countdown { width: 34px; height: 34px; font-size: .75rem; }
.game-screen--compact > .chaos-meter { margin: .25rem 0 .55rem; }
.game-screen--compact .game-card { margin: 0; padding: .85rem; border-radius: 1rem; }
.game-screen--compact .game-card__meta { margin-bottom: .75rem; }
.game-screen--compact .role-chip, .game-screen--compact .style-chip, .game-screen--compact .severity-chip { font-size: .43rem; }
.game-screen--compact .game-card__eyebrow { font-size: .48rem; }
.game-screen--compact .game-card h1 { margin-bottom: .6rem; font-size: 1.45rem; }
.game-screen--compact .game-card__body { font-size: .78rem; line-height: 1.35; }
.game-screen--compact .game-card__detail { font-size: .58rem; }
.game-screen--compact .game-option { min-height: 48px; padding: .5rem; }
.game-screen--compact .game-option strong { font-size: .6rem; }
.game-screen--compact .button { min-height: 38px; padding: .55rem; font-size: .58rem; }
.game-screen--compact .active-rules, .game-screen--compact .mission-dock, .game-screen--compact .power-dock { padding: .6rem; }
.game-screen--compact .active-rules span { font-size: .5rem; }
.game-screen--compact .power-card { min-height: 52px; padding: .45rem; }
.game-screen--compact .power-card small { display: none; }
.game-screen--compact .player-footer { margin-top: .4rem; }

.results-page main { width: min(1200px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(3rem, 8vw, 7rem) 0; }
.results-hero { margin-bottom: 3rem; }
.results-hero h1 { margin-bottom: 2rem; font-size: clamp(3.2rem, 10vw, 8.5rem); }
.results-hero h1 em { color: var(--acid); font-style: normal; }
.results-hero .chaos-meter { max-width: 600px; }
.award-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.award-card { min-height: 260px; display: flex; flex-direction: column; justify-content: flex-end; padding: 1.5rem; overflow: hidden; }
.award-card__emoji { position: absolute; top: 1rem; right: 1rem; font-size: 3.2rem; transform: rotate(8deg); }
.award-card small { color: var(--aqua); font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.award-card h2 { margin: .45rem 0 .7rem; font-size: 2rem; }
.award-card p { margin-bottom: 0; color: var(--muted); font-size: .82rem; }
.award-card--1 { grid-column: span 2; background: var(--acid); color: #111900; }
.award-card--1 small, .award-card--1 p { color: #4a5a08; }
.highlights { margin-top: 5rem; }
.highlights h2 { max-width: 680px; margin-bottom: 2rem; font-size: clamp(2.2rem, 5vw, 4rem); }
.highlights article { display: grid; grid-template-columns: 54px 1fr; gap: 1rem; padding: 1rem 0; border-top: 1px solid var(--line); }
.highlights article span { color: var(--coral); font-weight: 900; }
.highlights article p { margin: 0; color: #bed0d0; }
.results-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 3rem; }

.content-page main { width: min(1100px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(4rem, 9vw, 8rem) 0; }
.content-page main > h1 { margin-bottom: 3rem; font-size: clamp(3.5rem, 10vw, 8rem); }
.content-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.content-grid .panel { min-height: 240px; padding: 1.5rem; }
.content-grid .panel > span { color: var(--coral); font-weight: 900; }
.content-grid h2 { margin: 3rem 0 .8rem; font-size: 1.7rem; }
.content-grid p { color: var(--muted); }
.not-found { min-height: 100vh; display: grid; place-content: center; justify-items: start; width: min(760px, calc(100% - 2rem)); margin: auto; }
.not-found__code { margin: 2rem 0 0; color: var(--coral); font-family: var(--display); font-size: clamp(7rem, 30vw, 17rem); line-height: .78; }
.not-found h1 { max-width: 700px; margin-bottom: 1rem; font-size: clamp(2.2rem, 7vw, 5rem); }
.not-found > p:not(.not-found__code) { max-width: 560px; color: var(--muted); }

.test-page { min-height: 100vh; background: #050b10; }
.test-shell { width: min(1900px, calc(100% - 1.5rem)); margin: 0 auto; padding: 2rem 0 5rem; }
.test-heading { display: flex; justify-content: space-between; gap: 2rem; align-items: flex-end; margin-bottom: 1.5rem; }
.test-heading h1 { margin-bottom: .7rem; font-size: clamp(2.4rem, 6vw, 5rem); }
.test-heading p:not(.eyebrow) { max-width: 700px; color: var(--muted); }
.test-heading__actions { display: flex; gap: .6rem; }
.test-layout { display: grid; grid-template-columns: minmax(330px, 430px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.test-controls { display: grid; gap: .75rem; }
.test-controls > .panel { padding: 1rem; }
.test-player-editor { display: grid; gap: .45rem; }
.test-player-editor article { display: grid; grid-template-columns: 42px minmax(0,1fr) 120px 42px; gap: .4rem; align-items: center; }
.test-player-editor input, .test-player-editor select { min-height: 39px; padding: .5rem; font-size: .68rem; }
.test-avatar, .connect-toggle { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: .55rem; background: #07131b; cursor: pointer; }
.test-avatar--active { border-color: var(--acid); background: rgba(216,255,69,.1); }
.connect-toggle { color: #6f8185; font-size: .52rem; font-weight: 900; }
.connect-toggle--on { border-color: rgba(76,232,220,.35); color: var(--aqua); }
.compact-form { display: grid; grid-template-columns: 1fr auto 1fr; gap: .4rem; align-items: center; }
.compact-form select:nth-of-type(3), .compact-form .button { grid-column: 1 / -1; }
.relationship-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .75rem; }
.relationship-tags span { padding: .35rem .5rem; border-radius: 99px; background: #102430; color: var(--muted); font-size: .58rem; }
.developer-controls { display: grid; gap: .8rem; border-color: rgba(255,148,59,.3); }
.control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.control-grid .button { min-height: 42px; padding: .55rem; font-size: .62rem; }
.jump-levels { display: grid; grid-template-columns: repeat(6, 1fr); gap: .3rem; }
.jump-levels button { min-height: 38px; border: 1px solid var(--line); border-radius: .5rem; background: #07131b; color: var(--muted); cursor: pointer; }
.jump-levels button.active { border-color: var(--acid); color: var(--acid); }
.grant-power { display: grid; gap: .4rem; }
.debug-panel pre { max-height: 420px; margin: 1rem 0 0; overflow: auto; padding: .75rem; border-radius: .6rem; background: #020609; color: #8fded5; font: .58rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; }
.test-preview-area { min-width: 0; }
.impersonator-bar { position: sticky; top: .5rem; z-index: 30; display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; padding: .7rem; border: 1px solid var(--line); border-radius: .85rem; background: rgba(7,19,27,.88); backdrop-filter: blur(16px); }
.impersonator-bar > span { color: var(--orange); font-size: .58rem; font-weight: 900; letter-spacing: .12em; }
.impersonator-bar select { width: auto; min-width: 170px; min-height: 38px; padding: .4rem .7rem; }
.impersonator-bar > strong { margin-left: auto; color: var(--muted); font-size: .6rem; text-transform: uppercase; }
.phone-wall { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: .75rem; }
.mini-phone { min-width: 0; overflow: hidden; border: 6px solid #020609; border-radius: 1.7rem; background: #020609; box-shadow: 0 16px 44px rgba(0,0,0,.34); transition: border 180ms ease, transform 180ms ease; }
.mini-phone--active { border-color: var(--acid); transform: translateY(-3px); }
.mini-phone__bar { display: flex; align-items: center; justify-content: space-between; min-height: 34px; padding: 0 .7rem; background: #020609; font-size: .6rem; font-weight: 800; }
.mini-phone__bar i { color: var(--aqua); font-style: normal; font-size: .48rem; letter-spacing: .08em; }
.mini-phone__screen { height: 640px; overflow-y: auto; border-radius: 1.15rem; }
.test-results { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.test-results > .eyebrow, .test-results > h2 { grid-column: 1 / -1; }
.test-results article { padding: 1rem; border: 1px solid var(--line); border-radius: 1rem; background: #0b1a24; }
.test-results article > span { font-size: 2rem; }
.test-results article strong { display: block; margin: .6rem 0; font-family: var(--display); }
.test-results article p { color: var(--muted); font-size: .75rem; }

.offline-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; padding: .7rem 1rem; background: var(--orange); color: #241001; text-align: center; font-size: .7rem; font-weight: 900; }

@keyframes tide { to { transform: translateY(-1.2rem) scaleX(1.04); } }
@keyframes signal { from { opacity: .25; transform: scaleY(.65); } to { opacity: 1; transform: scaleY(1); } }
@keyframes sonar { from { opacity: .8; transform: scale(.2); } to { opacity: 0; transform: scale(1.55); } }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }
@keyframes urgent { to { transform: scale(1.08); box-shadow: 0 0 20px rgba(255,91,77,.35); } }
@keyframes drift { to { transform: translate3d(3rem,-2rem,0) scale(1.08); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(28px) rotateX(6deg) scale(.97); } to { opacity: 1; transform: none; } }

@media (max-width: 1050px) {
  .hero__wreck { opacity: .28; right: -8rem; }
  .mechanics-strip { grid-template-columns: repeat(2, 1fr); }
  .mechanics-strip article:nth-child(3) { border-left: 1px solid var(--line); }
  .lobby-grid { grid-template-columns: 1fr; }
  .lobby-grid__side { position: static; }
  .host-controls { max-width: none; }
  .test-layout { grid-template-columns: 1fr; }
  .test-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .developer-controls, .debug-panel { grid-column: span 2; }
}

@media (max-width: 720px) {
  .app-header { min-height: 64px; }
  .hero { min-height: calc(100vh - 64px); padding-top: 5rem; }
  .hero h1 { font-size: clamp(3.1rem, 18vw, 6.2rem); }
  .hero__wreck { display: none; }
  .hero__actions { display: grid; }
  .hero__actions .button { width: 100%; }
  .mechanics-strip { grid-template-columns: 1fr; }
  .mechanics-strip article, .mechanics-strip article:first-child, .mechanics-strip article:nth-child(3) { min-height: 170px; border-left: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .mechanics-strip h2 { margin-top: 1.8rem; }
  .how-it-hits { grid-template-columns: 1fr; gap: 2rem; }
  .role-stack { min-height: 320px; }
  .role-stack span { width: 78%; }
  .play-style__grid { grid-template-columns: 1fr; }
  .choice-card { min-height: 78px; }
  .avatar-picker__grid { grid-template-columns: repeat(6, 1fr); }
  .lobby-title { align-items: flex-start; flex-direction: column; }
  .room-code { grid-template-columns: 1fr; text-align: center; }
  .room-code img { width: min(220px, 80%); height: auto; justify-self: center; }
  .room-code .button-row { justify-content: center; }
  .relationships label { grid-template-columns: 1fr; gap: .35rem; }
  .award-grid, .content-grid { grid-template-columns: 1fr; }
  .award-card--1 { grid-column: span 1; }
  .test-heading { align-items: stretch; flex-direction: column; }
  .test-heading__actions { display: grid; grid-template-columns: 1fr 1fr; }
  .test-controls { grid-template-columns: 1fr; }
  .developer-controls, .debug-panel { grid-column: auto; }
  .phone-wall { display: block; }
  .mini-phone { display: none; }
  .mini-phone--active { display: block; }
  .test-player-editor article { grid-template-columns: 40px minmax(0,1fr) 105px 40px; }
  .impersonator-bar > strong { display: none; }
  .game-screen__status { padding-right: 3rem; }
}

@media (max-width: 430px) {
  .app-header { padding-inline: .9rem; }
  .entry-shell, .lobby-shell, .results-page main, .content-page main { width: min(100% - 1rem, 100%); }
  .hero { padding-inline: .9rem; }
  .hero h1 { font-size: 3.35rem; }
  .avatar-picker__grid { grid-template-columns: repeat(4, 1fr); }
  .room-code__copy > strong { font-size: 3.35rem; }
  .game-card h1 { font-size: 2.5rem; }
  .game-options { grid-template-columns: 1fr; }
  .game-actions { grid-template-columns: 1fr; }
  .control-grid { grid-template-columns: 1fr; }
  .test-player-editor article { grid-template-columns: 38px 1fr 40px; }
  .test-player-editor article select { grid-column: 2 / 4; }
}

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