:root {
  --plum: #6b2f57;
  --pink: #ff8fb8;
  --pinkD: #e2618f;
  --mint: #4fd6b0;
  --mintD: #2f9d82;
  --butter: #ffe08a;
  --cream: #fff6ec;
  --lilac: #c4b2ff;
  --hot: #ff4fae;
  --safeT: env(safe-area-inset-top, 0px);
  --safeB: env(safe-area-inset-bottom, 0px);
  --ol: 2px 0 0 var(--plum), -2px 0 0 var(--plum), 0 2px 0 var(--plum), 0 -2px 0 var(--plum), 1.5px 1.5px 0 var(--plum), -1.5px 1.5px 0 var(--plum), 1.5px -1.5px 0 var(--plum), -1.5px -1.5px 0 var(--plum), 0 4px 0 rgba(107, 47, 87, 0.35);
  --olBig: 3px 0 0 var(--plum), -3px 0 0 var(--plum), 0 3px 0 var(--plum), 0 -3px 0 var(--plum), 2.2px 2.2px 0 var(--plum), -2.2px 2.2px 0 var(--plum), 2.2px -2.2px 0 var(--plum), -2.2px -2.2px 0 var(--plum), 0 6px 0 rgba(107, 47, 87, 0.4);
  --olHuge: 5px 0 0 var(--plum), -5px 0 0 var(--plum), 0 5px 0 var(--plum), 0 -5px 0 var(--plum), 3.6px 3.6px 0 var(--plum), -3.6px 3.6px 0 var(--plum), 3.6px -3.6px 0 var(--plum), -3.6px -3.6px 0 var(--plum), 4.6px 2px 0 var(--plum), -4.6px 2px 0 var(--plum), 4.6px -2px 0 var(--plum), -4.6px -2px 0 var(--plum), 2px 4.6px 0 var(--plum), -2px 4.6px 0 var(--plum), 2px -4.6px 0 var(--plum), -2px -4.6px 0 var(--plum), 0 10px 0 rgba(107, 47, 87, 0.42);
  --olSmall: 1.3px 0 0 var(--plum), -1.3px 0 0 var(--plum), 0 1.3px 0 var(--plum), 0 -1.3px 0 var(--plum), 1px 1px 0 var(--plum), -1px 1px 0 var(--plum), 1px -1px 0 var(--plum), -1px -1px 0 var(--plum);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #f9d9e6; color: var(--plum); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
body { font-weight: 800; }
button { font-family: inherit; }
.hidden { display: none !important; }

#bg { position: fixed; inset: 0; background: #fbe0ea url("../assets/scene-bg.webp") center / cover no-repeat; }
#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; touch-action: none; -webkit-touch-callout: none; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
#topbar { position: absolute; top: calc(8px + var(--safeT)); left: 8px; right: 62px; height: 62px; display: flex; align-items: center; gap: 6px; }
.pcard { flex: 1 1 0; min-width: 0; height: 56px; display: flex; align-items: center; gap: 4px; padding: 0 8px 0 4px; border-radius: 20px; background: linear-gradient(180deg, #ffffff 0%, #fff1f6 100%); border: 3px solid var(--pink); box-shadow: 0 4px 0 rgba(107, 47, 87, 0.22); position: relative; transition: transform 0.2s cubic-bezier(.34,1.56,.64,1), box-shadow 0.2s; }
#card1 { border-color: var(--mint); flex-direction: row-reverse; padding: 0 4px 0 8px; background: linear-gradient(180deg, #ffffff 0%, #ecfbf6 100%); }
#card1 .pmeta { text-align: right; }
.ava { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; overflow: hidden; background: var(--pink); border: 2px solid #fff; }
#card1 .ava { background: var(--mint); }
.ava img { width: 100%; height: 160%; object-fit: cover; object-position: 50% 0%; display: block; transform: translateY(-2%); }
.pmeta { min-width: 0; flex: 1 1 auto; line-height: 1.05; padding-top: 6px; }
.pname { font-size: 14px; font-weight: 900; color: var(--pinkD); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#card1 .pname { color: var(--mintD); }
.pscore { font-size: 22px; font-weight: 900; color: #fff; text-shadow: var(--ol); font-variant-numeric: tabular-nums; display: inline-block; }
.pscore.bump { animation: bump 0.25s ease-out; }
.ptag { position: absolute; left: 50%; bottom: -13px; transform: translateX(-50%) scale(0); padding: 2px 8px; border-radius: 10px; background: #ff5a7a; color: #fff; font-size: 12px; font-weight: 900; white-space: nowrap; border: 2px solid #fff; transition: transform 0.25s cubic-bezier(.34,1.56,.64,1); }
.ptag.on { transform: translateX(-50%) scale(1); }
.pcard.active { transform: scale(1.07); box-shadow: 0 0 0 4px rgba(255, 242, 122, 0.95), 0 6px 14px rgba(255, 143, 184, 0.55); }
#card1.active { box-shadow: 0 0 0 4px rgba(255, 242, 122, 0.95), 0 6px 14px rgba(79, 214, 176, 0.55); }
.pcard:not(.active) { filter: saturate(0.75) brightness(0.97); }
/* round wins: a little star badge riding on the top edge of each card */
.pwins { position: absolute; top: -10px; left: 50px; display: flex; gap: 1px; height: 19px; padding: 0 4px; align-items: center; border-radius: 10px; background: var(--cream); border: 2px solid var(--pink); box-shadow: 0 2px 0 rgba(107, 47, 87, 0.2); }
#card1 .pwins { left: auto; right: 50px; border-color: var(--mint); }
.pwins:empty { display: none; }
.pwins i { font-style: normal; font-size: 14px; line-height: 1; color: #fff; text-shadow: var(--olSmall); opacity: 0.5; }
.pwins i.on { color: var(--butter); opacity: 1; }
.pwins.pulse { animation: starPop 0.6s cubic-bezier(.34,1.56,.64,1); }

#timer { position: relative; width: 58px; height: 58px; flex: 0 0 58px; }
#timer svg { width: 100%; height: 100%; transform: rotate(-90deg); filter: drop-shadow(0 3px 0 rgba(107, 47, 87, 0.25)); }
#timer .track { fill: #fffaf3; stroke: rgba(107, 47, 87, 0.15); stroke-width: 9; }
#timer .ring { fill: none; stroke: var(--pink); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 283; stroke-dashoffset: 0; transition: stroke 0.2s; }
#timer[data-player="1"] .ring { stroke: var(--mint); }
#timerNum { position: absolute; inset: 9px; display: flex; align-items: center; justify-content: center; font-size: 27px; font-weight: 900; color: #fff; text-shadow: var(--ol); }
#timer.hurry .ring { stroke: #ff4d6d; }
#timer.hurry { animation: hurry 0.5s ease-in-out infinite; }
#roundTag { position: absolute; left: 50%; top: calc(100% - 6px); transform: translateX(-50%); padding: 1px 7px; border-radius: 9px; background: var(--plum); color: #fff; font-size: 12px; line-height: 1.25; font-weight: 900; white-space: nowrap; box-shadow: 0 2px 0 rgba(107, 47, 87, 0.25); }
#roundTag:empty { display: none; }

#quota { position: absolute; top: calc(86px + var(--safeT)); left: 50%; transform: translateX(-50%) scale(0.8); opacity: 0; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 14px; border-radius: 17px; background: #fffaf3; border: 3px solid var(--pink); box-shadow: 0 3px 0 rgba(107, 47, 87, 0.2); white-space: nowrap; transition: opacity 0.2s, transform 0.25s cubic-bezier(.34,1.56,.64,1), background 0.2s; }
#quota[data-player="1"] { border-color: var(--mint); }
#quota.on { opacity: 1; transform: translateX(-50%) scale(1); }
#quota.done { background: var(--butter); }
#quotaText { font-size: 15px; font-weight: 900; color: var(--plum); }
#pips { display: flex; gap: 4px; }
#pips i { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid var(--plum); background: #fff; display: block; }
#pips i.full { background: var(--pink); animation: bump 0.25s ease-out; }
#quota[data-player="1"] #pips i.full { background: var(--mint); }
/* flags planted toward the next free item: a little flag badge at the end of the quota pill */
#flagProg { position: relative; display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 7px 0 4px; border-radius: 12px; background: #fff; border: 2.5px solid var(--plum); box-shadow: inset 0 -3px 0 rgba(107, 47, 87, 0.1); transition: background 0.2s, transform 0.2s; }
#flagProg svg { width: 18px; height: 18px; display: block; overflow: visible; }
#flagProg .pole { fill: var(--plum); }
#flagProg .cloth { fill: var(--pink); stroke: var(--plum); stroke-width: 1.5; stroke-linejoin: round; }
#quota[data-player="1"] #flagProg .cloth { fill: var(--mint); }
#flagNum { font-size: 14px; line-height: 1; font-weight: 900; color: var(--plum); font-variant-numeric: tabular-nums; }
#flagKey { min-width: 18px; padding: 1px 4px; border-radius: 6px; background: var(--plum); color: #fff; font: 900 10px/1.3 system-ui, sans-serif; text-align: center; }
#flagKey:empty { display: none; }
#flagProg.full { background: var(--butter); transform: scale(1.08); }
#flagProg.full .cloth { animation: clothWave 0.5s ease-in-out 2; transform-origin: 30% 50%; }
#flagProg.pulse { animation: bump 0.3s ease-out; }

#itembar { position: absolute; left: 10px; right: 10px; bottom: calc(10px + var(--safeB)); height: 84px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; pointer-events: auto; }
.item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 2px; border-radius: 20px; border: 3px solid var(--pink); background: linear-gradient(180deg, #ffffff 0%, #ffeef4 100%); box-shadow: 0 5px 0 rgba(107, 47, 87, 0.3); cursor: pointer; transition: transform 0.08s, filter 0.15s, opacity 0.15s; color: var(--plum); }
.panel-art .item { border-style: solid; border-width: 14px; border-image: var(--panel-img) var(--panel-slice) fill / 16px stretch; background: none; border-radius: 0; box-shadow: none; filter: drop-shadow(0 4px 0 rgba(107, 47, 87, 0.28)); padding: 0; }
#itembar[data-player="1"] .item:not(.panel-art *) { border-color: var(--mint); }
.item:active { transform: translateY(3px) scale(0.95); }
.item img { width: 40px; height: 40px; object-fit: contain; pointer-events: none; filter: drop-shadow(0 2px 1px rgba(107, 47, 87, 0.3)); }
.ilabel { font-size: 14px; font-weight: 900; color: var(--plum); white-space: nowrap; line-height: 1.1; }
.ibadge { position: absolute; top: -10px; right: -8px; min-width: 26px; padding: 1px 6px; border-radius: 12px; background: var(--butter); border: 2px solid var(--plum); font-size: 13px; font-weight: 900; color: var(--plum); }
.ibadge:empty { display: none; }
.item kbd { position: absolute; top: -10px; left: -8px; min-width: 22px; padding: 1px 5px; border-radius: 7px; background: var(--plum); color: #fff; font: 900 11px/1.3 system-ui, sans-serif; }
.item kbd:empty { display: none; }
.item.off { filter: grayscale(0.85) opacity(0.5); }
.item.pulse { animation: bump 0.3s ease-out; }
.item.deny { animation: deny 0.3s ease-in-out; }

/* the ring that fills around a held finger until the flag goes in */
#press { position: fixed; left: -200px; top: -200px; z-index: 6; width: 70px; height: 70px; border-radius: 50%; pointer-events: none; opacity: 0; transform: translate(-50%, -50%) scale(0.6); --p: 0; --pc: var(--pink);
  background:
    radial-gradient(circle closest-side, transparent 0 62%, var(--plum) 62% 68%, transparent 68% 92%, var(--plum) 92% 99%, transparent 99%),
    conic-gradient(var(--pc) calc(var(--p) * 360deg), rgba(255, 255, 255, 0.75) 0);
  -webkit-mask: radial-gradient(circle closest-side, transparent 0 61.5%, #000 62% 99%, transparent 99.5%);
  mask: radial-gradient(circle closest-side, transparent 0 61.5%, #000 62% 99%, transparent 99.5%);
  transition: opacity 0.1s, transform 0.12s cubic-bezier(.34,1.56,.64,1); }
#press.p1 { --pc: var(--mint); }
#press.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#press.done { animation: pressDone 0.4s ease-out forwards; }

/* ---------- banner (turn card, round and match cards), floaters, flash ---------- */
#banner { position: fixed; left: 0; right: 0; top: 31%; z-index: 6; display: flex; flex-direction: column; align-items: center; padding: 0 18px; text-align: center; pointer-events: none; opacity: 0; }
#banner.show { animation: bannerIn var(--bdur, 1.05s) ease-out forwards; }
/* a soft card behind the turn / round / match text so it reads over the board */
#banner.turn::before, #banner.round::before, #banner.match::before { content: ""; position: absolute; z-index: -1; left: max(4%, calc(50% - 190px)); right: max(4%, calc(50% - 190px)); top: -18px; bottom: -18px; border-radius: 34px; background: radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, 0.97) 0%, rgba(255, 246, 236, 0.94) 60%, rgba(255, 228, 238, 0.92) 100%); border: 5px solid var(--pink); box-shadow: 0 9px 0 rgba(107, 47, 87, 0.25), 0 0 0 9999px rgba(107, 47, 87, 0.12); }
#banner[data-player="1"]::before { border-color: var(--mint); background: radial-gradient(ellipse at 50% 40%, rgba(255, 255, 255, 0.97) 0%, rgba(240, 255, 250, 0.94) 60%, rgba(214, 248, 236, 0.92) 100%); }
#banner .b0 { display: inline-block; max-width: 100%; margin-bottom: 8px; padding: 3px 14px; border-radius: 14px; background: var(--plum); color: #fff; font-size: 15px; line-height: 1.3; font-weight: 900; letter-spacing: 0.03em; white-space: nowrap; }
#banner .b1 { display: inline-block; max-width: 100%; font-size: clamp(28px, 9.5vw, 44px); line-height: 1.12; font-weight: 900; color: #fff; text-shadow: var(--olBig); transform: rotate(-4deg); letter-spacing: 0.02em; overflow-wrap: anywhere; }
#banner[data-player="0"] .b1 { color: #fff0f6; }
#banner .bnum { position: relative; display: flex; align-items: baseline; justify-content: center; gap: 6px; margin-top: 4px; line-height: 1; white-space: nowrap; }
#banner .bnum b { display: inline-block; min-width: 0.62em; font-size: clamp(88px, 31vw, 128px); line-height: 1.02; font-weight: 900; color: #ff7aab; text-shadow: var(--olHuge); font-variant-numeric: tabular-nums; animation: numPop 0.55s cubic-bezier(.34,1.56,.64,1) 0.18s backwards; }
#banner[data-player="1"] .bnum b { color: #3fd1a8; }
/* the draw: each flick of the reel, then the landing bounce */
#banner .bnum b.tick { animation: rollTick 0.12s ease-out; }
#banner .bnum b.land { animation: numLand 0.5s cubic-bezier(.34,1.56,.64,1); }
#banner .bnum em.plus { position: absolute; left: calc(50% + 0.32em); top: -6px; font-style: normal; font-size: 40px; line-height: 1; font-weight: 900; color: #ff5a7a; text-shadow: var(--olBig); transform: rotate(10deg); animation: plusIn 0.45s cubic-bezier(.34,1.56,.64,1); }
#banner .bnum small { font-size: 30px; font-weight: 900; color: #fff; text-shadow: var(--olBig); }
#banner .bnum.score { gap: 14px; align-items: center; }
#banner .bnum.score b { font-size: clamp(64px, 21vw, 90px); }
#banner .bnum.score b.s0 { color: #ff7aab; }
#banner .bnum.score b.s1 { color: #3fd1a8; animation-delay: 0.26s; }
#banner .bnum.score i { font-style: normal; font-size: 52px; font-weight: 900; color: #fff; text-shadow: var(--olBig); }
#banner .b2 { display: inline-block; max-width: 100%; margin-top: 10px; padding: 4px 16px; border-radius: 16px; font-size: clamp(16px, 5vw, 20px); line-height: 1.25; font-weight: 900; color: var(--plum); background: var(--butter); border: 3px solid var(--plum); box-shadow: 0 4px 0 rgba(107, 47, 87, 0.3); }
#banner .b2:empty { display: none; }
#banner .b2.later { visibility: hidden; opacity: 0; }
#banner .b2.pop { animation: popIn 0.32s cubic-bezier(.34,1.56,.64,1); }
#banner.danger .b1 { color: #ffd6d6; }
#banner.match .b1 { color: var(--butter); }
body.paused #banner, body.paused #banner *, body.paused .floater, body.paused #timer, body.paused #press { animation-play-state: paused !important; }

#floaters { position: fixed; inset: 0; z-index: 7; pointer-events: none; overflow: hidden; }
.floater { position: absolute; transform: translate(-50%, -50%); font-size: 22px; font-weight: 900; color: #fff; text-shadow: var(--ol); white-space: nowrap; animation: floatUp 1.25s ease-out forwards; }
.floater.p1 { color: #ffd1e3; }
.floater.p2 { color: #c9f7ea; }
.floater.gold { color: var(--butter); font-size: 25px; }
.floater.combo { color: var(--butter); font-size: 27px; animation: comboUp 1.3s ease-out forwards; }
.floater.item { color: #efe8ff; font-size: 19px; }
.floater.hint { color: var(--hot); font-size: 23px; }
/* a refused move: smaller, a soft red, shakes once */
.floater.warn { font-size: 16px; color: #ffe0dc; animation: warnUp 1.25s ease-out forwards; }
/* a how-to tip: a butter pill that stays a little longer */
.floater.tip { width: max-content; max-width: min(88vw, 340px); padding: 6px 16px; border-radius: 18px; background: var(--butter); border: 3px solid var(--plum); box-shadow: 0 4px 0 rgba(107, 47, 87, 0.3); color: var(--plum); text-shadow: none; font-size: 16px; line-height: 1.3; white-space: normal; text-align: center; animation: tipUp 2.6s ease-out forwards; }

#flash { position: fixed; inset: 0; z-index: 8; background: #fff; opacity: 0; pointer-events: none; }
#flash.go { animation: flash 0.4s ease-out; }

/* ---------- buttons ---------- */
.cbtn { position: relative; isolation: isolate; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 58px; padding: 0 20px; border: 3px solid #fff; border-radius: 30px; background: linear-gradient(180deg, #fff3b0 0%, #ffd166 100%); box-shadow: 0 6px 0 #d98a3a, 0 10px 18px rgba(107, 47, 87, 0.2); color: #fff; font-size: 22px; font-weight: 900; text-shadow: var(--ol); cursor: pointer; transition: transform 0.12s cubic-bezier(.34,1.56,.64,1), filter 0.12s; white-space: nowrap; }
.cbtn.alt { background: linear-gradient(180deg, #b8f5e3 0%, #4fd6b0 100%); box-shadow: 0 6px 0 #2f9d82, 0 10px 18px rgba(107, 47, 87, 0.2); }
.cbtn.small { height: 46px; font-size: 17px; background: linear-gradient(180deg, #e9e1ff 0%, #b9a5ff 100%); box-shadow: 0 5px 0 #8a72d8, 0 8px 14px rgba(107, 47, 87, 0.2); }
.btn-art .cbtn { background: none; border: none; box-shadow: none; border-radius: 0; filter: drop-shadow(0 5px 6px rgba(107, 47, 87, 0.25)); }
.btn-art .cbtn::before { content: ""; position: absolute; inset: 0; z-index: -1; border-style: solid; border-width: 27px 34px; border-image: var(--btn-img) var(--btn-slice-y) var(--btn-slice-x) fill / 27px 34px stretch; }
.btn-art .cbtn.alt::before { filter: hue-rotate(115deg) saturate(0.9) brightness(1.02); }
.btn-art .cbtn.small::before { border-width: 21px 28px; border-image-width: 21px 28px; filter: hue-rotate(215deg) saturate(0.7) brightness(1.05); }
.cbtn.focus { transform: scale(1.07) translateY(-2px); filter: brightness(1.08) drop-shadow(0 0 8px rgba(255, 255, 255, 0.95)); }
.cbtn:active { transform: translateY(3px) scale(0.96); }

/* ---------- title ---------- */
#title { position: fixed; inset: 0; z-index: 20; overflow: hidden; background: #fbe0ea; }
#titleArt { position: absolute; inset: 0; background: url("../assets/cover-bg.webp") center / cover no-repeat; transform: scale(1.04); }
#title.enter #titleArt { animation: artIn 1.2s ease-out forwards; }
#logo { position: absolute; top: calc(5% + var(--safeT)); left: 50%; width: 84%; max-height: 30%; object-fit: contain; transform: translateX(-50%); opacity: 0; filter: drop-shadow(0 6px 0 rgba(107, 47, 87, 0.25)); }
#title.enter #logo { animation: logoIn 0.7s cubic-bezier(.34,1.56,.64,1) 0.15s forwards, logoFloat 3.2s ease-in-out 0.9s infinite; }
#titleMenu { position: absolute; left: 50%; bottom: calc(12% + var(--safeB)); transform: translateX(-50%); width: min(76%, 330px); display: flex; flex-direction: column; gap: 14px; }
#title.enter #titleMenu > * { animation: popIn 0.4s cubic-bezier(.34,1.56,.64,1) backwards; }
#title.enter #titleMenu > :nth-child(1) { animation-delay: 0.45s; }
#title.enter #titleMenu > :nth-child(2) { animation-delay: 0.55s; }
#title.enter #titleMenu > :nth-child(3) { animation-delay: 0.65s; width: 70%; margin: 0 auto; }
#titleHint { position: absolute; left: 0; right: 0; bottom: calc(5% + var(--safeB)); text-align: center; font-size: 15px; font-weight: 900; color: #fff; text-shadow: var(--ol); animation: hint 1.6s ease-in-out infinite; }

/* ---------- panels ---------- */
#help, #result { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(107, 47, 87, 0.35); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.panel { width: min(90%, 370px); max-height: 92%; overflow: auto; padding: 24px 22px; border-radius: 28px; background: var(--cream); border: 5px solid var(--pink); box-shadow: 0 10px 0 rgba(107, 47, 87, 0.25); display: flex; flex-direction: column; gap: 10px; animation: popIn 0.32s cubic-bezier(.34,1.56,.64,1); }
.panel-art .panel { border-style: solid; border-width: 30px; border-image: var(--panel-img) var(--panel-slice) fill / 34px stretch; background: none; box-shadow: none; border-radius: 0; padding: 8px 6px; filter: drop-shadow(0 10px 10px rgba(107, 47, 87, 0.3)); }
.ptitle { text-align: center; font-size: 30px; font-weight: 900; color: #fff; text-shadow: var(--olBig); }
#helpList { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
#helpList li { position: relative; padding-left: 20px; font-size: 15px; line-height: 1.4; font-weight: 800; color: var(--plum); }
#helpList li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 11px; height: 11px; border-radius: 50%; background: var(--pink); border: 2px solid var(--plum); }
#helpKeys { font-size: 12.5px; line-height: 1.4; color: #9a6a88; font-weight: 700; }
body[data-device="touch"] #helpKeys { display: none; }
#helpGo { margin-top: 6px; }
#resultWho { display: flex; justify-content: center; gap: 4px; height: 150px; }
#resultWho img { height: 150px; object-fit: contain; animation: hop 0.9s ease-in-out infinite; filter: drop-shadow(0 6px 4px rgba(107, 47, 87, 0.25)); }
#resultWho img.p2 { animation-delay: 0.45s; }
#resultTitle[data-player="0"] { color: #ffe1ee; }
#resultTitle[data-player="1"] { color: #dbfff4; }
#resultReason { text-align: center; font-size: 17px; font-weight: 900; color: var(--plum); }
#resultScores { display: flex; gap: 10px; }
.rs { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 16px; background: #fff; border: 3px solid var(--pink); }
#rs1 { border-color: var(--mint); }
.rs.win { background: var(--butter); }
.rn { font-size: 14px; font-weight: 900; }
.rv { font-size: 24px; font-weight: 900; color: #fff; text-shadow: var(--ol); }
.rp { margin-top: 2px; font-size: 13px; font-weight: 800; color: #9a6a88; }
.rbtns { display: flex; gap: 10px; margin-top: 4px; }
.rbtns .cbtn { font-size: 18px; padding: 0 10px; }

/* ---------- cutscene ---------- */
#cutscene { position: fixed; inset: 0; z-index: 40; background: #fbe0ea url("../assets/cover-bg.webp") center / cover no-repeat; }
#introVideo { width: 100%; height: 100%; object-fit: cover; display: block; }
#skip { position: absolute; top: calc(12px + var(--safeT)); right: 12px; min-width: 88px; height: 44px; padding: 0 16px; border-radius: 22px; border: 3px solid #fff; background: rgba(107, 47, 87, 0.55); color: #fff; font-size: 16px; font-weight: 900; text-shadow: var(--ol); cursor: pointer; }

/* ---------- keyframes ---------- */
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes starPop { 0% { transform: scale(1); } 35% { transform: scale(1.7) rotate(-8deg); } 100% { transform: scale(1); } }
@keyframes hurry { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes deny { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes bannerIn { 0% { opacity: 0; transform: scale(2.2); } 12% { opacity: 1; transform: scale(0.92); } 20% { transform: scale(1.04); } 27% { transform: scale(1); } 84% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.06) translateY(-14px); } }
@keyframes numPop { 0% { transform: scale(0) rotate(-20deg); } 70% { transform: scale(1.18) rotate(4deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes rollTick { 0% { transform: translateY(-22%) scale(0.9); opacity: 0.5; } 100% { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes numLand { 0% { transform: scale(1.55) rotate(-8deg); } 55% { transform: scale(0.9) rotate(3deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes plusIn { 0% { opacity: 0; transform: translateY(18px) scale(0.3) rotate(-20deg); } 100% { opacity: 1; transform: translateY(0) scale(1) rotate(10deg); } }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.5); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.2); } 30% { transform: translate(-50%, -70%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -190%) scale(1); } }
@keyframes warnUp { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); } 12% { opacity: 1; transform: translate(-56%, -60%) scale(1.08); } 20% { transform: translate(-44%, -62%) scale(1); } 28% { transform: translate(-50%, -64%); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -120%); } }
@keyframes tipUp { 0% { opacity: 0; transform: translate(-50%, -20%) scale(0.6); } 8% { opacity: 1; transform: translate(-50%, -55%) scale(1.06); } 14% { transform: translate(-50%, -50%) scale(1); } 86% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -85%) scale(0.96); } }
@keyframes comboUp { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3) rotate(-8deg); } 18% { opacity: 1; transform: translate(-50%, -60%) scale(1.3) rotate(-5deg); } 32% { transform: translate(-50%, -70%) scale(1) rotate(-4deg); } 100% { opacity: 0; transform: translate(-50%, -170%) scale(1) rotate(-4deg); } }
@keyframes pressDone { 0% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 35% { opacity: 1; transform: translate(-50%, -50%) scale(1.25); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); } }
@keyframes clothWave { 0%, 100% { transform: skewY(0); } 50% { transform: skewY(-12deg); } }
@keyframes flash { 0% { opacity: 0.9; } 100% { opacity: 0; } }
@keyframes artIn { from { transform: scale(1.12); } to { transform: scale(1.04); } }
@keyframes logoIn { 0% { opacity: 0; transform: translateX(-50%) translateY(-60px) scale(0.6); } 100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }
@keyframes logoFloat { 0%, 100% { transform: translateX(-50%) translateY(0) rotate(-1deg); opacity: 1; } 50% { transform: translateX(-50%) translateY(-6px) rotate(1deg); opacity: 1; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.6); } 100% { opacity: 1; transform: scale(1); } }
@keyframes hint { 0%, 100% { opacity: 0.6; transform: scale(1); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
