/* Shared hub shell/menu styles (used by Moulin + Gomoku). Game styles can override visuals. */

:root {
  --hub-bg: var(--bg, #0b0f14);
  --hub-surface: var(--surface, #121821);
  --hub-surface-2: var(--surface-2, #0f141c);
  --hub-rim: var(--rim, #223246);
  --hub-rim-hi: var(--rim-hi, #355179);
  --hub-shadow: var(--shadow, 0 10px 30px rgba(0, 0, 0, 0.35));
  --hub-shadow-sm: var(--shadow-sm, 0 6px 18px rgba(0, 0, 0, 0.22));
  --hub-chalk: var(--chalk, #e7eef6);
  --hub-chalk-dim: var(--chalk-dim, #cfd9e3);
  --hub-stone: var(--stone, #8aa0b3);
  --hub-gold: var(--gold, #4aa3ff);
  --hub-gold-dim: var(--gold-dim, rgba(74, 163, 255, 0.6));
  --hub-good: var(--signal-hi, #baf3cf);
  --hub-warn: var(--gold-hi, #ffe0a0);
}

body[data-screen="menu"],
body[data-screen="online-home"],
body[data-screen="online-lobby"] {
  font-family: "Outfit", system-ui, sans-serif;
  color: var(--hub-chalk);
}

.app.menu-app {
  width: 100% !important;
  max-width: none !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: auto !important;
  grid-auto-rows: auto !important;
  gap: 0 !important;
  padding: 0 !important;
  align-items: start !important;
  justify-items: center !important;
}

.menu-shell {
  width: 95%;
  max-width: 95%;
  min-height: 100dvh;
  padding: 24px;
  display: grid;
  gap: 20px;
  box-sizing: border-box;
  margin: 0 auto;
}

.screen-panel {
  background: var(--hub-surface);
  border: 1px solid var(--hub-rim);
  border-radius: 14px;
  box-shadow: var(--hub-shadow);
  min-width: 0;
  overflow: hidden;
}

.menu-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
  gap: 0;
  min-height: 540px;
}

.menu-card {
  background: transparent;
  border: 1px solid var(--hub-rim);
  border-radius: 10px;
  box-shadow: none;
  padding: 16px;
  min-width: 0;
}

.menu-grid > .menu-card:first-child {
  border-right: 1px solid var(--hub-rim);
  border-radius: 0;
  border-top: none;
  border-left: none;
  border-bottom: none;
  padding: 24px;
}

.menu-grid > .menu-card:last-child {
  border-radius: 0;
  border: none;
  padding: 24px;
}

.hero {
  background:
    radial-gradient(500px 280px at 60% 0%, rgba(184, 150, 92, 0.07), transparent 65%),
    var(--hub-surface);
  border-radius: 10px;
}

.hero h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.12;
  font-weight: 400;
  color: var(--hub-chalk);
}

.hero-rules.prose {
  display: grid;
  gap: 10px;
  border: none;
  border-radius: 12px;
  background:
    radial-gradient(420px 180px at 82% 0%, rgba(184, 150, 92, 0.06), transparent 72%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.004));
  padding: 16px;
  margin-top: 14px;
}

body[data-screen="menu"] .hero-rules.prose,
body[data-screen="online-home"] .hero-rules.prose,
body[data-screen="online-lobby"] .hero-rules.prose {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.hero-rules.prose p {
  margin: 0;
  color: var(--hub-chalk-dim);
  line-height: 1.55;
  font-size: 13px;
  width: 100%;
  max-width: none;
}

.hero-rules.prose .hero-lead {
  color: var(--hub-chalk);
  font-size: 14px;
  line-height: 1.65;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border: 1px solid var(--hub-rim);
  border-radius: 10px;
  overflow: hidden;
  background: var(--hub-rim);
  margin-top: 14px;
}

.stats-pill {
  background: var(--hub-surface-2);
  text-align: center;
  color: var(--hub-stone);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 14px 12px;
  display: grid;
  gap: 2px;
  border: none;
}

.stats-pill b {
  font-family: "Playfair Display", serif;
  font-size: 22px;
  color: var(--hub-gold);
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
}

.mode-list {
  display: grid;
  gap: 10px;
}

.mode-btn {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 5px;
  background: var(--hub-bg);
  border: 1px solid var(--hub-rim);
  border-radius: 10px;
  padding: 16px 18px;
  transition: border-color 0.16s, background 0.16s, transform 0.12s;
  cursor: pointer;
  color: inherit;
  box-sizing: border-box;
}

.mode-btn:hover:not(:disabled) {
  border-color: var(--hub-gold-dim);
  background: var(--hub-surface-2);
  transform: translateX(3px);
}

.mode-btn strong {
  color: var(--hub-chalk);
  font-size: 14px;
  font-family: "Playfair Display", serif;
  font-weight: 500;
}

.mode-btn span {
  color: var(--hub-stone);
  font-size: 12px;
  line-height: 1.35;
}

.hub-games-block {
  margin-top: 20px;
  display: grid;
  gap: 12px;
}

.hub-section-title {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--hub-stone);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

/* ==========================================================================
   Game Preview (hub attract-mode panel)
   ========================================================================== */
.hub-preview-block {
  margin-top: 2px;
}

.hub-game-preview {
  position: relative;
  width: 100%;
  height: clamp(220px, 29vw, 300px);
  border-radius: 12px;
  border: 1px solid var(--hub-rim);
  background:
    radial-gradient(420px 180px at 82% 0%, rgba(184, 150, 92, 0.07), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,.015), rgba(255,255,255,.003)),
    var(--hub-surface);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
  overflow: hidden;
}

.game-preview-root {
  position: relative;
  width: 100%;
  height: 100%;
}

.game-preview-shell {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 8px;
  padding: 12px;
  box-sizing: border-box;
}

.game-preview-badge {
  justify-self: start;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hub-stone);
  border: 1px solid var(--hub-rim);
  background: rgba(255,255,255,.015);
  border-radius: 999px;
  padding: 4px 9px;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

.game-preview-caption {
  font-size: 12px;
  color: var(--hub-stone);
  line-height: 1.35;
  user-select: none;
  pointer-events: none;
}

.game-preview-board-stage {
  min-height: 0;
  display: grid;
  place-items: center;
  position: relative;
}

.game-preview-board-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.05);
  background:
    radial-gradient(220px 180px at 32% 22%, rgba(17, 24, 35, 0.92), rgba(8, 12, 18, 0.98)),
    #0b1017;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.015),
    0 12px 26px rgba(0,0,0,.28),
    0 2px 8px rgba(0,0,0,.18);
  overflow: hidden;
}

.game-preview-board-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(180px 120px at 82% 8%, rgba(184,150,92,.08), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,.02), transparent 40%);
  pointer-events: none;
}

.game-preview-root.is-gomoku .game-preview-board-wrap {
  background:
    radial-gradient(240px 180px at 28% 20%, rgba(16, 24, 34, 0.92), rgba(8, 12, 18, 0.985)),
    #0a0f16;
}

.game-preview-root.is-gomoku .game-preview-board-wrap::before {
  background:
    radial-gradient(180px 120px at 84% 9%, rgba(184,150,92,.08), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,.014), transparent 48%);
}

.game-preview-board-svg {
  position: absolute;
  inset: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  display: block;
  overflow: visible;
}

@keyframes gpPreviewMillLinePulse {
  0% {
    stroke-width: 2.15;
    opacity: 0.9;
  }
  50% {
    stroke-width: 2.7;
    opacity: 1;
  }
  100% {
    stroke-width: 2.25;
    opacity: 0.96;
  }
}

@keyframes gpPreviewMillNodePulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
  100% {
    transform: scale(1.02);
    opacity: 0.98;
  }
}

@keyframes gpPreviewMillPiecePulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.08);
  }
  100% {
    transform: translate(-50%, -50%) scale(1.02);
  }
}

@keyframes gpPreviewCaptureNodeFlash {
  0% {
    transform: scale(1);
    opacity: 0.9;
  }
  25% {
    transform: scale(1.14);
    opacity: 1;
  }
  60% {
    transform: scale(1.06);
    opacity: 0.98;
  }
  100% {
    transform: scale(1);
    opacity: 0.92;
  }
}

@keyframes gpPreviewCapturePiece {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    filter: saturate(1.06) brightness(1.02);
  }
  18% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.12);
    filter: saturate(1.12) brightness(1.08);
  }
  56% {
    opacity: 0.92;
    transform: translate(-50%, -50%) scale(0.92);
    filter: saturate(1.02) brightness(0.98);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.36);
    filter: blur(0.6px) saturate(0.85);
  }
}

@keyframes gpPreviewCaptureRing {
  0% {
    opacity: 0.92;
    transform: translate(-50%, -50%) scale(0.64);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.8);
  }
}

@keyframes gpPreviewWinLinePulse {
  0% {
    stroke-width: 2.25;
    opacity: 0.9;
  }
  50% {
    stroke-width: 2.8;
    opacity: 1;
  }
  100% {
    stroke-width: 2.35;
    opacity: 0.96;
  }
}

.game-preview-gk-grid-line {
  stroke: rgba(113, 130, 153, 0.34);
  stroke-width: 0.5;
  opacity: 0.92;
}

.game-preview-gk-star {
  fill: rgba(166, 180, 198, 0.34);
  opacity: 0.9;
}

.game-preview-gk-win-line {
  stroke: rgba(226, 189, 123, 0);
  stroke-width: 2.35;
  stroke-linecap: round;
  opacity: 0;
  filter: url(#gp-soft-glow);
  transition: opacity .2s ease, stroke .24s ease;
}

.game-preview-gk-win-line.is-win {
  stroke: rgba(226, 189, 123, .98);
  opacity: 1;
  filter: url(#gp-soft-glow) drop-shadow(0 0 4px rgba(184, 150, 92, 0.5));
  animation: gpPreviewWinLinePulse 0.92s ease-in-out infinite;
}

.game-preview-line {
  stroke: #3b495a;
  stroke-width: 1.6;
  opacity: .95;
  stroke-linecap: round;
  transition: stroke .48s ease, filter .48s ease, stroke-width .48s ease, opacity .48s ease;
}

.game-preview-line.is-mill {
  stroke: rgba(226, 189, 123, .98);
  stroke-width: 2.35;
  opacity: 1;
  filter: url(#gp-soft-glow) drop-shadow(0 0 4px rgba(184, 150, 92, 0.5));
  animation: gpPreviewMillLinePulse 0.92s ease-in-out infinite;
}

.game-preview-node-wrap {
  transition: opacity .28s ease;
  transform-box: fill-box;
  transform-origin: center;
}

.game-preview-node {
  transition: fill .25s ease, stroke .25s ease, opacity .25s ease, filter .25s ease;
}

.game-preview-node-outer {
  fill: rgba(15, 21, 30, .9);
  stroke: rgba(106, 126, 150, .35);
  stroke-width: .55;
}

.game-preview-node-outer.is-mill,
.game-preview-node-wrap.is-mill .game-preview-node-outer,
.game-preview-node-wrap.is-win .game-preview-node-outer {
  fill: rgba(184,150,92,.18);
  stroke: rgba(220,186,123,.92);
  stroke-width: .75;
  filter: url(#gp-soft-glow);
}

.game-preview-node-inner {
  fill: rgba(195, 209, 224, .26);
  stroke: none;
}

.game-preview-node-wrap.is-mill .game-preview-node-inner,
.game-preview-node-wrap.is-win .game-preview-node-inner {
  fill: rgba(232, 199, 140, .96);
}

.game-preview-node-wrap.is-mill,
.game-preview-node-wrap.is-win {
  animation: gpPreviewMillNodePulse 0.92s ease-in-out infinite;
}

.game-preview-node-wrap.is-active .game-preview-node-outer {
  stroke: rgba(184,150,92,.55);
  fill: rgba(184,150,92,.08);
}

.game-preview-node-wrap.is-active .game-preview-node-inner {
  fill: rgba(212,176,122,.70);
}

.game-preview-node-wrap.is-capture .game-preview-node-outer {
  fill: rgba(201, 74, 74, 0.2);
  stroke: rgba(255, 146, 120, 0.95);
  stroke-width: .92;
  filter: url(#gp-soft-glow);
}

.game-preview-node-wrap.is-capture .game-preview-node-inner {
  fill: rgba(255, 188, 170, 0.98);
}

.game-preview-node-wrap.is-capture {
  animation: gpPreviewCaptureNodeFlash 0.58s ease-out 1;
}

.game-preview-pieces {
  position: absolute;
  inset: 10px;
}

.game-preview-piece {
  position: absolute;
  width: 8.4%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(.72);
  opacity: 0;
  pointer-events: none;
  transition:
    left .78s cubic-bezier(.2,.7,.2,1),
    top .78s cubic-bezier(.2,.7,.2,1),
    transform .42s cubic-bezier(.25,.8,.25,1),
    opacity .32s ease,
    box-shadow .34s ease,
    filter .34s ease;
}

.game-preview-piece::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 130%;
  height: 130%;
  border-radius: 50%;
  border: 1.2px solid transparent;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.7);
}

.game-preview-root.is-gomoku .game-preview-piece {
  width: 7.2%;
}

.game-preview-root.is-gomoku .game-preview-node-outer {
  fill: rgba(14, 20, 28, 0.88);
  stroke: rgba(102, 121, 145, 0.22);
  stroke-width: .34;
}

.game-preview-root.is-gomoku .game-preview-node-inner {
  fill: rgba(178, 194, 212, 0.14);
}

.game-preview-piece.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.game-preview-piece.is-white {
  background: radial-gradient(circle at 34% 30%, #fff8ee 0%, #f2e7d7 48%, #dfcfb6 100%);
  border: 1px solid rgba(205, 188, 161, .95);
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
}

.game-preview-piece.is-black {
  background: radial-gradient(circle at 34% 30%, #3d3d44 0%, #1c1c21 50%, #09090b 100%);
  border: 1px solid rgba(8,8,10,.96);
  box-shadow: 0 1px 2px rgba(0,0,0,.28);
}

.game-preview-piece.is-active {
  filter: saturate(1.05);
}

.game-preview-piece.is-white.is-active {
  box-shadow:
    0 0 0 2px rgba(255,248,236,.10),
    0 0 10px rgba(255,236,207,.24),
    0 1px 2px rgba(0,0,0,.18);
}

.game-preview-piece.is-black.is-active {
  box-shadow:
    0 0 0 2px rgba(184,150,92,.08),
    0 0 10px rgba(184,150,92,.20),
    0 1px 2px rgba(0,0,0,.28);
}

.game-preview-piece.is-mill,
.game-preview-piece.is-win {
  box-shadow:
    0 0 0 2px rgba(184,150,92,.18),
    0 0 16px rgba(184,150,92,.44),
    0 0 22px rgba(184,150,92,.20),
    0 1px 2px rgba(0,0,0,.20);
  animation: gpPreviewMillPiecePulse 0.92s ease-in-out infinite;
}

.game-preview-piece.is-captured {
  box-shadow:
    0 0 0 2px rgba(236, 134, 111, 0.22),
    0 0 16px rgba(236, 134, 111, 0.34),
    0 0 26px rgba(184, 150, 92, 0.20);
  animation: gpPreviewCapturePiece 0.62s cubic-bezier(.2,.75,.2,1) forwards;
}

.game-preview-piece.is-captured::after {
  border-color: rgba(236, 146, 120, 0.92);
  animation: gpPreviewCaptureRing 0.58s ease-out forwards;
}

.game-preview-piece.is-reset-out {
  opacity: 0;
  transform: translate(-50%, -50%) scale(.72);
  filter: blur(0.45px);
  transition:
    transform .34s ease,
    opacity .3s ease,
    filter .3s ease;
}

.game-preview-fade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(180px 120px at 50% 50%, rgba(184,150,92,.07), transparent 72%),
    rgba(10,14,20,.0);
  opacity: 0;
  pointer-events: none;
  transition: opacity .42s ease;
}

.game-preview-root.is-resetting .game-preview-fade {
  opacity: 1;
}

.game-preview-root.is-placeholder .game-preview-shell {
  grid-template-rows: auto 1fr;
}

.game-preview-placeholder-card {
  min-height: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  border-radius: 10px;
  border: 1px dashed rgba(255,255,255,.08);
  background:
    radial-gradient(220px 120px at 84% 8%, rgba(184,150,92,.06), transparent 72%),
    rgba(255,255,255,.01);
  height: 100%;
}

.game-preview-placeholder-glyph {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--hub-rim-hi);
  background: var(--hub-surface-2);
  position: relative;
}

.game-preview-placeholder-glyph::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1.5px solid var(--hub-gold);
  border-radius: 4px;
}

.game-preview-placeholder-title {
  font-family: "Playfair Display", serif;
  color: var(--hub-chalk);
  font-size: 18px;
  line-height: 1.05;
}

.game-preview-placeholder-sub {
  color: var(--hub-stone);
  font-size: 12px;
  text-align: center;
  max-width: 28ch;
  line-height: 1.4;
}

.game-preview-placeholder-grid {
  width: min(160px, 80%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.game-preview-placeholder-grid span {
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
}

.game-preview-placeholder-grid span.active {
  border-color: rgba(184,150,92,.42);
  background: rgba(184,150,92,.10);
  box-shadow: 0 0 8px rgba(184,150,92,.14);
}

.hub-game-card {
  text-align: left;
  width: 100%;
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--hub-rim);
  background: var(--hub-bg);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.16s, background 0.16s, transform 0.12s;
  cursor: pointer;
  box-sizing: border-box;
}

.hub-game-card:hover {
  border-color: var(--hub-gold-dim);
  background: var(--hub-surface-2);
  transform: translateY(-1px);
}

.hub-game-card:disabled {
  opacity: 1;
  cursor: default;
}

.hub-game-card.active {
  border-color: var(--hub-gold);
  background:
    radial-gradient(220px 90px at 80% 0%, rgba(184, 150, 92, 0.08), transparent 70%),
    var(--hub-surface-2);
  box-shadow: inset 0 0 0 1px rgba(184, 150, 92, 0.12);
}

.hub-game-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hub-game-card strong {
  font-family: "Playfair Display", serif;
  font-weight: 500;
  font-size: 17px;
  color: var(--hub-chalk);
}

.hub-game-card > span {
  font-size: 13px;
  color: var(--hub-stone);
  line-height: 1.35;
}

.btn.btn-sm {
  padding: 8px 10px;
  font-size: 13px;
}

.badge {
  font-size: 12px;
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid var(--hub-rim);
  color: var(--hub-stone);
  background: var(--hub-surface);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.badge.good {
  border-color: rgba(78, 140, 100, 0.4);
  color: var(--hub-good);
  background: rgba(78, 140, 100, 0.08);
}

.badge.warn {
  border-color: rgba(184, 150, 92, 0.4);
  color: var(--hub-warn);
  background: rgba(184, 150, 92, 0.08);
}

.badge.bad {
  border-color: rgba(176, 64, 64, 0.4);
  color: #d07070;
  background: rgba(176, 64, 64, 0.08);
}

.shell-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--hub-surface);
  border: 1px solid var(--hub-rim);
  box-shadow: var(--hub-shadow-sm);
  box-sizing: border-box;
  position: sticky;
  top: 10px;
  z-index: 30;
}

.shell-head .brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.shell-head .brand > div:last-child {
  min-width: 0;
}

.shell-head .brand h1 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--hub-chalk);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shell-head .brand .sub {
  margin-top: 2px;
  color: var(--hub-stone);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--hub-surface-2);
  border: 1px solid var(--hub-rim-hi);
  position: relative;
  flex-shrink: 0;
}

.brand-logo.has-logo {
  padding: 4px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.brand-logo.has-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 4px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.28));
}

.brand-logo.has-logo::after {
  display: none;
}

.brand-logo::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 4px;
  border: 1.5px solid var(--hub-gold);
}

.shell-head-context {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.shell-marquee {
  min-width: 0;
  width: min(100%, 720px);
  border: 1px solid var(--hub-rim);
  border-radius: 8px;
  background: rgba(255,255,255,.01);
  overflow: hidden;
  box-sizing: border-box;
}

.shell-marquee-track {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  white-space: nowrap;
  padding: 6px 12px;
  will-change: transform;
  animation: shell-marquee-scroll 28s linear infinite;
}

.shell-marquee-item {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--hub-stone);
}

.shell-marquee-sep {
  color: var(--hub-gold-dim);
  font-size: 11px;
  opacity: .9;
}

@keyframes shell-marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-50% - 6px)); }
}

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

.shell-head-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 8px;
  margin-left: 2px;
  border-left: 1px solid var(--hub-rim);
  flex-wrap: wrap;
}

.shell-head-extra {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 8px;
  margin-left: 2px;
  border-left: 1px solid var(--hub-rim);
  flex-wrap: wrap;
}

.shell-head .btn {
  background: var(--hub-bg);
  border-color: var(--hub-rim);
  color: var(--hub-chalk);
}

.shell-head .btn:hover {
  border-color: var(--hub-rim-hi);
  background: var(--hub-surface-2);
}

.shell-head .btn.icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 8px;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}

.shell-head .btn.icon svg {
  display: block !important;
  width: 18px;
  height: 18px;
  margin: 0 !important;
  flex-shrink: 0;
}

.shell-head #btn-mute.btn.icon svg {
  width: 20px;
  height: 20px;
}

.loader {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(74, 163, 255, 0.2);
  border-top-color: var(--hub-gold);
  animation: hub-spin 0.8s linear infinite;
}

@keyframes hub-spin {
  to {
    transform: rotate(1turn);
  }
}

.overlay-screen-fade {
  animation: none;
}

@media (min-width: 981px) {
  /* Shared fixed bar readability across hub + games */
  .shell-head {
    min-height: clamp(64px, 6.2vh, 82px);
    padding: clamp(12px, 1.4vh, 18px) clamp(16px, 1.4vw, 24px);
    gap: clamp(10px, 0.9vw, 16px);
  }

  .shell-head .brand {
    gap: clamp(10px, 0.8vw, 14px);
  }

  .brand-logo {
    width: clamp(34px, 2.2vw, 42px);
    height: clamp(34px, 2.2vw, 42px);
    border-radius: clamp(8px, 0.5vw, 10px);
  }

  .brand-logo::after {
    inset: clamp(8px, 0.52vw, 10px);
  }

  .shell-head .brand h1 {
    font-size: clamp(18px, 1.08vw, 22px);
  }

  .shell-head .brand .sub {
    font-size: clamp(12px, 0.72vw, 14px);
  }

  .shell-head-context,
  .shell-head-actions {
    gap: clamp(8px, 0.6vw, 10px);
  }

  .shell-head-tools,
  .shell-head-extra {
    gap: clamp(6px, 0.45vw, 8px);
    padding-left: clamp(8px, 0.55vw, 10px);
  }

  .shell-head .btn {
    font-size: clamp(13px, 0.82vw, 15px);
    padding: clamp(8px, 0.55vw, 10px) clamp(10px, 0.7vw, 13px);
  }

  .shell-head .btn.icon {
    width: clamp(36px, 2.25vw, 42px);
    height: clamp(36px, 2.25vw, 42px);
    min-width: clamp(36px, 2.25vw, 42px);
    min-height: clamp(36px, 2.25vw, 42px);
  }

  .shell-head .btn.icon svg {
    width: clamp(18px, 1.05vw, 20px);
    height: clamp(18px, 1.05vw, 20px);
  }

  .shell-head #btn-mute.btn.icon svg {
    width: clamp(20px, 1.15vw, 22px);
    height: clamp(20px, 1.15vw, 22px);
  }

  /* Hub menu readability (accueil / online pages) */
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-shell {
    width: 95%;
    max-width: 95%;
    padding: clamp(18px, 1.6vw, 28px);
    gap: clamp(14px, 1.1vw, 22px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .screen-panel {
    border-radius: clamp(14px, 0.9vw, 18px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(380px, 0.95fr);
    min-height: clamp(560px, 64vh, 760px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card:first-child,
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card:last-child {
    padding: clamp(20px, 1.5vw, 28px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero-rules.prose {
    padding: clamp(16px, 1vw, 20px);
    gap: clamp(10px, 0.65vw, 12px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero-rules.prose p {
    font-size: clamp(14px, 0.86vw, 16px);
    line-height: 1.6;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero-rules.prose .hero-lead {
    font-size: clamp(15px, 0.98vw, 17px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-section-title {
    font-size: clamp(12px, 0.68vw, 13px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-game-grid {
    gap: clamp(12px, 0.8vw, 14px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-game-card {
    padding: clamp(12px, 0.8vw, 15px);
    gap: clamp(6px, 0.4vw, 8px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-game-card strong {
    font-size: clamp(17px, 1.02vw, 20px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-game-card > span {
    font-size: clamp(13px, 0.78vw, 14px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-list {
    gap: clamp(10px, 0.7vw, 12px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn {
    padding: clamp(16px, 1vw, 20px) clamp(18px, 1.1vw, 22px);
    gap: clamp(5px, 0.35vw, 7px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn strong {
    font-size: clamp(15px, 0.94vw, 18px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn span {
    font-size: clamp(13px, 0.78vw, 14px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .stats-pill {
    padding: clamp(14px, 1vw, 18px) clamp(10px, 0.8vw, 14px);
    font-size: clamp(12px, 0.7vw, 13px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .stats-pill b {
    font-size: clamp(24px, 1.5vw, 30px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-game-preview {
    height: clamp(240px, 31vw, 340px);
  }
}

/* Laptop readability boost (hub + shared fixed bar):
   increases text/button sizes without changing mobile or very large desktop layouts. */
@media (min-width: 981px) and (max-width: 1600px) {
  .shell-head {
    min-height: clamp(70px, 6.8vh, 86px);
    padding: clamp(14px, 1.6vh, 20px) clamp(18px, 1.6vw, 26px);
  }

  .shell-head .brand h1 {
    font-size: clamp(20px, 1.28vw, 25px);
  }

  .shell-head .brand .sub {
    font-size: clamp(13px, 0.88vw, 16px);
  }

  .shell-head .btn {
    font-size: clamp(15px, 0.98vw, 17px);
    padding: clamp(9px, 0.66vw, 12px) clamp(12px, 0.86vw, 15px);
  }

  .shell-head .btn.icon {
    width: clamp(38px, 2.35vw, 44px);
    height: clamp(38px, 2.35vw, 44px);
    min-width: clamp(38px, 2.35vw, 44px);
    min-height: clamp(38px, 2.35vw, 44px);
  }

  .shell-head .btn.icon svg {
    width: clamp(18px, 1.08vw, 21px);
    height: clamp(18px, 1.08vw, 21px);
  }

  .shell-head #btn-mute.btn.icon svg {
    width: clamp(20px, 1.18vw, 23px);
    height: clamp(20px, 1.18vw, 23px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-shell {
    padding: clamp(22px, 1.9vw, 32px);
    gap: clamp(16px, 1.2vw, 24px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero-rules.prose p {
    font-size: clamp(16px, 1vw, 19px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero-rules.prose .hero-lead {
    font-size: clamp(17px, 1.1vw, 20px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-section-title {
    font-size: clamp(12px, 0.72vw, 13px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-game-card strong {
    font-size: clamp(19px, 1.18vw, 23px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-game-card > span {
    font-size: clamp(14px, 0.88vw, 15px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn strong {
    font-size: clamp(17px, 1.08vw, 21px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn span {
    font-size: clamp(14px, 0.88vw, 15px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .stats-pill {
    font-size: clamp(13px, 0.8vw, 14px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .stats-pill b {
    font-size: clamp(28px, 1.72vw, 34px);
  }

  .game-preview-badge {
    font-size: 13px;
  }

  .game-preview-caption {
    font-size: 14px;
  }
}

/* Wide-screen typography growth:
   when the page is stretched horizontally, type keeps growing instead of
   stopping at the previous clamp maxima. */
@media (min-width: 1366px) {
  .shell-head .brand h1 {
    font-size: clamp(22px, 0.85vw + 8px, 30px);
  }

  .shell-head .brand .sub {
    font-size: clamp(13px, 0.45vw + 4px, 18px);
  }

  .shell-head .btn {
    font-size: clamp(15px, 0.42vw + 7px, 19px);
    padding: clamp(10px, 0.35vw + 4px, 13px) clamp(12px, 0.45vw + 5px, 16px);
  }

  .badge {
    font-size: clamp(13px, 0.34vw + 6px, 16px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero-rules.prose p {
    font-size: clamp(16px, 0.34vw + 9px, 20px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero-rules.prose .hero-lead {
    font-size: clamp(17px, 0.36vw + 10px, 22px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-game-card strong {
    font-size: clamp(19px, 0.46vw + 11px, 24px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-game-card > span {
    font-size: clamp(14px, 0.28vw + 8px, 17px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn strong {
    font-size: clamp(17px, 0.42vw + 10px, 22px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn span {
    font-size: clamp(14px, 0.28vw + 8px, 17px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .stats-pill {
    font-size: clamp(13px, 0.28vw + 7px, 16px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .stats-pill b {
    font-size: clamp(28px, 0.9vw + 12px, 40px);
  }

  .game-preview-badge {
    font-size: clamp(12px, 0.26vw + 6px, 15px);
  }

  .game-preview-caption {
    font-size: clamp(13px, 0.28vw + 7px, 16px);
  }
}

/* Laptop comfort override (hub only):
   higher minimum font sizes for 13"-16" laptops where CSS pixels look small,
   without changing game screens. */
@media (min-width: 981px) and (max-width: 1600px) {
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head {
    min-height: clamp(74px, 7.1vh, 90px);
    padding: clamp(15px, 1.7vh, 21px) clamp(20px, 1.7vw, 28px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head .brand h1 {
    font-size: clamp(22px, 1.36vw, 27px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head .brand .sub {
    font-size: clamp(14px, 0.92vw, 17px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head .btn {
    font-size: clamp(16px, 1.04vw, 18px);
    padding: clamp(10px, 0.72vw, 12px) clamp(13px, 0.92vw, 16px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head .btn.icon {
    width: clamp(40px, 2.45vw, 46px);
    height: clamp(40px, 2.45vw, 46px);
    min-width: clamp(40px, 2.45vw, 46px);
    min-height: clamp(40px, 2.45vw, 46px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card:first-child .hero h2 {
    font-size: clamp(46px, 3.45vw, 70px);
    line-height: 1.08;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-card h2 {
    font-size: clamp(30px, 2.1vw, 40px);
    line-height: 1.12;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero-rules.prose {
    padding: clamp(18px, 1.1vw, 24px);
    gap: clamp(12px, 0.72vw, 14px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero-rules.prose p {
    font-size: clamp(17px, 1.04vw, 20px);
    line-height: 1.62;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero-rules.prose .hero-lead {
    font-size: clamp(18px, 1.12vw, 22px);
    line-height: 1.62;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-section-title {
    font-size: clamp(13px, 0.8vw, 15px);
    letter-spacing: 0.07em;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-game-card {
    padding: clamp(14px, 0.9vw, 18px);
    gap: clamp(8px, 0.45vw, 10px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-game-card strong {
    font-size: clamp(20px, 1.22vw, 24px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-game-card > span {
    font-size: clamp(15px, 0.92vw, 16px);
    line-height: 1.35;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn {
    padding: clamp(18px, 1.08vw, 22px) clamp(20px, 1.2vw, 24px);
    gap: clamp(7px, 0.42vw, 9px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn strong {
    font-size: clamp(18px, 1.12vw, 22px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn span {
    font-size: clamp(15px, 0.92vw, 16px);
    line-height: 1.38;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .stats-pill {
    font-size: clamp(14px, 0.84vw, 15px);
    padding: clamp(16px, 1.08vw, 20px) clamp(12px, 0.9vw, 16px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .stats-pill b {
    font-size: clamp(30px, 1.84vw, 36px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-badge {
    font-size: clamp(13px, 0.8vw, 15px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-caption {
    font-size: clamp(14px, 0.88vw, 16px);
  }
}

/* Desktop/laptop hub layout:
   let the game preview fill the remaining vertical space between
   "Choisir un jeu" and the bottom stats strip. */
@media (min-width: 981px) {
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .app.menu-app {
    height: 100dvh;
    min-height: 100dvh;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-shell {
    height: 100dvh;
    min-height: 100dvh;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .screen-panel {
    min-height: 0;
    height: 100%;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid {
    min-height: 0;
    height: 100%;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card {
    min-height: 0;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card.hero {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    align-content: stretch;
    min-height: 0;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card.hero > :first-child {
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    align-content: start;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card.hero .hub-games-block {
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    align-content: stretch;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card.hero .hub-preview-block {
    min-height: 0;
    display: grid;
    margin-top: 2px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card.hero .hub-game-preview {
    height: 100%;
    min-height: clamp(140px, 14vh, 320px);
    max-height: none;
  }
}

/* Short-height desktop/laptop fit:
   preserve the no-scroll layout by easing spacing and preview chrome first,
   while keeping the preview-fills-the-rest behavior. */
@media (min-width: 981px) and (max-height: 980px) {
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-shell {
    padding-top: clamp(14px, 1.2vh, 20px);
    padding-bottom: clamp(14px, 1.2vh, 20px);
    gap: clamp(10px, 1vh, 14px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card:first-child,
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card:last-child {
    padding: clamp(14px, 1vw, 20px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero-rules.prose {
    margin-top: 10px;
    padding: clamp(12px, 0.9vw, 16px);
    gap: 8px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-games-block {
    margin-top: 14px;
    gap: 10px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-shell {
    padding: 10px;
    gap: 6px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-caption {
    line-height: 1.25;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .stats-strip {
    margin-top: 10px;
  }
}

/* Compact hub for short laptop windows:
   reduce typography + paddings across the whole hub so everything fits in one
   screen without scroll while preserving the same layout. */
@media (min-width: 981px) and (max-height: 900px) {
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head {
    min-height: 64px;
    padding: 10px 16px;
    gap: 10px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head .brand h1 {
    font-size: clamp(18px, 1vw, 22px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head .brand .sub {
    font-size: clamp(11px, 0.72vw, 13px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head .btn {
    font-size: clamp(13px, 0.8vw, 15px);
    padding: 8px 10px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head .btn.icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-shell {
    padding: 10px 16px 12px;
    gap: 16px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid {
    min-height: 0;
    grid-template-columns: minmax(0, 1.34fr) minmax(320px, 0.9fr);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card:first-child,
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card:last-child {
    padding: 14px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card:first-child .hero h2 {
    font-size: clamp(34px, 2.1vw, 42px);
    line-height: 1.08;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-card h2 {
    font-size: clamp(20px, 1.28vw, 26px);
    line-height: 1.12;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero-rules.prose {
    margin-top: 8px;
    padding: 10px 12px;
    gap: 6px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero-rules.prose p {
    font-size: clamp(13px, 0.78vw, 15px);
    line-height: 1.45;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero-rules.prose .hero-lead {
    font-size: clamp(14px, 0.85vw, 16px);
    line-height: 1.48;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-games-block {
    margin-top: 10px;
    gap: 8px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-section-title {
    font-size: 11px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-game-grid {
    gap: 8px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-game-card {
    padding: 10px 12px;
    gap: 4px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-game-card strong {
    font-size: clamp(16px, 0.96vw, 19px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-game-card > span {
    font-size: clamp(12px, 0.72vw, 13px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-list {
    gap: 8px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn {
    padding: 12px 14px;
    gap: 4px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn strong {
    font-size: clamp(15px, 0.92vw, 18px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn span,
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .small {
    font-size: clamp(12px, 0.74vw, 14px);
    line-height: 1.3;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .divider {
    margin: 10px 0;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card.hero .hub-game-preview {
    min-height: clamp(92px, 10vh, 180px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-shell {
    padding: 8px;
    gap: 4px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-badge {
    font-size: 10px;
    padding: 3px 8px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-caption {
    font-size: 11px;
    line-height: 1.15;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .stats-strip {
    margin-top: 8px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .stats-pill {
    padding: 10px 8px;
    font-size: 11px;
    gap: 1px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .stats-pill b {
    font-size: clamp(22px, 1.4vw, 28px);
  }
}

/* Ultra-compact hub (very short laptop windows) */
@media (min-width: 981px) and (max-height: 780px) {
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-shell {
    padding-top: 8px;
    padding-bottom: 10px;
    gap: 14px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card:first-child,
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card:last-child {
    padding: 12px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero-rules.prose {
    padding: 8px 10px;
    gap: 5px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero-rules.prose p {
    font-size: 12px;
    line-height: 1.34;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero-rules.prose .hero-lead {
    font-size: 13px;
    line-height: 1.38;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn {
    padding: 10px 12px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn strong {
    font-size: 14px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn span {
    font-size: 12px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-caption {
    display: none;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card.hero .hub-game-preview {
    min-height: clamp(74px, 8vh, 140px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .stats-pill {
    padding: 8px 6px;
    font-size: 10px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .stats-pill b {
    font-size: clamp(18px, 1.22vw, 24px);
  }
}

@media (max-width: 980px) {
  .menu-shell {
    padding: 10px;
    gap: 10px;
  }

  .menu-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .menu-grid > .menu-card:first-child,
  .menu-grid > .menu-card:last-child {
    border: none;
    border-radius: 0;
    padding: 14px;
  }

  .hub-game-grid {
    grid-template-columns: 1fr;
  }

  .hub-game-preview {
    height: 230px;
  }

  .game-preview-shell {
    padding: 10px;
    gap: 7px;
  }

  .game-preview-board-wrap {
    width: min(100%, 210px);
  }

  .hero-rules.prose {
    margin-top: 12px;
    padding: 14px;
  }

  .hub-games-block {
    margin-top: 16px;
    gap: 10px;
  }

  .shell-head {
    grid-template-columns: 1fr;
    align-items: stretch;
    top: 8px;
  }

  .shell-head-context {
    justify-content: flex-start;
  }

  .shell-head-actions {
    justify-content: space-between;
  }

  .shell-head-tools,
  .shell-head-extra {
    border-left: none;
    padding-left: 0;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app,
  .menu-shell,
  .overlay-screen-fade,
  .screen-panel.overlay-screen-fade {
    animation: none !important;
  }

  .mode-btn,
  .hub-game-card {
    transition: none !important;
  }

  .loader {
    animation: none !important;
  }

  .shell-marquee-track {
    animation: none !important;
    transform: none !important;
  }
}

/* ==========================================================================
   Hub Light Mode Rewrite (menu / online screens only)
   Rebuilt from scratch with the same premium "paper / ivory / brass" philosophy
   used for the refreshed Gomoku light mode.
   ========================================================================== */
:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) {
  --hub-l-paper: #f3e8d6;
  --hub-l-paper-deep: #ead9bf;
  --hub-l-surface: #f8f0e3;
  --hub-l-surface-2: #f2e5d3;
  --hub-l-surface-3: #ecdcc5;
  --hub-l-gomoku-board: #f0e2cc;
  --hub-l-line: rgba(137, 102, 53, 0.22);
  --hub-l-line-strong: rgba(137, 102, 53, 0.36);
  --hub-l-line-soft: rgba(137, 102, 53, 0.14);
  --hub-l-ink: #201c17;
  --hub-l-ink-dim: #4f463b;
  --hub-l-muted: #786d5d;
  --hub-l-accent: #a97836;
  --hub-l-accent-soft: rgba(169, 120, 54, 0.14);
  --hub-l-good: #2f7e58;
  --hub-l-warn: #926628;
  --hub-l-bad: #b44f4f;
  --hub-l-shadow-lg:
    0 18px 40px rgba(82, 57, 25, 0.10),
    0 2px 8px rgba(82, 57, 25, 0.05);
  --hub-l-shadow-sm:
    0 10px 22px rgba(82, 57, 25, 0.08),
    0 1px 4px rgba(82, 57, 25, 0.04);

  --hub-bg: var(--hub-l-paper);
  --hub-surface: var(--hub-l-surface);
  --hub-surface-2: var(--hub-l-surface-2);
  --hub-rim: var(--hub-l-line);
  --hub-rim-hi: var(--hub-l-line-strong);
  --hub-shadow: var(--hub-l-shadow-lg);
  --hub-shadow-sm: var(--hub-l-shadow-sm);
  --hub-chalk: var(--hub-l-ink);
  --hub-chalk-dim: var(--hub-l-ink-dim);
  --hub-stone: var(--hub-l-muted);
  --hub-gold: var(--hub-l-accent);
  --hub-gold-dim: rgba(169, 120, 54, 0.58);
  --hub-good: var(--hub-l-good);
  --hub-warn: var(--hub-l-warn);

  color-scheme: light;
  background:
    radial-gradient(900px 420px at 88% -6%, rgba(169, 120, 54, 0.12), transparent 62%),
    radial-gradient(560px 340px at 10% 100%, rgba(63, 126, 196, 0.05), transparent 62%),
    linear-gradient(180deg, #f8f0e2 0%, #f3e8d6 50%, #efddc3 100%);
  color: var(--hub-l-ink);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-shell {
  background: transparent;
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .screen-panel {
  background: var(--hub-l-gomoku-board);
  border-color: rgba(137, 102, 53, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.82),
    inset 0 0 0 1px rgba(255,255,255,.15),
    var(--hub-shadow);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-card {
  border-color: rgba(137, 102, 53, 0.18);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card:first-child {
  border-right-color: rgba(137, 102, 53, 0.22);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card:last-child {
  background:
    linear-gradient(180deg, rgba(255,255,255,.15), rgba(255,255,255,0)),
    transparent;
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero {
  background:
    radial-gradient(620px 260px at 62% 0%, rgba(169, 120, 54, 0.11), transparent 65%),
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0)),
    transparent;
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero h2 {
  color: var(--hub-l-ink);
  text-shadow: 0 1px 0 rgba(255,255,255,.50);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-card h2 {
  color: var(--hub-l-ink);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero-rules.prose {
  background:
    radial-gradient(460px 170px at 80% 0%, rgba(169,120,54,.10), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,.32), rgba(255,255,255,.10)),
    rgba(247, 239, 225, .35);
  border: none;
  box-shadow: none;
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero-rules.prose p {
  color: #53493d;
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero-rules.prose .hero-lead {
  color: var(--hub-l-ink);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-section-title {
  color: #726657;
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .stats-strip {
  border-color: rgba(137, 102, 53, 0.22);
  background: rgba(137, 102, 53, 0.10);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.68),
    inset 0 -1px 0 rgba(137, 102, 53, 0.04);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-game-preview {
  border-color: rgba(137, 102, 53, 0.24);
  background:
    radial-gradient(340px 150px at 82% 0%, rgba(169,120,54,.10), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,.25), rgba(255,255,255,.08)),
    rgba(240,226,204,.34);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.62),
    0 1px 2px rgba(82, 57, 25, .03);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-badge {
  border-color: rgba(137, 102, 53, 0.22);
  background: rgba(255,255,255,.48);
  color: #6f6456;
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-caption {
  color: #73685a;
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-board-wrap {
  border-color: rgba(188,164,131,.38);
  background: #f0e2cc;
  box-shadow:
    0 1px 0 rgba(255,255,255,.76) inset,
    0 16px 28px rgba(88,67,38,.10),
    0 3px 9px rgba(88,67,38,.05);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-board-wrap::before {
  background:
    radial-gradient(180px 110px at 82% 8%, rgba(169,120,54,.10), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,.22), transparent 40%);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-line {
  stroke: #a89679;
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-line.is-mill {
  stroke: rgba(173,129,64,.98);
  filter: url(#gp-soft-glow) drop-shadow(0 0 3px rgba(169,120,54,.32));
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-gk-grid-line {
  stroke: rgba(155, 133, 102, .52);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-gk-star {
  fill: rgba(149, 120, 73, .46);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-gk-win-line.is-win {
  stroke: rgba(173,129,64,.98);
  filter: url(#gp-soft-glow) drop-shadow(0 0 3px rgba(169,120,54,.28));
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-node-outer {
  fill: rgba(234,221,200,.92);
  stroke: rgba(188,164,131,.70);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-node-wrap.is-mill .game-preview-node-outer,
:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-node-wrap.is-win .game-preview-node-outer {
  fill: rgba(173,129,64,.14);
  stroke: rgba(173,129,64,.88);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-node-inner {
  fill: rgba(140, 120, 88, .48);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-node-wrap.is-mill .game-preview-node-inner,
:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-node-wrap.is-win .game-preview-node-inner {
  fill: rgba(173,129,64,.95);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-root.is-gomoku .game-preview-node-outer {
  fill: rgba(233,221,200,.68);
  stroke: rgba(188,164,131,.34);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-root.is-gomoku .game-preview-node-inner {
  fill: rgba(146, 124, 91, .22);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-node-wrap.is-capture .game-preview-node-outer {
  fill: rgba(191, 84, 66, .14);
  stroke: rgba(210, 98, 78, .88);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-node-wrap.is-capture .game-preview-node-inner {
  fill: rgba(220, 124, 103, .94);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-piece.is-white {
  background: radial-gradient(circle at 34% 30%, #fff8ee 0%, #f4eadb 48%, #dfcfb6 100%);
  border-color: rgba(205, 188, 161, .95);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-piece.is-black {
  background: radial-gradient(circle at 34% 30%, #34343a 0%, #1c1c20 54%, #09090a 100%);
  border-color: rgba(8,8,9,.96);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-piece.is-mill,
:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-piece.is-win {
  box-shadow:
    0 0 0 2px rgba(173,129,64,.16),
    0 0 14px rgba(173,129,64,.32),
    0 0 22px rgba(173,129,64,.14),
    0 1px 2px rgba(0,0,0,.12);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-piece.is-captured {
  box-shadow:
    0 0 0 2px rgba(210, 108, 88, 0.16),
    0 0 14px rgba(210, 108, 88, 0.24),
    0 0 18px rgba(173,129,64,.14);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-piece.is-captured::after {
  border-color: rgba(210, 108, 88, 0.82);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-fade {
  background:
    radial-gradient(180px 120px at 50% 50%, rgba(169,120,54,.10), transparent 72%),
    rgba(240,226,204,.0);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-placeholder-card {
  border-color: rgba(137, 102, 53, .18);
  background:
    radial-gradient(220px 120px at 84% 8%, rgba(169,120,54,.08), transparent 72%),
    rgba(255,255,255,.22);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-placeholder-glyph {
  background: linear-gradient(180deg, #f7efe1, #efe1c9);
  border-color: rgba(188,164,131,.40);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-placeholder-glyph::after {
  border-color: rgba(169,120,54,.86);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-placeholder-title {
  color: #201c17;
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-placeholder-sub {
  color: #6f6455;
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-placeholder-grid span {
  border-color: rgba(137,102,53,.18);
  background: rgba(255,255,255,.34);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-placeholder-grid span.active {
  border-color: rgba(169,120,54,.34);
  background: rgba(169,120,54,.12);
  box-shadow: 0 0 8px rgba(169,120,54,.12);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .stats-pill {
  background:
    linear-gradient(180deg, rgba(255,255,255,.78), rgba(243,231,214,.92));
  color: #6d6254;
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .stats-pill b {
  color: #a26f2a;
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn,
:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-game-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.74), rgba(244,233,218,.92));
  border-color: rgba(137, 102, 53, 0.20);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.76),
    0 1px 2px rgba(82, 57, 25, 0.03);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn:hover:not(:disabled),
:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-game-card:hover {
  border-color: rgba(169, 120, 54, 0.38);
  background:
    radial-gradient(260px 120px at 92% 0%, rgba(169,120,54,.11), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,.88), rgba(245,235,220,.98));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.86),
    0 6px 14px rgba(82, 57, 25, 0.06);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-game-card.active {
  border-color: rgba(169, 120, 54, 0.55);
  background:
    radial-gradient(260px 120px at 88% 0%, rgba(169,120,54,.14), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(245,234,218,.97));
  box-shadow:
    inset 0 0 0 1px rgba(169,120,54,.12),
    inset 0 1px 0 rgba(255,255,255,.86),
    0 8px 16px rgba(82, 57, 25, 0.07);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn strong,
:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-game-card strong {
  color: var(--hub-l-ink);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn span,
:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hub-game-card > span {
  color: #6c6152;
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .badge {
  background:
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(244,233,218,.88));
  border-color: rgba(137, 102, 53, 0.22);
  color: #675b4d;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .badge.good {
  border-color: rgba(47, 126, 88, 0.28);
  background: rgba(47, 126, 88, 0.08);
  color: #2c7854;
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .badge.warn {
  border-color: rgba(169, 120, 54, 0.28);
  background: rgba(169, 120, 54, 0.10);
  color: #875f24;
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .badge.bad {
  border-color: rgba(180, 79, 79, 0.28);
  background: rgba(180, 79, 79, 0.08);
  color: #a24545;
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-shell .divider {
  border-color: rgba(137, 102, 53, 0.18);
  background: rgba(137, 102, 53, 0.14);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-shell .small {
  color: #6f6355;
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-shell .btn {
  background:
    linear-gradient(180deg, rgba(255,255,255,.82), rgba(244,233,218,.95));
  border-color: rgba(137, 102, 53, 0.24);
  color: var(--hub-l-ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-shell .btn:hover {
  border-color: rgba(169, 120, 54, 0.34);
  background:
    radial-gradient(220px 80px at 90% 0%, rgba(169,120,54,.10), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(246,236,222,.98));
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-shell .btn.good {
  border-color: rgba(47, 126, 88, 0.30);
  color: #266d4c;
  background:
    linear-gradient(180deg, rgba(255,255,255,.78), rgba(234,247,239,.92));
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head {
  background: var(--hub-l-gomoku-board);
  border-color: rgba(137, 102, 53, 0.26);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.86),
    inset 0 0 0 1px rgba(255,255,255,.12),
    var(--hub-shadow-sm);
  backdrop-filter: blur(10px) saturate(1.05);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head .brand h1 {
  color: var(--hub-l-ink);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head .brand .sub {
  color: #766b5c;
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .brand-logo {
  background:
    linear-gradient(180deg, rgba(255,255,255,.78), rgba(239,224,202,.92));
  border-color: rgba(137, 102, 53, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.78),
    0 1px 2px rgba(82, 57, 25, 0.04);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .brand-logo::after {
  border-color: rgba(169, 120, 54, 0.88);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head-tools,
:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head-extra {
  border-left-color: rgba(137, 102, 53, 0.18);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head .btn {
  background:
    linear-gradient(180deg, rgba(255,255,255,.84), rgba(244,233,218,.95));
  border-color: rgba(137, 102, 53, 0.24);
  color: var(--hub-l-ink);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.82),
    0 1px 1px rgba(82, 57, 25, 0.03);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head .btn:hover {
  border-color: rgba(169, 120, 54, 0.34);
  background:
    radial-gradient(180px 70px at 92% 0%, rgba(169,120,54,.10), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(246,236,222,.98));
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head .btn.icon.sel {
  border-color: rgba(63, 126, 196, 0.34);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.82),
    inset 0 0 0 2px rgba(63, 126, 196, 0.12);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .loader {
  border-color: rgba(169, 120, 54, 0.18);
  border-top-color: rgba(169, 120, 54, 0.92);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-marquee {
  border-color: rgba(137, 102, 53, 0.18);
  background: rgba(255,255,255,.28);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-marquee-item {
  color: #6f6457;
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-marquee-sep {
  color: rgba(169, 120, 54, 0.72);
}

/* Mobile polish for the rebuilt hub light mode */
@media (max-width: 980px) {
  :root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .screen-panel {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.78),
      0 14px 24px rgba(82, 57, 25, 0.08);
  }

  :root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head {
    background: var(--hub-l-gomoku-board);
  }
}

/* ==========================================================================
   Hub game selection focus (selection should stand out first)
   ========================================================================== */
body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-games-block {
  margin-top: 16px;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(184, 150, 92, 0.18);
  background:
    radial-gradient(320px 130px at 88% 0%, rgba(184, 150, 92, 0.08), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,.012), rgba(255,255,255,.003));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.02),
    0 8px 22px rgba(0,0,0,.14);
}

body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-section-title {
  color: var(--hub-chalk-dim);
  font-size: 11px;
  letter-spacing: 0.09em;
  margin-bottom: 2px;
}

body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-game-grid {
  gap: 14px;
}

body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-game-card {
  min-height: 74px;
  border-width: 1px;
  border-color: rgba(255,255,255,.08);
  background:
    radial-gradient(240px 90px at 92% 0%, rgba(255,255,255,.02), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,.012), rgba(255,255,255,.003)),
    var(--hub-bg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.015);
}

body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-game-card:hover:not(:disabled) {
  border-color: rgba(184, 150, 92, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.02),
    0 8px 18px rgba(0,0,0,.12);
}

body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-game-card.active {
  border-color: rgba(184, 150, 92, 0.52);
  background:
    radial-gradient(240px 90px at 84% 0%, rgba(184,150,92,.11), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.005)),
    var(--hub-surface-2);
  box-shadow:
    inset 0 0 0 1px rgba(184,150,92,.12),
    0 0 0 1px rgba(184,150,92,.09);
}

body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-game-card strong {
  font-size: 17px;
}

body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-preview-block {
  margin-top: 6px;
}

@media (max-width: 980px) {
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-games-block {
    padding: 12px;
    margin-top: 12px;
    margin-bottom: 12px;
  }
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-game-card {
    min-height: 68px;
  }
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-games-block {
  border-color: rgba(169, 120, 54, 0.20);
  background:
    radial-gradient(320px 130px at 88% 0%, rgba(169,120,54,.10), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,.42));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.88),
    0 10px 18px rgba(82, 57, 25, 0.06);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-game-card {
  border-color: rgba(137, 102, 53, 0.20);
  background:
    radial-gradient(220px 80px at 92% 0%, rgba(169,120,54,.05), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,.82), rgba(246,236,222,.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82);
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-game-card.active {
  border-color: rgba(169, 120, 54, 0.34);
  background:
    radial-gradient(220px 80px at 86% 0%, rgba(169,120,54,.10), transparent 72%),
    linear-gradient(180deg, rgba(255,255,255,.9), rgba(243,231,214,.98));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.9),
    inset 0 0 0 1px rgba(169,120,54,.08);
}

/* ==========================================================================
   Hub order tuning (selection -> paragraphs -> preview)
   Keep preview large and reduce paragraph footprint.
   ========================================================================== */
body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card.hero > :first-child {
  grid-template-rows: auto auto auto minmax(0, 1fr);
  row-gap: 10px;
}

body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card.hero .hub-games-block {
  grid-template-rows: auto auto;
  align-content: start;
}

body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-games-block {
  margin-top: 0;
  margin-bottom: 0;
}

body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hero-rules.prose {
  margin-top: 0;
  padding: 9px 12px;
  gap: 6px;
}

body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hero-rules.prose p {
  line-height: 1.38;
}

body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hero-rules.prose .hero-lead {
  line-height: 1.42;
}

body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-preview-block {
  min-height: 0;
  display: grid;
  margin-top: 0;
  align-content: stretch;
}

body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-game-preview {
  height: 100%;
  min-height: clamp(240px, 30vh, 440px);
  max-height: none;
}

@media (min-width: 981px) and (max-height: 980px) {
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card.hero > :first-child {
    row-gap: 8px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hero-rules.prose {
    margin-top: 0;
    padding: 8px 10px;
    gap: 5px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-preview-block {
    margin-top: 0;
  }
}

@media (max-width: 980px) {
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card.hero > :first-child {
    row-gap: 12px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hero-rules.prose {
    margin-top: 0;
    padding: 12px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-preview-block {
    margin-top: 0;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-game-preview {
    min-height: 210px;
  }
}

/* ==========================================================================
   Hub block contour cleanup (selection / paragraphs / preview)
   ========================================================================== */
body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero {
  background: transparent !important;
  background-image: none !important;
}

body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-games-block,
body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hero-rules.prose,
body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-game-preview {
  border: none !important;
  box-shadow: none !important;
}

body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-games-block,
body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hero-rules.prose,
body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-game-preview {
  background: var(--hub-surface) !important;
  background-image: none !important;
}

body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-preview-block,
body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-game-preview {
  background: transparent !important;
  background-image: none !important;
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-games-block,
:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hero-rules.prose,
:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-game-preview {
  background: var(--hub-l-gomoku-board) !important;
  background-image: none !important;
}

:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-preview-block,
:root[data-theme="light"] body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-game-preview {
  background: transparent !important;
  background-image: none !important;
}

/* ==========================================================================
   Hub previews: hide preview badge/caption (Moulin + Gomoku)
   ========================================================================== */
body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-root.is-moulin .game-preview-badge,
body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-root.is-moulin .game-preview-caption,
body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-root.is-gomoku .game-preview-badge,
body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-root.is-gomoku .game-preview-caption {
  display: none !important;
}

body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-root.is-moulin .game-preview-shell,
body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-root.is-gomoku .game-preview-shell {
  grid-template-rows: 1fr !important;
  gap: 0 !important;
  padding: 8px !important;
}

/* ==========================================================================
   Mobile UX Overhaul (Hub / shared hub shell)
   Goal: tactile, readable, no accidental overflow, keeps premium style.
   ========================================================================== */
@media (max-width: 980px) {
  :root {
    --alignora-safe-x: max(env(safe-area-inset-left), env(safe-area-inset-right));
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .app.menu-app,
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-shell,
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .screen-panel {
    width: min(100%, calc(100dvw - var(--alignora-safe-x) - var(--alignora-safe-x)));
    max-width: min(100%, calc(100dvw - var(--alignora-safe-x) - var(--alignora-safe-x)));
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .app.menu-app {
    justify-items: stretch !important;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-shell {
    width: 100%;
    max-width: 100%;
    min-height: 100dvh;
    padding:
      max(8px, env(safe-area-inset-top))
      max(10px, var(--alignora-safe-x))
      max(12px, env(safe-area-inset-bottom))
      max(10px, var(--alignora-safe-x));
    gap: 12px;
    box-sizing: border-box;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .screen-panel {
    min-width: 0;
    min-height: 0;
    border-radius: 12px;
    overflow: hidden;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card:first-child,
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card:last-child {
    border: none;
    border-radius: 0;
    padding: 14px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card.hero > :first-child {
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    row-gap: 12px !important;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero h2 {
    font-size: clamp(28px, 8vw, 42px);
    line-height: 1.08;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-games-block {
    margin: 0;
    padding: 12px;
    border-radius: 12px;
    gap: 10px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-section-title {
    font-size: 11px;
    letter-spacing: 0.08em;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-game-card {
    min-height: 74px;
    padding: 12px;
    gap: 5px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-game-card strong {
    font-size: 16px;
    line-height: 1.15;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hero-rules.prose {
    margin-top: 0;
    padding: 12px;
    gap: 8px;
    border-radius: 12px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hero-rules.prose p {
    font-size: 13px;
    line-height: 1.44;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hero-rules.prose .hero-lead {
    font-size: 14px;
    line-height: 1.46;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-preview-block {
    min-height: 0;
    margin-top: 0;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-game-preview {
    min-height: clamp(200px, 28vh, 360px);
    height: auto;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-shell {
    padding: 8px !important;
    gap: 0 !important;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-board-stage {
    min-height: 0;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .game-preview-board-wrap {
    width: min(100%, 340px);
    max-width: 100%;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .stats-strip {
    margin-top: 10px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .stats-pill {
    padding: 10px 8px;
    font-size: 10px;
    gap: 3px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .stats-pill b {
    font-size: clamp(18px, 5vw, 24px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-list {
    gap: 8px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn {
    min-height: 64px;
    padding: 14px;
    gap: 6px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn strong {
    font-size: 16px;
    line-height: 1.15;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn span {
    font-size: 13px;
    line-height: 1.34;
  }

  /* Shared header on hub screens: single-column stack + touch-friendly controls */
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
    top: calc(env(safe-area-inset-top) + 6px);
    padding: 12px;
    min-height: 0;
    border-radius: 12px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head .brand {
    gap: 10px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 9px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head .brand h1 {
    font-size: 19px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head .brand .sub {
    font-size: 12px;
    line-height: 1.24;
    letter-spacing: 0.02em;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head-context {
    width: 100%;
    justify-content: flex-start;
    min-height: 0;
    gap: 8px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head-context:empty {
    display: none;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-marquee {
    width: 100%;
    max-width: none;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-marquee-track {
    padding: 7px 10px;
    gap: 10px;
    animation-duration: 34s;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-marquee-item {
    font-size: 11px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head .btn {
    min-height: 42px;
    font-size: 14px;
    padding: 10px 12px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head .btn.icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head-extra {
    order: 2;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: 8px;
    border-left: none;
    padding-left: 0;
    margin-left: 0;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head-extra .btn {
    width: 100%;
    justify-content: center;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head-tools {
    order: 3;
    margin-left: auto;
    border-left: none;
    padding-left: 0;
  }
}

@media (max-width: 700px) {
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-game-grid {
    grid-template-columns: 1fr;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card:first-child,
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card:last-child {
    padding: 12px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero h2 {
    font-size: clamp(26px, 9.2vw, 36px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-game-card {
    min-height: 68px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-game-preview {
    min-height: clamp(180px, 25vh, 280px);
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .stats-strip {
    grid-template-columns: 1fr;
    gap: 1px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .stats-pill {
    grid-template-columns: 1fr;
    align-items: center;
    padding: 10px 10px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head-actions {
    gap: 6px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head-extra {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-shell {
    gap: 10px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head {
    padding: 10px;
    gap: 8px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head .brand h1 {
    font-size: 18px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head .brand .sub {
    font-size: 11px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head .btn {
    min-height: 40px;
    font-size: 13px;
    padding: 9px 11px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head .btn.icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .shell-head-tools {
    gap: 4px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn {
    padding: 12px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn strong {
    font-size: 15px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .mode-btn span,
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hero-rules.prose p {
    font-size: 12px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hero-rules.prose .hero-lead {
    font-size: 13px;
  }
}

@media (max-width: 980px) and (max-height: 760px) {
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-shell {
    gap: 10px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card:first-child,
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .menu-grid > .menu-card:last-child {
    padding: 12px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-games-block,
  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hero-rules.prose {
    padding: 10px;
  }

  body:is([data-screen="menu"], [data-screen="online-home"], [data-screen="online-lobby"]) .hero .hub-game-preview {
    min-height: clamp(150px, 20vh, 220px);
  }
}
