:root {
  --court: #0f9c8f;
  --court-dark: #08736b;
  --ink: #17212b;
  --muted: #637381;
  --paper: #fffdf8;
  --line: #dce4e8;
  --accent: #f2c04c;
  --power: #ffca8b;
  --precision: #84d6ff;
  --placement: #f8fafc;
  --boost: #c47a9a;
  --danger: #d94b4b;
  --good: #0f8d68;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* V4.47 final light-surface overrides must remain after the legacy tournament theme. */
.competition-dialog-shell { background: #f4f7f6 !important; }
.competition-dialog-scroll,
.competition-dialog-scroll .tournament-panel { background: #fff !important; }
.competition-dialog-scroll .tournament-meta-row .difficulty-reminder { background: #edf3f4 !important; }
.competition-dialog-scroll .tournament-meta-row .weekly-points-reminder { background: #f6d66d !important; }
.competition-dialog-scroll .tournament-panel :is(.tournament-toggle-button, .championship-zone-toggle) { background: #e8f0f2 !important; }
.competition-dialog-scroll .tournament-panel :is(.tournament-match, .tournament-champion, .league-standings, .championship-zone) { background: #f0f4f3 !important; }
.competition-dialog-scroll .tournament-panel .tournament-match.current { background: #f3f8dc !important; }
.competition-dialog-scroll .tournament-panel .tournament-match.final-match { background: #fff7df !important; }
.competition-dialog-scroll .tournament-player-row,
.competition-dialog-scroll .league-standings-row { background: #f8fafb !important; }
.competition-dialog-scroll .tournament-player-row.winner,
.competition-dialog-scroll .league-standings-row.qualified { background: #e5f3ee !important; }
.competition-dialog-scroll :is(.tournament-player-row, .league-standings-row).human-player { background: #fff6dc !important; }
.competition-dialog-scroll .tournament-match-status { background: #e3eaed !important; }
.competition-dialog-scroll .tournament-match-status.live { background: #d9f1e6 !important; }
.competition-dialog-scroll .tournament-match-status.complete { background: #cfe9df !important; }
.competition-dialog-scroll .tournament-score,
.competition-dialog-scroll .tournament-set-scores span { background: #e7edef !important; }
.competition-dialog-scroll .tournament-set-scores.live span { background: #dff2ea !important; }
.competition-dialog-scroll .tournament-set-scores span.winner-set { background: #d5ece3 !important; }
.competition-dialog-scroll .championship-zone-content { background: #f7faf9 !important; }

/* V4.47 readable competition information on every light surface. */
.competition-dialog-shell {
  color: #17212b;
  background: #f4f7f6;
}

.competition-dialog-close {
  color: #fff;
  background: #17384a;
}

.competition-dialog-scroll,
.competition-dialog-scroll .tournament-panel {
  color: #17212b !important;
  background: #fff;
}

.competition-dialog-scroll .tournament-panel :is(h1, h2, h3, h4, p, span, strong, b, small, li, dt, dd, label) {
  color: #17212b !important;
}

.competition-dialog-scroll .tournament-panel :is(
  .eyebrow,
  .difficulty-reminder,
  .tournament-location-reminder,
  .tournament-round-label,
  .tournament-column-title,
  .league-standings-head,
  .championship-empty-round,
  .league-rank
) {
  color: #465b68 !important;
}

.competition-dialog-scroll .tournament-header {
  border-bottom-color: #d5e0e3;
}

.competition-dialog-scroll .tournament-meta-row .difficulty-reminder {
  border-color: #cbd8dc;
  color: #344957 !important;
  background: #edf3f4;
}

.competition-dialog-scroll .tournament-meta-row .weekly-points-reminder {
  border-color: #d4a82d;
  color: #382900 !important;
  background: #f6d66d;
}

.competition-dialog-scroll .tournament-panel :is(.tournament-toggle-button, .championship-zone-toggle) {
  border-color: #bfd1d6;
  color: #17212b !important;
  background: #e8f0f2;
}

.competition-dialog-scroll .tournament-panel button :is(span, strong, b, small) {
  color: inherit !important;
}

.competition-dialog-scroll .tournament-panel :is(.tournament-match, .tournament-champion, .league-standings, .championship-zone) {
  border-color: #cbd8dc;
  color: #17212b !important;
  background: #f0f4f3;
  box-shadow: 0 6px 16px rgba(23, 33, 43, .08);
}

.competition-dialog-scroll .tournament-panel .tournament-match.current {
  border-color: #8aaa39;
  background: #f3f8dc;
}

.competition-dialog-scroll .tournament-panel .tournament-match.final-match {
  border-color: #d1aa43;
  background: #fff7df;
}

.competition-dialog-scroll .tournament-player-row,
.competition-dialog-scroll .league-standings-row {
  border-color: #d8e2e5;
  color: #17212b !important;
  background: #f8fafb;
}

.competition-dialog-scroll .tournament-player-row.winner,
.competition-dialog-scroll .league-standings-row.qualified {
  border-color: #79a895;
  color: #183f35 !important;
  background: #e5f3ee;
  box-shadow: none;
}

.competition-dialog-scroll :is(.tournament-player-row, .league-standings-row).human-player {
  border-color: #c69d2f;
  color: #3d310d !important;
  background: #fff6dc;
}

.competition-dialog-scroll .tournament-match-status {
  color: #41545f !important;
  background: #e3eaed;
}

.competition-dialog-scroll .tournament-match-status.live {
  color: #155e43 !important;
  background: #d9f1e6;
}

.competition-dialog-scroll .tournament-match-status.complete {
  color: #164d3d !important;
  background: #cfe9df;
}

.competition-dialog-scroll .tournament-match-status.upcoming {
  color: #465b68 !important;
  background: #e3eaed;
}

.competition-dialog-scroll .tournament-score,
.competition-dialog-scroll .tournament-set-scores span {
  border-color: #c7d4d8;
  color: #263d49 !important;
  background: #e7edef;
}

.competition-dialog-scroll .tournament-set-scores.live span {
  border-color: #79a895;
  color: #155e43 !important;
  background: #dff2ea;
}

.competition-dialog-scroll .tournament-set-scores span.winner-set {
  border-color: #79a895;
  color: #164d3d !important;
  background: #d5ece3;
  box-shadow: none;
}

.competition-dialog-scroll .championship-zone-toggle > span:first-child,
.competition-dialog-scroll .championship-day > header strong {
  color: #315f52 !important;
}

.competition-dialog-scroll .championship-zone-content {
  color: #17212b;
  background: #f7faf9;
}

.competition-dialog-scroll .championship-day > header,
.competition-dialog-scroll .championship-day > header span {
  color: #465b68 !important;
}

/* V4.28 restored score geometry and overlays ---------------------------- */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .game-app .topbar > div:first-child {
    margin-left: auto;
  }

  body:not(.mobile-game-view) .desktop-game-menu-toggle {
    position: relative;
    z-index: 5;
  }

  body:not(.mobile-game-view) .game-app .top-actions {
    top: calc(100% + 7px);
    right: 0;
    z-index: 420;
    align-items: center;
    width: min(980px, calc(100vw - 24px));
  }

  body:not(.mobile-game-view) .game-app .top-actions > .global-player-dock {
    position: static;
    display: block;
    margin: 0 auto 0 0;
  }

  body:not(.mobile-game-view) .game-app .top-actions > .global-player-dock .global-player-profile {
    min-height: 34px;
    border: 0;
    padding: 0;
    background: transparent;
    opacity: 1;
  }

  body:not(.mobile-game-view) .game-app .top-actions > .global-player-dock .global-player-avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  body:not(.mobile-game-view) .game-app .top-actions > .global-player-dock .global-player-copy small {
    display: none;
  }

  body:not(.mobile-game-view) .desktop-match-score {
    right: 22px;
    left: 22px;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  body:not(.mobile-game-view) .desktop-score-match-column { justify-self: start; }
  body:not(.mobile-game-view) .desktop-exchange-score-line { grid-column: 2; justify-self: center; }
  body:not(.mobile-game-view) .desktop-score-avatar-placeholder { width: 42px; height: 42px; }

  body:not(.mobile-game-view) .court { position: relative; isolation: isolate; }

  body:not(.mobile-game-view) .court-logo-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 0;
    width: clamp(240px, 27vw, 520px);
    max-height: 32%;
    object-fit: contain;
    opacity: .5;
    transform: translate(-50%, -50%);
    pointer-events: none;
  }

  body:not(.mobile-game-view) .court > :not(.court-logo-watermark) {
    position: relative;
    z-index: 2;
  }

  body:not(.mobile-game-view) .game-assist-tools { position: relative; }

  body:not(.mobile-game-view) .game-assist-panel {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    z-index: 440 !important;
    width: min(420px, calc(100vw - 28px)) !important;
    max-height: calc(100dvh - 110px);
    transform: none !important;
  }
}

/* V4.29 history depth, persistent actions and browser-safe score row ---- */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .game-app {
    padding-top: max(8px, env(safe-area-inset-top)) !important;
  }

  body:not(.mobile-game-view) .desktop-match-score {
    top: max(8px, env(safe-area-inset-top));
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] {
    z-index: 80;
  }

  body:not(.mobile-game-view) .court > .log {
    z-index: 30;
  }

  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card-hover-panel,
  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card:hover .card-hover-panel,
  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card:focus-within .card-hover-panel {
    pointer-events: none !important;
  }

  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card-actions {
    position: relative;
    z-index: 210;
    display: flex;
    width: 100%;
    gap: 3px;
    pointer-events: auto !important;
  }

  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card-actions button {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    min-height: 32px;
    padding: 4px 3px;
    pointer-events: auto !important;
  }
}

/* V4.27 compact desktop header and dynamic unusable-card lock ----------- */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .game-app {
    position: relative;
    grid-template-rows: 48px minmax(0, 1fr);
  }

  body:not(.mobile-game-view) .game-app > .topbar {
    position: relative;
    z-index: 310;
    grid-row: 1;
    justify-content: flex-end;
  }

  body:not(.mobile-game-view) .game-app .topbar > div:first-child {
    position: relative;
    z-index: 2;
    gap: 6px;
    margin-left: auto;
  }

  body:not(.mobile-game-view) .game-app .brand-logo {
    height: 30px;
  }

  body:not(.mobile-game-view) .desktop-game-menu-toggle {
    display: grid;
    place-items: center;
    width: 34px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 9px;
    padding: 0;
    color: #fff;
    background: rgba(13, 66, 86, .94);
    font-size: 1.2rem;
    font-weight: 1000;
  }

  body:not(.mobile-game-view) .game-app .top-actions {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    z-index: 1;
    display: none;
    flex-wrap: wrap;
    justify-content: flex-end;
    width: min(760px, calc(100vw - 24px));
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 12px;
    padding: 9px;
    background: #061f30;
    box-shadow: 0 22px 55px rgba(0, 0, 0, .58);
  }

  body:not(.mobile-game-view) .game-app.desktop-game-menu-open .top-actions {
    display: flex;
  }

  body:not(.mobile-game-view) .desktop-match-score {
    position: absolute;
    top: 8px;
    right: 220px;
    left: 22px;
    z-index: 312;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    width: auto;
    max-width: none;
    min-height: 40px;
    padding: 0;
    transform: none;
  }

  body:not(.mobile-game-view) .desktop-match-score-list {
    grid-auto-columns: 72px;
  }

  body:not(.mobile-game-view) .desktop-set-score {
    width: 72px;
    min-height: 36px;
  }

  body:not(.mobile-game-view) .desktop-exchange-score-line {
    grid-template-columns: 42px minmax(136px, 190px) 42px;
    gap: 7px;
  }

  body:not(.mobile-game-view) .desktop-score-avatar {
    width: 42px;
    height: 42px;
  }

  body:not(.mobile-game-view) .court {
    grid-row: 2;
  }

  body:not(.mobile-game-view) .desktop-hand-card--locked .card-visual > img,
  body:not(.mobile-game-view) .desktop-hand-card--locked .card-readable-data {
    filter: grayscale(1) brightness(.62);
    opacity: .64;
  }

  body:not(.mobile-game-view) .desktop-hand-card--locked .card-hover-panel {
    pointer-events: none;
  }

  body:not(.mobile-game-view) .desktop-card-lock {
    position: absolute;
    inset: 0;
    z-index: 18;
    display: grid;
    place-items: center;
    border-radius: inherit;
    color: #fff;
    background: rgba(3, 19, 29, .16);
    filter: drop-shadow(0 3px 7px rgba(0, 0, 0, .9));
    font-size: clamp(1.2rem, 2vw, 2rem);
    pointer-events: none;
  }

  body:not(.mobile-game-view) .card-actions .remise-button strong {
    font-size: .49rem !important;
    letter-spacing: 0 !important;
  }
}

/* V4.25 competition information moved out of the game board ------------ */
.competition-dialog-open {
  overflow: hidden;
}

.competition-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 13, 24, .82);
  backdrop-filter: blur(6px);
}

.competition-dialog-backdrop.hidden {
  display: none;
}

.competition-dialog-shell {
  position: relative;
  display: grid;
  width: min(1180px, 100%);
  max-height: calc(100dvh - 44px);
  overflow: hidden;
  border: 1px solid rgba(140, 224, 191, .34);
  border-radius: 22px;
  background: #062d42;
  box-shadow: 0 34px 100px rgba(0, 0, 0, .62);
}

.competition-dialog-scroll {
  max-height: calc(100dvh - 44px);
  overflow: auto;
  padding: 20px;
  scrollbar-gutter: stable;
}

.competition-dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  color: #fff;
  background: #173f53;
  font-size: 1.7rem;
  line-height: 1;
}

.competition-dialog-scroll .tournament-panel {
  margin: 0;
  padding-top: 52px;
}

.competition-dialog-scroll .tournament-toggle-button[data-toggle-tournament] {
  display: none;
}

@media (max-width: 700px) {
  .competition-dialog-backdrop { padding: 8px; }
  .competition-dialog-shell,
  .competition-dialog-scroll { max-height: calc(100dvh - 16px); }
  .competition-dialog-scroll { padding: 10px; }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(2, 8, 23, 0.28), rgba(2, 8, 23, 0.62)),
    url("./assets/fond-jeu-TENNIS.jpg") center bottom / cover fixed;
}

body.surface-hard {
  background:
    linear-gradient(180deg, rgba(2, 8, 23, 0.28), rgba(2, 8, 23, 0.62)),
    url("./assets/fond-jeu-TENNIS-HARD.jpg") center bottom / cover fixed;
}

body.surface-grass {
  background:
    linear-gradient(180deg, rgba(2, 8, 23, 0.28), rgba(2, 8, 23, 0.62)),
    url("./assets/fond-jeu-TENNIS-GRASS.jpg") center bottom / cover fixed;
}

body.surface-clay {
  background:
    linear-gradient(180deg, rgba(2, 8, 23, 0.28), rgba(2, 8, 23, 0.62)),
    url("./assets/fond-jeu-TENNIS-CLAY.jpg") center bottom / cover fixed;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.app {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.hidden {
  display: none !important;
}

.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.tutorial-dialogue {
  position: fixed;
  right: 0;
  left: 0;
  bottom: 0;
  z-index: 120;
  display: grid;
  grid-template-columns: clamp(145px, 20vw, 270px) minmax(0, 1fr);
  min-height: 200px;
  border-top: 3px solid rgba(255, 255, 255, 0.82);
  background: rgba(6, 30, 45, 0.97);
  color: #fff;
  box-shadow: 0 -16px 38px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
}

.tutorial-dialogue-action {
  pointer-events: none;
}

.tutorial-portrait {
  position: relative;
  min-width: 0;
  overflow: visible;
}

.tutorial-portrait img {
  position: absolute;
  left: 0;
  bottom: 0;
  display: block;
  width: clamp(210px, 25vw, 350px);
  max-height: clamp(300px, 48vh, 450px);
  object-fit: contain;
  object-position: left bottom;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.38));
}

.tutorial-dialogue-content {
  min-width: 0;
  max-height: 42vh;
  overflow: auto;
  padding: 16px clamp(20px, 4vw, 64px) 18px;
}

.tutorial-speaker-line {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  align-items: baseline;
  margin-bottom: 5px;
}

.tutorial-speaker-line strong {
  font-size: 1.05rem;
}

.tutorial-speaker-line span {
  color: #cbd8df;
  font-size: 0.85rem;
}

.tutorial-dialogue h2 {
  margin: 0 0 7px;
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  letter-spacing: 0;
}

.tutorial-copy {
  min-height: 3.2em;
  margin: 0 0 10px;
  max-width: 1000px;
  font-size: clamp(1.08rem, 1.5vw, 1.3rem);
  line-height: 1.48;
}

.tutorial-typewriter-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  background: #f4d54d;
  vertical-align: -0.12em;
  animation: tutorialCaretBlink 0.65s steps(1) infinite;
}

@keyframes tutorialCaretBlink {
  50% { opacity: 0; }
}

.tutorial-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 22px;
  margin: 8px 0 10px;
  padding-left: 20px;
  line-height: 1.35;
}

.tutorial-error {
  width: fit-content;
  margin: 8px 0 0;
  padding: 7px 10px;
  border-left: 4px solid #f2c04c;
  background: rgba(242, 192, 76, 0.14);
  color: #fff4c8;
  font-weight: 750;
}

.tutorial-card-showcase {
  position: fixed;
  top: clamp(64px, 9vh, 105px);
  left: 50%;
  z-index: 115;
  width: clamp(190px, 20vw, 285px);
  transform: translateX(-50%);
  filter: drop-shadow(0 18px 25px rgba(0, 0, 0, 0.5));
}

.tutorial-card-showcase img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 7px;
}

.tutorial-showcase-pointer {
  position: absolute;
  top: 4px;
  display: flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 5px;
  background: #e5312f;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.38);
  animation: tutorialPointerPulse 0.7s ease-in-out infinite alternate;
}

.tutorial-showcase-pointer.cost {
  right: calc(100% - 14px);
}

.tutorial-showcase-pointer.power {
  left: calc(100% - 14px);
}

.tutorial-showcase-pointer.precision,
.tutorial-showcase-pointer.placement {
  left: calc(100% - 14px);
}

.tutorial-showcase-pointer.precision {
  top: 20%;
}

.tutorial-showcase-pointer.placement {
  top: 29%;
}

.tutorial-showcase-pointer.effect,
.tutorial-showcase-pointer.boost {
  right: calc(100% - 14px);
}

.tutorial-showcase-pointer.effect {
  top: 68%;
}

.tutorial-showcase-pointer.boost {
  top: 85%;
}

@keyframes tutorialPointerPulse {
  from { transform: scale(0.96); }
  to { transform: scale(1.04); }
}

.tutorial-focus-target {
  position: relative;
  z-index: 80;
  outline: 4px solid #f4d54d;
  outline-offset: 4px;
  box-shadow: 0 0 0 8px rgba(244, 213, 77, 0.2), 0 0 28px rgba(244, 213, 77, 0.8) !important;
  animation: tutorialFocusPulse 0.85s ease-in-out infinite alternate;
}

.tutorial-showcase-pointer.tutorial-focus-target {
  position: absolute;
}

.tutorial-action-target::before {
  position: absolute;
  top: -34px;
  left: 50%;
  z-index: 3;
  width: 0;
  height: 0;
  border-right: 13px solid transparent;
  border-left: 13px solid transparent;
  border-top: 22px solid #e5312f;
  content: "";
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
  transform: translateX(-50%);
}

@keyframes tutorialFocusPulse {
  from { outline-color: #f4d54d; }
  to { outline-color: #fff3a6; }
}

.tutorial-selectable-card {
  cursor: pointer;
}

.tutorial-card-selector {
  position: absolute;
  inset: 0;
  z-index: 70;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: transparent;
}

.tutorial-card-selector:focus-visible {
  outline: 4px solid #48a9ff;
  outline-offset: 4px;
}

.tutorial-selected-card {
  outline: 4px solid #48a9ff;
  outline-offset: 4px;
  box-shadow: 0 0 0 8px rgba(72, 169, 255, 0.22), 0 0 26px rgba(72, 169, 255, 0.76);
}

.tutorial-click-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  margin-right: 10px;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 18px solid #ff2f1f;
  filter: drop-shadow(0 0 6px rgba(255, 95, 0, 0.75));
  animation: tutorialArrowPulse 0.75s ease-in-out infinite alternate;
  vertical-align: middle;
}

@keyframes tutorialArrowPulse {
  from {
    transform: translateX(-4px);
    border-left-color: #ff2f1f;
  }

  to {
    transform: translateX(5px);
    border-left-color: #ff9d22;
  }
}

.tutorial-kicker,
.tutorial-action {
  margin: 0 0 5px;
  color: #f4d54d;
  font-weight: 900;
  text-transform: uppercase;
}

.tutorial-action {
  margin-top: 9px;
}

.tutorial-next-button {
  position: sticky;
  bottom: 0;
  z-index: 2;
  min-width: 150px;
  margin-top: 5px;
  pointer-events: auto;
}

.tutorial-wait {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 8px 0 0;
  color: #fff3a6;
  font-weight: 850;
}

.tutorial-wait span {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.32);
  border-top-color: #f4d54d;
  border-radius: 50%;
  animation: tutorialWaitSpin 0.7s linear infinite;
}

@keyframes tutorialWaitSpin {
  to { transform: rotate(360deg); }
}

body.tutorial-running .scoreboard,
body.tutorial-running .played-history {
  display: none;
}

body.tutorial-interface-tour .scoreboard,
body.tutorial-interface-tour .played-history {
  display: grid;
}

body.tutorial-interface-tour .tutorial-dialogue-content {
  max-height: 50vh;
}

body.tutorial-readonly .game-app button:not(.tutorial-next-button) {
  pointer-events: none;
}

body.tutorial-running .app {
  padding-top: 10px;
}

body.tutorial-running .court {
  min-height: 470px;
}

body.tutorial-running .player-panel {
  padding: 10px;
}

body.tutorial-running .player-header {
  margin-bottom: 6px;
}

body.tutorial-running .character-zone {
  gap: 8px;
  margin-bottom: 7px;
}

body.tutorial-running .character-card {
  width: 72px;
}

body.tutorial-running .character-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

body.tutorial-running .character-power-reminder,
body.tutorial-running .character-endurance-reminder {
  min-width: 68px;
  min-height: 62px;
  padding: 5px;
}

body.tutorial-running .hand {
  grid-template-columns: repeat(6, minmax(58px, 1fr));
  gap: 6px;
}

body.tutorial-running .card.has-visual {
  gap: 4px;
  padding: 4px;
}

body.tutorial-running .card-actions {
  gap: 3px;
}

body.tutorial-running .play-button,
body.tutorial-running .boost-button {
  min-height: 30px;
}

body.tutorial-running .play-button span,
body.tutorial-running .boost-button span {
  font-size: 0.58rem;
}

body.tutorial-running .play-button strong,
body.tutorial-running .boost-button strong {
  font-size: 0.68rem;
}

@media (max-width: 760px) {
  .tutorial-dialogue {
    grid-template-columns: clamp(100px, 28vw, 138px) minmax(0, 1fr);
    min-height: 190px;
  }

  .tutorial-portrait img {
    width: clamp(145px, 40vw, 205px);
    max-height: 270px;
  }

  .tutorial-dialogue-content {
    max-height: 48vh;
    padding: 12px 12px 14px;
  }

  .tutorial-dialogue h2 {
    font-size: 1.08rem;
  }

  .tutorial-copy,
  .tutorial-action,
  .tutorial-error,
  .tutorial-summary,
  .tutorial-wait {
    font-size: 0.98rem;
  }

  .tutorial-summary {
    grid-template-columns: 1fr;
  }

  .tutorial-card-showcase {
    top: 54px;
    width: clamp(140px, 38vw, 185px);
  }

  .tutorial-showcase-pointer {
    min-height: 25px;
    padding: 4px 6px;
    font-size: 0.65rem;
  }

  body.tutorial-running .hand {
    grid-template-columns: repeat(3, minmax(62px, 1fr));
  }
}

.menu-screen {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 36px 0;
}

.menu-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
}

.menu-shell > * {
  min-width: 0;
}

.menu-logo {
  width: min(620px, 72vw);
}

.menu-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(260px, 0.8fr) minmax(340px, 1.25fr);
  gap: 16px;
  align-items: start;
}

.online-lobby-panel,
.latest-news-panel,
.lobby-poster-panel,
.weekly-circuit-panel,
.ranking-panel {
  grid-column: 1 / -1;
}

.lobby-poster-panel {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(2, 8, 23, 0.22);
}

.lobby-poster-panel img {
  display: block;
  width: 100%;
  aspect-ratio: 1000 / 563;
  object-fit: cover;
}

.latest-news-panel {
  display: grid;
  gap: 10px;
}

.latest-news-heading {
  margin: 0;
  color: #102a43;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
}

.latest-news-item {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 68px;
  border-top: 1px solid rgba(16, 42, 67, 0.18);
  padding-top: 10px;
}

.latest-news-thumbnail {
  width: 50px;
  height: 50px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.96);
  border-radius: 8px;
  background: #dff6f2;
  box-shadow: 0 5px 14px rgba(10, 32, 44, 0.2);
}

.latest-news-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 12%;
  transform: scale(1.85);
  transform-origin: 50% 16%;
}

.latest-news-summary {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.latest-news-summary time {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.latest-news-title {
  width: fit-content;
  max-width: 100%;
  padding: 0;
  color: #0b3448;
  background: transparent;
  font-size: 0.95rem;
  font-weight: 950;
  line-height: 1.25;
  text-align: left;
}

.latest-news-title:hover,
.latest-news-title:focus-visible {
  color: #0f8d68;
  text-decoration: underline;
}

.latest-news-read-button {
  align-self: end;
  justify-self: end;
  border-radius: 8px;
  padding: 8px 16px;
  color: #3f2d00;
  background: #facc15;
  box-shadow: 0 5px 12px rgba(161, 98, 7, 0.24);
  font-size: 0.78rem;
  font-weight: 950;
}

.latest-news-read-button:hover,
.latest-news-read-button:focus-visible {
  background: #fde047;
}

@media (max-width: 560px) {
  .latest-news-item {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .latest-news-read-button {
    grid-column: 2;
  }
}

.friendly-lobby-shell {
  max-width: 1120px;
}

.friendly-lobby-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.brand-home-button {
  display: block;
  width: fit-content;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

.brand-home-button:focus-visible {
  outline: 3px solid #e9ff70;
  outline-offset: 5px;
}

.friendly-lobby-panel {
  display: grid;
  gap: 18px;
}

.friendly-lobby-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.friendly-lobby-title h1 {
  margin: 0;
  color: #17212b;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  letter-spacing: 0;
}

.friendly-lobby-title p {
  margin: 6px 0 0;
  color: #425466;
  font-weight: 800;
}

.friendly-lobby-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.friendly-lobby-action-panel {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(140px, auto);
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(99, 115, 129, 0.22);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.friendly-lobby-player-actions {
  margin-top: 12px;
}

.friendly-lobby-start-button,
.friendly-lobby-exit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  visibility: visible;
}

.friendly-lobby-start-button:disabled {
  color: #475569;
  background: #cbd5e1;
  cursor: not-allowed;
  opacity: 1;
}

.lobby-room-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.lobby-room-actions .admin-lobby-delete-button {
  color: #fff;
  background: #b91c1c;
}

.lobby-room-actions .friendly-spectator-button,
.lobby-room-actions .friendly-resume-button,
.profile-watch-button {
  color: #fff;
  background: #0f8d68;
}

.friendly-lobby-action-panel .friendly-lobby-exit-button {
  color: #fff;
  background: #b91c1c;
}

.friendly-player-grid,
.friendly-bracket-grid {
  display: grid;
  gap: 10px;
}

.friendly-player-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.friendly-player-card,
.friendly-bracket-card {
  border: 1px solid rgba(99, 115, 129, 0.22);
  border-radius: 8px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.82);
}

.friendly-club-house-photo {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(99, 115, 129, 0.28);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(2, 8, 23, 0.2);
}

.friendly-club-house-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 1000 / 563;
  object-fit: cover;
}

.friendly-player-card strong,
.friendly-bracket-card strong {
  display: block;
  color: #17212b;
}

.friendly-player-card span,
.friendly-bracket-card span {
  color: #425466;
  font-size: 0.8rem;
  font-weight: 800;
}

.friendly-bracket-card .friendly-bracket-player-name,
.friendly-bracket-card .friendly-bracket-winner {
  display: block;
  margin-top: 3px;
  color: #17212b;
  font-size: 0.94rem;
}

.friendly-bracket-card .friendly-bracket-player-name {
  font-weight: 650;
}

.friendly-bracket-card .friendly-bracket-winner {
  font-weight: 950;
}

.friendly-lobby-status {
  border: 1px solid rgba(14, 116, 144, 0.26);
  border-radius: 8px;
  padding: 12px;
  color: #0f172a;
  background: rgba(236, 253, 245, 0.9);
  font-weight: 900;
}

.friendly-settings-panel {
  display: grid;
  gap: 12px;
  border-top: 3px solid #0f8d68;
  padding-top: 14px;
}

.friendly-setting-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.8fr) minmax(280px, 1.4fr);
  gap: 16px;
  align-items: center;
}

.friendly-setting-row > div:first-child {
  display: grid;
  gap: 3px;
}

.friendly-setting-row strong {
  color: #17212b;
}

.friendly-setting-row span {
  color: #526170;
  font-size: 0.8rem;
  font-weight: 800;
}

.friendly-setting-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  background: #e2e8f0;
}

.friendly-setting-switch.three-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.friendly-setting-switch.four-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.friendly-setting-switch.five-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.friendly-setting-switch.five-options.reward-visible {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.friendly-setting-switch.six-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.friendly-setting-switch.seven-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.friendly-setting-switch.seven-options .friendly-setting-button:nth-child(4) {
  border-right: 0;
}

.friendly-setting-switch.seven-options .friendly-setting-button:nth-child(-n + 4) {
  border-bottom: 1px solid #94a3b8;
}

.friendly-setting-switch.seven-options .friendly-setting-button:nth-child(7) {
  grid-column: span 2;
  border-right: 0;
}

.friendly-setting-switch.six-options .friendly-setting-button:nth-child(3) {
  border-right: 0;
}

.friendly-setting-switch.six-options .friendly-setting-button:nth-child(-n + 3) {
  border-bottom: 1px solid #94a3b8;
}

.friendly-setting-row.setting-disabled {
  opacity: 0.48;
}

.friendly-setting-row.setting-disabled .friendly-setting-button {
  cursor: not-allowed;
}

.page-return-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.friendly-setting-button {
  min-width: 0;
  min-height: 42px;
  border: 0;
  border-right: 1px solid #94a3b8;
  padding: 8px 10px;
  color: #475569;
  background: #e2e8f0;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 950;
  cursor: pointer;
}

.friendly-setting-button:last-child {
  border-right: 0;
}

.friendly-setting-button.active {
  color: #fff;
  background: #0f8d68;
}

.friendly-setting-button:disabled {
  cursor: default;
  opacity: 1;
}

.friendly-settings-panel.locked .friendly-setting-button:not(.active) {
  color: #64748b;
  background: #e5e7eb;
}

.ai-club-house-panel {
  gap: 16px;
}

.ai-club-house-photo img {
  max-height: 300px;
}

.ai-club-house-settings {
  gap: 9px;
  padding-top: 11px;
}

.ai-club-house-settings .friendly-setting-row {
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.38);
}

.ai-club-house-settings .friendly-setting-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.ai-club-house-settings .friendly-setting-button {
  min-height: 34px;
  padding: 5px 7px;
  font-size: 0.7rem;
  touch-action: manipulation;
}

.ai-club-house-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, auto);
  gap: 12px;
  align-items: stretch;
}

.ai-club-house-footer .friendly-lobby-status {
  display: flex;
  align-items: center;
  padding: 9px 10px;
  font-size: 0.82rem;
}

.ai-club-house-start-button {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 0.82rem;
}

.opponent-hand-reveal-controls {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(560px, calc(100vw - 28px));
  border: 2px solid #e9ff70;
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  background: rgba(6, 30, 45, 0.96);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  transform: translateX(-50%);
}

.opponent-hand-reveal-controls strong {
  flex: 1;
  font-size: 0.88rem;
}

.opponent-hand-reveal-controls button {
  min-width: 230px;
}

.confrontation-intro-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.5);
}

.confrontation-intro {
  width: min(760px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 2px solid rgba(233, 255, 112, 0.72);
  border-radius: 8px;
  padding: 20px;
  color: #fff;
  text-align: center;
  background: rgba(6, 30, 45, 0.96);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
}

.confrontation-intro-tournament,
.confrontation-intro-type,
.confrontation-intro-rivalry {
  margin: 0;
  font-weight: 950;
}

.confrontation-intro-tournament {
  color: #e9ff70;
  font-size: 1.05rem;
}

.confrontation-intro-type {
  margin-top: 6px;
  font-size: 1.3rem;
  text-transform: uppercase;
}

.confrontation-intro-versus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}

.confrontation-intro-player {
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 0;
}

.confrontation-intro-player img {
  display: block;
  width: min(230px, 100%);
  aspect-ratio: 731 / 1039;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.38);
}

.confrontation-intro-player strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.confrontation-player-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
}

.confrontation-intro-player .confrontation-player-rank {
  color: #e9ff70;
  font-size: 1.15rem;
  font-weight: 950;
}

.confrontation-intro-countdown {
  display: grid;
  justify-items: center;
  gap: 3px;
}

.confrontation-intro-countdown strong {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 3px solid #e9ff70;
  border-radius: 50%;
  color: #e9ff70;
  font-size: 2.5rem;
  line-height: 1;
}

.confrontation-intro-countdown span {
  color: #cbd8df;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.confrontation-intro-rivalry {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 12px;
  margin: 16px auto 0;
  border-radius: 8px;
  padding: 8px 12px;
  color: #102a43;
  background: #e9ff70;
}

.confrontation-intro-rivalry > span:first-child,
.confrontation-intro-rivalry > strong { font-weight: 1000; }

.confrontation-intro-rivalry .confrontation-trend { min-width: 0; }
.confrontation-intro-rivalry .confrontation-result.victory { color: #16a34a; }
.confrontation-intro-rivalry .confrontation-result.defeat { color: #ef4444; }

.confrontation-intro-rivalry.bete-noire,
.confrontation-intro-rivalry.ascendant-negative {
  color: #fff;
  background: #b91c1c;
}

.friendly-player-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.friendly-player-card.selectable {
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.friendly-player-card.selectable:hover,
.friendly-player-card.selectable:focus-visible {
  border-color: #0f8d68;
  box-shadow: 0 0 0 3px rgba(15, 141, 104, 0.14);
  outline: none;
}

.friendly-player-card.selected {
  border-color: #0f8d68;
  background: #dff8ee;
  box-shadow: inset 4px 0 0 #0f8d68;
}

.ai-club-house-save-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.ai-club-house-save-actions.hidden { display: none; }
.replay-match-button { width: 100%; margin-top: 12px; }

.friendly-player-card > div {
  min-width: 0;
}

.friendly-player-card .friendly-kick-button {
  flex: 0 0 auto;
  color: #fff;
  background: #b91c1c;
}

.friendly-league-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.friendly-league-group {
  border: 1px solid rgba(99, 115, 129, 0.22);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.82);
}

.friendly-league-group h3 {
  margin: 0 0 9px;
  color: #17212b;
  font-size: 1rem;
}

.friendly-standing-head,
.friendly-standing-row {
  display: grid;
  grid-template-columns: 22px minmax(90px, 1fr) 46px 58px 58px;
  gap: 8px;
  align-items: center;
}

.friendly-standing-head {
  padding: 0 0 6px;
  color: #6b7785;
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.friendly-standing-row {
  border-top: 1px solid rgba(99, 115, 129, 0.18);
  padding: 8px 0;
  color: #526170;
  font-size: 0.78rem;
  font-weight: 800;
}

.friendly-standing-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #17212b;
}

.friendly-standing-head > span:nth-child(n + 3),
.friendly-standing-row > span:nth-child(n + 3),
.friendly-standing-points {
  text-align: right;
  white-space: nowrap;
}

.friendly-standing-points {
  color: #0f766e;
}

.friendly-master-standing .friendly-standing-head,
.friendly-master-standing .friendly-standing-row {
  grid-template-columns: 24px minmax(118px, 1fr) repeat(4, minmax(58px, 70px));
  column-gap: 10px;
}

.friendly-master-standing .friendly-standing-head > span:nth-child(n + 3),
.friendly-master-standing .friendly-standing-row > :nth-child(n + 3) {
  display: block;
  width: 100%;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.friendly-master-calendar {
  display: grid;
  gap: 12px;
}

.friendly-master-calendar-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.friendly-master-calendar-columns > section {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 220px;
}

.friendly-master-calendar-columns h3 {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0;
  border-radius: 10px;
  padding: 10px 12px;
  color: #fff;
  background: #103f58;
  text-align: center;
}

.friendly-master-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(15, 141, 104, .28);
  border-radius: 16px;
  padding: 18px;
  color: #173b50;
  background: #eff8f4;
}

.friendly-master-controls h2,
.friendly-master-controls p {
  margin: 0;
}

.friendly-master-control-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.friendly-draw-panel {
  text-align: center;
}

.friendly-draw-current {
  display: grid;
  gap: 8px;
  min-height: 92px;
  place-content: center;
  margin: 22px 0 14px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  color: #102f3a;
}

.friendly-draw-current strong {
  font-size: clamp(1.35rem, 4vw, 2.2rem);
}

.friendly-draw-current span,
.friendly-draw-progress {
  color: #31515b;
  font-weight: 800;
}

.online-clubhouse-room-panel .friendly-master-controls,
.online-clubhouse-room-panel .friendly-master-controls *,
.online-clubhouse-room-panel .friendly-master-board,
.online-clubhouse-room-panel .friendly-master-board * {
  color: #173b50 !important;
}

.friendly-league-schedule {
  display: grid;
  gap: 10px;
}

.friendly-league-day-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  border-top: 1px solid rgba(99, 115, 129, 0.22);
  padding-top: 10px;
}

.friendly-league-day-row h3,
.friendly-league-knockout-row h3,
.friendly-league-champion h3 {
  margin: 0;
  color: #17212b;
  font-size: 0.9rem;
}

.friendly-league-day-row > h3 {
  display: flex;
  align-items: center;
}

.friendly-league-day-matches {
  display: grid;
  grid-template-columns: repeat(4, minmax(175px, 1fr));
  gap: 9px;
}

.friendly-league-knockout-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(190px, 1fr) minmax(150px, 0.7fr);
  gap: 12px;
  border-top: 3px solid #0f8d68;
  padding-top: 12px;
}

.friendly-league-knockout-row > div {
  display: grid;
  align-content: start;
  gap: 8px;
}

.friendly-league-knockout-matches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 9px;
}

.friendly-league-champion {
  min-height: 120px;
  place-items: center;
  border: 1px solid rgba(15, 141, 104, 0.35);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  background: rgba(236, 253, 245, 0.9);
}

.friendly-league-champion strong {
  color: #0f766e;
  font-size: 1rem;
}

.friendly-bracket-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.friendly-bracket-live-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  min-height: 34px;
}

.friendly-bracket-live-row .friendly-live-score {
  color: #b91c1c;
  font-weight: 950;
}

.friendly-bracket-live-row .friendly-watch-button {
  flex: 0 0 auto;
  color: #fff;
  background: #0369a1;
}

.spectator-live-banner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  border: 2px solid #0e7490;
  border-radius: 8px;
  padding: 12px 14px;
  color: #0f172a;
  background: #ecfeff;
  font-weight: 850;
}

.spectator-live-banner strong {
  color: #0e7490;
}

.top-actions .spectator-quit-button {
  color: #fff;
  background: #b91c1c;
}

body.spectator-mode .game-app button:not(#spectatorQuitButton):not([data-image-zoom]) {
  display: none !important;
}

body.spectator-mode .game-app [data-image-zoom] {
  cursor: zoom-in;
}

body.spectator-mode .player-panel {
  cursor: default;
}

.menu-panel {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  padding: 16px;
  background: rgba(244, 250, 250, 0.9);
  box-shadow: 0 18px 44px rgba(2, 8, 23, 0.22);
}

.auth-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(99, 115, 129, 0.18);
}

.auth-form,
.auth-actions {
  display: grid;
  gap: 10px;
}

.link-button {
  width: max-content;
  padding: 0;
  color: #0f5f8d;
  font-weight: 900;
  text-decoration: underline;
  background: transparent;
}

.auth-status {
  min-height: 38px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(217, 75, 75, 0.32);
  border-radius: 8px;
  padding: 8px 10px;
  color: #7a2424;
  font-weight: 900;
  background: rgba(255, 239, 239, 0.94);
}

.auth-status.connected {
  border-color: rgba(15, 141, 104, 0.34);
  color: #0f684f;
  background: rgba(216, 243, 220, 0.96);
}

.pro-code-panel {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(250, 204, 21, 0.45);
  border-radius: 8px;
  padding: 10px;
  background: rgba(254, 249, 195, 0.86);
}

.pro-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.pro-code-row input {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 950;
}

.pro-code-status {
  min-height: 1.2em;
  margin: 0;
  color: #7c4a03;
  font-size: 0.84rem;
  font-weight: 900;
}

.admin-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(14, 116, 144, 0.28);
  border-radius: 8px;
  padding: 10px;
  background: rgba(219, 244, 255, 0.84);
}

.admin-panel:empty { display: none; }

.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-users-list {
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}

.admin-shell {
  max-width: 1180px;
}

.admin-management-panel {
  display: grid;
  gap: 16px;
}

.admin-management-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.admin-management-header h1 {
  margin: 0;
  color: #17212b;
}

.admin-users-table {
  display: grid;
  gap: 6px;
}

.admin-table-head,
.admin-table-row {
  display: grid;
  grid-template-columns: 70px minmax(130px, 1fr) minmax(200px, 1.35fr) 110px 88px 96px 150px 104px;
  gap: 10px;
  align-items: center;
  border-radius: 8px;
  padding: 10px 12px;
}

.admin-table-head {
  color: #536272;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
  background: rgba(232, 240, 244, 0.92);
}

.admin-table-row {
  color: #17212b;
  font-weight: 850;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(99, 115, 129, 0.14);
}

.admin-table-row span,
.admin-table-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-table-row select {
  min-height: 36px;
  border: 1px solid rgba(99, 115, 129, 0.28);
  border-radius: 8px;
  color: #17212b;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  background: #fff;
}

.admin-points-control {
  display: grid;
  grid-template-columns: minmax(64px, 1fr) 48px;
  gap: 6px;
  align-items: center;
}

.admin-points-control input {
  min-width: 0;
  min-height: 36px;
  border: 1px solid rgba(99, 115, 129, 0.28);
  border-radius: 8px;
  color: #17212b;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  padding: 0 8px;
  background: #fff;
}

.admin-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  color: #17212b;
  font-weight: 950;
}

.admin-management-header.compact {
  margin-top: 20px;
}

.admin-codes-panel,
.admin-codes-list {
  display: grid;
  gap: 10px;
}

.admin-code-head,
.admin-code-row {
  display: grid;
  grid-template-columns: 120px 120px minmax(0, 1fr) 110px;
  gap: 10px;
  align-items: center;
}

.admin-code-head {
  color: #536272;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.admin-code-row {
  border-radius: 8px;
  padding: 10px 12px;
  color: #17212b;
  font-weight: 850;
  background: rgba(236, 253, 245, 0.9);
  border: 1px solid rgba(16, 185, 129, 0.32);
}

.admin-code-row.used {
  color: #64748b;
  background: rgba(241, 245, 249, 0.92);
  border-color: rgba(148, 163, 184, 0.4);
}

.admin-code-row select {
  min-width: 0;
  min-height: 38px;
  border: 1px solid rgba(15, 125, 98, .28);
  border-radius: 8px;
  padding: 0 9px;
  color: #173b4e;
  background: #fff;
  font: inherit;
  font-size: .78rem;
  font-weight: 900;
}

.admin-code-row select:disabled {
  color: #64748b;
  background: #e2e8f0;
  cursor: not-allowed;
  opacity: .78;
}

.admin-assign-shell {
  max-width: 760px;
}

.admin-assign-panel {
  gap: 24px;
}

.admin-assign-form {
  display: grid;
  gap: 16px;
  max-width: 560px;
}

.admin-assign-form .menu-field > span {
  color: #64748b;
  font-size: .72rem;
  font-weight: 750;
  text-transform: none;
}

.admin-assign-form input {
  color: #17212b;
  background: #fff;
}

.admin-assign-form .primary-button {
  justify-self: start;
  min-width: 160px;
}

.admin-assign-status {
  min-height: 1.4em;
  margin: 0;
  color: #173b4e;
  font-weight: 850;
}

.admin-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(99, 115, 129, 0.18);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.admin-user-row strong,
.admin-user-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-row strong {
  color: #17212b;
  font-size: 0.88rem;
  font-weight: 950;
}

.admin-user-row span,
.admin-empty,
.access-note {
  color: #536272;
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-user-row select {
  min-height: 34px;
  border: 1px solid rgba(99, 115, 129, 0.28);
  border-radius: 8px;
  color: #17212b;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  background: #fff;
}

.menu-field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #314256;
  font-size: 0.82rem;
  font-weight: 850;
}

.menu-field input,
.create-online-row select {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(99, 115, 129, 0.28);
  border-radius: 8px;
  padding: 0 10px;
  color: #17212b;
  font: inherit;
  font-weight: 750;
  background: rgba(255, 255, 255, 0.95);
}

.coach-choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.coach-choice {
  display: grid;
  gap: 8px;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 8px;
  color: #17212b;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 8px 20px rgba(2, 8, 23, 0.12);
}

.coach-choice.active {
  border-color: #e9ff70;
  background: rgba(216, 243, 220, 0.96);
}

.coach-choice img {
  width: 100%;
  aspect-ratio: 0.7;
  object-fit: cover;
  border-radius: 7px;
}

.coach-choice span {
  font-weight: 950;
}

.menu-actions,
.create-online-row {
  display: grid;
  gap: 10px;
}

.menu-mode-group {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.08);
}

.menu-mode-group .label {
  margin-bottom: 0;
}

.menu-mode-group.locked,
.online-lobby-panel.locked {
  opacity: 0.58;
}

.menu-mode-group.locked button,
.online-lobby-panel.locked button,
.online-lobby-panel.locked select {
  cursor: not-allowed;
}

.weekly-competitions-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.weekly-competition {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  border-radius: 8px;
  padding: 8px 10px;
  color: #17212b;
  font-size: 0.78rem;
  font-weight: 850;
  background: rgba(255, 255, 255, 0.78);
}

.weekly-competition-counter {
  grid-column: 1 / -1;
  border-radius: 8px;
  padding: 8px 10px;
  color: #102a43;
  font-size: 0.78rem;
  font-weight: 900;
  background: rgba(233, 255, 112, 0.86);
}

.weekly-competition strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

.weekly-competition span {
  white-space: normal;
  line-height: 1.25;
}

.weekly-competition-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.weekly-competition .replay-button {
  color: #fff;
  background: #dc2626;
}

.weekly-competition .replay-button:disabled {
  color: #64748b;
  background: #cbd5e1;
}

.resume-button {
  color: #fff;
  background: #16a34a;
}

.danger-button {
  color: #fff;
  background: #b91c1c;
}

.admin-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.ranking-ai-name {
  color: #475569;
}

.lobby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.lobby-rooms {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.lobby-room {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(99, 115, 129, 0.22);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.78);
}

.lobby-room strong,
.lobby-empty {
  color: #17212b;
}

.lobby-room span,
.lobby-empty {
  font-size: 0.82rem;
  font-weight: 750;
}

.friendly-status-banner {
  margin: 10px 0 12px;
  border: 1px solid rgba(14, 116, 144, 0.26);
  border-radius: 8px;
  padding: 10px 12px;
  color: #0f172a;
  background: rgba(236, 253, 245, 0.9);
  font-size: 0.84rem;
  font-weight: 900;
}

.ranking-list {
  display: grid;
  gap: 6px;
}

.ranking-head,
.ranking-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 84px 84px 84px;
  gap: 8px;
  align-items: center;
  border-radius: 8px;
  padding: 8px 10px;
}

.ranking-head {
  color: #536272;
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
  background: rgba(232, 240, 244, 0.86);
}

.ranking-row {
  color: #17212b;
  font-weight: 850;
  background: rgba(255, 255, 255, 0.78);
}

.ranking-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  min-width: 0;
}

.ranking-projection {
  display: inline-block;
  margin-left: 3px;
  font-size: 0.68em;
  font-weight: 500;
  color: #536272;
}

.ranking-projection-down {
  color: #d83a35;
}

.ranking-name-button {
  appearance: none;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: 950;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
  line-height: 1.12;
}

.ranking-row.current-user {
  border: 2px solid #e9ff70;
  background: rgba(216, 243, 220, 0.94);
}

.ranking-meta {
  color: #536272;
  font-size: 0.75rem;
  font-weight: 850;
  text-align: right;
}

.ranking-current-label {
  margin-top: 10px;
  color: #17212b;
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.ranking-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.ranking-pagination span {
  min-width: 92px;
  color: #17212b;
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
}

.ranking-points-heading {
  display: grid;
  line-height: 1.05;
}

.ranking-points-heading small {
  font-size: 0.72em;
  font-weight: 850;
}

.ranking-sort-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.ranking-sort-controls .active {
  color: #fff;
  background: #167d62;
}

.season-one-button {
  color: #fff;
  background: #b91c1c;
  border-color: #7f1d1d;
}

.admin-profile-tools {
  border: 2px solid rgba(185, 28, 28, 0.35);
}

.admin-score-periods {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.admin-score-period {
  display: grid;
  gap: 6px;
  color: #536272;
  font-size: 0.74rem;
  font-weight: 850;
}

.admin-score-period input {
  min-width: 0;
  min-height: 38px;
  border: 1px solid rgba(99, 115, 129, 0.28);
  border-radius: 8px;
  padding: 0 8px;
  color: #17212b;
  font: inherit;
  font-size: 0.9rem;
  background: #fff;
}

.admin-ai-season-total {
  max-width: 280px;
  margin: 4px 0 18px;
  border-left: 4px solid #9e4766;
  padding: 12px;
  background: #fff4f7;
}

.profile-honor-row {
  margin-top: 6px;
  border-left: 5px solid #f4c430;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-card {
  display: grid;
  gap: 10px;
  border-radius: 8px;
  padding: 14px;
  color: #17212b;
  background: rgba(255, 255, 255, 0.82);
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.profile-stat {
  border-radius: 8px;
  padding: 8px 10px;
  color: #102a43;
  background: rgba(233, 255, 112, 0.55);
}

.profile-stat span {
  display: block;
  color: #536272;
  font-size: 0.72rem;
  font-weight: 900;
}

.profile-stat strong {
  font-size: 1rem;
}

.profile-current-week-points dd {
  display: flex;
  align-items: baseline;
  gap: .3em;
}

.profile-current-week-points dd > small {
  font-size: .46em;
  font-weight: 800;
  opacity: .72;
}

.profile-current-week-points > em {
  display: flex;
  gap: .35em;
  font-size: .72rem;
  font-style: normal;
}

.profile-current-week-points > em span:last-child {
  opacity: .68;
}

.profile-character-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  border-radius: 8px;
  padding: 10px;
  background: rgba(16, 42, 67, 0.08);
}

.profile-character-visuals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.profile-character-visual {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(23, 33, 43, 0.14);
  border-radius: 8px;
  padding: 0;
  background: #e8f3ef;
  box-shadow: 0 8px 16px rgba(10, 32, 44, 0.16);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.profile-character-visual:hover,
.profile-character-visual:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(10, 32, 44, 0.24);
}

.profile-character-visual img {
  display: block;
  width: 100%;
  aspect-ratio: 731 / 1039;
  object-fit: cover;
  image-rendering: auto;
}

.profile-character-summary > strong {
  text-align: center;
  font-size: 0.9rem;
}

.profile-character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.profile-character-choice {
  display: grid;
  gap: 6px;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 8px;
  color: #17212b;
  font-weight: 950;
  background: rgba(255, 255, 255, 0.86);
  cursor: pointer;
}

.profile-character-choice.active {
  border-color: #0f8d68;
  background: rgba(216, 243, 220, 0.96);
}

.profile-character-choice img {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  object-fit: cover;
}

.profile-wide {
  grid-column: 1 / -1;
}

.profile-live-activity {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 2px solid rgba(15, 141, 104, 0.38);
  background: rgba(236, 253, 245, 0.94);
}

.profile-live-activity div {
  display: grid;
  gap: 4px;
}

.profile-live-activity span {
  color: #425466;
  font-size: 0.86rem;
  font-weight: 800;
}

@media (max-width: 700px) {
  .profile-live-activity {
    grid-template-columns: 1fr;
  }
}

.menu-screen.auth-only .menu-shell {
  max-width: 620px;
}

.menu-screen.auth-only .menu-grid {
  display: block;
}

.menu-screen.auth-only .menu-panel:not(.player-select-panel),
.menu-screen.auth-only .player-select-panel > .label,
.menu-screen.auth-only .player-select-panel > .lobby-empty,
.menu-screen.auth-only .player-select-panel > #proCodePanel,
.menu-screen.auth-only .player-select-panel > #adminPanel {
  display: none !important;
}

.menu-screen.auth-only .player-select-panel {
  display: block;
}

.profile-role {
  width: max-content;
  border-radius: 8px;
  padding: 8px 12px;
  color: #102a43;
  font-weight: 950;
  background: #e9ff70;
}

.profile-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(232, 240, 244, 0.86);
}

.profile-row strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.confrontation-summary {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
  text-align: right;
}

.confrontation-trend {
  display: inline-flex;
  justify-content: flex-end;
  gap: 3px;
  min-width: 76px;
}

.confrontation-result {
  font-size: 0.88rem;
  font-weight: 1000;
  line-height: 1;
}

.confrontation-result.victory { color: #15803d; }
.confrontation-result.defeat { color: #dc2626; }

.confrontation-status {
  border: 1px solid currentColor;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.confrontation-status.domination {
  color: #166534;
  background: #dcfce7;
}

.confrontation-status.ascendant-positive {
  color: #075985;
  background: #e0f2fe;
}

.confrontation-status.ascendant-negative {
  color: #9a3412;
  background: #ffedd5;
}

.confrontation-status.bete-noire {
  color: #991b1b;
  background: #fee2e2;
}

.confrontation-ratio {
  min-width: 58px;
  text-align: right;
  font-weight: 900;
}

.profile-calendar {
  display: grid;
  gap: 8px;
}

.profile-calendar-row {
  display: grid;
  gap: 3px;
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(232, 240, 244, 0.86);
}

.profile-calendar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-tournament-reset {
  flex: 0 0 auto;
}

.admin-weekly-attempts {
  margin-top: 10px;
}

@media (max-width: 640px) {
  .profile-calendar-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-tournament-reset {
    width: 100%;
  }

  .confrontation-summary {
    gap: 6px;
  }
}

.profile-calendar-row strong,
.profile-calendar-row span,
.profile-calendar-row em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-calendar-row em {
  color: #0f766e;
  font-style: normal;
  font-weight: 900;
}

.profile-result-medal {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55), 0 2px 6px rgba(0, 0, 0, 0.18);
}

.profile-result-medal.gold {
  background: #facc15;
}

.profile-result-medal.silver {
  background: #cbd5e1;
}

@media (max-width: 980px) {
  .menu-grid {
    grid-template-columns: 1fr;
  }

  .weekly-competitions-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .menu-screen {
    width: min(100vw - 16px, 560px);
    padding: 18px 0;
  }

  .menu-panel {
    padding: 12px;
  }

  .weekly-competition {
    grid-template-columns: 1fr;
    gap: 10px;
    font-size: 0.88rem;
  }

  .weekly-competition-actions {
    justify-content: stretch;
  }

  .weekly-competition-actions .small-button,
  .weekly-competition .small-button {
    width: 100%;
  }

  .friendly-lobby-action-panel {
    grid-template-columns: 1fr;
  }

  .friendly-setting-row,
  .friendly-league-groups {
    grid-template-columns: 1fr;
  }

  .friendly-league-day-row,
  .friendly-league-knockout-row {
    grid-template-columns: 1fr;
  }

  .friendly-league-day-matches {
    grid-template-columns: 1fr;
  }

  .friendly-standing-row {
    grid-template-columns: 18px minmax(0, 1fr) 36px 48px 48px;
    gap: 5px;
  }

  .friendly-standing-head {
    grid-template-columns: 18px minmax(0, 1fr) 36px 48px 48px;
    gap: 5px;
    font-size: 0.58rem;
  }

  .friendly-setting-switch.three-options {
    grid-template-columns: 1fr;
  }

  .friendly-setting-switch.four-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .friendly-setting-switch.five-options {
    grid-template-columns: 1fr;
  }

  .friendly-setting-switch.six-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .friendly-setting-switch.seven-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .friendly-setting-switch.three-options .friendly-setting-button {
    border-right: 0;
    border-bottom: 1px solid #94a3b8;
  }

  .friendly-setting-switch.three-options .friendly-setting-button:last-child {
    border-bottom: 0;
  }

  .friendly-setting-switch.four-options .friendly-setting-button:nth-child(2) {
    border-right: 0;
  }

  .friendly-setting-switch.four-options .friendly-setting-button:nth-child(-n + 2) {
    border-bottom: 1px solid #94a3b8;
  }

  .friendly-setting-switch.five-options .friendly-setting-button {
    border-right: 0;
    border-bottom: 1px solid #94a3b8;
  }

  .friendly-setting-switch.five-options .friendly-setting-button:last-child {
    border-bottom: 0;
  }

  .friendly-setting-switch.six-options .friendly-setting-button:nth-child(2n) {
    border-right: 0;
  }

  .friendly-setting-switch.six-options .friendly-setting-button:nth-child(3) {
    border-right: 1px solid #94a3b8;
  }

  .friendly-setting-switch.six-options .friendly-setting-button:nth-child(-n + 4) {
    border-bottom: 1px solid #94a3b8;
  }

  .friendly-setting-switch.seven-options .friendly-setting-button:nth-child(2n) {
    border-right: 0;
  }

  .friendly-setting-switch.seven-options .friendly-setting-button:nth-child(4) {
    border-right: 0;
  }

  .friendly-setting-switch.seven-options .friendly-setting-button:nth-child(-n + 6) {
    border-bottom: 1px solid #94a3b8;
  }

  .ai-club-house-footer {
    grid-template-columns: 1fr;
  }

  .opponent-hand-reveal-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .opponent-hand-reveal-controls button {
    width: 100%;
    min-width: 0;
  }

  .confrontation-intro {
    padding: 14px;
  }

  .confrontation-intro-versus {
    grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr);
    gap: 8px;
  }

  .confrontation-intro-countdown strong {
    width: 50px;
    height: 50px;
    font-size: 1.8rem;
  }

  .confrontation-intro-player strong {
    font-size: 0.78rem;
  }

  .spectator-live-banner {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .lobby-room {
    grid-template-columns: 1fr;
  }

  .lobby-room-actions {
    justify-content: stretch;
  }

  .lobby-room-actions .small-button {
    flex: 1 1 120px;
  }

  .ranking-head,
  .ranking-row {
    grid-template-columns: 34px minmax(92px, 1fr) 58px 58px 58px;
    gap: 4px;
    padding: 7px 6px;
    font-size: 0.72rem;
  }

  .ranking-row strong {
    white-space: normal;
    line-height: 1.12;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-row {
    grid-template-columns: 1fr;
  }

  .admin-score-periods {
    grid-template-columns: 1fr 1fr;
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.sync-panel {
  min-width: min(420px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  padding: 10px;
  color: #eff6ff;
  background: rgba(2, 8, 23, 0.58);
  box-shadow: 0 12px 36px rgba(2, 8, 23, 0.24);
}

.sync-panel p {
  margin: 0 0 8px;
  font-size: 0.82rem;
}

.sync-panel label {
  display: grid;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 850;
}

.sync-panel input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  padding: 7px;
  color: #17212b;
  background: rgba(255, 255, 255, 0.92);
}

.sync-panel span {
  display: inline-block;
  margin-top: 7px;
  font-size: 0.72rem;
  font-weight: 900;
}

.eyebrow,
.label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.eyebrow span {
  display: inline-block;
  margin-left: 6px;
  color: #e9ff70;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.95;
}

.brand-logo {
  display: block;
  width: min(520px, 48vw);
  max-height: 76px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.28));
}

.primary-button,
.pass-button,
.small-button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  color: #111827;
  font-weight: 850;
  background: var(--accent);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}

.small-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.menu-exchange-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.tutorial-menu-button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  color: #fff;
  font-weight: 900;
  background: #1976d2;
  box-shadow: 0 2px 0 rgba(5, 34, 72, 0.28);
}

.tutorial-menu-button:hover {
  background: #0f5fb3;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.admin-simulate-score-button {
  border-color: #b7791f;
  color: #2d2100;
  background: #f6c453;
}

.admin-simulate-score-button:hover:not(:disabled) {
  background: #ffd875;
}

.mode-info-badge {
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  padding: 9px 11px;
  color: #e9fbff;
  background: rgba(2, 42, 59, 0.72);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
}

.difficulty-reminder {
  display: inline-block;
  margin-top: 4px;
  margin-right: 5px;
  border-radius: 6px;
  padding: 4px 8px;
  background: rgba(17, 24, 39, 0.78);
  color: #fff;
  font-weight: 900;
  font-size: 0.76rem;
}

.tournament-location-reminder {
  background: rgba(224, 245, 255, 0.92);
  color: #0a3a4a;
}

.weekly-points-reminder {
  background: #d22f2f;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.74);
}

.solo-button {
  color: #07221d;
  background: #90f0b8;
}

.solo-button.active,
.set-button.active,
.online-button.active {
  color: #fff;
  background: #0f8d68;
}

.set-button {
  color: #17212b;
  background: #fef08a;
}

.online-button {
  color: #17212b;
  background: #dbeafe;
}

.reveal-button {
  color: #17212b;
  background: #f8d7e5;
}

.reveal-button.active {
  color: #fff;
  background: #8a2d58;
}

.pass-button {
  color: #fff;
  background: var(--danger);
}

.turn-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.end-turn-button {
  color: #12312d;
  background: #d8f3dc;
}

.undo-turn-button {
  color: #17212b;
  background: #dbeafe;
}

.scoreboard {
  display: grid;
  grid-template-columns: minmax(260px, 680px);
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.summary-card,
.rally-card,
.result-panel {
  border: 1px solid rgba(23, 33, 43, 0.12);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: 0 10px 24px rgba(9, 71, 74, 0.08);
}

.match-finale-overlay {
  position: fixed;
  inset: 0;
  z-index: 690;
  display: grid;
  align-content: center;
  gap: clamp(16px, 3vh, 30px);
  padding: clamp(24px, 5vw, 72px);
  overflow: auto;
  color: #fff;
  background: linear-gradient(160deg, #062b3d 0%, #0a4153 100%);
}
.match-finale-overlay > header { text-align: center; }
.match-finale-overlay > header span { letter-spacing: .16em; text-transform: uppercase; opacity: .72; }
.match-finale-overlay > header h2 { margin: 6px 0 0; font-size: clamp(2rem, 4vw, 4rem); }
.match-finale-players { display: grid; grid-template-columns: repeat(2, minmax(0, 280px)); justify-content: center; gap: clamp(16px, 5vw, 70px); }
.match-finale-players article { display: grid; gap: 10px; text-align: center; }
.match-finale-players article > strong { font-size: clamp(1rem, 2vw, 1.4rem); }
.match-finale-players article > div { position: relative; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 22px; }
.match-finale-players img { width: 100%; height: 100%; object-fit: cover; }
.match-finale-result-image { position: absolute; inset: 0; opacity: 0; animation: match-finale-result 300ms ease-out 2s forwards; }
.match-finale-overlay > ol { display: flex; justify-content: center; gap: 10px; margin: 0; padding: 0; list-style: none; }
.match-finale-overlay > ol li { display: grid; grid-template-columns: auto 8px auto; align-items: center; gap: 8px; min-width: 72px; padding: 8px 12px; border-radius: 999px; font-weight: 800; opacity: 0; transform: translateY(8px); animation: match-finale-set 220ms ease-out calc(var(--reveal-index) * 400ms) forwards; }
.match-finale-overlay > ol li i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .6; }
.match-finale-overlay > ol li.winner-0 { background: var(--player-one-color, #72e0bd); color: #062b3d; }
.match-finale-overlay > ol li.winner-1 { background: var(--player-two-color, #f2a177); color: #062b3d; }
.match-finale-overlay > nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; opacity: 0; animation: match-finale-set 250ms ease-out 2.3s forwards; }
.match-finale-overlay > nav button {
  min-height: 44px;
  padding: 11px 18px;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.one-point-victory-type {
  margin: -6px 0 -8px;
  text-align: center;
  font-size: clamp(1.15rem, 2.4vw, 1.75rem);
  font-weight: 900;
  letter-spacing: .035em;
  opacity: 0;
  transform: translateY(8px);
  animation: match-finale-set 260ms ease-out 1s forwards;
}
.one-point-final-score-label {
  margin: 0 0 -20px;
  text-align: center;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: 0;
  animation: match-finale-result 220ms ease-out 3s forwards;
}
.one-point-finale-overlay .match-finale-result-image {
  animation-delay: 3s;
}
.one-point-finale-overlay > ol li {
  animation-delay: calc(3s + var(--reveal-index) * 400ms);
}
.one-point-finale-overlay > nav {
  animation-delay: 3.3s;
}
@keyframes match-finale-set { to { opacity: 1; transform: none; } }
@keyframes match-finale-result { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .match-finale-result-image, .match-finale-overlay > ol li, .match-finale-overlay > nav, .one-point-victory-type, .one-point-final-score-label { animation: none; opacity: 1; transform: none; }
}

.result-panel {
  margin-bottom: 12px;
  border-color: rgba(15, 141, 104, 0.28);
}

.winner-dialog {
  display: inline-grid;
  place-items: center;
  margin: 0 0 10px;
  border-radius: 8px;
  padding: 10px 14px;
  color: #06314a;
  background: #dff3ff;
  border: 2px solid rgba(7, 89, 133, 0.22);
  font-size: 1.24rem;
  font-weight: 950;
}

.set-score-box {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  border-radius: 8px;
  padding: 10px;
  color: #17212b;
  background: #f7faf8;
  border: 1px solid var(--line);
}

.set-score-box strong {
  color: #075985;
}

.set-score-box span {
  font-weight: 850;
}

.end-bonus-box {
  background: #fff7ed;
  border-color: rgba(251, 146, 60, 0.55);
}

.hidden {
  display: none;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.metric {
  position: relative;
  min-height: 62px;
  border-radius: 8px;
  padding: 9px;
  background: #f7faf8;
  border: 1px solid var(--line);
}

.metric.endurance-metric {
  background: #fff0ee;
  border-color: rgba(240, 154, 145, 0.7);
}

.metric.endurance-metric strong {
  color: #cf4d45;
}

.metric.endurance-metric.low-endurance {
  color: #fff;
  background: #c92828;
  border-color: rgba(255, 255, 255, 0.44);
}

.metric.endurance-metric.low-endurance strong,
.metric.endurance-metric.low-endurance span {
  color: #fff;
}

.metric.power-metric {
  background: #fff3df;
  border-color: rgba(255, 202, 139, 0.85);
}

.metric.power-metric strong {
  color: #9a5d18;
}

.metric.power-metric.leading-power {
  background: #d8f3dc;
  border-color: rgba(15, 141, 104, 0.5);
}

.metric.power-metric.leading-power strong {
  color: #0f6b4f;
}

.winner-crown {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  padding: 4px;
  background: rgba(255, 255, 255, 0.94);
  border: 2px solid rgba(255, 216, 77, 0.9);
  box-shadow: 0 8px 18px rgba(10, 32, 44, 0.22);
  z-index: 2;
}

.winner-crown img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.metric strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1.1;
}

.metric span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.rally-state {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 0.9rem;
}

.rally-state .constraint-line {
  border-radius: 8px;
  padding: 6px 8px;
  color: #7a1515;
  background: #ffe1dc;
}

.effect-notice {
  margin-top: 12px;
  border: 2px solid rgba(168, 36, 36, 0.35);
  border-radius: 8px;
  padding: 10px;
  color: #7a1515;
  background: #ffe1dc;
  font-size: 0.86rem;
  line-height: 1.3;
}

.effect-notice strong {
  display: block;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.effect-notice.muted {
  border-color: rgba(99, 115, 129, 0.22);
  color: #637381;
  background: #f3f6f7;
}

.court {
  display: grid;
  grid-template-columns: 1fr 170px 1fr;
  min-height: 640px;
  overflow: hidden;
  border: 4px solid #f9fff6;
  border-radius: 8px;
  background: rgba(15, 156, 143, 0.2);
  box-shadow: 0 22px 60px rgba(9, 71, 74, 0.2);
}

.player-panel {
  position: relative;
  padding: 18px;
}

.player-panel.active {
  background: rgba(255, 255, 255, 0.16);
}

.player-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  color: #fff;
}

.player-header h2 {
  margin: 0;
  font-size: 1.6rem;
}

.player-character-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  margin-top: 6px;
  margin-bottom: 10px;
  color: rgba(248, 250, 252, 0.82);
  font-size: 0.82rem;
  font-weight: 750;
}

.desktop-player-rank {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(255, 224, 92, 0.82);
  border-radius: 999px;
  padding: 3px 9px;
  color: #4b3700;
  background: #f1cf55;
  box-shadow: 0 3px 8px rgba(48, 35, 0, 0.18);
  font-size: 0.7rem;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.player-identity-panel {
  display: inline-grid;
  min-width: min(240px, 100%);
  border-radius: 8px;
  background: transparent;
  box-shadow: 0 3px 0 transparent;
}

.player-identity-panel h2 {
  width: fit-content;
  min-width: 100%;
  border-radius: 8px;
  padding: 5px 10px;
  color: #fff;
  background: transparent;
  box-shadow: 0 3px 0 transparent;
}
.player-identity-panel.active-turn h2 { color: #06281f; background: #90f0b8; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18); }

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 999px;
  padding: 5px 9px;
  color: #102026;
  font-size: 0.72rem;
  font-weight: 850;
  background: rgba(255, 255, 255, 0.82);
}

.badge.server {
  background: var(--accent);
}

.badge.active {
  background: #fefefe;
}

.badge.effect-badge {
  background: #eadcff;
  color: #4d238c;
}

.badge.constraint-badge {
  background: #ffe1dc;
  color: #7a1515;
}

.badge.coach-blue-badge {
  background: #dff3ff;
  color: #075985;
}

.badge.coach-rose-badge {
  background: #f8d7e5;
  color: #8a2d58;
}

.hand {
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  gap: 12px;
}

.character-zone {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 12px;
}

.character-card {
  position: relative;
  width: min(150px, 38vw);
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.95);
  box-shadow: 0 10px 22px rgba(9, 71, 74, 0.16);
}

.character-stats {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.character-power-reminder,
.character-endurance-reminder {
  position: relative;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 8px;
  color: #17212b;
  text-align: center;
  box-shadow: 0 10px 22px rgba(9, 71, 74, 0.16);
}

.character-power-reminder {
  min-width: 104px;
  min-height: 104px;
  padding: 12px;
  background: #fff3df;
}

.character-endurance-reminder {
  min-width: 82px;
  min-height: 74px;
  padding: 8px 10px;
  color: #cf4d45;
  background: #fff0ee;
}

.character-power-reminder strong {
  color: #9a5d18;
  font-size: 2.8rem;
  line-height: 0.95;
}

.stat-value-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.stat-value-power { color: #9a5d18; }
.stat-value-endurance { color: #cf4d45; }
.stat-value-row strong { color: inherit; }

.character-endurance-reminder strong {
  color: #cf4d45;
  font-size: 1.85rem;
  line-height: 0.95;
}

.character-endurance-reminder.low-endurance {
  color: #fff;
  background: #c92828;
}

.opponent-inline {
  display: none;
  margin-left: 5px;
  font-size: 0.42em;
  font-weight: 900;
  vertical-align: middle;
  opacity: 0.78;
}

.character-endurance-reminder.low-endurance strong,
.character-endurance-reminder.low-endurance span {
  color: #fff;
}

.character-power-reminder.leading-power {
  background: #d8f3dc;
  border-color: rgba(15, 141, 104, 0.5);
}

.character-power-reminder.leading-power strong {
  color: #0f6b4f;
}

.character-power-reminder.leading-power .stat-value-power { color: #0f6b4f; }

.character-power-reminder > span,
.character-endurance-reminder > span {
  color: #5c3b17;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.character-endurance-reminder > span {
  color: #91443e;
  font-size: 0.66rem;
}

.character-power-reminder .stat-symbol,
.character-endurance-reminder .stat-symbol {
  display: block;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  background: currentColor;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
}

.stat-value-row .stat-symbol { color: inherit; }

.character-power-reminder .stat-symbol-power {
  flex-basis: 29px;
  width: 29px;
  height: 29px;
  mask-image: url("assets/icons/power-flash.svg");
  -webkit-mask-image: url("assets/icons/power-flash.svg");
}
.character-endurance-reminder .stat-symbol-endurance {
  mask-image: url("assets/icons/endurance-heart.svg");
  -webkit-mask-image: url("assets/icons/endurance-heart.svg");
}
.character-endurance-reminder.low-endurance .stat-value-endurance { color: #fff; }

.character-card.exchange-winner {
  z-index: 2;
}

.character-card img,
.played-visual img {
  display: block;
  width: 100%;
  aspect-ratio: 731 / 1039;
  object-fit: cover;
  image-rendering: auto;
}

.card {
  position: relative;
  min-height: 236px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  border: 2px solid rgba(23, 33, 43, 0.14);
  border-radius: 8px;
  padding: 10px;
  background: var(--paper);
  box-shadow: 0 8px 18px rgba(9, 71, 74, 0.16);
}

.card.has-visual {
  min-height: 0;
  gap: 7px;
  padding: 7px;
  background: rgba(255, 253, 248, 0.96);
}

.card-hover-panel {
  display: contents;
}

.card-visual {
  overflow: hidden;
  border-radius: 8px;
  background: #e8f3ef;
  box-shadow: inset 0 0 0 1px rgba(23, 33, 43, 0.12);
}

.card-visual img {
  display: block;
  width: 100%;
  aspect-ratio: 731 / 1039;
  object-fit: cover;
  image-rendering: auto;
}

.card-effect-forbid-host,
.effect-forbid-host {
  position: relative;
}

.forbid-effect-overlay {
  position: absolute;
  left: 50%;
  top: 74%;
  z-index: 4;
  width: 16%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.34));
}

.forbid-effect-overlay.fallback {
  top: 50%;
  width: min(34px, 22%);
}

.card.has-visual,
.played-visual,
.character-card {
  transform-origin: center center;
  transition: box-shadow 160ms ease;
}

.card.has-visual:hover,
.character-card:hover {
  z-index: 60;
  box-shadow: 0 24px 70px rgba(10, 32, 44, 0.35);
}

.played-visual:hover {
  z-index: 24;
  box-shadow: 0 28px 76px rgba(10, 32, 44, 0.4);
}

.played-visual.center-played:hover {
  box-shadow: 0 28px 76px rgba(10, 32, 44, 0.4);
}

.hidden-hand-card:hover {
  box-shadow: 0 18px 50px rgba(10, 32, 44, 0.28);
}

.visual-stats {
  display: grid;
  gap: 4px;
  border-radius: 8px;
  padding: 6px 7px;
  color: #243b53;
  background: #eef7ff;
  font-size: 0.72rem;
  font-weight: 850;
}

.card-readable-data {
  display: grid;
  gap: 6px;
  border: 1px solid #d8e3e7;
  border-radius: 9px;
  padding: 8px;
  color: #1f3441;
  background: #fff;
  font-synthesis: none;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

.card-readable-data header {
  display: grid;
  gap: 1px;
}

.card-readable-data header span {
  color: #607482;
  font-size: .58rem;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}

.card-readable-data header strong {
  overflow-wrap: anywhere;
  font-size: .78rem;
  line-height: 1.12;
  text-transform: uppercase;
}

.card-readable-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
}

.card-readable-stats > span {
  display: grid;
  gap: 1px;
  border-radius: 5px;
  padding: 4px 2px;
  background: #edf4f5;
  text-align: center;
}

.card-readable-stats small {
  overflow: hidden;
  color: #637783;
  font-size: .43rem;
  font-weight: 850;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.card-readable-stats strong {
  color: #1d3a48;
  font-size: .75rem;
}

.card-readable-data p {
  margin: 0;
  color: #3d5562;
  font-size: .65rem;
  font-weight: 650;
  line-height: 1.28;
}

.card-readable-data p b {
  display: block;
  margin-bottom: 2px;
  color: #176f72;
  font-size: .5rem;
  text-transform: uppercase;
}

.card-readable-data .card-readable-boost {
  border-radius: 5px;
  padding: 5px 6px;
  color: #6f2448;
  background: #faeaf1;
}

.card.remise-card {
  background: #fff8bf;
  border-color: rgba(189, 149, 24, 0.42);
}

.card.remise-card .effect {
  color: #17212b;
  background: #f2dc72;
}

.card.remise-card .remise-note {
  color: #17212b;
  background: #f7e896;
}

.card-star {
  position: absolute;
  top: 9px;
  left: 44px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 2px solid #111827;
  border-radius: 50%;
  color: #111827;
  background: #ffd84d;
  font-size: 0.92rem;
  font-weight: 950;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

.card.unplayable {
  border-color: rgba(122, 136, 145, .48);
  background: #eef1f2;
}

.card.unplayable .card-visual {
  box-shadow: inset 0 0 0 2px rgba(96, 112, 121, .24);
}

.card.exchange-complete-card {
  filter: none;
}

.card.boosted-card::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: -14px;
  width: 42%;
  height: 46px;
  border-radius: 6px;
  background: repeating-linear-gradient(135deg, #ffd6e4 0 8px, #b95782 8px 16px);
  box-shadow: 0 7px 12px rgba(0, 0, 0, 0.2);
  z-index: -1;
}

.card-top {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 8px;
}

.bubble {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #111827;
  font-size: 1.3rem;
  font-weight: 950;
  border: 3px solid rgba(0, 0, 0, 0.16);
}

.cost {
  background: #f09a91;
  color: #fff;
}

.power {
  background: var(--power);
}

.card-title {
  min-width: 0;
  text-align: center;
}

.card-title strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1rem;
  line-height: 1.1;
  text-transform: uppercase;
}

.card-title span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.stat {
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.82rem;
  font-weight: 850;
}

.stat.precision {
  background: var(--precision);
}

.stat.placement {
  background: var(--placement);
  border: 1px solid var(--line);
}

.effect {
  flex: 1;
  min-height: 64px;
  border-radius: 8px;
  padding: 9px;
  color: #fff;
  background: #079aa5;
  font-size: 0.82rem;
  line-height: 1.25;
}

.boost-box {
  border-radius: 8px;
  padding: 8px;
  color: #fff;
  background: var(--boost);
  font-size: 0.82rem;
  font-weight: 760;
}

.card-actions {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.card.has-visual:hover .card-actions {
  z-index: 62;
}

.play-button {
  position: relative;
  z-index: 3;
  pointer-events: auto;
  min-height: 34px;
  border-radius: 8px;
  color: #fff;
  font-weight: 850;
  background: var(--court-dark);
}

.play-button,
.boost-button {
  display: grid;
  place-items: center;
  line-height: 1.05;
}

.play-button span,
.boost-button span {
  font-size: 0.76rem;
}

.play-button strong,
.boost-button strong {
  font-size: 0.9rem;
}

.play-button.risky-play-button,
.boost-button.risky-play-button {
  background: var(--danger);
  color: #fff;
}

.boost-button {
  position: relative;
  z-index: 3;
  pointer-events: auto;
  min-height: 34px;
  border-radius: 8px;
  color: #111827;
  font-weight: 900;
  background: var(--accent);
}

.boost-warning strong {
  color: var(--danger);
}

.tournament-panel {
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 16px;
  color: #fff;
  background: rgba(16, 20, 67, 0.84);
  box-shadow: 0 18px 44px rgba(2, 8, 23, 0.28);
}

.tournament-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.tournament-header h2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  color: #fff;
  font-size: 1.3rem;
  text-transform: uppercase;
}

.surface-round-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 6px 12px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 8px 18px rgba(2, 8, 23, 0.24);
}

.surface-round-grass {
  background: #168a47;
}

.surface-round-hard {
  background: #1478b8;
}

.surface-round-clay {
  background: #c34030;
}

.tournament-bracket {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(220px, 0.9fr);
  gap: 18px;
  align-items: center;
}

.league-board {
  display: grid;
  gap: 18px;
}

.league-standings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
}

.league-standings {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
}

.league-standings-head,
.league-standings-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 64px 82px 82px;
  gap: 10px;
  align-items: center;
}

.league-standings-head {
  margin-bottom: 6px;
  padding: 0 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.league-standings-row {
  min-height: 34px;
  border-radius: 6px;
  padding: 6px 8px;
  color: #16212b;
  background: rgba(255, 255, 255, 0.88);
  font-weight: 900;
}

.league-standings-row > strong:not(.league-rank),
.league-standings-row > span:nth-last-child(-n + 2),
.league-standings-head > span:nth-child(n + 3) {
  text-align: right;
}

.league-rank,
.league-standings-head > span:first-child {
  text-align: center;
}

.league-standings-row + .league-standings-row {
  margin-top: 6px;
}

.league-standings-row.qualified {
  color: #052e1b;
  background: linear-gradient(90deg, #e9ff70, #86efac);
}

.league-standings-row.human-player {
  outline: 2px solid rgba(134, 239, 172, 0.98);
  outline-offset: -2px;
}

.league-bracket {
  grid-template-columns: repeat(6, minmax(180px, 1fr));
  align-items: start;
  overflow-x: auto;
  padding-bottom: 4px;
}

.championship-board { display: grid; gap: 12px; }
.championship-zone { overflow: hidden; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; background: rgba(255,255,255,.055); }
.championship-zone.open { border-color: rgba(140,224,191,.42); }
.championship-zone-toggle {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  border: 0;
  padding: 10px 14px;
  color: #fff;
  background: rgba(4,30,47,.86);
  text-align: left;
  cursor: pointer;
}
.championship-zone-toggle > span:first-child { color: #8ce0bf; font-size: .7rem; font-weight: 900; text-transform: uppercase; }
.championship-zone-toggle > span:last-child { font-size: 1.35rem; }
.championship-zone-content { display: grid; gap: 14px; padding: 12px; }
.championship-groups { grid-template-columns: repeat(2, minmax(300px, 1fr)); }
.championship-days { display: grid; gap: 16px; }
.championship-day { display: grid; gap: 9px; }
.championship-day > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: #fff; }
.championship-day > header strong { color: #8ce0bf; font-size: .86rem; text-transform: uppercase; }
.championship-day > header span { color: rgba(255,255,255,.68); font-size: .7rem; font-weight: 800; }
.championship-day-matches { display: grid; grid-template-columns: repeat(4, minmax(190px, 1fr)); gap: 10px; }
.championship-playoffs { display: grid; grid-template-columns: repeat(4, minmax(190px, 1fr)); gap: 10px; }
.championship-matches { grid-template-columns: repeat(4, minmax(210px, 1fr)); }
.championship-final-bracket { grid-template-columns: repeat(4, minmax(210px, 1fr)); }
.championship-lobby-shell { display: grid; gap: 18px; }
.championship-lobby-hero { position: relative; min-height: 220px; overflow: hidden; margin: 0; border-radius: 18px; background: #062b3d; }
.championship-lobby-hero img { width: 100%; height: 260px; object-fit: cover; object-position: center 36%; }
.championship-lobby-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg,rgba(245,249,248,.96),rgba(245,249,248,.34)); }
.championship-lobby-hero figcaption { position: absolute; z-index: 1; left: 28px; bottom: 24px; max-width: 580px; border-radius: 12px; padding: 12px 16px; color: #243947; background: rgba(255,255,255,.88); }
.championship-lobby-hero h1 { margin: 3px 0 6px; font-size: clamp(2rem,5vw,4rem); }
.championship-lobby-hero p { margin: 0; }
.championship-lobby-content { display: grid; gap: 14px; }
.championship-lobby-content .championship-board { border-radius: 18px; padding: 18px; color: #263746; background: rgba(242,246,247,.98); box-shadow: 0 12px 28px rgba(1,25,39,.17); font-size: .86rem; }
.championship-lobby-content .championship-zone { border-color: rgba(87,108,121,.18); background: transparent; }
.championship-lobby-content .championship-zone.open { border-color: rgba(15,118,110,.26); }
.championship-lobby-content .championship-zone-toggle { min-height: 44px; padding: 8px 12px; color: #2d4050; background: #f9fbfb; }
.championship-lobby-content .championship-zone-toggle strong { font-size: .88rem; font-weight: 800; }
.championship-lobby-content .championship-zone-toggle > span:first-child { color: #527080; font-size: .62rem; }
.championship-lobby-content .championship-zone-toggle > span:last-child { color: #70828d; font-size: 1.05rem; }
.championship-lobby-content .championship-zone-content { background: #eef3f5; }
.championship-lobby-section { display: grid; gap: 12px; }
.championship-lobby-section + .championship-lobby-section { margin-top: 8px; }
.championship-section-label { margin: 0; border-bottom: 1px solid rgba(87,108,121,.18); padding-bottom: 9px; color: #657784; font-size: .68rem; font-weight: 850; letter-spacing: .025em; text-transform: uppercase; }
.championship-lobby-content .league-standings { border-color: rgba(87,108,121,.2); color: #17212b; background: rgba(255,255,255,.92); }
.championship-lobby-content .league-standings .tournament-round-label { color: #293b49; font-size: .88rem; font-weight: 800; text-transform: none; }
.championship-lobby-content .league-standings-head { color: #71818b; font-size: .62rem; font-weight: 800; }
.one-point-master-standings .league-standings-head,
.one-point-master-standings .league-standings-row { grid-template-columns: 42px minmax(130px, 1fr) repeat(4, minmax(54px, auto)); }
.championship-lobby-content .league-standings-row { min-height: 31px; border-top: 1px solid rgba(87,108,121,.14); border-left: 3px solid transparent; border-radius: 0; padding-block: 5px; color: #5c6d78; background: transparent; font-size: .76rem; font-weight: 750; }
.championship-lobby-content .league-standings-row strong,
.championship-lobby-content .league-standings-row .tournament-player-identity { color: #293945; font-weight: 800; }
.championship-lobby-content .league-standings-row.qualified { border-left-color: #79b7a2; border-radius: 5px; background: #eaf5f1; }
.championship-lobby-content .league-standings-row.human-player { border-left-color: #d2ad45; outline: 0; background: #fff8e5; }
.championship-lobby-content .championship-day { grid-template-columns: 120px minmax(0,1fr); align-items: stretch; border-top: 1px solid rgba(87,108,121,.2); padding-top: 12px; }
.championship-lobby-content .championship-day > header { align-content: center; align-items: flex-start; flex-direction: column; justify-content: center; color: #17212b; }
.championship-lobby-content .championship-day > header strong { color: #344957; font-size: .8rem; font-weight: 800; text-transform: none; }
.championship-lobby-content .championship-day > header span { color: #74848e; font-size: .62rem; font-weight: 700; line-height: 1.35; }
.championship-lobby-content .tournament-match,
.championship-lobby-content .tournament-champion { border-color: rgba(87,108,121,.18); padding: 10px; color: #293945; background: #fff; box-shadow: 0 3px 9px rgba(22,48,63,.045); }
.championship-lobby-content .tournament-round-label { margin-bottom: 6px; color: #607584; font-size: .62rem; font-weight: 800; letter-spacing: .01em; }
.championship-lobby-content .tournament-match-status { padding: 3px 6px; font-size: .55rem; font-weight: 800; }
.championship-lobby-content .tournament-match-status.complete { color: #315f52; background: #dceee8; }
.championship-lobby-content .tournament-match-status.upcoming { color: #687984; background: #edf1f3; }
.championship-lobby-content .tournament-player-row { min-height: 32px; padding: 5px 7px; color: #2e3f4b; background: #f8fafb; font-size: .76rem; font-weight: 750; }
.championship-lobby-content .tournament-player-row.human-player { border-left: 3px solid #d2ad45; background: #fff8e5; }
.championship-lobby-content .tournament-player-row.winner { border-left: 3px solid #79b7a2; background: #eaf5f1; box-shadow: none; }
.championship-lobby-content .tournament-column-title { color: #607584; font-size: .68rem; }
.championship-lobby-content .tournament-set-scores span { border-color: rgba(87,108,121,.18); color: #405562; background: #f1f4f5; font-size: .72rem; font-weight: 800; }
.championship-lobby-content .tournament-set-scores span.winner-set { border-color: rgba(121,183,162,.38); color: #315f52; background: #eaf5f1; box-shadow: none; }
.championship-lobby-content .championship-empty-round { color: #647481; }
.championship-practical-info { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.championship-practical-info > div { display: grid; gap: 3px; border: 1px solid #d8e2e5; border-radius: 12px; padding: 12px; color: #243947; background: #fff; }
.championship-practical-info span { color: #427466; font-size: .65rem; font-weight: 900; text-transform: uppercase; }
.championship-lobby-actions { position: sticky; z-index: 4; top: 8px; display: flex; flex-wrap: wrap; gap: 8px; border: 1px solid #d8e2e5; border-radius: 14px; padding: 10px; background: rgba(255,255,255,.96); box-shadow: 0 10px 30px rgba(18,48,61,.14); }
.championship-lobby-actions button { min-height: 46px; }
.championship-lobby-progress { border-radius: 10px; padding: 10px 14px; color: #052e1b; background: #8ce0bf; font-weight: 900; }
.championship-lobby-groups { display: grid; grid-template-columns: repeat(2,minmax(280px,1fr)); gap: 10px; }
.championship-lobby-group { display: grid; grid-template-columns: auto repeat(3,1fr); align-items: center; gap: 8px; border: 1px solid #d8e2e5; border-radius: 10px; padding: 10px; color: #344957; background: #fff; }
.championship-lobby-group > strong { color: #315f52; }
.championship-lobby-group > span { display: flex; gap: 7px; min-width: 0; }
.championship-lobby-group b { color: #8ce0bf; }
.championship-empty-round { margin: 0; padding: 24px; color: rgba(255,255,255,.68); text-align: center; }
.championship-winner-card { justify-self: center; display: grid; justify-items: center; gap: 6px; width: min(320px,100%); border: 1px solid rgba(121,183,162,.45); border-radius: 16px; padding: 14px; color: #293945; background: #eaf5f1; }
.championship-winner-card img { width: 180px; aspect-ratio: 1; border-radius: 12px; object-fit: cover; object-position: 50% 18%; }
.championship-winner-card span { color: #52786b; font-size: .66rem; font-weight: 850; text-transform: uppercase; }
.championship-winner-card strong { font-size: 1.05rem; }

.tournament-column {
  display: grid;
  gap: 14px;
}

.tournament-match,
.tournament-champion {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
}

.tournament-match.current {
  border-color: #e9ff70;
  box-shadow: 0 0 0 2px rgba(233, 255, 112, 0.2);
}

.tournament-round-label {
  display: block;
  margin-bottom: 8px;
  color: #e9ff70;
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.tournament-player-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-radius: 6px;
  padding: 8px 10px;
  color: #17212b;
  background: rgba(255, 255, 255, 0.88);
  font-weight: 950;
}

.tournament-player-identity {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.tournament-seed-number {
  margin-left: 2px;
  font-size: 0.72em;
  font-weight: 400;
}

.ai-intelligence-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  min-height: 22px;
  border: 1px solid transparent;
  border-radius: 50%;
  padding: 0;
  font-size: 0.7rem;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ai-intelligence-badge.amateur {
  border-color: #94a3b8;
  color: #111827;
  background: #fff;
}

.ai-intelligence-badge.expert {
  border-color: #7c4023;
  color: #fff;
  background: #b56a35;
}

.ai-intelligence-badge.champion {
  border-color: #7b8794;
  color: #17212b;
  background: #c7cdd4;
}

.ai-intelligence-badge.legend {
  border-color: #8c6900;
  color: #332400;
  background: #e0b52f;
}

.tournament-player-row.winner {
  color: #fff;
  background: linear-gradient(90deg, #f2a334, #f8c64c);
}

.tournament-player-row.human-player {
  color: #052e1b;
  border: 2px solid rgba(134, 239, 172, 0.98);
  background: linear-gradient(90deg, #bbf7d0, #86efac);
}

.tournament-player-row.human-player.winner {
  color: #052e1b;
  border-color: #e9ff70;
  background: linear-gradient(90deg, #e9ff70, #f8c64c);
}

.tournament-score {
  margin-top: 8px;
  color: #fff;
  font-size: 1rem;
  font-weight: 950;
}

.qualification-summary {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  border-radius: 8px;
  padding: 12px;
  background: rgba(13, 43, 73, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.qualification-column {
  border-radius: 8px;
  padding: 8px;
  background: rgba(13, 43, 73, 0.24);
}

.tournament-column-title {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.76);
}

.surface-bonus-pill,
.surface-bonus-reminder {
  border-radius: 8px;
  padding: 7px 9px;
  color: #3b0764;
  background: #f3e8ff;
  border: 1px solid rgba(168, 85, 247, 0.45);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.15;
}

.surface-bonus-pill {
  margin: 5px 0;
}

.surface-bonus-reminder {
  max-width: 220px;
  text-align: center;
}

.surface-bonus-reminder.world-rank-gold {
  border-color: #fff0a6;
  color: #4b3000;
  background: linear-gradient(135deg, #ffe795, #dcae2d);
  box-shadow: 0 5px 16px rgba(130, 86, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .7);
}

.tournament-champion {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
}

.tournament-trophy {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(116, 71, 163, 0.9);
}

.tournament-trophy img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.tournament-final-button {
  justify-self: start;
}

.full-ranking-button {
  margin-top: 12px;
}

.ranking-shell {
  max-width: 980px;
}

.ranking-full-panel {
  min-height: 520px;
}

.circuit-info-button {
  margin-left: auto;
}

.solo-info-button {
  margin-left: auto;
}

.solo-info-screen {
  width: min(1180px, calc(100vw - 32px));
}

.solo-info-shell {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
}

.solo-info-hero img {
  object-position: center 48%;
}

.solo-info-introduction {
  display: grid;
  gap: 10px;
  padding: clamp(24px, 4vw, 42px);
  color: #173b4e;
  background: #fff;
}

.solo-info-introduction h2,
.solo-info-introduction h3,
.solo-competition-content h3 {
  margin: 0;
  color: #10364d;
}

.solo-info-introduction > p,
.solo-match-intro p,
.solo-competition-content p,
.solo-competition-content li {
  margin: 0;
  color: #526878;
  line-height: 1.62;
}

.solo-match-intro {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 20px;
  margin-top: 12px;
  border: 1px solid rgba(16, 54, 77, .12);
  border-radius: 18px;
  padding: 22px;
  background: #eef7f4;
}

.solo-match-intro > img {
  width: 64px;
  height: 64px;
}

.solo-match-intro > div {
  display: grid;
  gap: 8px;
}

.solo-competition-accordions {
  display: grid;
  gap: 12px;
  padding: 0 clamp(24px, 4vw, 42px) clamp(28px, 4vw, 44px);
  background: #fff;
}

.solo-competition-accordion {
  overflow: hidden;
  border: 1px solid rgba(16, 54, 77, .16);
  border-radius: 16px;
  background: #f8fbfa;
  box-shadow: 0 7px 18px rgba(10, 42, 58, .06);
}

.solo-competition-accordion summary {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 14px;
  min-height: 82px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}

.solo-competition-accordion summary::-webkit-details-marker {
  display: none;
}

.solo-competition-accordion summary > img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.solo-competition-accordion summary > span {
  display: grid;
  gap: 3px;
}

.solo-competition-accordion summary small {
  color: #0f8d68;
  font-size: .66rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.solo-competition-accordion summary strong {
  color: #10364d;
  font-size: 1.08rem;
}

.solo-competition-accordion summary i {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e3efeb;
}

.solo-competition-accordion summary i::before,
.solo-competition-accordion summary i::after {
  position: absolute;
  top: 14px;
  left: 8px;
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: #0b7659;
  content: "";
}

.solo-competition-accordion summary i::after {
  transform: rotate(90deg);
  transition: transform 180ms ease;
}

.solo-competition-accordion[open] summary i::after {
  transform: rotate(0);
}

.solo-competition-accordion[open] summary {
  border-bottom: 1px solid rgba(16, 54, 77, .12);
  background: #eef7f4;
}

.solo-competition-content {
  display: grid;
  gap: 12px;
  padding: clamp(20px, 3vw, 30px);
}

.solo-competition-content ul,
.solo-competition-content ol {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 22px;
}

.info-highlight-button,
#menuScreen .info-highlight-button {
  min-height: 38px;
  border: 1px solid #cf6485;
  padding: 0 14px;
  color: #2e101a;
  background: #e57d9d;
  box-shadow: 0 3px 0 rgba(113, 39, 64, 0.38), 0 8px 18px rgba(93, 30, 52, 0.18);
  font-weight: 950;
}

.info-highlight-button:hover:not(:disabled),
.info-highlight-button:focus-visible {
  border-color: #b94d70;
  color: #210b12;
  background: #ee9ab3;
  transform: translateY(-1px);
}

.academy-info-menu-button {
  grid-column: 1 / -1;
}

.academy-info-shell {
  max-width: 1120px;
}

.tutorial-module-list {
  padding: clamp(28px, 5vw, 58px);
}

.tutorial-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 24px;
}

.tutorial-module-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid rgba(14, 67, 91, 0.14);
  border-radius: 18px;
  background: linear-gradient(145deg, #fff 0%, #edf7fa 100%);
  box-shadow: 0 16px 34px rgba(7, 39, 55, 0.1);
}

.tutorial-module-number {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 16px;
  background: #0b4059;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 900;
}

.tutorial-module-card h3 {
  margin: 3px 0 8px;
  color: #0b4059;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
}

.tutorial-module-card p:not(.label) {
  margin: 0;
  color: #526878;
  line-height: 1.55;
}

.tutorial-module-card .primary-button {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: 4px;
}

@media (max-width: 760px) {
  .tutorial-module-grid {
    grid-template-columns: 1fr;
  }

  .tutorial-module-card {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 14px;
  }

  .tutorial-module-number {
    width: 48px;
    height: 48px;
  }
}

/* Desktop interface v4.11 ------------------------------------------------ */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .game-app {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  body:not(.mobile-game-view) .desktop-match-score {
    position: relative;
    top: auto;
    left: auto;
    grid-row: 2;
    align-self: center;
    justify-self: center;
    width: max-content;
    min-height: 44px;
    max-width: min(430px, 38vw);
    margin: 0;
    padding: 0;
    transform: none;
  }

  body:not(.mobile-game-view) .court {
    grid-row: 3;
  }

  body:not(.mobile-game-view) .desktop-played-row {
    transform: translateY(var(--desktop-row-offset, 0));
    transition: transform 160ms ease;
  }

  body:not(.mobile-game-view) .result-panel.exchange-result-host {
    position: fixed;
    inset: 0;
    z-index: 1180;
    display: grid;
    place-items: center;
    width: auto;
    margin: 0;
    padding: 24px;
    background: rgba(1, 17, 28, .82);
    backdrop-filter: blur(9px);
  }

  body:not(.mobile-game-view) .exchange-result-overlay {
    display: grid;
    gap: 14px;
    width: min(520px, calc(100vw - 48px));
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 24px;
    padding: 24px;
    color: #fff;
    background:
      radial-gradient(circle at 50% 0, rgba(140, 224, 191, .13), transparent 42%),
      #062b3d;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .58);
  }

  body:not(.mobile-game-view) .exchange-result-overlay > header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: left;
  }

  body:not(.mobile-game-view) .exchange-result-overlay > header img {
    width: 82px;
    height: 82px;
    border: 4px solid var(--exchange-result-accent, #8ce0bf);
    border-radius: 50%;
    object-fit: cover;
    object-position: center 20%;
    background: #0b4053;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, .07);
  }

  body:not(.mobile-game-view) .exchange-result-overlay > header span {
    display: block;
    margin-bottom: 4px;
    color: var(--exchange-result-accent, #8ce0bf);
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  body:not(.mobile-game-view) .exchange-result-overlay > header h2 {
    margin: 0;
    font-size: clamp(1.45rem, 2.2vw, 2rem);
  }

  body:not(.mobile-game-view) .exchange-result-overlay.rally-end-boost {
    --exchange-result-accent: #f1cf55;
  }

  body:not(.mobile-game-view) .exchange-result-overlay.rally-end-effect {
    --exchange-result-accent: #77cdef;
  }

  body:not(.mobile-game-view) .exchange-result-overlay.rally-end-points {
    --exchange-result-accent: #8ce0bf;
  }

  body:not(.mobile-game-view) .exchange-result-overlay.exchange-result-winner--player {
    --exchange-result-winner-color: #8ce0bf;
  }

  body:not(.mobile-game-view) .exchange-result-overlay.exchange-result-winner--opponent {
    --exchange-result-winner-color: #f2a37f;
  }

  body:not(.mobile-game-view) .exchange-result-victory-type {
    display: block;
    border-radius: 12px;
    padding: 10px 14px;
    color: #062b3d;
    background: var(--exchange-result-winner-color, #8ce0bf);
    font-size: .92rem;
    font-weight: 1000;
    text-align: center;
  }

  body:not(.mobile-game-view) .exchange-result-power-score {
    display: grid;
    grid-template-columns: 1fr 30px 1fr;
    align-items: center;
    width: min(250px, 100%);
    margin: -3px auto 0;
    border-radius: 999px;
    padding: 8px 14px;
    color: #062b3d;
    background: var(--exchange-result-winner-color, #8ce0bf);
    font-size: 1.12rem;
    font-weight: 1000;
    text-align: center;
  }

  body:not(.mobile-game-view) .exchange-result-power-score i,
  .desktop-exchange-power-score i {
    display: block;
    justify-self: center;
    width: 24px;
    height: 30px;
    background: currentColor;
    mask: url("assets/icons/power-flash.svg") center / contain no-repeat;
    -webkit-mask: url("assets/icons/power-flash.svg") center / contain no-repeat;
  }

  body:not(.mobile-game-view) .exchange-result-consequences {
    display: grid;
    gap: 8px;
  }

  body:not(.mobile-game-view) .exchange-result-consequences p {
    display: grid;
    grid-template-columns: minmax(110px, .7fr) minmax(0, 1.3fr);
    align-items: center;
    gap: 12px;
    margin: 0;
    border-left: 4px solid var(--exchange-result-accent, #8ce0bf);
    border-radius: 8px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, .07);
  }

  body:not(.mobile-game-view) .exchange-result-consequences p span {
    color: rgba(255, 255, 255, .62);
    font-size: .68rem;
    font-weight: 850;
    text-transform: uppercase;
  }

  body:not(.mobile-game-view) .exchange-result-consequences p strong {
    font-size: .82rem;
    line-height: 1.35;
  }

  body:not(.mobile-game-view) .exchange-result-overlay > nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(130px, .45fr);
    gap: 8px;
  }

  body:not(.mobile-game-view) .exchange-result-overlay > nav button {
    width: 100%;
    min-height: 46px;
    margin: 0;
  }

  body:not(.mobile-game-view) .exchange-result-history-button {
    border: 1px solid rgba(140, 224, 191, .48);
    border-radius: 11px;
    color: #8ce0bf;
    background: rgba(140, 224, 191, .08);
    font-size: .76rem;
    font-weight: 950;
    text-transform: uppercase;
    cursor: pointer;
  }
}

.desktop-exchange-power-score {
  display: inline-grid;
  grid-template-columns: auto 28px auto;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 11px;
  color: #062b3d;
  font-size: .72rem;
  font-weight: 1000;
  line-height: 1;
}

.desktop-exchange-power-score--player {
  background: #8ce0bf;
}

.desktop-exchange-power-score--opponent {
  background: #f2a37f;
}

.desktop-exchange-power-score--information {
  background: #a9b8c5;
}

.action-log-result-details--boost .exchange-outcome-detail {
  border-left-color: #f1cf55 !important;
  color: #062b3d !important;
  background: #f1cf55 !important;
}

.action-log-result-details--effect .exchange-outcome-detail {
  border-left-color: #77cdef !important;
  color: #062b3d !important;
  background: #77cdef !important;
}

.action-log-result-details--power .exchange-outcome-detail {
  border-left-color: #8ce0bf !important;
  color: #062b3d !important;
  background: #8ce0bf !important;
}

.desktop-history-latest .exchange-score-consequence,
.desktop-history-entry .exchange-score-consequence {
  border-left-color: #fff !important;
  color: #fff;
  background: rgba(255, 255, 255, .11);
  font-weight: 850;
}

/* Desktop interface v4.12 ------------------------------------------------ */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .desktop-played-row:has(.desktop-played-card:hover),
  body:not(.mobile-game-view) .desktop-played-row:has(.desktop-played-card:focus-visible) {
    z-index: 230;
  }

  body:not(.mobile-game-view) .desktop-played-card {
    transform-origin: bottom center;
  }

  body:not(.mobile-game-view) .desktop-played-card:hover,
  body:not(.mobile-game-view) .desktop-played-card:focus-visible {
    z-index: 220;
    transform: translateY(-28%) scale(1.38);
    box-shadow: 0 28px 70px rgba(0, 0, 0, .56), 0 0 0 2px #f6c344;
  }
}

.visual-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 5px;
  background: rgba(238, 247, 255, .96);
}

.visual-stat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 30px;
  border-radius: 7px;
  padding: 4px 5px;
  background: #fff;
}

.visual-stat strong {
  font-size: .86rem;
  font-weight: 1000;
  line-height: 1;
}

.visual-stat--positive strong {
  color: #16845f;
}

.visual-stat--negative strong {
  color: #c92828;
}

.visual-stat-icon {
  display: block;
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  background: #264956;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
}

.visual-stat-icon--precision {
  mask-image: url("assets/icons/precision-target.svg");
  -webkit-mask-image: url("assets/icons/precision-target.svg");
}

.visual-stat-icon--placement {
  mask-image: url("assets/icons/placement-pin.svg");
  -webkit-mask-image: url("assets/icons/placement-pin.svg");
  mask-size: 132%;
  -webkit-mask-size: 132%;
}

.visual-stat-icon--endurance {
  mask-image: url("assets/icons/endurance-heart.svg");
  -webkit-mask-image: url("assets/icons/endurance-heart.svg");
}

.action-log-backdrop {
  z-index: 1200;
}

.desktop-history-latest .exchange-score-consequence,
.desktop-history-entry .exchange-score-consequence {
  border-left-color: #fff !important;
  color: #fff !important;
  background: rgba(255, 255, 255, .11) !important;
  font-weight: 850;
}

.academy-info-panel {
  min-height: 520px;
  overflow: hidden;
}

.academy-info-header {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(10, 56, 78, 0.16);
}

.academy-info-intro {
  max-width: 850px;
  padding: 34px 0 28px;
}

.academy-info-intro h1 {
  margin: 5px 0 18px;
  color: #102a43;
  font-size: 1.8rem;
  line-height: 1.18;
  letter-spacing: 0;
}

.academy-info-intro p {
  margin: 0 0 12px;
  color: #425466;
  line-height: 1.65;
}

.academy-info-intro .label {
  margin-bottom: 0;
  color: #0f8d68;
}

.academy-info-highlight {
  margin-top: 20px !important;
  border-left: 4px solid #0f8d68;
  padding: 12px 16px;
  color: #102a43 !important;
  background: rgba(216, 243, 220, 0.62);
}

.academy-info-section {
  border-top: 1px solid rgba(10, 56, 78, 0.16);
  padding: 28px 0;
}

.academy-section-heading h2,
.academy-copy-grid h2 {
  margin: 4px 0 12px;
  color: #17212b;
  font-size: 1.2rem;
  letter-spacing: 0;
}

.academy-section-heading {
  margin-bottom: 18px;
}

.academy-deck-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.academy-deck-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(23, 33, 43, 0.16);
  border-radius: 8px;
  padding: 0;
  color: #17212b;
  line-height: 0;
  text-align: left;
  background: #f8fbfc;
  box-shadow: 0 7px 16px rgba(10, 32, 44, 0.13);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.academy-deck-card:hover,
.academy-deck-card:focus-visible {
  border-color: #0f8d68;
  transform: translateY(-3px);
  box-shadow: 0 13px 24px rgba(10, 32, 44, 0.2);
}

.academy-deck-card > img {
  display: block;
  width: 100%;
  aspect-ratio: 731 / 1039;
  object-fit: cover;
  image-rendering: auto;
}

.academy-gallery-arrow {
  position: fixed;
  top: 50%;
  z-index: 142;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 2px solid rgba(255, 255, 255, 0.84);
  border-radius: 50%;
  padding: 0 0 5px;
  color: #fff;
  background: rgba(190, 24, 93, 0.94);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34);
  font-size: 2.7rem;
  line-height: 1;
  transform: translateY(-50%);
}

.academy-gallery-arrow.previous {
  left: max(12px, calc(50% - 360px));
}

.academy-gallery-arrow.next {
  right: max(12px, calc(50% - 360px));
}

.academy-gallery-arrow:hover,
.academy-gallery-arrow:focus-visible {
  background: #9d174d;
}

.academy-copy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px;
}

.academy-copy-grid > div + div {
  border-left: 1px solid rgba(10, 56, 78, 0.16);
  padding-left: 36px;
}

.academy-copy-grid p {
  color: #425466;
  line-height: 1.6;
}

.academy-benefits-list,
.academy-discovery-list {
  display: grid;
  gap: 9px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.academy-benefits-list li,
.academy-discovery-list li {
  position: relative;
  padding-left: 25px;
  color: #243b53;
  line-height: 1.45;
}

.academy-benefits-list li::before,
.academy-discovery-list li::before {
  position: absolute;
  top: 0;
  left: 0;
  color: #0f8d68;
  content: "✓";
  font-weight: 950;
}

.academy-info-footer {
  display: grid;
  margin: 6px -18px -18px;
  color: #fff;
  background: #102a43;
}

.academy-shop-banner {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.academy-shop-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 18px;
}

.academy-shop-callout p {
  max-width: 660px;
  margin: 0;
  line-height: 1.55;
}

.academy-shop-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 44px;
  border: 1px solid #be185d;
  padding: 8px 18px;
  color: #fff;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  background: #be185d;
  box-shadow: 0 2px 0 rgba(75, 8, 36, 0.58);
}

.academy-shop-button:hover,
.academy-shop-button:focus-visible {
  color: #fff;
  background: #9d174d;
}

.circuit-info-main-title {
  margin: 10px 0 18px;
  color: #17212b;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0.04em;
}

.circuit-info-feature {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
  gap: 30px;
  align-items: stretch;
  margin-top: 20px;
  padding-bottom: 8px;
}

.circuit-info-visual {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(10, 56, 78, 0.2);
  border-radius: 8px;
  background: #eef4f5;
  box-shadow: 0 16px 32px rgba(10, 42, 58, 0.16);
}

.circuit-info-visual img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 410px;
  object-fit: cover;
  object-position: center;
}

.circuit-info-feature-copy {
  display: grid;
  align-content: center;
}

.circuit-info-feature-copy .circuit-info-section:first-child {
  border-top: 0;
}

.circuit-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 28px;
}

.circuit-info-section {
  padding: 20px 0;
  border-top: 1px solid rgba(10, 56, 78, 0.16);
}

.circuit-info-section:nth-child(-n + 2) {
  border-top: 0;
}

.circuit-info-section h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.circuit-info-section p {
  margin: 0;
  line-height: 1.6;
}

.circuit-points-section {
  margin-top: 18px;
  border-top: 1px solid rgba(99, 115, 129, 0.24);
  padding-top: 18px;
}

.circuit-points-section h2 {
  margin: 3px 0 6px;
  color: #17212b;
  font-size: 1.15rem;
}

.circuit-points-section p {
  margin: 0 0 14px;
  color: #526170;
  line-height: 1.55;
}

.circuit-points-table-wrap {
  overflow-x: auto;
}

.circuit-points-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  color: #17212b;
  background: rgba(255, 255, 255, 0.86);
}

.circuit-points-table th,
.circuit-points-table td {
  border-bottom: 1px solid rgba(99, 115, 129, 0.2);
  padding: 10px 12px;
  text-align: right;
  white-space: nowrap;
}

.circuit-points-table th:first-child,
.circuit-points-table td:first-child {
  text-align: left;
}

.circuit-points-table thead th {
  color: #fff;
  background: #174b58;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.ranking-full-list .ranking-row,
.ranking-full-list .ranking-head {
  grid-template-columns: 70px 1fr 120px 120px 120px;
}

@media (max-width: 860px) {
  .tournament-bracket {
    grid-template-columns: 1fr;
  }

  .league-standings-grid {
    grid-template-columns: 1fr;
  }

  .league-standings-head,
  .league-standings-row {
    grid-template-columns: 34px minmax(0, 1fr) 48px 64px 64px;
    gap: 6px;
  }
}

.center-lane {
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: stretch;
  justify-items: center;
  padding: 12px 0;
  background: rgba(255, 255, 255, 0.16);
}

.previous-turn {
  width: calc(100% - 18px);
  min-height: 210px;
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 253, 248, 0.86);
}

.center-endurance {
  display: grid;
  place-items: center;
  gap: 2px;
  margin: 0 auto 8px;
  border: 1px solid rgba(240, 154, 145, 0.7);
  border-radius: 8px;
  padding: 8px 12px;
  color: #cf4d45;
  background: #fff0ee;
}

.center-set-stack {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin: 0 auto 8px;
}

.center-set-score {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  justify-items: center;
  gap: 10px;
  width: fit-content;
  margin: 0 auto;
  border: 1px solid rgba(199, 236, 62, 0.62);
  border-radius: 8px;
  padding: 7px 12px;
  color: #e9ff70;
  background: rgba(16, 42, 24, 0.86);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.center-set-score.live-set-score {
  border-color: rgba(216, 243, 220, 0.72);
}

.center-set-score.completed-set-score {
  opacity: 0.78;
  transform: scale(0.88);
}

.center-match-markers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.set-marker-image {
  width: 36px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 8px 14px rgba(10, 32, 44, 0.22);
}

.center-set-score span {
  min-width: 0;
  color: #f7ffe1;
  font-size: 0.64rem;
  font-weight: 950;
  text-align: center;
  text-transform: uppercase;
}

.center-set-score strong {
  color: #f7ffe1;
  font-size: 1.25rem;
  line-height: 1;
}

.score-digit-image {
  display: block;
  width: 34px;
  height: 44px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.score-digit-fallback {
  display: grid;
  place-items: center;
  width: 34px;
  height: 44px;
  border-radius: 4px;
  color: #c7ec3e;
  background: #27511e;
  font-size: 1.5rem;
  font-weight: 950;
}

.center-endurance.low-endurance {
  border-color: rgba(255, 255, 255, 0.44);
  color: #fff;
  background: #c92828;
}

.center-endurance strong {
  font-size: 1.45rem;
  line-height: 1;
}

.center-endurance span {
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.previous-title {
  margin: 0 0 6px;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.previous-empty {
  display: grid;
  place-items: center;
  min-height: 86px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.previous-card-row,
.played-history-row,
.center-card-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.center-card-wrap {
  align-items: center;
  min-height: 126px;
  margin-top: 18px;
}

.remise-underlay-wrap {
  position: relative;
  width: 148px;
}

.remise-underlay-shot {
  position: relative;
  z-index: 3;
  width: 148px;
}

.remise-underlay-layer {
  position: absolute;
  left: 3px;
  top: 37px;
  z-index: 1;
  width: calc(100% - 19px);
  pointer-events: none;
}

.remise-underlay-wrap.has-boost .remise-underlay-layer {
  top: 71px;
}

.played-history-row .remise-underlay-wrap,
.played-history-row .remise-underlay-shot {
  width: 125px;
}

.played-history-row .remise-underlay-shot .played-visual.center-played {
  width: 125px;
}

.played-history-row .remise-underlay-layer {
  left: 3px;
  top: 41px;
  width: calc(100% - 3px);
}

.remise-underlay-layer img {
  display: block;
  width: 100%;
  aspect-ratio: 731 / 1039;
  border: 2px solid rgba(23, 33, 43, 0.14);
  border-radius: var(--game-card-radius);
  object-fit: cover;
  box-shadow: 0 8px 16px rgba(10, 32, 44, 0.28);
}

.remise-underlay-layer span {
  position: absolute;
  left: 50%;
  bottom: 9px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  min-width: 42px;
  min-height: 32px;
  border: 2px solid #f1cf55;
  border-radius: 999px;
  padding: 3px 10px;
  color: #f1cf55;
  background: #080b0d;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.34);
  font-size: 1rem;
  font-weight: 1000;
  line-height: 1;
}

.center-card-wrap + .next-exchange-button,
.previous-empty + .next-exchange-button {
  margin: 12px auto 0;
}

.center-card-wrap.boosted-center-wrap + .next-exchange-button {
  margin-top: 140px;
}

.center-card-wrap.has-remise-underlay + .center-progression-actions {
  margin-top: 34px;
}

.next-set-button {
  margin-top: 10px;
  background: #90f0b8;
}

.played-visual {
  position: relative;
  overflow: visible;
  width: 148px;
  border: 2px solid rgba(23, 33, 43, 0.12);
  border-radius: 8px;
  padding: 0;
  color: inherit;
  background: #f7faf8;
  box-shadow: 0 7px 16px rgba(9, 71, 74, 0.16);
}

.played-visual > img:not(.boost-sacrifice-back) {
  position: relative;
  z-index: 2;
  border-radius: 6px;
}

.boost-sacrifice-layer {
  position: absolute;
  left: 0;
  top: 20%;
  z-index: 1;
  width: 100%;
  pointer-events: none;
}

.boost-sacrifice-back {
  display: block;
  width: 100%;
  opacity: 0.96;
  border-radius: 6px;
  box-shadow: 0 8px 16px rgba(10, 32, 44, 0.28);
}

.boost-sacrifice-label {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 3px 8px;
  color: #111827;
  background: var(--accent);
  border: 1px solid rgba(17, 24, 39, 0.18);
  font-size: 0.58rem;
  font-weight: 950;
  letter-spacing: 0;
  box-shadow: 0 5px 10px rgba(10, 32, 44, 0.18);
}

.played-visual.latest-card {
  width: min(224px, 48vw);
}

.played-visual.center-played {
  width: min(260px, calc(100% - 16px));
}

.played-visual.history-card {
  width: 125px;
}

.played-visual.history-card:hover {
  box-shadow: 0 22px 60px rgba(10, 32, 44, 0.36);
}

.remise-forbid-overlay {
  position: absolute !important;
  left: 50%;
  top: 74%;
  z-index: 5 !important;
  width: 18% !important;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain !important;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.38));
}

.played-visual.removed {
  filter: grayscale(0.75);
  opacity: 0.72;
}

.played-chip {
  position: absolute;
  right: 4px;
  bottom: 4px;
  border-radius: 999px;
  padding: 3px 5px;
  color: #111827;
  background: var(--accent);
  font-size: 0.58rem;
  font-weight: 950;
}

.removed-chip {
  left: 4px;
  right: auto;
  color: #fff;
  background: var(--danger);
}

.net-line {
  width: 8px;
  min-height: 100%;
  border-radius: 999px;
  background: repeating-linear-gradient(0deg, #fff 0 18px, rgba(255, 255, 255, 0.25) 18px 34px);
}

.log {
  width: calc(100% - 18px);
  max-height: 260px;
  overflow: auto;
  border-radius: 8px;
  padding: 10px;
  color: #17212b;
  background: rgba(255, 253, 248, 0.92);
  font-size: 0.78rem;
  line-height: 1.35;
}

.log p {
  margin: 0 0 8px;
}

.log-effect-blue {
  color: #0369a1;
  font-weight: 950;
}

.log-effect-rose {
  color: #be185d;
  font-weight: 950;
}

.engaged,
.latest-played,
.played-history {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.engaged-title {
  margin: 0;
  color: #f7fffb;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.played-card {
  border-radius: 8px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(23, 33, 43, 0.14);
  font-size: 0.84rem;
}

.played-card strong {
  display: block;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 24, 40, 0.48);
}

.tournament-loading-backdrop {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 20, 31, 0.62);
  backdrop-filter: blur(2px);
}

.tournament-loading-panel {
  display: grid;
  gap: 9px;
  width: min(420px, 100%);
  border: 1px solid rgba(229, 125, 157, 0.82);
  border-radius: 8px;
  padding: 24px;
  color: #fff;
  text-align: center;
  background: #0b3448;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.45);
}

.tournament-loading-kicker {
  color: #f2abc0;
  font-size: 0.72rem;
  font-weight: 950;
}

.tournament-loading-panel strong {
  font-size: 1.2rem;
}

.tournament-loading-panel p {
  margin: 0;
  color: #dcecf2;
  line-height: 1.45;
}

.tournament-loading-track {
  height: 7px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.18);
}

.tournament-loading-track span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: #e57d9d;
  animation: tournamentLoadingProgress 1.15s ease-in-out infinite;
}

@keyframes tournamentLoadingProgress {
  from { transform: translateX(-110%); }
  to { transform: translateX(340%); }
}

.image-zoom-backdrop {
  z-index: 3000;
  cursor: zoom-out;
}

.card-local-preview {
  position: fixed;
  z-index: 1000;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.96);
  border-radius: 6% / 4.25%;
  background: #f7faf8;
  opacity: 0;
  pointer-events: none;
  transition: opacity 100ms ease;
  box-shadow: 0 26px 80px rgba(4, 20, 31, 0.52);
}

.card-local-preview.visible {
  opacity: 1;
}

.card-local-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: auto;
}

.image-zoom-figure {
  width: min(731px, calc(100vw - 42px));
  max-height: calc(100vh - 42px);
  margin: 0;
  display: grid;
  place-items: center;
}

.image-zoom-figure img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 42px);
  border-radius: 8px;
  object-fit: contain;
  image-rendering: auto;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}

.image-zoom-figure img[src*="assets/cards/"][src*=".webp"] {
  width: auto;
  max-width: 100%;
  height: auto;
}

.image-zoom-close {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  background: rgba(15, 23, 42, 0.88);
  font-size: 1.6rem;
  line-height: 1;
}

#menuScreen .menu-mode-group button,
#menuScreen .online-lobby-panel button,
#menuScreen .online-lobby-panel select,
#profileScreen .profile-content,
#profileScreen .profile-content button,
#profileScreen .profile-content input {
  font-size: 0.82rem;
}

@media (hover: none) {
  .played-visual.history-card:hover,
  .played-visual.center-played:hover,
  .played-visual:hover {
    transform: none;
  }
}

.modal {
  width: min(720px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  overflow: auto;
  border-radius: 8px;
  padding: 18px;
  background: var(--paper);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.35);
}

.modal h2 {
  margin: 0 0 6px;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.pro-news-backdrop {
  z-index: 1200;
  background: rgba(5, 20, 31, 0.72);
  backdrop-filter: blur(4px);
}

.pro-news-modal {
  position: relative;
  display: grid;
  grid-template-columns: minmax(170px, 0.72fr) minmax(260px, 1.28fr);
  align-items: center;
  gap: clamp(18px, 4vw, 34px);
  width: min(760px, 100%);
  border: 1px solid rgba(229, 125, 157, 0.7);
  border-radius: 18px;
  padding: clamp(18px, 4vw, 30px);
  background: linear-gradient(145deg, #f9fffc 0%, #eef8f5 58%, #fcecf2 100%);
}

.pro-news-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 44px;
  min-width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  color: #fff;
  font-size: 1.65rem;
  line-height: 1;
  background: rgba(5, 20, 31, 0.82);
}

.pro-news-copy {
  display: grid;
  justify-items: start;
  max-height: min(72vh, 680px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.pro-news-card-frame {
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.98);
  border-radius: 6.4% / 4.55%;
  background: #fff;
  box-shadow: 0 22px 50px rgba(5, 35, 45, 0.28);
}

.pro-news-card-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.pro-news-copy {
  min-width: 0;
}

.pro-news-copy h2 {
  width: 100%;
  margin-inline: 0;
  text-align: left;
  color: #0b3448;
  font-size: clamp(1.45rem, 4vw, 2.25rem);
  line-height: 1.06;
}

.pro-news-copy > p:not(.label):not(.pro-news-signature) {
  white-space: pre-line;
  color: #314657;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.58;
}

.pro-news-signature {
  margin: 14px 0 0;
  color: #b03f65;
  font-weight: 950;
}

@media (max-width: 620px) {
  .pro-news-modal {
    grid-template-columns: 1fr;
    max-height: calc(100vh - 24px);
    padding: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .pro-news-card-frame {
    width: min(190px, 52vw);
    margin: 0 auto;
  }

  .pro-news-copy {
    max-height: none;
    overflow: visible;
  }
}

.return-lobby-modal {
  width: min(440px, 100%);
}

.friendly-round-countdown-modal {
  width: min(430px, 100%);
  text-align: center;
}

.friendly-round-countdown-modal p:not(.label) {
  margin: 16px 0 6px;
  color: #425466;
  font-weight: 800;
}

.friendly-round-countdown-number {
  display: block;
  min-height: 76px;
  color: #b91c1c;
  font-size: 4rem;
  line-height: 1.1;
}

.friendly-disconnect-modal {
  width: min(480px, 100%);
  text-align: center;
}

.friendly-disconnect-modal > p:not(.label) {
  color: #425466;
  font-weight: 750;
}

.friendly-disconnect-countdown {
  display: grid;
  grid-template-columns: 1fr 84px 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  border-radius: 8px;
  padding: 14px;
  color: #7f1d1d;
  background: #fee2e2;
  font-weight: 900;
}

.friendly-disconnect-countdown strong {
  font-size: 2.8rem;
  line-height: 1;
}

.waiting-room-modal {
  width: min(460px, 100%);
  text-align: center;
}

.waiting-room-modal h2 {
  color: #075985;
  letter-spacing: 0;
}

.waiting-room-modal .dialog-actions {
  justify-content: center;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.choice-card {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  background: #f7faf8;
}

.choice-card-visual {
  overflow: hidden;
  border-radius: 8px;
  background: #e8f3ef;
}

.choice-card-visual img {
  display: block;
  width: 100%;
  aspect-ratio: 731 / 1039;
  object-fit: cover;
}

.choice-card strong {
  display: block;
  margin-top: 7px;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.choice-card span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .court,
  .scoreboard {
    grid-template-columns: 1fr;
  }

  .center-lane {
    min-height: 120px;
    grid-template-columns: 1fr;
  }

  .net-line {
    width: 100%;
    height: 8px;
    min-height: 8px;
  }
}

@media (max-width: 720px) {
  .academy-deck-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .academy-copy-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .academy-copy-grid > div + div {
    border-top: 1px solid rgba(10, 56, 78, 0.16);
    border-left: 0;
    padding-top: 26px;
    padding-left: 0;
  }

  .academy-shop-callout {
    align-items: stretch;
    flex-direction: column;
  }

  .academy-gallery-arrow {
    width: 44px;
    height: 44px;
    font-size: 2.25rem;
  }

  .academy-shop-button {
    justify-content: center;
    text-align: center;
  }

  .circuit-info-grid {
    grid-template-columns: 1fr;
  }

  .circuit-info-feature {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .circuit-info-visual img {
    height: auto;
    min-height: 0;
  }

  .circuit-info-section:nth-child(2) {
    border-top: 1px solid rgba(10, 56, 78, 0.16);
  }

  .app {
    width: min(100vw - 18px, 1440px);
    padding-top: 12px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-grid,
  .hand {
    grid-template-columns: 1fr 1fr;
  }

  .opponent-inline {
    display: inline;
    color: inherit !important;
    opacity: 0.78;
  }

  .opponent-inline.critical-opponent {
    color: inherit !important;
    font-weight: 1000;
    opacity: 1;
  }

  .character-power-reminder strong {
    font-size: 2.35rem;
  }

  .character-endurance-reminder strong {
    font-size: 1.6rem;
  }

  .player-panel {
    padding: 12px;
  }
}

/* Les cartes V165 sont des WebP sans transparence. Cette bordure arrondie
   recouvre les quatre coins blancs et restitue la découpe des anciens PNG. */
.card-visual > img[src*="assets/cards/"][src*=".webp"]:not(.forbid-effect-overlay),
.character-card > img[src*="assets/cards/"][src*=".webp"],
.played-visual > img[src*="assets/cards/"][src*=".webp"]:not(.remise-forbid-overlay),
.profile-character-visual img[src*="assets/cards/"][src*=".webp"],
.profile-character-choice img[src*="assets/cards/"][src*=".webp"],
.academy-deck-card > img[src*="assets/cards/"][src*=".webp"],
.image-zoom-figure img[src*="assets/cards/"][src*=".webp"],
.choice-card-visual img[src*="assets/cards/"][src*=".webp"],
.tutorial-card-showcase img[src*="assets/cards/"][src*=".webp"],
.confrontation-intro-player img[src*="assets/cards/"][src*=".webp"] {
  box-sizing: border-box;
  border: 0;
  border-radius: 6% / 4.25%;
  background: #f7faf8;
}

.card-image-zoom-trigger {
  width: 100%;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  cursor: zoom-in;
}

/* Lobby redesign --------------------------------------------------------- */
.lobby-home-screen,
.lobby-section-screen {
  width: min(1120px, calc(100vw - 40px));
  padding: 22px 0 28px;
}

.lobby-home-shell,
.lobby-section-shell {
  gap: 18px;
}

.lobby-app-header,
.lobby-section-header {
  position: relative;
  z-index: 20;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 14px 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 18px;
  background: rgba(7, 35, 58, 0.88);
  box-shadow: 0 10px 28px rgba(2, 16, 31, 0.2);
  backdrop-filter: blur(14px);
}

.lobby-header-logo,
.lobby-section-logo {
  width: min(330px, 38vw);
  height: 48px;
  object-fit: contain;
  object-position: left center;
}

.lobby-header-actions,
.lobby-account-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.lobby-user-chip,
.lobby-icon-button,
.lobby-admin-button {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 13px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  transition: background 180ms ease, transform 180ms ease;
}

.lobby-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 166px;
  padding: 6px 12px 6px 7px;
  text-align: left;
}

.lobby-user-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  overflow: hidden;
  border: 2px solid #f2c84b;
  border-radius: 10px;
  color: #07334d;
  background: #f2c84b;
  font-size: 0.72rem;
  font-weight: 950;
}

.lobby-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 14%;
  transform: scale(1.35);
  transform-origin: 50% 18%;
}

.lobby-user-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.lobby-user-copy strong,
.lobby-user-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lobby-user-copy strong {
  font-size: 0.84rem;
}

.lobby-user-copy small {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lobby-icon-button {
  display: grid;
  width: 44px;
  padding: 10px;
  place-items: center;
}

.lobby-icon-button svg,
.lobby-icon-button img {
  width: 21px;
  height: 21px;
  fill: currentColor;
  filter: invert(1);
}

.lobby-admin-button {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 15px;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lobby-admin-button img {
  width: 18px;
  height: 18px;
  filter: invert(1);
}

.lobby-user-chip:hover,
.lobby-icon-button:hover,
.lobby-admin-button:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.lobby-account-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  width: min(390px, calc(100vw - 40px));
  max-height: min(720px, calc(100vh - 112px));
  gap: 14px;
  overflow: auto;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 0 24px 60px rgba(2, 12, 27, 0.38);
}

.lobby-account-popover .latest-news-panel {
  grid-column: auto;
  margin-top: 2px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.lobby-account-popover .latest-news-item {
  grid-template-columns: 56px minmax(0, 1fr);
}

.lobby-account-popover .latest-news-read-button {
  grid-column: 1 / -1;
}

.lobby-hero {
  position: relative;
  aspect-ratio: 16 / 7.5;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 22px;
  background: #0a304c;
  box-shadow: 0 18px 38px rgba(2, 16, 31, 0.28);
}

.lobby-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.lobby-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.lobby-mode-card {
  --mode-color: #3f8fe8;
  position: relative;
  min-width: 0;
  height: 222px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 0;
  color: #fff;
  background: #123a54;
  box-shadow: 0 12px 30px rgba(2, 16, 31, 0.24);
  text-align: left;
  transition: filter 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.lobby-mode-card::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, color-mix(in srgb, var(--mode-color) 88%, #071c2c) 0%, color-mix(in srgb, var(--mode-color) 52%, transparent) 46%, rgba(4, 18, 31, 0.14) 100%);
  content: "";
}

.lobby-mode-card::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  height: 5px;
  background: var(--mode-color);
  content: "";
}

.lobby-mode-card > .lobby-mode-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 72% 28%;
}

.lobby-mode-training { --mode-color: #357ed5; }
.lobby-mode-solo { --mode-color: #d8ad25; }
.lobby-mode-online { --mode-color: #11a99f; }
.lobby-mode-circuit { --mode-color: #2f9a61; }
.lobby-mode-circuit > .lobby-mode-art { object-position: 70% 50%; }
.lobby-mode-training > .lobby-mode-art,
.lobby-mode-solo > .lobby-mode-art { object-position: 72% 40%; }

.lobby-mode-icon {
  position: absolute;
  top: 18px;
  left: 20px;
  z-index: 3;
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.25));
}

.lobby-mode-card-copy {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 3;
  display: grid;
  max-width: 62%;
  gap: 4px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.lobby-mode-card-copy strong {
  font-size: clamp(1.45rem, 2.35vw, 2.05rem);
  font-weight: 950;
  letter-spacing: -0.035em;
}

.lobby-mode-card-copy small {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.88rem;
  font-weight: 700;
}

.lobby-mode-arrow {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 3;
  display: grid;
  width: 35px;
  height: 35px;
  padding: 7px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 50%;
  background: rgba(4, 19, 31, 0.28);
  font-size: 1.2rem;
  filter: invert(1);
}

.lobby-mode-card:not(:disabled):hover {
  filter: brightness(1.06);
  box-shadow: 0 16px 36px rgba(2, 16, 31, 0.3);
  transform: scale(1.018);
}

.lobby-mode-card:focus-visible,
.lobby-user-chip:focus-visible,
.lobby-icon-button:focus-visible,
.lobby-admin-button:focus-visible,
.lobby-shop-banner:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.lobby-mode-card.locked {
  z-index: 1;
  opacity: 1;
  filter: grayscale(1) saturate(.2) brightness(.72);
  isolation: isolate;
  box-shadow: none;
  cursor: not-allowed;
}

.lobby-mode-card.locked::after {
  content: none;
}

/* V6.3 compact, readable 8/16/32-player Solo brackets. */
.tournament-panel .tournament-bracket {
  gap: 9px;
}

.tournament-panel .tournament-column {
  gap: 7px;
  min-width: 174px;
}

.tournament-panel .tournament-match {
  gap: 4px;
  padding: 7px;
}

.tournament-panel .tournament-match-head {
  gap: 5px;
}

.tournament-panel .tournament-round-label,
.tournament-panel .tournament-match-status {
  font-size: .52rem;
}

.tournament-panel .tournament-player-row {
  min-height: 29px;
  padding: 4px 6px;
  font-size: .68rem;
}

.tournament-panel .tournament-player-identity {
  line-height: 1.15;
}

.tournament-panel .tournament-set-scores {
  gap: 3px;
}

.tournament-panel .tournament-set-scores span {
  min-width: 34px;
  padding: 3px 5px;
  font-size: .7rem;
}

.lobby-shop-banner {
  display: grid;
  grid-template-columns: minmax(190px, 30%) minmax(0, 1fr) auto;
  min-height: 142px;
  align-items: center;
  gap: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 0 24px 0 0;
  color: #fff;
  background: linear-gradient(110deg, #0a354e, #115b68);
  box-shadow: 0 12px 30px rgba(2, 16, 31, 0.22);
  text-decoration: none;
  transition: filter 180ms ease, transform 180ms ease;
}

.lobby-shop-banner:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
}

.lobby-shop-banner > img {
  width: 100%;
  height: 142px;
  object-fit: cover;
  object-position: center;
}

.lobby-shop-copy {
  display: grid;
  gap: 6px;
}

.lobby-shop-copy strong {
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
}

.lobby-shop-copy small {
  max-width: 580px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.87rem;
  line-height: 1.45;
}

.lobby-shop-button {
  white-space: nowrap;
}

.lobby-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 2px 4px 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.72rem;
  font-weight: 700;
}

.lobby-section-header {
  margin-bottom: 4px;
}

.lobby-destination-panel,
.lobby-circuit-layout {
  min-height: 300px;
}

.lobby-destination-panel {
  display: grid;
  align-content: start;
  gap: 28px;
  padding: clamp(24px, 4vw, 44px);
}

.lobby-destination-heading .label,
.lobby-destination-heading h1 {
  margin: 0;
}

.lobby-destination-heading h1 {
  margin-top: 6px;
  color: #10364d;
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  letter-spacing: -0.035em;
}

.lobby-destination-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lobby-destination-actions > button,
.lobby-pro-action > button {
  min-height: 56px;
}

.lobby-pro-action {
  display: grid;
  gap: 6px;
}

.lobby-circuit-layout {
  display: grid;
  gap: 16px;
}

/* Pages de mode — continuité visuelle du lobby */
.mode-page {
  gap: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  background: #f4f7f8;
  box-shadow: 0 24px 70px rgba(2, 20, 34, 0.28);
}

.mode-page-hero {
  position: relative;
  min-height: 250px;
  overflow: hidden;
  margin: 0;
  color: #fff;
  background: #0a334a;
}

.mode-page-hero::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(4, 25, 40, 0.94) 0%, rgba(4, 25, 40, 0.7) 40%, rgba(4, 25, 40, 0.08) 78%);
  content: "";
}

.mode-page-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 68% 42%;
}

.mode-page-hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  width: min(560px, 62%);
  min-height: 250px;
  gap: 8px;
  padding: clamp(28px, 5vw, 58px);
}

.mode-page-hero-copy .label,
.mode-page-hero-copy h1,
.mode-page-hero-copy p {
  margin: 0;
}

.mode-page-hero-copy .label {
  color: #7dd3fc;
  letter-spacing: 0.13em;
}

.mode-page-hero-copy h1 {
  color: #fff;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 950;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.mode-page-hero-copy > p:last-child {
  max-width: 500px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.5;
}

.training-page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.38fr);
  gap: 22px;
  padding: clamp(22px, 4vw, 38px);
}

.training-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.training-action-card {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 28px;
  gap: 14px;
  align-items: center;
  min-height: 150px;
  border: 1px solid #d6e0e5;
  border-radius: 18px;
  padding: 20px;
  color: #12364b;
  background: #fff;
  box-shadow: 0 9px 25px rgba(18, 54, 75, 0.07);
  text-align: left;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.training-action-card:hover {
  border-color: #6aaee5;
  box-shadow: 0 14px 30px rgba(18, 54, 75, 0.13);
  transform: translateY(-2px);
}

.training-action-card > span:nth-child(2) {
  display: grid;
  gap: 5px;
}

.training-action-card small {
  color: #3783b6;
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.training-action-card strong {
  font-size: 1.25rem;
  font-weight: 950;
}

.training-action-card em {
  color: #617482;
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1.35;
}

.training-action-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, #1597dc, #3157d9);
  font-size: 1.2rem;
  font-weight: 950;
}

.training-action-icon img {
  width: 48px;
  height: 48px;
}

.training-action-icon-set {
  background: linear-gradient(135deg, #1aa76c, #087d65);
}

.training-action-icon-academy {
  color: #10364d;
  background: linear-gradient(135deg, #ffe889, #f4ba2e);
}

.training-action-arrow {
  width: 27px;
  height: 27px;
  opacity: 0.45;
}

.training-coach-card {
  display: grid;
  align-content: end;
  min-height: 314px;
  overflow: hidden;
  border-radius: 20px;
  padding: 28px;
  color: #fff;
  background: linear-gradient(160deg, rgba(9, 61, 89, 0.25), rgba(4, 29, 45, 0.94)), url("./assets/ENTRAINEMENT.jpg") center / cover;
  box-shadow: 0 18px 38px rgba(8, 42, 62, 0.22);
}

.training-coach-kicker {
  color: #7dd3fc;
  font-size: 0.7rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.training-coach-card h2 {
  margin: 8px 0;
  font-size: 1.55rem;
  line-height: 1.05;
}

.training-coach-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
}

.training-coach-path {
  display: flex;
  align-items: center;
  margin-top: 22px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
}

.training-coach-path span.active { color: #7dd3fc; }
.training-coach-path i { flex: 1; height: 1px; margin: 0 7px; background: rgba(255, 255, 255, 0.26); }

.mode-page-hero-action {
  position: absolute;
  right: 22px;
  bottom: 22px;
  z-index: 2;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  padding: 0 16px;
  color: #fff;
  background: rgba(5, 28, 43, 0.58);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 900;
}

.online-clubhouse-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 30px 10px;
}

.online-clubhouse-toolbar > div {
  display: grid;
  grid-template-columns: 10px auto;
  align-items: center;
  gap: 2px 9px;
}

.online-clubhouse-toolbar small { grid-column: 2; color: #71818c; font-weight: 700; }
.online-status-dot { width: 10px; height: 10px; border-radius: 50%; background: #21b87a; box-shadow: 0 0 0 5px rgba(33, 184, 122, 0.12); }
.online-clubhouse-list { margin: 0; padding: 14px 30px 28px; }
.online-access-note { margin: 0 30px 24px; }

.online-clubhouse-list .lobby-room {
  grid-template-columns: 48px minmax(0, 1fr) auto;
  min-height: 78px;
  border-radius: 16px;
  padding: 15px 18px;
  background: #fff;
  box-shadow: 0 7px 18px rgba(16, 54, 75, 0.06);
}

.online-room-format-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
}

.online-room-format-icon img { width: 44px; height: 44px; }

.mode-clubhouse-screen {
  background: radial-gradient(circle at 50% 0, rgba(36, 142, 184, 0.23), transparent 36%), #082a3e;
}

.ai-club-house-screen,
.championship-lobby-screen {
  background: transparent;
}

.championship-lobby-screen .mode-clubhouse-topbar {
  border-color: #d8e2e5;
  background: rgba(255,255,255,.94);
}

.championship-lobby-screen :is(h1, h2, h3, p, span, strong, b, small, button) {
  color: #243947 !important;
}

.championship-lobby-screen :is(.primary-button, .small-button) {
  border: 1px solid #b9ccc8;
  background: #dcebe6;
}

.championship-lobby-group b {
  color: #315f52;
}

.mode-clubhouse-topbar {
  min-height: 64px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 8px 14px;
  background: rgba(5, 30, 45, 0.76);
}

.mode-clubhouse-topbar .menu-logo { width: min(310px, 42vw); height: 46px; }

.mode-clubhouse-panel {
  gap: 0;
  overflow: hidden;
  padding: 0;
  border-radius: 24px;
  background: #f4f7f8;
  box-shadow: 0 26px 70px rgba(1, 14, 23, 0.32);
}

.solo-clubhouse-hero { min-height: 230px; }
.solo-clubhouse-hero .mode-page-hero-copy { min-height: 230px; }

.clubhouse-format-section {
  display: grid;
  gap: 18px;
  padding: 28px 32px 20px;
}

.clubhouse-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.clubhouse-section-heading .label,
.clubhouse-section-heading h2 { margin: 0; }
.clubhouse-section-heading h2 { margin-top: 5px; color: #12364b; font-size: 1.45rem; }
.clubhouse-friendly-note { color: #71818c; font-size: 0.72rem; font-weight: 850; }

.clubhouse-format-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.clubhouse-format-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  min-height: 112px;
  border: 2px solid #d8e2e7;
  border-radius: 18px;
  padding: 17px;
  color: #173b50;
  background: #fff;
  text-align: left;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.clubhouse-format-card:not(:disabled):hover { border-color: #5ea9d6; transform: translateY(-2px); }
.clubhouse-format-card.active { border-color: #1597dc; background: #edf8ff; box-shadow: 0 10px 25px rgba(21, 151, 220, 0.14); }
.clubhouse-format-card:disabled { cursor: not-allowed; filter: grayscale(0.65); opacity: 0.58; }
.clubhouse-format-card > img { width: 44px; height: 44px; }
.clubhouse-format-card > span { display: grid; gap: 3px; }
.clubhouse-format-card small { color: #50809a; font-size: 0.62rem; font-weight: 950; letter-spacing: 0.07em; text-transform: uppercase; }
.clubhouse-format-card strong { font-size: 1rem; font-weight: 950; }
.clubhouse-format-card em { color: #71818c; font-size: 0.72rem; font-style: normal; font-weight: 700; line-height: 1.3; }

.clubhouse-configuration-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.34fr);
  gap: 18px;
  align-items: start;
  padding: 8px 32px 34px;
}

.clubhouse-settings-card {
  gap: 0;
  overflow: hidden;
  border: 1px solid #d8e2e7;
  border-top: 0;
  border-radius: 18px;
  padding: 0;
  background: #fff;
}

.clubhouse-settings-card .friendly-setting-row {
  padding: 17px 18px;
  border-bottom: 1px solid #e4ebee;
}

.clubhouse-settings-card .friendly-setting-row:last-child { border-bottom: 0; }

.clubhouse-summary-card {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
  border-radius: 19px;
  padding: 22px;
  color: #fff;
  background: linear-gradient(145deg, #123f58, #082c42);
  box-shadow: 0 18px 35px rgba(7, 42, 62, 0.2);
}

.clubhouse-summary-card .label { margin: 0; color: #7dd3fc; }
.clubhouse-summary-card h2 { margin: 0; color: #fff; font-size: 1.55rem; }
.clubhouse-summary-text { min-height: 64px; color: rgba(255, 255, 255, 0.74); font-size: 0.8rem; font-weight: 750; line-height: 1.5; }
.clubhouse-access-message { border: 1px solid rgba(250, 204, 21, 0.35); border-radius: 11px; padding: 10px; color: #fde68a; background: rgba(250, 204, 21, 0.08); font-size: 0.74rem; font-weight: 800; }
.clubhouse-summary-footnote { color: rgba(255, 255, 255, 0.46); font-weight: 700; line-height: 1.4; }
.clubhouse-summary-card .ai-club-house-start-button { min-height: 50px; }
.clubhouse-summary-card .ai-club-house-save-actions { display: grid; gap: 8px; }
.clubhouse-summary-card .ai-club-house-save-actions.hidden { display: none; }

.friendly-lobby-screen:not(.ai-club-house-screen) .friendly-lobby-panel {
  border-radius: 22px;
  background: #f4f7f8;
  box-shadow: 0 24px 65px rgba(2, 20, 34, 0.25);
}

.online-room-hero {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  border-radius: 17px;
  color: #fff;
  background: #07354d;
}

.online-room-hero::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(4, 30, 46, 0.94), rgba(4, 30, 46, 0.26));
  content: "";
}

.online-room-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 65% 38%;
}

.online-room-hero > div {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  width: min(520px, 62%);
  min-height: 210px;
  padding: 30px;
}

.online-room-hero .label,
.online-room-hero h1,
.online-room-hero p { margin: 0; }
.online-room-hero .label { color: #67e8f9; }
.online-room-hero h1 { margin: 5px 0; color: #fff; font-size: clamp(2rem, 4vw, 3.15rem); line-height: 1; }
.online-room-hero p { color: rgba(255, 255, 255, 0.76); font-weight: 750; }

.clubhouse-room-heading h2 {
  margin: 0;
  color: #173b50;
  font-size: 1.5rem;
}

.clubhouse-inline-formats .friendly-setting-button.active {
  background: linear-gradient(135deg, #0fa89b, #087b79);
}

.friendly-lobby-screen:not(.ai-club-house-screen) .friendly-settings-panel {
  border: 1px solid #d8e2e7;
  border-top: 4px solid #0f8d68;
  border-radius: 17px;
  padding: 18px;
  background: #fff;
}

.friendly-lobby-screen:not(.ai-club-house-screen) .friendly-player-card,
.friendly-lobby-screen:not(.ai-club-house-screen) .friendly-bracket-card {
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(16, 54, 75, 0.06);
}

@media (max-width: 900px) {
  .championship-groups,
  .championship-matches,
  .championship-final-bracket { grid-template-columns: 1fr; }
  .championship-practical-info { grid-template-columns: repeat(2,1fr); }
  .championship-lobby-groups { grid-template-columns: 1fr; }
  .championship-day-matches,
  .championship-playoffs { grid-template-columns: repeat(2,minmax(160px,1fr)); }
  .training-page-layout,
  .clubhouse-configuration-layout { grid-template-columns: 1fr; }
  .training-coach-card { min-height: 235px; }
  .clubhouse-summary-card { position: static; }
  .clubhouse-format-card { grid-template-columns: 38px minmax(0, 1fr); padding: 14px; }
  .clubhouse-format-card > img { width: 38px; height: 38px; }
}

@media (max-width: 700px) {
  .championship-lobby-content .championship-board { padding: 10px; }
  .championship-lobby-content .championship-zone-content { padding: 8px; }
  .championship-lobby-content .championship-day { grid-template-columns: 1fr; }
  .championship-lobby-content .championship-day > header { gap: 3px; }
  .mode-page-hero,
  .solo-clubhouse-hero { min-height: 220px; }
  .mode-page-hero-copy,
  .solo-clubhouse-hero .mode-page-hero-copy { width: 80%; min-height: 220px; padding: 24px; }
  .mode-page-hero::after { background: linear-gradient(90deg, rgba(4, 25, 40, 0.94), rgba(4, 25, 40, 0.42)); }
  .training-action-grid,
  .clubhouse-format-grid { grid-template-columns: 1fr; }
  .training-page-layout,
  .clubhouse-format-section,
  .clubhouse-configuration-layout { padding: 18px; }
  .training-action-card { min-height: 120px; }
  .clubhouse-section-heading,
  .online-clubhouse-toolbar { align-items: stretch; flex-direction: column; }
  .clubhouse-format-card { min-height: 96px; }
  .clubhouse-settings-card .friendly-setting-row { grid-template-columns: 1fr; }
  .online-clubhouse-list { padding: 12px 18px 22px; }
  .online-clubhouse-list .lobby-room { grid-template-columns: 42px minmax(0, 1fr); }
  .online-clubhouse-list .lobby-room-actions { grid-column: 1 / -1; justify-content: stretch; }
  .online-clubhouse-list .lobby-room-actions button { flex: 1; }
  .online-access-note { margin: 0 18px 20px; }
  .online-room-hero > div { width: 82%; padding: 22px; }
  .mode-page-hero-action { right: 14px; bottom: 14px; }
}

@media (max-width: 900px) {
  .lobby-home-screen,
  .lobby-section-screen {
    width: min(100vw - 28px, 1120px);
    padding-top: 14px;
  }

  .lobby-mode-card {
    height: 200px;
  }

  .lobby-shop-banner {
    grid-template-columns: 210px minmax(0, 1fr);
    padding-right: 20px;
  }

  .lobby-shop-button {
    grid-column: 2;
    justify-self: start;
    margin-bottom: 16px;
  }
}

@media (max-width: 700px) {
  .lobby-app-header,
  .lobby-section-header {
    gap: 12px;
    padding: 9px 10px 9px 13px;
  }

  .lobby-header-logo,
  .lobby-section-logo {
    width: min(250px, 42vw);
  }

  .lobby-user-chip {
    min-width: 0;
  }

  .lobby-user-copy,
  .lobby-admin-button {
    display: none;
  }

  .lobby-mode-grid {
    grid-template-columns: 1fr;
  }

  .lobby-mode-card {
    height: 180px;
  }

  .lobby-shop-banner {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0 18px 18px;
  }

  .lobby-shop-banner > img {
    width: calc(100% + 36px);
    height: 125px;
    margin-left: -18px;
  }

  .lobby-shop-copy {
    padding-top: 16px;
  }

  .lobby-shop-button {
    grid-column: 1;
    margin: 14px 0 0;
  }

  .lobby-destination-actions {
    grid-template-columns: 1fr;
  }
}

/* Circuit Pro */
.circuit-pro-page {
  display: grid;
  gap: 0;
  background: #f3f6f5;
}

.circuit-page-hero::after {
  background: linear-gradient(90deg, rgba(4, 39, 29, 0.96) 0%, rgba(4, 49, 36, 0.72) 42%, rgba(4, 39, 29, 0.08) 78%);
}

.circuit-page-hero > img { object-position: 70% 52%; }
.circuit-page-hero .mode-page-hero-copy .label { color: #86efac; }
.circuit-page-hero .circuit-info-button { top: 22px; bottom: auto; }

.circuit-hero-countdown {
  position: absolute;
  right: 22px;
  bottom: 22px;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 11px;
  padding: 9px 13px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(3, 29, 21, 0.58);
  font-size: 0.7rem;
  font-weight: 850;
}

.circuit-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 28px 30px 10px;
}

.circuit-stat-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  min-height: 112px;
  border: 1px solid #d8e3df;
  border-radius: 17px;
  padding: 17px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(12, 54, 39, 0.06);
}

.circuit-stat-card > img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.circuit-stat-card > span { display: grid; min-width: 0; gap: 2px; }
.circuit-stat-card small { color: #6b7d75; font-size: 0.64rem; font-weight: 950; letter-spacing: 0.06em; text-transform: uppercase; }
.circuit-stat-card strong { color: #103e2d; font-size: 1.55rem; font-weight: 950; line-height: 1; }
.circuit-stat-card em { overflow: hidden; color: #7a8a83; font-size: 0.67rem; font-style: normal; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.circuit-stat-attempts { border-color: #d5c06b; background: linear-gradient(145deg, #fffdf3, #fff); }

.circuit-main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.33fr);
  gap: 18px;
  align-items: start;
  padding: 18px 30px;
}

.circuit-content-card {
  border: 1px solid #d8e3df;
  border-radius: 20px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(12, 54, 39, 0.07);
}

.circuit-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.circuit-section-heading .label,
.circuit-section-heading h2 { margin: 0; }
.circuit-section-heading h2 { margin-top: 4px; color: #123e2e; font-size: 1.55rem; letter-spacing: -0.025em; }
.circuit-section-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: #edf8f2; }
.circuit-section-icon img { width: 23px; height: 23px; opacity: 0.68; }

.circuit-competition-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.circuit-attempt-banner {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #bee2cc;
  border-radius: 13px;
  padding: 11px 14px;
  color: #155b3d;
  background: #effaf3;
  font-size: 0.76rem;
  font-weight: 800;
}

.circuit-attempt-banner strong { font-size: 1.05rem; }
.circuit-attempt-banner small { color: #648073; font-weight: 750; }
.circuit-attempt-banner.empty { border-color: #ead4a1; color: #7d5b12; background: #fff9e9; }

.weekly-competition.circuit-competition-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-content: space-between;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid #dbe5e1;
  border-top: 4px solid #2e9e61;
  border-radius: 17px;
  padding: 18px;
  background: linear-gradient(155deg, #fff 65%, #f1f8f4);
  box-shadow: 0 7px 18px rgba(13, 55, 40, 0.06);
}

.weekly-competition.circuit-competition-card[data-competition-category*="slam"],
.weekly-competition.circuit-competition-card[data-competition-category*="final"] { border-top-color: #c89c25; background: linear-gradient(155deg, #fff 60%, #fff8e4); }
.weekly-competition.circuit-competition-card[data-competition-category*="crown"] { border-top-color: #7c5cc4; }
.weekly-competition.circuit-competition-card[data-competition-category*="premier"] { border-top-color: #2186bb; }
.weekly-competition.circuit-competition-card[data-competition-category*="major"] { border-top-color: #db7149; }

.circuit-competition-head,
.circuit-competition-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.circuit-competition-category {
  color: #238655;
  font-size: 0.66rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.circuit-competition-state {
  border-radius: 999px;
  padding: 5px 8px;
  color: #4e665b;
  background: #eaf2ee;
  font-size: 0.6rem;
  font-weight: 900;
  text-transform: uppercase;
}
.circuit-competition-state.saved { color: #155b3d; background: #dff5e8; }
.circuit-competition-state.played { color: #79570b; background: #fff1c7; }

.circuit-competition-copy { display: grid; gap: 5px; }
.circuit-competition-copy h3 { margin: 0; color: #153e2f; font-size: 1.15rem; line-height: 1.1; }
.circuit-competition-copy > span { color: #718078; font-size: 0.75rem; font-weight: 750; }
.circuit-competition-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.circuit-competition-meta span { border-radius: 7px; padding: 5px 7px; color: #486259; background: #eef4f1; font-size: 0.65rem; font-weight: 850; }
.circuit-competition-meta .single-entry-league-badge { border: 1px solid rgba(151,71,20,.26); color: #8a3f12; background: #fff0df; }
.circuit-competition-footer { padding-top: 12px; border-top: 1px solid #e4ebe8; }
.circuit-competition-footer > span { display: grid; gap: 1px; }
.circuit-competition-footer > span small { color: #7c8b84; font-size: 0.6rem; font-weight: 850; text-transform: uppercase; }
.circuit-competition-footer > span strong { color: #153e2f; font-size: 1rem; }

.circuit-player-card {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 18px;
  border-radius: 20px;
  padding: 22px;
  color: #fff;
  background: linear-gradient(155deg, #124b37, #082f25);
  box-shadow: 0 18px 38px rgba(4, 39, 28, 0.23);
}

.circuit-player-identity {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
}

.circuit-player-avatar {
  width: 62px;
  height: 62px;
  overflow: hidden;
  border: 3px solid #e6c557;
  border-radius: 18px;
  background: #e6c557;
}
.circuit-player-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 14%; transform: scale(1.32); transform-origin: 50% 18%; }
.circuit-player-identity > div { display: grid; min-width: 0; gap: 2px; }
.circuit-player-identity small { color: #86efac; font-size: 0.64rem; font-weight: 900; text-transform: uppercase; }
.circuit-player-identity strong { overflow: hidden; font-size: 1.08rem; text-overflow: ellipsis; white-space: nowrap; }
.circuit-player-identity em { color: rgba(255, 255, 255, 0.56); font-size: 0.68rem; font-style: normal; font-weight: 800; }

.circuit-player-metrics { display: grid; gap: 0; margin: 0; }
.circuit-player-metrics > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.circuit-player-metrics dt { color: rgba(255, 255, 255, 0.6); font-size: 0.72rem; font-weight: 750; }
.circuit-player-metrics dd { margin: 0; color: #fff; font-size: 0.95rem; font-weight: 950; text-align: right; }
.circuit-player-metrics dd small { display: block; margin-top: 2px; font-size: 0.67rem; font-weight: 800; }
.circuit-player-card > button { width: 100%; color: #123e2e; background: #e9ff70; }

.circuit-top-ranking { margin: 4px 30px 30px; }
.circuit-ranking-heading { align-items: flex-end; }
.circuit-ranking-list .ranking-head,
.circuit-ranking-list .ranking-row { border-radius: 11px; padding: 10px 12px; }
.circuit-ranking-list .ranking-row { border: 1px solid #e3eae7; background: #fbfdfc; }
.circuit-ranking-list .ranking-row.current-user { border-color: #b6cf43; background: #f5ffd2; }
.circuit-top-ranking .full-ranking-button { justify-self: center; min-width: 260px; margin-top: 18px; }

.ranking-position { display: inline-flex; align-items: baseline; gap: 2px; }
.ranking-position .ranking-projection { margin-left: 2px; }
.ranking-projection-up { color: #168251 !important; }
.ranking-projection-down { color: #d34c45 !important; }
.ranking-projection-neutral { color: #74827b !important; }

.circuit-ranking-shell { max-width: 1120px; }
.circuit-ranking-full-panel { display: grid; gap: 18px; border-radius: 22px; padding: 28px; background: #f5f8f6; box-shadow: 0 24px 65px rgba(2, 20, 34, 0.28); }
.circuit-ranking-page-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; overflow: hidden; border-radius: 18px; padding: 24px 28px; color: #fff; background: linear-gradient(135deg, #124b37, #0b3327); }
.circuit-ranking-page-header .label,
.circuit-ranking-page-header h1,
.circuit-ranking-page-header p { margin: 0; }
.circuit-ranking-page-header .label { color: #86efac; }
.circuit-ranking-page-header h1 { margin: 4px 0; font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -0.04em; }
.circuit-ranking-page-header p { color: rgba(255, 255, 255, 0.68); font-size: 0.78rem; font-weight: 750; }
.circuit-ranking-page-header > img { width: 82px; height: 82px; filter: invert(1); opacity: 0.18; }
.circuit-ranking-full-panel .ranking-full-list { gap: 7px; }
.circuit-ranking-full-panel .ranking-row { border: 1px solid #e0e8e4; border-radius: 11px; padding: 10px 12px; background: #fff; }
.circuit-ranking-full-panel .ranking-head { border-radius: 11px; padding: 10px 12px; background: #e7efeb; }
.circuit-ranking-full-panel .ranking-pagination { border-top: 1px solid #dce5e1; padding-top: 18px; }

@media (max-width: 980px) {
  .circuit-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .circuit-main-layout { grid-template-columns: 1fr; }
  .circuit-player-card { position: static; grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1fr); align-items: center; }
  .circuit-player-card > button { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body,
  body * {
    box-sizing: border-box;
  }

  .menu-screen {
    width: calc(100% - 20px);
    max-width: calc(100% - 20px);
    margin-inline: auto;
  }

  .menu-shell,
  .menu-panel,
  .mode-page,
  .content-page-screen,
  .content-page-shell,
  .content-page-panel,
  .lobby-destination-panel { width: 100%; max-width: 100%; min-width: 0; }

  .lobby-mode-grid {
    width: 100%;
    max-width: 100%;
    padding-inline: 3px;
  }

  .lobby-mode-card > .lobby-mode-art {
    inset: 5px;
    width: calc(100% - 10px);
    height: calc(100% - 10px);
    border-radius: 15px;
  }

  img,
  video,
  canvas,
  svg {
    max-width: 100%;
  }

  input,
  select,
  textarea,
  button {
    max-width: 100%;
  }
  .circuit-page-hero { min-height: 310px; }
  .circuit-page-hero .mode-page-hero-copy { width: 100%; min-width: 0; padding: 22px 18px 112px; }
  .circuit-hero-countdown { right: 14px; bottom: 14px; left: 14px; max-width: none; text-align: center; }
  .circuit-page-hero .circuit-info-button { top: auto; right: 14px; bottom: 54px; left: 14px; z-index: 3; width: auto; max-width: none; }
  .circuit-stat-grid { grid-template-columns: 1fr; padding: 18px; }
  .circuit-stat-card { min-height: 92px; }
  .circuit-main-layout { padding: 0 18px 18px; }
  .circuit-content-card { padding: 18px; }
  .circuit-competition-list { grid-template-columns: 1fr; }
  .circuit-attempt-banner { align-items: flex-start; flex-direction: column; }
  .circuit-player-card { grid-template-columns: 1fr; }
  .circuit-top-ranking { margin: 0 18px 18px; }
  .circuit-ranking-heading { align-items: stretch; flex-direction: column; }
  .circuit-ranking-list,
  .circuit-ranking-full-panel .ranking-full-list { width: 100%; min-width: 0; overflow: visible; }
  .circuit-ranking-list .ranking-head,
  .circuit-ranking-list .ranking-row,
  .circuit-ranking-full-panel .ranking-head,
  .circuit-ranking-full-panel .ranking-row { min-width: 0; }
  .circuit-ranking-list .ranking-head,
  .circuit-ranking-list .ranking-row,
  .circuit-ranking-full-panel .ranking-head,
  .circuit-ranking-full-panel .ranking-row {
    grid-template-columns: 38px minmax(68px, 1fr) repeat(3, minmax(42px, 52px));
    gap: 4px;
    min-width: 0;
    padding: 9px 6px;
    font-size: 0.68rem;
  }
  .ranking-position { flex-wrap: wrap; }
  .ranking-position .ranking-projection { width: 100%; margin: 0; font-size: 0.52rem; }
  .ranking-head span,
  .ranking-row > span { min-width: 0; overflow-wrap: anywhere; }
  .ranking-name-button,
  .ranking-ai-name { display: block; min-width: 0; overflow: hidden; font-size: 0.66rem; text-overflow: ellipsis; white-space: nowrap; }
  .circuit-ranking-full-panel { padding: 18px; }
  .circuit-ranking-page-header { padding: 20px; }
  .circuit-ranking-page-header > img { width: 58px; height: 58px; }
  .circuit-section-heading,
  .ranking-sort-controls { min-width: 0; flex-wrap: wrap; }
  .ranking-sort-controls .small-button { flex: 1 1 72px; min-width: 0; padding-inline: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .lobby-mode-card,
  .lobby-shop-banner,
  .lobby-user-chip,
  .lobby-icon-button,
  .lobby-admin-button {
    transition: none;
  }
}

/* V2.169.14 · accueil, Club House en ligne et fin du mode spectateur */
.academy-upgrade-cta {
  display: grid;
  grid-template-columns: minmax(0, 45%) minmax(0, 55%);
  min-height: 360px;
  margin-top: 24px;
  overflow: hidden;
  color: #f8fbf5;
  background:
    radial-gradient(circle at 18% 20%, rgba(191, 214, 62, 0.16), transparent 38%),
    linear-gradient(135deg, #062c31 0%, #0a3d42 54%, #0c4c4a 100%);
  border: 1px solid rgba(203, 220, 102, 0.28);
  border-radius: 28px;
  box-shadow: 0 18px 44px rgba(5, 34, 38, 0.18);
}

.academy-upgrade-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: clamp(28px, 3vw, 38px);
}

.academy-upgrade-kicker {
  margin: 0;
  color: #d7e85b;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.academy-upgrade-copy h2 {
  max-width: 520px;
  margin: 0;
  color: #fff;
  font-size: clamp(1.85rem, 3vw, 2.65rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.academy-upgrade-copy > p:not(.academy-upgrade-kicker) {
  max-width: 560px;
  margin: 0;
  color: rgba(247, 252, 244, 0.8);
  font-size: clamp(0.92rem, 1.1vw, 1rem);
  line-height: 1.5;
}

.academy-upgrade-copy strong { color: #fff; }

.academy-upgrade-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.academy-upgrade-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 11px;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.025em;
  border-radius: 14px;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.academy-upgrade-primary {
  color: #102c2d;
  background: #d5e75c;
  border: 1px solid #e7f286;
}

.academy-upgrade-secondary {
  color: #f8fbf5;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.academy-upgrade-actions a:hover { transform: translateY(-2px); }
.academy-upgrade-primary:hover { background: #e0ed72; }
.academy-upgrade-secondary:hover { border-color: rgba(213, 231, 92, 0.7); }
.academy-upgrade-actions a:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.academy-upgrade-visual {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
}

.academy-upgrade-visual::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(90deg, #0a3c40 0%, rgba(10, 60, 64, 0.72) 8%, transparent 38%);
}

.academy-upgrade-visual img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  object-position: center;
  transition: transform 320ms ease;
}

.academy-upgrade-cta:hover .academy-upgrade-visual img { transform: scale(1.012); }

.online-action-with-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.online-action-with-icon > img {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  object-fit: contain;
}

.friendly-player-name {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.friendly-selected-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  object-fit: contain;
}

.friendly-start-selection-count {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 7px;
  margin: 14px 0 8px;
  color: rgba(244, 249, 241, 0.72);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.friendly-start-selection-count strong {
  color: #d6e75d;
  font-size: 1.45rem;
  line-height: 1;
}

.friendly-clubhouse-resume-button {
  width: 100%;
  margin-top: 16px;
  color: #f8fbf5;
  border-color: rgba(213, 231, 92, 0.5);
  background: rgba(213, 231, 92, 0.1);
}

.event-confirm-highlight {
  display: block;
  width: fit-content;
  margin: 8px auto 2px;
  padding: 9px 13px;
  color: #d9ea60;
  background: rgba(217, 234, 96, 0.1);
  border: 1px solid rgba(217, 234, 96, 0.32);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.spectator-match-end-panel {
  width: min(560px, calc(100vw - 32px));
  text-align: center;
}

.spectator-match-end-versus {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: 24px 0 16px;
}

.spectator-match-end-versus strong {
  min-width: 0;
  color: #fff;
  font-size: clamp(1rem, 3vw, 1.35rem);
  overflow-wrap: anywhere;
}

.spectator-match-end-versus span {
  color: rgba(244, 249, 241, 0.55);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.spectator-match-end-score {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0 auto 20px;
  padding: 16px 20px;
  color: #102f32;
  background: #d8e963;
  border-radius: 18px;
}

.spectator-match-end-score span {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.spectator-match-end-score strong { font-size: clamp(1.5rem, 5vw, 2.25rem); }
.spectator-match-end-panel > p:last-child { color: rgba(244, 249, 241, 0.68); }
.spectator-match-end-panel > p:last-child strong { color: #d8e963; }

.pro-news-modal {
  overflow: hidden;
  color: #f7fbf4;
  background: linear-gradient(135deg, #082f34 0%, #0a4544 100%);
  border: 1px solid rgba(214, 231, 93, 0.28);
  border-radius: 26px;
  box-shadow: 0 28px 80px rgba(3, 23, 27, 0.4);
}

.pro-news-card-frame { background: #0a3a3d; }
.pro-news-card-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
}
.pro-news-copy h2 { color: #fff; }
.pro-news-modal .pro-news-copy > p:not(.label),
.pro-news-modal #proNewsMessage {
  color: rgba(255, 255, 255, 0.94);
  line-height: 1.65;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
}

@media (max-width: 768px) {
  .academy-upgrade-cta {
    grid-template-columns: 1fr;
    min-height: 0;
    border-radius: 22px;
  }

  .academy-upgrade-visual {
    order: -1;
    aspect-ratio: 16 / 9;
  }

  .academy-upgrade-visual::after {
    background: linear-gradient(0deg, #08363a 0%, rgba(8, 54, 58, 0.2) 38%, transparent 65%);
  }

  .academy-upgrade-visual img { min-height: 0; }
  .academy-upgrade-copy { padding: 26px 22px 28px; }
  .academy-upgrade-copy h2 { font-size: clamp(1.9rem, 9vw, 2.75rem); }
  .academy-upgrade-actions { flex-direction: column; }
  .academy-upgrade-actions a { width: 100%; }
}

@media (max-width: 460px) {
  .spectator-match-end-versus { grid-template-columns: 1fr; gap: 6px; }
  .friendly-start-selection-count { align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  .academy-upgrade-actions a,
  .academy-upgrade-visual img { transition: none; }
  .academy-upgrade-actions a:hover,
  .academy-upgrade-cta:hover .academy-upgrade-visual img { transform: none; }
}

/* Interface de jeu unifiée — v170.6 */
.game-assist-tools { position: relative; }
.game-assist-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 210; display: grid; width: min(320px, calc(100vw - 32px)); gap: 10px; border: 1px solid rgba(140,224,191,.25); border-radius: 14px; padding: 14px; color: #fff; background: #062d42; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.game-assist-panel p { margin: 0 0 2px; color: #8ce0bf; font-size: .68rem; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; }
.game-assist-panel label { display: flex; align-items: center; gap: 9px; min-height: 32px; font-size: .76rem; font-weight: 850; cursor: pointer; }
.game-assist-panel input { width: 18px; height: 18px; accent-color: #29b895; }

.game-context-strip { display: grid; grid-template-columns: 1.5fr repeat(4, minmax(100px, .7fr)); gap: 1px; overflow: hidden; margin: 10px 0 12px; border: 1px solid rgba(255,255,255,.13); border-radius: 13px; color: #fff; background: rgba(6,45,66,.94); box-shadow: 0 8px 22px rgba(7,40,55,.14); }
.game-context-strip:empty { display: none; }
.game-context-strip > div { display: grid; min-width: 0; gap: 2px; padding: 9px 12px; background: rgba(255,255,255,.035); }
.game-context-strip span { color: #8ce0bf; font-size: .52rem; font-weight: 950; letter-spacing: .07em; text-transform: uppercase; }
.game-context-strip strong { overflow: hidden; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.game-context-strip .game-context-score { background: rgba(41,184,149,.13); }
.game-context-strip .game-context-score strong { color: #fff; font-size: .94rem; letter-spacing: .03em; }

.player-panel { transition: box-shadow .18s ease, border-color .18s ease; }
.player-panel.active { border-color: rgba(91,224,187,.72); box-shadow: inset 0 0 0 1px rgba(130,244,211,.32), 0 0 0 3px rgba(54,194,159,.12), 0 16px 40px rgba(8,113,98,.18); }
.player-panel.active .player-header { background: linear-gradient(115deg, rgba(11,103,91,.15), transparent 60%); }
.character-endurance-reminder.warning-endurance,
.metric.endurance-metric.warning-endurance { color: #8e5700; background: #fff2d8; }

.effect-chip { display: inline-grid; grid-template-columns: 23px minmax(0,1fr); align-items: center; gap: 6px; min-height: 34px; border: 1px solid rgba(38,166,197,.32); border-radius: 10px; padding: 4px 8px 4px 5px; color: #07566d; background: #ddf6fb; text-align: left; cursor: help; }
.effect-chip i { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 7px; color: #fff; background: #259db7; font-style: normal; font-weight: 950; }
.effect-chip span { display: grid; min-width: 0; }
.effect-chip strong { overflow: hidden; max-width: 170px; font-size: .61rem; text-overflow: ellipsis; white-space: nowrap; }
.effect-chip small { color: #34798a; font-size: .48rem; font-weight: 850; }
.effect-chip.constraint { border-color: rgba(222,126,39,.42); color: #7a4300; background: #fff0d6; }
.effect-chip.constraint i { background: #dc7d24; }
.effect-help-backdrop { z-index: 280; padding: 20px; }
.effect-help-dialog { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 14px; width: min(560px,100%); border: 1px solid #d9e6e7; border-radius: 18px; padding: 20px; color: #153848; background: #f8fbfa; box-shadow: 0 28px 80px rgba(0,0,0,.4); }
.effect-help-dialog h2, .effect-help-dialog p { margin: 3px 0; }
.effect-help-dialog .label { color: #25859c; }
.effect-help-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; color: #fff; background: #259db7; font-size: 1.4rem; }

.rally-context-line.stake { position: relative; overflow: hidden; color: #fff; background: linear-gradient(100deg,#9c3440,#c35642); }
.rally-context-line.stake::after { position: absolute; inset: -100% auto -100% -30%; width: 34%; transform: rotate(16deg); background: rgba(255,255,255,.17); content: ""; animation: stake-shine 2.8s ease-in-out infinite; }
@keyframes stake-shine { 0%,45% { transform: translateX(-50%) rotate(16deg); } 70%,100% { transform: translateX(430%) rotate(16deg); } }

.card-assist-preview { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; max-height: 0; overflow: hidden; opacity: 0; transform: translateY(3px); transition: max-height .18s ease, opacity .18s ease, transform .18s ease; text-align: center; }
.card-assist-preview.has-boost { grid-template-columns: repeat(3,minmax(0,1fr)); }
.card:hover .card-assist-preview, .card:focus-within .card-assist-preview { max-height: 120px; margin-top: 6px; opacity: 1; transform: none; }
.card-assist-preview span { display: grid; place-items: center; gap: 2px; border-radius: 7px; padding: 6px 4px; color: #264956; background: #eef6f4; text-align: center; }
.card-assist-preview small { font-size: .43rem; font-weight: 900; line-height: 1.05; text-transform: uppercase; }
.card-assist-preview strong { font-size: .82rem; font-weight: 1000; }
.card-assist-preview .card-assist-boost { color: #a92727; background: #fff0ee; }
.card-assist-preview .card-assist-boost strong { color: #c62121; }

.action-log-entry:not(.compact) { grid-template-columns: 10px 44px minmax(0,1fr) auto; }
.action-log-card-thumbnail { width: 44px; height: 61px; border: 1px solid rgba(12,67,82,.14); border-radius: 6px; object-fit: cover; }
.action-log-list .action-log-entry.compact { min-height: 72px; align-items: center; }

.result-match-score { order: 2; }
.result-match-score.winner-left, .result-match-score.winner-right { position: relative; overflow: hidden; animation: result-score-arrive .55s ease-out both; }
.result-match-score.winner-left::after, .result-match-score.winner-right::after { position: absolute; inset: 0; pointer-events: none; content: ""; animation: result-score-glow 1.35s ease-out .25s both; }
.result-match-score.winner-left::after { box-shadow: inset 0 0 28px rgba(38,177,140,.42); }
.result-match-score.winner-right::after { box-shadow: inset 0 0 28px rgba(130,76,182,.38); }
.result-summary-line { margin-top: 8px; }
.result-power-secondary .result-power-score { transform: scale(.88); transform-origin: right center; opacity: .82; }
@keyframes result-score-arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes result-score-glow { 0% { opacity: 0; } 35% { opacity: 1; } 100% { opacity: 0; } }

.event-transition-backdrop, .event-confirm-backdrop { z-index: 300; padding: 22px; background: rgba(1,19,31,.83); backdrop-filter: blur(9px); }
.event-transition-panel { position: relative; display: grid; justify-items: center; width: min(560px,100%); overflow: hidden; border: 1px solid rgba(140,224,191,.28); border-radius: 22px; padding: 30px; color: #fff; background: radial-gradient(circle at 50% 0,rgba(41,184,149,.19),transparent 46%),linear-gradient(145deg,#08354e,#031f31); box-shadow: 0 30px 90px rgba(0,0,0,.52); text-align: center; }
.event-transition-panel::before { position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.06); border-radius: inherit; pointer-events: none; content: ""; }
.event-transition-kicker { margin: 0 0 8px; color: #8ce0bf; font-size: .65rem; font-weight: 950; letter-spacing: .14em; text-transform: uppercase; }
.event-transition-panel h2 { margin: 0 0 10px; color: #fff; font-size: clamp(1.45rem,4vw,2.25rem); }
.event-transition-panel > p:not(.event-transition-kicker) { max-width: 440px; color: rgba(255,255,255,.72); line-height: 1.5; }
.event-transition-versus { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; margin: 8px 0 2px; }
.event-transition-versus strong { min-width: 0; font-size: .9rem; }
.event-transition-versus span { color: rgba(255,255,255,.45); font-size: .65rem; font-weight: 900; text-transform: uppercase; }
.event-transition-countdown { display: grid; place-items: center; width: 92px; height: 92px; margin: 18px 0; border: 1px solid rgba(140,224,191,.36); border-radius: 50%; color: #fff; background: rgba(41,184,149,.16); box-shadow: 0 0 0 10px rgba(41,184,149,.05),0 0 35px rgba(41,184,149,.18); font-size: 3rem; line-height: 1; }
.event-transition-actions { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.event-confirm-panel { justify-items: stretch; text-align: left; }
.event-confirm-panel .event-transition-actions { justify-content: center; }
.return-lobby-modal { border: 1px solid rgba(140,224,191,.28); border-radius: 20px; color: #fff; background: linear-gradient(145deg,#08354e,#031f31); box-shadow: 0 30px 90px rgba(0,0,0,.48); }
.return-lobby-modal h2 { color: #fff; }
.return-lobby-modal > p:not(.event-transition-kicker) { color: rgba(255,255,255,.72); }

.event-waiting-panel { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 18px; margin: 14px 0; border: 1px solid rgba(140,224,191,.22); border-radius: 18px; padding: 18px 20px; color: #fff; background: linear-gradient(120deg,#07364e,#062a3c); box-shadow: 0 14px 35px rgba(4,38,55,.17); }
.event-waiting-panel h2, .event-waiting-panel p { margin: 2px 0; }
.event-waiting-panel h2 { color: #fff; font-size: 1.15rem; }
.event-waiting-panel > div:nth-child(2) > p:last-child { color: rgba(255,255,255,.68); font-size: .76rem; }
.event-waiting-panel > strong { display: grid; color: #8ce0bf; font-size: 1.45rem; text-align: right; }
.event-waiting-panel > strong span { color: rgba(255,255,255,.56); font-size: .52rem; text-transform: uppercase; }
.event-waiting-pulse { display: flex; align-items: center; gap: 4px; }
.event-waiting-pulse i { width: 8px; height: 8px; border-radius: 50%; background: #54d4ac; animation: waiting-dot 1.2s ease-in-out infinite; }
.event-waiting-pulse i:nth-child(2) { animation-delay: .15s; }
.event-waiting-pulse i:nth-child(3) { animation-delay: .3s; }
@keyframes waiting-dot { 0%,70%,100% { opacity: .3; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-5px); } }

.tournament-loading-backdrop { background: rgba(1,19,31,.83); backdrop-filter: blur(9px); }
.tournament-loading-panel { border-color: rgba(140,224,191,.28); border-radius: 22px; color: #fff; background: radial-gradient(circle at 50% 0,rgba(41,184,149,.19),transparent 46%),linear-gradient(145deg,#08354e,#031f31); box-shadow: 0 30px 90px rgba(0,0,0,.52); }
.tournament-loading-panel strong { color: #fff; }
.tournament-loading-panel p { color: rgba(255,255,255,.7); }
.tournament-loading-kicker { color: #8ce0bf; }
.tournament-loading-track { background: rgba(255,255,255,.1); }
.tournament-loading-track span { background: linear-gradient(90deg,#53d9ae,#d8f46c); }

@media (max-width: 900px) {
  .game-context-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .game-context-strip > div { padding: 8px 10px; }
  .game-context-strip .game-context-score { position: sticky; right: 0; }
}

@media (max-width: 700px) {
  .game-app .small-button, .game-app .primary-button, .game-app .play-button, .game-app .boost-button, .game-app .pass-button, .game-app .end-turn-button { min-height: 44px; }
  .game-context-strip { position: sticky; top: 6px; z-index: 145; grid-template-columns: minmax(0,1fr) auto auto; margin: 6px 0 9px; box-shadow: 0 8px 24px rgba(0,0,0,.28); }
  .game-context-strip > div:not(:first-child):not(.game-context-ai-level):not(.game-context-score) { display: none; }
  .game-context-strip strong { font-size: .64rem; }
  .game-context-strip .game-context-score strong { font-size: .9rem; }
  .player-panel.active .turn-buttons { position: sticky; bottom: 7px; z-index: 120; display: flex; border: 1px solid rgba(140,224,191,.25); border-radius: 13px; padding: 6px; background: rgba(6,45,66,.92); box-shadow: 0 9px 30px rgba(0,0,0,.28); backdrop-filter: blur(7px); }
  .player-panel.active .turn-buttons button { flex: 1 1 auto; }
  .effect-chip { min-height: 40px; }
  .effect-chip strong { max-width: 132px; }
  .card-assist-preview { max-height: 100px; margin-top: 6px; opacity: 1; transform: none; }
  .action-log-backdrop { align-items: flex-end; padding: 0; }
  .action-log-dialog { width: 100%; max-height: 82vh; border-radius: 20px 20px 0 0; }
  .action-log-dialog .action-log-entry { grid-template-columns: 8px 38px minmax(0,1fr); }
  .action-log-dialog .action-log-order { display: none; }
  .action-log-card-thumbnail { width: 38px; height: 53px; }
  .effect-help-backdrop { align-items: flex-end; padding: 0; }
  .effect-help-dialog { grid-template-columns: auto minmax(0,1fr); width: 100%; border-radius: 20px 20px 0 0; padding: 18px; }
  .effect-help-dialog > button { grid-column: 1/-1; min-height: 44px; }
  .event-transition-panel { padding: 24px 18px; }
  .event-transition-versus { align-items: stretch; flex-direction: column; gap: 3px; }
  .event-transition-countdown { width: 78px; height: 78px; font-size: 2.55rem; }
  .event-waiting-panel { grid-template-columns: auto minmax(0,1fr); padding: 15px; }
  .event-waiting-panel > strong { grid-column: 2; text-align: left; }
  .result-power-secondary .result-power-score { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .rally-context-line.stake::after, .result-match-score::after, .event-waiting-pulse i { animation: none !important; }
}

/* Content pages and home news ------------------------------------------- */
.home-news-section {
  display: grid;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: clamp(20px, 3vw, 30px);
  color: #102a43;
  background: rgba(250, 252, 251, 0.98);
  box-shadow: 0 12px 30px rgba(2, 16, 31, 0.22);
}

.home-section-heading,
.character-gallery-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.home-section-heading .label,
.home-section-heading h2,
.character-gallery-heading .label,
.character-gallery-heading h2 {
  margin: 0;
}

.home-section-heading h2,
.character-gallery-heading h2 {
  margin-top: 3px;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  letter-spacing: -0.035em;
}

.home-news-live {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #607282;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.home-news-live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #14a372;
  box-shadow: 0 0 0 4px rgba(20, 163, 114, 0.12);
}

.home-news-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.home-news-scroll {
  overflow: visible;
  padding: 2px 3px;
}

.home-news-scroll > * {
  direction: ltr;
}

.home-news-scroll::-webkit-scrollbar {
  width: 6px;
}

.home-news-scroll::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

.home-news-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(140, 224, 191, .56);
}

.home-news-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(140, 224, 191, .82);
}

.home-news-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(16, 54, 77, 0.12);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(10, 38, 53, 0.08);
}

.home-news-card:only-child,
.home-news-featured:nth-last-child(3),
.home-news-featured:nth-last-child(5) {
  grid-column: 1 / -1;
  grid-template-columns: minmax(190px, 31%) minmax(0, 1fr);
}

.home-news-visual {
  min-width: 0;
  overflow: hidden;
  border: 0;
  padding: 0;
  background: #dceae7;
  cursor: pointer;
}

.home-news-visual img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: cover;
  object-position: 50% 17%;
  transition: transform 220ms ease;
}

.home-news-card:hover .home-news-visual img { transform: scale(1.025); }

.home-news-archive-action {
  display: flex;
  justify-content: center;
  margin-top: 14px;
  padding: 4px 0 8px;
}

.home-news-archive-button {
  min-width: 220px;
  border: 1px solid rgba(233, 255, 112, .42);
  color: #092f43;
  background: #e9ff70;
}

.news-archive-screen {
  min-height: 100vh;
  background: #eef5f3;
}

.news-archive-shell {
  width: min(1120px, calc(100% - 28px));
  margin-inline: auto;
}

.news-archive-heading {
  margin: 26px 0 22px;
}

.news-archive-heading h1 {
  margin: 4px 0 8px;
  color: #10364d;
}

.news-archive-heading p:last-child {
  margin: 0;
  color: #587080;
}

.news-archive-list {
  display: grid;
  gap: 16px;
  padding-bottom: 40px;
}

.news-archive-card {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(16, 54, 77, 0.12);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(10, 38, 53, 0.08);
}

.news-archive-visual {
  overflow: hidden;
  border: 0;
  padding: 0;
  background: #dceae7;
  cursor: pointer;
}

.news-archive-visual img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 230px;
  object-fit: cover;
  object-position: 50% 17%;
}

.news-archive-copy {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 9px;
  min-width: 0;
  padding: 26px;
}

.news-archive-copy time {
  color: #0f8d68;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.news-archive-title {
  border: 0;
  padding: 0;
  color: #10364d;
  background: transparent;
  font: inherit;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  font-weight: 950;
  text-align: left;
  cursor: pointer;
}

.news-archive-copy p {
  overflow: hidden;
  margin: 0;
  color: #587080;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.news-archive-summary {
  display: block;
  border-color: rgba(16, 54, 77, .16);
  background: #fff;
}

.news-archive-summary .news-archive-copy {
  grid-template-columns: minmax(120px, auto) minmax(0, 1fr) auto;
  align-items: center;
  align-content: center;
  gap: 14px;
  padding: 16px 20px;
}

.news-archive-summary .news-archive-title {
  width: 100%;
  color: #10364d;
  font-size: 1rem;
}

.news-archive-summary .home-news-read {
  color: #0b765c;
  white-space: nowrap;
}

@media (max-width: 680px) {
  .news-archive-card {
    grid-template-columns: 1fr;
  }

  .news-archive-visual img {
    height: 210px;
    min-height: 0;
  }

  .news-archive-copy {
    padding: 20px;
  }
}

.home-news-copy {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 7px;
  min-width: 0;
  padding: 22px;
}

.home-news-copy time {
  justify-self: start;
  width: 100%;
  text-align: left;
  color: #0f8d68;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-news-copy h3 {
  margin: 0;
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  letter-spacing: -0.025em;
}

.home-news-copy p {
  display: -webkit-box;
  max-width: 720px;
  margin: 0;
  overflow: hidden;
  color: #526878;
  font-size: 0.88rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.home-news-read {
  border: 0;
  padding: 3px 0;
  color: #0b7659;
  background: transparent;
  font-size: 0.77rem;
  font-weight: 950;
  text-transform: uppercase;
  cursor: pointer;
}

.home-news-read span { margin-left: 4px; font-size: 1rem; }
.home-news-empty { padding: 24px; border-radius: 14px; color: #607282; background: #eef4f3; text-align: center; }

.content-page-screen {
  width: min(1160px, calc(100vw - 40px));
  padding: 22px 0 30px;
}

.content-page-shell { gap: 16px; max-width: 1160px; }
.content-page-topbar { margin: 0; }
.content-page-panel { overflow: hidden; padding: 0; background: #f3f6f5; }

.content-page-hero {
  position: relative;
  min-height: 410px;
  overflow: hidden;
  color: #fff;
  background: #0b354a;
}

.content-page-hero::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(4, 30, 47, 0.96) 0%, rgba(4, 35, 51, 0.75) 43%, rgba(4, 25, 38, 0.04) 80%);
  content: "";
}

.content-page-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-page-hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(610px, 62%);
  min-height: 410px;
  align-content: center;
  justify-items: start;
  gap: 13px;
  padding: clamp(30px, 5vw, 64px);
}

.content-page-hero-copy .label { margin: 0; color: #8ce0bf; }
.content-page-hero-copy h1 { margin: 0; color: #fff; font-size: clamp(2.1rem, 5vw, 4rem); line-height: 0.98; letter-spacing: -0.055em; }
.content-page-hero-copy p { max-width: 570px; margin: 0; color: rgba(255,255,255,.82); font-size: 1rem; line-height: 1.6; }
.content-page-hero-copy .primary-button { margin-top: 8px; }

.academy-journey {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: rgba(14, 70, 83, 0.12);
}

.academy-journey article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  padding: 24px;
  background: #fff;
}

.academy-journey article > span,
.profile-card-heading > span {
  color: #0f8d68;
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.academy-journey strong { color: #173b4e; font-size: 1rem; }
.academy-journey p { margin: 4px 0 0; color: #657784; font-size: .82rem; line-height: 1.45; }

.content-page-panel .academy-info-section { margin: 0 clamp(20px, 4vw, 48px); }
.content-page-panel .academy-deck-section { border-top: 0; padding-top: 42px; }
.academy-copy-grid { gap: 18px; border-top: 0; }
.academy-copy-grid > div + div { border-left: 0; }
.academy-copy-card { border: 1px solid rgba(15, 73, 88, .12); border-radius: 16px; padding: 26px; background: #fff; box-shadow: 0 8px 22px rgba(10, 42, 58, .07); }
.academy-copy-grid > .academy-copy-card + .academy-copy-card { padding-left: 26px; }
.academy-next-card { background: linear-gradient(145deg, #eef8f5, #fff); }
.content-page-panel .academy-info-footer { margin: 24px 0 0; }

.academy-comparison-section {
  border: 1px solid rgba(15, 73, 88, .12) !important;
  border-radius: 17px;
  padding: clamp(24px, 4vw, 38px) !important;
  background: #fff;
  box-shadow: 0 8px 22px rgba(10, 42, 58, .07);
}

.academy-comparison-section .academy-section-heading h2 {
  max-width: 780px;
  color: #173b4e;
  font-size: clamp(1.45rem, 2.8vw, 2.1rem);
  letter-spacing: -.03em;
}

.academy-comparison-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(15, 73, 88, .14);
  border-radius: 14px;
  outline-offset: 3px;
  -webkit-overflow-scrolling: touch;
}

.academy-comparison-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  color: #405968;
  font-size: .86rem;
  line-height: 1.45;
}

.academy-comparison-table th,
.academy-comparison-table td {
  border-bottom: 1px solid rgba(15, 73, 88, .11);
  padding: 15px 17px;
  text-align: left;
  vertical-align: top;
}

.academy-comparison-table thead th {
  color: #fff;
  background: #0a4056;
  font-size: .78rem;
  letter-spacing: .025em;
  text-transform: uppercase;
}

.academy-comparison-table thead th:nth-child(2) { background: #16785f; }
.academy-comparison-table thead th:nth-child(3) { background: #9e4766; }
.academy-comparison-table tbody th {
  width: 22%;
  color: #173b4e;
  background: #f1f6f5;
  font-weight: 900;
}
.academy-comparison-table tbody td:nth-child(2) { width: 31%; background: #f5fbf8; }
.academy-comparison-table tbody td:nth-child(3) { width: 47%; background: #fff8fa; }
.academy-comparison-table tbody tr:last-child > * { border-bottom: 0; }

.academy-comparison-summary {
  margin: 22px 0 0;
  border-left: 4px solid #0f8d68;
  padding: 15px 18px;
  color: #405968;
  background: #eef8f5;
  line-height: 1.7;
}

@media (max-width: 700px) {
  .academy-comparison-section {
    padding: 20px 16px !important;
  }

  .academy-comparison-table {
    min-width: 590px;
    font-size: .79rem;
  }

  .academy-comparison-table th,
  .academy-comparison-table td {
    padding: 12px;
  }
}

.profile-page-panel,
.character-page-panel { overflow: hidden; padding: 0; background: #f3f6f5; }

.profile-page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(24px, 4vw, 42px);
  color: #fff;
  background: linear-gradient(115deg, #07364f, #0d6470);
}

.profile-page-heading .label,
.profile-page-heading h1,
.profile-page-heading p { margin: 0; }
.profile-page-heading .label { color: #88dfc0; }
.profile-page-heading h1 { margin-top: 4px; color: #fff; font-size: clamp(2rem, 4vw, 3.2rem); letter-spacing: -.045em; }
.profile-page-heading p { margin-top: 7px; color: rgba(255,255,255,.75); }
.profile-page-heading > img { width: 76px; height: 76px; padding: 16px; border-radius: 20px; background: rgba(255,255,255,.1); filter: invert(1); }

.profile-content { display: grid; gap: 18px; padding: clamp(18px, 3vw, 34px); }
.profile-identity-hero {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  min-height: 238px;
  align-items: stretch;
  gap: 16px;
  color: #fff;
  background: transparent;
}

.profile-identity-portrait { align-self: stretch; overflow: hidden; border-radius: 18px; background: #d8e9e5; box-shadow: 0 12px 28px rgba(7,45,64,.18); }
.profile-identity-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.profile-identity-info { display: grid; grid-template-rows: auto 1fr; min-width: 0; overflow: hidden; border-radius: 18px; background: linear-gradient(120deg, #092f47, #116e70); box-shadow: 0 12px 28px rgba(7,45,64,.18); }
.profile-identity-copy { display: grid; justify-items: start; gap: 5px; padding: 24px 26px 18px; }
.profile-identity-copy .profile-role { margin-bottom: 10px; color: #092f47; background: #f1c94c; }
.profile-identity-copy .label { margin: 0; color: #88dfc0; }
.profile-identity-copy h2 { margin: 0; color: #fff; font-size: clamp(1.8rem, 3vw, 2.6rem); letter-spacing: -.04em; }
.profile-identity-copy p { margin: 0; color: rgba(255,255,255,.72); }
.profile-identity-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-self: end; margin: 0; border-top: 1px solid rgba(255,255,255,.12); }
.profile-identity-metrics div { display: grid; align-content: center; gap: 4px; min-width: 0; padding: 16px 14px; border-left: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); }
.profile-identity-metrics div:first-child { border-left: 0; }
.profile-identity-metrics dt { color: rgba(255,255,255,.62); font-size: .68rem; font-weight: 850; text-transform: uppercase; }
.profile-identity-metrics dd { margin: 0; font-size: 1.65rem; font-weight: 950; }
.profile-identity-metrics small { color: rgba(255,255,255,.62); font-size: .57rem; font-weight: 800; line-height: 1.2; }
.profile-trophy-metric dd { display: flex; align-items: center; gap: 8px; }
.profile-trophy-metric dd img { width: 25px; height: 25px; object-fit: contain; }
.profile-trophy-metric.gold dd img { filter: sepia(1) saturate(4) hue-rotate(352deg) brightness(1.08); }
.profile-trophy-metric.silver dd img { filter: grayscale(1) brightness(1.75); }

.profile-grid { gap: 16px; }
.profile-card { align-content: start; gap: 14px; border: 1px solid rgba(15, 67, 82, .1); border-radius: 16px; padding: 22px; background: #fff; box-shadow: 0 8px 22px rgba(10, 42, 58, .06); }
.profile-card-heading { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 13px; border-bottom: 1px solid rgba(15, 67, 82, .1); }
.profile-card-heading .label,
.profile-card-heading h3 { margin: 0; }
.profile-card-heading h3 { margin-top: 2px; color: #183b4d; font-size: 1.08rem; }
.profile-ranking-card { grid-column: 1 / -1; }
.profile-player-level { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; border: 1px solid rgba(212, 145, 0, .2); border-radius: 12px; padding: 11px 14px; color: #183b4d; background: rgba(250, 204, 21, .14); }
.profile-player-level > span:first-child { font-size: .72rem; font-weight: 950; text-transform: uppercase; }
.profile-player-level > strong { font-size: 1rem; }
.profile-level-stars { margin-left: auto; color: #d49100; font-size: 1.08rem; letter-spacing: 2px; white-space: nowrap; }
.profile-character-summary { border-radius: 13px; background: #eef4f3; }
.profile-character-visual { border-radius: 11px; }
.profile-stat { border-radius: 11px; background: #eef8f2; }
.profile-row,
.profile-calendar-row { border-radius: 11px; }
.profile-expand-button { justify-self: center; display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(15,141,104,.22); border-radius: 50%; padding: 0; color: #0b7059; background: #e6f4ef; font-size: 1.35rem; font-weight: 950; line-height: 1; cursor: pointer; }
.profile-expand-button:hover,
.profile-expand-button:focus-visible { color: #fff; background: #0f8d68; }
.confrontation-matches { color: #5b7180; font-size: .68rem; font-weight: 850; white-space: nowrap; }

.character-mobile-actions { display: none; }
.character-selection-layout { display: grid; grid-template-columns: minmax(280px, 350px) minmax(0, 1fr); gap: 20px; }
.character-selection-preview { position: sticky; top: 18px; align-self: start; overflow: hidden; border-radius: 18px; color: #fff; background: #07364f; box-shadow: 0 14px 30px rgba(5, 38, 55, .2); }
.character-preview-image { height: 390px; overflow: hidden; background: #d8e9e5; }
.character-preview-image img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 14%; }
.character-preview-copy { display: grid; justify-items: start; gap: 8px; padding: 22px; }
.character-preview-copy .label,
.character-preview-copy h2,
.character-preview-copy p { margin: 0; }
.character-preview-copy .label { color: #86daba; }
.character-preview-copy h2 { color: #fff; font-size: 1.65rem; }
.character-preview-copy p { color: rgba(255,255,255,.7); font-size: .84rem; line-height: 1.5; }
.character-preview-copy .primary-button { width: 100%; margin-top: 8px; }
.character-selection-gallery { display: grid; align-content: start; gap: 15px; border: 1px solid rgba(15, 67, 82, .1); border-radius: 18px; padding: 22px; background: #fff; }
.character-gallery-heading > span { border-radius: 999px; padding: 7px 11px; color: #0e715a; background: #e8f5f0; font-size: .72rem; font-weight: 900; text-transform: uppercase; }
.character-role-hint { margin: 0; border-left: 3px solid #0f8d68; padding: 9px 12px; color: #5a6e7b; background: #f2f7f5; font-size: .8rem; }
.character-screen-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.profile-character-choice { position: relative; overflow: hidden; border: 2px solid transparent; border-radius: 14px; padding: 7px; text-align: left; background: #edf3f2; transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }
.profile-character-choice:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(8, 46, 61, .14); }
.profile-character-choice.active { border-color: #0f8d68; background: #e1f4ec; }
.profile-character-choice img { aspect-ratio: 731 / 1039; border-radius: 10px; object-position: 50% 15%; }
.profile-character-choice > span:last-child { display: grid; gap: 2px; padding: 7px 4px 3px; }
.profile-character-choice strong { color: #183b4d; font-size: .78rem; }
.profile-character-choice small { color: #71818b; font-size: .64rem; }
.character-choice-check { position: absolute; top: 13px; right: 13px; z-index: 1; display: none; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: #fff; background: #0f8d68; box-shadow: 0 5px 12px rgba(4, 45, 33, .3); }
.profile-character-choice.active .character-choice-check { display: grid; }

.circuit-info-hero::after { background: linear-gradient(90deg, rgba(3, 42, 30, .97), rgba(4, 66, 45, .73) 45%, rgba(4, 39, 29, .05) 82%); }
.circuit-info-hero > img { object-position: 70% 52%; }
.circuit-info-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: rgba(13, 78, 55, .12); }
.circuit-info-facts article { display: grid; justify-items: center; gap: 3px; padding: 24px 16px; background: #fff; text-align: center; }
.circuit-info-facts strong { color: #0c7653; font-size: 1.8rem; }
.circuit-info-facts span { color: #637681; font-size: .73rem; font-weight: 800; text-transform: uppercase; }
.circuit-info-card-grid { gap: 16px; padding: clamp(22px, 4vw, 44px); }
.circuit-info-card { position: relative; border: 1px solid rgba(15, 67, 82, .1) !important; border-radius: 16px; padding: 25px !important; background: #fff; box-shadow: 0 8px 22px rgba(10, 42, 58, .06); }
.circuit-info-card .label { margin: 0 0 3px; color: #0f8d68; }
.circuit-info-card h2 { padding-right: 42px; color: #183b4d; font-size: 1.25rem; }
.circuit-info-card p:last-child { color: #5c6f7c; font-size: .88rem; line-height: 1.62; }
.circuit-info-card-icon { position: absolute; top: 21px; right: 21px; display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; background: #e7f3ed; }
.circuit-info-card-icon img { width: 21px; height: 21px; object-fit: contain; }
.circuit-info-panel .circuit-points-section { margin: 0 clamp(22px, 4vw, 44px) 38px; border: 1px solid rgba(15, 67, 82, .1); border-radius: 16px; padding: 25px; background: #fff; }
.circuit-points-table { overflow: hidden; border-radius: 12px; }
.circuit-info-cta { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px clamp(22px, 4vw, 44px); color: #fff; background: linear-gradient(105deg, #07364f, #0d715a); }
.circuit-info-cta .label { margin: 0; color: #8ce0bf; }
.circuit-info-cta strong { display: block; margin-top: 4px; font-size: 1.15rem; }

@media (max-width: 900px) {
  .profile-identity-hero { grid-template-columns: 145px minmax(0, 1fr); }
  .profile-identity-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .profile-identity-metrics div:nth-child(4) { border-left: 0; border-top: 1px solid rgba(255,255,255,.12); }
  .profile-identity-metrics div:nth-child(5) { border-top: 1px solid rgba(255,255,255,.12); }
  .character-selection-layout { grid-template-columns: 270px minmax(0, 1fr); }
  .character-screen-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .circuit-info-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .content-page-screen { width: min(100vw - 28px, 1160px); padding-top: 14px; }
  .home-news-list { grid-template-columns: 1fr; }
  .home-news-card,
  .home-news-card:only-child,
  .home-news-featured:nth-last-child(3),
  .home-news-featured:nth-last-child(5) { grid-column: auto; grid-template-columns: 112px minmax(0, 1fr); }
  .home-news-visual img { min-height: 176px; }
  .home-news-copy { padding: 16px; }
  .home-news-copy p { -webkit-line-clamp: 2; }
  .home-news-live { display: none; }
  .content-page-hero,
  .content-page-hero-copy { min-height: 360px; }
  .content-page-hero-copy { width: 82%; padding: 28px 22px; }
  .content-page-hero-copy h1 { font-size: clamp(2rem, 10vw, 3rem); }
  .academy-journey { grid-template-columns: 1fr; }
  .academy-copy-grid { grid-template-columns: 1fr; }
  .academy-deck-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
  .profile-page-heading { padding: 24px 20px; }
  .profile-page-heading > img { width: 56px; height: 56px; padding: 12px; }
  .profile-identity-hero { grid-template-columns: 105px minmax(0, 1fr); gap: 12px; }
  .profile-identity-copy { padding: 16px 15px 13px; }
  .profile-identity-copy p { display: none; }
  .profile-identity-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-identity-metrics div { padding: 13px 9px; }
  .profile-identity-metrics div:nth-child(odd) { border-left: 0; }
  .profile-identity-metrics div:nth-child(n + 3) { border-top: 1px solid rgba(255,255,255,.12); }
  .profile-identity-metrics dt { font-size: .56rem; }
  .profile-identity-metrics dd { font-size: 1.15rem; }
  .profile-trophy-metric dd img { width: 20px; height: 20px; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-card,
  .profile-ranking-card { grid-column: 1; }
  .profile-character-visuals { gap: 6px; }
  .character-selection-layout { grid-template-columns: 1fr; }
  .character-selection-preview { position: static; display: grid; grid-template-columns: 140px minmax(0, 1fr); }
  .character-preview-image { height: 245px; }
  .character-preview-copy { align-content: center; padding: 17px; }
  .character-preview-copy p { display: none; }
  .character-screen-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .circuit-info-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .circuit-info-card-grid { grid-template-columns: 1fr; }
  .circuit-info-cta { align-items: stretch; flex-direction: column; }
}

@media (max-width: 430px) {
  .home-news-card,
  .home-news-card:only-child,
  .home-news-featured:nth-last-child(3),
  .home-news-featured:nth-last-child(5) { grid-template-columns: 92px minmax(0, 1fr); }
  .home-news-copy h3 { font-size: 1rem; }
  .character-selection-preview { grid-template-columns: 112px minmax(0, 1fr); }
  .character-preview-image { height: 215px; }
  .character-preview-copy h2 { font-size: 1.25rem; }
  .character-preview-copy .primary-button { padding-inline: 9px; font-size: .7rem; }
  .profile-identity-hero { grid-template-columns: 1fr; }
  .profile-identity-portrait { width: 118px; min-height: 150px; }
}

/* Navigation and interface refinements --------------------------------- */
.global-player-dock {
  position: fixed;
  top: 94px;
  right: max(18px, calc((100vw - 1160px) / 2));
  z-index: 90;
  max-width: min(250px, calc(100vw - 36px));
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 15px;
  padding: 4px;
  background: rgba(7, 35, 58, .9);
  box-shadow: 0 12px 28px rgba(2, 16, 31, .26);
  backdrop-filter: blur(14px);
}
.global-player-dock.docked { position: static; flex: 0 1 250px; margin-left: auto; }
.mode-clubhouse-topbar .page-return-actions,
.topbar .top-actions { flex: 0 0 auto; margin-left: 0; }

.global-player-profile {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 0;
  border-radius: 11px;
  padding: 5px 10px 5px 5px;
  color: #fff;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.global-player-profile:not(:disabled):hover { background: rgba(255,255,255,.1); }
.global-player-profile:disabled { cursor: not-allowed; filter: grayscale(.8); opacity: .72; }
.global-player-avatar { width: 38px; height: 38px; overflow: hidden; border: 2px solid #f2c84b; border-radius: 11px; background: #f2c84b; }
.global-player-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 14%; transform: scale(1.35); transform-origin: 50% 18%; }
.global-player-copy { display: grid; min-width: 0; gap: 1px; }
.global-player-copy strong,
.global-player-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-player-copy strong { font-size: .78rem; }
.global-player-copy small { color: rgba(255,255,255,.62); font-size: .58rem; font-weight: 800; text-transform: uppercase; }
.menu-screen .brand-logo[role="button"] { cursor: pointer; }
.menu-screen .brand-logo[role="button"]:focus-visible { outline: 3px solid #e9ff70; outline-offset: 4px; border-radius: 8px; }

.lobby-hero { aspect-ratio: 16 / 5.7; }
.lobby-hero img { object-position: 50% 38%; }

.home-news-section {
  gap: 10px;
  padding: 16px 18px;
  color: #fff;
  background: rgba(7, 35, 58, .76);
  box-shadow: 0 10px 24px rgba(2, 16, 31, .17);
  backdrop-filter: blur(10px);
}
.home-section-heading { align-items: center; }
.home-section-heading .label { color: #8ce0bf; }
.home-section-heading h2 { color: #fff; font-size: 1.28rem; }
.home-news-live { color: rgba(255,255,255,.6); }
.home-news-list { grid-template-columns: 1fr; }
.home-news-card,
.home-news-card:only-child,
.home-news-featured:nth-last-child(3),
.home-news-featured:nth-last-child(5) {
  grid-column: auto;
  grid-template-columns: 120px minmax(0, 1fr);
  min-height: 60px;
  border-color: rgba(255,255,255,.11);
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  box-shadow: none;
}
.home-news-visual { width: 120px; height: 60px; align-self: center; border-radius: 9px; background: rgba(255,255,255,.1); }
.home-news-visual img { width: 120px; height: 60px; min-height: 0; object-position: 50% 15%; transform: scale(1.16); transform-origin: 50% 18%; }
.home-news-card:hover .home-news-visual img { transform: scale(1.2); }
.home-news-copy { grid-template-columns: minmax(105px, auto) minmax(0, 1fr) auto; align-items: center; align-content: center; gap: 16px; padding: 9px 13px; }
.home-news-copy time { color: #8ce0bf; white-space: nowrap; }
.home-news-title { min-width: 0; overflow: hidden; border: 0; padding: 0; color: #fff; background: transparent; font: inherit; font-size: .9rem; font-weight: 900; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.home-news-copy time,
.home-news-title { justify-self: stretch; width: 100%; text-align: left; }
.home-news-title:hover { color: #e9ff70; }
.home-news-read { color: #e9ff70; white-space: nowrap; }

.lobby-shop-banner { display: block; min-height: 0; overflow: hidden; padding: 0; background: #0a354e; }
.lobby-shop-banner > img { display: block; width: 100%; height: auto; max-height: none; object-fit: cover; }

.training-page-hero > img { object-position: 67% 25%; }
.solo-clubhouse-hero > img { object-position: 67% 24%; }
.online-page-hero > img,
.online-room-hero > img { object-position: 68% 27%; }

.academy-foundations-card { margin-top: 34px !important; border: 1px solid rgba(15, 73, 88, .12) !important; border-radius: 17px; padding: clamp(24px, 4vw, 38px) !important; background: #fff; box-shadow: 0 8px 22px rgba(10, 42, 58, .07); }
.academy-foundations-card h2 { margin: 4px 0 16px; color: #173b4e; font-size: clamp(1.4rem, 2.8vw, 2rem); letter-spacing: -.03em; }
.academy-foundations-card > p:not(.label):not(.academy-info-highlight) { color: #526878; line-height: 1.65; }

.circuit-goat-feature { display: grid; grid-template-columns: minmax(250px, .9fr) minmax(0, 1.1fr); align-items: stretch; margin: clamp(22px, 4vw, 44px); overflow: hidden; border-radius: 18px; color: #fff; background: linear-gradient(120deg, #092f47, #126d57); box-shadow: 0 12px 28px rgba(7, 45, 64, .15); }
.circuit-goat-feature img { width: 100%; height: 100%; min-height: 280px; object-fit: cover; object-position: center 28%; }
.circuit-goat-feature div { display: grid; align-content: center; gap: 8px; padding: clamp(24px, 4vw, 42px); }
.circuit-goat-feature .label,
.circuit-goat-feature h2,
.circuit-goat-feature p { margin: 0; }
.circuit-goat-feature .label { color: #8ce0bf; }
.circuit-goat-feature h2 { color: #fff; font-size: clamp(1.7rem, 3vw, 2.5rem); letter-spacing: -.04em; }
.circuit-goat-feature p { color: rgba(255,255,255,.76); line-height: 1.6; }

.circuit-best-performance { display: grid; align-content: center; gap: 4px; min-width: 0; }
.circuit-best-performance small { color: #76858d; font-weight: 850; }
.circuit-performance-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-width: 0; }
.circuit-performance-line strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.circuit-performance-line em { display: inline-flex; align-items: center; justify-content: center; min-height: 24px; border-radius: 999px; padding: 3px 9px; color: #176947; background: #e5f4eb; font-size: .78rem; font-style: normal; font-weight: 950; line-height: 1; white-space: nowrap; }
.circuit-performance-detail { color: #5c7280; font-size: .68rem; font-weight: 800; line-height: 1.35; }
.circuit-best-performance.not-played strong { color: #73828b; font-size: .72rem; letter-spacing: .035em; }

.ranking-head,
.ranking-row { grid-template-columns: minmax(78px, max-content) minmax(0, 1fr) 84px 84px 84px; }
.ranking-position { min-width: 72px; overflow: visible; white-space: nowrap; }
.ranking-position > strong { overflow: visible; text-overflow: clip; white-space: nowrap; }

.profile-calendar-row.current-week { border-left: 5px solid #2186bb; box-shadow: inset 0 0 0 1px rgba(33, 134, 187, .2); }
.profile-calendar-row.result-finalist { background: rgba(192, 199, 207, .26); }
.profile-calendar-row.result-winner { background: rgba(250, 204, 21, .24); }
.profile-calendar-row.current-week.result-finalist { background: linear-gradient(90deg, rgba(33,134,187,.08), rgba(192,199,207,.28)); }
.profile-calendar-row.current-week.result-winner { background: linear-gradient(90deg, rgba(33,134,187,.08), rgba(250,204,21,.26)); }

.online-room-format-section { padding-top: 24px; }
.online-room-configuration { align-items: start; }
.online-room-summary-card { top: 94px; }
.online-room-summary-card .friendly-lobby-exit-button { width: 100%; }

/* V2.169.15 · confidentialité et continuité du Club House */
.content-page-panel .academy-upgrade-cta-info {
  margin: 30px 0 0;
  border-radius: 0 0 28px 28px;
}

.friendly-player-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
}

.friendly-player-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.friendly-player-identity .friendly-selected-icon {
  width: 22px;
  height: 22px;
  margin-top: 1px;
}

.friendly-player-identity .friendly-player-name {
  justify-content: flex-start;
  min-width: 0;
  line-height: 1.15;
}

.friendly-visibility-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 420px);
  align-items: center;
  gap: 22px;
  border: 1px solid rgba(15, 73, 88, 0.14);
  border-radius: 18px;
  padding: 20px;
  background: linear-gradient(135deg, #f1f8f5, #fff);
  box-shadow: 0 8px 22px rgba(10, 42, 58, 0.06);
}

.friendly-visibility-section .label,
.friendly-visibility-section h2,
.friendly-visibility-section p {
  margin: 0;
}

.friendly-visibility-section h2 {
  margin-top: 4px;
  color: #173b4e;
  font-size: 1.2rem;
}

.friendly-visibility-section p:not(.label) {
  margin-top: 5px;
  color: #5c7280;
  font-size: 0.82rem;
  font-weight: 750;
}

.friendly-visibility-switch {
  width: 100%;
}

.friendly-new-event-button {
  width: 100%;
  margin-top: 9px;
  color: #102c2d;
  background: #d5e75c;
  border-color: #e7f286;
}

.online-room-summary-card .clubhouse-summary-text {
  display: grid;
  gap: 4px;
}

.online-private-event-badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid rgba(15, 73, 88, 0.18);
  border-radius: 10px;
  padding: 0 12px;
  color: #60727d;
  background: #edf2f1;
  font-size: 0.7rem;
  font-weight: 950;
  letter-spacing: 0.055em;
}

.friendly-forfeit-dialog .modal {
  overflow: hidden;
  border: 1px solid rgba(213, 231, 92, 0.42);
  border-radius: 22px;
  color: #f8fbf5;
  background: linear-gradient(145deg, #062c31, #0c5350);
  box-shadow: 0 26px 70px rgba(3, 27, 32, 0.38);
}

.friendly-forfeit-dialog .modal h2 { color: #fff; }
.friendly-forfeit-dialog .modal > p:not(.event-transition-kicker) { color: rgba(248, 251, 245, 0.78); }

@media (max-width: 700px) {
  .global-player-dock { top: 82px; right: 14px; max-width: 210px; }
  .global-player-dock.docked { flex: 0 0 52px; max-width: 52px; margin-left: auto; }
  .global-player-dock.docked .global-player-profile { grid-template-columns: 38px; padding-right: 5px; }
  .global-player-dock.docked .global-player-copy { display: none; }
  .mode-clubhouse-topbar { flex-wrap: wrap; }
  .mode-clubhouse-topbar .page-return-actions,
  .topbar .top-actions { align-self: flex-end; margin-left: auto; }
  .global-player-copy small { display: none; }
  .lobby-hero { aspect-ratio: 16 / 7.2; }
  .lobby-hero img { object-position: 50% 35%; }
  .home-news-copy { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
  .home-news-copy time { grid-column: 1; font-size: .58rem; }
  .home-news-title { grid-column: 1; font-size: .76rem; }
  .home-news-read { grid-column: 2; grid-row: 1 / 3; font-size: 0; }
  .home-news-read span { font-size: 1.25rem; }
  .home-news-scroll { max-height: 330px; padding-right: 7px; }
  .solo-info-screen { width: 100%; }
  .solo-match-intro { grid-template-columns: 48px minmax(0, 1fr); gap: 14px; padding: 17px; }
  .solo-match-intro > img { width: 44px; height: 44px; }
  .solo-competition-accordion summary { grid-template-columns: 44px minmax(0, 1fr) 30px; gap: 10px; padding: 12px 14px; }
  .solo-competition-accordion summary > img { width: 40px; height: 40px; }
  .home-news-card,
  .home-news-card:only-child,
  .home-news-featured:nth-last-child(3),
  .home-news-featured:nth-last-child(5) { grid-template-columns: 100px minmax(0, 1fr); }
  .home-news-visual,
  .home-news-visual img { width: 100px; height: 60px; }
  .training-page-hero > img { object-position: 70% 22%; }
  .solo-clubhouse-hero > img { object-position: 70% 20%; }
  .online-page-hero > img,
  .online-room-hero > img { object-position: 70% 23%; }
  .circuit-goat-feature { grid-template-columns: 1fr; }
  .circuit-goat-feature img { min-height: 220px; max-height: 280px; }
  .ranking-head,
  .ranking-row { grid-template-columns: 38px minmax(68px, 1fr) repeat(3, minmax(42px, 52px)); gap: 4px; min-width: 0; }
  .friendly-visibility-section { grid-template-columns: 1fr; gap: 14px; }
  .content-page-panel .academy-upgrade-cta-info { border-radius: 0 0 22px 22px; }
}

/* Game information HUD ------------------------------------------------ */
.admin-game-tools {
  position: relative;
  z-index: 80;
}

.admin-game-tools-button {
  border-color: rgba(233, 255, 112, .55);
  color: #e9ff70;
  background: rgba(6, 45, 62, .88);
}

.admin-game-tools-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  gap: 8px;
  width: min(290px, calc(100vw - 32px));
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 14px;
  padding: 12px;
  background: rgba(5, 31, 48, .98);
  box-shadow: 0 20px 48px rgba(0, 0, 0, .36);
  backdrop-filter: blur(16px);
}

.admin-game-tools-panel.hidden { display: none; }
.admin-game-tools-panel > p { margin: 0 0 2px; color: #8ce0bf; font-size: .68rem; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; }
.admin-game-tools-panel .small-button { width: 100%; justify-content: flex-start; text-align: left; }
.admin-game-tools-panel .reveal-button { color: #581c45; background: #f8d7e5; }
.admin-game-tools-panel .reveal-button.active { color: #fff; background: #8a2d58; }

.scoreboard { grid-template-columns: minmax(280px, 960px); margin-bottom: 14px; }
.rally-card {
  overflow: hidden;
  border: 1px solid rgba(140, 224, 191, .24);
  border-radius: 16px;
  padding: 0;
  color: #fff;
  background: linear-gradient(125deg, rgba(6, 43, 61, .96), rgba(8, 83, 78, .9));
  box-shadow: 0 16px 38px rgba(2, 18, 32, .24);
  backdrop-filter: blur(14px);
}

.rally-card.completed {
  border-color: rgba(15, 141, 104, .28);
  color: #17384a;
  background: rgba(248, 251, 249, .96);
  box-shadow: 0 14px 34px rgba(2, 18, 32, .2);
}

.rally-card.completed .rally-card-header { border-bottom-color: rgba(18, 57, 77, .12); }
.rally-card.completed .rally-card-header .label { color: #27836b; }
.rally-card.completed .rally-card-header > div > strong { color: #12394d; }
.rally-card.completed .rally-full-log-button { border-color: #c5cdd1; color: #344955; background: #e2e6e8; }

.rally-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  padding: 14px 16px 12px;
}

.rally-card-header .label { margin: 0 0 2px; color: #8ce0bf; font-size: .62rem; }
.rally-card-header > div > strong { color: #fff; font-size: 1rem; }
.rally-status-badge { display: inline-flex; align-items: center; justify-content: center; text-align: center; min-height: 30px; border-radius: 999px; padding: 6px 11px; font-size: .68rem; font-weight: 950; text-transform: uppercase; }
.rally-status-badge.live { color: #06372a; background: #8ce0bf; }
.rally-status-badge.completed { color: #fff; box-shadow: 0 4px 10px rgba(18, 57, 77, .16); }
.rally-status-badge.completed.rally-end-points { background: #087162; }
.rally-status-badge.completed.rally-end-boost { color: #3f3000; background: #e2b52f; }
.rally-status-badge.completed.rally-end-effect { background: #75409e; }
.rally-score-delta-badge { display: inline-flex; align-items: center; min-height: 30px; border: 1px solid rgba(18, 57, 77, .14); border-radius: 999px; padding: 6px 11px; color: #12394d; background: #edf5f3; font-size: .72rem; font-weight: 950; white-space: nowrap; }
.rally-score-delta-badge.hidden { display: none; }

.rally-state { gap: 0; color: #fff; font-size: .84rem; }
.rally-info-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rally-info-chip { display: grid; align-content: center; min-width: 0; min-height: 68px; border-right: 1px solid rgba(255, 255, 255, .1); padding: 11px 16px; }
.rally-info-chip:last-child { border-right: 0; }
.rally-info-chip.primary { background: rgba(140, 224, 191, .08); }
.rally-info-chip span { color: rgba(255, 255, 255, .58); font-size: .58rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.rally-info-chip strong { min-width: 0; overflow: hidden; color: #fff; font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }
.rally-info-chip small { margin-top: 1px; color: #8ce0bf; font-size: .62rem; font-weight: 850; }
.rally-card.completed .rally-state { color: #17384a; }
.rally-card.completed .rally-info-chip { border-right-color: rgba(18, 57, 77, .12); }
.rally-card.completed .rally-info-chip.primary { background: #edf5f3; }
.rally-card.completed .rally-info-chip span { color: #6c808b; }
.rally-card.completed .rally-info-chip strong { color: #12394d; }
.rally-result-grid { grid-template-columns: max-content minmax(0, 1fr) auto; }
.rally-result-grid .rally-info-chip { min-height: 76px; }
.rally-result-grid .rally-info-chip.primary { min-width: 170px; }
.rally-score-chip { gap: 6px; }
.rally-end-score-values { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; overflow-x: auto; }
.rally-end-score-values strong {
  overflow: visible;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 11px;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1;
  text-overflow: clip;
}
.rally-card.completed .rally-end-score-values strong.won-left { border-color: rgba(8, 113, 98, .25); color: #075d51; background: #d8f1e9; }
.rally-card.completed .rally-end-score-values strong.won-right { border-color: rgba(108, 60, 160, .22); color: #5e348d; background: #eee3f8; }
.rally-card.completed .rally-end-score-values strong.current { border-color: #087162; color: #fff; background: #087162; box-shadow: 0 5px 12px rgba(8, 113, 98, .2); }
.rally-end-score-values i { color: #9bacb4; font-style: normal; font-weight: 900; }
.rally-end-score-empty { color: #9bacb4; font-size: 1.35rem; font-weight: 950; }
.rally-next-chip { align-content: center; justify-items: end; min-width: max-content; }
.rally-next-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.rally-next-actions:empty::after { content: "—"; color: #9bacb4; font-weight: 900; }
.rally-next-actions .next-exchange-button,
.rally-next-actions .replay-match-button { width: auto; min-height: 34px; margin: 0; padding: 7px 10px; font-size: .66rem; }
.top-progression-actions { display: flex; align-items: center; justify-content: flex-end; }
.top-progression-actions.hidden { display: none; }
.top-progression-actions .next-exchange-button,
.top-progression-actions .replay-match-button { width: auto; min-height: 34px; margin: 0; padding: 7px 11px; font-size: .68rem; }
.center-progression-actions { position: relative; z-index: 20; display: flex; justify-content: center; margin-top: 10px; }
.center-card-wrap.boosted-center-wrap + .center-progression-actions { margin-top: 140px; }
.center-progression-actions:empty { display: none; }
.center-progression-actions .next-exchange-button,
.center-progression-actions .replay-match-button { width: auto; margin: 0; }
.rally-context-list { display: grid; gap: 7px; border-top: 1px solid rgba(255, 255, 255, .1); padding: 10px 12px 12px; }
.rally-context-line { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px; align-items: center; border-radius: 9px; padding: 8px 10px; }
.rally-context-line strong { font-size: .65rem; text-transform: uppercase; }
.rally-context-line span { min-width: 0; font-weight: 800; }
.rally-context-line.constraint { color: #ffd9d2; background: rgba(163, 31, 31, .42); }
.rally-context-line.boost { color: #3b2a00; background: #f2c84b; }

.effect-notice {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 2px 12px;
  margin: 0 12px 12px;
  border: 1px solid rgba(199, 163, 255, .4);
  border-radius: 10px;
  padding: 10px 12px;
  color: #f7efff;
  background: rgba(89, 47, 135, .42);
  font-size: .8rem;
}
.effect-notice.hidden { display: none; }
.effect-notice-kicker { grid-row: 1 / 3; align-self: center; border-radius: 999px; padding: 5px 8px; color: #3b1769; background: #d9c2ff; font-size: .58rem; font-weight: 950; text-transform: uppercase; }
.effect-notice strong { margin: 0; color: #fff; text-transform: none; }
.effect-notice p { margin: 0; color: rgba(255, 255, 255, .76); }

.result-panel {
  overflow: hidden;
  border: 1px solid rgba(140, 224, 191, .28);
  border-radius: 14px;
  padding: 12px 14px;
  color: #17384a;
  background: rgba(248, 251, 249, .96);
  box-shadow: 0 14px 34px rgba(2, 18, 32, .2);
  backdrop-filter: blur(14px);
}

.result-panel.match-finale-host {
  overflow: visible;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.result-banner-heading { display: grid; grid-template-columns: minmax(240px, 1fr) auto; gap: 16px; align-items: center; }
.result-winner-copy { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: center; }
.result-banner-heading .eyebrow { grid-column: 1 / -1; margin: 0 0 2px; color: #27836b; font-size: .58rem; }
.result-panel .winner-dialog { display: block; margin: 0; border: 0; padding: 0; color: #12394d; background: transparent; font-size: clamp(1.25rem, 2.2vw, 1.75rem); line-height: 1; }
.result-outcome-badge { display: inline-flex; align-items: center; gap: 6px; justify-self: start; border-radius: 999px; padding: 6px 9px; color: #fff; font-size: .62rem; font-weight: 950; letter-spacing: .04em; text-transform: uppercase; }
.result-outcome-badge i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(255,255,255,.2); }
.result-outcome-badge small { color: inherit; font-size: .58rem; opacity: .78; }
.outcome-power .result-outcome-badge { background: linear-gradient(120deg, #087162, #15927b); }
.outcome-boost .result-outcome-badge { background: linear-gradient(120deg, #6c3ca0, #a33fb0); }
.outcome-automatic .result-outcome-badge { color: #442b00; background: linear-gradient(120deg, #efb638, #ffd66a); }
.result-score-summary { display: flex; align-items: stretch; justify-content: flex-end; gap: 8px; }
.result-match-score { display: grid; gap: 7px; width: min(520px, 100%); margin-top: 9px; border: 1px solid rgba(8,59,83,.12); border-radius: 10px; padding: 9px 11px; background: #edf5f3; }
.result-match-confrontation { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 7px; color: #23495b; font-size: .7rem; line-height: 1.25; }
.result-match-confrontation strong { color: #12394d; font-size: .76rem; }
.result-match-confrontation span { color: #6c808b; font-size: .55rem; font-weight: 900; text-transform: uppercase; }
.result-power-score > small { color: #6c808b; font-size: .52rem; font-weight: 950; letter-spacing: .04em; text-transform: uppercase; }
.result-match-score-values { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 34px; }
.result-match-score-values strong { border: 1px solid transparent; border-radius: 8px; padding: 6px 10px; color: #12394d; background: #fff; font-size: 1.2rem; line-height: 1; }
.result-match-score-values strong.current { padding: 7px 13px; color: #fff; background: #087162; font-size: 1.55rem; box-shadow: 0 5px 12px rgba(8,113,98,.18); }
.result-match-score-values strong.won-left { border-color: rgba(8,113,98,.25); color: #075d51; background: #d8f1e9; }
.result-match-score-values strong.won-right { border-color: rgba(108,60,160,.22); color: #5e348d; background: #eee3f8; }
.result-match-score-values i { color: #9bacb4; font-style: normal; }
.result-power-score { display: grid; align-content: center; justify-items: end; min-width: 104px; border-radius: 10px; padding: 7px 10px; background: #e7eef1; }
.result-power-score strong { color: #244b5e; font-size: 1rem; line-height: 1; }
.result-power-score strong i { margin: 0 4px; color: #91a2aa; font-style: normal; }
.result-reason { margin: 9px 0 0; border-left: 3px solid #27836b; padding: 4px 0 4px 9px; color: #405c6c; font-size: .78rem; line-height: 1.35; }
.outcome-boost + .result-reason { border-left-color: #8a43a5; }
.outcome-automatic + .result-reason { border-left-color: #e0a82f; }
.result-bonus-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.result-bonus-list span { border: 1px solid rgba(223,159,39,.24); border-radius: 999px; padding: 5px 8px; color: #76551a; background: #fff8e9; font-size: .66rem; font-weight: 800; }
.result-bonus-list strong { color: #a76700; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.result-actions .next-exchange-button,
.result-actions .replay-match-button { margin: 0; }

.tournament-panel { border-radius: 16px; padding: 18px; background: linear-gradient(125deg, rgba(6, 38, 59, .96), rgba(20, 42, 76, .94)); }
.tournament-header { align-items: flex-start; border-bottom: 1px solid rgba(255,255,255,.11); padding-bottom: 14px; }
.tournament-header-copy { display: grid; gap: 6px; min-width: 0; }
.tournament-header-copy .eyebrow { margin: 0; color: #8ce0bf; }
.tournament-header h2 { font-size: clamp(1.15rem, 2.3vw, 1.55rem); text-transform: none; }
.tournament-meta-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tournament-meta-row .difficulty-reminder { margin: 0; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; background: rgba(255,255,255,.09); }
.tournament-meta-row .tournament-location-reminder { color: #d8eff8; }
.tournament-meta-row .weekly-points-reminder { border-color: rgba(242,200,75,.42); color: #3b2a00; background: #f2c84b; }
.tournament-toggle-button { color: #083349; background: #e9ff70; }
.tournament-match,
.tournament-champion { border-radius: 11px; background: rgba(255,255,255,.075); }
.tournament-player-row { border-radius: 8px; }
.tournament-match { position: relative; display: grid; gap: 6px; overflow: hidden; border-color: rgba(255,255,255,.14); padding: 10px; box-shadow: 0 10px 24px rgba(0,0,0,.12); }
.tournament-match.current { border-color: #e9ff70; background: linear-gradient(145deg, rgba(233,255,112,.14), rgba(255,255,255,.08)); }
.tournament-match.final-match { border-color: rgba(242,200,75,.42); background: linear-gradient(145deg, rgba(242,200,75,.13), rgba(255,255,255,.07)); }
.tournament-match-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tournament-match-head .tournament-round-label { margin: 0; }
.tournament-match-status { border-radius: 999px; padding: 4px 7px; color: rgba(255,255,255,.66); background: rgba(255,255,255,.08); font-size: .54rem; font-weight: 950; text-transform: uppercase; white-space: nowrap; }
.tournament-match-status.live { display: inline-flex; align-items: center; gap: 5px; color: #a8f0ca; background: rgba(25,136,86,.2); }
.tournament-match-status.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #42d982; animation: tournament-live-pulse 1.2s ease-in-out infinite alternate; }
.tournament-match-status.complete { color: #06372a; background: #8ce0bf; }
.tournament-player-row { min-height: 38px; align-items: center; border: 1px solid transparent; padding: 7px 9px; }
.tournament-player-row.winner { box-shadow: inset 4px 0 0 rgba(255,255,255,.72); }
.tournament-score { justify-self: end; margin-top: 2px; border-radius: 999px; padding: 4px 8px; color: #e9ff70; background: rgba(0,0,0,.18); font-size: .78rem; }
.tournament-set-scores { display: flex; flex-wrap: wrap; gap: 4px; background: transparent; padding: 0; }
.tournament-set-scores span { min-width: 42px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 5px 8px; color: #e8f6f2; background: rgba(0,0,0,.18); font-size: .9rem; font-weight: 950; line-height: 1; text-align: center; }
.tournament-set-scores.live span { border-color: rgba(66,217,130,.35); color: #a8f0ca; background: rgba(25,136,86,.16); }
.tournament-set-scores span.winner-set { border-color: #fff; color: #14394b; background: #fff; box-shadow: 0 3px 9px rgba(0,0,0,.2); }
@keyframes tournament-live-pulse { from { background: #36ba72; box-shadow: 0 0 0 2px rgba(54,186,114,.12); } to { background: #79e7a7; box-shadow: 0 0 0 4px rgba(121,231,167,.2); } }
.tournament-champion { overflow: hidden; }
.tournament-champion-visual { position: relative; width: min(104px, 100%); height: auto; aspect-ratio: 1; overflow: hidden; margin-inline: auto; border: 1px solid rgba(242,200,75,.35); border-radius: 10px; background: linear-gradient(145deg, rgba(242,200,75,.18), rgba(110,72,11,.2)); }
.tournament-champion-portrait { width: 100%; height: 100%; object-fit: cover; object-position: 50% 16%; }

.competition-summary-screen { min-height: 100vh; background: radial-gradient(circle at top, rgba(69,94,168,.2), transparent 42%), #061f30; }
.competition-summary-shell { width: min(1480px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 56px; }
.competition-summary-content { display: grid; gap: 24px; }
.competition-summary-hero,
.competition-summary-winner,
.competition-summary-bracket { border: 1px solid rgba(140,224,191,.2); border-radius: 22px; background: rgba(6,45,66,.94); box-shadow: 0 22px 56px rgba(0,0,0,.25); }
.competition-summary-hero { padding: 28px; color: #fff; }
.competition-summary-hero h1 { margin: 4px 0 18px; font-size: clamp(2rem, 5vw, 4.6rem); text-transform: uppercase; }
.competition-summary-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.competition-summary-meta span { border-radius: 999px; padding: 8px 12px; color: #dff9ef; background: rgba(140,224,191,.1); font-size: .72rem; font-weight: 900; text-transform: uppercase; }
.competition-summary-winner { display: flex; align-items: center; gap: 24px; padding: 24px; color: #fff; }
.competition-summary-winner img { width: clamp(120px, 18vw, 220px); aspect-ratio: 1; border-radius: 18px; object-fit: cover; object-position: 50% 16%; }
.competition-summary-winner div { display: grid; gap: 6px; }
.competition-summary-winner span { color: #8ce0bf; font-size: .72rem; font-weight: 900; text-transform: uppercase; }
.competition-summary-winner strong { font-size: clamp(1.5rem, 4vw, 3rem); }
.competition-summary-bracket { overflow: hidden; padding: 24px; color: #fff; }
.competition-summary-rounds { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 16px; overflow-x: auto; padding: 12px 2px 18px; }
.competition-summary-round { display: grid; align-content: start; gap: 10px; }
.competition-summary-round h3 { margin: 0 0 4px; color: #8ce0bf; font-size: .75rem; text-transform: uppercase; }
.competition-summary-finish { justify-self: center; min-width: min(360px, 100%); }

@media (max-width: 700px) {
  .competition-summary-shell { width: min(100% - 20px, 1480px); padding-top: 16px; }
  .competition-summary-hero,
  .competition-summary-winner,
  .competition-summary-bracket { border-radius: 16px; padding: 18px; }
  .competition-summary-winner { align-items: flex-start; }
  .competition-summary-winner img { width: 112px; }
}
.tournament-champion-crown { position: absolute; right: 7px; bottom: 7px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(74,43,0,.78); box-shadow: 0 5px 14px rgba(0,0,0,.32); }
.tournament-champion-crown img { width: 22px; height: 22px; object-fit: contain; }
.tournament-champion:not(.is-crowned) .tournament-champion-visual { display: grid; place-items: center; }
.tournament-champion:not(.is-crowned) .tournament-champion-crown { position: static; width: 56px; height: 56px; }
.tournament-champion:not(.is-crowned) .tournament-champion-crown img { width: 38px; height: 38px; }
.league-standings { border-radius: 12px; background: rgba(255,255,255,.075); }
.league-standings-row { border-left: 3px solid transparent; border-radius: 8px; }
.league-standings-row.qualified { border-left-color: #27836b; }
.league-standings-row.human-player { position: relative; border-left-color: #f2c84b; outline-color: rgba(242,200,75,.92); }
.league-rank { color: #547080; font-size: .78rem; }

.character-stats { grid-template-columns: minmax(104px, 112px) 84px; grid-template-areas: "power endurance" "power hand"; align-items: stretch; }
.character-power-reminder { grid-area: power; }
.character-power-reminder { min-width: 104px; padding: 10px 6px; }
.character-power-reminder .stat-value-row { width: 100%; justify-content: flex-start; gap: 4px; }
.character-power-reminder .stat-value-row strong { min-width: 2ch; text-align: left; }
.character-endurance-reminder { grid-area: endurance; width: 84px; min-width: 84px; min-height: 48px; padding: 6px 8px; }
.character-hand-reminder { grid-area: hand; position: relative; display: grid; grid-template-columns: 24px auto; column-gap: 6px; align-items: center; justify-content: center; width: 84px; min-width: 84px; min-height: 48px; border: 2px solid rgba(255,255,255,.88); border-radius: 8px; padding: 5px 7px; color: #244b5e; background: #edf4f6; text-align: center; box-shadow: 0 10px 22px rgba(9,71,74,.13); }
.character-hand-reminder > strong { color: #244b5e; font-size: 1.3rem; line-height: .9; }
.hand-cards-icon { position: relative; display: block; width: 22px; height: 22px; }
.hand-cards-icon i { position: absolute; width: 14px; height: 19px; border: 2px solid currentColor; border-radius: 3px; background: #fff; }
.hand-cards-icon i:first-child { left: 1px; top: 2px; transform: rotate(-8deg); opacity: .64; }
.hand-cards-icon i:last-child { right: 0; top: 0; }
.character-hand-reminder.low-hand { color: #a86500; background: #fff6df; }
.character-hand-reminder.critical-hand { color: #b33a34; background: #fff0ee; }
.character-hand-reminder.empty-hand { color: #7d8b92; background: #e4e9eb; }
.character-hand-reminder.low-hand > strong,
.character-hand-reminder.critical-hand > strong,
.character-hand-reminder.empty-hand > strong { color: inherit; }

.rally-card-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.rally-full-log-button { min-height: 30px; border: 1px solid rgba(140,224,191,.32); border-radius: 999px; padding: 5px 9px; color: #a9ead1; background: rgba(140,224,191,.08); font-size: .58rem; font-weight: 950; text-transform: uppercase; cursor: pointer; }
.rally-full-log-button:hover,
.rally-full-log-button:focus-visible { color: #062e2b; background: #8ce0bf; }

/* Présentation événementielle avant la rencontre. */
.confrontation-intro-backdrop { padding: 18px; background: radial-gradient(circle at 50% 18%, rgba(20,129,104,.24), transparent 44%), rgba(2,17,29,.74); backdrop-filter: blur(8px); }
.confrontation-intro { position: relative; width: min(720px, 100%); min-height: 500px; overflow: hidden; border: 1px solid rgba(140,224,191,.42); border-radius: 22px; padding: 22px; color: #fff; background: linear-gradient(145deg, rgba(5,47,68,.98), rgba(6,32,52,.98)); box-shadow: 0 30px 90px rgba(0,0,0,.58), inset 0 1px 0 rgba(255,255,255,.08); }
.confrontation-event-glow { position: absolute; top: -130px; left: 50%; width: 520px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(140,224,191,.2), transparent 68%); transform: translateX(-50%); pointer-events: none; }
.confrontation-intro-event { position: relative; display: grid; grid-template-columns: minmax(0,1.35fr) minmax(0,1fr) minmax(110px,.7fr); gap: 8px; align-items: stretch; }
.confrontation-intro-event.no-location { grid-template-columns: minmax(0,1.5fr) minmax(130px,1fr); }
.confrontation-intro-type,
.confrontation-intro-location,
.confrontation-intro-round { display: grid; align-content: center; gap: 2px; min-width: 0; margin: 0; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 10px 12px; text-align: left; background: rgba(255,255,255,.055); }
.confrontation-intro-type { margin: 0; text-transform: none; }
.confrontation-intro-type span,
.confrontation-intro-location span,
.confrontation-intro-round span { color: #8ce0bf; font-size: .54rem; font-weight: 950; letter-spacing: .06em; text-transform: uppercase; }
.confrontation-intro-type strong { color: #fff; font-size: 1rem; text-transform: uppercase; }
.confrontation-intro-type small { overflow: hidden; color: rgba(255,255,255,.58); font-size: .6rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.confrontation-intro-location strong,
.confrontation-intro-round strong { overflow: hidden; color: #fff; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.confrontation-intro-versus { position: relative; grid-template-columns: minmax(0,1fr) 62px minmax(0,1fr); gap: 18px; margin-top: 16px; }
.confrontation-intro-player { gap: 5px; }
.confrontation-player-card-frame { position: relative; width: min(195px,100%); height: 242px; overflow: hidden; box-sizing: border-box; border: 0; border-radius: var(--game-card-radius); box-shadow: 0 18px 38px rgba(0,0,0,.36); }
.confrontation-player-card-frame::after { display: none; }
.confrontation-intro-player img { width: 100%; height: 100%; aspect-ratio: auto; border: 0; border-radius: var(--game-card-radius); object-fit: cover; object-position: 50% 13%; box-shadow: none; }
.confrontation-intro-player strong { font-size: .92rem; }
.confrontation-intro-player .confrontation-player-rank { border-radius: 999px; padding: 4px 8px; color: #173400; background: #e9ff70; font-size: .68rem; }
.confrontation-versus-mark { display: grid; place-items: center; align-self: center; }
.confrontation-versus-mark span { display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid rgba(140,224,191,.34); border-radius: 50%; color: #8ce0bf; background: rgba(140,224,191,.08); font-size: 1.05rem; font-weight: 1000; box-shadow: 0 0 0 8px rgba(140,224,191,.035); }
.confrontation-sequence-item { opacity: 0; transform: translateY(10px) scale(.985); transition: opacity 300ms ease, transform 360ms cubic-bezier(.2,.78,.25,1); }
.confrontation-sequence-item.revealed { opacity: 1; transform: none; }
.confrontation-countdown-shell { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 14px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 13px; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity 280ms ease, transform 300ms ease; }
.confrontation-countdown-shell.revealed { opacity: 1; visibility: visible; transform: none; }
.confrontation-intro-countdown { display: flex; align-items: center; }
.confrontation-intro-countdown strong { width: 38px; height: 38px; border: 2px solid #8ce0bf; color: #8ce0bf; font-size: 1.25rem; }
.confrontation-start-button { min-height: 40px; margin: 0; padding: 0 20px; }

.rally-stakes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rally-stakes .rally-context-line {
  flex: 1 1 230px;
}

#returnLobbyButton.friendly-match-complete-return {
  border-color: rgba(140, 224, 191, .72);
  color: #062e2c;
  background: #8ce0bf;
  box-shadow: 0 8px 24px rgba(31, 145, 111, .24);
}

/* Rayon unique pour toutes les représentations des cartes du jeu. */
:root { --game-card-radius: 7.2% / 5.2%; }
.card-visual,
.character-card,
.played-visual,
.choice-card-visual { border-radius: var(--game-card-radius); }
.card-visual > img:not(.forbid-effect-overlay),
.character-card > img,
.played-visual > img:not(.remise-forbid-overlay),
.profile-character-visual img,
.profile-character-choice img,
.academy-deck-card > img,
.image-zoom-figure img,
.card img,
.ultimate-dialog img,
.desktop-played-card-dialog img,
.card-local-preview img,
.choice-card img {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

.image-zoom-figure img,
.choice-card-visual img,
.tutorial-card-showcase img,
.confrontation-intro-player img {
  border-radius: var(--game-card-radius);
  clip-path: none;
  image-rendering: auto;
  transform: none;
  backface-visibility: visible;
}
.boost-sacrifice-back { border-radius: var(--game-card-radius); clip-path: inset(1px round 7.2%); }

/* À trois cartes par ligne, le conteneur arrondi suffit. Laisser le navigateur
   réduire directement le WebP source évite les couches intermédiaires et le
   rééchantillonnage agressif qui dégrade les petits textes selon l'écran. */
.hand .card-visual > img:not(.forbid-effect-overlay) {
  border-radius: 0;
  clip-path: none;
  image-rendering: auto;
}

@media (min-width: 1500px) {
  body.game-adaptive-board:not(.mobile-game-view) .app {
    width: min(1880px, calc(100vw - 24px));
  }

  body.game-adaptive-board:not(.mobile-game-view) .court {
    grid-template-columns: minmax(0, 1fr) clamp(170px, 10vw, 200px) minmax(0, 1fr);
  }
}

.center-lane .log {
  display: grid;
  align-self: end;
  gap: 8px;
  width: calc(100% - 18px);
  max-height: 360px;
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 12px;
  padding: 9px;
  color: #fff;
  background: rgba(4, 32, 48, .94);
  box-shadow: 0 12px 28px rgba(2, 18, 32, .22);
}

/* Desktop match board v4.1 -------------------------------------------------
   The mobile match keeps its dedicated mobile-game.css/mobile-game.js UI.
   This layout only applies to the legacy desktop game application. */
@media (min-width: 861px) {
  body:not(.mobile-game-view):has(.game-app:not(.hidden)) {
    overflow: hidden;
  }

  body:not(.mobile-game-view) .game-app {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 8px;
    width: min(1920px, 100vw);
    height: 100dvh;
    margin: 0 auto;
    padding: 8px 12px 12px;
    overflow: hidden;
  }

  body:not(.mobile-game-view) .game-app > .topbar {
    min-height: 48px;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 14px;
    padding: 6px 10px;
    background: rgba(4, 25, 40, .9);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .24);
    backdrop-filter: blur(14px);
  }

  body:not(.mobile-game-view) .game-app .topbar > div:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  body:not(.mobile-game-view) .game-app .topbar .eyebrow {
    display: none;
  }

  body:not(.mobile-game-view) .game-app .brand-logo {
    width: auto;
    height: 34px;
  }

  body:not(.mobile-game-view) .game-app .top-actions {
    align-items: center;
    gap: 6px;
  }

  body:not(.mobile-game-view) .game-app .top-actions .small-button,
  body:not(.mobile-game-view) .game-app .mode-info-badge {
    min-height: 32px;
    padding: 6px 10px;
    font-size: .66rem;
  }

  body:not(.mobile-game-view) .game-context-strip:empty,
  body:not(.mobile-game-view) .tournament-panel.hidden,
  body:not(.mobile-game-view) .result-panel.hidden {
    display: none;
  }

  body:not(.mobile-game-view) .game-context-strip,
  body:not(.mobile-game-view) .tournament-panel,
  body:not(.mobile-game-view) .result-panel,
  body:not(.mobile-game-view) .tutorial-overlay {
    grid-column: 1;
    margin: 0;
  }

  body:not(.mobile-game-view) .scoreboard {
    position: absolute;
    top: 8px;
    left: 50%;
    z-index: 35;
    width: min(660px, 48vw);
    margin: 0;
    transform: translateX(-50%);
    pointer-events: none;
  }

  body:not(.mobile-game-view) .rally-card {
    border-radius: 12px;
    background: linear-gradient(120deg, rgba(4, 31, 48, .97), rgba(8, 76, 77, .95));
    box-shadow: 0 12px 30px rgba(0, 0, 0, .28);
  }

  body:not(.mobile-game-view) .rally-card-header {
    min-height: 46px;
    padding: 7px 12px;
  }

  body:not(.mobile-game-view) .rally-card-header .label,
  body:not(.mobile-game-view) .rally-full-log-button {
    display: none;
  }

  body:not(.mobile-game-view) .rally-state,
  body:not(.mobile-game-view) .effect-notice:empty {
    display: none;
  }

  body:not(.mobile-game-view) .effect-notice:not(:empty) {
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    width: min(560px, 75vw);
    margin: 0;
    transform: translateX(-50%);
    pointer-events: auto;
  }

  body:not(.mobile-game-view) .court {
    position: relative;
    display: grid;
    grid-template-columns: clamp(154px, 12vw, 210px) minmax(0, 1fr) clamp(154px, 12vw, 210px);
    grid-template-rows: minmax(112px, 24%) minmax(190px, 42%) minmax(190px, 34%);
    min-height: 0;
    height: 100%;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 18px;
    background:
      linear-gradient(90deg, transparent 49.85%, rgba(255, 255, 255, .52) 50%, transparent 50.15%),
      linear-gradient(180deg, rgba(3, 24, 38, .18), rgba(3, 24, 38, .5));
    box-shadow: 0 24px 64px rgba(0, 0, 0, .32);
  }

  body:not(.mobile-game-view) .court::before {
    content: "";
    position: absolute;
    inset: 8% clamp(164px, 13vw, 220px) 4%;
    z-index: 0;
    border: 2px solid rgba(255, 255, 255, .3);
    background:
      linear-gradient(180deg, transparent 49.7%, rgba(255, 255, 255, .68) 49.8%, rgba(255, 255, 255, .68) 50.2%, transparent 50.3%),
      linear-gradient(90deg, transparent 49.85%, rgba(255, 255, 255, .34) 50%, transparent 50.15%);
    pointer-events: none;
  }

  body:not(.mobile-game-view) .player-panel {
    position: relative;
    z-index: 2;
    display: grid;
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    grid-template-columns: clamp(154px, 12vw, 210px) minmax(0, 1fr) clamp(154px, 12vw, 210px);
    grid-template-rows: minmax(112px, 24%) minmax(190px, 42%) minmax(190px, 34%);
    min-width: 0;
    min-height: 0;
    padding: 0;
    pointer-events: none;
  }

  body:not(.mobile-game-view) .player-panel.active {
    background: transparent;
    box-shadow: none;
  }

  body:not(.mobile-game-view) .player-panel > * {
    pointer-events: auto;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .player-header,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .player-header {
    align-self: stretch;
    display: grid;
    align-content: start;
    gap: 8px;
    min-width: 0;
    margin: 8px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 14px;
    padding: 10px;
    background: rgba(4, 28, 44, .91);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .26);
    backdrop-filter: blur(12px);
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .player-header {
    grid-column: 1;
    grid-row: 2 / 4;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .player-header {
    grid-column: 3;
    grid-row: 1 / 3;
  }

  body:not(.mobile-game-view) .player-header h2 {
    min-width: 0;
    padding: 4px 6px;
    font-size: clamp(.9rem, 1.25vw, 1.22rem);
    overflow-wrap: anywhere;
  }

  body:not(.mobile-game-view) .player-identity-panel {
    min-width: 0;
  }

  body:not(.mobile-game-view) .player-character-name {
    display: grid;
    gap: 5px;
    max-width: 100%;
    margin: 4px 0;
    font-size: .7rem;
  }

  body:not(.mobile-game-view) .badges {
    justify-content: flex-start;
  }

  body:not(.mobile-game-view) .badge,
  body:not(.mobile-game-view) .effect-chip {
    font-size: .58rem;
  }

  body:not(.mobile-game-view) .turn-buttons {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 4px;
  }

  body:not(.mobile-game-view) .turn-buttons button {
    min-height: 36px;
  }

  body:not(.mobile-game-view) .player-panel .character-zone {
    position: relative;
    align-self: end;
    display: grid;
    grid-template-columns: minmax(0, 72px) minmax(0, 1fr);
    gap: 7px;
    min-width: 0;
    margin: 0 10px 10px;
    pointer-events: none;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .character-zone {
    grid-column: 1;
    grid-row: 2 / 4;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .character-zone {
    grid-column: 3;
    grid-row: 1 / 3;
  }

  body:not(.mobile-game-view) .character-zone > * {
    pointer-events: auto;
  }

  body:not(.mobile-game-view) .character-card {
    width: 68px;
    align-self: end;
  }

  body:not(.mobile-game-view) .character-stats {
    align-self: end;
    grid-template-columns: 1fr;
    gap: 5px;
  }

  body:not(.mobile-game-view) .character-power-reminder,
  body:not(.mobile-game-view) .character-endurance-reminder,
  body:not(.mobile-game-view) .character-hand-reminder {
    min-width: 0;
    min-height: 48px;
    padding: 5px;
  }

  body:not(.mobile-game-view) .character-power-reminder strong {
    font-size: 1.45rem;
  }

  body:not(.mobile-game-view) .character-endurance-reminder strong {
    font-size: 1.2rem;
  }

  body:not(.mobile-game-view) .character-power-reminder > span,
  body:not(.mobile-game-view) .character-endurance-reminder > span {
    font-size: .5rem;
  }

  body:not(.mobile-game-view) .player-panel .hand {
    align-self: center;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: clamp(4px, .55vw, 10px);
    min-width: 0;
    min-height: 0;
    padding: 6px clamp(8px, 1vw, 18px);
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand {
    z-index: 12;
    grid-column: 2;
    grid-row: 3;
    align-self: end;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .hand {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    align-items: flex-start;
    padding-top: 7px;
  }

  body:not(.mobile-game-view) .hand .card {
    flex: 0 1 138px;
    width: min(9.4vw, 138px);
    min-width: 72px;
    max-height: min(30vh, 276px);
    overflow: visible;
    border-radius: var(--game-card-radius);
    padding: 4px;
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:hover,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:focus-within {
    z-index: 80;
    transform: translateY(-28%) scale(1.38);
    box-shadow: 0 28px 70px rgba(0, 0, 0, .56), 0 0 0 2px #f6c344;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .hand .card {
    flex-basis: 78px;
    width: clamp(48px, 5.2vw, 78px);
    max-height: 112px;
    padding: 3px;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .hand .card:not(.hidden-hand-card) {
    max-height: 132px;
    overflow: hidden;
  }

  body:not(.mobile-game-view) .hand .card-visual {
    flex: 1 1 auto;
    min-height: 0;
  }

  body:not(.mobile-game-view) .hand .card-actions {
    grid-template-columns: 1fr 1fr;
    gap: 3px;
  }

  body:not(.mobile-game-view) .hand .card-actions button {
    min-height: 30px;
    font-size: .67rem;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .hand .card-actions,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .hand .visual-stats,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .hand .card-assist-preview,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .hand .card-readable-data {
    display: none;
  }

  body:not(.mobile-game-view) .player-panel .played-history {
    display: none;
  }

  body:not(.mobile-game-view) .center-lane {
    position: relative;
    z-index: 6;
    grid-column: 2;
    grid-row: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 22%) minmax(0, 1fr);
    grid-template-rows: 1fr;
    min-width: 0;
    min-height: 0;
    padding: 8px;
    background: transparent;
    pointer-events: none;
  }

  body:not(.mobile-game-view) .center-lane > * {
    pointer-events: auto;
  }

  body:not(.mobile-game-view) .previous-turn {
    grid-column: 2;
    align-self: center;
    width: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: visible;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 14px;
    padding: 7px;
    background: rgba(4, 31, 48, .74);
    box-shadow: 0 16px 38px rgba(0, 0, 0, .3);
    backdrop-filter: blur(10px);
  }

  body:not(.mobile-game-view) .previous-turn .played-visual {
    max-height: min(30vh, 250px);
  }

  body:not(.mobile-game-view) .net-line {
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    height: 6px;
    border-top: 2px solid rgba(255, 255, 255, .78);
    border-bottom: 1px solid rgba(3, 20, 31, .72);
    background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .5) 0 3px, rgba(4, 31, 48, .4) 3px 7px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, .32);
  }

  body:not(.mobile-game-view) .center-lane .log {
    grid-column: 3;
    align-self: center;
    justify-self: end;
    width: min(240px, 92%);
    max-height: 160px;
    overflow: hidden;
  }

  body:not(.mobile-game-view) .action-log-header,
  body:not(.mobile-game-view) .action-log-entry.compact p {
    display: none;
  }

  body:not(.mobile-game-view) .action-log-open-button {
    min-height: 28px;
  }
}

@media (min-width: 861px) and (max-height: 760px) {
  body:not(.mobile-game-view) .game-app {
    padding-top: 5px;
    padding-bottom: 6px;
  }

  body:not(.mobile-game-view) .game-app > .topbar {
    min-height: 42px;
  }

  body:not(.mobile-game-view) .game-app .brand-logo {
    height: 28px;
  }

  body:not(.mobile-game-view) .court {
    grid-template-rows: minmax(90px, 22%) minmax(170px, 43%) minmax(160px, 35%);
  }

  body:not(.mobile-game-view) .player-panel {
    grid-template-rows: minmax(90px, 22%) minmax(170px, 43%) minmax(160px, 35%);
  }

  body:not(.mobile-game-view) .hand .card {
    width: min(8.2vw, 112px);
    max-height: 228px;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:hover,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:focus-within {
    transform: translateY(-20%) scale(1.25);
  }

  body:not(.mobile-game-view) .character-card {
    width: 54px;
  }
}

/* Admin mobile/desktop switch v5.35 -------------------------------------- */
.admin-game-view-switch,
.mobile-admin-game-view-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 4px;
  color: #fff;
  font-size: .7rem;
  font-weight: 950;
  letter-spacing: .035em;
}

.admin-game-view-switch input,
.mobile-admin-game-view-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.admin-game-view-switch i,
.mobile-admin-game-view-switch i {
  position: relative;
  width: 42px;
  height: 23px;
  border-radius: 999px;
  background: #59b5f7;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.65);
  cursor: pointer;
}

.admin-game-view-switch i::after,
.mobile-admin-game-view-switch i::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s ease;
}

.admin-game-view-switch input:checked + i::after,
.mobile-admin-game-view-switch input:checked + i::after {
  transform: translateX(19px);
}

/* Desktop player sidebars v4.3 ------------------------------------------- */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] {
    --desktop-player-color: #8ce0bf;
    --desktop-player-ink: #062e2b;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] {
    --desktop-player-color: #f2a37f;
    --desktop-player-ink: #3f1d15;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .player-header,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .player-header {
    align-content: end;
    border: 2px solid color-mix(in srgb, var(--desktop-player-color) 70%, transparent);
    padding: 270px 12px 14px;
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--desktop-player-color) 14%, transparent), transparent 42%),
      rgba(4, 28, 44, .94);
    box-shadow:
      inset 0 4px 0 var(--desktop-player-color),
      0 16px 38px rgba(0, 0, 0, .32);
  }

  body:not(.mobile-game-view) .player-panel .character-zone {
    z-index: 3;
    align-self: start;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 10px;
    width: calc(100% - 28px);
    margin: 24px 14px 0;
  }

  body:not(.mobile-game-view) .character-card {
    width: clamp(80px, 7vw, 108px);
    aspect-ratio: 1;
    overflow: hidden;
    border: 4px solid var(--desktop-player-color);
    border-radius: 50%;
    background: #09283a;
    box-shadow:
      0 0 0 5px rgba(255, 255, 255, .09),
      0 12px 30px rgba(0, 0, 0, .36);
  }

  body:not(.mobile-game-view) .character-card img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 13%;
  }

  body:not(.mobile-game-view) .character-card:hover {
    border-radius: 50%;
    transform: scale(1.08);
  }

  body:not(.mobile-game-view) .player-panel .character-stats {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 8px;
  }

  body:not(.mobile-game-view) .character-power-reminder,
  body:not(.mobile-game-view) .character-endurance-reminder {
    display: grid;
    place-items: center;
    width: clamp(68px, 5.6vw, 86px);
    min-width: 0;
    height: clamp(68px, 5.6vw, 86px);
    min-height: 0;
    border: 3px solid rgba(255, 255, 255, .82);
    border-radius: 50%;
    padding: 6px;
    color: var(--desktop-player-ink);
    background: var(--desktop-player-color);
    box-shadow:
      0 8px 20px rgba(0, 0, 0, .25),
      inset 0 -5px 0 rgba(0, 0, 0, .12);
  }

  body:not(.mobile-game-view) .character-power-reminder.leading-power {
    border-color: #fff4a3;
    background: var(--desktop-player-color);
  }

  body:not(.mobile-game-view) .character-endurance-reminder.low-endurance,
  body:not(.mobile-game-view) .character-endurance-reminder.warning-endurance {
    color: #fff;
    border-color: rgba(255, 255, 255, .9);
    background: #c92828;
  }

  body:not(.mobile-game-view) .character-power-reminder .stat-value-row,
  body:not(.mobile-game-view) .character-endurance-reminder .stat-value-row {
    gap: 7px;
    color: inherit;
  }

  body:not(.mobile-game-view) .character-power-reminder strong,
  body:not(.mobile-game-view) .character-endurance-reminder strong {
    color: inherit;
    font-size: clamp(1.35rem, 2vw, 1.9rem);
  }

  body:not(.mobile-game-view) .character-power-reminder .stat-symbol,
  body:not(.mobile-game-view) .character-endurance-reminder .stat-symbol {
    flex-basis: 24px;
    width: 24px;
    height: 24px;
  }

  body:not(.mobile-game-view) .character-power-reminder .stat-symbol-power {
    flex-basis: 26px;
    width: 26px;
    height: 26px;
  }

  body:not(.mobile-game-view) .character-power-reminder > span,
  body:not(.mobile-game-view) .character-endurance-reminder > span,
  body:not(.mobile-game-view) .character-hand-reminder,
  body:not(.mobile-game-view) .surface-bonus-stack {
    display: none;
  }

  body:not(.mobile-game-view) .player-identity-panel h2 {
    min-width: 0;
    width: 100%;
    color: #fff;
    background: transparent;
    text-align: center;
  }

  body:not(.mobile-game-view) .player-identity-panel.active-turn h2 {
    color: var(--desktop-player-ink);
    background: var(--desktop-player-color);
  }

  body:not(.mobile-game-view) .player-character-name {
    justify-items: center;
    text-align: center;
  }

  body:not(.mobile-game-view) .desktop-player-rank {
    border-color: color-mix(in srgb, var(--desktop-player-color) 76%, #fff);
    color: var(--desktop-player-ink);
    background: var(--desktop-player-color);
  }

  body:not(.mobile-game-view) .badges {
    display: grid;
    justify-items: stretch;
  }

  body:not(.mobile-game-view) .badges > .badge {
    justify-self: center;
  }

  body:not(.mobile-game-view) .desktop-player-bonuses {
    position: relative;
    width: 100%;
  }

  body:not(.mobile-game-view) .desktop-player-bonuses summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
    border: 1px solid color-mix(in srgb, var(--desktop-player-color) 70%, transparent);
    border-radius: 999px;
    color: var(--desktop-player-ink);
    background: var(--desktop-player-color);
    font-size: .7rem;
    font-weight: 950;
    letter-spacing: .05em;
    text-transform: uppercase;
    cursor: pointer;
    list-style: none;
  }

  body:not(.mobile-game-view) .desktop-player-bonuses summary::-webkit-details-marker {
    display: none;
  }

  body:not(.mobile-game-view) .desktop-player-bonuses summary span {
    display: grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    color: #fff;
    background: rgba(4, 28, 44, .76);
  }

  body:not(.mobile-game-view) .desktop-player-bonuses > div {
    position: absolute;
    right: 0;
    bottom: calc(100% + 7px);
    left: 0;
    z-index: 90;
    display: grid;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 12px;
    padding: 8px;
    background: rgba(4, 28, 44, .98);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .42);
  }

  body:not(.mobile-game-view) .desktop-player-bonus-label {
    border-radius: 8px;
    padding: 7px 8px;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    font-size: .62rem;
    font-weight: 800;
  }

  body:not(.mobile-game-view) .turn-buttons:empty {
    display: none;
  }

  body:not(.mobile-game-view) .turn-buttons .pass-button {
    min-height: 42px;
    border: 2px solid rgba(255, 255, 255, .82);
    border-radius: 999px;
    color: #fff;
    background: #c92828;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .24);
    font-size: .78rem;
    font-weight: 950;
    text-transform: uppercase;
  }
}
.action-log-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: start; border-bottom: 1px solid rgba(255,255,255,.1); padding: 2px 2px 8px; }
.action-log-header > div { display: grid; }
.action-log-header span { color: #8ce0bf; font-size: .51rem; font-weight: 950; letter-spacing: .04em; text-transform: uppercase; }
.action-log-header strong { font-size: .72rem; }
.action-log-header small { color: rgba(255,255,255,.48); font-size: .52rem; font-weight: 850; }
.action-log-list { display: grid; gap: 6px; }
.action-log-entry { position: relative; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 8px; align-items: start; border: 1px solid rgba(255,255,255,.08); border-radius: 9px; padding: 9px; color: #17384a; background: #f7faf8; }
.action-log-entry.compact { grid-template-columns: 7px minmax(0, 1fr); gap: 6px; padding: 7px; }
.action-log-marker { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: #78909c; box-shadow: 0 0 0 3px rgba(120,144,156,.13); }
.action-log-entry.shot .action-log-marker { background: #158b78; box-shadow: 0 0 0 3px rgba(21,139,120,.13); }
.action-log-entry.effect .action-log-marker { background: #8756bd; box-shadow: 0 0 0 3px rgba(135,86,189,.13); }
.action-log-entry.boost .action-log-marker { background: #e2af23; box-shadow: 0 0 0 3px rgba(226,175,35,.16); }
.action-log-entry.warning .action-log-marker { background: #c63e38; box-shadow: 0 0 0 3px rgba(198,62,56,.13); }
.action-log-entry.result .action-log-marker { background: #238855; box-shadow: 0 0 0 3px rgba(35,136,85,.13); }
.action-log-entry-copy { display: grid; min-width: 0; gap: 2px; }
.action-log-type { color: #70818d; font-size: .5rem; font-weight: 950; letter-spacing: .05em; text-transform: uppercase; }
.action-log-player { overflow: hidden; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.action-log-action { color: #1d7663; font-size: .66rem; font-weight: 900; }
.action-log-entry p { margin: 0; color: #425d6c; font-size: .63rem; line-height: 1.3; }
.action-log-result-title { color: #12394d; font-size: .78rem; }
.action-log-result-details { display: grid; gap: 4px; margin-top: 4px; }
.action-log-result-details p { border-left: 3px solid #27836b; padding: 3px 0 3px 8px; background: rgba(39, 131, 107, .055); }
.action-log-entry.compact .action-log-result-details p:not(:last-child) { display: none; }
.action-log-order { min-width: 20px; color: #98a6ae; font-size: .55rem; font-weight: 900; text-align: right; }
.action-log-entry.compact .action-log-order { display: none; }
.action-log-open-button { min-height: 32px; border: 1px solid rgba(140,224,191,.28); border-radius: 8px; color: #8ce0bf; background: rgba(140,224,191,.08); font-size: .6rem; font-weight: 950; cursor: pointer; }
.action-log-open-button:hover { color: #062e2b; background: #8ce0bf; }
.action-log-empty { margin: 0; padding: 10px; color: rgba(255,255,255,.58); font-size: .68rem; text-align: center; }

.action-log-backdrop { z-index: 260; padding: 24px; }
.action-log-dialog { display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(760px, 100%); max-height: min(760px, calc(100vh - 48px)); overflow: hidden; border: 1px solid rgba(140,224,191,.22); border-radius: 18px; color: #fff; background: #062d42; box-shadow: 0 28px 80px rgba(0,0,0,.46); }
.action-log-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid rgba(255,255,255,.1); padding: 18px 20px; }
.action-log-dialog .label { margin: 0; color: #8ce0bf; }
.action-log-dialog h2 { margin: 3px 0 0; color: #fff; }
.action-log-dialog-list { display: grid; gap: 8px; overflow: auto; padding: 14px; }
.action-log-dialog .action-log-entry { grid-template-columns: 12px minmax(0, 1fr) 34px; padding: 11px 13px; }
.action-log-dialog .action-log-type { font-size: .58rem; }
.action-log-dialog .action-log-player { font-size: .84rem; }
.action-log-dialog .action-log-action { font-size: .76rem; }
.action-log-dialog .action-log-entry p { font-size: .76rem; }

@media (max-width: 1100px) {
  .rally-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rally-result-grid { grid-template-columns: max-content minmax(0, 1fr) auto; }
  .rally-info-chip:nth-child(2) { border-right: 0; }
  .rally-info-chip:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.1); }
  .center-lane .log { width: 100%; max-height: 310px; }
  .action-log-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-log-open-button { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .admin-game-tools { position: static; }
  .admin-game-tools-panel { position: fixed; top: 82px; right: 14px; }
  .rally-card-header { align-items: flex-start; }
  .rally-card-actions { align-items: flex-end; flex-direction: column; }
  .rally-status-badge { max-width: 100%; text-align: center; }
  .rally-full-log-button { min-height: 28px; padding: 4px 7px; }
  .rally-info-grid { grid-template-columns: 1fr; }
  .rally-info-chip,
  .rally-info-chip:nth-child(2) { min-height: 56px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.1); }
  .rally-info-chip:last-child { border-bottom: 0; }
  .rally-context-line { grid-template-columns: 1fr; gap: 2px; }
  .effect-notice { grid-template-columns: 1fr; }
  .effect-notice-kicker { grid-row: auto; justify-self: start; }
  .result-banner-heading { grid-template-columns: 1fr; }
  .result-winner-copy { grid-template-columns: 1fr; gap: 5px; }
  .result-score-summary { justify-content: stretch; }
  .result-match-score { width: 100%; min-width: 0; }
  .result-power-score { min-width: 88px; }
  .tournament-header { align-items: stretch; flex-direction: column; }
  .tournament-toggle-button { width: 100%; }
  .league-standings { overflow-x: auto; padding: 9px; }
  .league-standings-head,
  .league-standings-row { min-width: 500px; }
  .action-log-list { grid-template-columns: 1fr; }
  .action-log-backdrop { padding: 10px; }
  .action-log-dialog { max-height: calc(100vh - 20px); }
  .action-log-dialog > header { padding: 14px; }
  .confrontation-intro-backdrop { padding: 9px; }
  .confrontation-intro { min-height: 0; max-height: calc(100vh - 18px); border-radius: 17px; padding: 13px; }
  .confrontation-intro-event { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
  .confrontation-intro-type { grid-column: 1 / -1; }
  .confrontation-intro-type,
  .confrontation-intro-location,
  .confrontation-intro-round { padding: 7px 9px; }
  .confrontation-intro-versus { grid-template-columns: minmax(0,1fr) 38px minmax(0,1fr); gap: 7px; margin-top: 10px; }
  .confrontation-player-card-frame { height: min(185px, 29vh); }
  .confrontation-intro-player img { height: 100%; }
  .confrontation-player-name { gap: 3px; }
  .confrontation-intro-player strong { font-size: .72rem; }
  .confrontation-versus-mark span { width: 36px; height: 36px; box-shadow: 0 0 0 4px rgba(140,224,191,.035); font-size: .76rem; }
  .confrontation-countdown-shell { gap: 10px; margin-top: 9px; padding-top: 9px; }
  .confrontation-start-button { min-height: 38px; padding: 0 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .tournament-match-status.live::before { animation: none; }
  .confrontation-sequence-item,
  .confrontation-countdown-shell { transition-duration: 1ms; }
}

/* Le journal possède une colonne image uniquement lorsqu’une carte est reconnue. */
.action-log-dialog .action-log-entry:not(.compact) { grid-template-columns: 10px minmax(0,1fr) 34px; }
.action-log-dialog .action-log-entry:not(.compact).has-card { grid-template-columns: 10px 44px minmax(0,1fr) 34px; }

@media (max-width: 700px) {
  .action-log-dialog .action-log-entry:not(.compact) { grid-template-columns: 8px minmax(0,1fr); }
  .action-log-dialog .action-log-entry:not(.compact).has-card { grid-template-columns: 8px 38px minmax(0,1fr); }
  .action-log-dialog .action-log-order { display: none; }
}

/* Desktop board v4.4 ----------------------------------------------------- */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .desktop-match-score {
    position: absolute;
    top: 8px;
    left: 50%;
    z-index: 42;
    width: min(430px, 36vw);
    transform: translateX(-50%);
    pointer-events: none;
  }

  body:not(.mobile-game-view) .desktop-match-score-list {
    display: grid;
    grid-auto-columns: minmax(58px, 1fr);
    grid-auto-flow: column;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  body:not(.mobile-game-view) .desktop-set-score {
    display: grid;
    grid-template-columns: 1fr 3px 1fr;
    align-items: center;
    min-height: 44px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 11px;
    color: #fff;
    background: rgba(4, 57, 55, .96);
    box-shadow: 0 9px 24px rgba(0, 0, 0, .28);
    font-size: 1rem;
    font-weight: 950;
    text-align: center;
  }

  body:not(.mobile-game-view) .desktop-set-score i {
    width: 3px;
    height: 19px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .18);
  }

  body:not(.mobile-game-view) .desktop-set-score--player {
    color: #082738;
    background: #8ce0bf;
  }

  body:not(.mobile-game-view) .desktop-set-score--opponent {
    color: #3f1d15;
    background: #f2a37f;
  }

  body:not(.mobile-game-view) .center-lane {
    z-index: 8;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 21vw) minmax(0, 1fr);
    overflow: hidden;
    padding: 12px 8px;
  }

  body:not(.mobile-game-view) .previous-turn {
    display: grid;
    place-items: center;
    width: min(205px, 100%);
    height: 100%;
    max-height: 100%;
    border: 0;
    padding: 4px;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  body:not(.mobile-game-view) .previous-turn .center-card-wrap {
    display: grid;
    place-items: center;
    max-width: 100%;
    max-height: 100%;
  }

  body:not(.mobile-game-view) .previous-turn .played-visual {
    width: auto;
    max-width: 100%;
    max-height: min(28vh, 235px);
  }

  body:not(.mobile-game-view) .previous-turn .previous-empty {
    border: 1px dashed rgba(255, 255, 255, .24);
    border-radius: 12px;
    padding: 14px;
    color: rgba(255, 255, 255, .58);
    background: rgba(3, 31, 45, .55);
    font-size: .68rem;
    text-align: center;
  }

  body:not(.mobile-game-view) .court > .log {
    z-index: 34;
    align-self: end;
    justify-self: stretch;
    grid-column: 3;
    grid-row: 3;
    display: grid;
    gap: 7px;
    width: auto;
    max-height: none;
    margin: 8px;
    overflow: visible;
    border: 0;
    padding: 0;
    color: #fff;
    background: transparent;
  }

  body:not(.mobile-game-view) .desktop-history-latest {
    position: relative;
    display: grid;
    gap: 5px;
    min-height: 84px;
    border: 1px solid rgba(255, 255, 255, .17);
    border-left: 5px solid #a9b8c5;
    border-radius: 0 12px 12px 0;
    padding: 10px;
    overflow: hidden;
    color: #f7fbff;
    background: rgba(3, 31, 45, .94);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .3);
  }

  body:not(.mobile-game-view) .desktop-history-latest--player {
    border-left-color: #8ce0bf;
  }

  body:not(.mobile-game-view) .desktop-history-latest--opponent {
    border-left-color: #f2a37f;
  }

  body:not(.mobile-game-view) .desktop-history-latest:has(img) {
    padding-right: 57px;
  }

  body:not(.mobile-game-view) .desktop-history-latest > div {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
  }

  body:not(.mobile-game-view) .desktop-history-latest span {
    border-radius: 999px;
    padding: 2px 6px;
    color: #d7e1e9;
    background: rgba(215, 225, 233, .1);
    font-size: .52rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  body:not(.mobile-game-view) .desktop-history-latest--player span,
  body:not(.mobile-game-view) .desktop-history-latest--player strong {
    color: #8ce0bf;
  }

  body:not(.mobile-game-view) .desktop-history-latest--opponent span,
  body:not(.mobile-game-view) .desktop-history-latest--opponent strong {
    color: #f2a37f;
  }

  body:not(.mobile-game-view) .desktop-history-latest p {
    margin: 0;
    color: rgba(255, 255, 255, .76);
    font-size: .64rem;
    line-height: 1.35;
  }

  body:not(.mobile-game-view) .desktop-history-latest > img {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 42px;
    height: calc(100% - 16px);
    border-radius: 6px;
    object-fit: cover;
  }

  body:not(.mobile-game-view) .desktop-history-button {
    min-height: 36px;
    border: 1px solid rgba(140, 224, 191, .42);
    border-radius: 999px;
    color: #062637;
    background: #8ce0bf;
    font-size: .65rem;
    font-weight: 950;
    text-transform: uppercase;
    cursor: pointer;
  }

  body:not(.mobile-game-view) .desktop-played-star-power {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: min(340px, 100%);
    border: 2px solid rgba(102, 202, 255, .66);
    border-radius: 14px;
    padding: 11px;
    color: #fff;
    background: linear-gradient(135deg, rgba(6, 103, 170, .96), rgba(4, 38, 67, .98));
    box-shadow: 0 16px 38px rgba(0, 0, 0, .38);
    animation: desktop-star-power-in 220ms ease-out both;
  }

  body:not(.mobile-game-view) .desktop-played-star-power--rose {
    border-color: rgba(255, 151, 194, .7);
    background: linear-gradient(135deg, rgba(177, 35, 99, .96), rgba(65, 18, 53, .98));
  }

  body:not(.mobile-game-view) .desktop-played-star-power img {
    width: 70px;
    aspect-ratio: 731 / 1039;
    border-radius: 8px;
    object-fit: cover;
  }

  body:not(.mobile-game-view) .desktop-played-star-power div {
    display: grid;
    gap: 4px;
    min-width: 0;
  }

  body:not(.mobile-game-view) .desktop-played-star-power span {
    color: #8bd7ff;
    font-size: .57rem;
    font-weight: 950;
    text-transform: uppercase;
  }

  body:not(.mobile-game-view) .desktop-played-star-power--rose span {
    color: #ffafd0;
  }

  body:not(.mobile-game-view) .desktop-played-star-power p {
    margin: 0;
    color: rgba(255, 255, 255, .8);
    font-size: .68rem;
    line-height: 1.35;
  }

  body:not(.mobile-game-view) .player-panel .character-zone {
    z-index: 5;
    align-self: start;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 7px;
    margin: 18px 12px 0;
  }

  body:not(.mobile-game-view) .character-card {
    width: clamp(78px, 7vw, 104px);
    align-self: center;
  }

  body:not(.mobile-game-view) .player-panel .character-stats {
    align-self: start;
    justify-items: center;
    gap: 7px;
  }

  body:not(.mobile-game-view) .character-power-reminder,
  body:not(.mobile-game-view) .character-endurance-reminder {
    width: clamp(60px, 4.8vw, 72px);
    height: clamp(60px, 4.8vw, 72px);
  }
}

@keyframes desktop-star-power-in {
  from { opacity: 0; transform: scale(.94); }
  to { opacity: 1; transform: scale(1); }
}

/* Desktop board v4.5 ----------------------------------------------------- */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .desktop-match-score {
    width: max-content;
    max-width: min(430px, 38vw);
  }

  body:not(.mobile-game-view) .desktop-match-score-list {
    grid-auto-columns: 96px;
    justify-content: center;
  }

  body:not(.mobile-game-view) .desktop-set-score {
    width: 96px;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .player-header,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .player-header {
    grid-row: 1 / -1;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .character-zone,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .character-zone {
    grid-row: 1 / -1;
  }

  body:not(.mobile-game-view) .center-lane {
    grid-template-columns: minmax(0, 1fr);
    padding: 0 12px;
    overflow: visible;
  }

  body:not(.mobile-game-view) .previous-turn {
    grid-column: 1;
    width: 100%;
    max-width: none;
    overflow: visible;
    padding: 0;
  }

  body:not(.mobile-game-view) .desktop-played-board {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
  }

  body:not(.mobile-game-view) .desktop-played-row {
    position: absolute;
    right: 0;
    left: 0;
    z-index: 9;
    height: 68%;
    min-height: 0;
    pointer-events: none;
  }

  body:not(.mobile-game-view) .desktop-played-row--opponent {
    top: -19%;
  }

  body:not(.mobile-game-view) .desktop-played-row--player {
    bottom: -19%;
    z-index: 10;
  }

  body:not(.mobile-game-view) .desktop-played-viewport {
    width: 100%;
    height: 100%;
    padding: 3px 36px;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
    pointer-events: auto;
  }

  body:not(.mobile-game-view) .desktop-played-viewport::-webkit-scrollbar {
    display: none;
  }

  body:not(.mobile-game-view) .desktop-played-track {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 1vw, 18px);
    width: max-content;
    min-width: 100%;
    height: 100%;
  }

  body:not(.mobile-game-view) .desktop-played-row.is-overflowing .desktop-played-track {
    justify-content: flex-start;
  }

  body:not(.mobile-game-view) .desktop-played-card {
    position: relative;
    flex: 0 0 auto;
    width: clamp(96px, 8.4vw, 148px);
    max-height: min(27vh, 230px);
    border: 2px solid rgba(255, 255, 255, .82);
    border-radius: var(--game-card-radius);
    padding: 0;
    overflow: visible;
    background: #09283a;
    box-shadow: 0 15px 34px rgba(0, 0, 0, .34);
    cursor: zoom-in;
    transition: transform 160ms ease, box-shadow 160ms ease;
    pointer-events: auto;
  }

  body:not(.mobile-game-view) .desktop-played-card:hover,
  body:not(.mobile-game-view) .desktop-played-card:focus-visible {
    z-index: 25;
    transform: translateY(-5px) scale(1.07);
    box-shadow: 0 22px 48px rgba(0, 0, 0, .5), 0 0 0 3px rgba(140, 224, 191, .35);
  }

  body:not(.mobile-game-view) .desktop-played-row--opponent .desktop-played-card:hover,
  body:not(.mobile-game-view) .desktop-played-row--opponent .desktop-played-card:focus-visible {
    box-shadow: 0 22px 48px rgba(0, 0, 0, .5), 0 0 0 3px rgba(242, 163, 127, .38);
  }

  body:not(.mobile-game-view) .desktop-played-card > img:not(.remise-forbid-overlay):not(.boost-sacrifice-back) {
    display: block;
    width: 100%;
    max-height: min(27vh, 230px);
    border-radius: calc(var(--game-card-radius) - 2px);
    object-fit: contain;
  }

  body:not(.mobile-game-view) .desktop-played-card.removed {
    filter: grayscale(.8) brightness(.66);
  }

  body:not(.mobile-game-view) .desktop-played-empty {
    align-self: center;
    border: 1px dashed rgba(255, 255, 255, .18);
    border-radius: 999px;
    padding: 7px 14px;
    color: rgba(255, 255, 255, .44);
    background: rgba(3, 31, 45, .5);
    font-size: .6rem;
    font-weight: 850;
  }

  body:not(.mobile-game-view) .desktop-played-scroll {
    position: absolute;
    top: 50%;
    z-index: 45;
    display: grid;
    place-items: center;
    width: 34px;
    height: 58px;
    border: 0;
    padding: 0;
    color: #fff;
    background: #ef312d;
    clip-path: polygon(100% 0, 100% 100%, 0 50%);
    font-size: 0;
    transform: translateY(-50%);
    cursor: pointer;
    pointer-events: auto;
  }

  body:not(.mobile-game-view) .desktop-played-scroll--previous {
    left: 0;
  }

  body:not(.mobile-game-view) .desktop-played-scroll--next {
    right: 0;
    transform: translateY(-50%) rotate(180deg);
  }

  body:not(.mobile-game-view) .desktop-played-scroll:disabled {
    opacity: .28;
    cursor: default;
  }

  body:not(.mobile-game-view) .desktop-star-reveal-layer {
    position: absolute;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: center;
    pointer-events: none;
  }

  body:not(.mobile-game-view) .ultimate-service-reveal-layer {
    position: absolute;
    inset: 0;
    z-index: 72;
    display: grid;
    place-items: center;
    pointer-events: none;
  }

  body:not(.mobile-game-view) .ultimate-service-reveal {
    grid-template-columns: 70px minmax(0, 1fr);
    border-color: rgba(140, 224, 191, .78);
    background: linear-gradient(135deg, rgba(8, 111, 102, .97), rgba(4, 38, 67, .98));
  }

  body:not(.mobile-game-view) .ultimate-service-reveal strong {
    font-size: .92rem;
    line-height: 1.1;
  }

  body:not(.mobile-game-view) .ultimate-service-reveal p {
    color: #8ce0bf;
    font-size: .72rem;
    font-weight: 950;
    letter-spacing: .08em;
  }

  body:not(.mobile-game-view) .center-progression-actions:not(:empty) {
    position: absolute;
    right: 50%;
    bottom: 4px;
    z-index: 60;
    transform: translateX(50%);
  }

  body:not(.mobile-game-view) .desktop-history-latest:has(button[data-open-latest-history-card]) {
    padding-right: 61px;
  }

  body:not(.mobile-game-view) .desktop-history-latest > button[data-open-latest-history-card] {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 44px;
    height: calc(100% - 16px);
    border: 0;
    border-radius: 6px;
    padding: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, .08);
    cursor: zoom-in;
  }

  body:not(.mobile-game-view) .desktop-history-latest > button[data-open-latest-history-card] img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

}

.desktop-played-card-backdrop {
  z-index: 1210;
  overflow-y: auto;
  background: rgba(0, 14, 23, .9);
  backdrop-filter: blur(4px);
}

.desktop-played-card-dialog {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(520px, calc(100vw - 40px));
  max-height: calc(100vh - 32px);
  padding: 12px 12px 18px;
  overflow-y: auto;
}

.desktop-played-card-large {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(59vh, 620px);
  border: 3px solid rgba(255, 255, 255, .92);
  border-radius: var(--game-card-radius);
  object-fit: contain;
  box-shadow: 0 25px 80px rgba(0, 0, 0, .58);
}

.desktop-played-card-close {
  position: fixed;
  top: 20px;
  right: 22px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(36, 67, 85, .94);
  font-size: 2rem;
  cursor: pointer;
}

.desktop-card-detail-panel {
  display: grid;
  gap: 10px;
  width: 100%;
  border: 1px solid rgba(140, 224, 191, .22);
  border-radius: 18px;
  padding: 18px;
  color: #f5fbff;
  background: #0a4056;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .32);
}

.desktop-card-detail-panel > span {
  color: #8ce0bf;
  font-size: .68rem;
  font-weight: 950;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.desktop-card-detail-panel h2 {
  margin: 0;
  color: #fff;
  font-size: 1.55rem;
}

.desktop-card-detail-panel dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.desktop-card-detail-panel dl div {
  display: grid;
  gap: 3px;
  border-radius: 12px;
  padding: 9px 5px;
  background: rgba(255, 255, 255, .07);
  text-align: center;
}

.desktop-card-detail-panel dt {
  color: rgba(255, 255, 255, .58);
  font-size: .62rem;
  font-weight: 850;
  text-transform: uppercase;
}

.desktop-card-detail-panel dd {
  margin: 0;
  color: #e7fb70;
  font-size: 1.15rem;
  font-weight: 950;
}

.desktop-card-detail-panel p {
  margin: 0;
  color: rgba(255, 255, 255, .78);
  font-size: .82rem;
  line-height: 1.45;
}

.desktop-card-detail-boost {
  justify-self: start;
  border-radius: 999px;
  padding: 5px 9px;
  color: #062637;
  background: #e7fb70;
  font-size: .65rem;
}

.action-log-backdrop {
  z-index: 1180;
  align-items: end;
  padding: 24px 24px 0;
  background: rgba(0, 14, 23, .84);
  backdrop-filter: blur(4px);
}

.action-log-dialog {
  position: relative;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(940px, 100%);
  height: min(84vh, 820px);
  max-height: none;
  border: 1px solid rgba(140, 224, 191, .22);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  color: #fff;
  background: #07364a;
}

.action-log-dialog > header {
  position: relative;
  min-height: 92px;
  justify-content: flex-start;
  padding: 38px 28px 18px;
}

.action-log-dialog h2 {
  font-size: 1.6rem;
}

.action-log-dialog-grabber {
  position: absolute;
  top: 13px;
  left: 50%;
  width: 70px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .3);
  transform: translateX(-50%);
}

.action-log-dialog-close {
  position: absolute;
  top: 18px;
  right: 22px;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(44, 78, 97, .96);
  font-size: 2rem;
  cursor: pointer;
}

.action-log-dialog-list {
  gap: 12px;
  padding: 0 28px 28px;
}

.desktop-history-entry {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  border-left: 7px solid #a9b8c5;
  border-radius: 0 15px 15px 0;
  padding: 16px 18px;
  color: #fff;
  background: #12475b;
}

.desktop-history-entry--player {
  border-left-color: #59ddbd;
}

.desktop-history-entry--opponent {
  border-left-color: #f3a17c;
}

.desktop-history-entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.desktop-history-entry-tags span {
  border-radius: 999px;
  padding: 4px 10px;
  color: #79e2c2;
  background: rgba(121, 226, 194, .11);
  font-size: .65rem;
  font-weight: 950;
  text-transform: uppercase;
}

.desktop-history-entry-tags span:not(:first-child) {
  color: #e7fb70;
}

.desktop-history-entry > p {
  grid-column: 1;
  margin: 0;
  color: rgba(255, 255, 255, .78);
  font-size: .86rem;
  line-height: 1.45;
}

.desktop-history-entry--player .desktop-history-player-name {
  color: #59ddbd;
}

.desktop-history-entry--opponent .desktop-history-player-name {
  color: #f3a17c;
}

.desktop-history-variations {
  grid-column: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.desktop-history-variations li {
  border-radius: 999px;
  padding: 6px 12px;
  color: #092b3c;
  background: #e7fb70;
  font-size: .72rem;
  font-weight: 950;
}

.desktop-history-card-button {
  grid-column: 2;
  grid-row: 1 / 4;
  width: 68px;
  min-height: 94px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 9px;
  padding: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, .08);
  cursor: zoom-in;
}

.desktop-history-card-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.boost-choice-backdrop,
.effect-choice-backdrop,
.coach-choice-backdrop,
.remove-choice-backdrop {
  z-index: 1160;
  background: rgba(0, 14, 23, .88);
  backdrop-filter: blur(4px);
}

.boost-choice-backdrop .modal,
.effect-choice-backdrop .modal,
.coach-choice-backdrop .modal,
.remove-choice-backdrop .modal {
  border: 1px solid rgba(140, 224, 191, .22);
  border-radius: 18px;
  color: #fff;
  background: #07364a;
}

.boost-choice-backdrop .modal h2,
.effect-choice-backdrop .modal h2,
.coach-choice-backdrop .modal h2,
.remove-choice-backdrop .modal h2 {
  color: #fff;
}

.boost-choice-backdrop .modal > p,
.effect-choice-backdrop .modal > p,
.coach-choice-backdrop .modal > p,
.remove-choice-backdrop .modal > p {
  color: rgba(255, 255, 255, .72);
}

.boost-choice-backdrop .choice-card,
.effect-choice-backdrop .choice-card,
.coach-choice-backdrop .choice-card,
.remove-choice-backdrop .choice-card {
  border-color: rgba(255, 255, 255, .15);
  color: #fff;
  background: #12475b;
}

.boost-choice-backdrop .choice-card:hover,
.effect-choice-backdrop .choice-card:hover,
.coach-choice-backdrop .choice-card:hover,
.remove-choice-backdrop .choice-card:hover {
  border-color: #8ce0bf;
  background: #18576d;
}

.boost-choice-backdrop .choice-card span,
.effect-choice-backdrop .choice-card span,
.coach-choice-backdrop .choice-card span,
.remove-choice-backdrop .choice-card span {
  color: rgba(255, 255, 255, .62);
}

@media (max-width: 700px) {
  .desktop-played-card-dialog {
    width: min(520px, calc(100vw - 18px));
    padding-right: 5px;
    padding-left: 5px;
  }

  .desktop-played-card-close {
    top: 12px;
    right: 12px;
  }

  .desktop-card-detail-panel {
    padding: 15px;
  }

  .desktop-card-detail-panel dl {
    gap: 5px;
  }

  .desktop-card-detail-panel dt {
    font-size: .52rem;
  }

  .action-log-backdrop {
    padding: 0;
  }

  .action-log-dialog {
    width: 100%;
    height: 82vh;
  }

  .action-log-dialog > header {
    padding-right: 82px;
    padding-left: 20px;
  }

  .action-log-dialog-list {
    padding: 0 14px 20px;
  }

  .desktop-history-entry {
    padding: 12px;
  }
}

/* Desktop board v4.6 ----------------------------------------------------- */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .game-app {
    grid-template-rows: auto minmax(0, 1fr);
  }

  body:not(.mobile-game-view) .court {
    grid-row: 2;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .player-header,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .character-zone {
    grid-row: 2 / 4;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .player-header,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .character-zone {
    grid-row: 1 / 3;
  }

  body:not(.mobile-game-view) .desktop-played-track {
    --desktop-played-card-width: clamp(96px, 8.4vw, 148px);
    justify-content: flex-start;
    gap: clamp(8px, 1vw, 18px);
  }

  body:not(.mobile-game-view) .desktop-played-row.is-overflowing .desktop-played-track {
    justify-content: flex-start;
  }

  body:not(.mobile-game-view) .desktop-played-slot {
    position: relative;
    flex: 0 0 var(--desktop-played-card-width);
    display: grid;
    place-items: center;
    width: var(--desktop-played-card-width);
    height: 100%;
  }

  body:not(.mobile-game-view) .desktop-played-slot--empty {
    pointer-events: none;
  }

  body:not(.mobile-game-view) .desktop-played-card {
    width: var(--desktop-played-card-width);
  }

  body:not(.mobile-game-view) .desktop-played-empty--overlay {
    position: absolute;
    left: 42px;
    top: 50%;
    transform: translateY(-50%);
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand {
    position: relative;
    isolation: isolate;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand::before {
    content: "";
    position: absolute;
    inset: -18px -8px -8px;
    z-index: 72;
    border-radius: 22px 22px 0 0;
    background:
      linear-gradient(180deg, rgba(4, 28, 44, .42) 0%, rgba(4, 28, 44, .16) 24%, transparent 56%),
      radial-gradient(ellipse at 50% 0%, rgba(140, 224, 191, .12), transparent 66%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
    pointer-events: none;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card {
    z-index: 71;
  }

  body:not(.mobile-game-view) .court > .log {
    grid-column: 2 / 4;
    justify-self: end;
    width: min(390px, 31vw);
    margin-right: 10px;
  }

  body:not(.mobile-game-view) .desktop-history-latest {
    min-height: 112px;
    padding: 13px;
  }

  body:not(.mobile-game-view) .desktop-history-latest p {
    font-size: .72rem;
    line-height: 1.42;
  }

  body:not(.mobile-game-view) .desktop-history-button {
    min-height: 42px;
    font-size: .72rem;
  }
}

/* Desktop board v4.7 ----------------------------------------------------- */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] {
    z-index: 24;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand {
    z-index: 90;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand::before {
    z-index: 91;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card {
    z-index: 92;
  }

  body:not(.mobile-game-view) .desktop-played-track {
    --desktop-played-step: calc((var(--desktop-played-card-width) / 2) + clamp(4px, .35vw, 7px));
    gap: 0;
    padding-right: calc(var(--desktop-played-card-width) / 2);
  }

  body:not(.mobile-game-view) .desktop-played-slot {
    flex-basis: var(--desktop-played-step);
    width: var(--desktop-played-step);
    justify-items: start;
  }

  body:not(.mobile-game-view) .desktop-played-board > .desktop-played-scroll {
    top: 50%;
  }

  body:not(.mobile-game-view) .desktop-history-progression-actions {
    display: grid;
    gap: 6px;
  }

  body:not(.mobile-game-view) .desktop-history-progression-actions:empty {
    display: none;
  }

  body:not(.mobile-game-view) .desktop-history-progression-actions .next-exchange-button,
  body:not(.mobile-game-view) .desktop-history-progression-actions .replay-match-button,
  body:not(.mobile-game-view) .desktop-history-progression-actions button {
    width: 100%;
    min-height: 40px;
    margin: 0;
  }
}

/* Desktop interface v4.8 ------------------------------------------------- */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .desktop-match-score {
    top: 64px;
  }

  body:not(.mobile-game-view) .court {
    background: linear-gradient(180deg, rgba(3, 24, 38, .18), rgba(3, 24, 38, .5));
  }

  body:not(.mobile-game-view) .court::before,
  body:not(.mobile-game-view) .net-line {
    display: none;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .player-header,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .player-header {
    padding: 0;
  }

  body:not(.mobile-game-view) .player-panel .character-zone {
    align-self: stretch;
    align-content: start;
    grid-template-columns: 1fr;
    grid-auto-rows: max-content;
    justify-items: center;
    gap: 7px;
    width: calc(100% - 24px);
    margin: 18px 12px 12px;
    overflow: visible;
  }

  body:not(.mobile-game-view) .character-card {
    width: clamp(76px, 6.3vw, 98px);
    border-width: 3px;
  }

  body:not(.mobile-game-view) .character-card img {
    object-position: 50% 18%;
  }

  body:not(.mobile-game-view) .desktop-player-identity {
    display: grid;
    justify-items: center;
    gap: 3px;
    width: 100%;
    color: #fff;
    text-align: center;
  }

  body:not(.mobile-game-view) .desktop-player-identity > strong {
    max-width: 100%;
    overflow: hidden;
    font-size: clamp(.75rem, 1vw, 1rem);
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.mobile-game-view) .desktop-player-identity.active-turn > strong {
    border-radius: 999px;
    padding: 4px 9px;
    color: var(--desktop-player-ink);
    background: var(--desktop-player-color);
  }

  body:not(.mobile-game-view) .desktop-player-identity > div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: rgba(255, 255, 255, .7);
    font-size: .58rem;
    font-weight: 850;
  }

  body:not(.mobile-game-view) .desktop-player-identity > div i {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--desktop-player-color);
  }

  body:not(.mobile-game-view) .player-panel .character-stats {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas: "power" "endurance";
    justify-items: center;
    gap: 7px;
  }

  body:not(.mobile-game-view) .character-power-reminder,
  body:not(.mobile-game-view) .character-endurance-reminder {
    width: clamp(62px, 4.9vw, 74px);
    min-width: 0;
    height: clamp(62px, 4.9vw, 74px);
    min-height: 0;
    border: 0;
    padding: 7px;
    overflow: hidden;
    background: var(--desktop-player-color);
  }

  body:not(.mobile-game-view) .character-power-reminder.leading-power {
    border: 0;
  }

  body:not(.mobile-game-view) .character-power-reminder .stat-value-row,
  body:not(.mobile-game-view) .character-endurance-reminder .stat-value-row {
    display: grid;
    grid-template-columns: 22px minmax(0, auto);
    justify-content: center;
    gap: 3px;
    width: 100%;
  }

  body:not(.mobile-game-view) .character-power-reminder strong,
  body:not(.mobile-game-view) .character-endurance-reminder strong {
    min-width: 0;
    max-width: 2.25ch;
    overflow: hidden;
    color: inherit;
    font-size: clamp(1.1rem, 1.55vw, 1.48rem);
    line-height: 1;
    text-overflow: clip;
  }

  body:not(.mobile-game-view) .character-power-reminder .stat-symbol,
  body:not(.mobile-game-view) .character-endurance-reminder .stat-symbol,
  body:not(.mobile-game-view) .character-power-reminder .stat-symbol-power {
    flex-basis: 22px;
    width: 22px;
    height: 22px;
  }

  body:not(.mobile-game-view) .desktop-player-bonus-count {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    padding: 0;
    color: var(--desktop-player-ink);
    background: var(--desktop-player-color);
    box-shadow: 0 7px 18px rgba(0, 0, 0, .25);
    font-size: 1rem;
    font-weight: 1000;
    cursor: pointer;
  }

  body:not(.mobile-game-view) .desktop-player-bonus-count:hover,
  body:not(.mobile-game-view) .desktop-player-bonus-count:focus-visible {
    transform: scale(1.08);
    outline: 2px solid #fff;
    outline-offset: 2px;
  }

  body:not(.mobile-game-view) .desktop-player-status {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    width: 100%;
  }

  body:not(.mobile-game-view) .desktop-player-status .badge {
    padding: 4px 8px;
    font-size: .58rem;
  }

  body:not(.mobile-game-view) .player-panel .character-zone > .turn-buttons {
    width: 100%;
    margin-top: 0;
  }

  body:not(.mobile-game-view) .turn-buttons .pass-button--winning {
    border-color: rgba(111, 226, 174, .75);
    background: linear-gradient(135deg, #197d68, #126452);
  }

  body:not(.mobile-game-view) .turn-buttons .pass-button--losing {
    border-color: rgba(255, 142, 122, .85);
    background: linear-gradient(135deg, #a94d3c, #813528);
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand {
    isolation: auto;
    overflow: visible;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand::before {
    content: none;
    display: none;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card {
    position: relative;
    transform-origin: bottom center;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:hover,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:focus-within {
    z-index: 220;
  }

  body:not(.mobile-game-view) .desktop-played-row {
    height: 112%;
  }

  body:not(.mobile-game-view) .desktop-played-row--opponent {
    top: -48%;
  }

  body:not(.mobile-game-view) .desktop-played-row--player {
    bottom: -48%;
  }

  body:not(.mobile-game-view) .desktop-played-card > img:not(.remise-forbid-overlay):not(.boost-sacrifice-back) {
    position: relative;
    z-index: 4;
  }

  body:not(.mobile-game-view) .desktop-played-card .desktop-boost-underlay {
    top: 18%;
    z-index: 1;
  }

  body:not(.mobile-game-view) .desktop-played-card.has-remise-underlay .desktop-boost-underlay {
    top: 30%;
  }

  body:not(.mobile-game-view) .desktop-remise-underlay {
    position: absolute;
    top: 18%;
    left: 0;
    z-index: 2;
    width: 100%;
    pointer-events: none;
  }

  body:not(.mobile-game-view) .desktop-remise-underlay > img {
    display: block;
    width: 100%;
    aspect-ratio: 731 / 1039;
    border-radius: var(--game-card-radius);
    object-fit: cover;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .34);
  }

  body:not(.mobile-game-view) .desktop-remise-underlay > span {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: grid;
    place-items: center;
    min-width: 38px;
    min-height: 30px;
    border: 2px solid #f1cf55;
    border-radius: 999px;
    padding: 3px 8px;
    color: #f1cf55;
    background: #071b31;
    font-size: .86rem;
    font-weight: 1000;
    line-height: 1;
  }

  body:not(.mobile-game-view) .desktop-played-card .boost-sacrifice-label {
    color: #071b31;
    background: #f1cf55;
  }
}

.card-assist-preview .card-assist-icon {
  display: block;
  width: 20px;
  height: 20px;
  background: #264956;
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: contain;
}

.card-assist-preview .card-assist-icon--power {
  mask-image: url("assets/icons/power-flash.svg");
  -webkit-mask-image: url("assets/icons/power-flash.svg");
}

.card-assist-preview .card-assist-icon--endurance {
  mask-image: url("assets/icons/endurance-heart.svg");
  -webkit-mask-image: url("assets/icons/endurance-heart.svg");
}

.card-assist-preview strong {
  color: #264956;
}

.desktop-bonus-backdrop {
  z-index: 1215;
  padding: 24px;
  background: rgba(0, 14, 23, .9);
  backdrop-filter: blur(5px);
}

.desktop-bonus-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(760px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid rgba(140, 224, 191, .24);
  border-radius: 20px;
  color: #fff;
  background: #062d42;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .48);
}

.desktop-bonus-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  padding: 18px 20px;
}

.desktop-bonus-dialog h2,
.desktop-bonus-dialog p {
  margin: 0;
}

.desktop-bonus-dialog .label {
  color: #8ce0bf;
}

.desktop-bonus-close {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, .1);
  font-size: 1.8rem;
  cursor: pointer;
}

.desktop-bonus-list {
  display: grid;
  gap: 9px;
  overflow-y: auto;
  padding: 14px;
}

.desktop-bonus-entry {
  display: grid;
  gap: 5px;
  border-left: 5px solid #8ce0bf;
  border-radius: 0 12px 12px 0;
  padding: 13px 15px;
  color: #fff;
  background: rgba(19, 65, 85, .96);
}

.desktop-bonus-entry--malus {
  border-left-color: #f2a37f;
}

.desktop-bonus-entry > span {
  justify-self: start;
  border-radius: 999px;
  padding: 3px 8px;
  color: #8ce0bf;
  background: rgba(140, 224, 191, .1);
  font-size: .58rem;
  font-weight: 950;
  text-transform: uppercase;
}

.desktop-bonus-entry--malus > span {
  color: #f2a37f;
  background: rgba(242, 163, 127, .1);
}

.desktop-bonus-entry strong {
  font-size: .9rem;
}

.desktop-bonus-entry p,
.desktop-bonus-empty {
  color: rgba(255, 255, 255, .72);
  font-size: .74rem;
  line-height: 1.45;
}

/* Desktop interface v4.9 ------------------------------------------------- */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .game-app .global-player-dock.read-only {
    flex: 0 0 42px;
    width: 42px;
    max-width: 42px;
    border: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  body:not(.mobile-game-view) .game-app .global-player-dock.read-only .global-player-profile {
    grid-template-columns: 42px;
    width: 42px;
    padding: 0;
    filter: none;
    opacity: 1;
  }

  body:not(.mobile-game-view) .game-app .global-player-dock.read-only .global-player-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
  }

  body:not(.mobile-game-view) .game-app .global-player-dock.read-only .global-player-copy {
    display: none;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] {
    z-index: 40;
  }

  body:not(.mobile-game-view) .court > .log {
    z-index: 34;
    width: clamp(250px, 23vw, 340px);
    max-width: calc(100% - 24px);
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card {
    z-index: 90;
  }

  body:not(.mobile-game-view) .desktop-played-row--player {
    bottom: -10%;
  }

  body:not(.mobile-game-view) .character-power-reminder {
    grid-area: power;
    width: min(132px, 100%);
    height: 58px;
    border-radius: 18px;
    padding: 8px 14px;
  }

  body:not(.mobile-game-view) .character-power-reminder .stat-value-row {
    grid-template-columns: 32px minmax(0, auto);
    gap: 7px;
  }

  body:not(.mobile-game-view) .character-power-reminder .stat-symbol,
  body:not(.mobile-game-view) .character-power-reminder .stat-symbol-power {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
  }

  body:not(.mobile-game-view) .character-power-reminder strong {
    max-width: 3ch;
    font-size: clamp(1.45rem, 1.9vw, 1.8rem);
  }

  body:not(.mobile-game-view) .character-endurance-reminder,
  body:not(.mobile-game-view) .character-endurance-reminder.warning-endurance {
    grid-area: endurance;
    width: 62px;
    height: 62px;
    border-radius: 17px;
    color: #09283a;
    background: #f4cbd5;
  }

  body:not(.mobile-game-view) .character-endurance-reminder.low-endurance {
    color: #fff;
    background: #c92828;
  }

  body:not(.mobile-game-view) .character-endurance-reminder .stat-value-row {
    grid-template-columns: 20px minmax(0, auto);
    gap: 3px;
  }

  body:not(.mobile-game-view) .character-endurance-reminder .stat-symbol {
    flex-basis: 20px;
    width: 20px;
    height: 20px;
  }

  body:not(.mobile-game-view) .character-endurance-reminder strong {
    max-width: 2.5ch;
    font-size: 1.25rem;
  }

  body:not(.mobile-game-view) .desktop-player-bonus-count {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(223, 243, 118, .32);
    color: #dff376;
    background: rgba(223, 243, 118, .08);
    box-shadow: none;
    font-size: .8rem;
  }
}

.desktop-exchange-result {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.desktop-exchange-result-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.desktop-exchange-winner,
.desktop-exchange-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 5px 11px;
  color: #062b3d !important;
  font-size: .72rem;
  font-weight: 1000;
  line-height: 1;
}

.desktop-exchange-winner--player {
  background: #8ce0bf;
}

.desktop-exchange-winner--opponent {
  background: #f2a37f;
}

.desktop-exchange-winner--information {
  background: #a9b8c5;
}

.desktop-exchange-score {
  background: #fff;
}

.desktop-history-latest .action-log-result-details,
.desktop-history-entry .action-log-result-details {
  display: grid;
  gap: 5px;
}

.desktop-history-latest .action-log-result-details p,
.desktop-history-entry .action-log-result-details p {
  display: block;
  width: 100%;
  margin: 0;
  border-left: 3px solid rgba(140, 224, 191, .58);
  padding: 5px 7px;
  color: rgba(255, 255, 255, .8);
  background: rgba(255, 255, 255, .05);
}

.action-log-entry.compact .action-log-result-details p {
  display: block;
}

.desktop-card-flight {
  position: fixed;
  z-index: 1170;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: var(--game-card-radius);
  background: #09283a;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .52);
  pointer-events: none;
  transform-origin: top left;
  will-change: transform;
}

.desktop-card-flight--player {
  box-shadow: 0 24px 60px rgba(0, 0, 0, .52), 0 0 0 3px rgba(140, 224, 191, .32);
}

.desktop-card-flight--opponent {
  box-shadow: 0 24px 60px rgba(0, 0, 0, .52), 0 0 0 3px rgba(242, 163, 127, .34);
}

.desktop-card-flight img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.desktop-played-card--arriving {
  opacity: 0 !important;
  visibility: hidden !important;
}

@media (prefers-reduced-motion: reduce) {
  .desktop-card-flight {
    display: none;
  }

  .desktop-played-card--arriving {
    opacity: 1;
  }
}

/* V4.26 compact actions, opaque settings and Club House competition UI -- */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card-actions { width: 100%; min-width: 0; gap: 4px; }
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card-actions button { min-width: 0; max-width: 100%; min-height: 32px; overflow: hidden; padding: 4px 3px; line-height: 1; }
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card-actions button strong { max-width: 100%; overflow: hidden; font-size: .64rem; font-weight: 1000; letter-spacing: .02em; white-space: nowrap; }
  .card-action-cost { display: inline-flex; align-items: center; justify-content: center; gap: 3px; font-size: .62rem !important; line-height: 1; }
  .card-action-cost i { width: 11px; height: 11px; background: currentColor; mask: url("assets/icons/endurance-heart.svg") center / contain no-repeat; -webkit-mask: url("assets/icons/endurance-heart.svg") center / contain no-repeat; }
  .card-actions .remise-button { color: #fff; background: #257a91; }
  .card-actions .boost-button:not(.remise-button) { color: #17212b; background: #f2c04c; }
  .visual-stats { width: 100%; min-width: 0; }
  .visual-stats--1 { grid-template-columns: minmax(0, 1fr); }
  .visual-stats--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .visual-stats--3 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .visual-stats .visual-stat { min-width: 0; overflow: hidden; padding: 5px 3px; }
  .visual-stats .visual-stat-icon { flex: 0 0 14px !important; width: 14px !important; height: 14px !important; }
  .visual-stats .visual-stat strong { min-width: 0; font-size: .72rem; }
}

.game-assist-panel {
  position: fixed !important;
  top: 50% !important;
  right: auto !important;
  left: 50% !important;
  z-index: 1750 !important;
  width: min(420px, calc(100vw - 28px)) !important;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  border-color: rgba(140, 224, 191, .48) !important;
  padding: 22px !important;
  color: #fff;
  background: #062d42 !important;
  box-shadow: 0 34px 100px rgba(0, 0, 0, .7) !important;
  transform: translate(-50%, -50%);
}

.competition-dialog-shell { background: #f4f7f6; }
.competition-dialog-scroll .tournament-panel { color: #263746; background: #fff; font-size: .78rem; }
.competition-dialog-scroll .tournament-panel h2,
.competition-dialog-scroll .tournament-panel strong { color: #17212b; }
.competition-dialog-scroll .tournament-panel .eyebrow,
.competition-dialog-scroll .tournament-panel .difficulty-reminder { color: #50636e; }
.competition-dialog-scroll .tournament-match,
.competition-dialog-scroll .league-standings,
.competition-dialog-scroll .championship-zone { color: #263746; background: #f0f4f3; }

/* V4.11 final desktop placement overrides. */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .game-app {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  body:not(.mobile-game-view) .desktop-match-score {
    position: relative;
    top: auto;
    left: auto;
    grid-row: 2;
    align-self: center;
    justify-self: center;
    width: max-content;
    min-height: 44px;
    max-width: min(430px, 38vw);
    margin: 0;
    padding: 0;
    transform: none;
  }

  body:not(.mobile-game-view) .court {
    grid-row: 3;
  }

  body:not(.mobile-game-view) .desktop-played-row {
    transform: translateY(var(--desktop-row-offset, 0));
  }
}

.action-log-backdrop {
  z-index: 1200;
}

/* V4.12 final card magnification override. */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .desktop-played-row:has(.desktop-played-card:hover),
  body:not(.mobile-game-view) .desktop-played-row:has(.desktop-played-card:focus-visible) {
    z-index: 230;
  }

  body:not(.mobile-game-view) .desktop-played-card {
    transform-origin: bottom center;
  }

  body:not(.mobile-game-view) .desktop-played-card:hover,
  body:not(.mobile-game-view) .desktop-played-card:focus-visible {
    z-index: 220;
    transform: translateY(-28%) scale(1.38);
    box-shadow: 0 28px 70px rgba(0, 0, 0, .56), 0 0 0 2px #f6c344;
  }
}

/* V4.13 rules and board visibility -------------------------------------- */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .desktop-played-row--opponent .desktop-played-card {
    transform-origin: top center;
  }

  body:not(.mobile-game-view) .desktop-played-row--opponent .desktop-played-card:hover,
  body:not(.mobile-game-view) .desktop-played-row--opponent .desktop-played-card:focus-visible {
    transform: translateY(10%) scale(1.38);
  }

  body:not(.mobile-game-view) .desktop-played-row:has(.desktop-played-card:hover) .desktop-played-viewport,
  body:not(.mobile-game-view) .desktop-played-row:has(.desktop-played-card:focus-visible) .desktop-played-viewport {
    overflow: visible;
  }
}

/* V4.14 solo exit, fixed choices and live desktop score ----------------- */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .desktop-match-score {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    justify-self: stretch;
    width: 100%;
    max-width: none;
    min-height: 62px;
    padding: 4px 18px;
    pointer-events: none;
  }

  body:not(.mobile-game-view) .desktop-score-match-column {
    min-width: 0;
    justify-self: start;
  }

  body:not(.mobile-game-view) .desktop-match-score-list {
    grid-auto-columns: 82px;
    justify-content: start;
  }

  body:not(.mobile-game-view) .desktop-set-score {
    width: 82px;
    min-height: 40px;
  }

  body:not(.mobile-game-view) .desktop-exchange-score-line {
    display: grid;
    grid-template-columns: 54px minmax(148px, 210px) 54px;
    align-items: center;
    gap: 10px;
    grid-column: 2;
    justify-self: center;
  }

  body:not(.mobile-game-view) .desktop-score-avatar {
    position: relative;
    width: 54px;
    height: 54px;
    border: 2px solid rgba(255, 255, 255, .72);
    border-radius: 13px;
    overflow: visible;
    background: #0b4053;
    box-shadow: 0 7px 18px rgba(0, 0, 0, .28);
  }

  body:not(.mobile-game-view) .desktop-score-avatar > img {
    width: 100%;
    height: 100%;
    border-radius: 11px;
    object-fit: cover;
    object-position: center 18%;
  }

  body:not(.mobile-game-view) .desktop-score-turn-dot {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    color: #062b3d;
    font-size: 1rem;
    line-height: 1;
    opacity: 0;
    transform: translateY(-50%);
  }

  body:not(.mobile-game-view) .desktop-score-turn-dot--player {
    left: 9px;
  }

  body:not(.mobile-game-view) .desktop-score-turn-dot--opponent {
    right: 9px;
  }

  body:not(.mobile-game-view) .desktop-score-turn-dot.is-active {
    opacity: 1;
  }

  body:not(.mobile-game-view) .desktop-score-server.mobile-server {
    right: -5px;
    bottom: -5px;
    width: 19px;
    height: 19px;
    border: 2px solid #08283a;
    color: #d9f269;
    background: #14715d;
    font-size: .56rem;
  }

  body:not(.mobile-game-view) .desktop-live-power-score {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 34px 1fr;
    align-items: center;
    min-height: 48px;
    border-radius: 16px;
    padding: 7px 16px;
    color: #062b3d;
    background: #a9b8c5;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .25);
    text-align: center;
    transition: background 160ms ease;
  }

  body:not(.mobile-game-view) .desktop-live-power-score--player {
    background: #8ce0bf;
  }

  body:not(.mobile-game-view) .desktop-live-power-score--opponent {
    background: #f2a37f;
  }

  body:not(.mobile-game-view) .desktop-live-power-score--boost {
    background: #f1cf55;
  }

  body:not(.mobile-game-view) .desktop-live-power-score strong {
    font-size: 1.34rem;
    font-weight: 1000;
    line-height: 1;
  }

  body:not(.mobile-game-view) .desktop-live-power-score i {
    display: block;
    justify-self: center;
    width: 26px;
    height: 32px;
    background: currentColor;
    mask: url("assets/icons/power-flash.svg") center / contain no-repeat;
    -webkit-mask: url("assets/icons/power-flash.svg") center / contain no-repeat;
  }

  body:not(.mobile-game-view) .desktop-score-balance {
    grid-column: 3;
  }

  .boost-choice-backdrop .modal,
  .effect-choice-backdrop .modal,
  .coach-choice-backdrop .modal,
  .remove-choice-backdrop .modal {
    width: min(900px, calc(100vw - 40px));
  }

  .boost-choice-backdrop .choice-grid,
  .effect-choice-backdrop .choice-grid,
  .coach-choice-backdrop .choice-grid,
  .remove-choice-backdrop .choice-grid {
    --choice-card-width: clamp(96px, 8.4vw, 148px);
    grid-template-columns: repeat(auto-fit, var(--choice-card-width));
    justify-content: center;
    align-items: start;
  }

  .boost-choice-backdrop .choice-card,
  .effect-choice-backdrop .choice-card,
  .coach-choice-backdrop .choice-card,
  .remove-choice-backdrop .choice-card {
    width: var(--choice-card-width);
    max-width: var(--choice-card-width);
    padding: 6px;
  }
}

/* V4.15 stable rows and projected pass leader --------------------------- */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .desktop-played-board {
    --desktop-played-card-width: clamp(96px, 8.4vw, 148px);
    --desktop-played-card-height: calc(var(--desktop-played-card-width) * 1.42135);
    --desktop-played-stack-height: calc(var(--desktop-played-card-height) * 1.3);
  }

  body:not(.mobile-game-view) .desktop-played-row {
    height: var(--desktop-played-stack-height);
    transform: none;
  }

  body:not(.mobile-game-view) .desktop-played-row--opponent {
    top: calc(50% - var(--desktop-played-stack-height) - 5px);
    bottom: auto;
  }

  body:not(.mobile-game-view) .desktop-played-row--player {
    top: calc(50% + 5px);
    bottom: auto;
  }

  body:not(.mobile-game-view) .desktop-played-track {
    align-items: flex-start;
  }
}

/* V4.16 smaller central cards and winner-colored exchange result -------- */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .desktop-played-board,
  body:not(.mobile-game-view) .desktop-played-track {
    --desktop-played-card-width: clamp(92px, 7.9vw, 140px);
  }
}

/* V4.17 clean hand, uncropped history and compact played rows ----------- */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card.has-visual {
    gap: 0;
    border-color: rgba(255, 255, 255, .22);
    padding: 4px;
    background: #061f2d;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:hover,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:focus-within {
    transform: translateY(-66%) scale(1.34);
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card-readable-data {
    display: none;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card-hover-panel {
    position: absolute;
    top: calc(100% - 3px);
    right: -2px;
    left: -2px;
    z-index: 95;
    display: grid;
    gap: 6px;
    border: 1px solid rgba(246, 195, 68, .42);
    border-top: 0;
    border-radius: 0 0 12px 12px;
    padding: 7px;
    visibility: hidden;
    color: #fff;
    background: rgba(3, 24, 38, .98);
    box-shadow: 0 18px 36px rgba(0, 0, 0, .52);
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
    pointer-events: none;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:hover .card-hover-panel,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:focus-within .card-hover-panel {
    visibility: visible;
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .visual-stats,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card-assist-preview {
    max-height: none;
    margin: 0;
    overflow: visible;
    opacity: 1;
    transform: none;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .visual-stats {
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .09);
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .visual-stat,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card-assist-preview span {
    background: #f4f8f7;
    box-shadow: inset 0 0 0 1px rgba(6, 43, 61, .1);
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card-actions button:not(:disabled),
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .risky-play-button {
    border: 2px solid #f6c344;
    box-shadow: 0 0 0 1px rgba(6, 31, 45, .72);
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .boost-warning {
    border: 1px solid rgba(246, 195, 68, .65);
    color: #fff;
    background: #7c2f2f;
    line-height: 1.25;
  }

  body:not(.mobile-game-view) .desktop-played-slot {
    align-self: flex-start;
    height: var(--desktop-played-card-height);
    place-items: start center;
  }

  body:not(.mobile-game-view) .desktop-history-latest > button[data-open-latest-history-card] img,
  body:not(.mobile-game-view) .desktop-history-latest > img,
  body:not(.mobile-game-view) .action-log-card-thumbnail {
    object-fit: contain;
    background: #061f2d;
  }

  body:not(.mobile-game-view) .action-log-dialog .action-log-entry.result:has(.desktop-exchange-result) {
    grid-template-columns: minmax(0, 1fr) 34px;
  }

  body:not(.mobile-game-view) .action-log-dialog .action-log-entry.result:has(.desktop-exchange-result) > .action-log-marker,
  body:not(.mobile-game-view) .action-log-entry.result:has(.desktop-exchange-result) .action-log-type {
    display: none;
  }

  body:not(.mobile-game-view) .desktop-exchange-result-header {
    justify-content: flex-start;
  }
}

/* V4.18 calmer hand controls, centered modifiers and safe hover -------- */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card.has-visual {
    border-color: rgba(141, 205, 213, .34);
    background: #0b4053;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:hover,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:focus-within {
    transform: translateY(-118%) scale(1.26);
    box-shadow: 0 28px 70px rgba(0, 0, 0, .56);
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card-hover-panel {
    border-color: rgba(141, 205, 213, .38);
    background: rgba(11, 64, 83, .99);
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .visual-stats {
    gap: 7px;
    border-color: rgba(255, 255, 255, .16);
    padding: 6px;
    background: rgba(3, 31, 45, .42);
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .visual-stat {
    justify-content: center;
    gap: 6px;
    min-width: 0;
    padding: 6px 10px;
    color: #fff;
    box-shadow: none;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .visual-stat--positive {
    background: #16845f;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .visual-stat--negative {
    background: #b93535;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .visual-stat--neutral {
    background: #476d7b;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .visual-stat strong,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .visual-stat--positive strong,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .visual-stat--negative strong {
    color: #fff;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .visual-stat-icon {
    flex-basis: 18px;
    width: 18px;
    height: 18px;
    background: #fff;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card-actions button,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card-actions button:not(:disabled),
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .risky-play-button {
    border: 1px solid rgba(255, 255, 255, .2);
    box-shadow: none;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .risky-play-button:not(:disabled) {
    border-color: #ffb2aa;
    color: #fff;
    background: #b93535;
    box-shadow: 0 0 0 2px rgba(185, 53, 53, .28);
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .hand {
    position: relative;
    z-index: 245;
  }

  body:not(.mobile-game-view) .desktop-played-row--opponent {
    z-index: 8;
  }

  body:not(.mobile-game-view) .player-panel .character-zone > .turn-buttons {
    width: calc(100% - 12px);
    margin-right: auto;
    margin-left: auto;
  }

  body:not(.mobile-game-view) .turn-buttons button,
  body:not(.mobile-game-view) .turn-buttons .pass-button {
    min-height: 32px;
    border-width: 1px;
    padding: 6px 8px;
    font-size: .6rem;
    font-weight: 1000;
    letter-spacing: .045em;
    line-height: 1.05;
    text-transform: uppercase;
  }
}

.quit-court-button {
  width: 100%;
  margin-top: 8px;
}

/* V4.19 optional persistent local-hand actions -------------------------- */
@media (min-width: 861px) {
  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand {
    padding-bottom: 42px;
  }

  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card {
    transform-origin: bottom center;
  }

  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card-hover-panel {
    top: 100%;
    visibility: visible;
    border: 0;
    padding: 4px 0 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    transform: none;
    pointer-events: none;
  }

  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card-hover-panel > :not(.card-actions) {
    display: none;
  }

  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card-actions {
    display: flex;
    pointer-events: auto;
  }

  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card:hover .card-hover-panel,
  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card:focus-within .card-hover-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    visibility: visible;
    border: 1px solid rgba(141, 205, 213, .38);
    border-top: 0;
    padding: 7px;
    background: rgba(11, 64, 83, .99);
    box-shadow: 0 18px 36px rgba(0, 0, 0, .52);
    opacity: 1;
    pointer-events: auto;
  }

  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card:hover .card-hover-panel > :not(.card-actions),
  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card:focus-within .card-hover-panel > :not(.card-actions) {
    display: flex;
  }

  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card:hover,
  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card:focus-within {
    transform: translateY(-118%) scale(1.26);
  }
}

/* V4.20 measured hover lift: actions stay on the baseline --------------- */
@media (min-width: 861px) {
  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card:hover,
  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card:focus-within {
    transform: translateY(calc(-1 * var(--local-card-hover-lift, 0px))) scale(1.26);
  }

  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card-hover-panel {
    transition: opacity 140ms ease, visibility 140ms ease;
  }

  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card-actions {
    order: 20;
  }
}

/* V4.22 hand hover: the actions replace the lifted bottom gap ----------- */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:hover,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:focus-within,
  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card:hover,
  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card:focus-within {
    transform: translateY(calc(-1 * var(--local-card-action-lift, 42px))) scale(1.26);
  }
}

/* V4.26 final card controls and stat containment ------------------------ */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card-actions {
    gap: 3px;
    width: 100%;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card-actions button {
    min-width: 0;
    max-width: 100%;
    padding: 4px 3px;
    overflow: hidden;
    font-size: .48rem;
    line-height: 1;
    white-space: nowrap;
  }

  body:not(.mobile-game-view) .visual-stats {
    gap: 3px !important;
    padding: 4px !important;
  }

  body:not(.mobile-game-view) .visual-stat {
    min-width: 0;
    gap: 2px !important;
    padding: 4px 2px !important;
    overflow: hidden;
  }

  body:not(.mobile-game-view) .visual-stat strong {
    min-width: 0;
    font-size: .72rem;
  }
}

/* V4.27 final overrides ------------------------------------------------- */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .game-app {
    position: relative;
    grid-template-rows: 48px minmax(0, 1fr) !important;
  }

  body:not(.mobile-game-view) .game-app > .topbar {
    position: relative;
    z-index: 310;
    grid-row: 1;
    justify-content: flex-end;
  }

  body:not(.mobile-game-view) .game-app .topbar > div:first-child {
    gap: 6px;
    margin-left: auto;
  }

  body:not(.mobile-game-view) .game-app .brand-logo { height: 30px; }

  body:not(.mobile-game-view) .desktop-game-menu-toggle {
    display: grid;
    place-items: center;
    width: 34px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 9px;
    padding: 0;
    color: #fff;
    background: rgba(13, 66, 86, .94);
    font-size: 1.2rem;
    font-weight: 1000;
  }

  body:not(.mobile-game-view) .game-app .top-actions {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    z-index: 1;
    display: none;
    flex-wrap: wrap;
    justify-content: flex-end;
    width: min(760px, calc(100vw - 24px));
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 12px;
    padding: 9px;
    background: #061f30;
    box-shadow: 0 22px 55px rgba(0, 0, 0, .58);
  }

  body:not(.mobile-game-view) .game-app.desktop-game-menu-open .top-actions { display: flex; }

  body:not(.mobile-game-view) .desktop-match-score {
    position: absolute;
    top: 8px;
    right: 220px;
    left: 22px;
    z-index: 312;
    grid-row: auto;
    width: auto;
    max-width: none;
    min-height: 40px;
    padding: 0;
    transform: none;
  }

  body:not(.mobile-game-view) .desktop-match-score-list { grid-auto-columns: 72px; }
  body:not(.mobile-game-view) .desktop-set-score { width: 72px; min-height: 36px; }
  body:not(.mobile-game-view) .desktop-exchange-score-line { grid-template-columns: 42px minmax(136px, 190px) 42px; gap: 7px; }
  body:not(.mobile-game-view) .desktop-score-avatar { width: 42px; height: 42px; }
  body:not(.mobile-game-view) .court { grid-row: 2 !important; }

  body:not(.mobile-game-view) .desktop-hand-card--locked .card-visual > img,
  body:not(.mobile-game-view) .desktop-hand-card--locked .card-readable-data {
    filter: grayscale(1) brightness(.62);
    opacity: .64;
  }

  body:not(.mobile-game-view) .desktop-card-lock {
    position: absolute;
    inset: 0;
    z-index: 18;
    display: grid;
    place-items: center;
    border-radius: inherit;
    color: #fff;
    background: rgba(3, 19, 29, .16);
    filter: drop-shadow(0 3px 7px rgba(0, 0, 0, .9));
    font-size: clamp(1.2rem, 2vw, 2rem);
    pointer-events: none;
  }

  body:not(.mobile-game-view) .desktop-hand-card--locked .card-hover-panel { pointer-events: none; }
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card-actions button strong {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    font-size: clamp(.42rem, .48vw, .52rem) !important;
    letter-spacing: 0 !important;
    white-space: nowrap;
  }
}

/* V4.28 final geometry -------------------------------------------------- */
/* V4.30 strict stacking: the local hand always covers history ---------- */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .court > .log {
    position: relative !important;
    z-index: 1 !important;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] {
    position: relative !important;
    z-index: 300 !important;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand {
    position: relative !important;
    z-index: 310 !important;
    isolation: isolate;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card {
    position: relative !important;
    z-index: 320 !important;
  }

  body:not(.mobile-game-view) .court-logo-watermark {
    width: clamp(360px, 42vw, 760px) !important;
    max-height: 46% !important;
  }
}

/* V4.29 final history, controls and safe-area overrides ---------------- */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .game-app { padding-top: max(8px, env(safe-area-inset-top)) !important; }
  body:not(.mobile-game-view) .desktop-match-score { top: max(8px, env(safe-area-inset-top)); }
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] { z-index: 80; }
  body:not(.mobile-game-view) .court > .log { z-index: 30; }

  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card-hover-panel,
  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card:hover .card-hover-panel,
  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card:focus-within .card-hover-panel {
    pointer-events: none !important;
  }

  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card-actions {
    position: relative;
    z-index: 210;
    display: flex;
    width: 100%;
    gap: 3px;
    pointer-events: auto !important;
  }

  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card-actions button {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    min-height: 32px;
    padding: 4px 3px;
    pointer-events: auto !important;
  }
}

@media (min-width: 861px) {
  body:not(.mobile-game-view) .desktop-match-score { right: 22px; left: 22px; }
  body:not(.mobile-game-view) .desktop-score-match-column { justify-self: start; }
  body:not(.mobile-game-view) .desktop-exchange-score-line { grid-column: 2; justify-self: center; }
  body:not(.mobile-game-view) .desktop-score-avatar-placeholder { width: 42px; height: 42px; }

  body:not(.mobile-game-view) .game-app .top-actions {
    top: calc(100% + 7px);
    right: 0;
    z-index: 420;
    align-items: center;
    width: min(980px, calc(100vw - 24px));
  }

  body:not(.mobile-game-view) .game-app .top-actions > .global-player-dock {
    position: static;
    display: block;
    margin: 0 auto 0 0;
  }

  body:not(.mobile-game-view) .game-app .top-actions > .global-player-dock .global-player-profile {
    min-height: 34px;
    border: 0;
    padding: 0;
    background: transparent;
    opacity: 1;
  }

  body:not(.mobile-game-view) .game-app .top-actions > .global-player-dock .global-player-avatar { width: 34px; height: 34px; border-radius: 8px; }
  body:not(.mobile-game-view) .game-app .top-actions > .global-player-dock .global-player-copy small { display: none; }

  body:not(.mobile-game-view) .court { position: relative; isolation: isolate; }
  body:not(.mobile-game-view) .court-logo-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 0;
    width: clamp(240px, 27vw, 520px);
    max-height: 32%;
    object-fit: contain;
    opacity: .5;
    transform: translate(-50%, -50%);
    pointer-events: none;
  }
  body:not(.mobile-game-view) .court > :not(.court-logo-watermark) { position: relative; z-index: 2; }

  body:not(.mobile-game-view) .game-assist-tools { position: relative; }
  body:not(.mobile-game-view) .game-assist-panel {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    z-index: 440 !important;
    max-height: calc(100dvh - 110px);
    transform: none !important;
  }
}


/* V4.31 compact player medallions and vertically resilient desktop board. */
@media (min-width: 861px) {
  body:not(.mobile-game-view):has(.game-app:not(.hidden)),
  body:not(.mobile-game-view) .game-app {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  body:not(.mobile-game-view) .game-app {
    grid-template-rows: 48px minmax(0, 1fr);
  }

  body:not(.mobile-game-view) .desktop-match-score {
    top: max(8px, env(safe-area-inset-top));
    z-index: 420;
  }

  body:not(.mobile-game-view) .court,
  body:not(.mobile-game-view) .player-panel {
    min-height: 0;
    grid-template-rows: clamp(76px, 12dvh, 110px) minmax(0, 1fr) clamp(178px, 29dvh, 276px);
  }

  body:not(.mobile-game-view) .player-panel .player-header {
    display: none !important;
  }

  body:not(.mobile-game-view) .player-panel .character-zone {
    position: relative;
    z-index: 24;
    align-self: center;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    justify-items: stretch;
    width: min(210px, calc(100% - 18px));
    min-width: 0;
    gap: 4px 7px;
    margin: 0 9px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 18px;
    padding: 7px;
    background: linear-gradient(145deg, rgba(10, 23, 42, .94), rgba(20, 44, 73, .9));
    box-shadow: 0 10px 28px rgba(0, 0, 0, .3);
    backdrop-filter: blur(10px);
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .character-zone {
    grid-column: 1;
    grid-row: 2;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .character-zone {
    grid-column: 3;
    grid-row: 2;
  }

  body:not(.mobile-game-view) .character-card {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: center;
    width: 54px;
    height: 54px;
    border-width: 3px;
  }

  body:not(.mobile-game-view) .desktop-player-identity {
    grid-column: 2 / 4;
    min-width: 0;
  }

  body:not(.mobile-game-view) .desktop-player-identity > strong {
    display: block;
    overflow: hidden;
    font-size: .72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.mobile-game-view) .desktop-player-identity > div {
    font-size: .55rem;
  }

  body:not(.mobile-game-view) .player-panel .character-stats {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    display: flex;
    gap: 4px;
  }

  body:not(.mobile-game-view) .character-power-reminder,
  body:not(.mobile-game-view) .character-endurance-reminder {
    min-width: 34px;
    min-height: 25px;
    border-width: 1px;
    border-radius: 999px;
    padding: 2px 6px;
  }

  body:not(.mobile-game-view) .character-power-reminder strong,
  body:not(.mobile-game-view) .character-endurance-reminder strong {
    font-size: .82rem;
  }

  body:not(.mobile-game-view) .desktop-player-bonus-count {
    grid-column: 3;
    grid-row: 2;
    align-self: center;
  }

  body:not(.mobile-game-view) .desktop-player-status,
  body:not(.mobile-game-view) .player-panel .character-zone > .turn-buttons {
    position: absolute;
    bottom: calc(100% + 5px);
    width: auto;
    margin: 0;
  }

  body:not(.mobile-game-view) .desktop-player-status {
    left: 6px;
  }

  body:not(.mobile-game-view) .player-panel .character-zone > .turn-buttons {
    right: 6px;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .hand {
    grid-row: 1;
    align-self: center;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand {
    grid-row: 3;
    align-self: end;
    padding-bottom: clamp(8px, 1.5dvh, 16px);
  }

  body:not(.mobile-game-view) .center-lane {
    grid-row: 2;
    min-height: 0;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:nth-child(6n + 1) { transform: rotate(-4deg); }
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:nth-child(6n + 2) { transform: rotate(-2.4deg); }
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:nth-child(6n + 3) { transform: rotate(-.8deg); }
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:nth-child(6n + 4) { transform: rotate(.8deg); }
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:nth-child(6n + 5) { transform: rotate(2.4deg); }
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:nth-child(6n) { transform: rotate(4deg); }
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:nth-child(n + 7),
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .ultimate-reserve-hand-card { transform: rotate(4deg); }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:hover,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:focus-within {
    transform: translateY(calc(-1 * var(--local-card-action-lift, 42px))) scale(1.26) rotate(0deg) !important;
  }
}

@media (min-width: 861px) and (max-height: 760px) {
  body:not(.mobile-game-view) .court,
  body:not(.mobile-game-view) .player-panel {
    grid-template-rows: 68px minmax(0, 1fr) 158px;
  }

  body:not(.mobile-game-view) .player-panel .character-zone {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    padding: 5px 6px;
  }

  body:not(.mobile-game-view) .character-card {
    width: 46px;
    height: 46px;
  }
}

@media (min-width: 861px) and (max-height: 620px) {
  body:not(.mobile-game-view) .court,
  body:not(.mobile-game-view) .player-panel {
    grid-template-rows: 58px minmax(0, 1fr) 132px;
  }

  body:not(.mobile-game-view) .player-panel .character-zone {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    margin-right: 5px;
    margin-left: 5px;
    padding: 4px;
  }

  body:not(.mobile-game-view) .character-card {
    width: 40px;
    height: 40px;
  }
}

/* V4.32 reference medallions: circular portrait, name pill and three counters. */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .player-panel .character-zone {
    align-self: center;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: 92px 24px 34px auto auto;
    justify-items: center;
    width: min(164px, calc(100% - 12px));
    gap: 5px 4px;
    margin: 6px;
    border: 0;
    border-radius: 0;
    padding: 0;
    overflow: visible;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .character-zone {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: start;
    margin-top: 10px;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .character-zone {
    grid-column: 3;
    grid-row: 2 / 4;
    align-self: end;
    margin-bottom: 14px;
  }

  body:not(.mobile-game-view) .character-card {
    position: relative;
    grid-column: 1 / 4;
    grid-row: 1;
    align-self: center;
    width: 84px;
    height: 84px;
    overflow: visible;
    border: 3px solid var(--desktop-player-color);
    border-radius: 50%;
    background: #09283a;
    box-shadow:
      0 0 0 4px #0b3044,
      0 0 0 6px color-mix(in srgb, var(--desktop-player-color) 78%, white),
      0 0 22px color-mix(in srgb, var(--desktop-player-color) 38%, transparent),
      0 10px 24px rgba(0, 0, 0, .42);
  }

  body:not(.mobile-game-view) .character-card img {
    width: 100%;
    height: 100%;
    border: 3px solid #0a2638;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 14%;
  }

  body:not(.mobile-game-view) .desktop-player-identity {
    position: relative;
    z-index: 2;
    grid-column: 1 / 4;
    grid-row: 2;
    align-self: center;
    display: block;
    width: min(122px, 100%);
    color: #092438;
    text-align: center;
  }

  body:not(.mobile-game-view) .desktop-player-identity > strong,
  body:not(.mobile-game-view) .desktop-player-identity.active-turn > strong {
    display: block;
    width: 100%;
    max-width: none;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--desktop-player-color) 72%, white);
    border-radius: 999px;
    padding: 4px 10px;
    color: #092438;
    background: var(--desktop-player-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
    font-size: .72rem;
    font-weight: 1000;
    line-height: 1;
    letter-spacing: .015em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body:not(.mobile-game-view) .desktop-player-identity > div {
    display: none;
  }

  body:not(.mobile-game-view) .player-panel .character-stats {
    display: contents;
  }

  body:not(.mobile-game-view) .character-power-reminder,
  body:not(.mobile-game-view) .character-endurance-reminder,
  body:not(.mobile-game-view) .desktop-player-bonus-count {
    position: relative;
    align-self: center;
    width: 48px;
    min-width: 0;
    height: 31px;
    min-height: 0;
    border: 1px solid color-mix(in srgb, var(--desktop-player-color) 62%, #ffffff);
    border-radius: 999px;
    padding: 3px 6px;
    color: #f8fbff;
    background: rgba(5, 28, 43, .94);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), 0 5px 13px rgba(0, 0, 0, .3);
  }

  body:not(.mobile-game-view) .character-power-reminder {
    grid-column: 1;
    grid-row: 3;
  }

  body:not(.mobile-game-view) .character-endurance-reminder {
    grid-column: 2;
    grid-row: 3;
  }

  body:not(.mobile-game-view) .desktop-player-bonus-count {
    grid-column: 3;
    grid-row: 3;
    place-items: center;
    color: #e9f168;
    font-size: .83rem;
  }

  body:not(.mobile-game-view) .character-power-reminder .stat-value-row,
  body:not(.mobile-game-view) .character-endurance-reminder .stat-value-row {
    display: grid;
    grid-template-columns: 16px auto;
    justify-content: center;
    gap: 3px;
  }

  body:not(.mobile-game-view) .character-power-reminder .stat-symbol,
  body:not(.mobile-game-view) .character-endurance-reminder .stat-symbol,
  body:not(.mobile-game-view) .character-power-reminder .stat-symbol-power {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
    background-color: var(--desktop-player-color);
  }

  body:not(.mobile-game-view) .character-power-reminder strong,
  body:not(.mobile-game-view) .character-endurance-reminder strong {
    color: #f8fbff;
    font-size: .86rem;
    line-height: 1;
  }

  body:not(.mobile-game-view) .desktop-player-status {
    position: static;
    grid-column: 1 / 4;
    grid-row: 4;
    justify-content: center;
    width: 100%;
    margin: 0;
  }

  body:not(.mobile-game-view) .desktop-player-status .badge {
    min-height: 20px;
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 999px;
    padding: 3px 10px;
    color: #092438;
    background: #f7fafc;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .24);
    font-size: .55rem;
  }

  body:not(.mobile-game-view) .desktop-player-status .badge.server {
    border-color: #f4cd42;
    background: #f4cd42;
  }

  body:not(.mobile-game-view) .player-panel .character-zone > .turn-buttons {
    position: static;
    grid-column: 1 / 4;
    grid-row: 5;
    width: 100%;
    margin: 0;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] {
    --desktop-player-color: #f2a37f;
    --desktop-player-ink: #3f1d15;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] {
    --desktop-player-color: #8ce0bf;
    --desktop-player-ink: #062e2b;
  }
}

@media (min-width: 861px) and (max-height: 700px) {
  body:not(.mobile-game-view) .player-panel .character-zone {
    grid-template-rows: 72px 21px 29px auto auto;
    width: min(146px, calc(100% - 10px));
    gap: 3px;
  }

  body:not(.mobile-game-view) .character-card {
    width: 66px;
    height: 66px;
  }

  body:not(.mobile-game-view) .desktop-player-identity {
    width: 108px;
  }

  body:not(.mobile-game-view) .character-power-reminder,
  body:not(.mobile-game-view) .character-endurance-reminder,
  body:not(.mobile-game-view) .desktop-player-bonus-count {
    width: 43px;
    height: 27px;
  }
}

/* V6.14 · Academy desktop only: visible centre cards, effect summaries and safer action spacing. */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .character-zone:not(.ultimate-character-zone) .academy-desktop-effects {
    position: absolute;
    right: 5px;
    left: 5px;
    z-index: 38;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
    max-height: 58px;
    overflow: auto;
    font-size: .52rem;
    line-height: 1.15;
    pointer-events: auto;
  }

  body:not(.mobile-game-view) .character-zone:not(.ultimate-character-zone) .academy-desktop-effects span {
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    padding: 3px 6px;
    color: #eefaff;
    background: rgba(7, 32, 47, .92);
  }

  body:not(.mobile-game-view) .character-zone:not(.ultimate-character-zone) .academy-desktop-effects span.constraint {
    border-color: rgba(255, 150, 120, .6);
    color: #ffd3c7;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .character-zone:not(.ultimate-character-zone) .academy-desktop-effects--opponent {
    top: calc(100% + 6px);
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .character-zone:not(.ultimate-character-zone):has(.academy-desktop-effects) > .desktop-profile-actions--opponent {
    top: calc(100% + 70px);
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .character-zone:not(.ultimate-character-zone) .academy-desktop-effects--local {
    bottom: calc(100% + 6px);
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .character-zone:not(.ultimate-character-zone):has(.academy-desktop-effects) .desktop-profile-actions--local {
    bottom: calc(100% + 70px);
  }

  body:not(.mobile-game-view) .character-zone:not(.ultimate-character-zone) .desktop-profile-actions {
    width: min(168px, calc(100vw - 28px));
    margin-inline: 6px;
  }

  body:not(.mobile-game-view) .desktop-played-board {
    z-index: 12;
    min-height: min(48vh, 430px);
    overflow: visible;
  }

  body:not(.mobile-game-view) .desktop-played-row,
  body:not(.mobile-game-view) .desktop-played-viewport,
  body:not(.mobile-game-view) .desktop-played-track,
  body:not(.mobile-game-view) .desktop-played-card {
    visibility: visible;
    opacity: 1;
  }
}

/* V4.36 equal-height history drawer and locked player medallion geometry. */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .court > .log {
    height: clamp(230px, 40vh, 390px);
    max-height: calc(100% - 92px);
  }

  body:not(.mobile-game-view) .desktop-history-drawer-toggle,
  body:not(.mobile-game-view) .desktop-history-drawer-content {
    height: 100%;
    min-height: 0;
  }

  body:not(.mobile-game-view) .desktop-history-drawer-content {
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  body:not(.mobile-game-view) .desktop-history-drawer-content .desktop-history-latest {
    align-content: start;
    min-height: 0;
    height: 100%;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] {
    --desktop-player-color: #f2a37f;
    --desktop-player-ink: #3f1d15;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] {
    --desktop-player-color: #8ce0bf;
    --desktop-player-ink: #062e2b;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .character-zone {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: start;
    margin: 10px 6px 6px;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .character-zone {
    grid-column: 1;
    grid-row: 2 / 4;
    align-self: end;
    margin: 6px 6px 14px;
  }

  body:not(.mobile-game-view) .player-panel .character-zone {
    grid-template-columns: repeat(3, minmax(42px, 1fr));
    grid-template-rows: 92px 24px 34px auto auto;
    width: min(164px, calc(100% - 12px));
    min-width: 144px;
    overflow: visible;
  }

  body:not(.mobile-game-view) .player-panel .character-stats {
    position: static;
    grid-column: 1 / 3;
    grid-row: 3;
    display: grid;
    grid-template-columns: repeat(2, minmax(42px, 1fr));
    align-self: stretch;
    width: 100%;
    min-width: 0;
    gap: 4px;
    visibility: visible !important;
    opacity: 1 !important;
  }

  body:not(.mobile-game-view) .player-panel .character-stats .character-power-reminder,
  body:not(.mobile-game-view) .player-panel .character-stats .character-endurance-reminder {
    position: relative;
    grid-column: auto;
    grid-row: auto;
    display: grid !important;
    align-self: stretch;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    height: 31px;
    min-height: 31px;
    visibility: visible !important;
    opacity: 1 !important;
  }

  body:not(.mobile-game-view) .desktop-player-bonus-count {
    position: relative;
    grid-column: 3;
    grid-row: 3;
    align-self: stretch;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    height: 31px;
    min-height: 31px;
  }

  body:not(.mobile-game-view) .character-power-reminder,
  body:not(.mobile-game-view) .character-power-reminder.leading-power {
    border: 1px solid color-mix(in srgb, var(--desktop-player-color) 70%, white);
    color: var(--desktop-player-ink);
    background: var(--desktop-player-color);
  }

  body:not(.mobile-game-view) .character-power-reminder strong {
    color: var(--desktop-player-ink);
  }

  body:not(.mobile-game-view) .character-power-reminder .stat-symbol,
  body:not(.mobile-game-view) .character-power-reminder .stat-symbol-power {
    background-color: var(--desktop-player-ink);
  }

  body:not(.mobile-game-view) .character-endurance-reminder,
  body:not(.mobile-game-view) .character-endurance-reminder.warning-endurance {
    border: 1px solid var(--desktop-player-color);
    color: var(--desktop-player-color);
    background: rgba(5, 28, 43, .96);
  }

  body:not(.mobile-game-view) .character-endurance-reminder strong {
    color: var(--desktop-player-color);
  }

  body:not(.mobile-game-view) .character-endurance-reminder .stat-symbol,
  body:not(.mobile-game-view) .character-endurance-reminder .stat-symbol-endurance {
    background-color: var(--desktop-player-color);
  }

  body:not(.mobile-game-view) .character-endurance-reminder.low-endurance {
    border-color: #ff7b73;
    color: #fff;
    background: #b83232;
  }

  body:not(.mobile-game-view) .character-endurance-reminder.low-endurance strong {
    color: #fff;
  }

  body:not(.mobile-game-view) .character-endurance-reminder.low-endurance .stat-symbol,
  body:not(.mobile-game-view) .character-endurance-reminder.low-endurance .stat-symbol-endurance {
    background-color: #fff;
  }
}

@media (min-width: 861px) and (max-height: 700px) {
  body:not(.mobile-game-view) .court > .log {
    height: clamp(190px, 38vh, 300px);
    max-height: calc(100% - 62px);
  }

  body:not(.mobile-game-view) .player-panel .character-zone {
    grid-template-columns: repeat(3, minmax(39px, 1fr));
    grid-template-rows: 72px 21px 29px auto auto;
    width: min(146px, calc(100% - 10px));
    min-width: 132px;
  }

  body:not(.mobile-game-view) .player-panel .character-stats {
    grid-template-columns: repeat(2, minmax(39px, 1fr));
  }

  body:not(.mobile-game-view) .player-panel .character-stats .character-power-reminder,
  body:not(.mobile-game-view) .player-panel .character-stats .character-endurance-reminder,
  body:not(.mobile-game-view) .desktop-player-bonus-count {
    height: 27px;
    min-height: 27px;
  }
}

/* V4.39 compact history tab and explicit seventh-card angle inheritance. */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .court > .log {
    height: auto;
    align-items: center;
  }

  body:not(.mobile-game-view) .desktop-history-drawer-toggle {
    align-self: center;
    height: auto !important;
    min-height: 0;
    grid-template-rows: auto auto;
  }

  body:not(.mobile-game-view) .desktop-history-drawer-content {
    align-self: center;
    height: auto;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card.drawn-card-inherited-angle,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card.drawn-card-inherited-angle:focus,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card.drawn-card-inherited-angle:active {
    --local-card-angle: var(--drawn-card-angle);
    transform: rotate(var(--drawn-card-angle)) !important;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card.drawn-card-inherited-angle:hover,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card.drawn-card-inherited-angle:focus-within {
    --local-card-angle: var(--drawn-card-angle);
    transform: translateY(calc(-1 * var(--local-card-action-lift, 42px))) scale(1.26) rotate(var(--drawn-card-angle)) !important;
  }
}

/* V4.37 content-height history drawer and readable double-digit power. */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .court > .log {
    height: auto;
    max-height: calc(100% - 92px);
  }

  body:not(.mobile-game-view) .desktop-history-drawer-toggle,
  body:not(.mobile-game-view) .desktop-history-drawer-content {
    height: auto;
  }

  body:not(.mobile-game-view) .desktop-history-drawer-content {
    grid-template-rows: auto auto auto;
  }

  body:not(.mobile-game-view) .desktop-history-drawer-content .desktop-history-latest {
    height: auto;
  }

  body:not(.mobile-game-view) .character-power-reminder.double-digit-power {
    padding-inline: 3px;
  }

  body:not(.mobile-game-view) .character-power-reminder.double-digit-power .stat-value-power {
    grid-template-columns: 14px minmax(0, auto);
    justify-content: center;
    width: 100%;
    gap: 1px;
  }

  body:not(.mobile-game-view) .character-power-reminder.double-digit-power .stat-symbol-power {
    width: 14px;
    height: 14px;
    flex-basis: 14px;
  }

  body:not(.mobile-game-view) .character-power-reminder.double-digit-power strong {
    min-width: 0;
    overflow: visible;
    font-size: .84rem;
    font-weight: 1000;
    letter-spacing: -.04em;
    white-space: nowrap;
  }
}

@media (min-width: 861px) and (max-height: 700px) {
  body:not(.mobile-game-view) .court > .log {
    height: auto;
    max-height: calc(100% - 62px);
  }
}

/* V4.38 measured history toggle and inherited angle for drawn cards. */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .court > .log {
    align-items: start;
  }

  body:not(.mobile-game-view) .desktop-history-drawer-toggle,
  body:not(.mobile-game-view) .desktop-history-drawer-content {
    align-self: start;
  }

  body:not(.mobile-game-view) .desktop-history-drawer-toggle {
    box-sizing: border-box;
  }
}

/* V4.34 stable card angles, persistent energy, clipped portraits and adjustable opponent tuck. */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .court {
    --opponent-hand-tuck: 50%;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .hand {
    align-self: start;
    transform: translateY(calc(-1 * var(--opponent-hand-tuck)));
    transition: transform 180ms ease;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:nth-child(6n + 1) { --local-card-angle: -4deg; }
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:nth-child(6n + 2) { --local-card-angle: -2.4deg; }
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:nth-child(6n + 3) { --local-card-angle: -.8deg; }
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:nth-child(6n + 4) { --local-card-angle: .8deg; }
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:nth-child(6n + 5) { --local-card-angle: 2.4deg; }
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:nth-child(6n) { --local-card-angle: 4deg; }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:hover,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:focus,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:focus-within,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:active {
    transform: rotate(var(--local-card-angle, 0deg));
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:hover,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card:focus-within {
    transform: translateY(calc(-1 * var(--local-card-action-lift, 42px))) scale(1.26) rotate(var(--local-card-angle, 0deg)) !important;
  }

  body:not(.mobile-game-view) .character-card {
    overflow: hidden;
    isolation: isolate;
  }

  body:not(.mobile-game-view) .character-card img {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 50%;
    clip-path: circle(50% at 50% 50%);
    object-fit: cover;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .character-stats,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .character-endurance-reminder,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .character-endurance-reminder.low-endurance,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .character-endurance-reminder.warning-endurance,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .character-endurance-reminder .stat-value-row,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .character-endurance-reminder strong {
    visibility: visible !important;
    opacity: 1 !important;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .character-endurance-reminder {
    display: grid !important;
    z-index: 4;
  }
}

@media (min-width: 861px) and (max-height: 760px) {
  body:not(.mobile-game-view) .court { --opponent-hand-tuck: 56%; }
}

@media (min-width: 861px) and (max-height: 620px) {
  body:not(.mobile-game-view) .court { --opponent-hand-tuck: 64%; }
}

/* V4.35 center-right collapsible history drawer. */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .court > .log {
    position: absolute !important;
    top: 50%;
    right: 0;
    z-index: 360 !important;
    grid-column: auto;
    grid-row: auto;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: stretch;
    width: calc(min(390px, 31vw) + 46px);
    max-height: min(440px, calc(100% - 120px));
    margin: 0;
    overflow: visible;
    transform: translate(calc(100% - 46px), -50%);
    transition: transform 220ms ease;
  }

  body:not(.mobile-game-view) .court > .log.desktop-history-drawer--open {
    transform: translate(0, -50%);
  }

  body:not(.mobile-game-view) .desktop-history-drawer-toggle {
    z-index: 2;
    display: grid;
    grid-template-rows: auto 1fr;
    place-items: center;
    gap: 8px;
    min-width: 46px;
    border: 1px solid rgba(242, 163, 127, .72);
    border-right: 0;
    border-radius: 18px 0 0 18px;
    padding: 12px 7px;
    color: #f7fbff;
    background: rgba(5, 28, 43, .97);
    box-shadow: -8px 12px 26px rgba(0, 0, 0, .32);
  }

  body:not(.mobile-game-view) .desktop-history-drawer-toggle span {
    color: #f2a37f;
    font-size: 1.2rem;
    font-weight: 1000;
    line-height: 1;
  }

  body:not(.mobile-game-view) .desktop-history-drawer-toggle strong {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: .62rem;
    letter-spacing: .13em;
    text-transform: uppercase;
  }

  body:not(.mobile-game-view) .desktop-history-drawer-content {
    display: grid;
    gap: 7px;
    min-width: 0;
    max-height: inherit;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, .17);
    border-right: 0;
    border-radius: 14px 0 0 14px;
    padding: 9px;
    background: rgba(3, 31, 45, .96);
    box-shadow: -14px 18px 36px rgba(0, 0, 0, .34);
  }

  body:not(.mobile-game-view) .desktop-history-drawer-content .desktop-history-latest {
    min-height: 112px;
  }
}

@media (min-width: 861px) and (max-height: 700px) {
  body:not(.mobile-game-view) .court > .log {
    width: calc(min(340px, 29vw) + 42px);
    max-height: calc(100% - 76px);
    grid-template-columns: 42px minmax(0, 1fr);
    transform: translate(calc(100% - 42px), -50%);
  }

  body:not(.mobile-game-view) .court > .log.desktop-history-drawer--open {
    transform: translate(0, -50%);
  }
}

/* V4.39 final cascade lock: the tab stays compact beside the content-height drawer. */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .court > .log {
    height: auto;
    align-items: center;
  }

  body:not(.mobile-game-view) .desktop-history-drawer-toggle {
    align-self: center;
    height: auto !important;
    min-height: 0;
    grid-template-rows: auto auto;
  }

  body:not(.mobile-game-view) .desktop-history-drawer-content {
    align-self: center;
    height: auto;
  }
}

/* V4.40 direct centered history dialog and larger profile power bolts. */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .court > .log {
    display: flex;
    width: auto;
    max-height: none;
    align-items: center;
    transform: translate(0, -50%);
  }

  body:not(.mobile-game-view) .court > .log.desktop-history-drawer--open {
    transform: translate(0, -50%);
  }

  body:not(.mobile-game-view) .desktop-history-drawer-content {
    display: none;
  }

  body:not(.mobile-game-view) .desktop-history-progression-actions {
    width: min(320px, 28vw);
  }

  body:not(.mobile-game-view) .desktop-history-drawer-toggle {
    flex: 0 0 46px;
    border-right: 1px solid rgba(242, 163, 127, .72);
    border-radius: 18px 0 0 18px;
  }

  body:not(.mobile-game-view) .action-log-backdrop {
    align-items: center;
    padding: 24px;
  }

  body:not(.mobile-game-view) .action-log-dialog {
    width: min(940px, calc(100vw - 48px));
    height: min(78vh, 760px);
    border: 1px solid rgba(140, 224, 191, .22);
    border-radius: 24px;
  }

  body:not(.mobile-game-view) .character-power-reminder {
    padding-inline: 3px;
  }

  body:not(.mobile-game-view) .character-power-reminder .stat-value-power {
    grid-template-columns: 20px minmax(0, auto);
    gap: 2px;
  }

  body:not(.mobile-game-view) .character-power-reminder .stat-symbol-power {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
  }

  body:not(.mobile-game-view) .character-power-reminder.double-digit-power .stat-value-power {
    grid-template-columns: 18px minmax(0, auto);
    gap: 1px;
  }

  body:not(.mobile-game-view) .character-power-reminder.double-digit-power .stat-symbol-power {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }
}

/* V4.41 rounded center-board cards matching the player's hand. */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .desktop-played-card {
    border-radius: var(--game-card-radius);
  }

  body:not(.mobile-game-view) .desktop-played-card > img:not(.remise-forbid-overlay) {
    border-radius: var(--game-card-radius);
    clip-path: inset(0 round 7.2% / 5.2%);
  }

  body:not(.mobile-game-view) .desktop-played-card .desktop-remise-underlay,
  body:not(.mobile-game-view) .desktop-played-card .desktop-boost-underlay,
  body:not(.mobile-game-view) .desktop-played-card .boost-sacrifice-back {
    border-radius: var(--game-card-radius);
  }
}

/* V4.42 complete white outline above stacked effect + shot cards. */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .desktop-played-card.preceded-by-effect::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 12;
    box-sizing: border-box;
    border: 0;
    border-left: 2px solid #fff;
    border-radius: var(--game-card-radius);
    pointer-events: none;
  }
}

/* V4.44 restore only the obscured shot edge, without doubling its outline. */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .desktop-played-card.preceded-by-effect::after {
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
  }
}

/* V4.43 outline applies to Effect + Shot only, never Remise + Shot. */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .desktop-played-card.has-remise-underlay:not(.preceded-by-effect)::after {
    content: none;
    display: none;
  }
}

/* V4.45 the same single restored edge also applies between consecutive Effect cards. */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .desktop-played-card.preceded-by-effect::after {
    border-left: 2px solid #fff;
  }
}

/* V4.46 stable removed-card layers, readable overlays and consistent information rows. */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .desktop-played-slot {
    position: relative;
    z-index: var(--desktop-played-layer, 1);
  }

  body:not(.mobile-game-view) .desktop-played-card.removed {
    z-index: auto;
    filter: none;
    opacity: 1;
  }

  body:not(.mobile-game-view) .desktop-played-card.removed > img:not(.remise-forbid-overlay),
  body:not(.mobile-game-view) .desktop-played-card.removed .desktop-remise-underlay,
  body:not(.mobile-game-view) .desktop-played-card.removed .desktop-boost-underlay {
    filter: grayscale(1) brightness(.62);
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card-readable-data {
    position: absolute;
    inset: 4px;
    z-index: 12;
    display: grid !important;
    align-content: start;
    gap: 6px;
    overflow: auto;
    border: 1px solid rgba(140, 224, 191, .45);
    border-radius: var(--game-card-radius);
    padding: 8px;
    color: #f7fbff;
    background: rgba(3, 24, 38, .97);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
    pointer-events: none;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card-readable-data header span,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card-readable-data header strong,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card-readable-data p,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card-readable-data p b {
    color: #f7fbff;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card-readable-data .card-readable-stats > span {
    color: #f7fbff;
    background: rgba(255, 255, 255, .1);
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card-readable-data .card-readable-stats small,
  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card-readable-data .card-readable-stats strong {
    color: #f7fbff;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .card-readable-data .card-readable-boost {
    color: #fff;
    background: rgba(125, 47, 47, .78);
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .hand .boost-warning {
    width: 100%;
    min-height: 0;
    padding: 4px 5px;
    font-size: .46rem;
    font-weight: 900;
    line-height: 1.12;
    letter-spacing: .035em;
    text-align: center;
    text-transform: uppercase;
  }

  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card:hover .card-hover-panel,
  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card:focus-within .card-hover-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: auto;
  }

  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card:hover .card-assist-preview,
  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card:focus-within .card-assist-preview {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card:hover .card-assist-preview.has-boost,
  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card:focus-within .card-assist-preview.has-boost {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card:hover .card-assist-preview span,
  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card:focus-within .card-assist-preview span,
  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card:hover .boost-warning,
  body:not(.mobile-game-view).game-actions-always-visible .player-panel[data-desktop-role="local"] .hand .card:focus-within .boost-warning {
    width: 100%;
    min-width: 0;
  }
}

/* V4.47 final competition contrast overrides. Keep after legacy tournament rules. */
.competition-dialog-shell { color: #17212b; background: #f4f7f6 !important; }
.competition-dialog-close { color: #fff; background: #17384a; }
.competition-dialog-scroll,
.competition-dialog-scroll .tournament-panel { color: #17212b !important; background: #fff !important; }
.competition-dialog-scroll .tournament-panel :is(h1, h2, h3, h4, p, span, strong, b, small, li, dt, dd, label) { color: #17212b !important; }
.competition-dialog-scroll .tournament-panel :is(.eyebrow, .difficulty-reminder, .tournament-location-reminder, .tournament-round-label, .tournament-column-title, .league-standings-head, .championship-empty-round, .league-rank) { color: #465b68 !important; }
.competition-dialog-scroll .tournament-meta-row .difficulty-reminder { color: #344957 !important; background: #edf3f4 !important; }
.competition-dialog-scroll .tournament-meta-row .weekly-points-reminder { color: #382900 !important; background: #f6d66d !important; }
.competition-dialog-scroll .tournament-panel :is(.tournament-toggle-button, .championship-zone-toggle) { color: #17212b !important; background: #e8f0f2 !important; }
.competition-dialog-scroll .tournament-panel button :is(span, strong, b, small) { color: inherit !important; }
.competition-dialog-scroll .tournament-panel :is(.tournament-match, .tournament-champion, .league-standings, .championship-zone) { border-color: #cbd8dc; color: #17212b !important; background: #f0f4f3 !important; }
.competition-dialog-scroll .tournament-panel .tournament-match.current { background: #f3f8dc !important; }
.competition-dialog-scroll .tournament-panel .tournament-match.final-match { background: #fff7df !important; }
.competition-dialog-scroll .tournament-player-row,
.competition-dialog-scroll .league-standings-row { color: #17212b !important; background: #f8fafb !important; }
.competition-dialog-scroll .tournament-player-row.winner,
.competition-dialog-scroll .league-standings-row.qualified { color: #183f35 !important; background: #e5f3ee !important; box-shadow: none; }
.competition-dialog-scroll :is(.tournament-player-row, .league-standings-row).human-player { color: #3d310d !important; background: #fff6dc !important; }
.competition-dialog-scroll .tournament-match-status { color: #41545f !important; background: #e3eaed !important; }
.competition-dialog-scroll .tournament-match-status.live { color: #155e43 !important; background: #d9f1e6 !important; }
.competition-dialog-scroll .tournament-match-status.complete { color: #164d3d !important; background: #cfe9df !important; }
.competition-dialog-scroll .tournament-match-status.upcoming { color: #465b68 !important; background: #e3eaed !important; }
.competition-dialog-scroll .tournament-score,
.competition-dialog-scroll .tournament-set-scores span { color: #263d49 !important; background: #e7edef !important; }
.competition-dialog-scroll .tournament-set-scores.live span { color: #155e43 !important; background: #dff2ea !important; }
.competition-dialog-scroll .tournament-set-scores span.winner-set { color: #164d3d !important; background: #d5ece3 !important; box-shadow: none; }
.competition-dialog-scroll .championship-zone-toggle > span:first-child,
.competition-dialog-scroll .championship-day > header strong { color: #315f52 !important; }
.competition-dialog-scroll .championship-zone-content { color: #17212b; background: #f7faf9 !important; }
.competition-dialog-scroll .championship-day > header,
.competition-dialog-scroll .championship-day > header span { color: #465b68 !important; }

/* V4.50 online match menu and explicit walkover action. */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .game-app > .topbar {
    z-index: 520 !important;
    overflow: visible;
  }

  body:not(.mobile-game-view) .desktop-game-menu-toggle {
    position: relative;
    z-index: 2;
    pointer-events: auto;
  }

  body:not(.mobile-game-view) .game-app.desktop-game-menu-open .top-actions {
    z-index: 540 !important;
    display: flex !important;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  body:not(.mobile-game-view) .game-app.desktop-game-menu-open .top-actions > :not(.hidden) {
    pointer-events: auto;
  }
}

.online-forfeit-button {
  color: #fff;
  background: #b83232;
}

.online-forfeit-dialog .modal {
  border-color: rgba(217, 75, 75, .5);
}

/* V4.52 identical solo/online desktop score line above the silent header. */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .game-app > .topbar {
    background: transparent !important;
  }

  body:not(.mobile-game-view) .desktop-match-score {
    z-index: 530 !important;
    display: grid !important;
    visibility: visible;
    opacity: 1;
  }

  body:not(.mobile-game-view) .desktop-match-score.hidden {
    display: none !important;
  }
}

/* V5 Ultimate — desktop only. All selectors are scoped to the dedicated mode. */
.lobby-mode-ultimate {
  position: relative;
  overflow: hidden;
  border-color: #d8b85a;
  background: linear-gradient(135deg, #101826, #35280e);
}
.lobby-mode-ultimate > .lobby-mode-art { object-position: 50% 48%; }
.ultimate-mode-icon { color: #ffd76a; font-size: 2rem; }
.lobby-mode-ultimate .lobby-mode-card-copy { position: relative; z-index: 2; }

.ultimate-dialog {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 2rem;
  background: rgba(3, 8, 18, .84);
  backdrop-filter: blur(12px);
}
.ultimate-dialog.hidden { display: none; }
.ultimate-dialog-card {
  position: relative;
  width: min(980px, 96vw);
  max-height: 90vh;
  overflow: auto;
  padding: 2rem;
  border: 1px solid rgba(255, 215, 106, .55);
  border-radius: 24px;
  color: #f7f7f5;
  background: linear-gradient(145deg, #141e2d, #090d14);
  box-shadow: 0 30px 90px #000;
}
.ultimate-dialog-card h2 { margin: .2rem 0 .5rem; font-size: 2rem; }
.ultimate-player-dialog-card { width: min(900px, 94vw); }
.ultimate-player-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.ultimate-player-choice { display: grid; gap: .6rem; overflow: hidden; padding: 0 0 1rem; border: 2px solid rgba(255,255,255,.14); border-radius: 18px; background: #1d2938; color: #fff; cursor: pointer; transition: border-color 160ms ease, transform 160ms ease; }
.ultimate-player-choice:hover, .ultimate-player-choice:focus-visible { border-color: #ffd76a; transform: translateY(-4px); }
.ultimate-player-choice img { width: 100%; height: min(44vh, 390px); object-fit: cover; object-position: top center; }
.ultimate-player-choice strong { font-size: 1.2rem; }
.ultimate-player-choice span { color: #ffd76a; font-weight: 850; text-transform: uppercase; }
.ultimate-dialog-close { position: absolute; top: 1rem; right: 1rem; width: 2.5rem; height: 2.5rem; border-radius: 50%; font-size: 1.5rem; }
.ultimate-rules-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 1.5rem; }
.ultimate-rules-grid article { padding: 1rem; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(255,255,255,.05); }
.ultimate-rules-grid strong { color: #ffd76a; }
.ultimate-rules-grid p { margin: .45rem 0 0; line-height: 1.5; color: #dbe4ec; }
.ultimate-draft-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.5rem 0; }
.ultimate-draft-card { display: grid; gap: .65rem; padding: .75rem; border: 2px solid transparent; border-radius: 16px; background: #1d2938; color: #fff; }
.ultimate-draft-card img { width: 100%; max-height: 48vh; object-fit: contain; border-radius: 10px; }
.ultimate-draft-card.selected { border-color: #ffd76a; box-shadow: 0 0 0 4px rgba(255,215,106,.16); transform: translateY(-5px); }
.ultimate-post-exchange-actions { display: flex; justify-content: flex-end; gap: .75rem; }
.ultimate-post-exchange-cards:empty { display: none; }
.ultimate-resources { display: flex; align-items: center; gap: .65rem; min-height: 66px; margin: .35rem .75rem; padding: .5rem .65rem; border-radius: 12px; background: rgba(7, 13, 22, .8); color: #fff; }
.ultimate-energy { display: flex; align-items: center; gap: .4rem; padding-right: .75rem; border-right: 3px solid var(--player-color, #ffd76a); }
.ultimate-energy > span, .ultimate-reserve-divider { font-size: .68rem; font-weight: 900; letter-spacing: .08em; }
.ultimate-energy strong { color: #ffd76a; }
.ultimate-energy button, .ultimate-discard-button, .ultimate-reserve-pick button { padding: .35rem .55rem; border-radius: 7px; font-size: .68rem; }
.ultimate-reserve { display: flex; align-items: center; gap: .4rem; }
.ultimate-reserve-divider { padding-right: .35rem; color: #bed0dd; }
.ultimate-reserve-slot { width: 62px; height: 48px; display: grid; place-items: center; overflow: hidden; border: 1px dashed #728494; border-radius: 8px; font-size: .55rem; color: #b8c6cf; background: #121c27; }
.ultimate-reserve-slot.filled { position: relative; border-style: solid; color: #fff; }
.ultimate-reserve-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.ultimate-reserve-slot span { position: relative; z-index: 1; text-shadow: 0 1px 4px #000; }
.ultimate-reserve-pick { display: flex; align-items: center; gap: .35rem; margin-left: auto; }
.ultimate-reserve-pick strong { max-width: 110px; font-size: .62rem; color: #ffd76a; }
.ultimate-discard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .75rem; margin-top: 1rem; }
.ultimate-discard-grid article { display: grid; gap: .35rem; padding: .5rem; border-radius: 10px; background: rgba(255,255,255,.06); }
.ultimate-discard-grid img { width: 100%; max-height: 180px; object-fit: contain; }
.ultimate-discard-grid strong { font-size: .72rem; }
.ultimate-reserve-hand-divider { align-self: stretch; display: grid; place-items: center; min-width: 30px; border-left: 3px solid #ffd76a; color: #ffd76a; font-size: .58rem; font-weight: 950; letter-spacing: .08em; text-orientation: mixed; writing-mode: vertical-rl; }
.ultimate-reserve-hand-divider.empty { opacity: .55; }
.ultimate-reserve-hand-card { position: relative; border: 3px solid #ffd76a !important; border-radius: 14px; box-shadow: 0 0 0 3px rgba(255,215,106,.18), 0 8px 22px rgba(0,0,0,.28); }
.ultimate-reserve-hand-badge { position: absolute; top: -10px; left: 50%; z-index: 8; padding: .22rem .45rem; border-radius: 999px; color: #17202b; background: #ffd76a; font-size: .55rem; font-weight: 950; transform: translateX(-50%); }
.ultimate-use-reserve-button { position: absolute; right: 6px; bottom: 6px; left: 6px; z-index: 8; padding: .4rem; border: 0; border-radius: 8px; color: #17202b; background: #ffd76a; font-weight: 900; }
.ultimate-reserve-mark { position: absolute; top: 50%; left: 50%; z-index: 9; width: 34px; height: 34px; border: 3px solid #fff; border-radius: 50%; background: #177de3; box-shadow: 0 2px 10px rgba(0,0,0,.5); pointer-events: none; transform: translate(-50%,-50%); }
.ultimate-discard-mark { position: absolute; top: 50%; left: 50%; z-index: 12; width: 38px; height: 38px; border: 4px solid #fff; border-radius: 50%; background: #177de3; box-shadow: 0 2px 12px rgba(0,0,0,.65); pointer-events: none; transform: translate(-50%,-50%); }
.ultimate-mark-reserve-choice { display: block; margin: 0 auto 1rem; }
.ultimate-reserve-actions { position: relative; z-index: 110; display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; width: 100%; pointer-events: auto; }
.ultimate-reserve-actions > button { min-width: 0; min-height: 34px; pointer-events: auto; }
.ultimate-reserve-hover-panel { z-index: 108 !important; }
.ultimate-reserve-hand-card:hover, .ultimate-reserve-hand-card:focus-within { z-index: 120 !important; }
.ultimate-reserve-readonly { cursor: default; }
.ultimate-resources { display: grid; grid-template-columns: auto 1fr auto; }
.ultimate-energy-summary { display: grid; gap: .1rem; padding-right: .8rem; border-right: 3px solid var(--player-color, #ffd76a); }
.ultimate-energy-summary span { font-size: .68rem; font-weight: 900; letter-spacing: .08em; }
.ultimate-energy-summary strong { color: #ffd76a; font-size: 1.1rem; }
.ultimate-energy-actions { display: flex; align-items: center; gap: .45rem; }
.ultimate-energy-actions button { padding: .45rem .7rem; border-radius: 8px; font-weight: 850; }
.ultimate-energy-actions span { color: #8fa5b5; font-size: .65rem; font-weight: 900; text-transform: uppercase; }
.ultimate-discard-button { display: grid; place-items: center; min-width: 74px; }
.ultimate-discard-button strong { font-size: 1.1rem; }
.ultimate-ai-levels { margin: 1rem 0 0; padding: .8rem; border: 1px solid rgba(255,255,255,.16); border-radius: 12px; }
.ultimate-ai-levels legend { padding: 0 .4rem; color: #ffd76a; font-weight: 900; }
.ultimate-ai-levels div { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.ultimate-ai-levels button { padding: .55rem .8rem; border: 2px solid transparent; border-radius: 999px; }
.ultimate-ai-levels button.selected { border-color: #ffd76a; color: #17202b; background: #ffd76a; }
.ultimate-energy-dialog { width: min(620px, 94vw); }
.ultimate-energy-dialog-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.ultimate-energy-dialog-actions button { display: grid; gap: .35rem; min-height: 110px; padding: 1rem; border: 2px solid rgba(255,215,106,.42); border-radius: 16px; color: #fff; background: #1d2938; }
.ultimate-energy-dialog-actions button strong { color: #ffd76a; font-size: 1rem; }
.ultimate-character-state-dialog { width: min(520px, 94vw); text-align: center; }
.ultimate-character-state-dialog > img { display: block; width: min(300px, 80%); max-height: 58vh; margin: 1rem auto; object-fit: contain; border-radius: 14px; }
.ultimate-character-state-label { display: block; color: #ffd76a; }

@media (min-width: 861px) {
  body:not(.mobile-game-view) .game-app .character-card { padding: 0; border-style: solid; background: transparent; cursor: pointer; }
  body:not(.mobile-game-view) .game-app .ultimate-profile-energy { position: absolute; top: 56px; left: 118px; z-index: 80; display: flex; align-items: center; justify-content: center; gap: 3px; min-width: 48px; height: 30px; padding: 0 8px; border: 2px solid #fff; border-radius: 999px; color: #fff; background: #d93743; box-shadow: 0 3px 10px rgba(0,0,0,.45); cursor: pointer; pointer-events: auto; }
  body:not(.mobile-game-view) .game-app .ultimate-profile-energy span { font-size: .72rem; }
  body:not(.mobile-game-view) .game-app .ultimate-profile-energy strong { color: #fff; font-size: .88rem; font-weight: 950; }
  body:not(.mobile-game-view) .game-app .ultimate-profile-energy:disabled { opacity: .72; cursor: default; }
  body:not(.mobile-game-view) .game-app .character-zone:has(.ultimate-profile-discard) { width: min(232px, calc(100% - 12px)); min-height: 102px; padding: 7px 7px 36px; overflow: visible; }
  body:not(.mobile-game-view) .game-app .ultimate-profile-discard { position: absolute; right: 7px; bottom: 7px; left: 68px; z-index: 70; display: block; min-height: 27px; padding: 3px 8px; border: 1px solid rgba(255,215,106,.7); border-radius: 0 0 12px 12px; color: #eef5f8; background: #071f2c; box-shadow: 0 5px 12px rgba(0,0,0,.35); font-size: .58rem; font-weight: 900; letter-spacing: .05em; cursor: pointer; pointer-events: auto; }
  body:not(.mobile-game-view) .game-app .ultimate-profile-discard strong { color: #ffd76a; }
}

@media (max-width: 860px) {
  .lobby-mode-ultimate, .ultimate-dialog, .ultimate-resources { display: none !important; }
}

@media (min-width: 861px) {
  body:not(.mobile-game-view) .game-app .character-zone:has(.ultimate-profile-energy) .character-stats { grid-template-columns: repeat(3, minmax(38px, 1fr)); }
  body:not(.mobile-game-view) .game-app .character-stats .ultimate-profile-energy { position: relative; inset: auto; z-index: 1; align-self: stretch; width: 100%; min-width: 0; height: 31px; min-height: 31px; padding: 0 5px; }
  body:not(.mobile-game-view) .game-app .character-zone:has(.ultimate-profile-energy) > .desktop-player-bonus-count { grid-column: 1 / 4; grid-row: 4; display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; border-radius: 999px; font-size: .68rem; letter-spacing: .04em; }
  body:not(.mobile-game-view) .game-app .desktop-player-bonus-count strong { font-size: .9rem; font-weight: 1000; }
}

/* V5.29 · profil et actions, exclusivement sur le plateau Ultimate desktop. */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .game-app .ultimate-character-zone { width: min(246px, calc(100% - 12px)); }
  body:not(.mobile-game-view) .game-app .ultimate-character-zone .desktop-player-identity { width: 100%; min-width: 0; }
  body:not(.mobile-game-view) .game-app .ultimate-character-zone .desktop-player-identity > strong { display: block; width: 100%; max-width: none; padding-inline: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  body:not(.mobile-game-view) .game-app .ultimate-character-zone .character-stats { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 7px; }
  body:not(.mobile-game-view) .game-app .ultimate-character-zone .character-endurance-reminder,
  body:not(.mobile-game-view) .game-app .ultimate-character-zone .character-endurance-reminder.warning-endurance { border-color: #274ab3; color: #fff; background: #274ab3; }
  body:not(.mobile-game-view) .game-app .ultimate-character-zone .character-endurance-reminder strong { color: #fff; }
  body:not(.mobile-game-view) .game-app .ultimate-character-zone .character-endurance-reminder .stat-symbol { background-color: #fff; }
  body:not(.mobile-game-view) .game-app .ultimate-character-zone .character-endurance-reminder.low-endurance { border-color: #ffa500; color: #fff; background: #ffa500; }
  body:not(.mobile-game-view) .game-app .ultimate-character-zone .ultimate-profile-energy { border-color: #ff2c2c; color: #fff; background: #ff2c2c; }
  body:not(.mobile-game-view) .game-app .ultimate-character-zone .ultimate-profile-energy img { width: 18px; height: 18px; object-fit: contain; filter: brightness(0) invert(1); pointer-events: none; }
  body:not(.mobile-game-view) .game-app .ultimate-character-zone > .desktop-player-bonus-count { width: 100%; }
  body:not(.mobile-game-view) .game-app .ultimate-character-zone .ultimate-profile-discard { right: auto; left: 50%; width: 66%; min-width: 132px; transform: translateX(-50%); text-align: center; }
  body:not(.mobile-game-view) .game-app .ultimate-card-play-button:not(:disabled) { color: #fff; background: #274ab3; }
  body:not(.mobile-game-view) .game-app .ultimate-card-play-button .card-action-cost { justify-content: center; width: 100%; }
}

/* V6.1 Academy action trays, restored from V4.56 and isolated from Ultimate. */
@media (min-width: 861px) {
  body:not(.mobile-game-view) .player-panel .character-zone:not(.ultimate-character-zone) .character-portrait-stage {
    position: relative;
    grid-column: 1 / 4;
    grid-row: 1;
    align-self: center;
    justify-self: center;
    width: 84px;
    height: 84px;
    overflow: visible;
  }

  body:not(.mobile-game-view) .player-panel .character-zone:not(.ultimate-character-zone) .character-portrait-stage > .character-card {
    position: relative;
    width: 100%;
    height: 100%;
  }

  body:not(.mobile-game-view) .player-panel .character-zone:not(.ultimate-character-zone) .desktop-profile-actions {
    position: absolute;
    z-index: 40;
    right: auto;
    left: 50%;
    display: flex;
    justify-content: center;
    width: min(172px, calc(100vw - 16px));
    min-height: 38px;
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 12px;
    padding: 5px;
    background: linear-gradient(145deg, rgba(7, 27, 43, .96), rgba(13, 50, 69, .94));
    box-shadow: 0 8px 20px rgba(0, 0, 0, .3);
    backdrop-filter: blur(8px);
    transform: translateX(-50%);
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  body:not(.mobile-game-view) .player-panel .character-zone:not(.ultimate-character-zone) .desktop-profile-actions:empty {
    visibility: hidden;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .character-zone:not(.ultimate-character-zone) .desktop-profile-actions--local {
    top: auto;
    bottom: calc(100% + 40px);
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="opponent"] .character-zone:not(.ultimate-character-zone) > .desktop-profile-actions--opponent {
    top: calc(100% + 40px);
    bottom: auto;
  }

  body:not(.mobile-game-view) .player-panel .character-zone:not(.ultimate-character-zone) .desktop-profile-actions button {
    min-width: 0;
    min-height: 28px;
    padding: 5px 7px;
    font-size: .56rem;
    line-height: 1.05;
  }

  body:not(.mobile-game-view) .character-zone:not(.ultimate-character-zone) .desktop-profile-bottom-spacer {
    display: none;
  }

  body:not(.mobile-game-view) .player-panel[data-desktop-role="local"] .character-zone:not(.ultimate-character-zone) .desktop-profile-bottom-spacer {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    display: block;
    width: 100%;
    height: 38px;
    pointer-events: none;
  }
}

@media (min-width: 861px) and (max-height: 700px) {
  body:not(.mobile-game-view) .player-panel .character-zone:not(.ultimate-character-zone) .character-portrait-stage {
    width: 66px;
    height: 66px;
  }
}

/* V6.2 explicit local-match resume from the lobby. */
.local-match-resume-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 18px 0;
  border: 1px solid rgba(140, 224, 191, .55);
  border-radius: 18px;
  padding: 18px 20px;
  color: #fff;
  background: linear-gradient(135deg, #075f58, #063449);
  box-shadow: 0 14px 34px rgba(3, 31, 45, .22);
}

.local-match-resume-prompt.hidden { display: none; }
.local-match-resume-prompt > div:first-child { display: grid; gap: 4px; }
.local-match-resume-prompt span { color: #dfff75; font-size: .68rem; font-weight: 950; letter-spacing: .1em; }
.local-match-resume-prompt strong { font-size: 1rem; }
.local-match-resume-prompt small { color: rgba(255, 255, 255, .76); }
.local-match-resume-actions { display: flex; flex: 0 0 auto; gap: 9px; }
.local-match-resume-actions .small-button { color: #fff; background: rgba(255, 255, 255, .1); }

.admin-ai-report-summary { display: grid; gap: 6px; margin: 12px 0; color: #274154; font-size: .82rem; }
.admin-ai-report-summary p { margin: 0; }
.admin-ai-report-table { overflow-x: auto; border: 1px solid #d7e0e5; border-radius: 14px; background: #fff; }
.admin-ai-report-row { display: grid; grid-template-columns: 38px minmax(145px, 1.5fr) 54px repeat(8, minmax(82px, 1fr)); min-width: 1050px; border-bottom: 1px solid #e5ebee; }
.admin-ai-report-row:last-child { border-bottom: 0; }
.admin-ai-report-row > span, .admin-ai-report-row > strong { padding: 9px 8px; text-align: right; font-size: .72rem; }
.admin-ai-report-row > span:nth-child(2) { text-align: left; font-weight: 800; }
.admin-ai-report-head { position: sticky; top: 0; z-index: 2; color: #fff; background: #16374a; }
.admin-ai-report-head > span { font-weight: 900; }

@media (max-width: 700px) {
  .local-match-resume-prompt { align-items: stretch; flex-direction: column; padding: 16px; }
  .local-match-resume-actions { display: grid; grid-template-columns: 1fr; }
}

/* V6.18 — contraste des surfaces sombres et libellés de boutons homogènes. */
.game-context-strip > div > strong,
.game-assist-panel :is(h2, h3, p, label, strong),
.tournament-panel .tournament-header :is(h2, strong),
.competition-summary-hero > :is(h1, h2, h3, p, strong),
.competition-summary-winner > :is(h1, h2, h3, p, strong),
.competition-summary-bracket > :is(h1, h2, h3, p, strong) {
  color: #fff;
}

.game-assist-panel :is(small, span),
.competition-summary-hero > :is(small, span),
.competition-summary-winner > :is(small, span),
.competition-summary-bracket > :is(small, span) {
  color: #d8eff8;
}

:is(
  .weekly-competition-actions,
  .dialog-actions,
  .result-actions,
  .local-match-resume-actions,
  .competition-dialog-scroll .tournament-header,
  .competition-dialog-scroll .tournament-panel
) :is(.primary-button, .small-button, .tournament-toggle-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding-block: 7px;
  font-size: .82rem;
  line-height: 1.15;
  text-align: center;
}
