:root {
  --ink: #141311; --cream: #FAF6EC; --stripe: #F4EDDC; --pink: #FF4FA0; --yellow: #FFD400; --live: #1F9E54; --muted: #57524A;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  /* 1rem = 20px on a 1280x720 screen; everything scales with the window like the native TV view. */
  font-size: min(1.5625vw, 2.778vh);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: repeating-linear-gradient(-45deg, var(--cream) 0 1.3rem, var(--stripe) 1.3rem 2.6rem);
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 1em; height: 1em; flex: none; }
#stage { position: fixed; inset: 0; padding: 2.7rem 3.2rem; display: flex; flex-direction: column; gap: 1.6rem; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; background: var(--cream); opacity: 0; transition: opacity .35s; }
#game.shown { opacity: 1; }

/* Chrome: the P tile, wordmark and the status pill. The pill leaves room for the full screen button. */
.top { display: flex; align-items: center; gap: 1rem; padding-right: 11rem; min-height: 2.6rem; }
.logo { display: flex; align-items: center; gap: .7rem; margin-right: auto; }
.wordmark { font-weight: 900; font-size: 1.15rem; letter-spacing: .04em; }
.mark { width: 2.6rem; height: 2.6rem; border-radius: .5rem; background: var(--pink); border: .15rem solid var(--ink);
  box-shadow: .18rem .18rem 0 var(--ink); display: grid; place-items: center; color: var(--ink); flex: none; }
.mark .p { width: 1.3rem; height: 1.55rem; }
.mark .play { fill: var(--pink); }
.pill { font: 500 .9rem var(--mono); color: var(--cream); background: var(--ink); padding: .5rem .9rem; border-radius: 99rem; }

h1 { margin: 0; font-size: 4.6rem; line-height: 1; font-weight: 900; letter-spacing: -.01em; }
h1 mark { background: var(--pink); color: inherit; padding: 0 .6rem; }
.lede { margin: 0; font-size: 1.4rem; max-width: 46rem; line-height: 1.35; }

/* Game art: the synced cover on the game's colour; the name stands in when there is none. */
.art, .cover { position: relative; overflow: hidden; display: grid; place-items: center; }
.art img, .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left top; }
/* The covers are the app's game-page heroes (GameCover), drawn at 360x214; keep that shape so their type isn't cropped. */
.art, .cover { aspect-ratio: 360 / 214; }
.art-name { color: #fff; font-weight: 900; font-size: 1.6rem; text-align: center; padding: .6rem; text-shadow: .1rem .1rem 0 var(--ink); }

.card { flex: 1; min-width: 0; background: #fff; border: .2rem solid var(--ink); border-radius: .9rem;
  box-shadow: .3rem .3rem 0 var(--ink); overflow: hidden; }
.card .art { border-bottom: .2rem solid var(--ink); }
.showcase .card .art { border-bottom: 0; }
.card .body { padding: .8rem 1rem; }
.card b { display: block; font-size: 1.3rem; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .body span { font-size: .95rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Waiting for the host: mirrors AudienceWelcome. */
.cards { margin-top: auto; display: flex; gap: 1.4rem; align-items: stretch; }
.card.more { background: var(--yellow); display: flex; flex-direction: column; justify-content: center; gap: .3rem; padding: 0 1.2rem; }
.card.more .count { font-size: 4.8rem; line-height: 1; }
.card.more mark { align-self: flex-start; background: var(--pink); color: inherit; font-weight: 900; font-size: 1.3rem; padding: 0 .4rem; }
.card.more span { font-size: .95rem; }

/* Landing / pairing */
.pairing { gap: 1.4rem; }
.split { flex: 1; min-height: 0; display: flex; gap: 2.4rem; align-items: stretch; }
.intro { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 1.1rem; }
.pairing h1 { font-size: 3.8rem; line-height: .98; }
.pairing .lede { font-size: 1.1rem; max-width: 26rem; }
.showcase { flex: 0 0 26rem; position: relative; }
.showcase .card { position: absolute; width: 15.5rem; flex: none; box-shadow: .3rem .3rem 0 var(--ink); }
.showcase .tilt-0 { left: .5rem; top: .5rem; transform: rotate(-5deg); }
.showcase .tilt-1 { right: 0; top: 5.2rem; transform: rotate(4deg); }
.showcase .tilt-2 { left: 2rem; bottom: .6rem; transform: rotate(2deg); z-index: 1; }
.more-chip { position: absolute; right: 1rem; bottom: 1.3rem; background: var(--yellow); border: .15rem solid var(--ink); border-radius: .7rem;
  box-shadow: .2rem .2rem 0 var(--ink); padding: .7rem .9rem; transform: rotate(-3deg); z-index: 2; }
.more-chip b { display: block; font-size: 2rem; line-height: 1; font-weight: 900; }
.more-chip span { font: 500 .65rem var(--mono); letter-spacing: .06em; }
@media (prefers-reduced-motion: no-preference) {
  .showcase .card, .more-chip { animation: arrive .45s var(--ease) both; }
  .showcase .tilt-1 { animation-delay: .08s; } .showcase .tilt-2 { animation-delay: .16s; } .more-chip { animation-delay: .24s; }
}
@keyframes arrive { from { translate: 0 .8rem; } }

form { display: flex; gap: .7rem; margin-top: .3rem; }
input { font: 700 2rem var(--mono); letter-spacing: .3em; text-transform: uppercase; width: 15rem; height: 3.8rem;
  padding: 0 1.1rem; border: .15rem solid var(--ink); border-radius: .7rem; background: #fff; color: var(--ink); box-shadow: .2rem .2rem 0 var(--ink); }
input::placeholder { color: #C9C2B2; }
input:focus-visible, button:focus-visible { outline: .2rem solid var(--ink); outline-offset: .25rem; box-shadow: .2rem .2rem 0 var(--ink), 0 0 0 .25rem var(--cream); }
button { font-family: inherit; font-size: 1.1rem; font-weight: 800; color: var(--ink); background: var(--yellow); border: .15rem solid var(--ink);
  border-radius: .6rem; box-shadow: .2rem .2rem 0 var(--ink); padding: .7rem 1.3rem; cursor: pointer;
  transition: transform .14s var(--ease), box-shadow .14s var(--ease); }
button:hover { transform: translate(-.1rem, -.1rem); box-shadow: .3rem .3rem 0 var(--ink); }
button:active { transform: translate(.15rem, .15rem); box-shadow: .05rem .05rem 0 var(--ink); }
button:disabled { opacity: .6; cursor: default; transform: none; }
.cta { background: var(--pink); white-space: nowrap; display: inline-flex; align-items: center; gap: .6rem; padding: 0 1.3rem; }
.cta .icon { transition: translate .14s var(--ease); }
.cta:hover .icon { translate: .2rem 0; }
.error { color: #B3132F; font-weight: 700; font-size: 1rem; min-height: 1.4rem; margin: 0; }
.steps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.steps li { display: flex; gap: .7rem; align-items: flex-start; background: #fff; border: .15rem solid var(--ink); border-radius: .7rem;
  padding: .7rem .9rem; font-size: .85rem; line-height: 1.35; }
.steps b { flex: none; font: 700 .75rem var(--mono); background: var(--ink); color: var(--cream); border-radius: .3rem; padding: .2rem .4rem; }

/* Up next: mirrors AudienceSpotlight. */
.feature { display: flex; gap: 2.6rem; align-items: center; flex: 1; min-height: 0; }
.cover { width: 30rem; flex: none; border: .25rem solid var(--ink); border-radius: 1.1rem; box-shadow: .4rem .4rem 0 var(--ink); }
.cover .art-name { font-size: 3.4rem; }
.about { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: .9rem; }
.feature h2 { margin: 0; font-size: 4.2rem; line-height: 1; font-weight: 900; overflow-wrap: anywhere; }
.tag { display: inline-block; font-weight: 900; font-size: 1.4rem; text-transform: uppercase; background: var(--pink); padding: .2rem .5rem; }
.summary { margin: 0; font-size: 1.2rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.facts li { font: 500 .8rem var(--mono); text-transform: uppercase; letter-spacing: .03em; padding: .4rem .7rem; border: .1rem solid var(--ink);
  border-radius: 99rem; background: #fff; }
.facts li:first-child { background: var(--ink); color: var(--cream); }
.ready { display: flex; align-items: center; gap: 1rem; padding: .8rem 1.1rem; background: #fff; border: .15rem solid var(--ink);
  border-radius: .7rem; box-shadow: .2rem .2rem 0 var(--ink); }
.ready-icon { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 99rem; background: var(--yellow);
  border: .1rem solid var(--ink); font-size: 1rem; flex: none; }
.ready-text { font-size: 1.1rem; font-weight: 600; flex: 1; min-width: 0; }
.ready-note { font: .8rem var(--mono); color: var(--muted); }
.foot { font-size: 1.2rem; font-weight: 500; max-width: 30rem; margin: 0; }

/* Full screen toggle: top right, above the game. */
#fs { position: fixed; top: 2.7rem; right: 3.2rem; z-index: 4; display: inline-flex; align-items: center; gap: .5rem;
  height: 2.6rem; padding: 0 .9rem; font-size: .85rem; background: #fff; transition: transform .14s var(--ease), box-shadow .14s var(--ease), opacity .3s; }
#fs[hidden] { display: none; }
#fs .icon { font-size: 1rem; }
#fs.on { background: var(--yellow); }
#fs kbd { font: 500 .65rem var(--mono); padding: .1rem .35rem; border: .1rem solid var(--ink); border-radius: .3rem; background: var(--cream); }
#fs kbd[hidden] { display: none; }
#fs.idle { opacity: 0; }
#fs.idle:hover { opacity: 1; }
#stage.loading ~ #fs, #game:not([hidden]) ~ #fs { top: 1.2rem; right: 1.2rem; }

/* "Opening…" loader: mirrors GameLoader.swift, laid out on the 1280x720 rem canvas. */
#stage.loading { padding: 0; align-items: center; justify-content: center; gap: 2.4rem; overflow: hidden; }
#stage.loading::before { content: ''; position: absolute; inset: -4rem; z-index: -1;
  background: repeating-linear-gradient(-45deg, var(--cream) 0 1.3rem, var(--stripe) 1.3rem 2.6rem); animation: slide 2.45s linear infinite; }
@keyframes slide { to { transform: translateX(3.68rem); } }
.loader { display: contents; }
.hero { position: relative; width: 26rem; height: 21rem; display: grid; place-items: center; }
.burst { position: absolute; width: 26rem; height: 26rem; left: 0; top: -2.5rem; animation: pop .5s .12s cubic-bezier(.34, 1.8, .64, 1) both, turn 16s linear infinite; }
.burst polygon { fill: var(--yellow); stroke: var(--ink); stroke-width: .6; stroke-linejoin: round; }
.card-wrap { position: relative; transform: rotate(-4deg); animation: pop .55s cubic-bezier(.34, 1.5, .64, 1) both, rock 5.2s ease-in-out infinite; }
.game-card { width: 20rem; background: #fff; border: .19rem solid var(--ink); border-radius: .9rem; overflow: hidden;
  animation: lift 2.6s ease-in-out infinite; }
.game-card .art { border-bottom: .19rem solid var(--ink); }
.game-card .strip { display: flex; flex-direction: column; gap: .15rem; padding: .6rem .9rem; }
.game-card .strip b { font-size: 1.4rem; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-card .strip span { font: .7rem var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.caption { font: 700 1.1rem var(--mono); letter-spacing: .14em; background: var(--cream);
  border: .16rem solid var(--ink); border-radius: 99rem; padding: .45rem .9rem; box-shadow: .19rem .19rem 0 var(--ink); animation: fade .3s .25s both; }
.dots { display: inline-block; width: 3ch; text-align: left; }
.dots::after { content: ''; animation: dots 1.33s steps(1) infinite; }
.bar { position: relative; width: 18rem; height: 1.4rem; border-radius: 99rem; background: var(--cream); border: .19rem solid var(--ink);
  box-shadow: .25rem .25rem 0 var(--ink); overflow: hidden; animation: fade .3s .35s both; }
.block { position: absolute; top: .12rem; bottom: .12rem; left: .2rem; width: 30%; border-radius: 99rem; border: .12rem solid var(--ink);
  background: repeating-linear-gradient(-45deg, rgba(255,255,255,.35) 0 .45rem, transparent .45rem .9rem) var(--pink); animation: shuttle 2.4s ease-in-out infinite alternate; }
@keyframes pop { from { transform: scale(0); } }
@keyframes turn { to { rotate: 360deg; } }
@keyframes rock { 0%, 100% { rotate: -3.5deg; } 50% { rotate: 3.5deg; } }
@keyframes lift { 0%, 100% { transform: translate(0, 0); box-shadow: .25rem .25rem 0 var(--ink); } 50% { transform: translate(-.3rem, -.3rem); box-shadow: .62rem .62rem 0 var(--ink); } }
@keyframes shuttle { 0% { left: .2rem; width: 26%; } 50% { width: 44%; } 100% { left: calc(100% - 26% - .2rem); width: 26%; } }
@keyframes fade { from { opacity: 0; } }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
@media (prefers-reduced-motion: reduce) {
  #stage.loading::before, .burst, .card-wrap, .game-card, .block, .caption, .bar, .dots::after { animation: none; }
  .dots::after { content: '...'; }
  #game, #fs, button, .cta .icon { transition: none; }
  button:hover { transform: none; }
}

#tip { position: fixed; right: 1.2rem; bottom: 1.2rem; max-width: 26rem; background: var(--ink); color: var(--cream);
  border-radius: 1rem; padding: 1rem 1.2rem; font-size: 1rem; line-height: 1.4; z-index: 5; box-shadow: 0 .4rem 1.6rem rgba(0,0,0,.25); }
#tip p { margin: 0 0 .8rem; }
.tip-actions { display: flex; gap: .6rem; }
.tip-actions button { font-size: .95rem; padding: .45rem .8rem; box-shadow: none; }
#dismiss { background: transparent; color: var(--cream); border-color: var(--cream); }
#dismiss:focus-visible { outline-color: var(--pink); }
#badge { position: fixed; left: 1.2rem; bottom: 1.2rem; z-index: 3; background: var(--ink); color: var(--cream);
  font: 500 .9rem var(--mono); padding: .45rem .8rem; border-radius: 99rem; }

/* Portrait windows and phones: one column. */
@media (max-aspect-ratio: 1/1) {
  :root { font-size: 2.6vw; }
  #stage { overflow-y: auto; }
  .top { padding-right: 0; flex-wrap: wrap; }
  #fs { top: auto; bottom: 1.2rem; right: 1.2rem; }
  .split, .cards, .feature { flex-direction: column; }
  .showcase { display: none; }
  .cover { width: 100%; }
  .steps { grid-template-columns: 1fr; }
  form { flex-direction: column; }
  input { width: 100%; }
  .cta { justify-content: center; min-height: 3.2rem; }
}

/* End-of-game recap, over the game's view. */
#stage.over { z-index: 1; background: repeating-linear-gradient(-45deg, var(--cream) 0 1.3rem, var(--stripe) 1.3rem 2.6rem); }
.recap { display: flex; gap: 2rem; flex: 1; min-height: 0; }
.recap-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: .9rem; }
.recap h1 { font-size: 4rem; }
.kicker { margin: 0; font: 700 1rem ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }
.podium { list-style: none; margin: .4rem 0 0; padding: 0; width: 100%; max-width: 40rem; display: grid; gap: .5rem; }
.podium li { display: flex; align-items: center; gap: 1rem; background: #fff; border: .2rem solid var(--ink); border-radius: .8rem; padding: .45rem 1rem; font-size: 1.35rem; }
.podium li.first { background: var(--yellow); box-shadow: .25rem .25rem 0 var(--ink); }
.podium b { font: 900 1.3rem ui-monospace, monospace; width: 1.6rem; }
.podium .who { flex: 1; min-width: 0; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium small { font-weight: 500; font-size: .9rem; margin-left: .6rem; }
.podium .score { font: 700 1.2rem ui-monospace, monospace; }
.night { flex: none; width: 19rem; align-self: flex-start; background: var(--ink); color: var(--cream); border-radius: 1rem; padding: 1.2rem 1.3rem; }
.night .count { margin: .3rem 0 .8rem; font-size: 2.4rem; font-weight: 900; }
.night ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; font-size: 1.2rem; }
.night li { display: flex; justify-content: space-between; gap: 1rem; border-top: .1rem solid rgba(250, 246, 236, .25); padding-top: .45rem; }
.night li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot.wide { max-width: none; }
@media (max-aspect-ratio: 1/1) { .recap { flex-direction: column; } .night { width: 100%; } .recap h1 { font-size: 3rem; } }
