/* TV screens. Colors and fonts come from core/theme.js as CSS variables;
   the three [data-theme] blocks only change the "feel" (borders, shadows, tilt). */

:root {
  --card-border: var(--outline) solid var(--ink);
  --card-shadow: 8px 8px 0 var(--ink);
  --chip-shadow: 5px 5px 0 var(--ink);
  --tilt: 0deg;
}
:root[data-theme="neon"] {
  --card-border: 3px solid var(--accent);
  --card-shadow: 0 0 22px color-mix(in srgb, var(--accent) 55%, transparent), inset 0 0 18px color-mix(in srgb, var(--accent) 25%, transparent);
  --chip-shadow: 0 0 14px color-mix(in srgb, var(--pc, var(--accent)) 60%, transparent);
}
:root[data-theme="paper"] {
  --card-border: 0 solid transparent;
  --card-shadow: 0 4px 0 rgba(46,42,38,.16), 0 14px 24px rgba(46,42,38,.2);
  --chip-shadow: 0 3px 0 rgba(46,42,38,.18), 0 8px 14px rgba(46,42,38,.18);
  --tilt: -1.2deg;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
/* Pinned to the screen so the 1920-wide stage never widens the page (phones and tablets would
   otherwise zoom the whole TV out and the fit would be wrong). */
body { position: fixed; inset: 0; width: 100%; touch-action: manipulation; }
#stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; }
#game { position: absolute; inset: 0; width: 1920px; height: 1080px; display: block; }
#ui { position: absolute; inset: 0; font-family: var(--font-body); color: var(--ink); font-weight: 800; }
#ui[data-phase="playing"], #ui[data-phase="countdown"] { pointer-events: none; }

.screen { position: absolute; inset: 0; padding: 56px 72px; display: flex; flex-direction: column; gap: 36px; }
.card { background: var(--surface); border: var(--card-border); border-radius: calc(var(--radius) + 6px); box-shadow: var(--card-shadow); padding: 32px; }
:root[data-theme="paper"] .card { transform: rotate(var(--tilt)); }
.lbl { font-size: 28px; text-transform: uppercase; letter-spacing: 3px; color: var(--ink); }
:root[data-theme="neon"] .lbl { color: var(--accent); letter-spacing: 1px; font-size: 32px; }
:root[data-theme="paper"] .lbl { text-transform: none; letter-spacing: 0; font-size: 34px; }

.title { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 108px; line-height: 1; color: #FFFFFF;
  -webkit-text-stroke: calc(var(--outline) * 2) var(--ink); paint-order: stroke fill; text-shadow: 8px 8px 0 var(--ink); text-transform: uppercase; }
.title.small { font-size: 76px; text-shadow: 6px 6px 0 var(--ink); }
:root[data-theme="neon"] .title { -webkit-text-stroke: 0; font-size: 80px; text-shadow: 0 0 10px var(--bad), 0 0 26px var(--bad), 5px 5px 0 var(--accent); }
:root[data-theme="neon"] .title.small { font-size: 52px; }
:root[data-theme="paper"] .title { -webkit-text-stroke: 0; text-transform: none; text-shadow: none; color: var(--accentText);
  background: var(--accent); display: inline-block; padding: 8px 36px 16px; transform: rotate(-2deg); box-shadow: var(--chip-shadow); align-self: flex-start; }

.bar { display: flex; justify-content: space-between; align-items: center; }
.pill { background: var(--surface); border: var(--card-border); border-radius: 999px; padding: 14px 30px; font-size: 32px; box-shadow: var(--chip-shadow); }
:root[data-theme="neon"] .pill { border: 0; box-shadow: none; background: none; color: var(--gold); font-size: 40px; }

.cols { display: flex; gap: 44px; flex: 1; min-height: 0; }
.join { width: 470px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.qr { width: 300px; height: 300px; background: #fff; border-radius: 14px; padding: 10px; image-rendering: pixelated; }
.url { font-size: 26px; word-break: break-all; text-align: center; }
.code { display: flex; gap: 12px; }
.code span { width: 84px; height: 100px; display: grid; place-items: center; font-family: var(--font-display); font-size: 64px; font-weight: 400;
  background: var(--accent); color: var(--accentText); border: var(--card-border); border-radius: calc(var(--radius) - 4px); box-shadow: var(--chip-shadow); }
:root[data-theme="neon"] .code span { background: none; color: var(--gold); border: 0; box-shadow: none; width: 64px; text-shadow: 0 0 14px var(--gold); font-size: 52px; }
:root[data-theme="paper"] .code span:nth-child(1) { background: var(--p0); transform: rotate(-4deg); }
:root[data-theme="paper"] .code span:nth-child(2) { background: var(--p1); transform: rotate(3deg); }
:root[data-theme="paper"] .code span:nth-child(3) { background: var(--p2); transform: rotate(-2deg); }
:root[data-theme="paper"] .code span:nth-child(4) { background: var(--p3); transform: rotate(4deg); }

.main { flex: 1; display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.seats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.seats.col { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.seat { height: 140px; display: flex; align-items: center; gap: 18px; padding: 0 22px; border-radius: calc(var(--radius) + 4px);
  background: var(--pc); color: var(--pt); border: var(--card-border); box-shadow: var(--chip-shadow); min-width: 0; }
.seat .dot { width: 68px; height: 68px; border-radius: 50%; background: var(--light); border: var(--card-border); flex: none; }
.seat .who { min-width: 0; }
.seat .nm { font-size: 36px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .st { font-size: 22px; }
.seat.open { background: var(--open); color: var(--inkSoft); border-style: dashed; box-shadow: none; }
.seat.open .dot { opacity: .45; }
.seat.away { opacity: .55; }
:root[data-theme="neon"] .seat { background: var(--bg); color: #fff; border: 3px solid var(--pc); }
:root[data-theme="neon"] .seat .st { color: var(--pc); }
:root[data-theme="neon"] .seat .dot { background: var(--pc); border: 0; box-shadow: 0 0 12px var(--pc); width: 22px; height: 22px; border-radius: 0; }
:root[data-theme="neon"] .seat.open { border: 3px dashed var(--open); color: var(--inkSoft); }
:root[data-theme="paper"] .seat:nth-child(odd) { transform: rotate(-1.2deg); }
:root[data-theme="paper"] .seat:nth-child(even) { transform: rotate(1deg); }
:root[data-theme="paper"] .seat.open { background: transparent; border: 3px dashed #8C7B66; }

.games { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px; flex: 1; }
.game { all: unset; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; padding: 22px; border-radius: calc(var(--radius) + 4px);
  background: var(--accent); color: var(--accentText); border: var(--card-border); box-shadow: var(--card-shadow); font-family: var(--font-body); }
/* Eight colors in a cycle: no two neighbours match, across or down (5 or 6 to a row). */
.game:nth-child(8n+1) { background: var(--p0); color: var(--p0-text); }
.game:nth-child(8n+2) { background: var(--p4); color: var(--p4-text); }
.game:nth-child(8n+3) { background: var(--p1); color: var(--p1-text); }
.game:nth-child(8n+4) { background: var(--p2); color: var(--p2-text); }
.game:nth-child(8n+5) { background: var(--p3); color: var(--p3-text); }
.game:nth-child(8n+6) { background: var(--p5); color: var(--p5-text); }
.game:nth-child(8n+7) { background: var(--p6); color: var(--p6-text); }
.game:nth-child(8n+8) { background: var(--p7); color: var(--p7-text); }
.game .gi { width: 84px; height: 84px; display: grid; place-items: center; background: var(--light); color: var(--ink); border: var(--card-border); border-radius: calc(var(--radius) - 4px); }
.game .mt { display: flex; flex-direction: column; min-width: 0; }
.game .gn { font-family: var(--font-display); font-size: 40px; line-height: 1.05; }
.game .gp { font-size: 22px; margin-top: 6px; }
.game.soon { filter: saturate(.35); opacity: .75; cursor: default; }
.game:not(.soon):hover { transform: translateY(-6px) rotate(-1.5deg); }
:root[data-theme="neon"] .game { background: none !important; color: #fff !important; border: 2px solid var(--open); box-shadow: none; }
:root[data-theme="neon"] .game:not(.soon) { border-color: var(--accent); box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 55%, transparent); }
:root[data-theme="neon"] .game .gi { background: none; color: var(--accent); border: 0; }
:root[data-theme="neon"] .game .gn { font-size: 26px; line-height: 1.3; }
:root[data-theme="paper"] .game { box-shadow: var(--chip-shadow); }
:root[data-theme="paper"] .game:nth-child(odd) { transform: rotate(-1.5deg); }
:root[data-theme="paper"] .game:nth-child(even) { transform: rotate(1.2deg); }
:root[data-theme="paper"] .game .gi { background: none; color: inherit; border: 0; }

/* how-to / ready: the game runs live in a window (practice), rules on the right */
#stage.practice { background: var(--bg); }
#stage.practice #world, #stage.practice #game { transform-origin: 0 0; transform: translate(56px, 56px) scale(0.6); }
#ui[data-phase="howto"] { pointer-events: none; }
.howto { padding: 0; }
.pframe { position: absolute; left: 42px; top: 42px; width: 1180px; height: 676px; border: 14px solid var(--light); box-shadow: var(--card-shadow); }
.ptag { position: absolute; left: -22px; top: -26px; background: var(--gold); color: var(--ink); font-family: var(--font-display); font-size: 36px; padding: 4px 26px; transform: rotate(-4deg); box-shadow: var(--chip-shadow); }
.howto .rules { position: absolute; left: 1262px; right: 48px; top: 42px; height: 676px; display: flex; flex-direction: column; gap: 16px; padding: 26px 28px; }
.howto .rules .title.small { font-size: 60px; }
.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; font-size: 27px; line-height: 1.2; }
.steps li { display: flex; gap: 14px; align-items: center; }
.steps .n { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accentText); flex: none; font-family: var(--font-display); font-size: 24px; }
.tip { margin-top: auto; font-size: 23px; line-height: 1.3; color: var(--inkSoft); background: var(--open); padding: 14px 18px; border-radius: var(--radius); }
.howto .bottom { position: absolute; left: 48px; right: 48px; top: 760px; display: flex; flex-direction: column; gap: 12px; }
.howto .bottom .seats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.howto .seat { height: 100px; }
.howto .seat .nm { font-size: 28px; }
.howto .seat .dot { width: 50px; height: 50px; }
.sit { font-size: 22px; background: var(--surface); padding: 8px 16px; border-radius: var(--radius); box-shadow: var(--chip-shadow); align-self: flex-start; }

/* countdown */
.count { align-items: center; justify-content: center; }
.count .num { font-family: var(--font-display); font-size: 360px; color: #fff; -webkit-text-stroke: 14px var(--ink); paint-order: stroke fill; text-shadow: 14px 14px 0 var(--ink); animation: pop .9s ease-out infinite; }
:root[data-theme="neon"] .count .num { -webkit-text-stroke: 0; text-shadow: 0 0 30px var(--accent), 0 0 60px var(--accent); font-size: 220px; }
@keyframes pop { from { transform: scale(1.35); } to { transform: scale(1); } }

.corner { position: absolute; right: 24px; bottom: 18px; font-size: 22px; color: var(--ink); background: var(--surface); padding: 6px 14px; border-radius: 999px; opacity: .85; }

/* results */
.results { flex-direction: row; align-items: stretch; }
.results .left { flex: 1; display: flex; flex-direction: column; gap: 26px; }
.results .right { width: 520px; display: flex; flex-direction: column; gap: 20px; }
.ranking { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.ranking .row { display: grid; grid-template-columns: 70px 1fr auto 90px; align-items: center; gap: 18px; padding: 12px 22px; border-radius: var(--radius);
  background: var(--pc); color: var(--pt); border: var(--card-border); box-shadow: var(--chip-shadow); }
.ranking .pl { font-family: var(--font-display); font-size: 48px; }
.ranking .nm { font-size: 36px; display: flex; flex-direction: column; }
.ranking .nm small { font-size: 22px; font-weight: 700; }
.ranking .sc { font-family: var(--font-display); font-size: 44px; }
.ranking .pts { font-size: 30px; text-align: right; }
:root[data-theme="neon"] .ranking .row { background: none; color: #fff; border: 2px solid var(--pc); }
.standings { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; font-size: 34px; }
.standings li { display: flex; align-items: center; gap: 14px; }
.standings .sw { width: 28px; height: 28px; border-radius: 50%; background: var(--pc); flex: none; }
.standings b { margin-left: auto; font-family: var(--font-display); font-weight: 400; }
.hint { margin-top: auto; font-size: 24px; color: var(--inkSoft); }

.toast { position: absolute; left: 50%; top: 40px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 16px 30px; border-radius: 999px; font-size: 30px; }
.toast.warn { background: var(--bad); color: #fff; }
:root[data-theme="neon"] .toast { background: var(--bad); color: var(--bg); }

/* ---- party layer: chips, teams, six games, podium ---- */
.barright { display: flex; gap: 16px; align-items: center; }
.hintpill { font-size: 24px; background: var(--accent); color: var(--accentText); animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(-5px); } }
.lblrow { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { font-size: 22px; background: var(--ink); color: var(--bg); padding: 6px 16px; border-radius: 999px; transform: rotate(-1.5deg); box-shadow: var(--chip-shadow); }
.chip:nth-child(even) { transform: rotate(1.5deg); background: var(--accent); color: var(--accentText); }
.seat .dot { display: grid; place-items: center; }
.seat.open .dot svg { display: none; }
.tm { display: inline-block; font-style: normal; font-size: 17px; color: #FFF8EC; padding: 1px 10px; border-radius: 999px; margin-left: 8px; border: 2px solid #FFF8EC; }
.games.n6, .games.n7, .games.n8 { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.games.n7, .games.n8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.games.n6 .game { padding: 16px; }
.games.n6 .game .gn { font-size: 32px; }
.games.n6 .game .gi { width: 70px; height: 70px; }
.howto .top .head .chips { margin-top: 6px; }
.teams { display: flex; gap: 16px; }
.team { flex: 1; color: #FFF8EC; padding: 10px 20px; border-radius: var(--radius); display: flex; justify-content: space-between; align-items: baseline; font-size: 28px; box-shadow: var(--chip-shadow); opacity: .7; }
.team.won { opacity: 1; transform: rotate(-1deg) scale(1.03); }
.team b { font-family: var(--font-display); font-weight: 400; font-size: 36px; }
.ranking .nm > span { display: flex; align-items: center; gap: 10px; }
.ranking.tight { gap: 8px; }
.ranking.tight .row { padding: 5px 20px; }
.ranking.tight .pl { font-size: 36px; } .ranking.tight .nm { font-size: 28px; } .ranking.tight .nm small { font-size: 18px; } .ranking.tight .sc { font-size: 34px; }
.standings .sw { display: grid; place-items: center; width: 34px; height: 34px; }
.results .row { animation: slidein .5s both; }
.results .row:nth-child(2) { animation-delay: .08s; } .results .row:nth-child(3) { animation-delay: .16s; } .results .row:nth-child(4) { animation-delay: .24s; }
.results .row:nth-child(n+5) { animation-delay: .32s; }
@keyframes slidein { from { opacity: 0; transform: translateX(-60px) rotate(-2deg); } }
.podium { align-items: center; gap: 30px; }
.podium .title { font-size: 76px; }
.steps3 { display: flex; align-items: flex-end; gap: 30px; flex: 1; }
.step { width: 360px; display: flex; flex-direction: column; align-items: center; gap: 8px; animation: rise .9s cubic-bezier(.2,1.4,.4,1) both; }
.step.s2 { animation-delay: .3s; } .step.s3 { animation-delay: .6s; } .step.s1 { animation-delay: .9s; }
@keyframes rise { from { transform: translateY(700px); } }
.step .ribbon { font-family: var(--font-display); font-size: 44px; background: var(--gold); color: var(--ink); padding: 4px 26px; transform: rotate(-3deg); box-shadow: var(--chip-shadow); }
.step .face { width: 150px; height: 150px; border-radius: 50%; background: var(--pc); display: grid; place-items: center; border: 10px solid var(--light); box-shadow: var(--chip-shadow); }
.step .nm { font-size: 44px; } .step .tot { font-size: 28px; color: var(--inkSoft); }
.step .block { width: 100%; background: var(--pc); border: 8px solid var(--light); box-shadow: var(--card-shadow); }
.step.s1 .block { height: 300px; } .step.s2 .block { height: 210px; } .step.s3 .block { height: 140px; }
.rest { list-style: none; margin: 0; padding: 0; display: flex; gap: 30px; font-size: 30px; }
.rest b { font-family: var(--font-display); font-weight: 400; }
.corner { font-size: 20px; opacity: .8; }

.games.many { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.games.many .game { padding: 12px 14px; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; }
.games.many .game .gi { width: 54px; height: 54px; flex: none; } .games.many .game .gi svg { width: 34px; height: 34px; }
.games.many .game .gn { font-size: 25px; line-height: 1; } .games.many .game .gp { display: none; }

/* motion guide on the practice screen */
.steps.tight { font-size: 23px; gap: 8px; } .steps.tight .n { width: 36px; height: 36px; font-size: 20px; }
.guide { background: var(--open); border-radius: var(--radius); padding: 10px 12px 12px; font-size: 22px; --mg: 74px; color: var(--ink); }
.guide .lbl { font-size: 16px; margin-bottom: 4px; }
.guide .mg-row { gap: 8px; flex-wrap: nowrap; } .guide .mg-item { flex: 1; min-width: 0; }
.guide .mg-item small { font-size: 15px; }
.howto .rules { gap: 12px; }

.seat .dot.av { position: relative; background: transparent; overflow: visible; }
.seat .dot.av img { width: 100%; height: 100%; object-fit: contain; transform: scale(1.25) translateY(-6%); }
.seat .dot.av .badge { position: absolute; right: -6px; bottom: -4px; width: 26px; height: 26px; border-radius: 50%; background: var(--pc); display: grid; place-items: center; border: 3px solid #FFF8EC; }
.chaosnote { background: #7A4E7E; color: #FFF8EC; border-radius: var(--radius); padding: 8px 14px; font-size: 21px; } .chaosnote b { margin-right: 6px; }

/* A seat card wiggles when its player sends an emote. */
.wiggle { animation: wiggle .55s cubic-bezier(.3,1.6,.5,1); }
@keyframes wiggle { 0% { transform: scale(1) rotate(0); } 30% { transform: scale(1.08) rotate(-3deg); } 60% { transform: scale(1.04) rotate(2deg); } 100% { transform: scale(1) rotate(0); } }

/* Podium: portraits on the steps, awards as stickers, paper confetti falling. */
.podium { overflow: hidden; gap: 18px; }
.podium .steps3 { gap: 26px; }
.step .pav { width: 170px; height: 170px; border-radius: 50%; background: var(--pc); border: 10px solid var(--light); box-shadow: var(--chip-shadow); overflow: hidden; display: grid; place-items: end center; }
.step.s1 .pav { width: 210px; height: 210px; animation: champ 1.2s ease-in-out 1.8s infinite; }
.step .pav img { width: 96%; height: 96%; object-fit: contain; }
.step .block { display: grid; place-items: start center; padding-top: 18px; }
.step.s1 .block { height: 190px; } .step.s2 .block { height: 135px; } .step.s3 .block { height: 95px; }
@keyframes champ { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-14px) rotate(2deg); } }
.awards { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.award { --ac: #E2B33C; width: 250px; background: var(--ac); color: #FFF8EC; border-radius: 22px; padding: 10px 14px 12px 82px; position: relative; box-shadow: 0 0 0 6px #FFF8EC, 0 10px 18px rgba(46,42,38,.25); animation: stick .6s cubic-bezier(.2,1.6,.4,1) var(--d) both; min-height: 82px; }
.award:nth-child(odd) { transform: rotate(-2deg); } .award:nth-child(even) { transform: rotate(2deg); }
.award img { position: absolute; left: 6px; top: 50%; width: 72px; height: 72px; margin-top: -38px; }
.award b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1.05; }
.award small { display: block; font-size: 17px; line-height: 1.15; opacity: .95; }
@keyframes stick { 0% { opacity: 0; transform: scale(1.8) rotate(-12deg); } 100% { opacity: 1; } }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.cf { position: absolute; top: -30px; width: 16px; height: 9px; background: var(--c); animation: fall 4.2s linear var(--d) infinite; transform: rotate(var(--r)); }
@keyframes fall { 0% { transform: translateY(0) rotate(var(--r)); } 100% { transform: translateY(1150px) rotate(calc(var(--r) + 720deg)); } }
.seat.fresh { animation: seatpop .7s cubic-bezier(.2,1.7,.4,1) both; }
@keyframes seatpop { 0% { transform: scale(.3) rotate(-10deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.seat .av img { transition: transform .2s; }
.seat.wiggle .av img { transform: translateY(-6px) rotate(-6deg); }

/* Full screen button (top left) and the iPhone "Add to Home Screen" card. */
#fsbtn { position: fixed; left: max(12px, env(safe-area-inset-left)); top: max(10px, env(safe-area-inset-top)); z-index: 60; display: flex; align-items: center; gap: 8px;
  padding: 8px 16px 8px 12px; border: 0; border-radius: 999px; background: rgba(255,248,236,.94); color: #2E2A26; font: 800 17px var(--font-body, sans-serif);
  box-shadow: 0 3px 0 rgba(46,42,38,.2), 0 8px 18px rgba(46,42,38,.25); cursor: pointer; opacity: .9; transition: transform .15s, opacity .15s; }
#fsbtn:hover, #fsbtn:focus-visible { opacity: 1; transform: scale(1.06); }
#fsbtn[hidden] { display: none; }
#fstip { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(27,27,58,.55); padding: 16px; }
.fstip-card { max-width: 440px; background: #FFF8EC; color: #2E2A26; border-radius: 22px; padding: 22px 24px; font: 700 17px/1.4 var(--font-body, sans-serif); box-shadow: 0 16px 40px rgba(0,0,0,.35); transform: rotate(-1deg); }
.fstip-card > b { font: 400 28px var(--font-display, sans-serif); display: block; margin-bottom: 6px; }
.fstip-card ol { padding-left: 22px; margin: 10px 0 16px; } .fstip-card li { margin: 4px 0; }
.fstip-card .pill { border: 0; cursor: pointer; font: inherit; background: #E2B33C; padding: 10px 22px; border-radius: 999px; }
@media (max-width: 900px) { #fsbtn span { display: none; } #fsbtn { padding: 8px; } }

/* ---------- TV menus: title screen, settings, help, credits, confirm, pause bar ---------- */
#menus { position: absolute; inset: 0; z-index: 40; pointer-events: none; font-family: var(--font-body); color: #2E2A26; font-weight: 800; }
#menus.m-on { pointer-events: auto; background: rgba(46,42,38,.55); display: grid; place-items: center; animation: m-fade .2s ease-out; }
#menus.m-on.m-title { background: linear-gradient(#F7E6BC, #F0CF94); }
@keyframes m-fade { from { opacity: 0; } }
.m-btn { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 18px; padding: 18px 34px; border-radius: 22px; background: #FFF8EC; color: #2E2A26;
  font: 400 38px var(--font-display); box-shadow: 0 5px 0 rgba(46,42,38,.25), 0 12px 24px rgba(46,42,38,.18); transition: transform .12s, box-shadow .12s, background .12s; }
.m-btn.big { background: #E2B33C; font-size: 46px; padding: 22px 40px; }
.m-btn.warn { background: #D8553C; color: #FFF8EC; }
.m-btn:hover { transform: translateY(-3px); }
.m-btn:focus-visible, .m-btn:focus, [data-nav]:focus { outline: 6px solid #2F6F8F; outline-offset: 6px; }
.m-btn:focus { transform: scale(1.04) rotate(-1deg); }
/* title */
.m-home { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 640px; grid-template-rows: 1fr auto auto 1fr auto; column-gap: 60px; padding: 0 140px; overflow: hidden; }
.m-logo { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.m-logo span { font: 400 210px/0.9 var(--font-display); color: #FFF8EC; background: #B84E36; padding: 6px 44px 26px; border-radius: 20px; box-shadow: 0 10px 0 rgba(46,42,38,.25), 0 30px 50px rgba(46,42,38,.25); transform: rotate(-3deg); }
.m-logo span:nth-child(2) { background: #2F6F8F; transform: rotate(2deg) translateX(120px); }
.m-tag { grid-column: 1; grid-row: 3; font-size: 36px; margin: 34px 0 0; max-width: 820px; }
.m-dolls { position: absolute; left: 140px; bottom: 60px; display: flex; gap: 22px; }
.m-dolls img { width: 150px; height: 150px; animation: m-bob 1.6s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -0.35s); filter: drop-shadow(0 8px 6px rgba(46,42,38,.2)); }
@keyframes m-bob { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-22px) rotate(4deg); } }
.m-list { grid-column: 2; grid-row: 2 / 4; display: flex; flex-direction: column; gap: 22px; align-self: center; }
.m-foot { position: absolute; right: 60px; bottom: 34px; font-size: 24px; opacity: .7; }
.m-bits i { position: absolute; width: 46px; height: 30px; border-radius: 6px; background: hsl(calc(var(--i) * 47), 55%, 58%); opacity: .5;
  left: calc(var(--i) * 107px + 20px); top: -60px; animation: m-fall calc(7s + var(--i) * 0.4s) linear infinite; animation-delay: calc(var(--i) * -1.3s); }
@keyframes m-fall { to { transform: translateY(1200px) rotate(540deg); } }
@media (prefers-reduced-motion: reduce) { .m-bits i, .m-dolls img { animation: none; } }
/* panels */
.m-panel { background: #FFF8EC; border-radius: 34px; padding: 50px 64px; width: 900px; max-height: 1000px; overflow: hidden; box-shadow: 0 30px 60px rgba(0,0,0,.35); transform: rotate(-.6deg); animation: m-pop .25s cubic-bezier(.2,1.4,.4,1); }
.m-panel.wide { width: 1500px; }
@keyframes m-pop { from { transform: scale(.9) rotate(-2deg); opacity: 0; } }
.m-panel h2 { display: flex; align-items: center; gap: 18px; font: 400 70px var(--font-display); margin: 0 0 20px; }
.m-panel h3 { font: 400 40px var(--font-display); margin: 18px 0 8px; color: #B84E36; }
.m-panel p, .m-panel li { font-size: 28px; line-height: 1.4; margin: 8px 0; }
.m-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; }
.m-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 92px; border-bottom: 3px dashed rgba(46,42,38,.12); }
.m-lbl { font-size: 32px; display: flex; flex-direction: column; } .m-lbl small { font-size: 21px; opacity: .65; font-weight: 700; max-width: 420px; }
.m-slider { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 18px; }
.m-slider button { all: unset; cursor: pointer; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: #E9DCC4; font: 400 40px var(--font-display); }
.m-track { width: 260px; height: 24px; border-radius: 12px; background: #E9DCC4; overflow: hidden; } .m-track b { display: block; height: 100%; background: #2F6F8F; border-radius: 12px; }
.m-tog { all: unset; cursor: pointer; width: 150px; height: 64px; border-radius: 32px; background: #E9DCC4; position: relative; font: 400 28px var(--font-display); }
.m-tog span { position: absolute; top: 6px; left: 6px; width: 76px; height: 52px; border-radius: 26px; background: #FFF8EC; display: grid; place-items: center; box-shadow: 0 3px 0 rgba(46,42,38,.2); transition: left .15s; }
.m-tog.on { background: #7FB87A; } .m-tog.on span { left: 68px; }
.m-seg { display: flex; gap: 8px; } .m-seg button { all: unset; cursor: pointer; padding: 12px 26px; border-radius: 16px; background: #E9DCC4; font: 400 28px var(--font-display); } .m-seg button.on { background: #2F6F8F; color: #FFF8EC; }
.m-actions { display: flex; gap: 20px; justify-content: center; margin-top: 34px; }
.m-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; margin: 20px 0; }
.m-step { background: #F2E3C6; border-radius: 26px; padding: 30px; position: relative; display: flex; flex-direction: column; gap: 10px; }
.m-step b { font: 400 40px var(--font-display); } .m-step p { font-size: 25px; }
.m-num { position: absolute; top: -22px; right: 24px; width: 62px; height: 62px; border-radius: 50%; background: #B84E36; color: #FFF8EC; display: grid; place-items: center; font: 400 40px var(--font-display); }
.m-tips { padding-left: 34px; }
.m-qrbox { display: flex; flex-direction: column; align-items: center; gap: 12px; } .m-qrbox img { width: 280px; height: 280px; background: #fff; border-radius: 16px; padding: 10px; image-rendering: pixelated; } .m-qrbox small { font-size: 22px; opacity: .7; }
.m-credits { font-size: 24px !important; opacity: .8; }
/* pause bar under the canvas pause card */
#pausebar { position: absolute; left: 0; right: 0; top: 760px; z-index: 39; display: flex; gap: 24px; justify-content: center; animation: m-fade .25s ease-out; }
/* lobby extras */
.navpill { all: unset; cursor: pointer; background: var(--surface); border-radius: 999px; padding: 14px 26px; font-size: 30px; box-shadow: var(--chip-shadow); font-family: var(--font-body); }
.navpill:focus { outline: 6px solid #2F6F8F; outline-offset: 4px; }
.game:focus { outline: 7px solid #2F6F8F; outline-offset: 5px; transform: translateY(-6px) scale(1.03) !important; }
.seat { cursor: pointer; } .seat:focus { outline: 6px solid #2F6F8F; outline-offset: 4px; }
.qr.hidden { display: grid; place-items: center; background: repeating-linear-gradient(45deg, #E9DCC4 0 18px, #F2E3C6 18px 36px); font: 400 34px var(--font-display); color: #7A6A5A; }
.code.hidden span { filter: saturate(.3); opacity: .7; }
.showcode { margin-top: 10px; font-size: 26px; }
.lbl.small { font-size: 22px; opacity: .7; }
.m-bits { position: absolute; inset: 0; z-index: 0; pointer-events: none; } .m-logo, .m-list, .m-tag, .m-dolls, .m-foot { position: relative; z-index: 1; } .m-dolls { position: absolute; }

.corner span { opacity: .65; font-weight: 700; }

.teamsum { display: flex; align-items: center; gap: 10px; font-size: 22px; margin-left: auto; margin-right: 16px; }
.tsum { background: var(--tc); color: #FFF8EC; border-radius: 999px; padding: 6px 18px; } .tsum b { font-family: var(--font-display); font-weight: 400; margin-right: 6px; }
.teamsum .vs { font-family: var(--font-display); font-size: 26px; } .teamsum .thint { font-size: 18px; opacity: .65; }

/* Lobby label row stays on one line even with Teams and every modifier on. */
.lblrow { flex-wrap: nowrap; gap: 14px; }
.lblrow > .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.lblrow .teamsum { flex: none; margin-left: auto; margin-right: 0; font-size: 20px; gap: 8px; }
.lblrow .tsum { white-space: nowrap; padding: 4px 14px; }
.lblrow .teamsum .vs { font-size: 22px; }
.lblrow .chips { flex-wrap: nowrap; flex: none; gap: 8px; }
.lblrow .chip { font-size: 18px; padding: 5px 12px; white-space: nowrap; }
.lblrow .teamsum ~ .chips .chip { font-size: 16px; padding: 4px 10px; }
/* Podium: the rest of the field on tidy single lines, smaller when there are many. */
.rest { flex-wrap: wrap; justify-content: center; row-gap: 8px; column-gap: 26px; font-size: 26px; }
.rest li { white-space: nowrap; }
.rest:has(li:nth-child(4)) { font-size: 24px; }

/* Podium with teams: the winning team up top, the top player underneath. */
.teamwin { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.podteams { display: flex; gap: 16px; }
.podteams .team { display: flex; flex-direction: column; padding: 10px 22px; border-radius: 18px; color: #FFF8EC; min-width: 220px; box-shadow: var(--chip-shadow); opacity: .8; }
.podteams .team.won { opacity: 1; transform: scale(1.08) rotate(-1.5deg); }
.podteams .team b { font: 400 34px var(--font-display); } .podteams .team span { font-size: 22px; } .podteams .team small { font-size: 16px; opacity: .85; max-width: 300px; }
.teamwin .champ { font-size: 28px; }

/* Lobby shelves: tabs over the game grid, a pager for "All", and party-mode tiles. */
.lobby .main { gap: 18px; }
.shelves { display: flex; gap: 8px; flex-wrap: nowrap; margin: -4px 0 -2px; }
.shelf { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px; font: 21px/1 var(--font-body); font-weight: 800; flex: none;
  background: var(--light); color: var(--ink); border: 3px solid transparent; box-shadow: var(--chip-shadow); white-space: nowrap; }
.shelf svg { width: 22px; height: 22px; flex: none; }
.shelf i { display: none; }
.shelf.on { background: var(--ink); color: var(--light); }
.shelf.on i { background: var(--light); color: var(--ink); }
.shelf:focus { outline: 6px solid #2F6F8F; outline-offset: 3px; }
.shelves.kinds { margin-top: -8px; gap: 6px; }
.shelves.kinds .shelf { font-size: 19px; padding: 6px 11px; background: transparent; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ink) 30%, transparent); }
.shelves.kinds .shelf.on { background: var(--ink); color: var(--light); box-shadow: none; }
.shelves.kinds .shelf svg { width: 18px; height: 18px; }
.games.some { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 16px; }
.games.some .game { padding: 14px 16px; }
.games.some .game .gi { width: 58px; height: 58px; } .games.some .game .gi svg { width: 40px; height: 40px; }
.games.some .game .gn { font-size: 30px; } .games.some .game .gp { font-size: 19px; }
.games.many { grid-auto-rows: minmax(0, 1fr); }
.games.modes { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
/* Party modes: a section per group (Adventures; boards, brackets and racing; playlists and shows),
   each a six-column grid that wraps, so any number of modes fits without squeezing. */
.msec, .hsec { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.mlbl { margin: 0 0 0 4px; font: 800 21px/1 var(--font-body); color: var(--inkSoft); letter-spacing: .02em; }
.mgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding-top: 6px; }
.games.modes .game { position: relative; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; padding: 10px 14px; min-height: 76px; }
.games.modes .game .gi { width: 46px; height: 46px; flex: none; } .games.modes .game .gi svg { width: 32px; height: 32px; }
.games.modes .mt { display: flex; flex-direction: column; min-width: 0; }
.games.modes .game .gn { font-size: 23px; line-height: 1.05; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.games.modes .game .gp { font-size: 16px; line-height: 1.2; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Start: two rows of tiles, party modes on top, new games under. Icon beside the words, so
   long names wrap inside the tile rather than spilling out of it. */
.games.home { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.hsec { flex: 1; }
.hrow { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 14px; padding-top: 6px; }
.games.home .game { position: relative; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; padding: 10px 14px; min-height: 0; overflow: visible; }
.games.home .game .gi { width: 50px; height: 50px; flex: none; } .games.home .game .gi svg { width: 34px; height: 34px; }
.games.home .mt { display: flex; flex-direction: column; min-width: 0; }
.games.home .game .gn { font-size: 25px; line-height: 1.05; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.games.home .game.mode:not(.picker) .gp { display: none; }
.games.home .game .gn { font-size: 27px; }
.games.home .game .gp { font-size: 17px; line-height: 1.2; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.mbadge { position: absolute; top: -10px; right: -6px; z-index: 2; background: var(--light); color: var(--ink); font: 800 15px/1 var(--font-body); padding: 5px 10px; border-radius: 999px; box-shadow: 0 2px 0 rgba(46,42,38,.25); transform: rotate(4deg); }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; font-size: 22px; margin-top: -6px; }
.pager .pill { padding: 4px 18px; font-size: 22px; }

/* Tournament bracket */
.bracket { padding: 56px 60px 70px; display: flex; flex-direction: column; gap: 18px; }
.bracket .bar { display: flex; align-items: center; justify-content: space-between; }
.bracket .bar .pill { font-size: 26px; }
.bcols { flex: 1; display: flex; gap: 34px; min-height: 0; }
.bcol { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bcol > .lbl { text-align: center; font-size: 26px; margin-bottom: 8px; }
.bmatches { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 14px; }
.bm { position: relative; background: var(--light); border-radius: calc(var(--radius) + 2px); padding: 10px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--chip-shadow); border: 4px solid transparent; }
.bm::after { content: ''; position: absolute; right: -36px; top: 50%; width: 32px; border-top: 5px solid var(--ink); opacity: .25; }
.bcol:nth-last-child(2) .bm::after { opacity: .25; }
.bm.next { border-color: var(--gold); animation: bnext 1.2s ease-in-out infinite alternate; }
@keyframes bnext { to { box-shadow: 0 0 0 8px color-mix(in srgb, var(--gold) 45%, transparent), var(--chip-shadow); } }
.bm.bye { opacity: .8; padding: 6px 10px; } .bm.bye .bp.won { outline: 0; } .bm.bye .tick { display: none; }
.bp { display: flex; align-items: center; gap: 10px; background: var(--pc, var(--open)); color: var(--pt, var(--inkSoft)); border-radius: var(--radius); padding: 5px 12px 5px 6px; min-height: 52px; position: relative; }
.bp img { width: 46px; height: 46px; border-radius: 50%; background: var(--light); flex: none; }
.bp .bs { display: grid; place-items: center; flex: none; }
.bp .bn { font-size: 26px; font-family: var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.bp.empty { background: var(--open); color: var(--inkSoft); justify-content: center; border: 3px dashed #8C7B66; }
.bp.lost { filter: saturate(.25); opacity: .55; }
.bp.lost .bn { text-decoration: line-through; text-decoration-thickness: 3px; }
.bp.won { outline: 4px solid var(--gold); }
.bp .tick { font-size: 26px; background: var(--gold); color: var(--ink); border-radius: 50%; width: 36px; height: 36px; display: grid; place-items: center; flex: none; }
.bm .bg { font-size: 19px; text-align: center; color: var(--inkSoft); min-height: 22px; }
.bm.next .bg { color: var(--ink); font-size: 22px; }
.bm.fresh .bp.won { animation: bwin .9s cubic-bezier(.2,1.6,.4,1); }
@keyframes bwin { from { transform: scale(1.35) rotate(-4deg); } }
.bcol.champ { flex: .8; align-items: center; }
.bcol.champ .bm::after { display: none; }
.trophy { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: #A9853A; }
.trophy.won { color: var(--gold); animation: bwin 1s cubic-bezier(.2,1.6,.4,1); }
.trophy .tq { font: 80px var(--font-display); color: var(--inkSoft); opacity: .5; }
.bp.big { padding: 10px 22px 10px 10px; }
.bp.big img { width: 70px; height: 70px; } .bp.big .bn { font-size: 40px; }
.bcols.r2 .bm { margin: 0 20px; }

/* The audience */
.audpill { background: #7A4E7E; color: #FFF8EC; }
.game { position: relative; }
.crowdv { position: absolute; top: -12px; right: -8px; background: #7A4E7E; color: #FFF8EC; font: 22px/1 var(--font-display); padding: 6px 12px; border-radius: 999px; border: 3px solid #FFF8EC; box-shadow: var(--chip-shadow); }
.crowdstar { background: #7A4E7E; color: #FFF8EC; border-radius: var(--radius); padding: 10px 16px; font-size: 24px; margin-bottom: 8px; }
.lobby .bar .pill, .lobby .bar .title { white-space: nowrap; }
.lobby .hintpill { white-space: normal !important; max-width: 360px; font-size: 20px; }
.chip.crowdchip { background: #7A4E7E; color: #FFF8EC; }

/* Switched-off games and the skip vote */
.game.off { opacity: .45; filter: saturate(.3); }
.offtag { position: absolute; top: 10px; right: 10px; background: var(--ink); color: var(--light); font: 18px/1 var(--font-body); font-weight: 800; padding: 5px 10px; border-radius: 999px; }
.pskip { position: absolute; right: 24px; bottom: -30px; background: #7A4E7E; color: #FFF8EC; font-size: 26px; padding: 6px 22px; border-radius: 30px; transform: rotate(1.5deg); box-shadow: var(--chip-shadow); }
.pskip b { font-family: var(--font-display); font-weight: 400; }
/* Choose games panel */
.m-note { font: 700 26px var(--font-body, Nunito); color: #5A4E44; margin: -6px 0 14px; }
.m-gbody { max-height: 600px; overflow-y: auto; padding: 4px 10px 10px 4px; }
.m-gbody h3 { margin: 14px 0 8px; }
.m-gchips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.m-gchip { all: unset; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px 14px; min-height: 52px; border-radius: 14px; border: 3px dashed #A89A88; color: #6B5F55; font: 800 22px var(--font-body, Nunito); text-decoration: line-through; }
.m-gchip i { font-style: normal; font-size: 22px; width: 26px; text-align: center; }
.m-gchip.on { border: 3px solid #2E2A26; background: #FFFDF6; color: #2E2A26; text-decoration: none; box-shadow: 0 3px 0 rgba(46,42,38,.2); }
.m-gchip.on i { color: #3E7A4E; }
.m-gchip:focus-visible, .m-gchip:focus { outline: 5px solid #E0A030; outline-offset: 3px; }
/* Measuring the screen delay: a dot that pops on the beat */
.m-lagdot { height: 260px; display: grid; place-items: center; }
.m-lagdot i { width: 120px; height: 120px; border-radius: 50%; background: #E9DCC4; border: 8px solid #FFF8EC; box-shadow: 0 0 0 4px #2E2A26; }
.m-lagdot i.pop { animation: m-lagpop .45s ease-out; }
@keyframes m-lagpop { 0% { transform: scale(1.7); background: #E2B33C; } 100% { transform: scale(1); background: #E9DCC4; } }
.m-row.stack { flex-direction: column; align-items: stretch; gap: 10px; }
.m-row.stack .m-seg { align-self: flex-start; }
.m-settings .m-row { min-height: 74px; }
.m-settings .m-row.stack { padding: 8px 0; }
.m-settings .m-panel { padding-top: 38px; padding-bottom: 38px; }
.m-settings .m-actions { margin-top: 22px; }
/* Between games (tv/transition.js): Snips cuts the old screen away, the next one pops up */
.cutfx { position: absolute; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }
.cutfx * { pointer-events: none !important; }
.cut-sheet { position: absolute; inset: 0; transform-origin: 50% 40%; will-change: transform; }
.cut-sheet:not(.cut-page) { filter: drop-shadow(0 12px 0 rgba(46,42,38,.2)); }
.cut-inner { position: absolute; inset: 0; overflow: hidden; }
.cut-pic, .cut-rim, .cut-line { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; }
.cut-rim { overflow: visible; }
.cut-ui { position: absolute; inset: 0; }
.cut-snips { position: absolute; left: 0; top: 0; width: 340px; height: 364px; transform-origin: 170px 197px; filter: drop-shadow(4px 6px 0 rgba(46,42,38,.18)); }
.cut-kraft { position: absolute; inset: 0; background: radial-gradient(rgba(120,90,50,.09) 1.4px, transparent 1.8px) 0 0 / 18px 18px, #E9D8B8; }
.cut-page { transform-origin: 50% 100%; transform: perspective(2200px) rotateX(86deg); }
.cut-page.up { transform: perspective(2200px) rotateX(0deg); transition: transform .52s cubic-bezier(.3, 1.5, .55, 1); }

/* The free demo: full-game tiles wear a brass "Full game" tag; the Unlock panel takes a key. */
.game.locked { filter: saturate(.55); }
.game.locked .gi { opacity: .6; }
.locktag { position: absolute; top: -9px; right: -6px; z-index: 2; background: #D9A93A; color: #2E2A26; font: 800 14px/1 var(--font-body); padding: 5px 9px; border-radius: 999px; box-shadow: inset 0 0 0 2px #9A7222, 0 2px 0 rgba(46,42,38,.25); transform: rotate(4deg); pointer-events: none; }
.demotag { background: #D9A93A !important; color: #2E2A26 !important; box-shadow: inset 0 0 0 3px #9A7222 !important; }
.m-btn.small { font-size: 28px; padding: 12px 24px; gap: 10px; }
.m-btn.gold { background: #D9A93A; box-shadow: inset 0 0 0 3px #9A7222, 0 5px 0 rgba(46,42,38,.25); }
.m-keyform { display: flex; gap: 18px; align-items: center; margin: 6px 0 14px; }
.m-keyform input { flex: 1; min-width: 0; box-sizing: border-box; font: 700 29px/1 'Courier New', ui-monospace, monospace; letter-spacing: .04em; text-transform: uppercase;
  padding: 20px 22px; border: 4px solid #2E2A26; border-radius: 18px; background: #fff; color: #2E2A26; }
.m-keyform input:focus { outline: 6px solid #2F6F8F; outline-offset: 4px; }
.m-keyform .m-btn { flex: none; }
.m-keyform .m-btn[disabled] { opacity: .5; }
.m-actions.m-col { flex-wrap: wrap; max-width: 1100px; margin-left: auto; margin-right: auto; }
/* Packs: one card per pack, a QR code beside the ones for sale. */
/* (.m-panel.m-packs: the menu layer itself also carries m-<panel name>, so a bare .m-packs would size it.) */
.m-panel.m-packs { width: 1100px; max-width: 1300px; }
.m-scroll { max-height: 640px; overflow-y: auto; padding: 4px 18px 70px 4px; margin: 0 -18px 0 -4px; scrollbar-width: auto; scrollbar-color: rgba(46,42,38,.4) transparent; -webkit-mask-image: linear-gradient(#000 82%, transparent); mask-image: linear-gradient(#000 82%, transparent); }
.m-hint { font-size: 24px !important; opacity: .65; margin: -6px 0 6px !important; }
.m-pack:focus-visible, .m-pack:focus { outline: 5px solid #2F6F8F; outline-offset: 2px; }
.m-pack { display: flex; align-items: center; gap: 30px; text-align: left; padding: 22px 28px; margin-top: 16px; border-radius: 24px; background: color-mix(in srgb, var(--ink, #2E2A26) 5%, transparent); }
.m-pack.focus { outline: 5px solid var(--gold, #E2B33C); }
.m-pack.owned .m-packst { color: var(--good, #3E7A4E); }
.m-packtxt { flex: 1; } .m-packtxt h3 { margin: 0 0 6px; font-size: 40px; } .m-packtxt p { margin: 0 0 10px; font-size: 26px; opacity: .8; }
.m-packst { font-size: 26px; }
.m-pgh { font: 800 24px/1 var(--font-body) !important; color: #6B6258 !important; letter-spacing: .03em; margin: 26px 0 4px 6px !important; }
.m-pgh:first-child { margin-top: 6px !important; }
.m-pgh i { font-style: normal; background: rgba(46,42,38,.1); border-radius: 999px; padding: 2px 10px; margin-left: 6px; }
.m-pack.compact { padding: 14px 24px; margin-top: 10px; justify-content: space-between; }
.m-pack.compact h3 { margin: 0; font-size: 32px; flex: 1; }
.m-pack.compact .m-packst { font-size: 22px; }
.m-new { font: 800 18px/1 var(--font-body); background: #2F6F8F; color: #FFF8EC; padding: 5px 11px; border-radius: 999px; vertical-align: middle; }
.m-packqr img { width: 200px; height: 200px; } .m-packqr small { font-size: 20px; }
.packpill i { font-style: normal; background: var(--gold, #E2B33C); color: var(--ink, #2E2A26); border-radius: 999px; padding: 0 10px; margin-left: 6px; font-size: .8em; }
/* Too old for the 3D games: what works instead, beside a QR code to the setup page. */
.m-panel .m-oldtv { display: flex; gap: 50px; align-items: center; text-align: left; margin: 10px 0 24px; }
.m-oldtv p { font-size: 30px; margin: 0 0 16px; } .m-bul { font-size: 30px; margin: 0; padding-left: 36px; } .m-bul li { margin-bottom: 10px; }

/* The Scrapbook panel (menus.js scrapbook()). */
.m-sb { max-height: 1040px; }
.m-sbtabs { margin: 0 0 22px; }
.m-sbnight { display: grid; grid-template-columns: 860px 1fr; gap: 36px; align-items: start; }
.m-sbpage { width: 860px; height: 538px; object-fit: contain; background: #F6EBCF; border-radius: 10px; box-shadow: 0 10px 24px rgba(46,42,38,.25); transform: rotate(-.8deg); }
.m-sbside h3 { margin-top: 0; } .m-sbside p { font-size: 25px; margin: 4px 0; }
.m-sbthumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 18px; }
.m-sbthumbs figure, .m-sbgrid figure { margin: 0; background: #FFFDF6; padding: 8px 8px 6px; box-shadow: 0 4px 10px rgba(46,42,38,.2); }
.m-sbthumbs img { width: 100%; display: block; }
.m-sbthumbs figcaption { font: 400 20px var(--font-display); text-align: center; padding-top: 4px; }
.m-sbgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.m-sbgrid figure:nth-child(odd) { transform: rotate(-1deg); } .m-sbgrid figure:nth-child(even) { transform: rotate(1.2deg); }
.m-sbgrid button { all: unset; cursor: pointer; display: block; } .m-sbgrid button:focus { outline: 6px solid #2F6F8F; outline-offset: 4px; }
.m-sbgrid img { width: 100%; height: 230px; object-fit: cover; display: block; }
.m-sbgrid figcaption { font: 400 24px var(--font-display); text-align: center; padding-top: 6px; } .m-sbgrid small { display: block; font: 700 18px var(--font-body); opacity: .6; }
.m-sbpager { display: flex; gap: 22px; align-items: center; justify-content: center; margin-top: 18px; font-size: 26px; }
.m-sbpager .m-btn[disabled] { opacity: .35; }
.m-sbrecs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 30px; max-height: 640px; overflow-y: auto; }
.m-sbrec { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; background: #F2E3C6; border-radius: 18px; padding: 16px 22px; }
.m-sbrec b { font: 400 30px var(--font-display); } .m-sbrec .v { font: 400 38px var(--font-display); color: #B84E36; grid-row: span 2; align-self: center; }
.m-sbrec span { font-size: 26px; } .m-sbrec small { font-size: 20px; opacity: .65; grid-column: 1; }
.m-sbempty { min-height: 300px; display: grid; align-content: center; justify-items: center; text-align: center; } .m-sbempty p { max-width: 900px; }
.m-sbshare { display: flex; gap: 40px; align-items: center; justify-content: center; min-height: 420px; } .m-sbshare img { width: 340px; height: 340px; background: #fff; border-radius: 16px; padding: 12px; } .m-sbshare p { max-width: 560px; }

/* The House Cup on the podium, and podium poses (earned in the House Cup). */
.cupstrip { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 22px; margin: -6px auto 10px; padding: 10px 26px; max-width: 1500px; background: #FFF8EC; color: #2E2A26; border-radius: 999px; font-size: 26px; box-shadow: 0 6px 0 rgba(46,42,38,.2); }
.cupstrip > b { font-family: var(--font-display); font-size: 30px; color: #9A7222; }
.cupstrip .cupico { font-size: 34px; }
.cuprow b { color: #3E7A4E; } .cuprow small { opacity: .6; font-size: 20px; }
.cupstrip.lifted { flex-direction: column; gap: 2px; border-radius: 28px; padding: 14px 40px; background: #E2B33C; animation: cuplift 1.2s ease-out; }
.cupstrip.lifted > b { color: #2E2A26; font-size: 44px; } .cupstrip.lifted small { font-size: 22px; }
@keyframes cuplift { 0% { transform: scale(.4) rotate(-6deg); opacity: 0; } 60% { transform: scale(1.08) rotate(2deg); opacity: 1; } 100% { transform: none; } }
.pav.pose-hop img { animation: pose-hop .9s ease-in-out infinite; }
.pav.pose-wiggle img { animation: pose-wiggle .7s ease-in-out infinite; }
.pav.pose-zoom img { animation: pose-zoom 1.6s ease-out 1; }
.pav.pose-spin img { animation: pose-spin 1.4s ease-in-out infinite; }
@keyframes pose-hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-34px) scale(1.04, .96); } }
@keyframes pose-wiggle { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg) translateY(-6px); } }
@keyframes pose-zoom { 0% { transform: scale(2.2); opacity: 0; } 55% { transform: scale(.9); opacity: 1; } 75% { transform: scale(1.08); } 100% { transform: none; } }
@keyframes pose-spin { 0%, 30% { transform: rotate(0); } 70%, 100% { transform: rotate(360deg); } }
.m-cupseason { font: 700 28px var(--font-body); opacity: .6; }
.m-cup { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; counter-reset: cup; }
.m-cup li { display: grid; grid-template-columns: 220px 1fr 70px; grid-template-rows: auto auto; align-items: center; gap: 0 14px; counter-increment: cup; }
.m-cup .nm { font: 400 32px var(--font-display); } .m-cup .nm::before { content: counter(cup) ". "; opacity: .5; }
.m-cup .bar { height: 22px; background: #E9DCC4; border-radius: 11px; overflow: hidden; } .m-cup .bar b { display: block; height: 100%; background: #E2B33C; border-radius: 11px; }
.m-cup .pts { font: 400 34px var(--font-display); color: #9A7222; text-align: right; }
.m-cup small { grid-column: 1 / -1; font-size: 20px; opacity: .6; }
.m-cuppast { padding-left: 26px; } .m-cuppast small { opacity: .6; font-size: 20px; }
.m-cupform input { text-transform: none; font: 700 30px/1 var(--font-body); letter-spacing: 0; }
.locktag.weekend { background: #3E7A4E; color: #FFF8EC; box-shadow: inset 0 0 0 2px #2C5A38, 0 2px 0 rgba(46,42,38,.25); }
.locktag.newtag { background: #2F6F8F; color: #FFF8EC; box-shadow: inset 0 0 0 2px #1F4F68, 0 2px 0 rgba(46,42,38,.25); }
