/* The party page: its screens (how to play, who is playing, which games, the scores), and the pieces every game screen shares. */
.game-page {
  display: grid;
  gap: 20px;
  max-width: 520px;
  margin: 0 auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  padding-block: calc(12px + env(safe-area-inset-top, 0px)) calc(32px + env(safe-area-inset-bottom, 0px));
}

/* The top of the page: the way home, and the room code. The right side is kept clear for the full screen button. */
.bar { display: flex; align-items: center; gap: 12px; min-height: 44px; padding-right: 136px; }
.mini { min-height: 44px; display: flex; align-items: center; gap: .3em; color: var(--white); font: 800 16px/1 var(--logo); letter-spacing: -.03em; text-decoration: none; white-space: nowrap; }
.mini span { color: var(--gold); }
.code-chip { min-height: 38px; padding: 0 12px; display: flex; align-items: center; gap: 8px; color: var(--muted); background: var(--panel-up); border: 0; border-radius: 12px; box-shadow: 0 3px 0 #120e36, inset 0 1px 0 rgba(255, 255, 255, .14); font: 600 13px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; transition: transform .08s ease-out; }
.code-chip:active { transform: translateY(2px); }
.code-chip b { color: var(--gold); font: 700 15px/1 var(--logo); letter-spacing: .1em; }
@media (max-width: 480px) { .code-chip span { display: none; } }

.screen { display: grid; gap: 16px; min-width: 0; animation: pop .45s var(--ease); }
.big { margin: 0; font: 800 clamp(30px, 9vw, 44px)/1.08 var(--logo); letter-spacing: -.03em; text-wrap: balance; }
.wait { margin: 0; font-size: 18px; line-height: 1.4; color: var(--muted); }
.wait:empty { display: none; }
.quiet { justify-self: center; min-height: 44px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); background: transparent; border: 0; border-radius: 12px; font: 600 16px/1.2 var(--body); text-decoration: none; transition: color .2s, background .2s; }
.quiet:hover { color: var(--text); background: rgba(255, 255, 255, .06); }

/* A big choice: a picture, what it is, and an arrow */
.choice { width: 100%; min-height: 100px; padding: 16px 12px 16px 16px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; justify-content: stretch; gap: 14px; border-radius: var(--radius); text-align: left; }
.choice .art { width: 58px; height: 58px; display: grid; place-items: center; color: #2a1600; background: linear-gradient(180deg, var(--gold), var(--gold-2)); border-radius: 16px; box-shadow: 0 3px 0 var(--gold-edge), inset 0 2px 0 rgba(255, 255, 255, .5); }
.choice .art.mint { color: #05302b; background: linear-gradient(180deg, #4be3d2, #25c9b6); box-shadow: 0 3px 0 #0d8c7d, inset 0 2px 0 rgba(255, 255, 255, .5); }
.choice .art .icon { width: 32px; height: 32px; }
.choice b { display: block; font: 700 18px/1.15 var(--logo); letter-spacing: -.02em; }
.choice small { display: block; margin-top: 5px; font: 500 16px/1.3 var(--body); letter-spacing: 0; color: var(--muted); }
.choice > .icon { width: 24px; height: 24px; color: var(--muted); }

/* Typing: a name, a room code */
.add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.add input, .join-form input {
  min-height: 58px;
  width: 100%;
  padding: 0 18px;
  color: var(--text);
  background: var(--well);
  border: 2px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, .45);
  font-size: 20px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.add input::placeholder, .join-form input::placeholder { color: #7f78ad; }
.add input:focus, .join-form input:focus { border-color: var(--gold); box-shadow: inset 0 3px 8px rgba(0, 0, 0, .45), 0 0 0 4px rgba(255, 197, 61, .18); }
.add button { --drop: 5px; min-height: 53px; padding: 0 22px; border-radius: 16px; font-size: 17px; }
.join-form { display: grid; gap: 10px; }
.join-form label { margin-top: 4px; font: 700 13px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.join-form .code-in { min-height: 72px; font: 800 30px/1 var(--logo); letter-spacing: .32em; text-indent: .32em; text-transform: uppercase; text-align: center; }
.join-form .go { margin-top: 10px; }

.go { width: 100%; min-height: 64px; padding: 8px 18px; border-radius: 20px; font-size: 20px; }
.pill { --drop: 4px; min-height: 40px; padding: 0 14px; gap: 7px; border-radius: 13px; font: 700 15px/1 var(--body); letter-spacing: .01em; }
.pill.wide { --drop: 5px; width: 100%; min-height: 52px; border-radius: 16px; font-size: 18px; }

/* The ticket to join by: the QR code, and the room code in letter tiles */
.join-card { justify-self: center; width: min(100%, 340px); margin-bottom: 6px; padding: 16px 16px 18px; display: grid; justify-items: center; gap: 14px; color: var(--ink); background: var(--white); border-radius: 26px; box-shadow: 0 6px 0 #a79fd6, 0 26px 34px -16px rgba(0, 0, 0, .65); }
.join-card .split { width: 100%; height: 0; border-top: 2px dashed #cdc6ee; }
.join-card small { display: block; margin-bottom: 8px; font: 700 13px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; text-align: center; color: #6d6698; }
.code-tiles { display: flex; justify-content: center; gap: 6px; }
.code-tiles i { width: 46px; height: 54px; display: grid; place-items: center; color: var(--white); background: var(--ink); border-radius: 12px; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .3); font: 800 26px/1 var(--logo); font-style: normal; }
.big-qr, .big-qr img, .big-qr canvas { width: min(62vw, 230px) !important; height: min(62vw, 230px) !important; }

/* The party before it starts: players on one side, games on the other */
.lobby, .lobby-a, .lobby-b { display: grid; gap: 14px; min-width: 0; align-content: start; }
.sec { margin: 6px 0 0; display: flex; align-items: center; gap: 10px; font: 700 21px/1.1 var(--logo); letter-spacing: -.02em; }
.sec .tally:empty { display: none; }
.sec .tally { padding: 4px 9px; color: var(--muted); background: var(--well); border-radius: 999px; font: 700 13px/1 var(--body); letter-spacing: .02em; }
.sub-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; }
.sub-row .wait { font-size: 16px; }
.group { margin: 8px 0 -4px; font: 700 13px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); list-style: none; }
.lobby-foot { position: sticky; bottom: 0; z-index: 5; display: grid; gap: 10px; margin: 0 -6px calc(-32px - env(safe-area-inset-bottom, 0px)); padding: 16px 6px calc(16px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, rgba(12, 10, 36, .97) 60%, transparent); }

/* A player's disc: their first letter on their colour */
.ava { flex: none; width: 36px; height: 36px; display: grid; place-items: center; color: var(--ink); background: var(--c, var(--white)); border-radius: 50%; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18), inset 0 2px 0 rgba(255, 255, 255, .45); font: 800 15px/1 var(--logo); }

/* A list whose rows can be dragged into order: the players, the games picked */
.order { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.order:empty { display: none; }
.order li { position: relative; min-height: 58px; padding: 6px 4px 6px 12px; display: flex; align-items: center; gap: 10px; background: var(--panel); border-radius: 16px; box-shadow: var(--shade); transition: background .2s, box-shadow .2s, transform .2s var(--ease); }
.order li.dragging { z-index: 2; background: var(--panel-up); box-shadow: 0 18px 30px -10px rgba(0, 0, 0, .75), inset 0 0 0 2px var(--gold); transform: scale(1.02); }
.order .num { width: 1.1em; flex: none; font: 700 14px/1 var(--logo); color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.order .thumb { width: 40px; height: 40px; border-radius: 12px; }
.order .thumb .icon { width: 22px; height: 22px; }
.order .nm { flex: 1; min-width: 0; font-size: 19px; font-weight: 600; overflow-wrap: anywhere; }
.order .crown { width: 18px; height: 18px; color: var(--gold); vertical-align: -2px; }
.order .note { flex: none; padding: 6px 10px; color: var(--gold); background: rgba(255, 197, 61, .14); border-radius: 999px; font: 700 14px/1 var(--body); white-space: nowrap; }
.order .acts { display: flex; flex: none; }
.order .acts button { width: 40px; height: 46px; padding: 0; display: grid; place-items: center; color: var(--muted); background: transparent; border: 0; border-radius: 12px; transition: color .2s, background .2s; }
.order .acts button:hover { color: var(--text); background: rgba(255, 255, 255, .07); }
.order .acts .icon { width: 22px; height: 22px; }
.order .handle { touch-action: none; cursor: grab; }
.order li:only-child .handle { visibility: hidden; }

/* The games to tick */
.ticks { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ticks button { width: 100%; min-height: 70px; padding: 9px 12px 9px 10px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; text-align: left; color: var(--text); background: var(--panel); border: 0; border-radius: 18px; box-shadow: var(--shade); transition: background .2s, box-shadow .2s, transform .08s ease-out; }
.ticks button:not(:disabled):active { transform: translateY(2px); }
.ticks button:disabled { cursor: default; }
.ticks .tx { min-width: 0; display: grid; gap: 3px; }
.ticks .tx b { font: 700 17px/1.15 var(--logo); letter-spacing: -.02em; }
.ticks .tx small { font-size: 15.5px; line-height: 1.25; color: var(--muted); }
.ticks .box { width: 30px; height: 30px; display: grid; place-items: center; color: transparent; border: 2px solid rgba(255, 255, 255, .28); border-radius: 50%; transition: background .2s, border-color .2s, transform .3s var(--spring); }
.ticks .box .icon { width: 18px; height: 18px; stroke-width: 3.2; }
.ticks button[aria-checked="true"] { background: #2b2259; box-shadow: 0 3px 0 rgba(0, 0, 0, .28), inset 0 0 0 2px var(--gold); }
.ticks button[aria-checked="true"] .box { color: #2a1600; background: var(--gold); border-color: var(--gold); transform: scale(1.08); }
.ticks .cant { opacity: .5; }
.ticks .plain { grid-template-columns: auto minmax(0, 1fr); }
.tick-empty { min-height: 70px; background: rgba(15, 11, 46, .5); border: 2px dashed rgba(255, 255, 255, .16); border-radius: 18px; }

/* Scores */
.board { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.board li { min-height: 62px; padding: 8px 16px 8px 12px; display: flex; align-items: center; gap: 12px; background: var(--panel); border-radius: 18px; box-shadow: var(--shade); animation: pop .5s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 70ms); }
.board .place { width: 30px; height: 30px; flex: none; display: grid; place-items: center; color: var(--muted); background: var(--well); border-radius: 50%; font: 800 14px/1 var(--logo); }
.board .p1 .place { color: #4a2c00; background: linear-gradient(180deg, #ffe08a, #ffb72e); box-shadow: 0 2px 0 var(--gold-edge); }
.board .p2 .place { color: #2c2a48; background: linear-gradient(180deg, #f4f3ff, #b9b6d6); box-shadow: 0 2px 0 #807da3; }
.board .p3 .place { color: #48230a; background: linear-gradient(180deg, #ffc9a0, #e08a4f); box-shadow: 0 2px 0 #9c5425; }
.board .nm { flex: 1; min-width: 0; font-size: 19px; font-weight: 600; overflow-wrap: anywhere; }
.board .gain { flex: none; padding: 6px 10px; color: #05302b; background: var(--cyan); border-radius: 999px; font: 800 14px/1 var(--logo); animation: pop-in .5s var(--spring) backwards; animation-delay: calc(var(--i, 0) * 70ms + .35s); }
.board .total { flex: none; min-width: 1.6em; font: 800 26px/1 var(--logo); text-align: right; font-variant-numeric: tabular-nums; }
.board .p1 { background: linear-gradient(180deg, #382d7c, #2a2266); box-shadow: 0 3px 0 rgba(0, 0, 0, .28), inset 0 0 0 2px var(--gold); }
@keyframes pop-in { from { opacity: 0; transform: scale(.4); } }

/* A plain list of people with something beside each name: results, streaks */
.rows { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rows:empty { display: none; }
.rows li { min-height: 54px; padding: 6px 12px; display: flex; align-items: center; gap: 10px; background: var(--panel); border-radius: 16px; box-shadow: var(--shade); font-size: 19px; font-weight: 600; }
.rows .nm { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rows .chip { flex: none; padding: 6px 11px; color: var(--ink); background: var(--white); border-radius: 999px; font: 700 15px/1 var(--body); white-space: nowrap; }
.rows li.winner { box-shadow: 0 3px 0 rgba(0, 0, 0, .28), inset 0 0 0 2px var(--gold); }
.rows li.winner .chip { color: #2a1600; background: var(--gold); }

/* The game itself, and what the party page puts under it */
.stage { display: grid; gap: 16px; min-width: 0; }
.stage-foot { display: grid; gap: 10px; margin-top: 16px; }

/* The heading of a game screen: whose turn it is, and what to do */
.turn { display: grid; gap: 4px; min-height: 80px; align-content: start; }
.turn h1 { margin: 0; font: 800 clamp(26px, 8vw, 36px)/1.1 var(--logo); letter-spacing: -.03em; overflow-wrap: anywhere; }
.turn p { margin: 0; font-size: 18px; color: var(--muted); }

/* A full-screen sheet over the page: the drawn card, the code to join */
.reveal {
  position: fixed;
  z-index: 50;
  inset: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  padding-block: calc(70px + env(safe-area-inset-top, 0px)) calc(20px + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(120% 70% at 50% 0%, #2f2182 0%, #130e38 55%, #0c0a24 100%);
  animation: fade .25s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.reveal > * { width: 100%; max-width: 520px; margin-inline: auto; }
.reveal > .pc, .reveal > .join-card { width: auto; flex: none; }
.reveal h2 { margin-block: 8px 0; font: 800 clamp(30px, 9.5vw, 46px)/1.08 var(--logo); letter-spacing: -.03em; text-align: center; text-wrap: balance; color: var(--gold); text-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.reveal p { margin-block: 0; }
.for-you { margin-bottom: 4px; padding: 14px 16px; color: #2a1600; background: linear-gradient(180deg, var(--gold), var(--gold-2)); border-radius: 16px; box-shadow: 0 4px 0 var(--gold-edge); font-size: 21px; font-weight: 700; line-height: 1.2; text-align: center; text-wrap: balance; }
.rule { font-size: 21px; line-height: 1.35; text-align: center; text-wrap: balance; }
.picks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; }
.picks button { --drop: 5px; min-height: 56px; padding: 6px 10px; border-radius: 16px; font: 700 19px/1.15 var(--body); letter-spacing: 0; overflow-wrap: anywhere; }
.reveal .go { margin-top: auto; flex: none; }

@media (min-width: 900px) {
  .party-page.wide { max-width: 1040px; }
  .party-page.wide .lobby { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 48px; }
  .party-page.wide .lobby-foot { grid-column: 1 / -1; justify-self: center; width: min(100%, 520px); }
  .party-page.race-wide { max-width: 1240px; }
}
@media (prefers-reduced-motion: reduce) { .screen, .reveal, .board li, .board .gain { animation: none; } }
