:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #123d47;
  background: #f4fbfa;
  --ink: #123d47;
  --muted: #668087;
  --surface: rgba(255, 255, 255, .88);
  --line: rgba(18, 61, 71, .11);
  --aqua: #38bdc8;
  --study-wash:
    radial-gradient(ellipse 110% 55% at 48% -3%, rgba(217, 250, 252, .72) 0, rgba(217, 250, 252, .34) 42%, transparent 70%),
    radial-gradient(ellipse 80% 70% at 12% 84%, rgba(122, 218, 226, .54) 0, transparent 68%),
    radial-gradient(ellipse 78% 68% at 93% 70%, rgba(31, 178, 194, .34) 0, transparent 70%),
    linear-gradient(125deg, #8bdde4 0%, #55ced9 42%, #28bdcd 72%, #54cbd3 100%);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: radial-gradient(circle at 50% -10%, #fff 0, #edf9f8 48%, #e3f5f3 100%); }
button, a { font: inherit; }
button { color: inherit; }

.game-app { width: min(100%, 58rem); min-height: 100dvh; margin: 0 auto; }
.game-countdown[hidden] { display: none; }
.game-countdown { position: fixed; z-index: 100; inset: 0; min-height: 100dvh; padding: 1.5rem; display: grid; place-content: center; justify-items: center; background: var(--theme-page, #f7f1fb); color: var(--theme-deep, #725795); text-align: center; }
.game-countdown [data-countdown-subject] { max-width: 28ch; margin: 0 0 .75rem; color: currentColor; font-size: clamp(.78rem, 2.5vw, 1rem); font-weight: 800; letter-spacing: .08em; opacity: .72; text-transform: uppercase; }
.game-countdown [data-countdown-phrase] { max-width: min(30ch, 100%); margin: 0 0 2rem; color: currentColor; font-size: clamp(1rem, 3.5vw, 1.4rem); font-style: italic; font-weight: 500; line-height: 1.5; text-wrap: balance; }
.game-countdown strong { display: block; min-width: 1.1em; color: var(--button-main-ink, #2f2340); font-size: clamp(8rem, 38vw, 18rem); font-weight: 800; line-height: .8; letter-spacing: -.07em; transform-origin: center; }
.game-countdown strong.is-beating { animation: countdown-beat .7s ease-out both; }
@keyframes countdown-beat { 0% { opacity: .35; transform: scale(.9); } 45% { opacity: 1; transform: scale(1.035); } 100% { opacity: 1; transform: scale(1); } }
[data-button-theme="night"] .game-countdown strong { color: var(--ink); }
.game-screen { display: none; min-height: 100dvh; padding: max(1.15rem, env(safe-area-inset-top)) clamp(1rem, 4vw, 2rem) max(1.25rem, env(safe-area-inset-bottom)); }
.game-screen.is-active { display: block; animation: screen-in .38s cubic-bezier(.2,.8,.25,1); }
.game-header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; margin-bottom: 1.2rem; }
.game-header.compact { grid-template-columns: auto 1fr; }
.game-header.packages-header { grid-template-columns: minmax(0,1fr) auto; align-items: start; }
.game-header h1, .score-heading h1, .podium-heading h1 { margin: .15rem 0 0; color: var(--ink); font-size: clamp(1.75rem, 6vw, 2.75rem); line-height: 1.05; }
.eyebrow { color: #2f9097; font-size: .72rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.round-button, .profile-dot { width: 2.85rem; height: 2.85rem; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--ink); text-decoration: none; font-weight: 900; box-shadow: 0 .55rem 1.4rem rgba(20, 88, 94, .09); }
.round-button { cursor: pointer; font-size: 1.25rem; }
.profile-dot { padding: 0; background: linear-gradient(145deg, #6bd7dc, #2ca9b5); color: white; cursor: pointer; }
.package-actions { position: relative; z-index: 12; }
.package-action-bubbles { position: absolute; top: 3.45rem; right: 0; display: flex; flex-direction: column; gap: .55rem; visibility: hidden; pointer-events: none; }
.package-action-bubbles a { width: 2.7rem; height: 2.7rem; display: grid; place-items: center; border: 1px solid rgba(21,90,101,.14); border-radius: 50%; background: #eef9fa; color: #155a65; box-shadow: 0 .55rem 1.4rem rgba(16,90,101,.14); text-decoration: none; font-size: 1.35rem; font-weight: 800; opacity: 0; transform: translateY(-.6rem) scale(.88); transition: opacity .18s ease, transform .24s cubic-bezier(.2,.8,.25,1); }
.package-action-bubbles svg { width: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.package-action-bubbles .is-current { background: #d9f3f1; color: #19828c; }
.package-actions.is-open .package-action-bubbles { visibility: visible; pointer-events: auto; }
.package-actions.is-open .package-action-bubbles a { opacity: 1; transform: none; }
.package-actions.is-open .package-action-bubbles a:nth-child(1) { transition-delay: 0s; }
.package-actions.is-open .package-action-bubbles a:nth-child(2) { transition-delay: .04s; }
.package-actions.is-open .package-action-bubbles a:nth-child(3) { transition-delay: .08s; }
.package-screen.is-swiping-back { transform: translateX(min(22vw,6rem)); opacity: .72; transition: transform .18s ease, opacity .18s ease; }
.intro { margin: 0 0 1.4rem; color: var(--muted); font-size: 1rem; }

.package-screen { --package-card-height: clamp(10.75rem, 31dvh, 15.25rem); }
.package-screen .intro { max-width: 52rem; }
.ready-room-exit { width: 3.35rem; height: 3.35rem; padding: 0; display: grid; place-items: center; border: 1px solid var(--button-main-border, rgba(21,90,101,.16)); border-radius: 50%; background: var(--button-main, #eef9fa); color: var(--button-main-ink, #155a65); box-shadow: 0 .48rem 1rem var(--button-main-shadow, rgba(16,90,101,.13)); cursor: pointer; font-size: .68rem; font-weight: 850; line-height: 1; -webkit-tap-highlight-color: transparent; transition: transform .18s ease, background .18s ease, box-shadow .18s ease; }
.ready-room-exit[hidden] { display: none; }
.ready-room-exit:hover:not(:disabled) { background: var(--button-main-hover, #dff1f5); transform: translateY(-1px); }
.ready-room-exit:active:not(:disabled) { transform: scale(.96); }
.ready-room-exit:focus-visible { outline: .22rem solid var(--theme-glow, rgba(54,189,202,.32)); outline-offset: .16rem; }
.ready-room-exit:disabled { opacity: .62; cursor: wait; transform: none; }
.package-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(.85rem, 2.7vw, 1.25rem); padding: .25rem .2rem 1.25rem; }
.package-screen { touch-action: pan-y; }
.package { --pack-a: #bdebd7; --pack-b: #6fc7a5; position: relative; min-height: var(--package-card-height); border: 0; background: transparent; cursor: pointer; perspective: 700px; }
.package-stack { position: absolute; inset: 0; }
.package-sheet, .package-cover { position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.56); border-radius: 1.6rem; background: linear-gradient(145deg, var(--pack-a), var(--pack-b)); box-shadow: 0 1rem 2rem rgba(36, 94, 89, .13); }
.package-sheet:nth-child(1) { transform: translate(.65rem, -.65rem) rotate(3deg); opacity: .48; }
.package-sheet:nth-child(2) { transform: translate(.35rem, -.35rem) rotate(1.6deg); opacity: .7; }
.package-sheet:nth-child(3) { transform: translate(.12rem, -.12rem) rotate(.6deg); opacity: .84; }
.package-cover { padding: clamp(1rem, 2.5vw, 1.25rem); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; text-align: left; transition: transform .25s ease; }
.package:hover .package-cover, .package:focus-visible .package-cover { transform: translateY(-.3rem) rotate(-1deg); }
.package:focus-visible { outline: none; }
.package-cover::after { content: ""; position: absolute; width: 10rem; height: 10rem; right: -4rem; bottom: -4rem; border-radius: 50%; background: rgba(255,255,255,.32); filter: blur(8px); }
.package-icon { width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border-radius: .8rem; background: rgba(255,255,255,.55); font-size: 1.25rem; }
.package h2 { position: relative; z-index: 1; max-width: 11ch; margin: 0; font-size: clamp(1.32rem, 4.6vw, 2rem); line-height: 1.02; text-wrap: balance; }
.package-meta { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; font-size: .78rem; font-weight: 800; }
.package[data-color="blue"] { --pack-a: #c6e9f5; --pack-b: #79c7df; }
.package[data-color="lilac"] { --pack-a: #e1d5f5; --pack-b: #ae91da; }
.package[data-color="gold"] { --pack-a: #f6e8bb; --pack-b: #ddb968; }

.package-screen .package-grid {
  gap: clamp(1.15rem, 3vw, 1.5rem);
  padding: .75rem .85rem 1.25rem 0;
}
.package-screen .package-sheet:nth-child(1) { transform: translate(.65rem, -.65rem) rotate(1.5deg); }
.package-screen .package-sheet:nth-child(2) { transform: translate(.35rem, -.35rem) rotate(.8deg); }
.package-screen .package:focus-visible { outline: .18rem solid #725795; outline-offset: .22rem; border-radius: 1.6rem; }
.package-screen .package-title {
  position: relative;
  z-index: 1;
  max-width: 18ch;
  font-size: clamp(1.45rem, 4.6vw, 2rem);
  line-height: 1.06;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.squad-topics {
  width: min(calc(100% - 2rem), 34rem);
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid #ffffff90;
  border-radius: 1.6rem;
  background: var(--theme-surface, #fbf7fd);
  color: var(--ink);
  box-shadow: 0 1rem 2rem rgba(36, 94, 89, .13);
}
.squad-topics::backdrop { background: rgba(27, 24, 48, .34); backdrop-filter: blur(5px); }
.squad-topics form { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100dvh - 2rem - 2px); }
.squad-topics-header, .squad-topics-list, .squad-topics-footer { padding-inline: clamp(1rem, 4vw, 1.6rem); }
.squad-topics-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding-block: 1rem .75rem; }
.squad-topics-header h2 { margin: 0; font-size: clamp(1.45rem, 6vw, 2rem); letter-spacing: -.035em; }
.squad-topics-close {
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--button-main-border, #c9b6e0);
  border-radius: 50%;
  background: var(--secondary-soft, #eee4fa);
  color: var(--button-main-ink, #2f2340);
  font-size: 1.35rem;
  cursor: pointer;
}
.squad-topics-close:focus-visible { outline: .15rem solid #725795; outline-offset: .12rem; }
.squad-topics-list { overflow: auto; overscroll-behavior: contain; padding-block: .35rem .8rem; }
.squad-topic-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.squad-topic-group + .squad-topic-group { margin-top: 1rem; }
.squad-topic-group legend { margin-bottom: .45rem; padding: 0; font-size: .9rem; font-weight: 850; }
.squad-topic {
  --topic-accent: #6fc7a5;
  display: flex;
  gap: .7rem;
  align-items: center;
  min-height: 3.35rem;
  padding: .55rem .75rem;
  border: 1px solid color-mix(in srgb, var(--topic-accent) 68%, transparent);
  border-radius: .85rem;
  background: color-mix(in srgb, var(--topic-accent) 13%, var(--theme-surface, #fff));
  cursor: pointer;
}
.squad-topic[data-color="lilac"] { --topic-accent: #ae91da; }
.squad-topic[data-color="blue"] { --topic-accent: #79c7df; }
.squad-topic[data-color="yellow"] { --topic-accent: #ddb968; }
.squad-topic + .squad-topic { margin-top: .4rem; }
.squad-topic:hover, .squad-topic:has(input:checked) {
  border-color: var(--topic-accent);
  background: color-mix(in srgb, var(--topic-accent) 26%, var(--theme-surface, #fff));
}
.squad-topic input { flex: 0 0 auto; width: 1.15rem; height: 1.15rem; margin: 0; accent-color: #725795; }
.squad-topic-details { display: grid; gap: .2rem; overflow-wrap: anywhere; }
.squad-topic-details strong { font-size: .91rem; }
.squad-topic-details small { font-size: .75rem; }
.squad-topics-footer { padding-block: .7rem 1rem; border-top: 1px solid var(--line); }
.squad-topics-footer .primary-action { margin: 0; }
.squad-topics-footer .primary-action:disabled { cursor: default; }
.squad-topics-error { margin: 0 0 .65rem; color: var(--ink); font-size: .85rem; }

.lobby-screen { background: linear-gradient(180deg, #f8fdfc, #e8f7f5); }
.selected-package { margin: 1rem 0 1.3rem; padding: 1rem 1.2rem; display: flex; align-items: center; gap: .9rem; border-radius: 1.2rem; background: white; border: 1px solid var(--line); font-weight: 900; }
.selected-package i { width: 2.7rem; height: 2.7rem; display: grid; place-items: center; border-radius: .8rem; background: #c8eee4; font-style: normal; }
.friends-card { padding: clamp(1rem, 4vw, 1.5rem); border: 1px solid var(--line); border-radius: 1.6rem; background: var(--surface); box-shadow: 0 1rem 3rem rgba(26, 97, 101, .08); }
.friends-heading { display: flex; justify-content: space-between; align-items: center; }
.friends-heading h2 { margin: .2rem 0 0; }
.player-count { padding: .45rem .65rem; border-radius: 999px; background: #e0f4f1; font-weight: 900; font-size: .8rem; }
.friend-list { margin-top: 1rem; display: grid; gap: .65rem; }
.friend { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .8rem; padding: .7rem; border-radius: 1rem; background: #f4faf9; }
.avatar { width: 2.7rem; height: 2.7rem; display: grid; place-items: center; border-radius: 50%; background: var(--avatar, #6bc9cf); color: white; font-weight: 900; }
.dice-avatar { display:block; padding:.1rem; object-fit:contain; background:#edf7f7; }
dotlottie-player.dice-avatar{transform:scale(1.45);filter:saturate(1.18) contrast(1.06)}
.friend strong { display: block; }
.friend small { color: var(--muted); }
.invite-status { color: #a07921; font-size: .75rem; font-weight: 850; }
.friend.is-accepted .invite-status { color: #27805f; }
.voice-card { margin-top: 1rem; padding: clamp(1rem,4vw,1.35rem); border: 1px solid var(--line); border-radius: 1.6rem; background: rgba(255,255,255,.92); box-shadow: 0 1rem 3rem rgba(26,97,101,.07); }
.voice-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.voice-heading h2 { margin: .2rem 0 0; font-size: 1.25rem; }
.voice-status { padding: .42rem .65rem; border-radius: 999px; background: #edf4f4; color: #698186; font-size: .7rem; font-weight: 900; white-space: nowrap; }
.voice-card.is-ready .voice-status { background: #ddf5ee; color: #21785a; }
.voice-card.is-speaking .voice-status { background: #d8f4f3; color: #147984; }
.voice-player { margin: 1rem 0; padding: .8rem; display: flex; align-items: center; gap: .85rem; border-radius: 1.2rem; background: #f4faf9; }
.voice-avatar { position: relative; flex: 0 0 auto; width: 3.5rem; height: 3.5rem; border: 3px solid white; border-radius: 50%; background: #e2f4f2; box-shadow: 0 .3rem .85rem rgba(22,94,100,.1); }
.voice-avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: contain; }
.voice-avatar::before, .voice-avatar::after { content: ""; position: absolute; inset: -.3rem; border: 2px solid rgba(42,170,178,.28); border-radius: 50%; opacity: 0; }
.voice-card.is-speaking .voice-avatar::before { animation: voice-wave 1s ease-out infinite; }
.voice-card.is-speaking .voice-avatar::after { animation: voice-wave 1s .35s ease-out infinite; }
.voice-copy { min-width: 0; flex: 1; }
.voice-copy strong, .voice-copy span { display: block; }
.voice-copy > span { margin-top: .12rem; overflow: hidden; color: var(--muted); font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.voice-meter { height: .3rem; margin-top: .55rem; overflow: hidden; border-radius: 999px; background: #dceceb; }
.voice-meter span { width: 3%; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#4fc4b0,#188c98); transition: width .08s linear; }
.voice-error { margin: -.35rem 0 .8rem; color: #a64742; font-size: .76rem; font-weight: 750; }
.voice-controls { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .75rem 1rem; }
.voice-toggle { width: 4rem; height: 4rem; display: grid; place-items: center; border: 1px solid rgba(21,90,101,.12); border-radius: 50%; background: #f1f8f7; cursor: pointer; }
.voice-toggle > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.voice-toggle [data-voice-toggle-icon]::after { content: ""; position: absolute; top: -.25rem; left: 50%; width: .14rem; height: 2rem; border-radius: 99px; background: #b54e49; transform: translateX(-50%) rotate(-42deg); box-shadow: 0 0 0 2px #f1f8f7; }
.voice-card.is-ready .voice-toggle [data-voice-toggle-icon]::after { display: none; }
.push-to-talk { position: relative; min-height: 5rem; padding: .7rem 1rem .7rem 4.7rem; overflow: hidden; border: 0; border-radius: 1.25rem; background: linear-gradient(135deg,#176c75,#21919a); color: white; text-align: left; cursor: pointer; touch-action: none; user-select: none; box-shadow: 0 .8rem 1.8rem rgba(24,117,126,.2); }
.push-to-talk:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.push-to-talk .mic-icon { position: absolute; left: 1.7rem; top: 50%; transform: translateY(-60%); }
.push-to-talk strong, .push-to-talk small { position: relative; z-index: 2; display: block; }
.push-to-talk small { margin-top: .15rem; opacity: .78; }
.push-rings { position: absolute; left: 2.2rem; top: 50%; width: 4.1rem; height: 4.1rem; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; transform: translate(-50%,-50%) scale(.7); opacity: 0; }
.voice-card.is-speaking .push-to-talk { background: linear-gradient(135deg,#1d929b,#39b9b4); transform: scale(.99); }
.voice-card.is-speaking .push-rings { animation: push-ring 1s ease-out infinite; }
.voice-mode { grid-column: 2; color: var(--muted); font-size: .7rem; font-weight: 700; text-align: center; }
.primary-action { width: 100%; margin-top: 1.2rem; padding: 1rem 1.25rem; display: block; border: 0; border-radius: 1rem; background: linear-gradient(135deg, #155a65, #237d86); color: white; text-align: center; text-decoration: none; font-weight: 900; cursor: pointer; box-shadow: 0 .85rem 1.8rem rgba(21,90,101,.2); }
.primary-action:disabled { opacity: .7; cursor: wait; }
.lobby-note { min-height: 1.3rem; color: var(--muted); text-align: center; font-size: .82rem; }

.question-screen { background: #fff; overflow: hidden; }
.play-header { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; column-gap: clamp(1.25rem, 5vw, 3rem); margin-bottom: .45rem; }
.timer { min-width: 6.25rem; padding: .55rem .75rem; display: flex; align-items: center; gap: .45rem; border: 1px solid rgba(21,90,101,.1); border-radius: 999px; background: #f0f9f9; box-shadow: none; }
.timer span { color: #dd9d2f; font-size: 1.05rem; }
.timer strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.timer.is-urgent { background: #fff1e8; color: #bd492f; animation: timer-pulse .8s infinite alternate; }
.round-progress { justify-self: end; color: var(--ink); text-align: right; }
.round-progress strong { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.play-status { justify-self: end; display: flex; align-items: center; gap: .65rem; }
.streak-badge { height: 2.55rem; padding: .18rem .65rem .18rem .25rem; display: flex; align-items: center; gap: .15rem; border: 1px solid rgba(225,139,37,.22); border-radius: 999px; background: rgba(255,249,236,.88); color: #bd681c; box-shadow: 0 .25rem .8rem rgba(153,91,27,.08); }
.streak-badge[hidden] { display: none; }
.streak-animation { position: relative; width: 2.1rem; height: 2.1rem; display: grid; place-items: center; }
.streak-lottie { position: absolute; inset: 0; width: 100%; height: 100%; display:none; }
.streak-lottie.is-lilac,[data-button-theme="lilac"] .streak-lottie.is-lilac,[data-button-theme="green"] .streak-lottie.is-green,[data-button-theme="yellow"] .streak-lottie.is-yellow,[data-button-theme="night"] .streak-lottie.is-night { display:block; }
[data-button-theme="green"] .streak-lottie.is-lilac,[data-button-theme="yellow"] .streak-lottie.is-lilac,[data-button-theme="night"] .streak-lottie.is-lilac { display:none; }
.streak-fallback { font-size: 1.45rem; line-height: 1; }
.streak-lottie:defined + .streak-fallback { display: none; }
.streak-badge > strong { min-width: 1.6rem; font-size: 1rem; font-variant-numeric: tabular-nums; }
.mini-players { min-height: 3.65rem; display: flex; align-items: flex-start; justify-content: center; gap:.42rem; }
.mini-player { min-width: 2.8rem; display: grid; justify-items: center; gap: .08rem; }
.mini-player small { max-width: 4.5rem; overflow: hidden; color: #416b74; font-size: .56rem; font-weight: 800; line-height: 1.05; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.mini-avatar { --base-scale:1; width: 2.55rem; height: 2.55rem; margin-left:0; display:block; object-fit:contain; padding:.12rem; border:3px solid #fff; border-radius:50%; background:#eef8f8; box-shadow:0 .2rem .65rem rgba(18,61,71,.08); transform:scale(var(--base-scale)); transition:transform .2s,border-color .22s ease,box-shadow .22s ease; }
dotlottie-player.mini-avatar{--base-scale:1.42;filter:saturate(1.18) contrast(1.06)}
.mini-avatar:first-child { margin-left:0; }
.mini-avatar.is-correct { border-color: #27966b; box-shadow: 0 .2rem .65rem rgba(18,61,71,.08); }
.mini-avatar.is-wrong { border-color: #c95852; box-shadow: 0 .2rem .65rem rgba(18,61,71,.08); }
.mini-avatar.is-thinking { animation: mini-breathe var(--breath-cycle,2.8s) ease-in-out var(--breath-delay,0s) infinite; }
.mini-avatar.is-responding { animation: mini-answer .62s cubic-bezier(.2,.72,.25,1); }
.mini-avatar.is-synced { animation: mini-shared .12s ease-out 2 alternate; }
.game-card-stage { position: relative; min-height: calc(100dvh - 8.4rem); border-radius: clamp(1.75rem, 6vw, 2.5rem); perspective: 1400px; touch-action: none; }
.game-question-card { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; border-radius: inherit; transition: transform .18s ease-out, opacity .18s ease-out; transform-style: preserve-3d; touch-action: none; }
.game-question-preview { z-index: 1; opacity: 0; transform: translate3d(0, calc(100% + .75rem), 0) scale(.985); pointer-events: none; will-change: transform, opacity; }
.game-question-preview .game-card-inner { transition: none; }
.game-question-card.is-leaving { transform: translateY(-110%) rotate(-2deg); opacity: 0; }
.game-question-card.is-entering { animation: question-enter .34s cubic-bezier(.2,.8,.25,1); }
.game-card-inner { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; transform-style: preserve-3d; -webkit-transform-style: preserve-3d; transition: transform .28s cubic-bezier(.2,.75,.25,1); }
.game-question-card.is-flipped .game-card-inner { transform: rotateY(180deg); -webkit-transform: rotateY(180deg); }
.game-question-card.is-flipped .game-card-front { pointer-events: none; }
.game-question-card.is-switching .game-card-inner { transition: none; }
.game-question-card.is-switching .game-card-face { transition: none; }
.game-card-face { position: absolute; inset: 0; overflow: hidden; contain: paint; clip-path: inset(0 round clamp(1.75rem, 6vw, 2.5rem)); -webkit-clip-path: inset(0 round clamp(1.75rem, 6vw, 2.5rem)); border: 1px solid rgba(20,145,159,.28); border-radius: inherit; background: rgba(255,255,255,.96); box-shadow: none; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: opacity 0s linear .14s, visibility 0s linear .14s; }
.game-card-front { padding: clamp(1.5rem, 6vw, 4rem); display: grid; grid-template-rows: auto 1fr; align-items: center; color: #123d47; background: linear-gradient(145deg, #8cdee4 0%, #55cdd6 48%, #32bdc9 100%); opacity: 1; visibility: visible; transform: rotateY(0deg) translateZ(1px); -webkit-transform: rotateY(0deg) translateZ(1px); }
.game-card-front::before, .game-card-front::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.game-card-front::before, .game-card-front::after { display: none; }
.game-card-back { padding: clamp(1rem, 4vw, 1.6rem); padding-bottom: clamp(5.5rem,11vh,6.25rem); display: grid; grid-template-rows: auto 1fr auto; opacity: 0; visibility: hidden; transform: rotateY(180deg) translateZ(1px); -webkit-transform: rotateY(180deg) translateZ(1px); }
.game-question-card.is-flipped .game-card-front { opacity: 0; visibility: hidden; }
.game-question-card.is-flipped .game-card-back { opacity: 1; visibility: visible; }
.reveal-answer-area { position: absolute; z-index: 4; inset: 0; width: 100%; height: 100%; border: 0; border-radius: inherit; background: transparent; cursor: pointer; }
.reveal-answer-area:focus-visible { outline: .25rem solid rgba(37,139,150,.34); outline-offset: -.5rem; }
.skip-question-button { display: none; position: absolute; z-index: 5; right: 1.4rem; bottom: 1.4rem; padding: .62rem .9rem; border: 1px solid rgba(18,61,71,.18); border-radius: 999px; background: rgba(255,255,255,.72); color: #155a65; cursor: pointer; font-size: .78rem; font-weight: 850; backdrop-filter: blur(10px); }
.skip-question-button:hover { background: rgba(255,255,255,.94); }
.subject-badge { position: relative; z-index: 1; justify-self: start; padding: .55rem .9rem; border: 1px solid rgba(255,255,255,.64); border-radius: 999px; background: rgba(255,255,255,.66); color: #14718a; box-shadow: 0 .35rem 1rem rgba(32,105,88,.1); backdrop-filter: blur(10px); font-size: .72rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.question-kicker { position: relative; z-index: 1; align-self: start; margin: .9rem 0 0; color: rgba(18,61,71,.65); font-size: .75rem; font-weight: 800; }
.game-card-front h1 { position: relative; z-index: 1; align-self: center; max-width: 16ch; margin: 0 auto; text-align: center; font-size: clamp(2.5rem, 8.5vw, 5rem); line-height: 1.04; text-wrap: balance; }
.tap-hint { position: relative; z-index: 1; margin: .8rem 0 0; color: rgba(18,61,71,.66); text-align: center; font-size: .82rem; font-weight: 850; }
.tap-hint span { display: inline-grid; width: 1.9rem; height: 1.9rem; margin-right: .35rem; place-items: center; border-radius: 50%; background: #e0f3f1; color: #2f8990; }
.game-back-question { padding-bottom: .8rem; }
.game-back-question > span { color: #2e8c93; font-size: .7rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.game-back-question p { margin: .35rem 0; color: var(--muted); font-size: .72rem; font-weight: 800; }
.game-back-question h2 { max-width: 30ch; margin: 0; font-size: clamp(1.15rem, 4vw, 1.8rem); line-height: 1.08; }
.game-answers { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
.game-answer { position: relative; min-height: 5.2rem; padding: .8rem .8rem .8rem 2.9rem; border: 1px solid #b8dddd; border-radius: 1rem; background: linear-gradient(145deg, #f0fbfa, #dff3f1); text-align: left; font-weight: 800; cursor: pointer; transition: transform .16s, background .16s; }
.game-answer::before { content: attr(data-letter); position: absolute; left: .65rem; top: 50%; width: 1.75rem; height: 1.75rem; transform: translateY(-50%); display: grid; place-items: center; border-radius: .55rem; background: white; color: #23737a; font-size: .75rem; }
.game-answer:hover { transform: translateY(-2px); }
.game-answer.is-correct { background: #2d9a70; border-color: #2d9a70; color: white; }
.game-answer.is-wrong { background: #cf645b; border-color: #cf645b; color: white; }
.game-answer:disabled { pointer-events: none; cursor: default; }
.game-feedback { min-height: 1.4rem; margin: .7rem 0 0; color: var(--muted); text-align: center; font-size: .8rem; font-weight: 850; }
.game-gesture-help { position: absolute; z-index: 8; right: 0; bottom: 0; left: 0; min-height: clamp(4rem,9vh,5rem); padding: .7rem 1rem max(.7rem,env(safe-area-inset-bottom)); display: flex; justify-content: center; align-items: center; gap: .65rem; color: rgba(255,255,255,.86); text-shadow: 0 1px 8px rgba(16,57,67,.22); font-size: clamp(.88rem,3vw,1.05rem); font-weight: 650; text-align: center; opacity: 0; pointer-events: none; transition: opacity .25s; }
.game-question-card.is-answered .game-gesture-help { opacity: 1; animation: game-gesture-coach 1.15s ease-in-out infinite alternate; }
.game-question-card.is-flipped .game-gesture-help { color: #26747b; text-shadow: none; }
.game-question-card.is-flipped .game-up-arrow { border-color: rgba(38,116,123,.2); background: #dff3f1; }
.game-up-arrow { width: 2.15rem; height: 2.15rem; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.24); border-radius: 50%; background: rgba(255,255,255,.14); backdrop-filter: blur(8px); font-weight: 800; }

.leave-match-button {
  position: fixed;
  z-index: 90;
  left: max(24px, calc(env(safe-area-inset-left) + 14px));
  bottom: max(14px, env(safe-area-inset-bottom));
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--button-main-border);
  border-radius: 50%;
  background: var(--button-main);
  color: var(--button-main-ink);
  box-shadow: 0 .48rem 1rem var(--button-main-shadow);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.leave-match-button[hidden] { display: none; }
.leave-match-button strong { font-size: .68rem; font-weight: 850; line-height: 1; }
.leave-match-button:hover { background: var(--button-main-hover); transform: translateY(-1px); box-shadow: 0 .55rem 1.1rem var(--button-main-shadow); }
.leave-match-button:active { transform: scale(.96); }
.leave-match-button:focus-visible { outline: .22rem solid var(--theme-glow); outline-offset: .16rem; }
.leave-match-button:disabled { opacity: .62; cursor: wait; transform: none; }

.game-page-dock { --dock-surface: #eef9fa; --dock-ink: #155a65; position: fixed; z-index: 60; right: max(24px, calc(env(safe-area-inset-right) + 14px)); bottom: max(14px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; }
.game-page-trigger, .game-page-actions a { display: grid; place-items: center; border: 1px solid rgba(21,90,101,.16); border-radius: 50%; background: var(--dock-surface); color: var(--dock-ink); box-shadow: 0 .65rem 1.8rem rgba(16,90,101,.13); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.game-page-trigger { width: 3.5rem; height: 3.5rem; padding: 0; cursor: pointer; touch-action: manipulation; }
.game-page-trigger svg { width: 1.65rem; }
.game-page-actions { margin-bottom: .7rem; display: flex; flex-direction: column; gap: .6rem; visibility: hidden; pointer-events: none; }
.game-page-actions a { width: 3rem; height: 3rem; opacity: 0; transform: translateY(.75rem) scale(.9); transition: opacity .28s ease, transform .4s cubic-bezier(.2,.72,.25,1); }
.game-page-actions a svg { width: 1.35rem; }
.game-page-trigger svg, .game-page-actions svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.game-page-dock.is-open .game-page-actions { visibility: visible; pointer-events: auto; }
.game-page-dock.is-open .game-page-actions a { opacity: 1; transform: none; }
.game-page-dock.is-open .game-page-actions a:nth-child(4) { transition-delay: 0s; }
.game-page-dock.is-open .game-page-actions a:nth-child(3) { transition-delay: .04s; }
.game-page-dock.is-open .game-page-actions a:nth-child(2) { transition-delay: .08s; }
.game-page-dock.is-open .game-page-actions a:nth-child(1) { transition-delay: .12s; }
.game-page-trigger:focus-visible, .game-page-actions a:focus-visible { outline: .22rem solid rgba(54,189,202,.32); outline-offset: .16rem; }

.scoreboard-screen { background: radial-gradient(circle at 50% 0, #fff, #edf8f7 55%, #dff1ef); }
.score-heading, .podium-heading { padding-top: 1rem; text-align: center; }
.score-heading p, .podium-heading p { color: var(--muted); }
.scoreboard-timer { width: max-content; margin: 1rem auto 0; }
.scoreboard { margin-top: 2rem; display: grid; gap: .8rem; }
.score-row { position: relative; min-height: 4.8rem; padding: .7rem 1rem .7rem .7rem; display: grid; grid-template-columns: 2rem auto 1fr auto; align-items: center; gap: .7rem; border: 1px solid var(--line); border-radius: 1.25rem; background: rgba(255,255,255,.9); box-shadow: 0 .65rem 1.6rem rgba(23,81,86,.07); transition: transform .9s cubic-bezier(.2,.72,.2,1), background .3s, border-color .3s, box-shadow .3s; }
.score-row.is-moving { background: #f8edc9; }
.score-row.is-rising { border-color: rgba(54,172,125,.42); box-shadow: 0 .9rem 2rem rgba(38,137,99,.14); }
.score-row.is-falling { border-color: rgba(224,126,118,.4); box-shadow: 0 .9rem 2rem rgba(177,83,75,.12); }
.rank { color: #779096; font-weight: 950; font-size: 1.1rem; }
.score-row .avatar { width: 3rem; height: 3rem; }
.score-name strong { display: block; }
.score-name span { color: var(--muted); font-size: .75rem; }
.score-points { font-weight: 950; font-variant-numeric: tabular-nums; }
.score-result{display:flex;align-items:center;justify-content:flex-end;gap:.45rem}.score-streak{height:1.7rem;padding:.12rem .38rem .12rem .18rem;display:flex;align-items:center;gap:.12rem;border:1px solid color-mix(in srgb,var(--button-main-border) 35%,transparent);border-radius:999px;background:var(--secondary-soft);color:var(--secondary-ink)}.score-streak b{font-size:.68rem;font-weight:950}.palette-streak-icon{width:1.35rem;height:1.35rem;display:grid;place-items:center}.palette-streak-icon img{width:100%;height:100%;display:none;object-fit:contain}.palette-streak-icon img.is-lilac,[data-button-theme="lilac"] .palette-streak-icon img.is-lilac,[data-button-theme="green"] .palette-streak-icon img.is-green,[data-button-theme="yellow"] .palette-streak-icon img.is-yellow,[data-button-theme="night"] .palette-streak-icon img.is-night{display:block}[data-button-theme="green"] .palette-streak-icon img.is-lilac,[data-button-theme="yellow"] .palette-streak-icon img.is-lilac,[data-button-theme="night"] .palette-streak-icon img.is-lilac{display:none}
.score-delta { position: absolute; right: 1rem; top: -.6rem; padding: .25rem .45rem; border-radius: 999px; background: #d9f2e8; color: #23805c; font-size: .68rem; font-weight: 900; opacity: 0; }
.score-row.is-moving .score-delta { animation: delta-pop .8s; }
.score-timeline { height: .45rem; margin-top: 2rem; overflow: hidden; border-radius: 999px; background: #dcebea; }
.score-timeline span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #54c8d0, #d6ae4b); transition: width 12.5s linear; }
.score-timeline.is-running span { width: 100%; }
.scoreboard.is-settling .score-row.is-leader { box-shadow: 0 1rem 2.5rem rgba(205,157,48,.2); border-color: rgba(205,157,48,.38); }

.podium-screen { position: relative; overflow-x: hidden; overflow-y: auto; background: radial-gradient(circle at 50% 18%, #fff9dc, #eef9f7 52%, #ddecf2); }
.podium-voice{position:relative;z-index:3;width:min(100%,46rem);min-height:7rem;margin:.75rem auto 0;padding:.6rem 1rem;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:start;gap:.75rem 1rem;border:1px solid rgba(21,90,101,.1);border-radius:1.4rem;background:rgba(255,255,255,.88);box-shadow:0 .8rem 2rem rgba(26,97,101,.1);-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}.podium-voice *{-webkit-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important;-webkit-user-drag:none!important}.podium-audio-action{display:grid;justify-items:center;gap:.3rem;color:#416b74;text-align:center}.podium-audio-action>strong{font-size:.68rem}.podium-audio-action>small{margin-top:-.3rem;color:#55777e;font-size:.58rem;font-weight:750}.podium-audio-toggle,.podium-audio-options,.podium-push-talk{display:grid;place-items:center;border:1px solid rgba(21,90,101,.12);border-radius:50%;cursor:pointer}.podium-audio-toggle,.podium-audio-options{width:3.5rem;height:3.5rem;background:#fff;color:#176f7a;box-shadow:0 .45rem 1rem rgba(20,88,94,.09)}.podium-audio-main{position:relative;margin-top:-.75rem}.podium-push-talk{position:relative;width:4.75rem;height:4.75rem;border:.35rem solid rgba(255,255,255,.95);background:linear-gradient(145deg,#eee8f7,#ddd2ed);color:#89799f;box-shadow:0 0 0 .14rem rgba(157,127,202,.14),0 .6rem 1.25rem rgba(112,83,153,.16);touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}.podium-push-talk:disabled{cursor:not-allowed}.podium-voice.is-ready .podium-push-talk{background:linear-gradient(145deg,#d9c8f2,#bca7df);color:#65547f}.podium-voice.is-speaking .podium-push-talk{background:linear-gradient(145deg,#c9afea,#a98bd3);color:#fff}.podium-mic-icon{position:relative;width:.9rem;height:1.25rem;border:.14rem solid currentColor;border-radius:.6rem}.podium-mic-icon:before{content:"";position:absolute;left:50%;bottom:-.42rem;width:1.3rem;height:.65rem;border:.13rem solid currentColor;border-top:0;border-radius:0 0 .8rem .8rem;transform:translateX(-50%)}.podium-mic-icon.is-muted:after{content:"";position:absolute;left:50%;top:-.2rem;width:.12rem;height:1.75rem;border-radius:99px;background:#b4524c;transform:translateX(-50%) rotate(-42deg);box-shadow:0 0 0 2px #fff}.podium-voice.is-ready .podium-mic-icon.is-muted:after{display:none}.podium-audio-options>span{display:grid;gap:.27rem}.podium-audio-options i{width:1.35rem;height:.12rem;border-radius:99px;background:currentColor}.podium-audio-meter{width:4.7rem;height:.18rem;overflow:hidden;border-radius:99px;background:#e5deef}.podium-audio-meter b{display:block;width:3%;height:100%;border-radius:inherit;background:#a98bd3;transition:width .08s linear}.podium-audio-waves{position:absolute;inset:-.65rem;border:1.5px solid rgba(169,139,211,.42);border-radius:50%;opacity:0}.podium-voice.is-speaking .podium-audio-waves{animation:voice-wave 1s ease-out infinite}
.podium-voice-error { grid-column: 1 / -1; margin: .15rem 0 0; color: #a34545; font-size: .65rem; font-weight: 800; text-align: center; }
.podium-heading { position: relative; z-index: 2; }
.podium-brand { display: block; width: clamp(7rem, 20vw, 9rem); max-width: 100%; height: auto; margin: .6rem auto .3rem; }
.winning-streak{position:relative;z-index:3;width:max-content;min-width:12rem;margin:.55rem auto -1.1rem;padding:.48rem .8rem .48rem .48rem;display:flex;align-items:center;gap:.55rem;border:1px solid var(--button-main-border);border-radius:1rem;background:linear-gradient(145deg,var(--theme-pale),var(--theme-surface));color:var(--ink);box-shadow:0 .55rem 1.35rem var(--theme-glow);opacity:0;transform:translateY(-.4rem) scale(.94);transition:opacity .35s ease,transform .45s cubic-bezier(.2,.8,.25,1.15)}.winning-streak[hidden]{display:none}.winning-streak.is-visible{opacity:1;transform:none}.winning-streak>i{flex-shrink:0;line-height:1}.winning-streak>i .palette-streak-icon{width:2.3rem;height:2.3rem}.winning-streak>span{display:grid;gap:.1rem}.winning-streak em{max-width:11rem;overflow:hidden;color:var(--ink);font-size:.62rem;font-style:normal;font-weight:900;line-height:1.1;text-overflow:ellipsis;white-space:nowrap}.winning-streak strong{color:var(--theme-deep);font-size:.78rem;font-weight:950;letter-spacing:.045em;text-transform:uppercase}.winning-streak strong b{font-size:.72rem}.winning-streak small{color:var(--muted);font-size:.66rem;font-weight:750}
.confetti { position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(circle, #e9b949 0 3px, transparent 4px), radial-gradient(circle, #65c5cd 0 3px, transparent 4px), radial-gradient(circle, #b59ade 0 3px, transparent 4px); background-size: 83px 97px, 107px 89px, 71px 113px; opacity: .6; animation: confetti-fall 8s linear infinite; }
.podium { position: relative; z-index: 1; min-height: 26.5rem; margin-top: .8rem; display: flex; justify-content: center; align-items: flex-end; gap: clamp(.35rem, 2vw, 1rem); }
.podium-place { width: min(31%, 10rem); text-align: center; animation: podium-up .65s both; }
.podium-place .avatar { width: clamp(3.5rem, 13vw, 5.2rem); height: clamp(3.5rem, 13vw, 5.2rem); margin: 0 auto .5rem; border: 4px solid white; font-size: 1.15rem; box-shadow: 0 .6rem 1.5rem rgba(28,74,78,.14); }
.podium-avatar-wrap{position:relative;width:max-content;margin:0 auto .5rem;display:block}.podium-avatar-wrap>.avatar{margin:0}.podium-streak-card{position:absolute;z-index:8;right:-.9rem;bottom:-.12rem;height:2rem;display:flex;align-items:center;gap:.22rem;opacity:0;transform:translate(.2rem,.2rem) scale(.65);transform-origin:left center;pointer-events:none;transition:opacity .3s ease,transform .4s cubic-bezier(.2,.8,.25,1.18)}.podium-streak-card.is-visible{opacity:1;transform:none}.podium-streak-card i{width:2rem;height:2rem;display:grid;place-items:center;border:2px solid var(--button-main-border);border-radius:50%;background:var(--theme-surface);box-shadow:0 .25rem .7rem var(--theme-glow);font-style:normal;line-height:1}.podium-streak-card b{padding:.1rem .25rem;border-radius:999px;background:var(--theme-pale);color:var(--theme-deep);font-size:.67rem;font-weight:950}
.podium-place.is-speaking .podium-dice-avatar,.fourth-place.is-speaking .podium-dice-avatar{animation:podium-speaker-aura 1s ease-out infinite;box-shadow:0 0 0 .28rem rgba(42,170,178,.32),0 0 0 .7rem rgba(42,170,178,.14),0 .6rem 1.5rem rgba(28,74,78,.2)}
.podium-dice-avatar{display:block;object-fit:contain;padding:.18rem;background:rgba(255,255,255,.72);animation:podium-avatar-celebrate 1.8s cubic-bezier(.2,.8,.25,1) infinite alternate}
.podium-place strong { display: block; overflow: hidden; text-overflow: ellipsis; }
.podium-place small { color: var(--muted); font-weight: 850; }
.podium-block { height: var(--height); margin-top: .7rem; padding: 1rem .25rem 0; border-radius: 1.2rem 1.2rem .4rem .4rem; background: var(--medal); color: white; font-size: 1.8rem; font-weight: 950; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.8); }
.podium-place.first { order: 2; animation-delay: 0s; }
.podium-place.second { order: 1; animation-delay: .15s; }
.podium-place.third { order: 3; animation-delay: .3s; }
.podium-place.podium-rank-1 { --height: 11.5rem; --medal: linear-gradient(145deg,#f1d276,#c99b32); }
.podium-place.podium-rank-2 { --height: 8rem; --medal: linear-gradient(145deg,#c5d5d9,#829da4); }
.podium-place.podium-rank-3 { --height: 6rem; --medal: linear-gradient(145deg,#d6a47e,#a86c43); }
.podium-place.is-tied .podium-block { font-size: clamp(.9rem, 4vw, 1.25rem); }
.fourth-place { position: relative; z-index: 2; margin: 1rem auto 0; padding: .8rem 1rem; display: flex; justify-content: center; gap: .75rem; color: var(--muted); font-weight: 800; }
.fourth-place:empty { display: none; }
.return-lobby { position: relative; z-index: 2; width: min(100%, 15rem); margin: .7rem 0 .55rem auto; padding: .68rem 1rem; }
.podium-actions { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .7rem; }
.podium-actions .return-lobby { margin: 0; width: auto; flex: 0 1 15rem; text-align: center; }
.share-podium { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 2.8rem; padding: .35rem .65rem; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font: inherit; font-size: .8rem; font-weight: 850; cursor: pointer; }
.share-podium img { display: block; width: 2rem; height: 2rem; object-fit: contain; }
.share-podium:hover { background: var(--theme-surface, #eee6f8); }
.share-podium:focus-visible { outline: 2px solid var(--theme-deep, #875fac); outline-offset: 3px; }
.share-podium:disabled { cursor: wait; opacity: .65; }
.share-podium.is-generating img { animation: mini-shared .7s ease-in-out infinite alternate; }
.podium-share-status { position: relative; z-index: 3; margin: .35rem 0; color: var(--muted); font-size: .75rem; text-align: center; }
.podium-share-status:empty { display: none; }
@media(max-width:360px) { .podium-actions { flex-wrap: wrap; justify-content: center; } .podium-actions .return-lobby { flex-basis: 100%; } }

@media (max-height: 850px) {
  .podium-screen { padding-top: max(.6rem, env(safe-area-inset-top)); padding-bottom: max(.65rem, env(safe-area-inset-bottom)); }
  .podium-heading { padding-top: 0; }
  .podium-heading p { margin: .3rem 0; }
  .podium { min-height: 23.5rem; margin-top: .3rem; }
  .podium-place.podium-rank-1 { --height: 10rem; }
  .podium-place.podium-rank-2 { --height: 7rem; }
  .podium-place.podium-rank-3 { --height: 5.25rem; }
  .podium-voice { min-height: 6.5rem; margin-top: .55rem; padding-block: .5rem; }
  .return-lobby { margin-block: .5rem; }
}

@keyframes screen-in { from { opacity: 0; transform: translateY(1rem); } }
@keyframes podium-speaker-aura{0%{box-shadow:0 0 0 .15rem rgba(42,170,178,.42),0 0 0 .3rem rgba(42,170,178,.2),0 .6rem 1.5rem rgba(28,74,78,.2)}70%{box-shadow:0 0 0 .4rem rgba(42,170,178,.18),0 0 0 .9rem rgba(42,170,178,0),0 .6rem 1.5rem rgba(28,74,78,.2)}100%{box-shadow:0 0 0 .15rem rgba(42,170,178,0),0 0 0 1rem rgba(42,170,178,0),0 .6rem 1.5rem rgba(28,74,78,.2)}}
@keyframes question-enter { from { opacity: 0; transform: translateY(18%) scale(.97); } }
@keyframes swipe-coach { to { transform: translateY(-.22rem); } }
@keyframes game-gesture-coach { to { transform: translateY(-.28rem); } }
@keyframes timer-pulse { to { transform: scale(1.04); } }
@keyframes delta-pop { 0% { opacity: 0; transform: translateY(.5rem); } 25%,70% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-.4rem); } }
@keyframes confetti-fall { to { background-position: 0 194px, 0 178px, 0 226px; } }
@keyframes podium-up { from { opacity: 0; transform: translateY(5rem); } }
@keyframes podium-avatar-celebrate{0%,65%{transform:translateY(0) rotate(-1deg)}100%{transform:translateY(-.45rem) rotate(2deg)}}
@keyframes mini-breathe { 0%,16%,100% { transform:scale(1); box-shadow:0 .2rem .65rem rgba(18,61,71,.08) } 8% { transform:scale(1.05); box-shadow:0 .35rem .9rem rgba(18,110,119,.16) } }
@keyframes mini-answer { 0%{transform:translateY(0) scale(var(--base-scale))} 34%{transform:translateY(-8px) scale(var(--base-scale))} 100%{transform:translateY(0) scale(var(--base-scale))} }
@keyframes mini-shared { to{transform:translateY(-4px) scale(var(--base-scale));scale:1.04} }
@keyframes voice-wave { 0% { opacity:.75; transform:scale(.9); } 100% { opacity:0; transform:scale(1.45); } }
@keyframes push-ring { 0% { opacity:.7; transform:translate(-50%,-50%) scale(.65); } 100% { opacity:0; transform:translate(-50%,-50%) scale(1.2); } }

@media (max-width: 430px) {
  .play-header { position: relative; }
  .package-screen { --package-card-height: clamp(8.8rem, 22dvh, 11rem); }
  .game-header.packages-header { gap: .75rem; }
  .game-header.packages-header h1 { font-size: clamp(1.9rem, 12vw, 3rem); }
  .ready-room-exit { width: 3rem; height: 3rem; font-size: .62rem; }
  .package-screen .intro { margin-bottom: .85rem; font-size: .9rem; line-height: 1.35; }
  .package-grid { grid-template-columns: 1fr; gap: .8rem; }
  .package-cover { padding: 1rem; }
  .package h2 { max-width: 15ch; font-size: clamp(1.45rem, 8vw, 2rem); }
  .game-card-front { padding: 1.25rem; }
  .game-card-back { padding: .9rem; }
  .game-answer { min-height: 4.8rem; font-size: .86rem; }
  .play-status { gap: .35rem; }
  .streak-badge { position: absolute; z-index: 9; top: 3.2rem; right: 0; padding-right: .45rem; }
  .winning-streak{min-width:10.5rem;margin-bottom:-.65rem}.winning-streak>i .palette-streak-icon{width:1.9rem;height:1.9rem}.podium-streak-card{right:-.72rem;bottom:-.08rem;height:1.8rem;gap:.16rem}.podium-streak-card i{width:1.8rem;height:1.8rem}.podium-streak-card .palette-streak-icon{width:1.2rem;height:1.2rem}.podium-streak-card b{font-size:.6rem}
  .voice-controls { grid-template-columns: 3.7rem 1fr; gap: .65rem; }
  .voice-toggle { width: 3.7rem; height: 3.7rem; }
  .push-to-talk { padding-left: 4rem; }
  .push-to-talk .mic-icon { left: 1.45rem; }
  .push-rings { left: 1.95rem; }
}

@media (hover: hover) and (pointer: fine) {
  .skip-question-button { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Botones pastel difuminados: continuidad visual con el perfil. */
:root { --pastel-peach:#f9dfbb; --pastel-lilac:#e8d9f5; --pastel-blue:#d9f1f6; --pastel-mint:#d9f2e8; --pastel-ink:#315f68; }
.round-button,.profile-dot,.package-action-bubbles a,.voice-toggle,.podium-audio-toggle,.podium-audio-options {
  border:1px solid rgba(125,105,158,.28);
  background:radial-gradient(circle at 22% 18%,#f5c982,transparent 45%),radial-gradient(circle at 82% 78%,#9fdce5,transparent 52%),linear-gradient(145deg,#f9f4fc,#cdb7e7);
  color:#244f58;
  box-shadow:0 .62rem 1.5rem rgba(76,79,105,.18),0 0 1.2rem rgba(154,119,190,.16),inset 0 1px 0 rgba(255,255,255,.78);
  backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
}
.primary-action {
  border:1px solid rgba(91,94,145,.28);
  background:radial-gradient(circle at 15% 20%,#f1bd70,transparent 42%),radial-gradient(circle at 88% 72%,#65c1cc,transparent 52%),linear-gradient(135deg,#ad8fd2,#72c2cc);
  color:#123d47;
  box-shadow:0 .85rem 1.9rem rgba(65,76,114,.25),0 0 1.5rem rgba(154,119,190,.22),inset 0 1px 0 rgba(255,255,255,.56);
  transition:transform .18s ease,box-shadow .18s ease,filter .18s ease;
}
.primary-action:hover:not(:disabled){transform:translateY(-2px);filter:saturate(1.06);box-shadow:0 1rem 2rem rgba(83,99,126,.22),0 0 1.8rem rgba(193,169,218,.2),inset 0 1px 0 rgba(255,255,255,.74)}
.primary-action:active:not(:disabled){transform:scale(.985)}
.skip-question-button {
  border-color:rgba(137,105,164,.3);
  background:radial-gradient(circle at 18% 15%,#f4ca88,transparent 47%),linear-gradient(135deg,#fff9ee,#d6bfe9);
  color:#3d5660;box-shadow:0 .48rem 1.1rem rgba(76,79,105,.16),inset 0 1px 0 rgba(255,255,255,.7);
}
.skip-question-button:hover{background:radial-gradient(circle at 18% 15%,#f9dfbb,transparent 46%),linear-gradient(135deg,#fff,#e8d9f5)}
.game-answer {
  border-color:rgba(80,142,158,.28);
  background:radial-gradient(circle at 12% 16%,rgba(255,255,255,.72),transparent 42%),linear-gradient(145deg,#bde7ef,#cbb6e3);
  color:#1f4851;box-shadow:0 .5rem 1.15rem rgba(76,79,105,.15),inset 0 1px 0 rgba(255,255,255,.7);
}
.game-answer:nth-child(2){background:radial-gradient(circle at 12% 16%,rgba(255,255,255,.72),transparent 42%),linear-gradient(145deg,#d0b9e7,#efc989)}
.game-answer:nth-child(3){background:radial-gradient(circle at 12% 16%,rgba(255,255,255,.72),transparent 42%),linear-gradient(145deg,#b9e5cd,#addde8)}
.game-answer:nth-child(4){background:radial-gradient(circle at 12% 16%,rgba(255,255,255,.72),transparent 42%),linear-gradient(145deg,#f1ca83,#cfb8e6)}
.game-answer::before{border:1px solid rgba(255,255,255,.82);background:rgba(255,255,255,.68);color:#52676d;box-shadow:inset 0 1px 0 rgba(255,255,255,.84)}
.game-answer.is-correct{border-color:#8bcdb0;background:radial-gradient(circle at 15% 15%,#f4fff8,transparent 40%),linear-gradient(145deg,#dff5e8,#a9ddc5);color:#245f47}
.game-answer.is-wrong{border-color:#dfaaa8;background:radial-gradient(circle at 15% 15%,#fff7f5,transparent 40%),linear-gradient(145deg,#fae7e4,#efbfbd);color:#7f4545}
.push-to-talk,.podium-push-talk {
  border-color:rgba(255,255,255,.92);
  background:radial-gradient(circle at 24% 18%,rgba(255,255,255,.72),transparent 38%),radial-gradient(circle at 78% 82%,rgba(217,241,246,.5),transparent 48%),linear-gradient(145deg,var(--pastel-lilac),#c5addf);
  color:#65547f;box-shadow:0 0 0 .14rem rgba(193,169,218,.16),0 .68rem 1.4rem rgba(76,79,105,.15),inset 0 1px 0 rgba(255,255,255,.66);
}
.selected-package,.friends-card,.voice-card,.podium-voice {
  border-color:rgba(255,255,255,.78);
  background:radial-gradient(circle at 9% 18%,rgba(249,223,187,.38),transparent 36%),radial-gradient(circle at 88% 82%,rgba(217,241,246,.68),transparent 44%),linear-gradient(145deg,rgba(255,255,255,.9),rgba(232,217,245,.5));
  box-shadow:0 1rem 2.8rem rgba(76,79,105,.09),inset 0 1px 0 rgba(255,255,255,.9);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);
}
.friend,.voice-player{background:radial-gradient(circle at 15% 20%,rgba(249,223,187,.32),transparent 38%),linear-gradient(135deg,rgba(255,255,255,.78),rgba(217,241,246,.62))}
.player-count,.voice-status{background:linear-gradient(135deg,var(--pastel-lilac),var(--pastel-blue));color:#52676d}
.package-icon{border:1px solid rgba(255,255,255,.82);background:rgba(255,255,255,.58);box-shadow:0 .3rem .85rem rgba(76,79,105,.08),inset 0 1px 0 rgba(255,255,255,.86);backdrop-filter:blur(10px)}

/* Botones nítidos: pastel sólido, sin difusión dentro del control. */
.primary-action{border:1px solid #8d6fba;background:#a98bd2;color:#2f2340;box-shadow:0 .48rem 1rem rgba(91,63,126,.22);filter:none}
.primary-action:hover:not(:disabled){background:#9d7bc9;filter:none;box-shadow:0 .65rem 1.2rem rgba(91,63,126,.28)}
.skip-question-button{border-color:#b99bd2;background:#e2d3ef;color:#4f4165;box-shadow:0 .3rem .75rem rgba(83,65,110,.12)}
.skip-question-button:hover{background:#d7c2e8}

/* Respuestas uniformes: el color identifica el mazo, no una opción concreta. */
[data-game-app][data-package-color="green"]{--answer-a:#dff5e8;--answer-b:#b8e4cf;--answer-border:#8bcdb0;--answer-ink:#245f47}
[data-game-app][data-package-color="blue"]{--answer-a:#dff3f8;--answer-b:#b9deeb;--answer-border:#86c4d8;--answer-ink:#285c70}
[data-game-app][data-package-color="lilac"]{--answer-a:#eee7f8;--answer-b:#d8c8ec;--answer-border:#b59bd3;--answer-ink:#55436f}
[data-game-app][data-package-color="gold"]{--answer-a:#f8efcf;--answer-b:#ead79d;--answer-border:#d7b965;--answer-ink:#69541e}
[data-game-app][data-package-color] .game-answer,[data-game-app][data-package-color] .game-answer:nth-child(2),[data-game-app][data-package-color] .game-answer:nth-child(3),[data-game-app][data-package-color] .game-answer:nth-child(4){border-color:var(--answer-border);background:linear-gradient(145deg,var(--answer-a),var(--answer-b));color:var(--answer-ink);box-shadow:0 .5rem 1.15rem rgba(76,79,105,.12),inset 0 1px 0 rgba(255,255,255,.64)}
[data-game-app][data-package-color] .game-answer::before{border-color:rgba(255,255,255,.82);background:rgba(255,255,255,.68);color:var(--answer-ink)}
[data-game-app][data-package-color] .game-answer.is-correct{border-color:#8bc5a6;background:#9fd7b7;color:#245f47;box-shadow:0 .35rem .9rem rgba(36,95,71,.1)}
[data-game-app][data-package-color] .game-answer.is-wrong{border-color:#d9a09e;background:#e8aaa5;color:#7f4545;box-shadow:0 .35rem .9rem rgba(127,69,69,.1)}
[data-button-theme="night"] [data-game-app][data-package-color="green"]{--answer-a:#2b5149;--answer-b:#23433e;--answer-border:#4f8172;--answer-ink:#e7f8ee}
[data-button-theme="night"] [data-game-app][data-package-color="blue"]{--answer-a:#2d5068;--answer-b:#243f56;--answer-border:#4f7790;--answer-ink:#e9f6fb}
[data-button-theme="night"] [data-game-app][data-package-color="lilac"]{--answer-a:#4b4468;--answer-b:#3b3658;--answer-border:#71668f;--answer-ink:#f0ecfb}
[data-button-theme="night"] [data-game-app][data-package-color="gold"]{--answer-a:#554a35;--answer-b:#463d2f;--answer-border:#7c6b45;--answer-ink:#fbf0d0}
[data-button-theme="night"] [data-game-app][data-package-color] .game-answer,[data-button-theme="night"] [data-game-app][data-package-color] .game-answer:nth-child(2),[data-button-theme="night"] [data-game-app][data-package-color] .game-answer:nth-child(3),[data-button-theme="night"] [data-game-app][data-package-color] .game-answer:nth-child(4){border-color:var(--answer-border);background:linear-gradient(145deg,var(--answer-a),var(--answer-b));color:var(--answer-ink);box-shadow:0 .35rem .9rem rgba(2,8,20,.2)}
[data-button-theme="night"] [data-game-app][data-package-color] .game-answer::before{border-color:rgba(222,230,245,.28);background:rgba(18,31,51,.48);color:var(--answer-ink)}
[data-button-theme="night"] [data-game-app][data-package-color] .game-answer.is-correct{border-color:#729e86;background:#355b49;color:#e1f3e8;box-shadow:0 .35rem .9rem rgba(2,8,20,.2)}
[data-button-theme="night"] [data-game-app][data-package-color] .game-answer.is-wrong{border-color:#b18181;background:#704b50;color:#fbe7e5;box-shadow:0 .35rem .9rem rgba(2,8,20,.2)}

/* Audio settings shared visually with the room controls. */
.audio-dialog{width:min(calc(100% - 2rem),28rem);padding:0;border:0;border-radius:1.5rem;color:var(--ink);box-shadow:0 2rem 5rem rgba(16,57,67,.25)}.audio-dialog::backdrop{background:rgba(11,44,51,.3);backdrop-filter:blur(6px)}.audio-dialog form{padding:1.25rem;background:#f8fcfc}.audio-dialog header{display:flex;align-items:center;justify-content:space-between;gap:1rem}.audio-dialog header h2{margin-top:.15rem}.audio-dialog header button{width:2.5rem;height:2.5rem;border:0;border-radius:50%;background:#e7f5f5;color:#155a65;font-size:1.35rem;cursor:pointer}.audio-device-field{margin-top:1rem;display:grid;gap:.4rem}.audio-device-field>span{font-size:.72rem;font-weight:900}.audio-device-field select{width:100%;padding:.75rem;border:1px solid rgba(21,90,101,.14);border-radius:.85rem;background:#fff;color:#174f58;font:inherit;font-size:.76rem}.audio-setting{margin-top:.7rem;padding:.75rem;display:flex;align-items:center;justify-content:space-between;gap:1rem;border:1px solid rgba(21,90,101,.1);border-radius:.9rem;background:#fff}.audio-setting strong,.audio-setting small{display:block}.audio-setting strong{font-size:.76rem}.audio-setting small{margin-top:.1rem;color:var(--muted);font-size:.62rem}.audio-setting input{width:1.25rem;height:1.25rem;accent-color:#218b93}.audio-apply{width:100%;margin-top:1rem;padding:.8rem;border:0;border-radius:.9rem;background:linear-gradient(135deg,#155a65,#237d86);color:#fff;font-weight:900;cursor:pointer}

/* Preserve results while showing who has returned to the lobby. */
.is-in-lobby .podium-avatar-wrap { opacity: .65; transition: opacity .2s ease; }
.is-in-lobby .podium-dice-avatar { animation: none; }
.podium-lobby-badge { display: table; margin: .3rem auto 0; padding: .2rem .6rem; border-radius: 999px; background: var(--button-main); color: var(--button-main-ink); font-size: .7rem; line-height: 1.2; font-weight: 850; white-space: nowrap; }
.fourth-place .podium-lobby-badge { margin: 0; }

.podium-disconnected-badge { display: flex; align-items: center; justify-content: center; width: 2rem; height: 1.65rem; margin: .3rem auto 0; border-radius: 999px; background: #000; color: #fff; }
.podium-disconnected-badge svg { display: block; width: 1.2rem; height: 1.2rem; }
.fourth-place .podium-disconnected-badge { margin: 0; flex-shrink: 0; }
.is-disconnected .podium-dice-avatar { animation: none; }

.voice-playback {
  grid-column: 1 / -1;
  justify-self: center;
  padding: .35rem .75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #405461;
  cursor: pointer;
}
