/* Risky Rolls on the web. Colours are RRColor.swift's; component looks follow the app
   (CandyButtonStyle, MatchSeatPlate, OnlineRaceBar, LootCard, OnlineResultPanel). */
@font-face { font-family: "Baloo 2"; src: url(fonts/Baloo2.woff2) format("woff2"); font-weight: 400 800; font-display: swap; }
:root {
  --cream: #FDFBF7; --coral: #FF8A73; --coral-deep: #FF6B4A; --mint: #96E8C3; --mint-deep: #10B981;
  --gold: #CC801A; --gold-soft: #FFD694; --gold-tint: #FFF7EB; --gold-ink: #8A5A12;
  --lav: #DFD0FF; --lav-deep: #B9A3EA; --lav-tint: #F5F0FF; --lav-ink: #6B5BB0; --ink: #3D3A37; --stone: #7E7975; --hair: #E6E3DE;
  --hot-top: #FF9E1B; --hot-bottom: #FF6A12; --hot-edge: #D84E08;
  --wall: #FBF6EE; --floor: #F0CC8E; --mat-ink: var(--lav-ink);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
html, body { margin: 0; height: 100%; overflow: hidden; background: linear-gradient(var(--wall) 50%, var(--floor) 50%); font-family: "Baloo 2", system-ui, sans-serif; color: var(--ink); touch-action: manipulation; overscroll-behavior: none; }
#stage { position: absolute; left: 50%; top: 50%; width: 360px; height: 720px; transform-origin: 0 0; }
button { font-family: inherit; border: 0; padding: 0; cursor: pointer; color: inherit; background: none; }
.hidden { display: none !important; }
#stage > section { position: absolute; inset: 0; overflow: hidden; }

/* CandyButtonStyle */
.candy { height: 54px; border-radius: 20px; font-weight: 800; font-size: 19px; display: flex; align-items: center; justify-content: center; gap: 6px; transition: transform .08s, box-shadow .08s, opacity .2s; }
.candy img { height: 34px; }
.candy:active { transform: translateY(6px); box-shadow: none !important; }
.candy.off { opacity: .45; pointer-events: none; }
.coral { background: var(--coral); color: #fff; box-shadow: 0 6px 0 var(--coral-deep); }
.mint { background: var(--mint); color: var(--ink); box-shadow: 0 6px 0 var(--mint-deep); }
.lav { background: var(--lav); color: var(--lav-ink); box-shadow: 0 6px 0 var(--lav-deep); }
.plain { background: #fff; color: var(--ink); box-shadow: 0 6px 0 var(--hair); }
.hotbtn { background: linear-gradient(var(--hot-top), var(--hot-bottom)); color: #fff; box-shadow: 0 6px 0 var(--hot-edge); }
.pulse { animation: breathe .8s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }

/* Home: HomeScreen.swift. Player chip and buttons on top, HomeLogoArtwork, then ModeCards. */
#lobby { display: flex; flex-direction: column; align-items: center; padding: 10px 18px 0; }
body.home { background: var(--cream); }
/* The wallpaper keeps its own shape on the stage; a wider or taller screen continues its edge colours around it. */
body.home.halloween { background: linear-gradient(#EAD7EF, #FEF5E7 28%, #FEF5E7 62%, #F3E3F0); }
#lobby { isolation: isolate; }
body.halloween #lobby::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: url(art/home-halloween.webp) center / 100% 100% no-repeat; }
/* Beside the stage on a wide screen, its sides melt into the page instead of ending in a line. */
@media (min-aspect-ratio: 3/4) {
  body.halloween #lobby::before { -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
}
#topbar { width: 100%; display: flex; align-items: center; gap: 8px; height: 48px; }
.chip { flex: 0 1 200px; min-width: 0; margin-right: auto; display: flex; align-items: center; gap: 9px; padding: 4px 12px 4px 5px; border-radius: 22px; background: #fff; border: 2px solid var(--hair); margin-right: auto; }
.chip button { flex: none; width: 34px; height: 34px; border-radius: 50%; box-shadow: 0 0 0 2px var(--lav-deep); transition: transform .08s; }
.chip button:active { transform: scale(.92); }
.chip img { display: block; width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--lav-tint); }
.chip input { width: 100%; min-width: 0; border: 0; outline: 0; background: none; font: 800 15px "Baloo 2", system-ui; color: var(--ink); padding: 0; user-select: text; -webkit-user-select: text; }
.chip:focus-within { border-color: var(--lav-ink); }
/* CandyChromeButtonStyle: the app's white icon button on a soft lip (SoundToggleButton, HomeActionButton) */
.chrome { width: 44px; height: 44px; flex: none; border-radius: 16px; background: #fff; box-shadow: 0 4px 0 rgba(61,58,55,.08); display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; line-height: 1; color: var(--stone); transition: transform .08s, box-shadow .08s; }
.chrome:active { transform: translateY(4px); box-shadow: none; }
.chrome svg { width: 26px; height: 26px; display: block; }
.chrome img { width: 34px; height: 34px; object-fit: contain; display: block; }
.lockup { display: flex; flex-direction: column; align-items: center; margin-top: 2px; }
.lockup .mascot { width: 112px; height: 112px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,138,115,.10) 92%, transparent 93%); }
.lockup .mascot img { width: 100%; height: 100%; object-fit: contain; }
.lockup .wordmark { width: 150px; height: 94px; margin-top: -8px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.lockup .wordmark img { width: 150px; height: 150px; object-fit: contain; flex: none; }
#modes { width: 100%; display: flex; flex-direction: column; gap: 13px; margin-top: 6px; }
/* ModeCardChrome: a white card on a lip of the mode's accent, which it sinks into while held */
.mode { position: relative; width: 100%; display: flex; align-items: center; gap: 14px; padding: 9px 14px; border-radius: 24px; background: #fff; border: 2px solid var(--hair); box-shadow: 0 5px 0 var(--lip); text-align: left; transition: transform .08s, box-shadow .08s; }
.mode:active { transform: translateY(5px); box-shadow: 0 0 0 var(--lip); }
.lip-coral { --lip: #FFD3C9; } .lip-lav { --lip: #E3DAF7; } .lip-mint { --lip: #C4EEDD; } .lip-gold { --lip: #F2DFC2; }
.mode img { width: 52px; height: 52px; object-fit: contain; flex: none; }
.mode div { flex: 1; min-width: 0; }
.mode b { display: block; font-size: 21px; font-weight: 800; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mode small { display: block; font-size: 13px; font-weight: 500; color: var(--stone); line-height: 1.2; }
.mode i { width: 10px; height: 10px; border-right: 3px solid rgba(126,121,117,.4); border-top: 3px solid rgba(126,121,117,.4); transform: rotate(45deg); border-radius: 2px; margin-right: 4px; flex: none; }
.mode span { flex: none; padding: 3px 8px; border-radius: 10px; background: rgba(61,58,55,.1); color: rgba(61,58,55,.65); font-size: 10px; font-weight: 800; letter-spacing: .4px; }
/* High Score in its Halloween dress (ModeCard's seasonalTheme): the card art carries the pumpkin */
body.halloween .mode[data-place="highscore"] { background: #3F245E url(art/card-halloween.webp) left bottom / cover no-repeat; border-color: #FF9E37; --lip: #FF9E37; }
body.halloween .mode[data-place="highscore"] img { visibility: hidden; }
body.halloween .mode[data-place="highscore"] b { color: #FFF8EF; } body.halloween .mode[data-place="highscore"] small { color: #FFF8EF; opacity: .9; }
body.halloween .mode[data-place="highscore"] span { background: rgba(255,248,239,.2); color: #FFF8EF; }
body.no-app .app { display: none; }
#lobby-status { position: absolute; left: 20px; right: 20px; bottom: 14px; margin: 0; padding: 8px 14px; border-radius: 16px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 700; text-align: center; opacity: 0; transition: opacity .2s; pointer-events: none; }
#lobby-status:not(:empty) { opacity: .94; }

/* Sheets over home: play a friend, searching, and the invite with its QR */
#sheet { z-index: 9; } #sheet.show { pointer-events: auto; }
/* Sheets dim the whole screen, not just the stage's column on a wide one */
#sheet, #howto { background: none; }
#sheet::before, #howto::before { content: ""; position: absolute; inset: -300% -600%; z-index: -1; background: rgba(61,58,55,.28); }
.target { display: flex; align-items: center; justify-content: center; gap: 12px; }
.target b { min-width: 150px; font-size: 19px; font-weight: 800; }
.target button { width: 44px; height: 44px; border-radius: 50%; background: #fff; box-shadow: 0 4px 0 var(--hair); font-size: 26px; font-weight: 800; line-height: 1; color: var(--lav-ink); }
.target button:active { transform: translateY(4px); box-shadow: none; }
.owns { display: flex; gap: 10px; }
.owns > div { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px 8px; border-radius: 18px; background: #fff; border: 2px solid var(--hair); }
.owns b { font-size: 15px; line-height: 1.1; } .owns small { font-size: 11px; font-weight: 700; color: var(--stone); }
.owns .price { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 800; color: var(--gold-ink); } .owns .price img { height: 18px; }
#sheet .card { gap: 10px; transform: scale(.85); transition: transform .3s cubic-bezier(.34,1.56,.64,1); }
#sheet.show .card { transform: none; }
#sheet .art { height: 150px; object-fit: contain; }
#sheet .or { font-size: 13px; font-weight: 800; color: var(--stone); letter-spacing: .5px; }
#join { display: flex; gap: 10px; }
#join input { flex: 1; min-width: 0; height: 54px; border-radius: 20px; border: 2px solid var(--lav); background: #fff; font: 800 22px "Baloo 2", system-ui; letter-spacing: 4px; text-align: center; color: var(--ink); text-transform: uppercase; user-select: text; -webkit-user-select: text; outline: none; }
#join input:focus { border-color: var(--lav-ink); }
#join button { width: 96px; }
#sheet .code { font-size: 40px; font-weight: 800; letter-spacing: 6px; line-height: 1; color: var(--coral-deep); user-select: text; -webkit-user-select: text; }
#sheet .lbl { font-size: 12px; font-weight: 800; letter-spacing: 1px; color: var(--stone); }
.qr-wrap { align-self: center; width: 176px; aspect-ratio: 1; background: #fff; border: 3px solid var(--lav-ink); border-radius: 18px; padding: 6px; }
.qr-wrap .qr { display: block; width: 100%; height: 100%; }
#sheet .note { min-height: 18px; margin: 0; font-size: 14px; }
.faces { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px 8px; }
.faces button { aspect-ratio: 1; border-radius: 50%; background: var(--lav-tint); transition: transform .08s, box-shadow .15s; }
.faces button:active { transform: scale(.92); }
.faces button.on { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--coral-deep); }
.faces img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* The table: wall above the rim, the theme's art from the rim down, floor colour below it */
#table { background: var(--floor); }
#wall { position: absolute; left: 0; right: 0; top: 0; height: 190px; background: var(--wall); }
#tableart { position: absolute; left: 0; top: 78px; width: 360px; height: 540px; pointer-events: none; }   /* rim at 78 + 131 = 209 */
#titlebar { position: absolute; left: 12px; right: 12px; top: 4px; height: 40px; display: flex; align-items: center; justify-content: space-between; }
#titlebar b { position: absolute; left: 50px; right: 96px; text-align: center; font-size: 19px; font-weight: 800; pointer-events: none; }
#titlebar span { display: flex; gap: 6px; }
#titlebar .chrome { width: 38px; height: 38px; border-radius: 14px; font-size: 21px; }
#titlebar .chrome svg { width: 23px; height: 23px; }
#leave { font-size: 17px !important; }

/* MatchSeatPlate and OnlineRaceBar */
#plates { position: absolute; left: 12px; right: 12px; top: 46px; display: flex; gap: 10px; }
.plate { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-radius: 18px; background: rgba(253,251,247,.85); border: 1px solid var(--hair); opacity: .8; transform: scale(.96); transition: transform .2s, opacity .2s; }
.plate img.face { width: 36px; height: 36px; border-radius: 50%; flex: none; object-fit: cover; background: var(--lav-tint); }
.plate div { min-width: 0; }
.plate small { display: block; font-size: 12px; font-weight: 700; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate b { font-size: 22px; line-height: 1.05; font-weight: 800; }
.plate.on { background: #fff; opacity: 1; transform: none; border: 3px solid var(--coral-deep); box-shadow: 0 4px 10px rgba(255,107,74,.35); padding: 4px 7px; }
.plate.on img.face { box-shadow: 0 0 0 3px var(--coral-deep); }
.plate.on b { color: var(--coral-deep); }
.plate.them.on { border-color: var(--lav-ink); box-shadow: 0 4px 10px rgba(107,91,176,.35); }
.plate.them.on img.face { box-shadow: 0 0 0 3px var(--lav-ink); } .plate.them.on b { color: var(--lav-ink); }
.plate .clock { position: absolute; right: 8px; top: 50%; margin-top: -15px; width: 30px; height: 30px; border-radius: 50%; background: var(--cream); border: 2px solid var(--hair); font-size: 15px; font-weight: 800; display: none; align-items: center; justify-content: center; }
.plate.on .clock.show { display: flex; }
.plate .clock.low { background: var(--coral-deep); border-color: var(--coral-deep); color: #fff; animation: breathe .5s ease-in-out infinite; }
.plate .gain { position: absolute; left: 50px; top: -6px; font-size: 18px; font-weight: 800; color: var(--mint-deep); pointer-events: none; animation: rise 1.1s ease-out forwards; }
.plate.away { opacity: .55; }
@keyframes rise { 0% { opacity: 0; transform: translateY(14px); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-12px); } }
#race { position: absolute; left: 18px; right: 18px; top: 104px; display: flex; align-items: center; gap: 6px; }
.track { flex: 1; height: 11px; border-radius: 6px; background: rgba(255,255,255,.9); border: 1px solid var(--hair); overflow: hidden; display: flex; }
.track i { display: block; height: 100%; border-radius: 6px; background: var(--lav-deep); transition: width .5s ease-out; }
.track.r { justify-content: flex-end; } .track.r i { background: var(--coral-deep); }
.flag { display: flex; flex-direction: column; align-items: center; line-height: 1; } .flag img { width: 22px; height: 22px; } .flag span { font-size: 11px; font-weight: 800; color: var(--gold-ink); margin-top: -2px; }
#status { text-align: center; height: 20px; flex: none; pointer-events: none; }
.plate.them { cursor: pointer; }
#status span { display: inline-block; padding: 2px 10px; border-radius: 10px; background: var(--coral-deep); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .5px; }

/* The opponent over the far rim, emotes, and connection trouble on the wall */
#opp { position: absolute; left: 50%; top: 131px; height: 80px; transform: translateX(-50%); pointer-events: none; transition: opacity .2s; }
/* FirstMatchCoach: in a new player's first match Risky Bot steps aside and talks them through it */
#table.coached #opp { left: 76px; }
#coach { position: absolute; left: 146px; right: 14px; top: 146px; min-height: 52px; padding: 8px 12px; border-radius: 20px; background: var(--lav-tint); border: 2px solid var(--lav); display: flex; align-items: center; font-size: 15px; font-weight: 800; line-height: 1.2; color: var(--ink); opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 2; }
#coach.show { opacity: 1; }
.emote { position: absolute; width: 62px; height: 62px; padding: 6px; background: #fff; border: 2px solid var(--hair); border-radius: 20px; box-shadow: 0 6px 14px rgba(61,58,55,.12); transform: scale(0); transition: transform .3s cubic-bezier(.34,1.56,.64,1); pointer-events: none; z-index: 3; }
.emote.show { transform: scale(1); } .emote img { width: 100%; height: 100%; object-fit: contain; }
#bubble-them { right: 44px; top: 138px; } #bubble-me { right: 12px; bottom: 96px; }
#notice { position: absolute; left: 16px; right: 16px; top: 172px; padding: 6px 12px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 700; text-align: center; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 4; }
#notice.show { opacity: .94; }

/* The felt (OnlineMatchScreen.felt): mode switch, turn score, dice, loot, top to bottom */
#felt { position: absolute; left: 26px; right: 26px; top: 216px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 6px 10px; border-radius: 24px; border: 2.5px dashed transparent; transition: background .3s, border-color .3s; }
/* The opponent's turn plays inside their lavender frame, so it never looks like your board */
#felt.watching { background: rgba(223,208,255,.16); border-color: rgba(185,163,234,.7); }
#score { text-align: center; font-weight: 800; font-size: 34px; line-height: 1; color: var(--gold); pointer-events: none; }
#score small { display: block; height: 14px; font-size: 11px; letter-spacing: 1.2px; color: var(--mat-ink); font-weight: 800; margin-bottom: 1px; }
#score.lost { color: var(--coral-deep); }
#table.dark #score { color: var(--gold-soft); } #table.dark { --mat-ink: #FFF8EF; }
#dice { display: grid; grid-template-columns: repeat(3, 58px); gap: 8px; }
.die { position: relative; width: 58px; height: 58px; border-radius: 22%; background: var(--die-face, #fff); box-shadow: 0 2px 6px rgba(61,58,55,.16); transition: transform .18s, box-shadow .18s, opacity .18s, filter .18s; }
.die i { position: absolute; width: 18%; height: 18%; margin: -9% 0 0 -9%; border-radius: 50%; background: var(--die-pip, var(--ink)); }
.die.art { background-color: transparent; background-size: 600% 100%; box-shadow: none; filter: drop-shadow(0 2px 3px rgba(61,58,55,.3)); }
.die.idle { opacity: .5; }
.die.empty { visibility: hidden; }
.die.claimed { transform: translateY(-3px); box-shadow: 0 0 0 3px var(--gold); }
.die.claimed::after { content: "✓"; position: absolute; right: -6px; top: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--gold); border: 2px solid #fff; color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.die.spent { opacity: .55; }
.die.bust { filter: grayscale(.85) opacity(.75); }
.die.rolling { animation: wobble .16s linear infinite; }
.die.hot { box-shadow: 0 0 0 3px var(--gold), 0 0 16px 5px var(--hot-top); }
.die.nudge { animation: nudge .7s ease-in-out infinite; }
.die.partial { outline: 2px dashed var(--gold); outline-offset: -2px; transform: translateY(-3px); }
@keyframes wobble { 0% { transform: rotate(-9deg) translateY(-3px); } 50% { transform: rotate(8deg) translateY(2px); } 100% { transform: rotate(-9deg) translateY(-3px); } }
@keyframes nudge { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* LootShelf and LootCard */
#shelf { min-height: 78px; width: 100%; display: flex; justify-content: center; align-items: center; gap: 8px; }
#shelf p { margin: 0; padding: 14px 0; font-size: 15px; font-weight: 700; color: var(--mat-ink); text-align: center; }
.bag { position: relative; min-width: 74px; padding: 5px 7px 5px; border-radius: 16px; background: #fff; border: 2px solid var(--hair); box-shadow: 0 4px 0 rgba(61,58,55,.06); display: flex; flex-direction: column; align-items: center; gap: 3px; transition: transform .2s, background .2s, border-color .2s, box-shadow .2s; animation: bagin .3s cubic-bezier(.34,1.56,.64,1); }
.bag img { height: 28px; } .bag.medium img { height: 34px; } .bag.huge img { height: 40px; }
.bag .mini { display: flex; gap: 2px; }
.bag .mini b { position: relative; width: 13px; height: 13px; border-radius: 24%; background: #F4F0EA; border: 1.5px solid #DDD7CD; }
.bag .mini b i { position: absolute; width: 22%; height: 22%; margin: -11% 0 0 -11%; border-radius: 50%; background: #B8B2A8; }
.bag span { font-weight: 800; font-size: 16px; line-height: 1; color: var(--ink); }
.bag.huge { background: var(--gold-tint); border-color: var(--gold-soft); } .bag.huge span { color: var(--gold); }
.bag.grabbed { background: var(--gold-tint); border-color: var(--gold); box-shadow: 0 6px 0 rgba(204,128,26,.3); transform: translateY(-2px); }
.bag.grabbed span { color: var(--gold); }
.bag.grabbed .mini b { background: #fff; border-color: #F2C877; } .bag.grabbed .mini b i { background: var(--gold); }
.bag.nudge { animation: nudge .7s ease-in-out infinite; border-color: var(--coral); }
.bag.theirs { pointer-events: none; }
@keyframes bagin { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
/* LootModeToggle: Eazy-Peazy takes whole bags, DIY builds them die by die. Offered before a turn's first throw. */
#toggle { width: 256px; height: 42px; flex: none; padding: 3px; display: flex; gap: 5px; background: var(--lav-tint); border: 2px solid var(--lav); border-radius: 21px; }
#toggle button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; border-radius: 17px; font-weight: 800; font-size: 14px; color: var(--lav-ink); transition: background .2s; }
#toggle button.on { background: #fff; }
#toggle button.on::after { content: "✓"; display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; background: var(--lav-ink); color: #fff; font-size: 9px; }
#toggle img { height: 24px; }

/* DIY (OnlineManualDiceTray): an instruction line and the dice in six slots, just above the buttons. The felt
   then shows only what they pack into: built bags without their dice, a little smaller. */
#tray { position: absolute; left: 0; right: 0; bottom: 84px; display: none; flex-direction: column; align-items: center; gap: 8px; }
#table.diy #tray { display: flex; }
#trayhint { margin: 0; height: 16px; font-size: 12px; font-weight: 700; color: var(--lav-ink); text-align: center; }
#table.diy.dark #trayhint { color: #FFF8EF; }
#table.diy #dice { grid-template-columns: repeat(3, 62px); gap: 10px; }
#table.diy .die { width: 62px; height: 62px; }
#table.diy #shelf .bag .mini { display: none; }
#table.diy #shelf .bag { transform: scale(.9); } #table.diy #shelf .bag.grabbed { transform: scale(.9) translateY(-2px); }

/* The near edge: this player's buttons or who everyone is waiting for, and the reaction button */
#buttons { position: absolute; left: 14px; right: 14px; bottom: 12px; display: flex; align-items: flex-start; gap: 8px; height: 64px; }
#buttons .candy { flex: 1; min-width: 0; height: 58px; font-size: 18px; white-space: nowrap; }
#buttons .candy img { height: 30px; }
#waiting { flex: 1; min-width: 0; height: 60px; border-radius: 20px; background: var(--lav-tint); border: 1px solid rgba(185,163,234,.5); display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--lav-ink); white-space: nowrap; overflow: hidden; }
#waiting i { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--lav-deep); border-top-color: var(--lav-ink); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
#emote-open { width: 58px; height: 58px; flex: none; border-radius: 50%; background: #fff; box-shadow: 0 4px 0 rgba(61,58,55,.08); padding: 10px; transition: transform .08s, box-shadow .08s; }
#emote-open:active { transform: translateY(4px); box-shadow: none; }
#emote-open img { width: 100%; height: 100%; object-fit: contain; }
/* OnlineEmotePicker: the six reactions, over the button that opens them */
#emotes { position: absolute; right: 14px; bottom: 86px; width: 196px; padding: 10px; border-radius: 22px; background: #fff; box-shadow: 0 10px 24px rgba(61,58,55,.22); display: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; z-index: 6; }
#emotes.open { display: grid; }
#emotes button { aspect-ratio: 1; min-width: 0; border-radius: 16px; background: var(--cream); padding: 6px; transition: transform .08s; }
#emotes button:active { transform: scale(.92); }
#emotes button img { width: 100%; height: 100%; object-fit: contain; }

/* Overlays: LootCelebrationOverlay, HotDiceBanner, FarkleBurstStage, OnlineTurnBanner */
.overlay { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .25s; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 5; }
.overlay.show { opacity: 1; }
.overlay.dim { background: rgba(61,58,55,.2); }
.overlay.solid { background: rgba(253,251,247,.97); z-index: 8; }
.overlay.solid.show, #confirm.show { pointer-events: auto; }
#burst { position: absolute; inset: 0; opacity: .85; overflow: hidden; }
#burst > div { position: absolute; left: 50%; top: 50%; width: 720px; height: 720px; margin: -360px 0 0 -360px; }
#burst > div > div { position: absolute; inset: 0; }
.banner { position: relative; padding: 10px 24px 12px; background: rgba(255,255,255,.94); border: 2px solid var(--gold-soft); border-radius: 24px; text-align: center; box-shadow: 0 8px 18px rgba(204,128,26,.25); transform: scale(.7); transition: transform .45s cubic-bezier(.34,1.8,.64,1); max-width: 320px; }
.overlay.show .banner { transform: scale(1); }
#celebrate .banner { margin-bottom: 60px; }
.banner b { display: block; font-size: 40px; line-height: 1.05; color: var(--gold); white-space: pre-line; }
.banner b.big { font-size: 54px; }
.banner em { font-style: normal; font-size: 14px; font-weight: 700; }
#bombart { width: 340px; height: 340px; margin-bottom: 110px; }
#fire { position: relative; width: 290px; height: 290px; margin-bottom: -28px; }
#fire > div { position: absolute; inset: 0; }
#fire > div.tumble { left: 21.5%; top: 42.5%; width: 57%; height: 57%; }
#hotdice .banner { border-radius: 22px; box-shadow: 0 8px 18px rgba(61,58,55,.18); }
#hotdice .banner b { font-size: 30px; color: var(--ink); }
#hotdice .banner em { font-size: 13px; font-weight: 600; color: var(--stone); }
#turnbanner .banner { border-color: var(--lav); box-shadow: 0 8px 18px rgba(107,91,176,.25); margin-bottom: 120px; }
#turnbanner .banner b { font-size: 30px; color: var(--lav-ink); }
#turnbanner.urgent .banner { border-color: var(--coral); } #turnbanner.urgent .banner b { color: var(--coral-deep); }
#confirm { z-index: 9; }
.card { width: 300px; padding: 20px 18px 18px; border-radius: 28px; background: var(--cream); box-shadow: 0 14px 30px rgba(61,58,55,.3); text-align: center; display: flex; flex-direction: column; gap: 12px; }
.card h2 { margin: 0; font-size: 24px; font-weight: 800; } .card p { margin: 0 0 4px; font-size: 16px; font-weight: 600; color: var(--stone); line-height: 1.25; }

/* The coin shop, to look through (ShopPage.swift): header, tab dock, a grid of cards */
#shop { z-index: 9; justify-content: flex-start; align-items: stretch; background: var(--cream) url(art/shop-back.webp) center / cover no-repeat; }
.shop-top { display: flex; align-items: center; gap: 10px; padding: 8px 14px 6px; }
.shop-top b { flex: 1; font-size: 24px; font-weight: 800; } .shop-top img { height: 44px; } .shop-top .chrome { font-size: 30px; padding-bottom: 4px; }
.shop-tabs { display: flex; gap: 6px; margin: 0 14px 8px; padding: 4px; border-radius: 22px; background: rgba(255,255,255,.85); border: 2px solid var(--hair); }
.shop-tabs button { flex: 1; height: 40px; border-radius: 17px; display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 15px; font-weight: 800; color: var(--stone); }
.shop-tabs button.on { background: var(--gold-tint); box-shadow: inset 0 0 0 2px var(--gold-soft); color: var(--gold-ink); }
.shop-tabs img { height: 26px; }
.shop-grid { flex: 1; overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 2px 14px 18px; align-content: start; -webkit-overflow-scrolling: touch; }
.shop-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px 9px; border-radius: 20px; background: #fff; border: 2px solid var(--hair); box-shadow: 0 4px 0 rgba(61,58,55,.06); text-align: center; }
.shop-art { height: 84px; width: 100%; display: flex; align-items: center; justify-content: center; }
.shop-art img { max-height: 84px; max-width: 100%; object-fit: contain; }
.shop-art .die { width: 62px; height: 62px; }
.shop-art .tableshot { width: 100%; height: 84px; object-fit: cover; object-position: 50% 30%; border-radius: 12px; }
.shop-card b { font-size: 16px; font-weight: 800; line-height: 1.1; margin-top: 4px; }
.shop-card small { font-size: 11px; font-weight: 600; color: var(--stone); line-height: 1.15; min-height: 13px; }
.shop-card .price { display: inline-flex; align-items: center; gap: 4px; font-size: 16px; font-weight: 800; color: var(--gold-ink); }
.shop-card .price img { height: 20px; }
.shop-card .candy { width: 100%; height: 38px; border-radius: 14px; font-size: 15px; margin-top: 4px; box-shadow: 0 4px 0 var(--coral-deep); }
.shop-card .have { width: 100%; height: 38px; margin-top: 4px; border-radius: 14px; background: var(--lav-tint); color: var(--lav-ink); font-size: 14px; font-weight: 800; display: flex; align-items: center; justify-content: center; }

/* How to play: three steps and the app's scoring cheat sheet */
#howto { z-index: 10; } #howto.show { pointer-events: auto; }
#howto .card { width: 328px; max-height: 660px; padding: 16px 14px 14px; gap: 8px; }
#howto h2 { font-size: 26px; }
#howto .steps { display: flex; gap: 6px; }
#howto .step { flex: 1; padding: 8px 4px 6px; border-radius: 16px; background: #fff; border: 2px solid var(--hair); }
#howto .step img { height: 40px; } #howto .step b { display: block; font-size: 14px; line-height: 1.1; } #howto .step small { display: block; font-size: 11px; font-weight: 600; color: var(--stone); line-height: 1.15; margin-top: 2px; }
#howto .pays { overflow-y: auto; overscroll-behavior: contain; border-radius: 16px; background: #fff; border: 2px solid var(--hair); padding: 2px 10px; text-align: left; }
#howto .pay { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--hair); font-size: 14px; font-weight: 700; }
#howto .pay:last-child { border-bottom: 0; }
#howto .pay span { flex: 1; } #howto .pay b { color: var(--gold); font-size: 16px; }
#howto .pay .mini { display: flex; gap: 2px; width: 88px; flex: none; }
#howto .mini i { position: relative; width: 13px; height: 13px; border-radius: 24%; background: #F4F0EA; border: 1.5px solid #DDD7CD; }
#howto .mini i u { position: absolute; width: 22%; height: 22%; margin: -11% 0 0 -11%; border-radius: 50%; background: var(--ink); }
#howto .rule { margin: 0; font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.25; text-align: left; display: flex; gap: 8px; align-items: center; }
#howto .rule img { height: 30px; flex: none; }

/* Match found */
#reveal { gap: 6px; }
#reveal .versus { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; }
#reveal .who { width: 120px; text-align: center; }
#reveal .who img { width: 84px; height: 84px; border-radius: 50%; background: var(--lav-tint); box-shadow: 0 0 0 4px #fff, 0 6px 14px rgba(61,58,55,.18); object-fit: cover; }
#reveal .who b { display: block; margin-top: 8px; font-size: 17px; font-weight: 800; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#reveal .clash { width: 96px; }
#reveal h2 { margin: 0 0 14px; font-size: 30px; font-weight: 800; color: var(--coral-deep); }
#reveal p { margin: 14px 0 0; font-size: 17px; font-weight: 700; color: var(--stone); }

/* OnlineResultPanel */
#result { padding: 18px 22px; gap: 6px; overflow: hidden; }
#result .art { height: 170px; object-fit: contain; animation: bob 1.4s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-4px) rotate(1deg); } }
#result h2 { margin: 2px 0 0; font-size: 32px; line-height: 1.05; font-weight: 800; text-align: center; }
#result .sub { margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--stone); text-align: center; }
#result .rows { width: 100%; display: flex; flex-direction: column; gap: 6px; }
#result .row { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 16px; background: #fff; border: 2px solid var(--hair); font-weight: 800; }
#result .row img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--lav-tint); }
#result .row span { flex: 1; min-width: 0; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#result .row b { font-size: 22px; }
#result .row.won { border-color: var(--gold); background: var(--gold-tint); } #result .row.won b { color: var(--gold); }
#result .coins { width: 100%; margin-top: 4px; padding: 8px 12px 10px; border-radius: 20px; background: var(--gold-tint); border: 2px solid var(--gold-soft); text-align: center; }
#result .coins .won { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 34px; font-weight: 800; color: var(--gold); line-height: 1; }
#result .coins .won img { height: 44px; }
#result .coins p { margin: 2px 0 8px; font-size: 15px; font-weight: 700; color: var(--gold-ink); line-height: 1.2; }
#result .coins .candy { width: 100%; height: 50px; }
#result .offer { min-height: 20px; margin: 4px 0 0; font-size: 15px; font-weight: 800; color: var(--coral-deep); }
#result .actions { width: 100%; display: flex; gap: 10px; margin-top: 2px; }
#result .actions .candy { flex: 1; }
.confetti { position: absolute; width: 8px; height: 12px; top: -20px; border-radius: 2px; animation: fall linear forwards; pointer-events: none; }
@keyframes fall { to { transform: translateY(800px) rotate(720deg); } }

@media (prefers-reduced-motion: reduce) {
  .pulse, .die.nudge, .bag.nudge, #result .art { animation: none; }
}
