:root { --g:#2ee59d; --b:#4aa8ff; --gold:#ffd25e; --bg:#0b0d1f; --ink:#f2f4ff; --muted:#8e95c4; --glow:46,229,157; }
body[data-turn="blue"] { --glow:74,168,255; }
body[data-turn="win"] { --glow:255,210,94; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  color: var(--ink); overflow-x: hidden;
  font-family: "Lilita One", ui-rounded, "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  background: radial-gradient(ellipse at 50% -10%, rgba(var(--glow),.22), transparent 55%), radial-gradient(ellipse at 50% 120%, rgba(124,92,255,.25), transparent 50%), var(--bg);
  transition: background .6s;
}
button { font: inherit; cursor: pointer; }
.game { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: max(10px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom)); gap: 10px; }

/* HUD */
.hud { width: min(680px, 100%); display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.pcard { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 18px; background: rgba(255,255,255,.06); border: 2px solid transparent; opacity: .6; transition: .25s; }
.pcard.active { opacity: 1; transform: translateY(-2px); }
.pcard.green.active { border-color: var(--g); box-shadow: 0 0 22px rgba(46,229,157,.45); }
.pcard.blue.active { border-color: var(--b); box-shadow: 0 0 22px rgba(74,168,255,.45); }
.pcard strong { font-size: 26px; font-weight: 400; }
.pinfo { flex: 1; min-width: 0; font-size: 13px; letter-spacing: .08em; }
.pinfo.right { text-align: right; }
.pinfo i { font-style: normal; font-size: 10px; padding: 1px 6px; border-radius: 8px; background: var(--gold); color: #3a2a00; letter-spacing: 0; }
.bar { height: 7px; margin-top: 5px; border-radius: 9px; background: rgba(255,255,255,.1); overflow: hidden; }
.bar span { display: block; height: 100%; width: 100%; border-radius: 9px; transition: width .4s; }
.green .bar span { background: linear-gradient(90deg,#0f9d68,var(--g)); }
.blue .bar span { background: linear-gradient(90deg,#1d5fd1,var(--b)); margin-left: auto; }
.gem { flex: 0 0 30px; height: 30px; border-radius: 50%; box-shadow: inset -3px -4px 6px rgba(0,0,0,.35), inset 3px 3px 6px rgba(255,255,255,.55), 0 3px 8px rgba(0,0,0,.4); }
.gem.green { background: radial-gradient(circle at 35% 30%, #b9ffe3, var(--g) 45%, #087a50); }
.gem.blue { background: radial-gradient(circle at 35% 30%, #c7e5ff, var(--b) 45%, #164fb5); }
.clock { position: relative; width: 70px; height: 70px; display: grid; place-items: center; }
.clock svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.clock circle { fill: rgba(11,13,31,.8); stroke-width: 5; }
.ring-bg { stroke: rgba(255,255,255,.12); }
.ring-fg { fill: none !important; stroke: rgb(var(--glow)); stroke-linecap: round; stroke-dasharray: 163.4; transition: stroke .3s; }
.clock span { position: relative; font-size: 26px; font-variant-numeric: tabular-nums; }
.clock.urgent span { color: #ff8a8a; animation: pulse .5s infinite alternate; }
.clock.urgent .ring-fg { stroke: #ff5d5d; }

/* Stage */
.stage { width: min(680px, 100%); display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 1; }
.turn-pill { margin: 0; padding: 5px 18px; border-radius: 999px; font-size: 15px; letter-spacing: .12em; color: #06231a; background: rgb(var(--glow)); box-shadow: 0 0 18px rgba(var(--glow),.6); transition: background .3s; }
.room-chip { align-self: flex-end; display: flex; gap: 8px; align-items: center; font-size: 12px; letter-spacing: .1em; color: var(--muted); }
.room-chip strong { color: var(--gold); font-weight: 400; font-size: 16px; letter-spacing: .2em; }
.chip-btn { border: 0; border-radius: 8px; padding: 3px 9px; background: rgba(255,255,255,.12); color: var(--ink); font-size: 11px; }
.board-wrap { position: relative; width: min(100%, calc(100dvh - 330px), 640px); min-width: 280px; aspect-ratio: 1; padding: 8px; border-radius: 28px; background: linear-gradient(160deg,#2a2f63,#12152e); border: 2px solid rgba(var(--glow),.55); box-shadow: 0 0 44px rgba(var(--glow),.3), 0 18px 40px rgba(0,0,0,.5); transition: .4s; }
#board { display: block; width: 100%; height: 100%; touch-action: manipulation; }
.board-frame { fill: #151936; stroke: rgba(255,255,255,.08); stroke-width: 2; }
.board-line { stroke: #4d5690; stroke-width: 3; stroke-linecap: round; }
.point { cursor: pointer; outline: none; }
.point-hit { fill: transparent; }
.point-core { fill: #262c5a; stroke: #3a4283; stroke-width: 2; }
.piece { stroke: rgba(255,255,255,.75); stroke-width: 2; filter: drop-shadow(0 4px 3px rgba(0,0,0,.55)); }
.piece.green { fill: url(#gG); } .piece.blue { fill: url(#gB); }
.shine { fill: rgba(255,255,255,.45); pointer-events: none; }
.selection-ring { fill: none; stroke: var(--gold); stroke-width: 4; stroke-dasharray: 8 6; transform-box: fill-box; transform-origin: center; animation: spin 4s linear infinite; }
.chain-ring { fill: none; stroke: #ff7ae0; stroke-width: 4; transform-box: fill-box; transform-origin: center; animation: ring 0.8s ease-in-out infinite alternate; }
.mark.move { fill: var(--gold); filter: drop-shadow(0 0 6px var(--gold)); animation: pulse .7s infinite alternate; }
.mark.cap { fill: rgba(255,80,80,.2); stroke: #ff5d5d; stroke-width: 4; filter: drop-shadow(0 0 8px #ff5d5d); animation: ring .6s infinite alternate; }
.mark-x { fill: #ff8a8a; font-size: 20px; pointer-events: none; }
.point:focus-visible .point-hit { stroke: #fff; stroke-width: 2; stroke-dasharray: 4 4; }
.burst { fill: none; stroke-width: 5; transform-box: fill-box; transform-origin: center; animation: burst .6s ease-out forwards; pointer-events: none; }
.burst.green { stroke: var(--g); } .burst.blue { stroke: var(--b); }

/* Toast */
.toast { position: absolute; inset: 50% 8% auto; transform: translateY(-50%); text-align: center; padding: 18px 12px; border-radius: 22px; background: rgba(20,10,40,.92); border: 2px solid #c06bff; box-shadow: 0 0 40px rgba(192,107,255,.6); pointer-events: none; }
.toast b { display: block; font-size: clamp(22px,6vw,34px); font-weight: 400; color: #ffe38a; }
.toast span { font-size: 14px; color: #d9c4ff; letter-spacing: .04em; }
.toast.show { animation: toast 2.6s ease forwards; }

/* 5-second window */
.window { width: min(100%, 460px); padding: 10px 14px 12px; border-radius: 20px; background: rgba(255,210,94,.1); border: 2px solid rgba(255,210,94,.55); animation: rise .25s ease-out; }
.window-top { display: flex; justify-content: center; align-items: center; gap: 10px; font-size: 14px; letter-spacing: .05em; text-align: center; }
.combo { padding: 2px 10px; border-radius: 999px; background: linear-gradient(90deg,#ff7ae0,#ffb347); color: #2b0a2b; animation: pulse .5s infinite alternate; }
.window-track { height: 10px; margin: 9px 0; border-radius: 9px; background: rgba(255,255,255,.12); overflow: hidden; }
#window-fill { display: block; height: 100%; width: 100%; background: linear-gradient(90deg,#ff5d5d,var(--gold)); }
.window-actions { display: flex; gap: 10px; }
.window-actions .btn { flex: 1; }
.status { margin: 0; min-height: 22px; text-align: center; color: var(--muted); font-size: 16px; letter-spacing: .03em; }

/* Buttons */
.btn { border: 0; border-radius: 14px; padding: 11px 18px; font-size: 16px; letter-spacing: .04em; color: var(--ink); background: rgba(255,255,255,.12); box-shadow: 0 4px 0 rgba(0,0,0,.35); transition: transform .1s, box-shadow .1s, filter .15s; }
.btn:hover:not(:disabled) { filter: brightness(1.15); }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.big { width: 100%; padding: 15px; font-size: 20px; }
.btn.green { background: linear-gradient(#37f0a8,#0f9d68); color: #04281c; }
.btn.blue { background: linear-gradient(#6cbcff,#1d5fd1); color: #04152e; }
.btn.gold { background: linear-gradient(#ffe07c,#e8a21c); color: #3a2a00; }
.dock { display: flex; gap: 10px; }

/* Overlays */
.overlay { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; background: rgba(6,7,20,.82); backdrop-filter: blur(6px); }
.menu-card { width: min(380px, 100%); max-height: 100%; overflow: auto; padding: 24px 20px; display: grid; gap: 12px; justify-items: center; text-align: center; border-radius: 28px; background: linear-gradient(160deg,#242a5e,#12152e); border: 2px solid rgba(255,255,255,.14); box-shadow: 0 0 60px rgba(124,92,255,.4); animation: rise .3s ease-out; }
.logo { width: 64px; height: 64px; display: grid; place-items: center; font-size: 36px; border-radius: 20px; color: #3a2a00; background: linear-gradient(#ffe07c,#e8a21c); box-shadow: 0 0 30px rgba(255,210,94,.6); animation: float 2.4s ease-in-out infinite; }
.menu-card h1, .menu-card h2 { margin: 0; font-weight: 400; font-size: 42px; letter-spacing: .08em; background: linear-gradient(90deg,var(--g),var(--b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tag { margin: -6px 0 6px; color: var(--muted); letter-spacing: .12em; font-size: 14px; }
.or { width: 100%; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.15); }
.conn { padding: 3px 12px; border-radius: 999px; font-size: 12px; letter-spacing: .06em; }
.conn.online { background: rgba(46,229,157,.2); color: var(--g); } .conn.offline { background: rgba(255,93,93,.2); color: #ff9b9b; }
.join { width: 100%; display: flex; gap: 8px; }
.join input { flex: 1; min-width: 0; border: 2px solid rgba(255,255,255,.18); border-radius: 14px; padding: 11px; font: inherit; font-size: 18px; letter-spacing: .25em; text-align: center; text-transform: uppercase; color: var(--ink); background: rgba(0,0,0,.3); }
.room-message { margin: 0; min-height: 16px; font-size: 13px; color: var(--muted); font-family: system-ui, sans-serif; }
.how { width: 100%; text-align: left; font-family: system-ui, sans-serif; font-size: 13px; color: var(--muted); }
.how summary { cursor: pointer; text-align: center; font-family: "Lilita One", ui-rounded, sans-serif; letter-spacing: .08em; }
.how ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.5; }
.trophy { font-size: 64px; animation: float 1.6s ease-in-out infinite; }

@keyframes pop { from { transform: scale(.3); } to { transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ring { to { transform: scale(1.18); opacity: .7; } }
@keyframes pulse { to { opacity: .6; transform: scale(.96); } }
@keyframes burst { from { transform: scale(.3); opacity: 1; } to { transform: scale(2.6); opacity: 0; } }
@keyframes toast { 0% { opacity: 0; transform: translateY(-50%) scale(.6); } 12% { opacity: 1; transform: translateY(-50%) scale(1.06); } 20%,85% { opacity: 1; transform: translateY(-50%) scale(1); } 100% { opacity: 0; transform: translateY(-50%) scale(.95); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes float { 50% { transform: translateY(-6px); } }
@media (max-width: 480px) { .pcard { padding: 6px 8px; gap: 6px; } .pcard strong { font-size: 22px; } .gem { flex-basis: 22px; height: 22px; } .clock { width: 60px; height: 60px; } .clock span { font-size: 22px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* ===== Round 2: motion, mobile, game feel ===== */
html, body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 30; pointer-events: none; }
.bg { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.bg i { position: absolute; width: 38vmax; height: 38vmax; border-radius: 50%; filter: blur(70px); opacity: .28; animation: drift 18s ease-in-out infinite alternate; }
.bg i:nth-child(1) { background: #2ee59d; left: -12vmax; top: -10vmax; }
.bg i:nth-child(2) { background: #4aa8ff; right: -14vmax; bottom: -12vmax; animation-delay: -6s; }
.bg i:nth-child(3) { background: #7c5cff; left: 30vw; top: 40vh; width: 26vmax; height: 26vmax; animation-delay: -3s; }
.bg i:nth-child(4) { background: #ff7ae0; right: 10vw; top: -8vmax; width: 20vmax; height: 20vmax; opacity: .18; animation-delay: -9s; }
.bg i:nth-child(5) { background: #ffd25e; left: 5vw; bottom: -8vmax; width: 20vmax; height: 20vmax; opacity: .15; animation-delay: -12s; }
.game { position: relative; z-index: 1; }
.overlay { z-index: 40; }

/* pieces */
.pc { transform-box: fill-box; transform-origin: center; }
.pc.pop { animation: pop .42s cubic-bezier(.2,1.7,.4,1); }
.pc.slide { animation: hop .42s cubic-bezier(.3,.7,.3,1); }
.pc.sel { animation: bob .7s ease-in-out infinite alternate; }
.pc.sel .piece { filter: drop-shadow(0 0 10px rgb(var(--glow))) drop-shadow(0 6px 4px rgba(0,0,0,.5)); }
.spark { transform-box: fill-box; transform-origin: center; animation: spark .6s ease-out forwards; pointer-events: none; }
.spark.green { fill: var(--g); } .spark.blue { fill: var(--b); }
.point:hover .point-core { fill: #3a4283; }
.board-wrap.shake { animation: shake .35s; }
.toast.combo { border-color: #ff9d3c; box-shadow: 0 0 44px rgba(255,157,60,.7); background: rgba(40,16,6,.92); }
.turn-pill.swap { animation: swap .5s cubic-bezier(.2,1.6,.4,1); }
.menu-card h1 { background-size: 200% 100%; animation: shimmer 4s linear infinite; }
.window-slot { width: 100%; min-height: 128px; display: flex; justify-content: center; }
.banner-sub { margin: 0; font-size: 20px; color: var(--gold); letter-spacing: .05em; }
.banner-stats { margin: 0; white-space: pre-line; color: var(--muted); font-size: 15px; line-height: 1.7; }
.btn.rematch { animation: throb 1.1s ease-in-out infinite; }
.btn.rematch:disabled { animation: none; }
#mute { padding: 11px 14px; }
.dock { padding-bottom: 4px; }

@keyframes drift { to { transform: translate(8vw, 6vh) scale(1.25); } }
@keyframes hop { 0% { transform: translate(var(--dx), var(--dy)) scale(1); } 50% { transform: translate(calc(var(--dx) / 2), calc(var(--dy) / 2)) scale(1.35); } 100% { transform: none; } }
@keyframes bob { from { transform: translateY(0) scale(1.06); } to { transform: translateY(-4px) scale(1.14); } }
@keyframes spark { to { transform: translate(var(--sx), var(--sy)) scale(.1); opacity: 0; } }
@keyframes shake { 20% { transform: translate(-5px, 2px) rotate(-.4deg); } 40% { transform: translate(5px, -2px) rotate(.4deg); } 60% { transform: translate(-3px, 1px); } 80% { transform: translate(3px, -1px); } }
@keyframes swap { from { transform: scale(.5) translateY(-10px); opacity: 0; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes throb { 50% { transform: scale(1.05); box-shadow: 0 4px 0 rgba(0,0,0,.35), 0 0 30px rgba(46,229,157,.7); } }

/* phones: big touch targets, window becomes a bottom sheet */
@media (max-width: 700px) {
  .game { gap: 8px; }
  .board-wrap { width: min(100%, calc(100dvh - 300px)); min-width: 260px; border-radius: 22px; padding: 6px; }
  .window-slot { min-height: 0; }
  .window { position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); width: auto; z-index: 20; background: rgba(28,24,12,.96); backdrop-filter: blur(8px); box-shadow: 0 10px 40px rgba(0,0,0,.6); animation: sheet .28s cubic-bezier(.2,1.2,.4,1); }
  .window-actions .btn { padding: 15px 10px; font-size: 18px; }
  .btn { min-height: 46px; }
  .menu-card h1 { font-size: 36px; }
}
@keyframes sheet { from { transform: translateY(120%); } }
/* phone held sideways: board left, controls right */
@media (orientation: landscape) and (max-height: 560px) {
  .game { gap: 6px; padding-top: 6px; }
  .hud, .stage { width: min(960px, 100%); }
  .stage { display: grid; grid-template-columns: auto minmax(190px, 1fr); grid-auto-rows: min-content; align-content: center; column-gap: 18px; row-gap: 8px; }
  .stage > * { grid-column: 2; }
  .stage > .board-wrap { grid-column: 1; grid-row: 1 / 6; width: calc(100dvh - 100px); min-width: 0; }
  .window { position: static; width: 100%; animation: rise .25s ease-out; }
  .window-slot { min-height: 0; }
  .dock { position: fixed; right: 10px; bottom: 6px; z-index: 5; }
  .clock { width: 54px; height: 54px; } .clock span { font-size: 20px; }
}
/* big screens: bigger board, roomier HUD */
@media (min-width: 1000px) and (min-height: 760px) {
  .hud, .stage { width: min(820px, 100%); }
  .board-wrap { width: min(100%, calc(100dvh - 300px), 720px); }
}

/* ===== Round 3: callout under the player cards, crush animation, series, emotes ===== */
.callout { width: min(680px, 100%); min-height: 56px; display: grid; place-content: center; text-align: center; padding: 6px 14px; border-radius: 18px; opacity: 0; pointer-events: none; }
.callout b { font-size: clamp(20px, 5.4vw, 30px); font-weight: 400; letter-spacing: .05em; line-height: 1.1; }
.callout span { font-size: 13px; color: rgba(255,255,255,.75); letter-spacing: .04em; }
.callout span:empty { display: none; }
.callout.show { opacity: 1; animation: callin .5s cubic-bezier(.2,1.5,.4,1); background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.2); }
.callout.hit { background: rgba(255,93,93,.16); border-color: #ff5d5d; }
.callout.combo { background: linear-gradient(90deg, rgba(255,122,224,.25), rgba(255,157,60,.3)); border-color: #ff9d3c; box-shadow: 0 0 30px rgba(255,157,60,.5); }
.callout.hot { background: linear-gradient(90deg, rgba(255,93,93,.3), rgba(255,210,94,.3)); border-color: var(--gold); box-shadow: 0 0 34px rgba(255,210,94,.55); animation: callin .5s cubic-bezier(.2,1.5,.4,1), throb 1s .5s ease-in-out infinite; }
.callout.watch { background: rgba(124,92,255,.2); border-color: #a58bff; }
.callout.miss { background: rgba(192,107,255,.22); border-color: #c06bff; box-shadow: 0 0 34px rgba(192,107,255,.6); }
.callout.miss b { color: #ffe38a; }
.board-wrap { width: min(100%, calc(100dvh - 390px), 700px); }
.wins { display: block; font-style: normal; font-size: 12px; color: var(--gold); letter-spacing: .04em; margin-top: 1px; }
.gem { position: relative; }
.pcard.leader .gem::after { content: "👑"; position: absolute; top: -17px; left: 50%; font-size: 17px; transform: translateX(-50%) rotate(-12deg); animation: float 1.8s ease-in-out infinite; }

.crush { pointer-events: none; transform-box: fill-box; transform-origin: center; animation: crush .65s ease-in forwards; }
.slash { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; filter: drop-shadow(0 0 6px #ffd25e); pointer-events: none; animation: slash .35s .05s ease-out forwards; }
.sword { font-size: 46px; pointer-events: none; opacity: 0; transform-box: fill-box; transform-origin: center; animation: swing .7s ease-out forwards; }
.sword.big { font-size: 64px; }
.emotes { display: flex; gap: 4px; }
.emotes button { border: 0; border-radius: 12px; padding: 6px 7px; font-size: 20px; background: rgba(255,255,255,.1); box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.emotes button:active { transform: translateY(2px) scale(.9); }
.dock { flex-wrap: wrap; justify-content: center; }
.emote-float { position: fixed; z-index: 35; font-size: 44px; pointer-events: none; transform: translateX(-50%); animation: emote 1.8s ease-out forwards; }

@keyframes callin { from { transform: translateY(-14px) scale(.7); opacity: 0; } }
@keyframes crush { 0% { transform: scale(1); opacity: 1; } 25% { transform: scale(1.25) rotate(-8deg); filter: brightness(2); } 100% { transform: scale(0) rotate(220deg); opacity: 0; } }
@keyframes slash { to { stroke-dashoffset: 0; } }
@keyframes swing { 0% { opacity: 0; transform: translate(-30px, -50px) rotate(-80deg) scale(.4); } 30% { opacity: 1; transform: translate(0, 0) rotate(25deg) scale(1.35); } 70% { opacity: 1; transform: rotate(10deg) scale(1.1); } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes emote { 0% { opacity: 0; transform: translate(-50%, 0) scale(.3); } 15% { opacity: 1; transform: translate(-50%, -20px) scale(1.3); } 100% { opacity: 0; transform: translate(-50%, -150px) scale(1); } }
@media (max-width: 700px) { .board-wrap { width: min(100%, calc(100dvh - 350px)); } .callout { min-height: 50px; } .emotes button { padding: 5px 6px; font-size: 18px; } }
@media (orientation: landscape) and (max-height: 560px) { .callout { min-height: 38px; } .callout b { font-size: 18px; } .callout span { display: none; } .stage > .board-wrap { width: calc(100dvh - 150px); } }
@media (min-width: 1000px) and (min-height: 760px) { .board-wrap { width: min(100%, calc(100dvh - 360px), 720px); } }

/* ===== Round 4: HUD takeover message (no layout shift), aligned guides, unique pieces ===== */
.hud { position: relative; }
.pcard { position: relative; }
.callout { position: absolute; inset: -3px; z-index: 6; width: auto; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 14px; border-radius: 20px; overflow: hidden; white-space: nowrap; opacity: 0; pointer-events: none; background: none; border: 2px solid transparent; }
.callout b { font-size: clamp(18px, 4.8vw, 30px); font-weight: 400; letter-spacing: .06em; text-shadow: 0 0 14px rgba(255,255,255,.5); }
.callout span { font-size: 13px; color: rgba(255,255,255,.8); }
.callout::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.4) 50%, transparent 70%); transform: translateX(-100%); animation: sweep 1s .15s ease-out; }
.callout.show { opacity: 0; animation: callflash var(--d, 1.6s) ease forwards; background: linear-gradient(100deg, #4a0f1f, #8a1f35 50%, #4a0f1f); border-color: #ff5d5d; box-shadow: 0 0 30px rgba(255,93,93,.6); }
.callout.hit { --d: 1.5s; }
.callout.combo { --d: 1.9s; background: linear-gradient(100deg, #4a1a5a, #a2400f 50%, #4a1a5a); border-color: #ffb347; box-shadow: 0 0 36px rgba(255,157,60,.8); }
.callout.miss { --d: 3.2s; background: linear-gradient(100deg, #24104a, #5a1f9a 50%, #24104a); border-color: #c06bff; box-shadow: 0 0 36px rgba(192,107,255,.8); }
.badge { position: absolute; z-index: 5; top: calc(100% - 5px); left: 50%; transform: translateX(-50%); padding: 3px 12px; border-radius: 999px; white-space: nowrap; font-size: 13px; letter-spacing: .05em; color: #3a1500; background: linear-gradient(90deg, #ff8a5d, #ffd25e); box-shadow: 0 0 18px rgba(255,210,94,.7); animation: badge 1s ease-in-out infinite alternate; }
.board-wrap { width: min(100%, calc(100dvh - 300px), 700px); }
@media (max-width: 700px) { .board-wrap { width: min(100%, calc(100dvh - 260px)); } .callout span { display: none; } }
@media (orientation: landscape) and (max-height: 560px) { .stage > .board-wrap { width: calc(100dvh - 110px); } }
@media (min-width: 1000px) and (min-height: 760px) { .board-wrap { width: min(100%, calc(100dvh - 280px), 740px); } }

/* every SVG animation scales about its own centre (this was the cause of the drifting markers) */
.mark { transform-box: fill-box; transform-origin: center; }
.guide, .arrow, .victim-ring, .crush, .slash { pointer-events: none; }
.guide { fill: none; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 10 8; animation: march .5s linear infinite; }
.guide.move { stroke: var(--gold); filter: drop-shadow(0 0 4px var(--gold)); }
.guide.cap { stroke: #ff5d5d; stroke-width: 5; filter: drop-shadow(0 0 6px #ff5d5d); }
.arrow.move { fill: var(--gold); } .arrow.cap { fill: #ff5d5d; filter: drop-shadow(0 0 6px #ff5d5d); }
.victim-ring { fill: rgba(255,93,93,.12); stroke: #ff5d5d; stroke-width: 3; stroke-dasharray: 6 5; transform-box: fill-box; transform-origin: center; animation: spin 3s linear infinite; }

/* unique pieces: emerald hexagon vs sapphire orb */
.piece { stroke-linejoin: round; }
.facet { fill: none; stroke: rgba(255,255,255,.5); stroke-width: 1.6; pointer-events: none; }
.rune { fill: rgba(255,255,255,.9); pointer-events: none; filter: drop-shadow(0 0 3px #fff); }
.halo { pointer-events: none; transform-box: fill-box; transform-origin: center; }
.halo.green { fill: rgba(46,229,157,.16); } .halo.blue { fill: rgba(74,168,255,.16); }
.pc.live .halo { animation: halo 1.3s ease-in-out infinite alternate; }

/* richer board */
.board-line { stroke: #6a74c4; filter: drop-shadow(0 0 4px rgba(106,116,196,.9)); }
.point-core { fill: #2f3770; stroke: #6a74c4; filter: drop-shadow(0 0 5px rgba(106,116,196,.9)); }
.point-core.center { fill: #5a4a1a; stroke: var(--gold); filter: drop-shadow(0 0 8px var(--gold)); }
.arena-ring { fill: none; stroke: rgba(255,210,94,.25); stroke-width: 2; stroke-dasharray: 3 9; stroke-linecap: round; transform-box: fill-box; transform-origin: center; animation: spin 40s linear infinite; pointer-events: none; }

@keyframes callflash { 0% { opacity: 0; transform: translateX(-35%) scale(.9); } 10% { opacity: 1; transform: translateX(0) scale(1.03); } 16% { transform: scale(1); } 84% { opacity: 1; } 100% { opacity: 0; transform: translateY(-8px); } }
@keyframes sweep { to { transform: translateX(100%); } }
@keyframes badge { to { transform: translateX(-50%) scale(1.08); } }
@keyframes march { to { stroke-dashoffset: -18; } }
@keyframes halo { from { opacity: .4; transform: scale(.95); } to { opacity: 1; transform: scale(1.12); } }

/* ===== Round 5: profile, levels, matchmaking ===== */
.profile { width: 100%; display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 18px; background: rgba(255,255,255,.07); border: 2px solid rgba(255,210,94,.35); text-align: left; }
.avatar { flex: 0 0 52px; height: 52px; display: grid; place-items: center; font-size: 30px; border-radius: 16px; background: linear-gradient(160deg, #3a4090, #1c2050); box-shadow: inset 0 0 0 2px rgba(255,255,255,.18), 0 0 18px rgba(124,92,255,.5); }
.avatar.big { flex-basis: 96px; width: 96px; height: 96px; font-size: 56px; border-radius: 28px; animation: float 2s ease-in-out infinite; }
.pmeta { flex: 1; min-width: 0; }
.pmeta input { width: 100%; border: 0; border-bottom: 2px dashed rgba(255,255,255,.25); background: transparent; color: var(--ink); font: inherit; font-size: 20px; letter-spacing: .04em; padding: 0 0 2px; -webkit-user-select: text; user-select: text; }
.pmeta input:focus { outline: none; border-bottom-color: var(--gold); }
.rank { display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; font-size: 13px; color: var(--gold); letter-spacing: .04em; }
.rank span:last-child { color: var(--muted); }
.xp-bar { height: 9px; margin-top: 5px; border-radius: 9px; background: rgba(255,255,255,.12); overflow: hidden; }
.xp-bar span { display: block; height: 100%; width: 0; border-radius: 9px; background: linear-gradient(90deg, #ffb347, #ffe07c); box-shadow: 0 0 10px rgba(255,210,94,.8); transition: width .6s; }
.how.friend { text-align: center; } .how.friend summary { padding: 8px 0; }
.how.friend .btn, .how.friend .join { margin-top: 8px; }
.menu-card h2.small { font-size: 26px; letter-spacing: .12em; }
.radar { position: relative; width: 150px; height: 150px; display: grid; place-items: center; font-size: 44px; }
.radar i { position: absolute; inset: 0; border-radius: 50%; border: 3px solid rgba(46,229,157,.7); animation: radar 2.4s ease-out infinite; }
.radar i:nth-child(2) { animation-delay: .8s; } .radar i:nth-child(3) { animation-delay: 1.6s; }
.radar span { position: relative; width: 70px; height: 70px; display: grid; place-items: center; border-radius: 50%; background: #1c2050; box-shadow: 0 0 24px rgba(46,229,157,.6); }
.vs { display: flex; flex-direction: column; justify-content: center; gap: 24px; z-index: 50; background: radial-gradient(circle, rgba(60,30,120,.95), rgba(6,7,20,.98)); }
.vs-row { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 4vw, 40px); }
.vs-side { display: grid; justify-items: center; gap: 6px; max-width: 34vw; text-align: center; }
.vs-side b { font-size: clamp(16px, 4.4vw, 26px); font-weight: 400; letter-spacing: .05em; word-break: break-word; }
.vs-side span { font-size: 13px; color: var(--gold); }
.vs-side.left { animation: vsl .7s cubic-bezier(.2,1.2,.4,1); } .vs-side.right { animation: vsr .7s cubic-bezier(.2,1.2,.4,1); }
.vs-badge { font-size: clamp(40px, 12vw, 80px); background: linear-gradient(#ffe07c, #ff7a3c); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 16px rgba(255,160,60,.8)); animation: vsb .9s .3s cubic-bezier(.2,1.8,.4,1) both; }
.xpbox { width: 100%; padding: 10px 12px; border-radius: 16px; background: rgba(255,210,94,.1); border: 2px solid rgba(255,210,94,.4); }
.xp-row { display: flex; justify-content: space-between; font-size: 15px; } .xp-row b { font-weight: 400; color: var(--gold); }
.xpbox p { margin: 8px 0 0; font-size: 14px; color: var(--ink); }
.pinfo b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gem { display: grid; place-items: center; font-size: 15px; }
@keyframes radar { from { transform: scale(.35); opacity: 1; } to { transform: scale(1.15); opacity: 0; } }
@keyframes vsl { from { transform: translateX(-120%); opacity: 0; } }
@keyframes vsr { from { transform: translateX(120%); opacity: 0; } }
@keyframes vsb { from { transform: scale(0) rotate(-30deg); opacity: 0; } }

/* ===== Round 6: compact badge messages, quick undo, quests, unlocks, trail ===== */
.callout { display: none !important; }
.badge { max-width: 94vw; font-size: 13px; padding: 3px 13px; animation: badgepop .45s cubic-bezier(.2,1.8,.4,1); }
.badge.prompt { animation: badgepop .45s cubic-bezier(.2,1.8,.4,1), badge 1s .45s ease-in-out infinite alternate; }
.badge.hit { background: linear-gradient(90deg, #ff5d5d, #ffb347); color: #3a0a00; box-shadow: 0 0 16px rgba(255,93,93,.7); }
.badge.combo { background: linear-gradient(90deg, #ff7ae0, #ffb347); color: #2b0a2b; font-size: 15px; padding: 4px 15px; box-shadow: 0 0 22px rgba(255,157,60,.9); }
.badge.miss { background: linear-gradient(90deg, #7c3aff, #c06bff); color: #fff; font-size: 12px; box-shadow: 0 0 20px rgba(192,107,255,.8); }
@keyframes badgepop { from { transform: translateX(-50%) scale(.3); opacity: 0; } 60% { transform: translateX(-50%) scale(1.18); } to { transform: translateX(-50%) scale(1); opacity: 1; } }

.window.quick { padding: 6px 10px 8px; border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.07); }
.window.quick #lock-in, .window.quick #combo { display: none; }
.window.quick .window-top { font-size: 12px; color: var(--muted); }
.window.quick .window-track { margin: 5px 0; height: 6px; }
.window.quick .btn { padding: 8px; }
@media (max-width: 700px) { .window.quick { background: rgba(20,22,50,.95); } .window.quick .window-actions .btn { padding: 10px; font-size: 16px; } }

.trail-from { fill: none; stroke: rgba(255,255,255,.35); stroke-width: 2; stroke-dasharray: 3 5; pointer-events: none; }
.trail-to { fill: none; stroke: rgb(var(--glow)); stroke-width: 3; opacity: .55; filter: drop-shadow(0 0 6px rgb(var(--glow))); pointer-events: none; }

.daily { margin: 0; font-size: 13px; color: var(--gold); letter-spacing: .04em; }
.quests { width: 100%; display: grid; gap: 6px; }
.quest { position: relative; display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 12px; overflow: hidden; font-size: 13px; text-align: left; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); }
.quest i { position: absolute; left: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, #ffb347, #ffe07c); transition: width .5s; }
.quest b { font-weight: 400; color: var(--gold); white-space: nowrap; }
.quest.done { opacity: .65; border-color: rgba(46,229,157,.5); } .quest.done b { color: var(--g); }
.swatches, .shapes { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.shape { width: 42px; height: 38px; border-radius: 12px; border: 2px solid transparent; font-size: 20px; color: var(--ink); background: rgba(255,255,255,.1); }
.swatch.on, .shape.on { border-color: var(--gold); box-shadow: 0 0 14px rgba(255,210,94,.8); }
.swatch.locked, .shape.locked { opacity: .35; filter: grayscale(.8); position: relative; }
.swatch.locked::after, .shape.locked::after { content: "🔒"; font-size: 13px; position: absolute; right: -4px; bottom: -4px; }
.style-box { display: grid; justify-items: center; }
.style-box svg { width: 70px; height: 70px; }
