/* ==========================================================================
   BASTION & STEEL (حُصون وفولاذ) — AAA War-Room Client Stylesheet
   Full-Bleed 3D Tabletop Perspective, Chamfered Damascus Steel & Brass HUD,
   Curved Hand Fan, and Physics-Based Motion
   ========================================================================== */

:root {
  color-scheme: dark;
  --in-oklab: ;
  --in-oklch: ;
  --target-size: 24px;

  /* Physics-Based Spring Easing (MANDATORY: paired with explicit duration) */
  --spring-duration: 520ms;
  --spring-easing: linear(
    0, 0.009, 0.035 2.1%, 0.141, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%,
    1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%,
    1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%,
    0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1.004 83.8%, 1
  );

  --bg-abyss: #03050a;
  --bg-obsidian: #080c17;
  --bg-gunmetal: #0f172a;
  --bg-slate-elevated: #1e293b;

  --brass-dim: rgba(217, 119, 6, 0.42);
  --brass-mid: #d97706;
  --brass-bright: #fbbf24;
  --brass-gleam: #fef08a;

  --steel-border: rgba(148, 163, 184, 0.28);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  /* Coherent Damascus Steel & Burnished Brass Scrollbar Palette (>6:1 contrast) */
  --scrollbar-thumb: #d97706;
  --scrollbar-track: #070b14;

  /* Authentic AAA Arabic & Tactical Fonts */
  --font-ui: 'Readex Pro', system-ui, -apple-system, sans-serif;
  --font-heading: 'Changa', 'Cinzel', sans-serif;
  --font-display: 'Cinzel', 'Changa', Georgia, serif;
  --font-tactical: 'Chakra Petch', 'Changa', ui-monospace, monospace;

  /* Chamfered Polygon Clips for Non-Website Diegetic Game HUD */
  --clip-panel: polygon(
    12px 0, calc(100% - 12px) 0, 100% 12px,
    100% calc(100% - 12px), calc(100% - 12px) 100%,
    12px 100%, 0 calc(100% - 12px), 0 12px
  );
  --clip-btn: polygon(
    8px 0, calc(100% - 8px) 0, 100% 8px,
    100% calc(100% - 8px), calc(100% - 8px) 100%,
    8px 100%, 0 calc(100% - 8px), 0 8px
  );
  --clip-card: polygon(
    6px 0, calc(100% - 6px) 0, 100% 6px,
    100% calc(100% - 6px), calc(100% - 6px) 100%,
    6px 100%, 0 calc(100% - 6px), 0 6px
  );

  --shadow-aaa:
    0 4px 10px rgba(0, 0, 0, 0.75),
    0 14px 32px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

@media (pointer: coarse) {
  :root {
    --target-size: 44px;
  }
}

@supports (background: linear-gradient(in oklab, white, black)) {
  :root {
    --in-oklab: in oklab;
    --in-oklch: in oklch;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* Locked 100dvh Full-Screen Game Viewport (Zero Website Scroll) */
body {
  block-size: 100dvh;
  max-block-size: 100dvh;
  inline-size: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  background-color: var(--bg-abyss);
  background-image:
    radial-gradient(ellipse 72% 58% at 60% 48%, rgba(217, 119, 6, 0.14), transparent 70%),
    radial-gradient(circle at 18% 20%, rgba(56, 189, 248, 0.08), transparent 55%),
    radial-gradient(circle at 85% 85%, rgba(244, 63, 94, 0.08), transparent 55%),
    radial-gradient(circle at 50% 50%, transparent 45%, rgba(2, 4, 9, 0.92) 100%),
    linear-gradient(to bottom var(--in-oklab), #090e1a, #03050a);
  color: var(--text-primary);
  font-family: var(--font-ui);
  line-height: 1.4;
  text-align: start;
  overflow-wrap: anywhere;
  user-select: none;
}

/* ==========================================================================
   AAA Fullscreen Launch Gate Splash Overlay
   ========================================================================== */
.launch-splash {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 50% 45%, rgba(217, 119, 6, 0.22), rgba(4, 7, 15, 0.96) 68%),
    linear-gradient(to bottom var(--in-oklab), rgba(7, 11, 22, 0.95), rgba(2, 4, 9, 0.98));
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: opacity 320ms ease-out, transform 320ms ease-out;
}

.launch-splash.hidden-splash {
  opacity: 0;
  transform: scale(1.06);
  pointer-events: none;
}

.launch-splash-core {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.7rem;
  padding: 2.2rem 3rem;
  background: linear-gradient(160deg var(--in-oklab), rgba(22, 33, 58, 0.95), rgba(7, 11, 21, 0.98));
  border: 2px solid var(--brass-bright);
  clip-path: var(--clip-panel);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.95), 0 0 45px rgba(245, 158, 11, 0.28);
}

.launch-crest {
  filter: drop-shadow(0 0 18px rgba(251, 191, 36, 0.55));
}

.launch-eyebrow {
  font-family: var(--font-tactical);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #7dd3fc;
}

.launch-title {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.5rem);
  font-weight: 800;
  color: var(--brass-gleam);
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.9);
}

.launch-sub {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.launch-cta-pill {
  margin-top: 0.5rem;
  padding: 0.65rem 1.8rem;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  color: #fffbeb;
  background: linear-gradient(to bottom var(--in-oklab), #d97706, #78350f);
  border: 1.5px solid var(--brass-gleam);
  clip-path: var(--clip-btn);
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* ==========================================================================
   Full-Viewport 60fps VFX Canvas & Cinematic Phase Sweep Banner
   ========================================================================== */
.vfx-canvas {
  position: fixed;
  inset: 0;
  inline-size: 100vw;
  block-size: 100dvh;
  pointer-events: none;
  z-index: 90;
}

.cinematic-banner {
  position: fixed;
  inset-inline: 0;
  inset-block-start: 46%;
  transform: translateY(-50%) scaleY(0.15);
  opacity: 0;
  pointer-events: none;
  z-index: 88;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(
    to right var(--in-oklab),
    transparent 4%,
    rgba(6, 10, 20, 0.95) 22%,
    rgba(22, 33, 58, 0.98) 50%,
    rgba(6, 10, 20, 0.95) 78%,
    transparent 96%
  );
  border-block: 2px solid var(--brass-bright);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.9), 0 0 30px rgba(245, 158, 11, 0.35);
  transition: opacity 220ms cubic-bezier(0.4, 0, 1, 1), transform 220ms cubic-bezier(0.4, 0, 1, 1);
}

.cinematic-banner.active {
  opacity: 1;
  transform: translateY(-50%) scaleY(1);
  transition: opacity 200ms ease-out, transform 260ms ease-out;
}

@media (prefers-reduced-motion: no-preference) {
  .cinematic-banner.active {
    transition:
      opacity 200ms ease-out,
      transform var(--spring-duration) var(--spring-easing);
  }
}

.cinematic-banner[data-tone="danger"] {
  border-block-color: #fb7185;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.9), 0 0 32px rgba(244, 63, 94, 0.5);
}

.cinematic-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  text-align: center;
}

.cinematic-title {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 1.05rem + 1vw, 1.85rem);
  font-weight: 800;
  color: var(--brass-gleam);
  letter-spacing: 0.06em;
  text-shadow: 0 2px 14px rgba(245, 158, 11, 0.75);
}

.cinematic-banner[data-tone="danger"] .cinematic-title {
  color: #fecdd3;
  text-shadow: 0 2px 14px rgba(244, 63, 94, 0.75);
}

.cinematic-sub {
  font-family: var(--font-tactical);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.14em;
}

/* Typography & Form-Factor Rules */
h1,
h2,
h3 {
  font-family: var(--font-heading);
  text-wrap: balance;
  line-height: 1.2;
}

p,
li {
  text-wrap: pretty;
  max-inline-size: 68ch;
}

:where(button, select, textarea, input:not([type="checkbox"], [type="radio"]), [role="button"], nav a, label:has(input[type="checkbox"], input[type="radio"])) {
  min-block-size: var(--target-size);
  min-inline-size: var(--target-size);
  font-family: inherit;
}

:where(button) {
  cursor: pointer;
  transition:
    box-shadow 180ms ease-out,
    scale 180ms ease-out,
    border-color 180ms ease-out,
    background-color 180ms ease-out,
    filter 180ms ease-out;
}

button:hover:not(:disabled) {
  filter: brightness(1.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.75), 0 0 12px rgba(251, 191, 36, 0.4);
}

button:active:not(:disabled) {
  scale: 0.96;
}

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

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--brass-bright);
  outline-offset: 2px;
}

.icon-button {
  position: relative;
}

.icon-button::after {
  content: "";
  position: absolute;
  inset: -8px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
}

:where(.toolbar > :not(button, input, select, textarea, a, [role="button"], label)) {
  min-inline-size: 0;
}

/* ==========================================================================
   Main Full-Screen AAA War-Room Client Layout
   ========================================================================== */
.duel-layout {
  min-block-size: 0;
  block-size: 100dvh;
  inline-size: 100%;
  max-inline-size: 1840px;
  margin: 0 auto;
  padding: 0.45rem 0.7rem;
  display: grid;
  grid-template-columns: clamp(16rem, 20.5vw, 19.2rem) minmax(0, 1fr);
  gap: 0.65rem;
  overflow: hidden;
}

@media (max-width: 960px) {
  .duel-layout {
    grid-template-columns: 14.5rem minmax(0, 1fr);
    padding: 0.3rem 0.45rem;
    gap: 0.4rem;
  }
}

/* ==========================================================================
   Left Diegetic Column: Brand Pod, Card Holo-Inspector & Combat Ticker
   ========================================================================== */
.inspector-panel {
  min-block-size: 0;
  block-size: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0.42rem;
  overflow: hidden;
}

.hud-brand-pod {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  background: linear-gradient(145deg var(--in-oklab), #162238, #080d18);
  border: 1px solid var(--brass-dim);
  clip-path: var(--clip-btn);
  box-shadow: var(--shadow-aaa);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.brand-emblem {
  display: flex;
  align-items: center;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.45));
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--brass-gleam);
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.brand-subtitle {
  font-family: var(--font-display);
  font-size: 0.54rem;
  font-weight: 700;
  color: #7dd3fc;
  letter-spacing: 0.12em;
}

.hud-quick-utils {
  align-items: center;
  gap: 0.25rem;
}

.hud-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.26rem 0.44rem;
  background: linear-gradient(to bottom var(--in-oklab), #1e293b, #090e1a);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: var(--brass-gleam);
  clip-path: var(--clip-card);
  font-family: var(--font-tactical);
  font-size: 0.68rem;
  font-weight: 700;
}

.inspector-card-box {
  background: linear-gradient(160deg var(--in-oklab), #1b2842, #070b14);
  border: 1.5px solid var(--brass-mid);
  clip-path: var(--clip-panel);
  padding: 0.22rem;
  box-shadow: var(--shadow-aaa);
}

.inspector-frame-inner {
  clip-path: var(--clip-panel);
  border: 1px solid rgba(251, 191, 36, 0.24);
  padding: 0.5rem 0.6rem;
  background:
    radial-gradient(circle at 50% 0%, rgba(217, 119, 6, 0.12), transparent 65%),
    linear-gradient(to bottom var(--in-oklab), #0d1527, #060912);
  display: flex;
  flex-direction: column;
  gap: 0.34rem;
}

.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.inspector-badge {
  font-family: var(--font-heading);
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.08rem 0.5rem;
  background: rgba(217, 119, 6, 0.22);
  color: var(--brass-gleam);
  border: 1px solid var(--brass-dim);
  clip-path: var(--clip-card);
}

.inspector-tier {
  font-family: var(--font-tactical);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--brass-bright);
  letter-spacing: 0.06em;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.45);
}

.inspector-title {
  font-family: var(--font-heading);
  font-size: clamp(0.88rem, 0.8rem + 0.25vw, 1.02rem);
  font-weight: 800;
  color: #fff;
  padding-bottom: 0.18rem;
  border-bottom: 1px solid rgba(251, 191, 36, 0.25);
}

.inspector-art {
  position: relative;
  inline-size: 100%;
  aspect-ratio: 200 / 116;
  overflow: hidden;
  border: 1.5px solid rgba(251, 191, 36, 0.55);
  clip-path: var(--clip-card);
  background: #050811;
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.85);
}

.card-art-svg {
  inline-size: 100%;
  block-size: 100%;
  display: block;
}

.inspector-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(15, 23, 42, 0.85);
  padding: 0.18rem 0.45rem;
  clip-path: var(--clip-card);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.inspector-stats {
  font-family: var(--font-tactical);
  font-weight: 700;
  color: var(--brass-gleam);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.inspector-desc {
  font-size: 0.71rem;
  line-height: 1.4;
  color: var(--text-secondary);
  min-block-size: 2.5rem;
}

.inspector-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.inspector-actions:empty {
  display: none;
}

.action-cmd-btn {
  flex: 1 1 auto;
  padding: 0.28rem 0.55rem;
  font-family: var(--font-heading);
  font-size: 0.74rem;
  font-weight: 700;
  clip-path: var(--clip-btn);
  border: 1px solid var(--brass-bright);
  background: linear-gradient(to bottom var(--in-oklab), #d97706, #78350f);
  color: #fffbeb;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.action-cmd-btn.secondary {
  border-color: #38bdf8;
  background: linear-gradient(to bottom var(--in-oklab), #0284c7, #082f49);
}

.action-cmd-btn.tactic {
  border-color: #34d399;
  background: linear-gradient(to bottom var(--in-oklab), #059669, #042f2e);
}

.action-cmd-btn.skill {
  border-color: #c084fc;
  background: linear-gradient(to bottom var(--in-oklab), #7c3aed, #2e1065);
  color: #f3e8ff;
}

/* Tactical Operations Ticker */
.battle-log-section {
  min-block-size: 0;
  background: linear-gradient(to bottom var(--in-oklab), rgba(13, 20, 36, 0.92), rgba(6, 9, 18, 0.96));
  border: 1px solid var(--steel-border);
  clip-path: var(--clip-panel);
  padding: 0.42rem 0.55rem;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.3rem;
  box-shadow: var(--shadow-aaa);
  overflow: hidden;
}

.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brass-gleam);
  padding-bottom: 0.2rem;
  border-bottom: 1px solid rgba(251, 191, 36, 0.2);
}

.turn-pill {
  font-family: var(--font-tactical);
  background: linear-gradient(to bottom var(--in-oklab), #92400e, #451a03);
  color: var(--brass-gleam);
  border: 1px solid var(--brass-bright);
  padding: 0.06rem 0.48rem;
  clip-path: var(--clip-card);
  font-size: 0.68rem;
  font-weight: 700;
}

.battle-log-list {
  min-block-size: 0;
  list-style: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.24rem;
  font-size: 0.69rem;
  padding-inline-end: 0.18rem;
}

.log-entry {
  padding: 0.22rem 0.42rem;
  background: rgba(15, 23, 42, 0.82);
  border-inline-start: 2.5px solid #64748b;
  line-height: 1.32;
}

.log-entry.player {
  border-inline-start-color: #38bdf8;
}

.log-entry.ai {
  border-inline-start-color: #fb7185;
}

.log-entry.alert {
  border-inline-start-color: var(--brass-bright);
  background: rgba(180, 83, 9, 0.22);
  color: var(--brass-gleam);
}

/* ==========================================================================
   Right Full-Bleed War-Room Battlefield & Diegetic HUD Pods
   ========================================================================== */
.battlefield {
  min-block-size: 0;
  block-size: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.32rem;
  overflow: hidden;
}

.arena-top-hud,
.arena-bottom-hud {
  display: grid;
  grid-template-columns: clamp(13rem, 19vw, 16.5rem) minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
}

/* Chamfered Commander Medallion & Integrity Gauge Pod */
.commander-hud-pod {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.32rem 0.68rem;
  background: linear-gradient(135deg var(--in-oklab), #17223b, #080d18);
  border: 1.5px solid var(--steel-border);
  clip-path: var(--clip-panel);
  box-shadow: var(--shadow-aaa);
}

.opponent-pod {
  border-color: rgba(244, 63, 94, 0.55);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8), inset 0 0 18px rgba(244, 63, 94, 0.14);
}

.player-pod {
  border-color: rgba(251, 191, 36, 0.65);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8), inset 0 0 18px rgba(251, 191, 36, 0.14);
}

.commander-avatar {
  inline-size: 2.25rem;
  block-size: 2.25rem;
  display: grid;
  place-items: center;
  background: #060912;
  border: 1px solid var(--brass-dim);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  flex-shrink: 0;
}

.commander-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
}

.commander-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
}

.commander-name {
  font-family: var(--font-heading);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-primary);
}

.lp-value {
  font-family: var(--font-tactical);
  font-size: clamp(1rem, 0.9rem + 0.38vw, 1.24rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--brass-gleam);
  text-shadow: 0 0 12px rgba(245, 158, 11, 0.55);
  transition: scale 180ms ease-out, color 180ms ease-out;
}

.lp-value.lp-hit-flash {
  color: #f43f5e;
  scale: 1.16;
}

.lp-value.lp-heal-flash {
  color: #4ade80;
  scale: 1.14;
}

.opp-lp-text {
  color: #fda4af;
  text-shadow: 0 0 12px rgba(244, 63, 94, 0.55);
}

/* Angled Parallelogram AAA Health Bar with Delayed Trail */
.lp-bar-track {
  position: relative;
  inline-size: 100%;
  block-size: 0.5rem;
  background: #04070e;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  transform: skewX(-16deg);
}

.lp-bar-trail {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  inline-size: 100%;
  background: rgba(254, 240, 138, 0.85);
  transition: width 850ms cubic-bezier(0.22, 1, 0.36, 1) 160ms;
}

.lp-bar-fill {
  position: relative;
  z-index: 1;
  block-size: 100%;
  inline-size: 100%;
  transition: width 220ms ease-out;
}

.player-lp-fill {
  background: linear-gradient(to right var(--in-oklab), #d97706, #fbbf24, #fef08a);
}

.opp-lp-fill {
  background: linear-gradient(to right var(--in-oklab), #9f1239, #f43f5e, #fda4af);
}

/* Top-Right Tactical Command Bar */
.tactical-menu-pod {
  align-items: center;
  gap: 0.32rem;
  padding: 0.26rem 0.5rem;
  background: linear-gradient(135deg var(--in-oklab), rgba(19, 28, 49, 0.92), rgba(8, 12, 23, 0.96));
  border: 1px solid var(--brass-dim);
  clip-path: var(--clip-panel);
  box-shadow: var(--shadow-aaa);
}

.ai-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 0.14rem 0.42rem;
}

.ctrl-select {
  background: #0d1527;
  color: var(--brass-gleam);
  border: 1px solid var(--brass-dim);
  clip-path: var(--clip-card);
  padding: 0.14rem 0.38rem;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
}

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.24rem 0.58rem;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-primary);
  background: linear-gradient(to bottom var(--in-oklab), #1e293b, #0b1120);
  border: 1px solid rgba(148, 163, 184, 0.36);
  clip-path: var(--clip-btn);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-svg-icon {
  width: 0.9rem;
  height: 0.9rem;
  flex-shrink: 0;
  color: var(--brass-bright);
}

.ctrl-btn-primary {
  background: linear-gradient(to bottom var(--in-oklab), #d97706, #78350f);
  border-color: var(--brass-gleam);
  color: #fffbeb;
  box-shadow: inset 0 1px 0 rgba(254, 243, 199, 0.4), 0 2px 10px rgba(0, 0, 0, 0.65);
}

.ctrl-btn-primary .btn-svg-icon {
  color: #fef08a;
}

/* ==========================================================================
   3D Vault Plinths (Deck & Scrapyard Counters)
   ========================================================================== */
.pile-counters {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.pile-divider {
  inline-size: 1px;
  block-size: 1.9rem;
  background: rgba(251, 191, 36, 0.25);
  margin-inline: 0.1rem;
}

.vault-plinth {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-inline-size: 3.15rem;
  padding: 0.16rem 0.42rem;
  background: linear-gradient(160deg var(--in-oklab), #17233b, #080d19);
  border: 1px solid var(--brass-dim);
  clip-path: var(--clip-card);
  color: var(--text-primary);
  box-shadow:
    0 4px 0 #04070e,
    0 6px 12px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.vault-plinth.opp-vault {
  border-color: rgba(244, 63, 94, 0.38);
}

.pile-label {
  font-family: var(--font-heading);
  font-size: 0.56rem;
  font-weight: 700;
  color: var(--text-muted);
}

.pile-count {
  font-family: var(--font-tactical);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brass-gleam);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   3D Tilted Engraved Siege Table Stage (Master Duel / Gwent Tabletop Feel)
   ========================================================================== */
.board-3d-stage {
  position: relative;
  min-block-size: 0;
  block-size: 100%;
  inline-size: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1150px;
  padding: 0.15rem 0.35rem;
}

.board-surface {
  position: relative;
  min-block-size: 0;
  block-size: 100%;
  inline-size: 100%;
  display: grid;
  grid-template-rows: minmax(0, 0.86fr) minmax(0, 1.14fr) auto minmax(0, 1.14fr) minmax(0, 0.86fr);
  gap: 0.32rem;
  padding: 0.45rem 0.85rem;
  clip-path: var(--clip-panel);
  background:
    radial-gradient(ellipse 65% 55% at 50% 50%, rgba(217, 119, 6, 0.12), transparent 75%),
    linear-gradient(to bottom var(--in-oklab), #0c1324, #060a14 50%, #0a101f);
  border: 2px solid rgba(217, 119, 6, 0.55);
  box-shadow:
    0 12px 0 #04060c,
    0 18px 36px rgba(0, 0, 0, 0.92),
    inset 0 0 46px rgba(0, 0, 0, 0.92);
  overflow: hidden;
  transition: border-color 320ms ease-out, box-shadow 320ms ease-out;
}

@media (prefers-reduced-motion: no-preference) {
  .board-surface {
    transform: rotateX(7deg);
    transform-origin: center center;
  }
}

/* Dynamic Field Terrain Directives */
.board-surface[data-terrain="FOUNDRY_NETWORK"] {
  border-color: rgba(249, 115, 22, 0.8);
  background:
    radial-gradient(circle at 50% 50%, rgba(234, 88, 12, 0.22), transparent 72%),
    linear-gradient(to bottom var(--in-oklab), #1a0d08, #08070c);
  box-shadow:
    0 12px 0 #04060c,
    0 18px 36px rgba(0, 0, 0, 0.92),
    inset 0 0 50px rgba(234, 88, 12, 0.28);
}

.board-surface[data-terrain="BASTION_GRID"] {
  border-color: rgba(52, 211, 153, 0.75);
  background:
    radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.18), transparent 72%),
    linear-gradient(to bottom var(--in-oklab), #071919, #060a12);
  box-shadow:
    0 12px 0 #04060c,
    0 18px 36px rgba(0, 0, 0, 0.92),
    inset 0 0 50px rgba(16, 185, 129, 0.25);
}

/* Corner Brass Rivet Ornaments */
.board-corner-ornament {
  position: absolute;
  inline-size: 16px;
  block-size: 16px;
  border: 2px solid var(--brass-bright);
  pointer-events: none;
  z-index: 2;
  opacity: 0.7;
}
.board-corner-ornament.tl { inset-block-start: 6px; inset-inline-start: 6px; border-inline-end: none; border-block-end: none; }
.board-corner-ornament.tr { inset-block-start: 6px; inset-inline-end: 6px; border-inline-start: none; border-block-end: none; }
.board-corner-ornament.bl { inset-block-end: 6px; inset-inline-start: 6px; border-inline-end: none; border-block-start: none; }
.board-corner-ornament.br { inset-block-end: 6px; inset-inline-end: 6px; border-inline-start: none; border-block-start: none; }

/* Architectural War-Room Perspective Grid */
.board-perspective-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(251, 191, 36, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(251, 191, 36, 0.06) 1px, transparent 1px);
  background-size: 52px 52px;
  opacity: 0.7;
}

/* Visually Textured Pattern Layer */
.board-texture-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  background: linear-gradient(135deg var(--in-oklab), #fbbf24, #38bdf8);
}

.weathered-element {
  --lattice-mask:
    linear-gradient(45deg, #000 25%, transparent 25%),
    linear-gradient(-45deg, #000 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #000 75%),
    linear-gradient(-45deg, transparent 75%, #000 75%);
  -webkit-mask-image: var(--lattice-mask);
  -webkit-mask-size: 24px 24px;
  -webkit-mask-position: 0 0, 0 12px, 12px -12px, -12px 0;
  mask-image: var(--lattice-mask);
  mask-size: 24px 24px;
  mask-position: 0 0, 0 12px, 12px -12px, -12px 0;
}

@supports (not (mask-image: linear-gradient(black, transparent))) and (not (-webkit-mask-image: linear-gradient(black, transparent))) {
  .weathered-element {
    opacity: 0.03;
  }
}

.board-row {
  position: relative;
  z-index: 1;
  min-block-size: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.6rem;
}

/* Recessed Metallic & Stone Card Sockets on the Playmat */
.zone-slot {
  position: relative;
  min-block-size: 0;
  block-size: 100%;
  clip-path: var(--clip-btn);
  border: 1.5px solid rgba(217, 119, 6, 0.28);
  background:
    radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.45), rgba(3, 6, 12, 0.9));
  box-shadow:
    inset 0 3px 14px rgba(0, 0, 0, 0.9),
    inset 0 0 0 1px rgba(251, 191, 36, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.14rem;
  transition: border-color 180ms ease-out, box-shadow 180ms ease-out, transform 180ms ease-out;
}

.opp-backrow .zone-slot,
.opp-frontrow .zone-slot {
  border-color: rgba(244, 63, 94, 0.26);
}

/* Engraved Tactical Stencil on Empty Zones */
.zone-slot::before {
  content: attr(data-zone-label);
  position: absolute;
  font-family: var(--font-tactical);
  font-size: 0.58rem;
  font-weight: 700;
  color: rgba(251, 191, 36, 0.2);
  letter-spacing: 0.08em;
  pointer-events: none;
  text-align: center;
}

.zone-slot.valid-target {
  border-color: #fb7185;
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.65), inset 0 0 16px rgba(244, 63, 94, 0.35);
  cursor: pointer;
}

.zone-slot.valid-ally-target {
  border-color: #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.65), inset 0 0 16px rgba(56, 189, 248, 0.35);
  cursor: pointer;
}

/* ==========================================================================
   Center Diegetic Battle Phase Reactor Strip
   ========================================================================== */
.phase-ribbon {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.24rem 0.75rem;
  clip-path: var(--clip-btn);
  background: linear-gradient(
    to right var(--in-oklab),
    rgba(6, 10, 20, 0.95),
    rgba(26, 39, 68, 0.98) 50%,
    rgba(6, 10, 20, 0.95)
  );
  border: 1.5px solid var(--brass-mid);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.85), 0 0 18px rgba(217, 119, 6, 0.2);
}

.phase-steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.26rem;
}

.phase-pill {
  font-family: var(--font-tactical);
  font-size: 0.64rem;
  font-weight: 700;
  padding: 0.1rem 0.52rem;
  clip-path: var(--clip-card);
  background: rgba(7, 11, 20, 0.9);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.phase-pill.active {
  background: linear-gradient(to bottom var(--in-oklab), #f59e0b, #92400e);
  color: #fffbeb;
  border-color: var(--brass-gleam);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.65);
}

.field-terrain-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.1rem 0.52rem;
  clip-path: var(--clip-card);
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(234, 88, 12, 0.28);
  color: #fed7aa;
  border: 1px solid #fb923c;
}

.terrain-dot {
  inline-size: 0.42rem;
  block-size: 0.42rem;
  border-radius: 50%;
  background: #fb923c;
  box-shadow: 0 0 6px #fb923c;
}

.phase-banner-msg {
  font-family: var(--font-heading);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--brass-gleam);
  text-align: center;
  flex: 1;
}

.phase-controls {
  display: flex;
  align-items: center;
  gap: 0.34rem;
}

.phase-action-btn {
  padding: 0.2rem 0.68rem;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 800;
  clip-path: var(--clip-btn);
  background: linear-gradient(to bottom var(--in-oklab), #0284c7, #0c4a6e);
  color: #f0f9ff;
  border: 1px solid #7dd3fc;
}

.phase-action-btn.battle-btn {
  background: linear-gradient(to bottom var(--in-oklab), #d97706, #78350f);
  border-color: var(--brass-gleam);
  color: #fffbeb;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.phase-action-btn.phase-end-btn {
  background: linear-gradient(to bottom var(--in-oklab), #be123c, #4c0519);
  border-color: #fda4af;
}

/* ==========================================================================
   Opponent & Player Curved Fanned Hand Strips
   ========================================================================== */
.opp-hand-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
}

.opp-hand-card {
  inline-size: 2.15rem;
  block-size: 2.95rem;
  clip-path: var(--clip-card);
  background:
    radial-gradient(circle at center, #f59e0b 0 18%, transparent 22%),
    repeating-conic-gradient(#1e293b 0 25%, #070b14 0 50%) 0 / 10px 10px;
  border: 1.5px solid var(--brass-mid);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
  transform: rotate(var(--opp-fan-angle, 0deg));
}

.scroller {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.55rem 0.5rem 0.2rem;
}

.scroller > * {
  scroll-snap-align: start;
}

.player-dock-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

/* ==========================================================================
   AAA Forged Metallic Trading Card Component (Board & Curved Hand Fan)
   ========================================================================== */
.duel-card {
  position: relative;
  inline-size: clamp(5.4rem, 7.1vw, 6.65rem);
  block-size: 100%;
  max-block-size: 6rem;
  clip-path: var(--clip-card);
  padding: 0.16rem 0.22rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: start;
  color: #fff;
  box-shadow:
    0 5px 12px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  user-select: none;
  flex-shrink: 0;
  transition:
    transform 190ms ease-out,
    box-shadow 190ms ease-out,
    border-color 190ms ease-out,
    filter 190ms ease-out;
}

/* Curved Hand Fan Physics */
.player-hand-strip .duel-card {
  block-size: 5.5rem;
  max-block-size: 5.5rem;
  transform: translateY(var(--fan-y, 0px)) rotate(var(--fan-angle, 0deg));
  transform-origin: bottom center;
}

.player-hand-strip .duel-card:hover {
  z-index: 30;
  transform: translateY(-0.55rem) rotate(0deg) scale(1.1);
  filter: brightness(1.1);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.92), 0 0 18px rgba(251, 191, 36, 0.65);
  transition:
    transform 240ms ease-out,
    box-shadow 220ms ease-out;
}

@media (prefers-reduced-motion: no-preference) {
  .player-hand-strip .duel-card:hover {
    transition:
      transform var(--spring-duration) ease-out,
      box-shadow 220ms ease-out;
    transition:
      transform var(--spring-duration) var(--spring-easing),
      box-shadow 220ms ease-out;
  }
}

.duel-card.kind-UNIT {
  background: linear-gradient(155deg var(--in-oklab), #6b3410, #231004);
  border: 1.5px solid #f59e0b;
}

.duel-card.kind-UNIT.has-ability {
  background: linear-gradient(155deg var(--in-oklab), #8a3514, #2d0e04);
  border: 1.5px solid #fb923c;
}

.duel-card.kind-TACTIC {
  background: linear-gradient(155deg var(--in-oklab), #065f46, #022c22);
  border: 1.5px solid #34d399;
}

.duel-card.kind-COUNTER {
  background: linear-gradient(155deg var(--in-oklab), #831843, #310817);
  border: 1.5px solid #fb7185;
}

.duel-card.selected {
  z-index: 28;
  outline: 2px solid var(--brass-gleam);
  transform: translateY(-0.42rem) rotate(0deg) scale(1.07);
  box-shadow: 0 0 22px rgba(251, 191, 36, 0.85);
}

.duel-card.can-attack {
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.8), inset 0 0 8px rgba(251, 191, 36, 0.45);
}

.duel-card.shielded-unit {
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.85), inset 0 0 10px rgba(56, 189, 248, 0.5);
}

.duel-card.defense-mode {
  border-color: #38bdf8;
}

.duel-card.defense-mode .card-art-wrap {
  transform: rotate(90deg) scale(0.82);
}

.duel-card.face-down {
  background:
    radial-gradient(circle at center, #f59e0b 0 14%, transparent 18%),
    repeating-conic-gradient(#1e293b 0 25%, #070b14 0 50%) 0 / 12px 12px;
  border: 1.5px solid #f59e0b;
  justify-content: center;
  align-items: center;
}

.card-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.14rem;
  font-family: var(--font-heading);
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1.1;
  background: rgba(3, 6, 14, 0.65);
  padding: 0.05rem 0.2rem;
  border-bottom: 1px solid rgba(251, 191, 36, 0.28);
}

.card-mini-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-tier-dots {
  font-family: var(--font-tactical);
  color: var(--brass-gleam);
  font-size: 0.56rem;
  flex-shrink: 0;
}

.card-art-wrap {
  position: relative;
  flex: 1;
  min-block-size: 0;
  inline-size: 100%;
  margin: 0.08rem 0;
  overflow: hidden;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: #050811;
  transition: transform 180ms ease-out;
}

/* Tactical Status Badges on Board Cards */
.card-badges-row {
  position: absolute;
  inset-block-end: 0.1rem;
  inset-inline: 0.12rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.12rem;
  pointer-events: none;
}

.mini-status-tag {
  font-family: var(--font-tactical);
  font-size: 0.48rem;
  font-weight: 700;
  padding: 0.02rem 0.2rem;
  background: rgba(9, 13, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #f8fafc;
}

.mini-status-tag.tag-shield {
  background: rgba(2, 132, 199, 0.92);
  border-color: #7dd3fc;
  color: #e0f2fe;
}

.mini-status-tag.tag-skill {
  background: rgba(109, 40, 217, 0.92);
  border-color: #d8b4fe;
  color: #f3e8ff;
}

.card-bottom-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-tactical);
  font-size: 0.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(3, 6, 14, 0.85);
  padding: 0.04rem 0.22rem;
  border-top: 1px solid rgba(251, 191, 36, 0.25);
}

.stat-active-atk {
  color: var(--brass-gleam);
}

.stat-active-def {
  color: #7dd3fc;
}

.stat-buffed {
  color: #4ade80 !important;
}

.stat-debuffed {
  color: #fb7185 !important;
}

/* Quick Action Bar floating above Player Hand */
.quick-action-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.24rem 0.85rem;
  background: linear-gradient(
    to right var(--in-oklab),
    transparent 5%,
    rgba(12, 19, 36, 0.96) 25%,
    rgba(24, 37, 66, 0.98) 50%,
    rgba(12, 19, 36, 0.96) 75%,
    transparent 95%
  );
  border-block: 1.5px solid var(--brass-bright);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.85);
}

.quick-action-bar:empty {
  display: none;
}

.quick-action-label {
  font-family: var(--font-heading);
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--brass-gleam);
  margin-inline-end: 0.25rem;
}

/* ==========================================================================
   Native <dialog> Modals (dialog + animate-to-from-top-layer compliant)
   ========================================================================== */
dialog {
  overscroll-behavior: contain;
  margin: auto;
  border: none;
  background: transparent;
  color: var(--text-primary);
  max-inline-size: min(94vw, 980px);
  max-block-size: 88dvh;
  opacity: 0;
  transform: scale(0.95);
  transition-property: opacity, transform, display, overlay;
  transition-duration: 220ms;
  transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
  /* Separate after transition so a shorthand doesn't reset it or fail in older browsers */
  transition-behavior: allow-discrete;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(2, 5, 11, 0.86);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition-property: opacity, display, overlay;
  transition-duration: 220ms;
  transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
  /* Separate after transition so a shorthand doesn't reset it or fail in older browsers */
  transition-behavior: allow-discrete;
}

dialog:open:where(:not([data-closing])) {
  opacity: 1;
  transform: scale(1);
  transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
  transition-duration: 280ms;

  @starting-style {
    opacity: 0;
    transform: scale(0.95);
  }
}

@media (prefers-reduced-motion: no-preference) {
  dialog:open:where(:not([data-closing])) {
    transition-timing-function: var(--spring-easing);
    transition-duration: var(--spring-duration);
  }
}

dialog:open:where(:not([data-closing]))::backdrop {
  opacity: 1;
  transition-timing-function: cubic-bezier(0, 0, 0.2, 1);

  @starting-style {
    opacity: 0;
  }
}

.modal-card {
  background: linear-gradient(160deg var(--in-oklab), #16223b, #080d18);
  border: 2px solid var(--brass-mid);
  clip-path: var(--clip-panel);
  padding: 1rem 1.2rem;
  box-shadow: var(--shadow-aaa);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-block-size: 85dvh;
  overflow-y: auto;
}

.counter-modal-card {
  max-inline-size: 540px;
  border-color: #fb7185;
}

.wide-modal-card {
  inline-size: min(92vw, 820px);
}

.xl-modal-card {
  inline-size: min(94vw, 980px);
}

.gameover-modal-card {
  inline-size: min(90vw, 440px);
  text-align: center;
  align-items: center;
}

.gameover-emblem {
  inline-size: 3.5rem;
  block-size: 3.5rem;
  display: grid;
  place-items: center;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(251, 191, 36, 0.28);
}

.modal-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.modal-body-text {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.icon-close-btn {
  padding: 0.24rem 0.58rem;
  clip-path: var(--clip-card);
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: #090e1c;
  color: var(--brass-gleam);
  font-weight: 800;
}

/* Deck Builder & Codex Grid */
.deck-builder-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-pills,
.deck-preset-actions {
  align-items: center;
  gap: 0.36rem;
}

.ctrl-btn.active-filter {
  border-color: var(--brass-gleam);
  background: rgba(217, 119, 6, 0.32);
  color: var(--brass-gleam);
}

.deck-count-pill {
  font-family: var(--font-tactical);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.24rem 0.58rem;
  clip-path: var(--clip-card);
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.codex-grid,
.card-grid-display,
.counter-candidates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13.2rem, 1fr));
  gap: 0.65rem;
}

.codex-item {
  background: linear-gradient(155deg var(--in-oklab), rgba(17, 26, 46, 0.95), rgba(8, 13, 24, 0.98));
  border: 1px solid rgba(217, 119, 6, 0.38);
  clip-path: var(--clip-btn);
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.4rem;
}

.codex-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brass-gleam);
}

.codex-item-art {
  inline-size: 100%;
  aspect-ratio: 200 / 126;
  clip-path: var(--clip-card);
  overflow: hidden;
  border: 1px solid rgba(251, 191, 36, 0.32);
}

.codex-item-desc {
  font-size: 0.71rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.codex-deck-ctrl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.28rem;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.rules-content {
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
  font-size: 0.84rem;
  line-height: 1.58;
  color: var(--text-secondary);
}

.rules-block {
  background: rgba(10, 15, 28, 0.88);
  border: 1px solid var(--brass-dim);
  clip-path: var(--clip-btn);
  padding: 0.72rem 0.92rem;
}

.rules-block h3 {
  color: var(--brass-gleam);
  font-size: 0.92rem;
  margin-bottom: 0.28rem;
}

/* ==========================================================================
   AAA Main Menu Screen, Mode Blades & Battle Mode Lobby (AI + PeerJS P2P)
   ========================================================================== */
[hidden] {
  display: none !important;
}

.main-menu-screen {
  position: relative;
  min-block-size: 0;
  block-size: 100dvh;
  inline-size: 100%;
  max-inline-size: 1760px;
  margin: 0 auto;
  padding: 0.9rem 1.4rem;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 1rem;
  overflow: hidden;
}

.menu-bg-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 50% 35%, rgba(245, 158, 11, 0.14), transparent 65%),
    linear-gradient(to right, rgba(251, 191, 36, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(251, 191, 36, 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 56px 56px, 56px 56px;
}

.menu-top-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.65rem 1.1rem;
  background: linear-gradient(145deg var(--in-oklab), rgba(22, 34, 59, 0.95), rgba(8, 13, 24, 0.98));
  border: 1.5px solid var(--brass-dim);
  clip-path: var(--clip-panel);
  box-shadow: var(--shadow-aaa);
}

.menu-brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.menu-main-title {
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 1rem + 0.55vw, 1.55rem);
  font-weight: 800;
  color: var(--brass-gleam);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
}

.menu-main-sub {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  color: #7dd3fc;
  letter-spacing: 0.14em;
}

.menu-top-utilities {
  align-items: center;
  gap: 0.45rem;
}

.menu-deck-ready-pill {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  clip-path: var(--clip-card);
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.5);
  color: #6ee7b7;
}

/* 4-Blade Mode Hub */
.menu-hub-view {
  position: relative;
  z-index: 2;
  min-block-size: 0;
  block-size: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-blades-grid {
  inline-size: 100%;
  block-size: min(100%, 31rem);
  display: grid;
  grid-template-columns: 1.25fr 1.05fr 0.95fr 0.95fr;
  gap: 0.9rem;
}

@media (max-width: 1100px) {
  .menu-blades-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    block-size: 100%;
  }
}

.mode-blade {
  position: relative;
  min-block-size: 0;
  block-size: 100%;
  padding: 1.15rem 1.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  clip-path: var(--clip-panel);
  background: linear-gradient(165deg var(--in-oklab), rgba(20, 31, 56, 0.95), rgba(7, 11, 22, 0.98));
  border: 1.5px solid var(--steel-border);
  box-shadow: var(--shadow-aaa);
  transition:
    transform 220ms ease-out,
    border-color 220ms ease-out,
    box-shadow 220ms ease-out;
}

@media (prefers-reduced-motion: no-preference) {
  .mode-blade:hover:not(:disabled) {
    transform: translateY(-0.4rem) scale(1.015);
    transition:
      transform var(--spring-duration) var(--spring-easing),
      border-color 220ms ease-out,
      box-shadow 220ms ease-out;
  }
}

.mode-blade.primary-blade {
  background:
    radial-gradient(circle at 50% 28%, rgba(245, 158, 11, 0.22), transparent 68%),
    linear-gradient(165deg var(--in-oklab), #23180c, #090e1c);
  border: 2px solid var(--brass-bright);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.85), 0 0 28px rgba(245, 158, 11, 0.25);
}

.mode-blade.secondary-blade:hover:not(:disabled) {
  border-color: #38bdf8;
}

.mode-blade.locked-blade {
  background: linear-gradient(165deg var(--in-oklab), rgba(15, 23, 42, 0.72), rgba(6, 9, 17, 0.9));
  border-color: rgba(100, 116, 139, 0.32);
  opacity: 0.68;
  cursor: not-allowed;
}

.blade-tag {
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.14rem 0.65rem;
  clip-path: var(--clip-card);
  background: rgba(217, 119, 6, 0.25);
  border: 1px solid var(--brass-bright);
  color: var(--brass-gleam);
}

.blade-tag.locked-tag {
  background: rgba(51, 65, 85, 0.45);
  border-color: #64748b;
  color: #cbd5e1;
}

.blade-art-emblem {
  inline-size: clamp(4.8rem, 7vw, 6.8rem);
  block-size: clamp(4.8rem, 7vw, 6.8rem);
  display: grid;
  place-items: center;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.8));
}

.blade-svg {
  inline-size: 100%;
  block-size: 100%;
}

.blade-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.blade-title {
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 0.95rem + 0.45vw, 1.38rem);
  font-weight: 800;
  color: #fff;
}

.primary-blade .blade-title {
  color: var(--brass-gleam);
}

.blade-sub {
  font-family: var(--font-tactical);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #7dd3fc;
}

.blade-desc {
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.blade-cta {
  inline-size: 100%;
  padding: 0.42rem 0.75rem;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 800;
  clip-path: var(--clip-btn);
  background: linear-gradient(to bottom var(--in-oklab), #d97706, #78350f);
  border: 1px solid var(--brass-gleam);
  color: #fffbeb;
}

.secondary-blade .blade-cta {
  background: linear-gradient(to bottom var(--in-oklab), #0284c7, #082f49);
  border-color: #7dd3fc;
}

.blade-cta.locked-cta {
  background: rgba(30, 41, 59, 0.75);
  border-color: #475569;
  color: #94a3b8;
}

/* ==========================================================================
   Battle Mode Sub-Screen (VS AI Commander & Online PeerJS P2P)
   ========================================================================== */
.menu-battle-view {
  position: relative;
  z-index: 2;
  min-block-size: 0;
  block-size: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.75rem;
  overflow: hidden;
}

.battle-sub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.45rem 0.85rem;
  background: rgba(9, 14, 28, 0.9);
  border: 1px solid var(--steel-border);
  clip-path: var(--clip-btn);
}

.battle-sub-title {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 0.9rem + 0.4vw, 1.28rem);
  color: var(--brass-gleam);
}

.wan-badge {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  clip-path: var(--clip-card);
  background: rgba(2, 132, 199, 0.22);
  border: 1px solid #38bdf8;
  color: #bae6fd;
}

.battle-lobby-grid {
  min-block-size: 0;
  block-size: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  overflow: hidden;
}

@media (max-width: 960px) {
  .battle-lobby-grid {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
}

.lobby-card {
  min-block-size: 0;
  block-size: 100%;
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.6rem;
  background: linear-gradient(160deg var(--in-oklab), rgba(19, 29, 52, 0.96), rgba(7, 11, 21, 0.98));
  border: 1.5px solid var(--brass-dim);
  clip-path: var(--clip-panel);
  box-shadow: var(--shadow-aaa);
  overflow-y: auto;
}

.p2p-lobby-card {
  border-color: rgba(56, 189, 248, 0.55);
}

.lobby-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.lobby-pill {
  align-self: flex-start;
  font-family: var(--font-tactical);
  font-size: 0.64rem;
  font-weight: 700;
  padding: 0.1rem 0.55rem;
  clip-path: var(--clip-card);
  background: rgba(217, 119, 6, 0.24);
  border: 1px solid var(--brass-bright);
  color: var(--brass-gleam);
}

.lobby-pill.online-pill {
  background: rgba(2, 132, 199, 0.25);
  border-color: #38bdf8;
  color: #bae6fd;
}

.lobby-card-header h3 {
  font-size: 1.1rem;
  color: #fff;
}

.lobby-card-header p {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

/* AI Commander Roster Cards */
.commander-roster-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.commander-card {
  padding: 0.55rem 0.65rem;
  text-align: start;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  background: rgba(9, 14, 26, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  clip-path: var(--clip-btn);
  color: var(--text-primary);
}

.commander-card.active-commander {
  background: linear-gradient(145deg var(--in-oklab), rgba(180, 83, 9, 0.34), rgba(15, 23, 42, 0.95));
  border: 1.5px solid var(--brass-gleam);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.35);
}

.cmd-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
  font-family: var(--font-heading);
  font-size: 0.76rem;
  color: var(--brass-gleam);
}

.cmd-diff {
  font-family: var(--font-tactical);
  font-size: 0.68rem;
  color: #fb923c;
}

.commander-card p {
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--text-secondary);
}

.launch-duel-btn {
  flex: 0 0 auto;
  padding: 0.52rem 1rem;
  font-size: 0.88rem;
}

/* Online P2P Lobby Controls */
.p2p-form-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.p2p-label {
  font-family: var(--font-heading);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.p2p-input {
  flex: 1;
  min-inline-size: 0;
  padding: 0.34rem 0.65rem;
  background: #060a14;
  border: 1px solid rgba(56, 189, 248, 0.45);
  clip-path: var(--clip-card);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
}

.p2p-input.code-input {
  font-family: var(--font-tactical);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass-gleam);
}

.p2p-split-boxes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.p2p-sub-box {
  padding: 0.65rem 0.75rem;
  background: rgba(8, 13, 24, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.28);
  clip-path: var(--clip-btn);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.45rem;
}

.p2p-sub-box h4 {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: #7dd3fc;
}

.p2p-sub-note {
  font-size: 0.68rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.room-code-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.3rem 0.5rem;
  background: rgba(217, 119, 6, 0.18);
  border: 1px solid var(--brass-bright);
  clip-path: var(--clip-card);
}

.room-code-lbl {
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.room-code-val {
  font-family: var(--font-tactical);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--brass-gleam);
}

.join-input-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.p2p-status-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  background: rgba(9, 14, 26, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.3);
  clip-path: var(--clip-card);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.status-dot {
  inline-size: 0.55rem;
  block-size: 0.55rem;
  border-radius: 50%;
  background: #64748b;
  flex-shrink: 0;
}

.p2p-status-banner[data-state="waiting"] {
  border-color: var(--brass-bright);
  color: var(--brass-gleam);
}
.p2p-status-banner[data-state="waiting"] .status-dot {
  background: var(--brass-bright);
  box-shadow: 0 0 8px var(--brass-bright);
}

.p2p-status-banner[data-state="connecting"] {
  border-color: #38bdf8;
  color: #bae6fd;
}
.p2p-status-banner[data-state="connecting"] .status-dot {
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}

.p2p-status-banner[data-state="connected"] {
  border-color: #4ade80;
  color: #bbf7d0;
}
.p2p-status-banner[data-state="connected"] .status-dot {
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
}

.p2p-status-banner[data-state="error"] {
  border-color: #fb7185;
  color: #fecdd3;
}
.p2p-status-banner[data-state="error"] .status-dot {
  background: #fb7185;
}

.online-live-badge {
  font-family: var(--font-tactical);
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.16rem 0.52rem;
  clip-path: var(--clip-card);
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid #34d399;
  color: #6ee7b7;
}

.gameover-footer {
  justify-content: center;
}

/* ==========================================================================
   Horizontal Defense Stance, Flipped/Hidden Owner Indicator & Combat Previews
   ========================================================================== */

/* Horizontal Landscape Card Orientation for Defense Mode on the Board */
.board-row .duel-card.defense-mode {
  inline-size: clamp(6.5rem, 8.8vw, 8.1rem);
  block-size: 4.35rem;
  max-block-size: 4.35rem;
  border-color: #38bdf8;
  box-shadow:
    0 5px 14px rgba(0, 0, 0, 0.9),
    0 0 12px rgba(56, 189, 248, 0.35),
    inset 0 1px 0 rgba(186, 230, 253, 0.35);
}

.board-row .duel-card.defense-mode .card-art-wrap {
  transform: none;
}

/* Owner's Card Set Face-Down (Appearing Flipped/Hidden to the Opponent) */
.duel-card.owner-face-down {
  border-style: dashed;
  border-width: 1.5px;
  border-color: #c084fc !important;
  box-shadow:
    0 5px 14px rgba(0, 0, 0, 0.9),
    0 0 14px rgba(192, 132, 252, 0.4),
    inset 0 0 16px rgba(88, 28, 135, 0.55);
}

.duel-card.owner-face-down .card-art-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    -45deg,
    rgba(15, 23, 42, 0.58) 0px,
    rgba(15, 23, 42, 0.58) 5px,
    rgba(126, 34, 206, 0.28) 5px,
    rgba(126, 34, 206, 0.28) 10px
  );
}

/* Top-Left / Center Visibility & Stance Ribbon on Board Cards */
.card-visibility-ribbon {
  position: absolute;
  inset-block-start: 0.1rem;
  inset-inline-start: 0.12rem;
  z-index: 4;
  font-family: var(--font-heading);
  font-size: 0.47rem;
  font-weight: 800;
  padding: 0.03rem 0.26rem;
  clip-path: var(--clip-card);
  pointer-events: none;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.card-visibility-ribbon.is-flipped-hidden {
  background: rgba(88, 28, 135, 0.95);
  border: 1px solid #d8b4fe;
  color: #f3e8ff;
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.65);
}

.card-visibility-ribbon.is-revealed-def {
  background: rgba(8, 47, 73, 0.94);
  border: 1px solid #38bdf8;
  color: #bae6fd;
}

.card-visibility-ribbon.is-revealed-atk {
  background: rgba(120, 53, 15, 0.92);
  border: 1px solid #fbbf24;
  color: #fef08a;
}

/* Opponent Face-Down Card Label */
.face-down-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  text-align: center;
}

.face-down-tag {
  font-family: var(--font-heading);
  font-size: 0.52rem;
  font-weight: 800;
  color: var(--brass-gleam);
  background: rgba(3, 6, 14, 0.86);
  padding: 0.04rem 0.28rem;
  border: 1px solid rgba(251, 191, 36, 0.45);
  clip-path: var(--clip-card);
}

/* Inspector Visibility Pill */
.inspector-visibility-pill {
  font-family: var(--font-heading);
  font-size: 0.66rem;
  font-weight: 800;
  padding: 0.16rem 0.48rem;
  clip-path: var(--clip-card);
  text-align: center;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-primary);
}

.inspector-visibility-pill.vis-hidden {
  background: rgba(88, 28, 135, 0.45);
  border-color: #c084fc;
  color: #f3e8ff;
}

.inspector-visibility-pill.vis-revealed {
  background: rgba(2, 132, 199, 0.28);
  border-color: #38bdf8;
  color: #bae6fd;
}

.inspector-visibility-pill.vis-opp-hidden {
  background: rgba(180, 83, 9, 0.32);
  border-color: #f59e0b;
  color: #fde68a;
}

/* Combat Outcome Preview Badge on Enemy Slots during Attack Selection */
.combat-preview-badge {
  position: absolute;
  inset-block-start: -0.1rem;
  inset-inline: 0.25rem;
  z-index: 25;
  font-family: var(--font-heading);
  font-size: 0.56rem;
  font-weight: 800;
  padding: 0.08rem 0.32rem;
  text-align: center;
  clip-path: var(--clip-card);
  pointer-events: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.9);
}

.combat-preview-badge.win {
  background: rgba(6, 95, 70, 0.96);
  border: 1px solid #4ade80;
  color: #bbf7d0;
}

.combat-preview-badge.tie {
  background: rgba(146, 64, 14, 0.96);
  border: 1px solid #fbbf24;
  color: #fef08a;
}

.combat-preview-badge.lose {
  background: rgba(136, 19, 55, 0.96);
  border: 1px solid #fb7185;
  color: #fecdd3;
}

.combat-preview-badge.unknown {
  background: rgba(88, 28, 135, 0.96);
  border: 1px solid #d8b4fe;
  color: #f3e8ff;
}

/* Clickable Empty Board Slots when Deploying/Setting from Hand */
.zone-slot.deployable-slot {
  border-color: rgba(251, 191, 36, 0.78);
  box-shadow:
    0 0 16px rgba(245, 158, 11, 0.4),
    inset 0 0 14px rgba(245, 158, 11, 0.22);
  cursor: pointer;
}

.zone-slot.deployable-slot:hover {
  border-color: #fef08a;
  box-shadow:
    0 0 22px rgba(251, 191, 36, 0.7),
    inset 0 0 18px rgba(251, 191, 36, 0.35);
}

/* Direct Attack Target Highlight on Opponent Commander Pod */
.opponent-pod.valid-direct-target {
  border-color: #fb7185;
  box-shadow:
    0 0 26px rgba(244, 63, 94, 0.85),
    inset 0 0 20px rgba(244, 63, 94, 0.4);
  cursor: pointer;
}

.opp-hand-count-pill {
  font-family: var(--font-heading);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.14rem 0.48rem;
  margin-inline-end: 0.35rem;
  clip-path: var(--clip-card);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(244, 63, 94, 0.45);
  color: #fda4af;
  white-space: nowrap;
}

/* ==========================================================================
   Thin Coherent Horizontal & Vertical Scrollbars (Damascus Steel & Brass)
   ========================================================================== */
*,
.scroller,
.battle-log-list,
.modal-card,
.lobby-card,
.battle-lobby-grid {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.battle-log-list,
.modal-card,
.lobby-card {
  scrollbar-gutter: stable;
}

@media (prefers-contrast: more) {
  :root,
  .scroller,
  .battle-log-list,
  .modal-card,
  .lobby-card,
  .battle-lobby-grid {
    --scrollbar-thumb: #fef08a;
    --scrollbar-track: #000000;
  }
}

/* Legacy fallback for WebKit/Blink browsers that do not support scrollbar-color */
@supports not (scrollbar-color: auto) {
  *::-webkit-scrollbar,
  .scroller::-webkit-scrollbar,
  .battle-log-list::-webkit-scrollbar,
  .modal-card::-webkit-scrollbar,
  .lobby-card::-webkit-scrollbar,
  .battle-lobby-grid::-webkit-scrollbar {
    width: 5px;
    height: 5px;
  }

  *::-webkit-scrollbar-thumb,
  .scroller::-webkit-scrollbar-thumb,
  .battle-log-list::-webkit-scrollbar-thumb,
  .modal-card::-webkit-scrollbar-thumb,
  .lobby-card::-webkit-scrollbar-thumb,
  .battle-lobby-grid::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 999px;
  }

  *::-webkit-scrollbar-track,
  .scroller::-webkit-scrollbar-track,
  .battle-log-list::-webkit-scrollbar-track,
  .modal-card::-webkit-scrollbar-track,
  .lobby-card::-webkit-scrollbar-track,
  .battle-lobby-grid::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
  }
}


