/* Carnival arcade UI — shared by all games */
@import url('https://fonts.googleapis.com/css2?family=Rye&family=Press+Start+2P&family=Nunito:wght@600;800&display=swap');

:root {
  --red: #c8102e; --red-dk: #8c0b20; --gold: #f6c453; --gold-dk: #b8862a;
  --cream: #fff6e3; --green: #1f6b3a; --night: #141433;
  --marquee: 'Rye', Georgia, serif;
  --pixel: 'Press Start 2P', ui-monospace, monospace;
  --body: 'Nunito', system-ui, sans-serif;
}

.arcade { position: relative; display: grid; place-items: center; overflow: hidden; background: var(--night); }
.stage { position: relative; overflow: hidden; box-shadow: 0 0 60px rgba(0,0,0,.6); user-select: none; -webkit-user-select: none; }
.stage canvas { display: block; }
.ui { position: absolute; inset: 0; pointer-events: none; font-family: var(--body); color: var(--cream); }
.ui > * { pointer-events: auto; }
.ui .hud, .ui .big { pointer-events: none; }
.hidden { display: none !important; }

/* sizes scale with the stage: 1 unit = calc(var(--s) * 1px) */
.ui { font-size: calc(var(--s) * 18px); }

/* HUD */
.hud { position: absolute; top: 2.2%; left: 3%; right: 3%; display: flex; justify-content: space-between; }
.plate {
  min-width: 6.2em; padding: .45em .8em .55em; text-align: center;
  background: linear-gradient(#2a1a12, #140c08); border: .18em solid var(--gold);
  border-radius: .7em; box-shadow: 0 0 0 .14em #000, 0 .3em .8em rgba(0,0,0,.5), inset 0 0 .8em rgba(246,196,83,.25);
}
.plate small { display: block; font-family: var(--pixel); font-size: .5em; letter-spacing: .1em; color: var(--gold); margin-bottom: .35em; }
.plate b { font-family: var(--pixel); font-size: 1.6em; color: #fff; text-shadow: 0 0 .4em rgba(255,220,140,.9); }
.plate.pop b { animation: pop .35s ease-out; display: inline-block; }
.plate.hurry { border-color: #ff5a5a; animation: hurry .5s infinite alternate; }
.plate.hurry b { color: #ffd0d0; }
@keyframes pop { 0% { transform: scale(1.6); color: var(--gold); } 100% { transform: scale(1); } }
@keyframes hurry { to { box-shadow: 0 0 0 .14em #000, 0 0 1.4em rgba(255,60,60,.8); } }

.mute { position: absolute; bottom: 2%; right: 3%; width: 2.4em; height: 2.4em; border-radius: 50%; border: .12em solid rgba(255,255,255,.35); background: rgba(0,0,0,.35); font-size: 1.1em; cursor: pointer; }

/* big center text: 3-2-1-GO, TIME */
.big { position: absolute; left: 0; right: 0; top: 30%; text-align: center; font-family: var(--marquee); font-size: 7em; color: var(--cream); opacity: 0;
  -webkit-text-stroke: .03em var(--red-dk); text-shadow: 0 .06em 0 var(--red), 0 .12em 0 var(--red-dk), 0 0 .4em rgba(255,200,90,.8); }
.big.show { animation: bigIn .7s ease-out forwards; }
.big.go { color: var(--gold); }
.big.time { color: #fff; font-size: 5em; }
@keyframes bigIn { 0% { opacity: 0; transform: scale(2.2); } 25% { opacity: 1; transform: scale(.95); } 40% { transform: scale(1.05); } 75% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(.9); } }

/* cards */
.card {
  position: absolute; left: 7%; right: 7%; top: 50%; transform: translateY(-50%);
  padding: 1.4em 1.2em 1.2em; text-align: center; border-radius: 1em;
  background:
    repeating-linear-gradient(90deg, var(--red) 0 1.4em, #fff6ee 1.4em 2.8em) top / 100% .9em no-repeat,
    linear-gradient(#2b1d33ee, #160f24f2);
  border: .18em solid var(--gold); box-shadow: 0 0 0 .2em #000, 0 1em 3em rgba(0,0,0,.6), inset 0 0 2em rgba(246,196,83,.15);
  animation: cardIn .45s cubic-bezier(.2,1.4,.4,1);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(-40%) scale(.85); } }
.marquee { font-family: var(--marquee); font-size: 2.6em; line-height: 1.05; margin: .4em 0 .3em; color: var(--gold);
  text-shadow: 0 .05em 0 var(--red-dk), 0 0 .5em rgba(246,196,83,.6); }
.intro p { font-size: 1.05em; line-height: 1.4; margin: 0 0 1.2em; color: #f3e6d0; }

.btn { display: block; width: 100%; margin: .55em 0 0; padding: .85em 1em; border-radius: .7em; border: 0; cursor: pointer;
  font-family: var(--pixel); font-size: .8em; letter-spacing: .06em; color: #fff; transition: transform .08s; }
.btn:active { transform: translateY(.15em) scale(.98); }
.btn.primary { background: linear-gradient(#e2283f, var(--red-dk)); box-shadow: 0 .3em 0 #5a0613, 0 .5em 1em rgba(0,0,0,.4); font-size: 1em; padding: 1em; }
.btn.gold { background: linear-gradient(#ffd877, var(--gold-dk)); color: #3a2205; box-shadow: 0 .3em 0 #6d4b10; }
.btn.ghost { background: rgba(255,255,255,.08); border: .1em solid rgba(255,255,255,.3); }
.btn:disabled { opacity: .5; }
.row { display: flex; gap: .6em; } .row .btn { flex: 1; font-size: .65em; }

/* results */
.results .lbl { display: block; font-family: var(--pixel); font-size: .55em; letter-spacing: .12em; color: var(--gold); margin-top: .4em; }
.final { font-family: var(--pixel); font-size: 4.2em; margin: .2em 0 .15em; color: #fff; text-shadow: 0 0 .3em rgba(255,215,120,.9), 0 .08em 0 var(--red); }
.statline { font-size: .95em; color: #f6e7cf; } .statline.dim { opacity: .7; margin-top: .2em; }
.ribbon { margin: -.4em auto .5em; display: inline-block; padding: .45em 1em; font-family: var(--pixel); font-size: .6em; color: #3a2205;
  background: linear-gradient(#ffe28a, #e0a832); border-radius: .3em; animation: wiggle 1s infinite ease-in-out; box-shadow: 0 0 1em rgba(255,210,100,.7); }
@keyframes wiggle { 50% { transform: rotate(-3deg) scale(1.06); } }
.entry { margin: .8em 0 .2em; padding: .7em; border-radius: .7em; background: rgba(0,0,0,.28); }
.wheels { display: flex; justify-content: center; gap: .7em; margin: .5em 0; }
.wheel { display: flex; flex-direction: column; align-items: center; }
.wheel span { font-family: var(--pixel); font-size: 2em; width: 1.4em; padding: .2em 0; background: #000; color: var(--gold); border-radius: .2em; border: .06em solid #444;
  text-shadow: 0 0 .3em rgba(246,196,83,.8); }
.wheel button { background: none; border: 0; color: var(--cream); font-size: 1.1em; padding: .25em .9em; cursor: pointer; }
.team { width: 100%; margin: .3em 0 0; padding: .6em; border-radius: .5em; border: 0; font-family: var(--body); font-size: .9em; background: #fff6e3; color: #2a1a12; }
.msg { min-height: 1em; font-size: .85em; color: #ffb4b4; margin-top: .3em; }
.posted { font-size: 1.05em; padding: .6em 0; } .posted b { color: var(--gold); font-family: var(--pixel); font-size: .9em; }

/* leaderboard */
.modal { position: absolute; inset: 0; background: rgba(5,5,20,.65); backdrop-filter: blur(3px); display: grid; place-items: center; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.board { width: 88%; max-height: 86%; display: flex; flex-direction: column; padding: 1em; border-radius: .8em; background: #07070f; border: .2em solid var(--gold);
  box-shadow: 0 0 0 .2em #000, 0 0 2em rgba(246,196,83,.35); font-family: var(--pixel); }
.board-title { text-align: center; color: var(--gold); font-size: 1.1em; margin: .3em 0 .8em; text-shadow: 0 0 .5em rgba(246,196,83,.8); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { color: #ff5a6e; } }
.tabs { display: flex; gap: .4em; margin-bottom: .6em; }
.tabs button { flex: 1; padding: .6em; font-family: var(--pixel); font-size: .55em; color: #aaa; background: #15152a; border: .1em solid #333; border-radius: .3em; cursor: pointer; }
.tabs button.on { color: #000; background: var(--gold); border-color: var(--gold); }
.rows { overflow-y: auto; flex: 1; }
.r { display: flex; align-items: center; gap: .6em; padding: .55em .3em; font-size: .62em; color: #e8e8ff; border-bottom: .1em dashed #222; }
.r:nth-child(1 of .r:not(.note)) .sc, .r:first-child .rk { color: var(--gold); }
.r .rk { width: 1.8em; color: #ff6b7d; } .r .in { width: 3.6em; color: #7ef0ff; letter-spacing: .1em; }
.r .tm { flex: 1; font-family: var(--body); font-size: 1.3em; color: #9a9ab8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r .tm.wide { color: #e8e8ff; } .r .tm em { display: block; font-style: normal; font-size: .8em; color: #77779a; }
.r .sc { color: #fff; min-width: 3em; text-align: right; }
.r.me { background: rgba(246,196,83,.15); animation: blink 1s steps(2) infinite; }
.r.dim { opacity: .45; }
.note { font-family: var(--body); font-size: .7em; color: #9a9ab8; margin-bottom: .4em; text-align: center; }
.board .btn { font-size: .75em; }

.toast { position: absolute; left: 10%; right: 10%; bottom: 8%; padding: .8em; text-align: center; border-radius: .6em; background: rgba(0,0,0,.75); animation: fade .2s; }

/* music toggle sits beside the sound toggle */
.mute.music { right: calc(3% + 2.9em); }
.mute.off { opacity: .45; text-decoration: line-through; }

/* ---------- Christmas TOP 5 board ---------- */
.xmas-wrap { width: 86%; }
.xmas-board {
  position: relative; margin: 1.3em 0 .4em; padding: 2em 1em .9em; border-radius: .6em;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.0) 0 1.9em, rgba(0,0,0,.18) 1.9em 2em),
    linear-gradient(90deg, rgba(255,255,255,.04), rgba(0,0,0,.12) 40%, rgba(255,255,255,.03) 70%, rgba(0,0,0,.15)),
    linear-gradient(#7a4a2a, #5a3219);
  border: .22em solid #3b200f; box-shadow: 0 .6em 1.6em rgba(0,0,0,.55), inset 0 0 1.2em rgba(0,0,0,.45);
  font-family: var(--pixel); text-align: left;
}
.xmas-board .snowcap { position: absolute; left: -.5em; right: -.5em; top: -1em; height: 1.9em;
  background:
    radial-gradient(circle at 6% 80%, #fff 0 .8em, transparent .83em),
    radial-gradient(circle at 20% 60%, #fff 0 1.05em, transparent 1.08em),
    radial-gradient(circle at 37% 78%, #fff 0 .85em, transparent .88em),
    radial-gradient(circle at 53% 58%, #fff 0 1.1em, transparent 1.13em),
    radial-gradient(circle at 70% 80%, #fff 0 .9em, transparent .93em),
    radial-gradient(circle at 86% 62%, #fff 0 1em, transparent 1.03em),
    radial-gradient(circle at 97% 82%, #fff 0 .7em, transparent .73em),
    linear-gradient(transparent 62%, #f4f8ff 62%);
  filter: drop-shadow(0 .18em .1em rgba(0,0,0,.35)); }
.xmas-board .bulbs { position: absolute; left: .5em; right: .5em; top: .85em; display: flex; justify-content: space-between; }
.xmas-board .bulbs::before { content: ''; position: absolute; left: 0; right: 0; top: .1em; height: .5em; border-top: .09em solid #1d3b22; border-radius: 50%; }
.xmas-board .bulbs i { width: .48em; height: .7em; border-radius: 50% 50% 45% 45%; position: relative; top: .3em; animation: twinkle 1.4s var(--d) infinite alternate; }
.xmas-board .bulbs i:nth-child(4n+1) { background: #ff3b4e; color: #ff3b4e; }
.xmas-board .bulbs i:nth-child(4n+2) { background: #ffd45c; color: #ffd45c; }
.xmas-board .bulbs i:nth-child(4n+3) { background: #3fe07a; color: #3fe07a; }
.xmas-board .bulbs i:nth-child(4n+4) { background: #5cb8ff; color: #5cb8ff; }
@keyframes twinkle { from { box-shadow: 0 0 .2em currentColor; filter: brightness(.7); } to { box-shadow: 0 0 .9em .15em currentColor; filter: brightness(1.25); } }
.xb-title { text-align: center; font-family: var(--marquee); font-size: 1.45em; color: #fff4d6; margin: .35em 0 .45em;
  text-shadow: 0 .06em 0 #7a0c1c, 0 0 .5em rgba(255,214,120,.6); }
.xr { display: flex; align-items: center; gap: .6em; padding: .42em .2em; font-size: .72em; color: #fff7e6; border-bottom: .1em dashed rgba(255,240,210,.18); }
.xr:last-child { border-bottom: 0; }
.xr .in { letter-spacing: .15em; color: #fff; }
.xr .dots { flex: 1; border-bottom: .14em dotted rgba(255,230,190,.35); transform: translateY(-.2em); }
.xr .sc { color: #ffe28a; min-width: 2.5em; text-align: right; text-shadow: 0 0 .4em rgba(255,214,120,.6); }
.xr.empty { justify-content: center; font-family: var(--body); font-size: .95em; }
.xr.me { background: rgba(255,226,138,.18); border-radius: .3em; animation: meGlow 1s ease-in-out infinite alternate; }
.xr.gap { margin-top: .5em; border-top: .12em dashed rgba(255,240,210,.35); }
@keyframes meGlow { to { background: rgba(255,226,138,.34); } }
/* ornament rank badges */
.orn { position: relative; width: 1.9em; height: 1.9em; border-radius: 50%; display: grid; place-items: center; font-size: .82em; color: #2a1405; flex: none;
  box-shadow: inset -.25em -.3em .4em rgba(0,0,0,.35), inset .2em .2em .3em rgba(255,255,255,.5), 0 .15em .3em rgba(0,0,0,.4); }
.orn::before { content: ''; position: absolute; top: -.32em; width: .55em; height: .38em; border-radius: .1em; background: linear-gradient(#e8d79a, #8f7a3a); }
.orn.gold { background: radial-gradient(circle at 35% 30%, #fff4b8, #e7b53c 55%, #9a6b10); }
.orn.silver { background: radial-gradient(circle at 35% 30%, #fff, #c7ccd6 55%, #7d8494); }
.orn.bronze { background: radial-gradient(circle at 35% 30%, #ffd9b0, #c97c3c 55%, #7b4416); }
.orn.red { background: radial-gradient(circle at 35% 30%, #ffb3ba, #d4243a 55%, #7d0c18); color: #fff; }
.orn.green { background: radial-gradient(circle at 35% 30%, #b8f5c8, #2a9a4e 55%, #0f4d22); color: #fff; }
.orn.plain { background: rgba(255,255,255,.15); color: #fff; box-shadow: none; } .orn.plain::before { display: none; }
.xmas-board.compact { margin: .3em 0 .2em; padding-top: 1.5em; }
.xmas-board.compact .xb-title { font-size: 1.1em; }
.xmas-board.compact .xr { font-size: .62em; padding: .3em .2em; }
.intro p { margin-bottom: .6em; }

/* arcade name entry */
.entry .name { width: 100%; box-sizing: border-box; margin: .55em 0 .1em; padding: .55em .5em; border-radius: .35em;
  border: .12em solid var(--gold); background: #000; color: var(--gold); text-align: center; text-transform: uppercase;
  font-family: var(--pixel); font-size: max(16px, 1.05em); letter-spacing: .08em; text-shadow: 0 0 .35em rgba(246,196,83,.8); outline: none; }
.entry .name::placeholder { color: rgba(246,196,83,.35); }
.entry .name:focus { box-shadow: 0 0 0 .15em rgba(246,196,83,.35), 0 0 1em rgba(246,196,83,.4); }
.tobeat { margin: .5em 0 .2em; } .tobeat b { color: var(--gold); }
.xr .in { letter-spacing: .06em; white-space: nowrap; }

/* new-client credit claim */
.nc { max-height: 92%; overflow-y: auto; top: 50%; }
.nc .final { color: #9cf2a8; }
.nc-p { font-size: .9em; line-height: 1.35; margin: .6em 0; }
.claim input:not([type=checkbox]):not([type=file]) { width: 100%; box-sizing: border-box; margin: .25em 0; padding: .6em; border-radius: .45em; border: 0; font: 600 max(16px, .9em) var(--body); background: #fff6e3; color: #2a1a12; }
.claim .two { display: flex; gap: .4em; } .claim .two input { flex: 1; min-width: 0; }
.claim .up { display: block; margin: .3em 0; padding: .75em; border-radius: .5em; border: .12em dashed var(--gold); background: rgba(246,196,83,.12); font-weight: 800; cursor: pointer; }
.claim .up.light { opacity: .8; font-weight: 600; } .claim .up.done { border-style: solid; background: rgba(124,228,149,.15); border-color: #7be495; }
.claim .up input { display: none; }
.claim .chk { display: flex; gap: .5em; align-items: flex-start; text-align: left; font-size: .82em; margin: .5em 0; }
.nc .meter { height: .7em; margin: .3em 1em .5em; border-radius: 1em; background: rgba(255,255,255,.12); overflow: hidden; border: .08em solid rgba(156,242,168,.5); }
.nc .meter i { display: block; height: 100%; background: linear-gradient(90deg, #2f8f4e, #9cf2a8); box-shadow: 0 0 .6em rgba(156,242,168,.7); }

.card .btn.next { font-size: .62em; margin-top: .55em; width: 100%; letter-spacing: .02em; }
.card .acct { margin-top: .5em; text-align: center; }
.card .acct small { display: block; font-size: .6em; opacity: .85; margin-top: .35em; }
.card .acct a { color: #f6c453; }
.card .acct .btn.gold, .card .btn.gold.signin { width: 100%; font-size: .7em; margin-top: .4em; }

.xr.guest { color: #bfe8ff; }
.xr.guest .in { color: #9fdcff; }
.xr.guest .sc { color: #9fdcff; text-shadow: 0 0 .4em rgba(140,210,255,.5); }
.xr.guest .in em { font-style: normal; font-size: .62em; letter-spacing: .08em; margin-left: .5em; padding: .1em .35em; border-radius: .3em; background: #2f7fb5; color: #fff; vertical-align: .15em; }
.card .guestnote { display: block; color: #9fdcff; font-size: .8em; margin: .2em 0 .4em; }
.card .acct .guestbtn { margin-top: .4em; }
.card input.name.ini { letter-spacing: .5em; text-align: center; }

.mute.home { right: auto; left: 3%; }
.card .btn.back { margin-top: .4em; }
