/* GuessRank redesign: 1v1 Battle and Group Battle. Builds on v2.css.
   The live scripts (1v1-logic.js, group-battle-logic.js, result-modal.js) keep driving these pages;
   everything they inject is styled here by its id or class. */

/* ---------- Visibility contracts with the live scripts ---------- */
/* 1v1 shows screens with inline display (jQuery .css/.hide), so .is-hidden must stay overridable. */
.v2-mp-page--duel .is-hidden { display: none; }
.v2-mp-page--duel #game-ui { display: none; }
/* Group Battle only toggles the class, so it wins over everything. */
.v2-mp-page--group .is-hidden { display: none !important; }
.v2-mp-page .result { display: none; }
.v2-mp-page .v2-mp-fallback .true,
.v2-mp-page .v2-mp-fallback .false { display: none; }
.v2-mp-page #copy-success-msg { display: none; }

/* ---------- Layout ---------- */
.v2-mp { display: flex; gap: 32px; align-items: flex-start; justify-content: center; padding-top: 24px; }
.v2-mp__main { flex: 999 1 560px; min-width: 0; max-width: 860px; }
.v2-mp__stage { position: relative; }
.v2-mp .v2-slot:empty { display: none; }
@media (max-width: 1100px) { .v2-mp .v2-rail { display: none; } }

/* Group Battle: game column, leaderboard column; the ad row moves under the leaderboard on phones. */
.v2-mp--group {
  display: grid; gap: 0 32px; justify-content: center; align-items: start;
  grid-template-columns: 160px minmax(0, 792px) 300px;
  grid-template-rows: auto 1fr;
  grid-template-areas: "rail main side" "rail ads side";
}
.v2-mp--group > .v2-rail { grid-area: rail; }
.v2-mp--group > .v2-mp__main { grid-area: main; max-width: none; }
.v2-mp--group > #sidebar-section { grid-area: side; min-width: 0; }
.v2-mp--group > .v2-mp__ads { grid-area: ads; min-width: 0; }
@media (max-width: 1100px) {
  .v2-mp--group { grid-template-columns: minmax(0, 792px) 300px; grid-template-areas: "main side" "ads side"; }
}
@media (max-width: 940px) {
  .v2-mp--group { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "main" "side" "ads"; }
  .v2-mp--group > #sidebar-section { margin-top: 16px; }
}

/* ---------- Lobby (both pages) ---------- */
.v2-mp-lobby { padding-top: 32px; animation: v2-rise 360ms var(--v2-ease) both; }
.v2-mp-page--duel .v2-mp-lobby { max-width: 760px; margin: 0 auto; }
.v2-mp-intro { display: flex; flex-direction: column; gap: 16px; }
.v2-mp-title { font-size: 48px; line-height: 1.05; letter-spacing: -0.03em; }
.v2-mp-lead { margin: 0; font-size: 18px; line-height: 1.5; color: var(--v2-muted); }
.v2-mp-forms { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 40px; }
.v2-mp-card { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; padding: 28px; border-radius: 24px; background: var(--v2-card); }
.v2-mp-card__title { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.v2-mp-card__title svg { flex: 0 0 auto; color: var(--v2-faint); }
.v2-mp-card__action { margin-top: auto; }

/* Fields */
.v2-mp-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.v2-mp-field label { font-size: 14px; font-weight: 500; color: var(--v2-muted); }
.v2-mp-page .v2-mp-field input[type="text"],
.v2-mp-page .v2-mp-select select,
.v2-mp-page #copy-link-input {
  width: 100%; min-height: 48px; margin: 0; padding: 0 16px; border: 0; border-radius: 12px;
  background: var(--v2-raised); box-shadow: inset 0 0 0 1px var(--v2-line);
  color: var(--v2-text); font-family: var(--v2-font); font-size: 16px;
  transition: box-shadow 150ms var(--v2-ease);
}
.v2-mp-page .v2-mp-field input[type="text"]::placeholder { color: var(--v2-faint); opacity: 1; }
.v2-mp-page .v2-mp-field input[type="text"]:focus,
.v2-mp-page .v2-mp-select select:focus,
.v2-mp-page #copy-link-input:focus { outline: 2px solid var(--v2-lavender); outline-offset: 2px; }
.v2-mp-page .v2-mp-code-input { font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
.v2-mp-page .v2-mp-code-input::placeholder { font-weight: 400; letter-spacing: 0; text-transform: none; }
.v2-mp-select { position: relative; display: block; }
.v2-mp-page .v2-mp-select select { padding-right: 44px; -webkit-appearance: none; appearance: none; cursor: pointer; }
.v2-mp-select svg { position: absolute; right: 16px; top: 16px; color: var(--v2-faint); pointer-events: none; }
.v2-mp-page option { background: var(--v2-raised); color: var(--v2-text); }
.v2-mp-help { margin: 0; font-size: 14px; line-height: 1.5; color: var(--v2-faint); }

/* Buttons that sit next to a .v2-pill keep its height and weight */
.v2-mp-page .v2-mp-btn { min-height: 48px; padding: 0 24px; color: var(--v2-text) !important; font-size: 16px; font-weight: 600; }

/* Status and error line the scripts write into (#lobby-error, #prompt-error) */
.v2-mp-error { display: flex; align-items: flex-start; gap: 8px; margin-top: 16px; font-size: 14px; line-height: 1.5; color: var(--v2-muted); }
.v2-mp-error:empty { display: none; }
.v2-mp-error.is-error { color: var(--v2-red); }
.v2-mp-error.is-error::before {
  content: ""; flex: 0 0 auto; width: 16px; height: 16px; margin-top: 2px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' x2='12' y1='8' y2='12'/%3E%3Cline x1='12' x2='12.01' y1='16' y2='16'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' x2='12' y1='8' y2='12'/%3E%3Cline x1='12' x2='12.01' y1='16' y2='16'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
}

/* ---------- Waiting orb ---------- */
.v2-orb {
  position: relative; flex: 0 0 auto; display: block; width: 96px; height: 96px; border-radius: 50%; overflow: hidden;
  background: var(--v2-raised); box-shadow: inset 0 0 0 2px rgba(60, 179, 113, 0);
  transition: box-shadow 360ms var(--v2-ease);
  animation: v2-orb-breathe 2.4s ease-in-out infinite alternate;
}
.v2-orb__blobs { position: absolute; inset: 0; filter: blur(12px); transition: opacity 360ms var(--v2-ease), transform 420ms var(--v2-ease); }
.v2-orb__blob { position: absolute; border-radius: 50%; }
.v2-orb__blob--a { left: 18px; top: 18px; width: 60px; height: 60px; background: var(--v2-accent); animation: v2-orbit-a 3.2s linear infinite; }
.v2-orb__blob--b { left: 22px; top: 22px; width: 52px; height: 52px; background: var(--v2-lavender); animation: v2-orbit-a 4.4s linear infinite reverse; }
.v2-orb__blob--c { left: 28px; top: 28px; width: 40px; height: 40px; background: var(--v2-gold); opacity: .85; animation: v2-orbit-b 5.6s linear infinite; }
.v2-orb__gloss { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; background: radial-gradient(circle at 34% 26%, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 46%); }
.v2-orb__check {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--v2-green);
  opacity: 0; transform: scale(.5);
  transition: opacity 240ms 120ms var(--v2-ease), transform 480ms 120ms var(--v2-spring);
}
.v2-orb__check svg { display: block; }
.v2-orb__check path { stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset 400ms 260ms var(--v2-ease); }
.v2-orb.is-done { animation: none; box-shadow: inset 0 0 0 2px var(--v2-green-ring); }
.v2-orb.is-done .v2-orb__blobs { opacity: 0; transform: scale(.35); }
.v2-orb.is-done .v2-orb__blob { animation-play-state: paused; }
.v2-orb.is-done .v2-orb__check { opacity: 1; transform: none; }
.v2-orb.is-done .v2-orb__check path { stroke-dashoffset: 0; }

/* ---------- 1v1 waiting room ---------- */
.v2-mp-page--duel #waiting-room { flex-direction: column; align-items: center; }
.v2-mp-wait {
  width: 100%; max-width: 560px; margin: 32px auto 0; padding: 40px; border-radius: 24px; background: var(--v2-card);
  display: flex; flex-direction: column; align-items: center; gap: 24px; text-align: center;
  animation: v2-rise 360ms var(--v2-ease) both;
}
.v2-mp-wait__head { display: flex; flex-direction: column; gap: 8px; }
.v2-mp-wait__head h2 { font-size: 30px; line-height: 1.2; }
.v2-mp-wait__head p { margin: 0; font-size: 16px; color: var(--v2-muted); }
.v2-mp-code {
  display: inline-block; min-width: 4ch; padding: 16px 32px; border-radius: 16px; background: var(--v2-raised);
  font-size: 48px; font-weight: 600; line-height: 1; letter-spacing: .12em; color: var(--v2-text); font-variant-numeric: tabular-nums;
}
.v2-mp-code:empty::before { content: "\00a0"; }
.v2-mp-players { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; border-radius: 16px; background: var(--v2-raised); overflow: hidden; text-align: left; }
.v2-mp-player { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; color: var(--v2-faint); }
.v2-mp-player + .v2-mp-player { border-top: 1px solid var(--v2-line); }
.v2-mp-player > svg { flex: 0 0 auto; color: var(--v2-faint); }
.v2-mp-player__name { flex: 1 1 auto; min-width: 0; font-size: 16px; font-weight: 500; color: var(--v2-muted); transition: color 300ms var(--v2-ease); }
.v2-mp-player__name span { font-size: 14px; font-weight: 400; color: var(--v2-faint); }
.v2-mp-player__state { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: 14px; text-align: right; transition: color 300ms var(--v2-ease); }
.v2-mp-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 999px; box-shadow: inset 0 0 0 2px currentColor; transition: background-color 300ms var(--v2-ease); }
.v2-mp-player.is-in .v2-mp-player__name { color: var(--v2-text); }
.v2-mp-player.is-in .v2-mp-player__state { color: var(--v2-green); }
.v2-mp-player.is-in .v2-mp-dot { background: currentColor; }

/* The moment player 2 arrives: the card turns to a check, then fades to reveal the round underneath. */
.v2-mp-handoff {
  position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center;
  background: var(--v2-ground); pointer-events: none; transition: opacity 320ms var(--v2-ease);
}
.v2-mp-handoff[hidden] { display: none; }
.v2-mp-handoff.is-leaving { opacity: 0; }
.v2-mp-handoff .v2-mp-wait { animation: none; }
.v2-mp-handoff .v2-mp-wait__head { animation: v2-rise 360ms var(--v2-ease) both; }

/* 1v1 fallback game over screen (only when the result popup is missing) */
.v2-mp-page--duel #game-over-screen { flex-direction: column; align-items: center; }
.v2-mp-over {
  width: 100%; max-width: 640px; margin: 32px auto 0; padding: 40px; border-radius: 24px; background: var(--v2-card);
  display: flex; flex-direction: column; align-items: center; gap: 28px; text-align: center; animation: v2-rise 360ms var(--v2-ease) both;
}
.v2-mp-eyebrow { margin: 0; font-size: 14px; font-weight: 500; color: var(--v2-muted); }
.v2-mp-page #game-over-content h1 { margin: 0 !important; font-size: 48px !important; font-weight: 600; line-height: 1.05; letter-spacing: -0.03em; text-transform: lowercase; }
.v2-mp-page #game-over-content h1::first-letter { text-transform: uppercase; }
.v2-mp-page #game-over-content h1[style*="#4caf50"] { color: var(--v2-green) !important; }
.v2-mp-page #game-over-content h1[style*="#ff5555"] { color: var(--v2-red) !important; }
.v2-mp-page #game-over-content div { margin-top: 16px !important; font-size: 36px !important; font-weight: 600; color: var(--v2-gold) !important; font-variant-numeric: tabular-nums; }
.v2-mp-page .game-over-actions { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ---------- 1v1 round ---------- */
.v2-mp-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.v2-mp-chip { display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px; border-radius: 12px; background: var(--v2-card); font-size: 18px; font-weight: 600; color: var(--v2-text); }
.v2-mp-chip[hidden] { display: none; }
.v2-mp-scoreboard { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; margin-left: auto; }
.v2-mp-score { display: flex; align-items: baseline; gap: 8px; }
.v2-mp-score > span:first-child { font-size: 14px; color: var(--v2-muted); }
.v2-mp-score > span:last-child { font-size: 30px; font-weight: 600; line-height: 1; color: var(--v2-text); font-variant-numeric: tabular-nums; }
.v2-mp-score--me > span:last-child { color: var(--v2-gold); }
.v2-mp-round { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--v2-muted); font-variant-numeric: tabular-nums; }
.v2-mp-segs { display: flex; gap: 4px; }
.v2-mp-segs span { display: block; width: 24px; height: 4px; border-radius: 999px; background: var(--v2-fill); transition: background-color 300ms var(--v2-ease); }
.v2-mp-segs span.is-done { background: var(--v2-accent); }
.v2-mp-segs span.is-current { background: var(--v2-text); }

.v2-mp-page--duel #status-message {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; margin: 0 0 16px; padding: 0 16px;
  border-radius: 999px; background: var(--v2-card); font-size: 14px; color: var(--v2-nav);
}
.v2-mp-page--duel #status-message::before { content: ""; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 999px; background: var(--v2-green); }
.v2-mp-page #status-message:empty { display: none; }

.v2-mp-clip #video { border-radius: 24px; }
.v2-mp-question .v2-mp-points-short { display: none; }
.v2-mp-question:has(+ #ranks.is-hidden),
.v2-mp-question:has(+ #ranks:empty),
.v2-mp-question:has(+ #ranks[style*="none"]) { display: none; }

/* 1v1 fallback result (only when the result popup is missing) */
.v2-mp-fallback { margin-top: 16px; justify-content: center; }
.v2-mp-fallback .true, .v2-mp-fallback .false { width: 100%; padding: 20px 24px; border-radius: 24px; background: var(--v2-card); text-align: left; }
.v2-mp-fallback .result-title { font-size: 18px; font-weight: 600; }
.v2-mp-fallback .true .result-title { color: var(--v2-green); }
.v2-mp-fallback .false .result-title { color: var(--v2-red); }
.v2-mp-fallback .result-message { margin-top: 4px; font-size: 14px; color: var(--v2-muted); }
.v2-mp-fallback .result-message b { font-weight: 600; color: var(--v2-text); }
.v2-mp-fallback .false-rank-image img { display: block; width: 56px; height: 56px; margin-top: 8px; object-fit: contain; }

/* ---------- Rank tiles ---------- */
/* The scripts inject bare <img id="rank_x" role="button"> elements; multiplayer.js wraps each in .v2-mp-rank with its label. */
.v2-mp-page #ranks:not(.is-hidden):not([style*="none"]) { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; }
.v2-mp-rank {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 8px;
  min-width: 0; min-height: 44px; padding: 16px 4px 12px; border-radius: 16px;
  background: var(--v2-card); box-shadow: inset 0 0 0 2px transparent;
  color: var(--v2-muted); font-size: 12px; font-weight: 500; line-height: 1.3; text-align: center;
  cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background-color 200ms var(--v2-ease), box-shadow 240ms var(--v2-ease), opacity 300ms var(--v2-ease), transform 360ms var(--v2-spring);
}
.v2-mp-rank img { position: relative; z-index: 1; display: block; width: 56px; height: 56px; object-fit: contain; cursor: pointer; }
.v2-mp-rank img:focus-visible { outline: none; }
.v2-mp-rank:has(img:focus-visible) { outline: 2px solid var(--v2-lavender); outline-offset: 3px; }
.v2-mp-rank__label { position: relative; z-index: 1; overflow-wrap: anywhere; }
.v2-mp-rank:hover { background: var(--v2-hover); }
/* Press in quickly, spring back on release */
.v2-mp-rank:active { transform: scale(.95); transition-duration: 200ms, 240ms, 300ms, 140ms; transition-timing-function: var(--v2-ease); }
/* 1v1 locks the tiles between turns (body.gr-result-locked; result-modal.css also blocks pointer events on the images) */
body.gr-result-locked #ranks .v2-mp-rank { opacity: .4; cursor: default; }
body.gr-result-locked #ranks .v2-mp-rank:hover { background: var(--v2-card); }
body.gr-result-locked #ranks .v2-mp-rank:active { transform: none; }
body.gr-result-locked #ranks .v2-mp-rank img { opacity: 1; cursor: default; }
/* Group Battle marks the pick with .gr-rank-selected */
.v2-mp-rank:has(> img.gr-rank-selected) { box-shadow: inset 0 0 0 2px var(--v2-lavender); animation: v2-mp-spring 560ms var(--v2-ease); }
#ranks.has-rank-selected .v2-mp-rank:not(:has(> img.gr-rank-selected)) { opacity: .4; }
/* Without multiplayer.js the bare images still read as tiles */
.v2-mp-page #ranks > img {
  display: block; width: 100%; height: 88px; padding: 16px 8px; border-radius: 16px; background: var(--v2-card);
  object-fit: contain; cursor: pointer; transition: background-color 200ms var(--v2-ease), transform 140ms var(--v2-ease);
}
.v2-mp-page #ranks > img:hover { background-color: var(--v2-hover); }
.v2-mp-page #ranks > img:active { transform: scale(.95); }
.v2-mp-page #ranks > img.gr-rank-selected { box-shadow: inset 0 0 0 2px var(--v2-lavender); }

/* ---------- Group Battle: waiting room ---------- */
.v2-mp-panel { display: flex; flex-direction: column; gap: 24px; padding: 32px; border-radius: 24px; background: var(--v2-card); animation: v2-rise 360ms var(--v2-ease) both; }
.v2-mp-panel__head { display: flex; flex-direction: column; gap: 8px; }
.v2-mp-panel__head h2 { font-size: 30px; line-height: 1.2; }
.v2-mp-panel__head p { margin: 0; font-size: 16px; line-height: 1.5; color: var(--v2-muted); }
.v2-mp-panel__head--orb { flex-direction: row; align-items: center; justify-content: space-between; gap: 24px; }
.v2-mp-panel__head--orb > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.v2-mp-invite { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 16px; background: var(--v2-raised); }
.v2-mp-invite > label { font-size: 14px; line-height: 1.5; color: var(--v2-muted); }
.v2-mp-invite .invite-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.v2-mp-page #display-lobby-code {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px; border-radius: 12px; background: var(--v2-ground);
  font-size: 20px; font-weight: 600; letter-spacing: .12em; color: var(--v2-text); font-variant-numeric: tabular-nums;
}
.v2-mp-page #copy-link-input { flex: 1 1 240px; width: auto; min-width: 0; background: var(--v2-ground); color: var(--v2-muted); font-size: 14px; }
.v2-mp-copy {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 20px; border: 0; border-radius: 999px;
  background: var(--v2-fill); color: var(--v2-text); font-size: 14px; font-weight: 600;
  transition: box-shadow 150ms var(--v2-ease), transform 120ms var(--v2-ease);
}
.v2-mp-copy:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.v2-mp-copy:active { transform: scale(.97); }
.v2-mp-page #copy-success-msg { font-size: 14px; line-height: 20px; color: var(--v2-green); }
.v2-mp-page #copy-success-msg svg { display: inline-block; margin-right: 4px; vertical-align: -3px; }

.v2-mp-page #host-controls { display: flex; flex-direction: column; gap: 16px; padding-top: 24px; border-top: 1px solid var(--v2-line); }
.v2-mp-page .host-settings-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.v2-mp-page .input-help-text { font-size: 12px; line-height: 1.5; color: var(--v2-faint); }
.v2-mp-start { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
/* The script rewrites this label in capitals (START GAME, WAITING FOR PLAYERS...); shown in sentence case. */
.v2-mp-page .btn-start-game { display: inline-block; line-height: 48px; text-align: center; white-space: nowrap; text-transform: lowercase; }
.v2-mp-page .btn-start-game::first-letter { text-transform: uppercase; }
.v2-mp-page .btn-start-game:disabled { opacity: 1; background: var(--v2-fill); color: var(--v2-muted) !important; }
.v2-mp-start__note { display: none; font-size: 14px; line-height: 1.5; color: var(--v2-muted); }
.v2-mp-page .btn-start-game:disabled + .v2-mp-start__note { display: inline; }

.v2-mp-page #player-wait-message { display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: 16px; background: var(--v2-raised); }
.v2-mp-page #player-wait-message > svg { flex: 0 0 auto; color: var(--v2-faint); }
.player-wait-card__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.player-wait-card__text p { margin: 0; font-size: 16px; line-height: 1.5; color: var(--v2-text); }
.player-wait-card__text b { font-weight: 600; }
.player-wait-card__text .settings-summary { font-size: 14px; color: var(--v2-muted); }
/* multiplayer.js shows the game's real name next to the capitalised key the script writes */
.v2-mp-js .v2-mp-src { display: none; }

/* Nickname prompt (arriving from an invite link) */
.v2-mp-prompt { max-width: 480px; margin: 32px auto 0; padding: 32px; border-radius: 24px; background: var(--v2-card); display: flex; flex-direction: column; gap: 20px; animation: v2-rise 360ms var(--v2-ease) both; }
.v2-mp-prompt .gb-title { font-size: 30px; line-height: 1.2; }
.v2-mp-prompt #prompt-room-code-title { color: var(--v2-muted); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.v2-mp-prompt .v2-mp-error { margin-top: 0; }

/* ---------- Group Battle: round ---------- */
.v2-mp-play { animation: v2-rise 360ms var(--v2-ease) both; }
.v2-mp-page .round-status-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; min-height: 36px; }
.v2-mp-page .round-index-badge { font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.v2-mp-page--group #status-message { margin: 0 0 16px; font-size: 16px; line-height: 1.5; color: var(--v2-muted); }

/* Countdown ring: drains over the round, red with a small pulse in the last 3 seconds (multiplayer.js reads the script's number) */
.v2-timer {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 16px 4px 4px; border-radius: 999px;
  background: var(--v2-card); color: var(--v2-text); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums;
  transition: opacity 320ms var(--v2-ease), color 300ms var(--v2-ease), visibility 0s;
}
/* Fade instead of collapsing so the round bar does not jump */
.v2-mp-page--group #countdown-wrapper.is-hidden { display: inline-flex !important; opacity: 0; visibility: hidden; transition: opacity 320ms var(--v2-ease), visibility 0s 320ms; }
.v2-timer__ring { display: block; flex: 0 0 auto; overflow: visible; }
.v2-timer__track { fill: none; stroke: var(--v2-fill); stroke-width: 3; }
.v2-timer__arc { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 69.12; stroke-dashoffset: 0; }
.v2-timer.is-urgent { color: var(--v2-red); }
.v2-timer__ring.is-pulse-a { animation: v2-pulse-a 520ms var(--v2-ease); }
.v2-timer__ring.is-pulse-b { animation: v2-pulse-b 520ms var(--v2-ease); }
.v2-mp-page #countdown-timer { display: inline-block; min-width: 1.3em; text-align: right; }
.v2-mp-page #countdown-timer.is-tick-a { animation: v2-tick-a 260ms var(--v2-ease); }
.v2-mp-page #countdown-timer.is-tick-b { animation: v2-tick-b 260ms var(--v2-ease); }

/* Review card the script never opens (results show in the popup); kept styled in case it does */
.v2-mp-page #round-review-card { display: flex; flex-direction: column; gap: 24px; margin-top: 28px; padding: 28px; border-radius: 24px; background: var(--v2-card); }
.v2-mp-page #round-review-card .review-title { font-size: 24px; }
.v2-mp-page #round-review-card .review-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.v2-mp-page #round-review-card p { margin: 0 0 8px; font-size: 14px; color: var(--v2-muted); }
.v2-mp-page #round-review-card .review-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 20px; border-top: 1px solid var(--v2-line); font-size: 14px; color: var(--v2-muted); }

/* ---------- Group Battle: final standings ---------- */
.v2-mp-page .game-over-title { display: flex; align-items: center; gap: 12px; font-size: 30px; line-height: 1.2; }
.v2-mp-page .game-over-title svg { flex: 0 0 auto; color: var(--v2-faint); }
.v2-mp-page .final-scoreboard-container { border-radius: 16px; background: var(--v2-raised); overflow: hidden; }
.v2-mp-page .final-scoreboard-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.v2-mp-page .final-scoreboard-table th { padding: 12px 16px; font-size: 12px; font-weight: 500; color: var(--v2-faint); text-align: left; }
.v2-mp-page .final-scoreboard-table th:first-child { width: 72px; }
.v2-mp-page .final-scoreboard-table th:last-child { width: 120px; text-align: right; }
.v2-mp-page #final-scoreboard-body td { height: 56px; padding: 0 16px; border-top: 1px solid var(--v2-line); font-size: 16px; font-weight: 500; color: var(--v2-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-mp-page #final-scoreboard-body td:last-child { text-align: right; font-weight: 600; color: var(--v2-gold); font-variant-numeric: tabular-nums; }
.v2-mp-page .scoreboard-place-badge { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 999px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.v2-mp-page .scoreboard-row-1 .scoreboard-place-badge { background: var(--v2-fill); }
/* The script marks your own row with an inline style */
.v2-mp-page #final-scoreboard-body tr[style] { background: var(--v2-hover) !important; border-left: 0 !important; font-weight: 500 !important; }
.v2-mp-page #final-scoreboard-body tr[style] td:nth-child(2)::after { content: "(you)"; margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--v2-faint); }
.v2-mp-page #gb-finished-view .game-over-actions { justify-content: flex-start; gap: 16px; }
.v2-mp-page #player-finish-msg { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; font-size: 14px; color: var(--v2-muted); }
.v2-mp-page #player-finish-msg svg { flex: 0 0 auto; color: var(--v2-faint); }

/* ---------- Group Battle: leaderboard ---------- */
.v2-mp-page .sidebar-leaderboard-card { padding: 24px 16px 16px; border-radius: 24px; background: var(--v2-card); animation: v2-rise 360ms var(--v2-ease) both; }
.v2-mp-board__head { display: flex; flex-direction: column; gap: 4px; padding: 0 8px 16px; border-bottom: 1px solid var(--v2-line); }
.v2-mp-page .sidebar-heading { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.v2-mp-page .sidebar-heading svg { flex: 0 0 auto; color: var(--v2-faint); }
.v2-mp-page .sidebar-meta { font-size: 14px; color: var(--v2-muted); }
.v2-mp-page .sidebar-player-list { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.v2-mp-page .player-list-item { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px; border-radius: 12px; }
.v2-mp-page .player-list-item.is-me { background: var(--v2-hover); }
.v2-mp-page .player-rank { flex: 0 0 28px; font-size: 14px; color: var(--v2-faint); font-variant-numeric: tabular-nums; }
.v2-mp-page .player-details { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.v2-mp-page .player-name { font-size: 14px; font-weight: 500; color: var(--v2-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2-mp-page .player-list-item.is-offline .player-name { color: var(--v2-faint); }
.v2-mp-page .player-list-item.is-me .player-name::after { content: "(you)"; margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--v2-faint); }
.v2-mp-page .player-status-text { font-size: 12px; color: var(--v2-faint); }
.v2-mp-page .player-status-text.status-guessed { color: var(--v2-green); }
.v2-mp-page .player-status-text.status-disconnected { color: var(--v2-red); }
.v2-mp-page .player-score-block { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.v2-mp-page .player-score { min-width: 24px; text-align: right; font-size: 16px; font-weight: 600; color: var(--v2-gold); font-variant-numeric: tabular-nums; }
.v2-mp-page .player-points-badge { order: -1; padding: 4px 8px; border-radius: 999px; background: rgba(239, 189, 80, .14); font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--v2-gold); font-variant-numeric: tabular-nums; animation: v2-chip 360ms var(--v2-spring) both; }
.v2-mp-page .player-points-badge.points-zero { background: var(--v2-hover); color: var(--v2-faint); }
/* In the waiting room the list is names only; in the final view, names and scores */
.v2-mp-page--group:has(#gb-lobby-view:not(.is-hidden)) .player-status-text,
.v2-mp-page--group:has(#gb-lobby-view:not(.is-hidden)) .player-score-block,
.v2-mp-page--group:has(#gb-finished-view:not(.is-hidden)) .player-status-text { display: none; }
.v2-mp-alone { display: none; margin: 12px 8px 0; font-size: 14px; line-height: 1.5; color: var(--v2-muted); }
.v2-mp-page--group:has(#gb-lobby-view:not(.is-hidden)) #sidebar-player-list:has(> .player-list-item:only-child) + .v2-mp-alone { display: block; }

/* Host crown the script injects as a Font Awesome <i>; drawn as an inline icon with a label, no icon font needed */
.v2-mp-page i.fa-crown { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px !important; color: var(--v2-faint) !important; font-size: 12px; font-style: normal; font-weight: 400; line-height: 1; vertical-align: -2px; }
.v2-mp-page i.fa-crown::before {
  content: ""; flex: 0 0 auto; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z'/%3E%3Cpath d='M5 21h14'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z'/%3E%3Cpath d='M5 21h14'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
}
.v2-mp-page i.fa-crown::after { content: "Host"; }

/* ---------- Result popup (result-modal.js) in the new look ---------- */
.v2-mp-page .gr-result-backdrop { padding: 16px; background: rgba(10, 10, 12, .72); transition: opacity 240ms var(--v2-ease), visibility 240ms var(--v2-ease); }
.v2-mp-page .gr-result-backdrop.is-open { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.v2-mp-page .gr-result-modal {
  animation: none; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  border: 0; border-radius: 24px; background: var(--v2-card);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .55), inset 0 0 0 1px var(--v2-line);
  color: var(--v2-text); font-family: var(--v2-font); text-align: left;
  transform: translateY(12px) scale(.98); transition: opacity 240ms var(--v2-ease), transform 360ms var(--v2-ease);
}
.v2-mp-page .gr-result-backdrop.is-open .gr-result-modal { transform: none; }
.v2-mp-page .gr-result-modal.is-result-correct,
.v2-mp-page .gr-result-modal.is-result-close,
.v2-mp-page .gr-result-modal.is-result-wrong { box-shadow: 0 24px 64px rgba(0, 0, 0, .55), inset 0 0 0 1px var(--v2-line); }
.v2-mp-page .gr-result-modal:focus { outline: none; }
.v2-mp-page .gr-result-inner { display: flex; flex-direction: column; gap: 20px; padding: 28px; }
.v2-mp-page .gr-result-summary { display: flex; flex-direction: column; gap: 16px; }

/* Guess locked */
.v2-mp-page .gr-result-modal.is-pending { width: min(480px, calc(100vw - 32px)); }
.v2-mp-page .gr-result-modal.is-pending .gr-result-inner { padding: 20px 24px; }
.v2-mp-page .gr-result-modal.is-pending .gr-result-pending-panel { display: flex; align-items: center; gap: 20px; min-height: 0; padding: 0; text-align: left; }
.v2-mp-page .gr-result-pending-panel > div:last-child { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.v2-mp-page .gr-result-pending-rank { flex: 0 0 auto; width: 56px; height: 56px; }
.v2-mp-page .gr-result-pending-title { font-size: 18px; font-weight: 600; color: var(--v2-text); }
.v2-mp-page .gr-result-pending-subtitle { font-size: 14px; font-weight: 400; line-height: 1.4; color: var(--v2-muted); }
.v2-mp-page .gr-result-pending-spinner { order: 3; flex: 0 0 auto; width: 18px; height: 18px; margin-left: auto; border: 2px solid rgba(255, 255, 255, .2); border-top-color: var(--v2-lavender); animation: v2-spin 800ms linear infinite; }

/* Round result */
.v2-mp-page .gr-result-state { display: flex; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; }
.v2-mp-page .gr-result-state.is-correct,
.v2-mp-page .gr-result-state.is-close,
.v2-mp-page .gr-result-state.is-wrong,
.v2-mp-page .gr-result-state.is-final { border: 0; background: none; }
/* The script's titles are capitals (TRUE GUESS!); shown in sentence case */
.v2-mp-page .gr-result-title { margin: 0; font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: 0; text-transform: lowercase; color: var(--v2-text); }
.v2-mp-page .gr-result-title::first-letter { text-transform: uppercase; }
.v2-mp-page .gr-result-points { margin: 0; font-size: 18px; font-weight: 600; color: var(--v2-text); }
.v2-mp-page .gr-result-state.is-correct .gr-result-title, .v2-mp-page .gr-result-state.is-correct .gr-result-points { color: var(--v2-green); }
.v2-mp-page .gr-result-state.is-close .gr-result-title, .v2-mp-page .gr-result-state.is-close .gr-result-points { color: var(--v2-gold); }
.v2-mp-page .gr-result-state.is-wrong .gr-result-title, .v2-mp-page .gr-result-state.is-wrong .gr-result-points { color: var(--v2-red); }
.v2-mp-page .gr-result-total-score { margin: 0 0 0 auto; font-size: 14px; font-weight: 400; color: var(--v2-muted); font-variant-numeric: tabular-nums; }

.v2-mp-page .gr-result-rank-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.v2-mp-page .gr-result-rank-card { display: flex; align-items: center; gap: 16px; min-height: 0; padding: 16px; border: 0; border-radius: 16px; background: var(--v2-raised); box-shadow: inset 0 0 0 2px transparent; }
.v2-mp-page .gr-result-backdrop.is-open .gr-result-rank-card { animation: v2-rise 360ms var(--v2-ease) both; }
.v2-mp-page .gr-result-backdrop.is-open .gr-result-rank-card:nth-child(2) { animation-delay: 60ms; }
.v2-mp-page .gr-result-rank-card.is-actual { box-shadow: inset 0 0 0 2px var(--v2-green-ring); }
.v2-mp-page .gr-result-modal.is-result-correct .gr-result-rank-card:not(.is-actual) { box-shadow: inset 0 0 0 2px var(--v2-green-ring); }
.v2-mp-page .gr-result-modal.is-result-close .gr-result-rank-card.is-wrong-guess { box-shadow: inset 0 0 0 2px var(--v2-gold); }
.v2-mp-page .gr-result-modal.is-result-wrong .gr-result-rank-card.is-wrong-guess { box-shadow: inset 0 0 0 2px var(--v2-red-ring); }
.v2-mp-page .gr-result-rank-card img { flex: 0 0 auto; width: 56px; height: 56px; object-fit: contain; }
.v2-mp-page .gr-result-rank-card > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.v2-mp-page .gr-result-rank-label { font-size: 12px; font-weight: 400; text-transform: none; color: var(--v2-faint); }
.v2-mp-page .gr-result-rank-name { margin: 0; font-size: 18px; font-weight: 600; color: var(--v2-text); overflow-wrap: anywhere; }

.v2-mp-page .gr-result-distribution { padding: 20px 0 0; border: 0; border-top: 1px solid var(--v2-line); border-radius: 0; background: none; }
.v2-mp-page .gr-result-distribution-head { display: flex; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.v2-mp-page .gr-result-distribution-title { margin: 0; font-size: 14px; font-weight: 600; color: var(--v2-text); text-transform: lowercase; }
.v2-mp-page .gr-result-distribution-title::first-letter { text-transform: uppercase; }
.v2-mp-page .gr-result-distribution-total { font-size: 12px; font-weight: 400; color: var(--v2-faint); font-variant-numeric: tabular-nums; }
.v2-mp-page .gr-result-chart { gap: 8px; min-height: 0; align-items: end; }
.v2-mp-page .gr-result-bar-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.v2-mp-page .gr-result-bar-percent { font-size: 12px; font-weight: 400; color: var(--v2-faint); font-variant-numeric: tabular-nums; }
.v2-mp-page .gr-result-bar-item:has(.is-actual) .gr-result-bar-percent,
.v2-mp-page .gr-result-bar-item:has(.is-guess) .gr-result-bar-percent { color: var(--v2-text); }
.v2-mp-page .gr-result-bar-track { width: 100%; height: 88px; border-radius: 0; background: none; overflow: visible; }
.v2-mp-page .gr-result-bar-track::after { content: none; display: none; }
.v2-mp-page .gr-result-bar-fill { border-radius: 8px; background: var(--v2-fill); box-shadow: none; }
.v2-mp-page .gr-result-backdrop.is-open .gr-result-bar-fill { animation: v2-grow 520ms var(--v2-ease) both; }
.v2-mp-page .gr-result-bar-item:nth-child(2) .gr-result-bar-fill { animation-delay: 30ms; }
.v2-mp-page .gr-result-bar-item:nth-child(3) .gr-result-bar-fill { animation-delay: 60ms; }
.v2-mp-page .gr-result-bar-item:nth-child(4) .gr-result-bar-fill { animation-delay: 90ms; }
.v2-mp-page .gr-result-bar-item:nth-child(5) .gr-result-bar-fill { animation-delay: 120ms; }
.v2-mp-page .gr-result-bar-item:nth-child(6) .gr-result-bar-fill { animation-delay: 150ms; }
.v2-mp-page .gr-result-bar-item:nth-child(7) .gr-result-bar-fill { animation-delay: 180ms; }
.v2-mp-page .gr-result-bar-item:nth-child(8) .gr-result-bar-fill { animation-delay: 210ms; }
.v2-mp-page .gr-result-bar-item:nth-child(9) .gr-result-bar-fill { animation-delay: 240ms; }
.v2-mp-page .gr-result-bar-fill.is-actual { background: var(--v2-green-ring); box-shadow: none; }
.v2-mp-page .gr-result-bar-fill.is-guess { background: var(--v2-red-ring); }
.v2-mp-page .gr-result-modal.is-result-close .gr-result-bar-fill.is-guess { background: var(--v2-gold); }
.v2-mp-page .gr-result-bar-meta img { width: 24px; height: 24px; }

/* Next button: a pill when the host can skip, a quiet status line while it is disabled */
.v2-mp-page .gr-result-next-button {
  align-self: flex-start; justify-self: auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: auto; min-height: 48px; padding: 0 24px; border: 0; border-radius: 999px;
  background: var(--v2-accent); box-shadow: none; filter: none;
  color: #ffffff; font-family: var(--v2-font); font-size: 16px; font-weight: 600; letter-spacing: 0; text-transform: none;
  transition: background-color 150ms var(--v2-ease), transform 120ms var(--v2-ease);
}
.v2-mp-page .gr-result-next-button:hover,
.v2-mp-page .gr-result-next-button:focus-visible { background: var(--v2-accent-hover); box-shadow: none; filter: none; transform: none; }
.v2-mp-page .gr-result-next-button:focus-visible { outline: 2px solid var(--v2-lavender); outline-offset: 3px; }
.v2-mp-page .gr-result-next-button:active { transform: scale(.97); }
.v2-mp-page .gr-result-next-button:disabled,
.v2-mp-page .gr-result-next-button:disabled:hover {
  min-height: 44px; padding: 0 0 0 24px; opacity: 1; filter: none; transform: none; cursor: default;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E") no-repeat left center / 16px 16px;
  color: var(--v2-muted); font-size: 14px; font-weight: 400;
}
.v2-mp-page .gr-result-ad-container { margin: 0; }
.v2-mp-page .gr-result-ad-container:empty { display: none !important; }

/* Game over (1v1 final score) */
.v2-mp-page .gr-result-modal.is-game-over { width: min(640px, calc(100vw - 32px)); }
.v2-mp-page .gr-result-modal.is-game-over .gr-result-inner { max-width: none; padding: 40px; }
.v2-mp-page .gr-result-modal.is-game-over .gr-result-summary { align-items: center; gap: 0; text-align: center; }
.v2-mp-page .gr-result-modal.is-game-over .gr-result-state,
.v2-mp-page .gr-result-modal.is-game-over .gr-result-end-panel { display: contents; }
.v2-mp-page .gr-result-modal.is-game-over .gr-result-state::before { content: "Game over"; order: 0; margin-bottom: 8px; font-size: 14px; font-weight: 500; color: var(--v2-muted); }
.v2-mp-page .gr-result-modal.is-game-over .gr-result-title { order: 1; font-size: 48px; line-height: 1.05; letter-spacing: -0.03em; }
.v2-mp-page .gr-result-modal[data-v2-outcome="won"] .gr-result-title { color: var(--v2-green); }
.v2-mp-page .gr-result-modal[data-v2-outcome="lost"] .gr-result-title { color: var(--v2-red); }
.v2-mp-page .gr-result-score-hero { order: 2; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 28px; }
.v2-mp-page .gr-result-score-value { font-size: 60px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; color: var(--v2-gold); font-variant-numeric: tabular-nums; }
.v2-mp-page .gr-result-score-value span { margin-left: 4px; font-size: 24px; color: var(--v2-muted); }
.v2-mp-page .gr-result-score-progress { display: none; }
.v2-mp-page .gr-result-score-hero.has-v2-split .gr-result-score-value { display: none; }
.v2-mp-final { display: flex; align-items: flex-end; justify-content: center; gap: 32px; }
.v2-mp-final__side { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.v2-mp-final__side span { font-size: 14px; color: var(--v2-muted); }
.v2-mp-final__side b { font-size: 60px; font-weight: 600; line-height: 1; letter-spacing: -0.02em; color: var(--v2-text); font-variant-numeric: tabular-nums; }
.v2-mp-final__side:first-child b { color: var(--v2-gold); }
.v2-mp-final__dash { padding-bottom: 12px; font-size: 30px; color: var(--v2-faint); }
.v2-mp-page .gr-result-modal.is-game-over .gr-result-final-message { order: 3; display: block; max-width: 420px; margin: 28px auto 0; font-size: 16px; font-style: normal; line-height: 1.5; color: var(--v2-muted); }
.v2-mp-page .gr-result-final-message::before,
.v2-mp-page .gr-result-final-message::after { content: none; }
.v2-mp-page .gr-result-modal.is-game-over .gr-result-rounds { order: 4; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 28px; }
.v2-mp-page .gr-result-modal.is-game-over .gr-result-rounds::before { content: "Your points per round"; flex: 0 0 100%; font-size: 12px; color: var(--v2-faint); text-align: center; }
.v2-mp-page .gr-result-round-pill { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; min-height: 0; padding: 8px 12px; border: 0; border-radius: 12px; background: var(--v2-raised); color: var(--v2-faint); font-size: 16px; font-weight: 600; }
.v2-mp-page .gr-result-round-label { font-size: 12px; font-weight: 400; line-height: 1.3; text-transform: none; color: var(--v2-faint); }
.v2-mp-page .gr-result-round-points { line-height: 1.3; font-variant-numeric: tabular-nums; }
.v2-mp-page .gr-result-round-pill.is-perfect,
.v2-mp-page .gr-result-round-pill.is-close { color: var(--v2-gold); }
.v2-mp-page .gr-result-round-pill.is-miss { color: var(--v2-faint); }
.v2-mp-page .gr-result-modal.is-game-over .gr-result-end-actions { order: 5; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }
.v2-mp-page .gr-result-modal.is-game-over .gr-game-over-ad { order: 6; margin-top: 20px; }
/* Button labels arrive as "Play Again" / "Back to Home"; shown in sentence case */
.v2-mp-page .gr-result-end-button {
  display: inline-block; min-height: 48px; padding: 0 24px; border: 0; border-radius: 999px;
  background: var(--v2-raised); box-shadow: inset 0 0 0 1px var(--v2-line);
  color: var(--v2-text) !important; font-family: var(--v2-font); font-size: 16px; font-weight: 600; line-height: 48px;
  text-align: center; text-decoration: none; text-transform: lowercase; white-space: nowrap;
  transition: background-color 150ms var(--v2-ease), transform 120ms var(--v2-ease);
}
.v2-mp-page .gr-result-end-button::first-letter { text-transform: uppercase; }
.v2-mp-page .gr-result-end-button:hover,
.v2-mp-page .gr-result-end-button:focus-visible { background: var(--v2-fill); }
.v2-mp-page .gr-result-end-button:focus-visible { outline: 2px solid var(--v2-lavender); outline-offset: 3px; }
.v2-mp-page .gr-result-end-button:active { transform: scale(.97); }
.v2-mp-page .gr-result-end-actions .gr-result-end-button:first-child { grid-column: auto; min-height: 48px; padding: 0 28px; background: var(--v2-accent); box-shadow: none; color: #ffffff !important; }
.v2-mp-page .gr-result-end-actions .gr-result-end-button:first-child:hover,
.v2-mp-page .gr-result-end-actions .gr-result-end-button:first-child:focus-visible { background: var(--v2-accent-hover); }
.v2-mp-page .gr-result-end-actions .gr-result-end-button:nth-child(2):last-child { grid-column: auto; justify-self: auto; width: auto; }

/* ---------- Phones ---------- */
@media (max-width: 860px) {
  .v2-mp { padding-top: 12px; }
  .v2-mp-lobby { padding-top: 8px; }
  .v2-mp-intro { gap: 8px; }
  .v2-mp-title { font-size: 36px; line-height: 1.1; letter-spacing: -0.02em; }
  .v2-mp-lead { font-size: 16px; }
  .v2-mp-forms { flex-direction: column; gap: 16px; margin-top: 24px; }
  .v2-mp-card { flex: 0 0 auto; gap: 12px; padding: 16px; border-radius: 16px; }
  .v2-mp-card__title { font-size: 16px; }
  .v2-mp-card .v2-pill, .v2-mp-card .v2-mp-btn { min-height: 44px; }

  .v2-mp-wait { margin-top: 8px; padding: 24px 16px; gap: 20px; }
  .v2-mp-wait__head h2 { font-size: 24px; }
  .v2-mp-code { padding: 12px 24px; font-size: 36px; }
  .v2-mp-player__state { flex: 1 1 auto; }
  .v2-mp-player__name { flex: 0 1 auto; }
  .v2-mp-over { margin-top: 8px; padding: 24px 16px; gap: 20px; }
  .v2-mp-page #game-over-content h1 { font-size: 36px !important; }
  .v2-mp-page .game-over-actions { flex-direction: column; align-items: stretch; }

  .v2-mp-top { margin-bottom: 4px; }
  .v2-mp-chip { display: none; }
  .v2-mp-scoreboard { width: 100%; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; padding: 12px 8px; border-radius: 16px; background: var(--v2-card); text-align: center; }
  .v2-mp-score, .v2-mp-round { flex-direction: column; align-items: center; gap: 4px; }
  .v2-mp-round { order: 0; gap: 8px; font-size: 12px; color: var(--v2-faint); }
  .v2-mp-score > span:first-child { font-size: 12px; color: var(--v2-faint); }
  .v2-mp-score > span:last-child { font-size: 24px; }
  .v2-mp-segs span { width: 12px; }
  .v2-mp-page--duel #status-message { margin: 8px 0 12px; }
  .v2-mp-clip #video { border-radius: 16px; }
  .v2-mp-question { margin: 16px 0 8px; gap: 8px; flex-wrap: nowrap; }
  .v2-mp-question h2 { font-size: 16px; }
  .v2-mp-question .v2-mp-points-long { display: none; }
  .v2-mp-question .v2-mp-points-short { display: inline; font-size: 12px; white-space: nowrap; }

  .v2-mp-page #ranks:not(.is-hidden):not([style*="none"]) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .v2-mp-rank { gap: 4px; padding: 8px 4px; border-radius: 12px; }
  .v2-mp-rank img { width: 36px; height: 36px; }
  .v2-mp-page #ranks > img { height: 64px; padding: 8px; border-radius: 12px; }

  .v2-mp-panel { gap: 20px; padding: 20px 16px; }
  .v2-mp-panel__head h2 { font-size: 24px; }
  .v2-mp-panel__head--orb { gap: 16px; }
  .v2-mp-invite { padding: 16px; }
  .v2-mp-invite .invite-box { justify-content: space-between; }
  .v2-mp-page #display-lobby-code { min-height: 44px; }
  .v2-mp-copy { order: 2; min-height: 44px; padding: 0 16px; }
  .v2-mp-page #copy-link-input { order: 3; flex: 1 1 100%; min-height: 44px; padding: 0 12px; }
  .v2-mp-page .host-settings-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .v2-mp-page .host-settings-row .v2-mp-field--game { grid-column: 1 / -1; }
  .v2-mp-page .host-settings-row .v2-mp-select select { padding: 0 36px 0 12px; }
  .v2-mp-page .host-settings-row .v2-mp-field:not(.v2-mp-field--game) .v2-mp-select svg { right: 12px; }
  .v2-mp-start { flex-direction: column; align-items: stretch; }
  .v2-mp-page .btn-start-game { display: block; width: 100%; }
  .v2-mp-start__note { text-align: center; }
  .v2-mp-page #player-wait-message { align-items: flex-start; gap: 12px; padding: 16px; }
  .v2-mp-prompt { margin-top: 8px; padding: 20px 16px; }
  .v2-mp-prompt .gb-title { font-size: 24px; }

  .v2-mp-page .round-status-bar { flex-wrap: nowrap; gap: 12px; margin-bottom: 8px; }
  .v2-mp-page .round-index-badge { font-size: 20px; }
  .v2-timer { padding-right: 12px; white-space: nowrap; }
  .v2-mp-page--group #status-message { margin-bottom: 12px; font-size: 14px; }

  .v2-mp-page .game-over-title { gap: 8px; font-size: 24px; }
  .v2-mp-page .final-scoreboard-table th { padding: 12px; }
  .v2-mp-page .final-scoreboard-table th:first-child { width: 48px; }
  .v2-mp-page .final-scoreboard-table th:last-child { width: 72px; }
  .v2-mp-page #final-scoreboard-body td { height: 52px; padding: 0 12px; font-size: 14px; }
  .v2-mp-page #final-scoreboard-body td:last-child { font-size: 16px; }
  .v2-mp-page .scoreboard-place-badge { width: 28px; height: 28px; }
  .v2-mp-page #gb-finished-view .game-over-actions { flex-direction: column; align-items: stretch; gap: 12px; }
  .v2-mp-page #gb-finished-view .v2-pill, .v2-mp-page #gb-finished-view .v2-mp-btn { width: 100%; }
  .v2-mp-page #player-finish-msg { justify-content: center; }
  .v2-mp-page .sidebar-leaderboard-card { padding: 20px 12px 12px; }
  .v2-mp-board__head { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 4px 12px; }
  .v2-mp-page .sidebar-player-list { margin-top: 8px; }
  .v2-mp-page .player-list-item { min-height: 52px; }
  .v2-mp-alone { margin: 8px 4px 0; }
  .v2-mp__ads .v2-slot { margin-top: 24px; }
}

@media (max-width: 720px) {
  .v2-mp-page .gr-result-backdrop { padding: 8px; }
  .v2-mp-page .gr-result-modal { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .v2-mp-page .gr-result-modal.is-pending,
  .v2-mp-page .gr-result-modal.is-game-over { width: calc(100vw - 16px); }
  .v2-mp-page .gr-result-inner { gap: 16px; padding: 20px 16px; }
  .v2-mp-page .gr-result-modal.is-pending .gr-result-inner { padding: 16px; }
  .v2-mp-page .gr-result-modal.is-pending .gr-result-pending-panel { gap: 16px; }
  .v2-mp-page .gr-result-pending-rank { width: 44px; height: 44px; }
  .v2-mp-page .gr-result-pending-title { font-size: 16px; }
  .v2-mp-page .gr-result-summary { gap: 16px; }
  .v2-mp-page .gr-result-state { flex-direction: column; align-items: flex-start; gap: 4px; }
  .v2-mp-page .gr-result-title { font-size: 20px; }
  .v2-mp-page .gr-result-points { font-size: 16px; }
  .v2-mp-page .gr-result-total-score { margin: 0; }
  .v2-mp-page .gr-result-rank-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .v2-mp-page .gr-result-rank-card { gap: 12px; padding: 12px; }
  .v2-mp-page .gr-result-rank-card img { width: 40px; height: 40px; }
  .v2-mp-page .gr-result-rank-name { font-size: 16px; }
  .v2-mp-page .gr-result-distribution { padding: 16px 0 0; }
  .v2-mp-page .gr-result-distribution-head { flex-direction: row; align-items: baseline; gap: 8px; }
  .v2-mp-page .gr-result-chart { gap: 4px; min-height: 0; }
  .v2-mp-page .gr-result-bar-item { gap: 4px; }
  .v2-mp-page .gr-result-bar-percent { font-size: 12px; }
  .v2-mp-page .gr-result-bar-track { height: 48px; border-radius: 0; }
  .v2-mp-page .gr-result-bar-fill { border-radius: 8px; }
  .v2-mp-page .gr-result-bar-meta img { width: 20px; height: 20px; }
  .v2-mp-page .gr-result-next-button { align-self: stretch; }
  .v2-mp-page .gr-result-next-button:disabled { align-self: center; }

  .v2-mp-page .gr-result-modal.is-game-over .gr-result-inner { padding: 24px 16px; }
  .v2-mp-page .gr-result-modal.is-game-over .gr-result-title { font-size: 36px; line-height: 1.1; }
  .v2-mp-page .gr-result-score-hero { margin-top: 20px; }
  .v2-mp-final { gap: 24px; }
  .v2-mp-final__side b, .v2-mp-page .gr-result-score-value { font-size: 48px; }
  .v2-mp-final__dash { padding-bottom: 8px; font-size: 24px; }
  .v2-mp-page .gr-result-modal.is-game-over .gr-result-final-message,
  .v2-mp-page .gr-result-modal.is-game-over .gr-result-rounds { margin-top: 20px; }
  .v2-mp-page .gr-result-round-pill { min-width: 60px; padding: 8px 0; }
  .v2-mp-page .gr-result-rounds { gap: 8px; }
  .v2-mp-page .gr-result-modal.is-game-over .gr-result-end-actions { flex-direction: column; align-self: stretch; margin-top: 20px; }
}

/* ---------- Keyframes ---------- */
@keyframes v2-orb-breathe { from { transform: scale(1); } to { transform: scale(1.05); } }
@keyframes v2-orbit-a { 0% { transform: rotate(0deg) translateX(16px) scale(1); } 50% { transform: rotate(180deg) translateX(22px) scale(1.15); } 100% { transform: rotate(360deg) translateX(16px) scale(1); } }
@keyframes v2-orbit-b { 0% { transform: rotate(90deg) translateX(18px); } 100% { transform: rotate(450deg) translateX(18px); } }
@keyframes v2-pulse-a { 0% { transform: scale(1); } 35% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes v2-pulse-b { 0% { transform: scale(1); } 35% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes v2-tick-a { from { opacity: 0; transform: translateY(40%); } to { opacity: 1; transform: none; } }
@keyframes v2-tick-b { from { opacity: 0; transform: translateY(40%); } to { opacity: 1; transform: none; } }
@keyframes v2-mp-spring { 0% { transform: scale(.95); } 40% { transform: scale(1.035); } 70% { transform: scale(.995); } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .v2-orb, .v2-orb__blob { animation: none !important; }
  .v2-mp-rank:active, .v2-mp-page #ranks > img:active { transform: none; }
  .v2-mp-handoff { display: none !important; }
}

/* Group Battle lobby: the leaderboard column is hidden until a lobby exists; drop its empty track so the page stays centred. */
.v2-mp--group:has(> #sidebar-section.is-hidden) { grid-template-columns: 160px minmax(0, 792px); grid-template-areas: "rail main" "rail ads"; }
@media (max-width: 1100px) { .v2-mp--group:has(> #sidebar-section.is-hidden) { grid-template-columns: minmax(0, 792px); grid-template-areas: "main" "ads"; } }
@media (max-width: 940px) { .v2-mp--group:has(> #sidebar-section.is-hidden) { grid-template-columns: minmax(0, 1fr); } }

/* iPhone zooms the page when a field under 16px is focused. */
@media (max-width: 640px) { .v2-mp-page #copy-link-input { font-size: 16px; } }
