/* Scalar Core — Design System v1.5
   Bottom Action Bar, Chat Logs, Dimmed Board, SVG Units, Mini Stash */

/* Inter faces load from vendor/fonts.css (linked first in the page head). */

@font-face {
  font-family: 'yumeXHA';
  src: url('../assets/fonts/YUMEXHA-Regular.woff2') format('woff2'),
       url('../assets/fonts/YUMEXHA-Regular.woff') format('woff'),
       url('../assets/fonts/YUMEXHA-Regular.ttf') format('truetype'),
       url('../assets/fonts/YUMEXHA-Regular.eot') format('embedded-opentype');
  font-display: swap;
}

:root {
  --bg: #06030d;
  --crimson: #9e0066;
  --crimson-hi: #d9008c;
  --p1: #0099ff;
  --p1-color: var(--p1);
  --p1-dim: rgba(0,153,255,0.18);
  --p2: #ff2bb1;
  --p2-color: var(--p2);
  --p2-dim: rgba(255,43,177,0.18);
  --gold: #d4a800;
  --text: #fff;
  --text-mid: rgba(255,255,255,0.6);
  --text-low: rgba(255,255,255,0.3);
  --card: rgba(14,9,24,0.92);
  --card-b: rgba(255,255,255,0.09);
  --blur: 16px;
  --ease: 0.2s cubic-bezier(0.2,0.8,0.2,1);

  /* Fluid multi-breakpoint layout variables */
  --hud-margin: clamp(4px, 4vw, 80px);
  --hud-w: clamp(228px, 19vw, 368px);
  --stash-w: clamp(188px, 17vw, 328px);
  --stash-margin: clamp(16px, 4.5vw, 100px);
  --stash-padding-y: clamp(20px, 4vh, 70px);
  --die-chip-size: clamp(46px, 4.5vw, 78px);
  --die-svg-size: clamp(38px, 4.0vw, 70px);
  --die-chip-gap: clamp(4px, 0.6vw, 8px);
}

@media (max-width: 1600px) {
  :root {
    --hud-margin: 40px;
    --hud-w: 340px;
    --stash-w: 300px;
    --stash-margin: 60px;
    --stash-padding-y: 70px;
    --die-chip-size: 74px;
    --die-svg-size: 66px;
    --die-chip-gap: 8px;
  }
}

@media (max-width: 1366px) {
  :root {
    --hud-margin: 18px;
    --hud-w: 288px;
    --stash-w: 248px;
    --stash-margin: 38px;
    --stash-padding-y: 55px;
    --die-chip-size: 62px;
    --die-svg-size: 54px;
    --die-chip-gap: 6px;
  }
}

@media (max-width: 1180px) {
  :root {
    --hud-margin: 8px;
    --hud-w: 246px;
    --stash-w: 206px;
    --stash-margin: 28px;
    --stash-padding-y: 40px;
    --die-chip-size: 52px;
    --die-svg-size: 44px;
    --die-chip-gap: 5px;
  }
}

@media (max-width: 1024px) {
  :root {
    --hud-margin: 4px;
    --hud-w: 228px;
    --stash-w: 188px;
    --stash-margin: 24px;
    --stash-padding-y: 30px;
    --die-chip-size: 46px;
    --die-svg-size: 38px;
    --die-chip-gap: 4px;
  }
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}
html,body{width:100%;height:100%;background:#07080e !important;color:var(--text);font-family:'Inter',sans-serif;overflow:hidden;-webkit-font-smoothing:antialiased; isolation: isolate;}

body::before{
  content:'';position:fixed;inset:0;z-index:0;pointer-events:none;
  transition: background 0.8s ease, filter 0.8s ease, opacity 0.8s ease;
  background:
    radial-gradient(ellipse 75% 60% at 20% 10%, rgba(0, 168, 255, 0.12) 0%, transparent 65%),
    radial-gradient(ellipse 65% 75% at 85% 90%, rgba(255, 46, 147, 0.1) 0%, transparent 65%),
    radial-gradient(circle at 50% 50%, rgba(255, 194, 51, 0.03) 0%, transparent 60%) !important;
}

body.momentum-active::before {
  background:
    radial-gradient(ellipse 80% 65% at 20% 15%, rgba(0, 168, 255, 0.22) 0%, transparent 65%),
    radial-gradient(ellipse 75% 75% at 80% 85%, rgba(255, 46, 147, 0.2) 0%, transparent 65%),
    radial-gradient(circle at 50% 50%, rgba(255, 194, 51, 0.1) 0%, transparent 60%) !important;
  animation: momentum-ambient-drift 7s ease-in-out infinite alternate;
}

@keyframes momentum-ambient-drift {
  0% { transform: scale(1) translate(0, 0); opacity: 0.88; filter: brightness(1.1); }
  50% { transform: scale(1.03) translate(-8px, 10px); opacity: 1; filter: brightness(1.28); }
  100% { transform: scale(1.02) translate(10px, -6px); opacity: 0.92; filter: brightness(1.18); }
}

/* ── SCALAR CORE PRELOADER (MAIN SITE SYNC) ── */
body.is-loading {
  overflow: hidden !important;
}

#scalar-preloader {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background-color: #000;
  z-index: 9999999999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.8s;
  pointer-events: all;
  overflow: hidden;
}

#scalar-preloader::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  background-image: 
    radial-gradient(circle at center, rgba(126, 0, 71, 0.28) 0%, #000000 80%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M 60 0 L 0 0 0 60' fill='none' stroke='white' stroke-width='1' stroke-opacity='0.08'/%3E%3C/svg%3E");
  background-size: 100% 100vh, 50px 50px;
}

.cs-mouse-glow {
  position: absolute;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(126, 0, 71, 0.4) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
  animation: preloaderGlowPulse 4s infinite ease-in-out;
}

@keyframes preloaderGlowPulse {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.85; transform: translate(-50%, -50%) scale(1.12); }
}

#scalar-preloader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 85%;
  max-width: 380px;
  text-align: center;
}

.preloader-logo-container {
  position: relative;
  display: inline-block;
  margin-bottom: 24px;
}

.preloader-logo-bg, .preloader-logo-fill img {
  display: block;
  width: clamp(90px, 16vw, 150px);
  height: auto;
}

.preloader-logo-bg {
  filter: brightness(0) invert(1);
  opacity: 0.15;
}

.preloader-logo-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  clip-path: inset(100% 0 0 0);
  transition: clip-path 0.08s ease-out;
}

.preloader-logo-fill img {
  filter: brightness(0) invert(1) drop-shadow(0 0 16px rgba(255, 255, 255, 0.65));
  transition: filter 0.4s ease;
}

.preloader-title {
  font-family: 'yumeXHA', sans-serif;
  font-size: clamp(28px, 5.5vw, 44px);
  color: #fff;
  margin-bottom: 24px;
  letter-spacing: 7px;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.25);
  text-align: center;
  line-height: 1.1;
  text-transform: uppercase;
}

.preloader-bar-container {
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  border-radius: 2px;
}

.preloader-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: #7E0047;
  box-shadow: 0 0 10px #7E0047;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.preloader-text {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  text-align: center;
  transition: color 0.4s ease;
  min-height: 16px;
}

/* ── MODALS ── */
.modal{position:fixed;inset:0;z-index:300;display:none;align-items:center;justify-content:center;background:rgba(4,2,10,0.85);backdrop-filter:blur(14px);opacity:0;pointer-events:none;transition:opacity 0.3s ease;}
.modal.active{display:flex !important;opacity:1;pointer-events:auto;}
.modal-card{background:var(--card);border:1px solid rgba(158,0,102,0.4);border-radius:20px;padding:clamp(24px, 4vw, 44px);max-width:560px;width:95%;max-height:90vh;overflow-y:auto;scrollbar-width:thin;scrollbar-color:rgba(158,0,102,0.5) transparent;display:flex;flex-direction:column;align-items:center;gap:18px;box-shadow:0 0 60px rgba(158,0,102,0.3),0 16px 48px rgba(0,0,0,0.5);position:relative;box-sizing:border-box;}
.modal-card::before{content:'';position:absolute;bottom:0;left:0;right:0;height:3px;background:linear-gradient(90deg,var(--crimson),var(--crimson-hi),var(--crimson));border-radius:0 0 20px 20px;}
.modal-label{font-size:11px;font-weight:900;letter-spacing:4px;text-transform:uppercase;color:var(--text-low);}

/* Setup Specific */
.setup-eyebrow{font-size:10px;font-weight:900;letter-spacing:5px;text-transform:uppercase;color:var(--text-low);}
.setup-title{font-size:32px;font-weight:900;color:#fff;margin-bottom:8px;}
.setup-body{font-size:12px;color:var(--text-mid);line-height:1.7;}
.rolloff-wrap{display:flex;flex-direction:column;gap:12px;}
.rolloff-vals{display:flex;align-items:center;justify-content:center;gap:18px;}
.ro-val{font-size:22px;font-weight:900;text-align:center;box-sizing:border-box;}
.rv-p1{color:var(--p1-color);}
.rv-p2{color:var(--p2-color);}

@keyframes ro-num-jitter {
  0% { transform: translate(0, 0); opacity: 0.9; }
  25% { transform: translate(-0.5px, 0.5px); opacity: 1; }
  50% { transform: translate(0.5px, -0.5px); opacity: 0.85; }
  75% { transform: translate(-0.5px, -0.5px); opacity: 1; }
  100% { transform: translate(0, 0); opacity: 0.9; }
}
.ro-num {
  display: inline-block;
}
.ro-rolling {
  animation: ro-num-jitter 0.12s infinite !important;
}
.ro-vs{font-size:10px;font-weight:900;letter-spacing:2px;color:var(--text-low);}
#ro-result{font-size:11px;font-weight:700;letter-spacing:1.5px;text-align:center;color:var(--text-mid);min-height:18px;}
.setup-rules{border-top:1px solid rgba(255,255,255,0.07);padding-top:18px;margin-top:8px;}
.rules-head{font-size:8px;font-weight:900;letter-spacing:3px;text-transform:uppercase;color:var(--text-low);margin-bottom:8px;}
.rules-body{font-size:11px;color:rgba(255,255,255,0.4);line-height:1.7;}

/* ── BUTTONS ── */
.btn{font-family:'Inter',sans-serif;font-size:11px;font-weight:900;letter-spacing:2px;text-transform:uppercase;border:none;border-radius:50px;padding:10px 22px;cursor:pointer;display:inline-flex;align-items:center;gap:8px;transition:all var(--ease);position:relative;overflow:hidden;}
.btn::after{content:'';position:absolute;inset:0;background:rgba(255,255,255,0.07);opacity:0;transition:opacity var(--ease);border-radius:inherit;}
.btn:hover::after{opacity:1;}
.btn:active{transform:scale(0.97);}
.btn:disabled{opacity:0.28;cursor:not-allowed;pointer-events:none;}
.btn-primary{background:var(--crimson);color:#fff;}
.btn-primary:hover{background:var(--crimson-hi);box-shadow:0 0 20px rgba(158,0,102,0.5);}

.popup-p1 .btn-primary { background: var(--p1); border-color: var(--p1); }
.popup-p1 .btn-primary:hover { background: rgba(0,153,255,0.8); box-shadow: 0 0 20px rgba(0,153,255,0.5); }

.popup-p2 .btn-primary { background: var(--p2); border-color: var(--p2); }
.popup-p2 .btn-primary:hover { background: rgba(255,43,177,0.8); box-shadow: 0 0 20px rgba(255,43,177,0.5); }
.btn-ghost{background:transparent;color:var(--text);border:1.5px solid rgba(255,255,255,0.18);}
.btn-ghost:hover{border-color:rgba(255,255,255,0.4);}

/* Dedicated Solid Style for Combat Done / Accept Button */
#btn-combat-done {
  background: #1a0822 !important;
  border: 1.5px solid rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8) !important;
  opacity: 1 !important;
}
#btn-combat-done:hover {
  background: #2a0c36 !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 0 20px rgba(158, 0, 102, 0.6) !important;
}
#btn-combat-done:disabled,
#btn-combat-done[data-combat-accepted="true"] {
  opacity: 1 !important;
  background: #0d0413 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: rgba(255, 255, 255, 0.6) !important;
  cursor: not-allowed !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8) !important;
}

/* ══════════════════════════════════════════════════════════════
   SCALAR CORE MODAL: APERTURE FOCUS DESIGN SYSTEM
   ══════════════════════════════════════════════════════════════ */

#core-modal {
  background: rgba(10, 6, 20, 0.55) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
}

/* Chamber Card Frame (Frosted Glassmorphism matching exit modal) */
.core-chamber-card {
  position: relative;
  max-width: 520px !important;
  width: 92% !important;
  padding: 30px 32px 34px 32px !important;
  background: linear-gradient(180deg, rgba(32, 18, 48, 0.72) 0%, rgba(14, 8, 24, 0.82) 100%) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255, 177, 0, 0.35) !important;
  border-radius: 24px !important;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(255, 177, 0, 0.18),
    inset 0 1px 0 rgba(255, 215, 90, 0.25) !important;
  gap: 0 !important;
  overflow: hidden;
}

/* Eliminate modal-card crimson bottom accent bar */
.core-chamber-card::before {
  display: none !important;
}

/* Elegant ambient top aperture flare */
.core-chamber-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ffb100, transparent);
  opacity: 0.7;
}

/* ── HUD Telemetry Header ── */
.core-hud-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-bottom: 8px;
  text-align: center;
}
.core-eyebrow-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Orbitron', 'Inter', sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
}
.core-scorer-tag {
  letter-spacing: 2.5px;
  transition: color 0.3s ease;
}
.core-hud-divider {
  color: rgba(255, 255, 255, 0.25);
  font-weight: 400;
}
.core-sys-label {
  color: #ffb100;
  letter-spacing: 3px;
  text-shadow: 0 0 12px rgba(255, 177, 0, 0.4);
  font-family: 'Orbitron', 'Inter', sans-serif;
}
.core-status-line {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  transition: all 0.3s ease;
  text-align: center;
}
.core-chamber-card.is-rolled .core-status-line {
  color: rgba(255, 177, 0, 0.85);
  letter-spacing: 3px;
}

/* ── 3D D4 Relic Chamber Widget ── */
.core-d4-widget {
  position: relative;
  width: 100%;
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  cursor: pointer;
  user-select: none;
  transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.core-chamber-card.is-rolled .core-d4-widget {
  height: 320px;
}

/* Atmospheric Core Glow */
.core-die-ambient-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 177, 0, 0.18) 0%, rgba(255, 120, 0, 0.05) 55%, transparent 75%);
  filter: blur(40px);
  z-index: 1;
  transition: opacity 0.5s ease;
}
.core-chamber-card.is-rolled .core-die-ambient-glow {
  opacity: 0.35;
}

/* Shockwaves */
.core-shockwave-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.core-shockwave-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 177, 0, 0.45);
  opacity: 0;
  pointer-events: none;
}
.core-d4-widget.is-rolling .core-shockwave-ring.c-ring-1 {
  animation: coreShockwave 1.2s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
}
.core-d4-widget.is-rolling .core-shockwave-ring.c-ring-2 {
  animation: coreShockwave 1.2s cubic-bezier(0.1, 0.8, 0.3, 1) 0.4s infinite;
}
@keyframes coreShockwave {
  0% { width: 100px; height: 100px; opacity: 0.9; transform: scale(0.6); }
  100% { width: 480px; height: 480px; opacity: 0; transform: scale(1.1); }
}

/* Core Die Canvas & Symbol Overlay */
.core-die-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}
.core-3d-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 440px !important;
  height: 440px !important;
  max-width: 85vw;
  max-height: 85vw;
  aspect-ratio: 1 / 1 !important;
  transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.45s ease;
  pointer-events: auto;
}
.core-d4-widget.is-locked .core-3d-canvas {
  opacity: 0.22 !important;
  transform: translate(-50%, -50%) scale(0.95);
}

/* Crisp Vector Outcome Symbol (Centered directly in the D4 chamber) */
.core-face-symbol {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 260px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 4;
}
.core-face-symbol svg {
  width: 220px;
  height: 220px;
  color: #ffffff !important;
  fill: #ffffff !important;
  filter: drop-shadow(0 0 24px rgba(255, 177, 0, 0.8)) drop-shadow(0 4px 20px rgba(0, 0, 0, 0.95));
  animation: coreFaceManifest 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes coreFaceManifest {
  0% { transform: scale(0.65); opacity: 0; filter: brightness(2) drop-shadow(0 0 50px #ffb100); }
  100% { transform: scale(1); opacity: 1; filter: drop-shadow(0 0 24px rgba(255, 177, 0, 0.8)) drop-shadow(0 4px 20px rgba(0,0,0,0.95)); }
}

/* Micro-HUD Roll Prompt Badge */
.core-prompt-badge {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 8, 22, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 177, 0, 0.4);
  border-radius: 50px;
  padding: 8px 20px;
  z-index: 6;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 177, 0, 0.2);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.core-prompt-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffb100;
  box-shadow: 0 0 8px #ffb100;
  animation: promptDotPulse 1.4s ease-in-out infinite;
}
@keyframes promptDotPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.4); opacity: 1; }
}
.core-prompt-text {
  font-family: 'Orbitron', 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #fff;
  text-transform: uppercase;
}

/* ── Outcome Resolution Section ── */
.core-outcome-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}
.core-outcome-title, #core-modal-title {
  font-family: 'Orbitron', 'Inter', sans-serif !important;
  font-size: 24px !important;
  font-weight: 900 !important;
  letter-spacing: 5px !important;
  color: #ffffff !important;
  text-shadow: 0 0 16px rgba(255, 215, 90, 0.6) !important;
  margin: 4px 0 6px 0 !important;
  text-transform: uppercase;
}
.core-outcome-desc, #core-modal-desc {
  font-family: 'Inter', sans-serif !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
  color: rgba(255, 255, 255, 0.72) !important;
  max-width: 420px !important;
  margin: 0 auto 12px auto !important;
  text-align: center !important;
}

/* ── Monolithic Primary Action Button ── */
.core-action-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 6px;
}
#btn-core-ok, .btn-core-action {
  font-family: 'Orbitron', 'Inter', sans-serif !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: 2.5px !important;
  text-transform: uppercase !important;
  background: linear-gradient(180deg, #ffb100 0%, #d48b00 100%) !important;
  color: #0b0512 !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 50px !important;
  padding: 12px 32px !important;
  box-shadow: 0 0 25px rgba(255, 177, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.5) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer;
}
#btn-core-ok:hover:not(:disabled), .btn-core-action:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.02) !important;
  box-shadow: 0 0 35px rgba(255, 177, 0, 0.6), 0 6px 16px rgba(0, 0, 0, 0.6) !important;
  filter: brightness(1.1) !important;
}

#btn-core-ok:disabled,
#btn-core-ok[data-core-confirmed="true"] {
  opacity: 1 !important;
  background: #0d0413 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  color: rgba(255, 255, 255, 0.6) !important;
  cursor: not-allowed !important;
}
#btn-core-acc-p1:disabled,
#btn-core-acc-p1.is-accepted {
  opacity: 1 !important;
  background: #04182b !important;
  border-color: rgba(0, 210, 255, 0.3) !important;
  color: rgba(255, 255, 255, 0.6) !important;
  cursor: not-allowed !important;
}
#btn-core-acc-p2:disabled,
#btn-core-acc-p2.is-accepted {
  opacity: 1 !important;
  background: #24051a !important;
  border-color: rgba(255, 0, 127, 0.3) !important;
  color: rgba(255, 255, 255, 0.6) !important;
  cursor: not-allowed !important;
}

/* ── GAME SCREEN LAYOUT ── */
#game-screen{
  position:fixed;inset:0;z-index:10;
  display:flex; flex-direction:column;
  overflow: hidden;
}

/* ── GAME HEADER ── */
.game-header-title {
  position: absolute;
  top: 0;
  left: 0; right: 0;
  width: 100%;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 40;
  padding: 0 80px;
  box-sizing: border-box;
  pointer-events: none;
}
.game-header-title * { pointer-events: auto; }

/* Left column — Tabletop game link */
.ghdr-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

/* Center: title row vertically centered */
.ghdr-center {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ghdr-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 6px;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  white-space: nowrap;
}
.ghdr-title-row .title-sep {
  color: var(--p1);
  font-weight: 200;
  font-family: sans-serif;
  opacity: 0.9;
  transition: color 0.4s ease;
}
#game-mode-tag {
  font-weight: 300;
  font-size: 18px;
  letter-spacing: 6px;
  opacity: 0.85;
  white-space: nowrap;
  display: inline-block;
}

/* Tabletop Game Pill Button in Electric Blue */
.tabletop-toggle-btn {
  font-family: 'Orbitron', sans-serif !important;
  font-weight: 800 !important;
  font-size: 10.5px !important;
  letter-spacing: 1.5px !important;
  height: 36px !important;
  width: auto !important;
  min-width: max-content !important;
  white-space: nowrap !important;
  padding: 0 16px !important;
  border-radius: 18px !important;
  color: #00a3ff !important;
  border: 1px solid rgba(0, 163, 255, 0.45) !important;
  background: rgba(0, 163, 255, 0.08) !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  flex-shrink: 0 !important;
}
.tabletop-toggle-btn:hover {
  background: rgba(0, 163, 255, 0.22) !important;
  border-color: rgba(0, 163, 255, 0.85) !important;
  box-shadow: 0 0 16px rgba(0, 163, 255, 0.45) !important;
  color: #ffffff !important;
}

/* Right column: X + audio — right-aligned with Violet card right edge */
.ghdr-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* Round exit button */
.btn-exit-round {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(20, 10, 30, 0.75);
  color: rgba(255, 255, 255, 0.65);
  font-size: 16px;
  line-height: 1;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s, background 0.2s, transform 0.2s;
  flex-shrink: 0;
  box-sizing: border-box !important;
}
.btn-exit-round:hover {
  border-color: rgba(255, 80, 80, 0.6);
  color: rgba(255, 120, 120, 0.95);
  background: rgba(40, 10, 10, 0.85);
  box-shadow: 0 0 12px rgba(255, 60, 60, 0.35);
  transform: scale(1.05);
}

/* Red Tutorial Exit Button (Single unified button at far right) */
.btn-exit-round.tutorial-exit-mode {
  border-color: rgba(255, 85, 119, 0.75) !important;
  background: rgba(255, 85, 119, 0.18) !important;
  color: #ff5577 !important;
  box-shadow: 0 0 14px rgba(255, 85, 119, 0.45) !important;
}
.btn-exit-round.tutorial-exit-mode:hover {
  border-color: #ff3366 !important;
  background: rgba(255, 51, 102, 0.35) !important;
  color: #ffffff !important;
  box-shadow: 0 0 22px rgba(255, 51, 102, 0.8) !important;
  transform: scale(1.1);
}

/* Audio icon buttons */
.audio-toggle-btn {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(20, 10, 30, 0.75);
  color: rgba(255, 255, 255, 0.6);
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s, background 0.2s, transform 0.2s;
  flex-shrink: 0;
  box-sizing: border-box !important;
}
.audio-toggle-btn:hover {
  border-color: rgba(255, 255, 255, 0.45);
  color: rgba(255, 255, 255, 0.95);
  background: rgba(30, 15, 50, 0.85);
  transform: scale(1.05);
}

/* AI Faction Choice Buttons */
.btn-faction-choice {
  outline: none;
  user-select: none;
}
.btn-faction-choice:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.btn-faction-choice.selected[data-faction="P1"] {
  border-color: var(--p1-color) !important;
  background: rgba(0, 163, 255, 0.22) !important;
  box-shadow: 0 0 14px rgba(0, 163, 255, 0.4) !important;
}
.btn-faction-choice.selected[data-faction="P2"] {
  border-color: var(--p2-color) !important;
  background: rgba(163, 0, 255, 0.22) !important;
  box-shadow: 0 0 14px rgba(163, 0, 255, 0.4) !important;
}

/* AI Turn Input Lockout */
body.ai-turn #action-bar-wrapper .act-btn,
body.ai-turn .act-btn {
  pointer-events: none !important;
  opacity: 0.55 !important;
  cursor: not-allowed !important;
}
body.ai-turn .stash-chip {
  cursor: not-allowed !important;
}
body.ai-turn .hex-poly {
  cursor: not-allowed !important;
}

/* TOP HUD */
#top-hud{
  display:flex;align-items:center;justify-content:space-between;
  padding:8px 16px;
  background:rgba(8,4,16,0.88);backdrop-filter:blur(var(--blur));
  border-bottom:1px solid rgba(255,255,255,0.07);
  z-index:50;
}




.hud-player {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: 0 clamp(8px, 1.2vw, 20px);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(180deg, rgba(22, 12, 38, 0.96), rgba(12, 6, 22, 0.96));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 1px rgba(255, 255, 255, 0.2) inset;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  width: var(--hud-w, 368px) !important;
  height: clamp(66px, 7.5vh, 82px);
  box-sizing: border-box;
}
.hud-player.active {
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.2) inset, 0 14px 44px rgba(0, 0, 0, 0.85);
}

.hp-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 5;
}

/* === SETUP SCREEN BACKGROUND OVERRIDES === */
#setup-screen .btn-ghost {
  background: rgba(35, 15, 50, 0.6) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-color: rgba(255, 255, 255, 0.35) !important;
}

#setup-screen .btn-primary {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

#setup-screen .setup-rules {
  background: rgba(20, 10, 30, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 12px;
}

/* Player 1 (Azure, Left Screen): Edge Wing */
#hud-p1 .hp-name-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  text-align: left;
  width: clamp(68px, 6.8vw, 100px);
  flex-shrink: 0;
}

#hud-p1 .hp-tokens-slot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: clamp(68px, 6.8vw, 100px);
  flex-shrink: 0;
}

/* Player 2 (Violet, Right Screen): Bilateral Mirror Wing */
#hud-p2 .hp-name-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
  width: clamp(68px, 6.8vw, 100px);
  flex-shrink: 0;
}

#hud-p2 .hp-tokens-slot {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: clamp(68px, 6.8vw, 100px);
  flex-shrink: 0;
}

.hp-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hp-actions-row {
  margin-top: 4px;
}

.p-actions {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-mid);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.hud-player.active .p-actions {
  opacity: 1;
}
.hud-player.active{border-color:var(--p1);border-width:2px;box-shadow:0 0 16px rgba(0,153,255,0.35);}
#hud-p2.active{border-color:var(--p2);border-width:2px;box-shadow:0 0 16px rgba(255,43,177,0.35);}
.hp-dot{width:11px;height:11px;border-radius:50%;flex-shrink:0;}
.hp1-dot{background:var(--p1);box-shadow:0 0 8px var(--p1);}
.hp2-dot{background:var(--p2);box-shadow:0 0 8px var(--p2);}
.hp-name{font-size:clamp(13px, 1.25vw, 16px);font-weight:900;letter-spacing:1.5px;text-transform:uppercase;color:#fff;}
.hp-row{display:flex;align-items:center;gap:6px;}
.hp-tok{font-size:20px;font-weight:900;}
.hp-tok-label{font-size:9px;letter-spacing:1.5px;text-transform:uppercase;color:var(--text-low);}
.hp-pips{
  display: flex;
  align-items: center;
  gap: 8px;
}
.pip{
  width: clamp(16px, 1.6vw, 24px);
  height: clamp(18px, 1.8vw, 28px);
  border-radius: 0;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: rgba(255,255,255,0.1);
  position: relative;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 0 1px rgba(255,255,255,0.35));
  flex-shrink: 0;
}
.pip::after {
  content: '';
  position: absolute;
  inset: 2px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: rgba(14, 7, 24, 0.88);
  transition: all 0.3s ease;
}

.pip.filled,
#p1-pips-wrapper .pip.filled,
#p2-pips-wrapper .pip.filled {
  background: linear-gradient(135deg, #00ffc8 0%, #39ff14 28%, #a6ff00 52%, #00e5ff 78%, #20cc00 100%);
  background-size: 260% 260%;
  animation: tokenGlimmer 5s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 6px rgba(57, 255, 20, 0.95)) drop-shadow(0 0 16px rgba(0, 255, 200, 0.8)) drop-shadow(0 0 28px rgba(57, 255, 20, 0.45));
}
.pip.filled::after,
#p1-pips-wrapper .pip.filled::after,
#p2-pips-wrapper .pip.filled::after {
  display: none;
}

@keyframes tokenGlimmer {
  0% {
    background-position: 0% 25%;
    filter: drop-shadow(0 0 6px rgba(57, 255, 20, 0.95)) drop-shadow(0 0 14px rgba(0, 255, 180, 0.75)) drop-shadow(0 0 24px rgba(57, 255, 20, 0.4));
  }
  50% {
    background-position: 100% 75%;
    filter: drop-shadow(0 0 10px rgba(130, 255, 50, 1)) drop-shadow(0 0 22px rgba(0, 230, 255, 0.9)) drop-shadow(0 0 34px rgba(57, 255, 20, 0.65));
  }
  100% {
    background-position: 0% 25%;
    filter: drop-shadow(0 0 6px rgba(57, 255, 20, 0.95)) drop-shadow(0 0 14px rgba(0, 255, 180, 0.75)) drop-shadow(0 0 24px rgba(57, 255, 20, 0.4));
  }
}

.pip.token-earned-anim {
  animation: tokenEarnedPop 0.85s cubic-bezier(0.2, 0.9, 0.3, 1.4) forwards;
}

@keyframes tokenEarnedPop {
  0% { transform: scale(0.4); filter: drop-shadow(0 0 25px #ffffff) brightness(3); }
  40% { transform: scale(1.38); filter: drop-shadow(0 0 30px #39ff14) brightness(2.2); }
  75% { transform: scale(0.94); }
  100% { transform: scale(1); }
}

#hud-center{display:flex;flex-direction:column;align-items:center;gap:4px;}
.core-badge{display:inline-flex;align-items:center;padding:4px 14px;border-radius:50px;font-size:9px;font-weight:900;letter-spacing:3px;text-transform:uppercase;border:1px solid;transition:all var(--ease);}
.cs-aether     {background:rgba(220,220,240,0.1);border-color:rgba(200,200,230,0.4);color:#cccce0;}
.cs-momentum   {background:rgba(0,180,255,0.1);border-color:rgba(0,180,255,0.4);color:#00c8ff;}
.cs-equilibrium{background:rgba(0,255,160,0.1);border-color:rgba(0,255,160,0.4);color:#00ffb0;}
.cs-reversal   {background:rgba(255,140,0,0.1);border-color:rgba(255,140,0,0.4);color:#ff9500;}
.bank-row{display:flex;align-items:center;gap:6px;font-size:9px;font-weight:700;color:var(--text-low);letter-spacing:1px;}
.bank-label{text-transform:uppercase;letter-spacing:2px;}
.bank-val{font-size:16px;font-weight:900;color:var(--text-low);}
.turn-display{font-size:10px;font-weight:800;letter-spacing:1.5px;color:rgba(255,255,255,0.5);text-transform:uppercase;}

/* ── BOARD COLUMN ── */
#board-col{
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  z-index: 20;
  min-height: 0;
}
.turn-indicator{width:100%;height:6px;flex-shrink:0;background:transparent;transition:all 0.4s ease;}
.ti-p1.ind-active{background:linear-gradient(90deg,transparent,var(--p1),transparent);box-shadow:0 -2px 14px rgba(0,153,255,0.65);}
.ti-p2.ind-active{background:linear-gradient(90deg,transparent,var(--p2),transparent);box-shadow:0 2px 14px rgba(255,43,177,0.65);}

#board-wrap{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;position:relative;padding:12px;}

#board-col {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}



svg#hex-board{
  display:block;
  width:auto;
  height:auto;
  max-width:100%;
  max-height:100%;
  overflow:visible;
  transition:opacity 0.3s ease; 
  pointer-events:none;
}

svg#hex-board > g#hex-group { pointer-events: auto; }
svg#hex-board > g#unit-group, svg#hex-board > g#core-group { pointer-events: none; }

.action-hint-overlay{position:absolute;top:24px;left:50%;transform:translateX(-50%);background:var(--card);border:1px solid rgba(255,255,255,0.15);padding:10px 20px;border-radius:50px;font-size:12px;font-weight:800;letter-spacing:1.5px;color:#fff;box-shadow:0 4px 16px rgba(0,0,0,0.6);pointer-events:none;z-index:20;}

/* ── LOG PANEL (Bottom Center) ── */
#log-panel{
  position: fixed !important;
  left: 50% !important;
  bottom: 0px !important;
  transform: translateX(-50%) !important;
  width: min(480px, 90vw) !important;
  height: 350px !important;
  display: none !important;
  flex-direction: column !important;
  background: rgba(8,4,16,0.92) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-bottom: none !important;
  border-radius: 16px 16px 0 0 !important;
  z-index: 200 !important;
  pointer-events: auto !important;
  transition: transform 0.3s cubic-bezier(0.2,0.8,0.2,1) !important;
  box-shadow: 0 -4px 30px rgba(0,0,0,0.6) !important;
}
body.game-active #log-panel{
  display: flex !important;
}
#log-panel.collapsed{transform: translate(-50%, calc(100% - 32px)) !important;}

.log-toggle-btn{
  height: 32px !important;
  width: 100% !important;
  background: rgba(255,255,255,0.03) !important;
  border: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
  color: var(--text-mid) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: 2px !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  user-select: none !important;
  pointer-events: auto !important;
  z-index: 201 !important;
}
.log-toggle-btn:hover{color:#fff !important; background: rgba(255,255,255,0.08) !important;}


.mini-stash-row{
  display:flex; align-items:center; gap:8px;
  padding-top:6px; border-top:1px solid rgba(255,255,255,0.08);
  width: 100%; justify-content:center;
}
.mini-group{display:flex; gap:2px;}
.mini-group-med{margin: 0 10px;}
.mini-die{width:18px;height:18px;border-radius:3px;border:1px solid rgba(255,255,255,0.2);display:flex;align-items:center;justify-content:center;font-size:8px;font-weight:900;color:var(--text-mid);background:rgba(255,255,255,0.05);transition:all 0.2s;}
.mini-die.m-d4{border-color:rgba(180,0,255,0.5);}
.mini-die.m-d6{border-color:rgba(0,180,255,0.5);}
.mini-die.m-d8{border-color:rgba(0,255,160,0.5);}
.mini-die.m-d10{border-color:rgba(212,168,0,0.5);}
.mini-die.m-d12{border-color:rgba(255,140,0,0.5);}
.mini-die.m-d20{border-color:rgba(255,43,177,0.5);}
.mini-die.deployed{opacity:0.25;text-decoration:line-through;}

.log-head{padding:12px 14px 8px;font-size:8px;font-weight:900;letter-spacing:3px;text-transform:uppercase;color:var(--text-low);border-bottom:1px solid rgba(255,255,255,0.06);}
#game-log{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:8px;scrollbar-width:thin;scrollbar-color:rgba(158,0,102,0.35) transparent;}
.chat-msg{font-size:10px;padding:6px 10px;border-radius:8px;line-height:1.4;max-width:90%;box-shadow:0 2px 4px rgba(0,0,0,0.2);}
.chat-p1{align-self:flex-start;background:rgba(0,153,255,0.12);border:1px solid rgba(0,153,255,0.3);color:#e0f0ff;}
.chat-p2{align-self:flex-end;background:rgba(255,43,177,0.12);border:1px solid rgba(255,43,177,0.3);color:#ffe0e8;}
.chat-sys{align-self:center;background:rgba(255,255,255,0.05);border:1px solid rgba(255,255,255,0.1);color:var(--text-mid);text-align:center;font-weight:700;}

/* ── ACTION BAR ── */
#action-bar {
  flex: 1;
  position: relative;
  height: 64px;
  margin-left: -14px;
  margin-right: -14px;
  z-index: 5;
  background: rgba(8, 4, 16, 0.92);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bar-center {
  display: flex;
  gap: 12px;
  align-items: center;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

#action-bar.ab-p1 .bar-center { transform: none; }
#action-bar.ab-p2 .bar-center { transform: none; }
#action-bar::before, #action-bar::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 3px;
  background: transparent;
  transition: all 0.4s ease;
  pointer-events: none;
}
#action-bar::before { top: 0; }
#action-bar::after { bottom: 0; }

#action-bar.ab-p1::before, #action-bar.ab-p1::after {
  background: linear-gradient(90deg, rgba(0, 153, 255, 0.85), rgba(0, 153, 255, 0.4) 60%, transparent);
  box-shadow: 0 0 15px rgba(0, 153, 255, 0.5);
}
#action-bar.ab-p2::before, #action-bar.ab-p2::after {
  background: linear-gradient(90deg, transparent, rgba(255, 43, 177, 0.4) 40%, rgba(255, 43, 177, 0.85));
  box-shadow: 0 0 15px rgba(255, 43, 177, 0.5);
}


#main-game-area {
  width: 100% !important;
  box-sizing: border-box !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: stretch !important;
  padding: 0 4px !important;
  overflow: hidden !important;
}

.pick-action-glow{box-shadow: 0 0 40px rgba(255,255,255,0.1) inset;}
.pick-action-glow .act-btn:not(:disabled){animation:btn-pulse 1.5s infinite alternate;}

@keyframes btn-pulse{0%{box-shadow:0 0 0 rgba(255,255,255,0);}100%{box-shadow:0 0 15px rgba(255,255,255,0.2);}}

.bar-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-left: var(--hud-margin, 80px) !important;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}
.bar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-right: var(--hud-margin, 80px) !important;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.action-tracker{font-size:11px;font-weight:900;letter-spacing:2px;text-transform:uppercase;color:var(--text-mid);}

.act-btn{
  display:flex;align-items:center;gap:8px;
  padding:8px 18px;border-radius:10px;
  background:rgba(255,255,255,0.04);
  border:1.5px solid rgba(255,255,255,0.1);
  color:var(--text-mid);font-family:'Inter',sans-serif;
  font-size:12px;font-weight:800;letter-spacing:1px;
  cursor:pointer;transition:all var(--ease);
}
.act-btn:disabled{opacity:0.25;cursor:not-allowed;}
.act-text{font-size:11px;font-weight:900;letter-spacing:1.5px;text-transform:uppercase;}

/* P1 Hovers & Active */
.ab-p1 .act-btn:not(:disabled):not(.act-active):hover { background:rgba(0,153,255,0.08); border-color:rgba(0,153,255,0.25); color:#fff; }
.ab-p1 .act-btn.act-active { border-color:var(--p1); background:rgba(0,153,255,0.2); color:#fff; box-shadow:0 0 14px rgba(0,153,255,0.3); }
.ab-p1 .act-btn.act-active:hover { background:rgba(0,153,255,0.35); border-color:var(--p1); box-shadow:0 0 20px rgba(0,153,255,0.5); }
.ab-p1 .act-end:not(:disabled) { border-color:rgba(0,153,255,0.5); color:var(--p1); }
.ab-p1 .act-end:not(:disabled):hover { background:rgba(0,153,255,0.25); box-shadow:0 0 14px rgba(0,153,255,0.35); border-color:var(--p1); color:#fff; }

/* P2 Hovers & Active */
.ab-p2 .act-btn:not(:disabled):not(.act-active):hover { background:rgba(255,43,177,0.08); border-color:rgba(255,43,177,0.25); color:#fff; }
.ab-p2 .act-btn.act-active { border-color:var(--p2); background:rgba(255,43,177,0.2); color:#fff; box-shadow:0 0 14px rgba(255,43,177,0.3); }
.ab-p2 .act-btn.act-active:hover { background:rgba(255,43,177,0.35); border-color:var(--p2); box-shadow:0 0 20px rgba(255,43,177,0.5); }
.ab-p2 .act-end:not(:disabled) { border-color:rgba(255,43,177,0.5); color:var(--p2); }
.ab-p2 .act-end:not(:disabled):hover { background:rgba(255,43,177,0.25); box-shadow:0 0 14px rgba(255,43,177,0.35); border-color:var(--p2); color:#fff; }


/* ── SIDE STASH PANELS ── */
.side-stash{
  position: relative;
  width: var(--stash-w, 328px) !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: rgba(8, 12, 22, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: none !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 8;
  padding: var(--stash-padding-y, 80px) 0 !important;
  margin-top: 0 !important;
  border-radius: 0 0 12px 12px !important;
  align-self: flex-start;
  min-height: 0 !important;
  max-height: calc(100vh - 130px) !important;
  height: auto !important;
  box-sizing: border-box;
  transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              height 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.45s ease,
              border-color 0.45s ease,
              box-shadow 0.45s ease !important;
  flex-shrink: 0;
}
.side-stash.stash-active{
  width: var(--stash-w, 328px) !important;
  margin-top: 0 !important;
  z-index: 8 !important;
  border-top: none !important;
  border-radius: 0 0 12px 12px !important;
}
.stash-p1.stash-active{ 
  width: var(--stash-w, 328px) !important;
  margin-left: var(--stash-margin, 100px) !important;
  padding: var(--stash-padding-y, 80px) 0 !important;
  background: linear-gradient(180deg, rgba(0,153,255,0.28) 0%, rgba(0,153,255,0.05) 50%, rgba(0,0,0,0.30) 100%) !important;
  border: 1px solid rgba(0, 210, 255, 0.3) !important;
  border-top: none !important;
  border-radius: 0 0 12px 12px !important;
  box-shadow: 0 12px 36px rgba(0,0,0,0.5), inset 0 0 24px rgba(0,210,255,0.10) !important;
}
.stash-p2.stash-active{ 
  width: var(--stash-w, 328px) !important;
  margin-right: var(--stash-margin, 100px) !important;
  padding: var(--stash-padding-y, 80px) 0 !important;
  background: linear-gradient(180deg, rgba(255,43,177,0.28) 0%, rgba(255,43,177,0.05) 50%, rgba(0,0,0,0.30) 100%) !important;
  border: 1px solid rgba(255, 0, 127, 0.3) !important;
  border-top: none !important;
  border-radius: 0 0 12px 12px !important;
  box-shadow: 0 12px 36px rgba(0,0,0,0.5), inset 0 0 24px rgba(255,43,177,0.10) !important;
}
.stash-p1{border: 1px solid rgba(0, 210, 255, 0.3) !important; border-top: none !important; border-radius: 0 0 12px 12px !important; margin-left: var(--stash-margin, 100px) !important; width: var(--stash-w, 328px) !important; padding: var(--stash-padding-y, 80px) 0 !important;}
.stash-p2{border: 1px solid rgba(255, 0, 127, 0.3) !important; border-top: none !important; border-radius: 0 0 12px 12px !important; margin-right: var(--stash-margin, 100px) !important; width: var(--stash-w, 328px) !important; padding: var(--stash-padding-y, 80px) 0 !important;}






.stash-group-vert{position:relative; width:100%;}
.row-popup{
  position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(10,5,20,0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 12px;
  border-radius: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  z-index: 10000 !important;
  pointer-events: auto !important;
  min-width: 100px;
}


.row-popup-lbl{font-size:13px;font-weight:900;text-transform:uppercase;letter-spacing:2px;color:#fff;text-shadow:0 0 8px rgba(255,255,255,0.25);text-align:center;}
.btn-sm{padding: 6px 12px; font-size: 11px;}

/* ── STASH CHIPS & GROUPS ── */
.stash-grid-wrapper{
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.6vh, 20px);
  width: 100%;
  transform-origin: top center;
  transition: transform 0.25s ease;
}
@media (max-height: 1000px) {
  .stash-grid-wrapper { transform: scale(0.92); }
}
@media (max-height: 920px) {
  .stash-grid-wrapper { transform: scale(0.85); }
}
@media (max-height: 840px) {
  .stash-grid-wrapper { transform: scale(0.77); }
}
@media (max-height: 760px) {
  .stash-grid-wrapper { transform: scale(0.70); }
}
.stash-group-vert{display:flex;flex-direction:column;gap:8px;align-items:center;}
.sg-head{font-size:12px;font-weight:900;letter-spacing:2px;text-transform:uppercase;color:var(--text-low);text-align:center;border-bottom:1px solid rgba(255,255,255,0.1);padding-bottom:4px;width:136px;margin-bottom:8px;color:rgba(255,255,255,0.5);}
.stash-row{display:flex;align-items:center;justify-content:center;gap:var(--die-chip-gap, 8px) !important;}

.die-chip{
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-mid);
  width: var(--die-chip-size, 80px) !important;
  height: var(--die-chip-size, 80px) !important;
  border-radius:12px;
  background:rgba(255,255,255,0.03);
  border:1.5px solid rgba(255,255,255,0.1);
  display:flex;flex-direction:column;
  align-items:center;justify-content:space-between;
  padding: 4px 0;
  cursor:pointer;transition:all var(--ease);
  font-family:'Inter',sans-serif;position:relative;
}
.die-chip:hover {
  background:rgba(255,255,255,0.08);
  border-color:rgba(255,255,255,0.3);
}

.chip-svg{width:var(--die-svg-size, 72px) !important;height:var(--die-svg-size, 72px) !important;}

.stash-p1 .chip-pending{
  border-color: var(--p1-color) !important;
  box-shadow: 0 0 24px rgba(0,153,255,0.4) inset, 0 4px 16px rgba(0,153,255,0.4) !important;
  background: rgba(0,153,255,0.15) !important;
  transform: scale(1.1);
  z-index: 10;
}
.stash-p2 .chip-pending{
  border-color: var(--p2-color) !important;
  box-shadow: 0 0 24px rgba(255,43,177,0.4) inset, 0 4px 16px rgba(255,43,177,0.4) !important;
  background: rgba(255,43,177,0.15) !important;
  transform: scale(1.1);
  z-index: 10;
}
.chip-pending-val{
  position: absolute;
  top: -8px;
  right: -8px;
  background: #fff;
  color: #000;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}
.die-chip:hover:not(.chip-deployed){transform:translateY(-4px) scale(1.05);background:rgba(255,255,255,0.09);border-color:#fff;box-shadow:0 6px 18px rgba(0,0,0,0.4);}

.chip-deployed{opacity:0.15;cursor:not-allowed;background:transparent;border-style:dashed; border-color: rgba(255,255,255,0.1) !important; color: #555 !important;}
.chip-deployed svg { color: #555 !important; filter: none !important; }
.chip-deployed 

/* ── COMBAT MODAL ── */
.combat-participants{display:flex;align-items:center;justify-content:space-between;width:100%;background:rgba(255,255,255,0.03);padding:20px;border-radius:12px;border:1px solid rgba(255,255,255,0.05);}
.cp-side{display:flex;flex-direction:column;align-items:center;gap:8px;}
.cp-title{font-size:9px;font-weight:900;letter-spacing:3px;text-transform:uppercase;color:var(--text-low);}
.cp-unit{font-size:24px;font-weight:900;}
.cp-atk{transition: color 0.3s;}
.cp-def{transition: color 0.3s;}
.cp-vs{font-size:16px;font-weight:900;color:var(--text-low);font-style:italic;}
.combat-rolls{display:flex;align-items:center;gap:32px;margin-top:12px;}
.cb-roll-box{width:auto;min-width:50px;max-width:140px;height:auto;min-height:50px;padding:8px 12px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:clamp(12px, 3.5vw, 18px);font-weight:900;background:rgba(255,255,255,0.05);border:2px solid rgba(255,255,255,0.15);word-break:break-word;text-align:center;position:relative;}

.cb-roll-box[data-tip]:not([data-tip=""]):hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(0,0,0,0.9);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 100;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.box-atk{transition: color 0.3s;}
.box-def{transition: color 0.3s;}
.cb-outcome{font-size:14px;font-weight:900;letter-spacing:1px;text-align:center;margin-top:12px;color:var(--gold);min-height:20px;}

/* ── INDIVIDUAL HEX GLASSMORPHISM BACKDROP BLUR ── */
.hex-glass-backdrop {
  width: 100%;
  height: 100%;
  backdrop-filter: blur(8px) saturate(125%);
  -webkit-backdrop-filter: blur(8px) saturate(125%);
  background: rgba(6, 10, 18, 0.48);
  pointer-events: none !important;
}

/* ── HEX POLYGONS ── */
.hex-poly {
  fill: rgba(8, 12, 22, 0.16) !important;
  stroke: rgba(255, 255, 255, 0.16) !important;
  stroke-width: 1.5 !important;
  cursor: pointer;
  transition: fill 0.18s ease, stroke 0.18s ease, filter 0.18s ease !important;
  pointer-events: auto;
}

.hex-poly:hover,
.hex-poly.hovered {
  fill: rgba(30, 42, 66, 0.6) !important;
  stroke: rgba(255, 255, 255, 0.65) !important;
  stroke-width: 1.8 !important;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.2)) !important;
}

.hex-poly.hex-control {
  fill: rgba(255, 190, 30, 0.10) !important;
  stroke: rgba(255, 205, 35, 0.85) !important;
  stroke-width: 1.8 !important;
  filter: drop-shadow(0 0 8px rgba(255, 190, 30, 0.35)) !important;
}

.hex-poly.hex-control:hover,
.hex-poly.hex-control.hovered {
  fill: rgba(255, 200, 45, 0.24) !important;
  stroke: rgba(255, 230, 80, 0.98) !important;
  stroke-width: 2.2 !important;
  filter: drop-shadow(0 0 12px rgba(255, 200, 45, 0.55)) !important;
}

.hex-poly.hex-center {
  fill: rgba(255, 180, 40, 0.12) !important;
  stroke: rgba(255, 210, 80, 0.75) !important;
  stroke-width: 2.0 !important;
  filter: drop-shadow(0 0 8px rgba(255, 180, 40, 0.25)) !important;
}

.hex-poly.hex-center:hover,
.hex-poly.hex-center.hovered {
  fill: rgba(255, 180, 40, 0.24) !important;
  stroke: #ffffff !important;
  stroke-width: 2.4 !important;
  filter: drop-shadow(0 0 10px rgba(255, 180, 40, 0.45)) !important;
}

.hex-poly.hex-deploy-p1 {
  fill: rgba(56, 142, 205, 0.08) !important;
  stroke: rgba(65, 160, 225, 0.68) !important;
  stroke-width: 1.8 !important;
}

.hex-poly.hex-deploy-p1:hover,
.hex-poly.hex-deploy-p1.hovered {
  fill: rgba(56, 142, 205, 0.22) !important;
  stroke: rgba(140, 210, 255, 0.85) !important;
  stroke-width: 2.0 !important;
  filter: drop-shadow(0 0 6px rgba(65, 160, 225, 0.35)) !important;
}

.hex-poly.hex-deploy-p2 {
  fill: rgba(215, 68, 142, 0.08) !important;
  stroke: rgba(225, 78, 155, 0.68) !important;
  stroke-width: 1.8 !important;
}

.hex-poly.hex-deploy-p2:hover,
.hex-poly.hex-deploy-p2.hovered {
  fill: rgba(215, 68, 142, 0.22) !important;
  stroke: rgba(255, 140, 205, 0.85) !important;
  stroke-width: 2.0 !important;
  filter: drop-shadow(0 0 6px rgba(225, 78, 155, 0.35)) !important;
}

.hex-poly.hex-mid {
  fill: rgba(14, 18, 28, 0.65) !important;
  stroke: rgba(255, 255, 255, 0.14) !important;
}

/* Highlight states - Classic subtle highlight for regular play */
.hex-poly.hex-deploy-valid-p1 {
  fill: rgba(0, 168, 255, 0.12) !important;
  stroke: rgba(0, 168, 255, 0.75) !important;
  stroke-width: 2.0 !important;
  stroke-dasharray: none !important;
  filter: drop-shadow(0 0 6px rgba(0, 168, 255, 0.3)) !important;
  animation: pulse-valid 1.1s ease-in-out infinite;
  cursor: pointer !important;
}

.hex-poly.hex-deploy-valid-p1:hover {
  fill: rgba(0, 168, 255, 0.25) !important;
  stroke: rgba(0, 168, 255, 1) !important;
  stroke-width: 2.5 !important;
  filter: drop-shadow(0 0 10px rgba(0, 168, 255, 0.6)) !important;
}

.hex-poly.hex-deploy-valid-p2 {
  fill: rgba(255, 46, 147, 0.12) !important;
  stroke: rgba(255, 46, 147, 0.75) !important;
  stroke-width: 2.0 !important;
  stroke-dasharray: none !important;
  filter: drop-shadow(0 0 6px rgba(255, 46, 147, 0.3)) !important;
  animation: pulse-valid 1.1s ease-in-out infinite;
  cursor: pointer !important;
}

.hex-poly.hex-deploy-valid-p2:hover {
  fill: rgba(255, 46, 147, 0.25) !important;
  stroke: rgba(255, 46, 147, 1) !important;
  stroke-width: 2.5 !important;
  filter: drop-shadow(0 0 10px rgba(255, 46, 147, 0.6)) !important;
}

.hex-poly.hex-deploy-preview-p1 {
  stroke: rgba(0, 168, 255, 0.7) !important;
  stroke-width: 2.0 !important;
  fill: rgba(0, 168, 255, 0.08) !important;
  filter: drop-shadow(0 0 6px rgba(0, 168, 255, 0.3)) !important;
}

.hex-poly.hex-deploy-preview-p2 {
  stroke: rgba(255, 46, 147, 0.7) !important;
  stroke-width: 2.0 !important;
  fill: rgba(255, 46, 147, 0.08) !important;
  filter: drop-shadow(0 0 6px rgba(255, 46, 147, 0.3)) !important;
}

/* Tutorial Mode: Tasteful, toned-down instructional glow (no circles, no blinding glare) */
body.tutorial-active .hex-poly.hex-deploy-valid-p1,
body.tutorial-active .hex-poly.hex-deploy-valid-p2 {
  animation: tutHexBeaconBreathe 1.8s infinite ease-in-out !important;
  cursor: pointer !important;
}

body.tutorial-active .hex-poly.hex-deploy-valid-p1:hover,
body.tutorial-active .hex-poly.hex-deploy-valid-p2:hover {
  fill: rgba(0, 229, 255, 0.3) !important;
  stroke: #ffffff !important;
  stroke-width: 2.8 !important;
  filter: drop-shadow(0 0 12px rgba(0, 229, 255, 0.75)) !important;
}

.hex-poly.hex-valid {
  fill: rgba(0, 229, 163, 0.10) !important;
  stroke: rgba(0, 229, 163, 0.75) !important;
  stroke-width: 2.0 !important;
  stroke-dasharray: none !important;
  filter: drop-shadow(0 0 6px rgba(0, 229, 163, 0.3)) !important;
  animation: pulse-valid 1.1s ease-in-out infinite;
  cursor: pointer !important;
}

.hex-poly.hex-valid:hover,
.hex-poly.hex-valid.hovered {
  fill: rgba(0, 229, 163, 0.26) !important;
  stroke: #ffffff !important;
  stroke-width: 2.6 !important;
  stroke-dasharray: none !important;
  filter: drop-shadow(0 0 12px rgba(0, 229, 163, 0.80)) !important;
}

.hex-poly.hex-attack {
  fill: rgba(255, 59, 92, 0.14) !important;
  stroke: rgba(255, 59, 92, 0.75) !important;
  stroke-width: 2.0 !important;
  stroke-dasharray: none !important;
  filter: drop-shadow(0 0 8px rgba(255, 59, 92, 0.35)) !important;
  animation: pulse-attack 0.95s ease-in-out infinite;
  cursor: pointer !important;
}

.hex-poly.hex-attack:hover,
.hex-poly.hex-attack.hovered {
  fill: rgba(255, 59, 92, 0.28) !important;
  stroke: #ffffff !important;
  stroke-width: 2.6 !important;
  stroke-dasharray: none !important;
  filter: drop-shadow(0 0 14px rgba(255, 59, 92, 0.85)) !important;
}

.hex-poly.hex-selected {
  stroke: rgba(255, 255, 255, 0.90) !important;
  stroke-width: 2.4 !important;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5)) !important;
}

.hex-poly.hex-selected.hex-selected-p1,
body.turn-p1 .hex-poly.hex-selected {
  stroke: #ffffff !important;
  stroke-width: 2.6 !important;
  filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.95)) drop-shadow(0 0 4px #00f0ff) !important;
}

.hex-poly.hex-selected.hex-selected-p2,
body.turn-p2 .hex-poly.hex-selected {
  stroke: #ffffff !important;
  stroke-width: 2.6 !important;
  filter: drop-shadow(0 0 12px rgba(255, 43, 177, 0.95)) drop-shadow(0 0 4px #ff2bb1) !important;
}

.hex-poly.hex-mode-hl {
  fill: rgba(255, 255, 100, 0.08);
  stroke: rgba(255, 255, 100, 0.45);
  stroke-width: 1.8;
  animation: pulse-valid 1.4s ease-in-out infinite;
}

.hex-poly.hex-invalid-flash {
  stroke: rgba(200, 205, 215, 0.75) !important;
  fill: rgba(180, 185, 195, 0.16) !important;
  stroke-width: 2.8px !important;
  filter: drop-shadow(0 0 10px rgba(180, 185, 195, 0.5)) !important;
  transition: stroke 0.05s ease, fill 0.05s ease;
}
@keyframes pulse-valid{0%,100%{opacity:1}50%{opacity:0.5}}
@keyframes pulse-attack{0%,100%{opacity:1;stroke-width:3}50%{opacity:0.55;stroke-width:1.5}}

/* ── COMBAT FLOATING LABELS ── */
.combat-badge {
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.9));
}
.combat-badge-bg {
  stroke-width: 2px;
}
/* Azure (P1) label - matches stash #0099ff */
.combat-badge-bg.p1,
.combat-badge-atk.p1 .combat-badge-bg,
.combat-badge-def.p1 .combat-badge-bg {
  fill: rgba(3, 14, 28, 0.95);
  stroke: #0099ff;
  filter: drop-shadow(0 0 10px rgba(0, 153, 255, 0.7));
}
/* Violet (P2) label - matches stash #ff2bb1 */
.combat-badge-bg.p2,
.combat-badge-atk.p2 .combat-badge-bg,
.combat-badge-def.p2 .combat-badge-bg {
  fill: rgba(28, 5, 24, 0.95);
  stroke: #ff2bb1;
  filter: drop-shadow(0 0 10px rgba(255, 43, 177, 0.7));
}

.combat-badge-text {
  font-family: 'Orbitron', monospace, sans-serif;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.5px;
}
/* Azure text */
.combat-badge-atk.p1 .combat-badge-text,
.combat-badge-def.p1 .combat-badge-text {
  fill: #0099ff;
}
/* Violet text */
.combat-badge-atk.p2 .combat-badge-text,
.combat-badge-def.p2 .combat-badge-text {
  fill: #ff2bb1;
}

/* ── UNIT SHAPES & MOVEMENT SLIDE ── */
@keyframes unitSlideMove {
  0% { transform: translate(var(--slide-from-x, 0px), var(--slide-from-y, 0px)); }
  100% { transform: translate(0px, 0px); }
}
.unit-sliding {
  animation: unitSlideMove 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.unit-shape{transition:all 0.15s ease;pointer-events:none; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.8));}
.unit-p1{color:var(--p1); stroke:none; fill:none;}
.unit-p2{color:var(--p2); stroke:none; fill:none;}


.unit-type{font-family:'Inter',sans-serif;font-size:9px;font-weight:900;letter-spacing:0.5px;fill:rgba(255,255,255,0.55);pointer-events:none;}
.unit-val{font-family:'Inter',sans-serif;font-size:16px;font-weight:900;fill:#fff;pointer-events:none;}

.core-pulse{animation:core-glow 2.2s ease-in-out infinite;}
@keyframes core-glow{0%,100%{opacity:0.15;r:26}50%{opacity:0.4;r:30}}

/* GameOver classes */
.go-winner{font-size:38px;font-weight:900;text-align:center;text-shadow:0 0 30px rgba(255,200,100,0.35);}
.go-tokens{font-size:12px;color:var(--text-mid);text-align:center;letter-spacing:1px;}
.go-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0 10px 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}
.go-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
}
.go-stat-mvp {
  grid-column: 1 / -1;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
  margin-top: 2px;
}
.stat-num {
  font-family: 'Orbitron', 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}
.stat-lbl {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  margin-top: 3px;
}

/* Hover tooltip for ROLL */
.can-roll[data-roll-text]:not([data-roll-text=""])::before {
  content: attr(data-roll-text);
  white-space: nowrap;
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  background: var(--crimson-hi);
  color: #fff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.5px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}
.can-roll[data-roll-text]:not([data-roll-text=""]):hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
/* P1 (Azure) stash: blue tooltip */
.stash-p1 .can-roll[data-roll-text]:not([data-roll-text=""])::before {
  background: rgba(0, 153, 255, 0.9);
  box-shadow: 0 4px 12px rgba(0,153,255,0.4);
}
/* P2 (Violet) stash: magenta tooltip */
.stash-p2 .can-roll[data-roll-text]:not([data-roll-text=""])::before {
  background: rgba(255, 43, 177, 0.9);
  box-shadow: 0 4px 12px rgba(255,43,177,0.4);
}

.bg3-battle-die-widget::before,
.bg3-battle-die-widget::after {
  content: none !important;
  display: none !important;
}

/* POPUP OVERHAUL STYLES */
.popup-big-val {
  font-size: 36px;
  font-weight: 900;
  color: #fff;
  background: rgba(0,0,0,0.4);
  border-radius: 8px;
  margin: 4px auto;
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: 0 4px 16px rgba(0,0,0,0.6) inset;
  text-shadow: 0 0 12px rgba(255,255,255,0.3);
  transition: all 0.3s ease;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Player 1 Popup Colors */
.popup-p1.popup-animating .popup-big-val {
  color: #fff; text-shadow: 0 0 20px rgba(0,153,255,0.8); border-color: rgba(0,153,255,0.5); box-shadow: 0 0 20px rgba(0,153,255,0.3) inset;
}
.popup-p1.popup-animating .row-popup-lbl { color: var(--p1-color); animation: pulse-txt 0.5s infinite alternate; }
.popup-p1.popup-settled .popup-big-val {
  color: var(--p1-color); border-color: rgba(0,153,255,0.8); box-shadow: 0 0 30px rgba(0,153,255,0.4) inset, 0 4px 16px rgba(0,0,0,0.6) inset; text-shadow: 0 0 20px rgba(0,153,255,1);
}

/* Player 2 Popup Colors */
.popup-p2.popup-animating .popup-big-val {
  color: #fff; text-shadow: 0 0 20px rgba(255,43,177,0.8); border-color: rgba(255,43,177,0.5); box-shadow: 0 0 20px rgba(255,43,177,0.3) inset;
}
.popup-p2.popup-animating .row-popup-lbl { color: var(--p2-color); animation: pulse-txt 0.5s infinite alternate; }
.popup-p2.popup-settled .popup-big-val {
  color: var(--p2-color); border-color: rgba(255,43,177,0.8); box-shadow: 0 0 30px rgba(255,43,177,0.4) inset, 0 4px 16px rgba(0,0,0,0.6) inset; text-shadow: 0 0 20px rgba(255,43,177,1);
}

.popup-actions { display: flex; gap: 8px; justify-content: center; }
.popup-actions .btn:disabled { opacity: 0.2; cursor: not-allowed; transform: none; box-shadow: none; }

@keyframes pulse-txt {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* Highlight for actionable units - Faction themed (P1 Azure = Cyan, P2 Violet = Magenta) */

/* ── P1 (AZURE) CAN-MOVE & CAN-ATTACK ── */
.hex-poly.can-move-p1,
body.turn-p1 .hex-poly.can-move {
  fill: rgba(0, 229, 255, 0.08) !important;
  stroke: rgba(0, 229, 255, 0.85) !important;
  stroke-width: 1.8px !important;
  stroke-dasharray: none !important;
  cursor: pointer !important;
  animation: pulse-hex 1.6s infinite alternate ease-in-out;
}
.hex-poly.can-move-p1:hover,
.hex-poly.can-move-p1.hovered,
body.turn-p1 .hex-poly.can-move:hover,
body.turn-p1 .hex-poly.can-move.hovered {
  fill: rgba(0, 229, 255, 0.22) !important;
  stroke: #ffffff !important;
  stroke-width: 2.4px !important;
  stroke-dasharray: none !important;
  filter: drop-shadow(0 0 12px rgba(0, 229, 255, 0.75)) !important;
}

.hex-poly.can-attack-p1,
body.turn-p1 .hex-poly.can-attack {
  fill: rgba(0, 229, 255, 0.10) !important;
  stroke: #00f0ff !important;
  stroke-width: 2.2px !important;
  stroke-dasharray: none !important;
  cursor: pointer !important;
  animation: pulse-hex-attack-p1 1.2s infinite alternate ease-in-out;
}
.hex-poly.can-attack-p1:hover,
.hex-poly.can-attack-p1.hovered,
body.turn-p1 .hex-poly.can-attack:hover,
body.turn-p1 .hex-poly.can-attack.hovered {
  fill: rgba(0, 229, 255, 0.26) !important;
  stroke: #ffffff !important;
  stroke-width: 2.6px !important;
  stroke-dasharray: none !important;
  filter: drop-shadow(0 0 14px rgba(0, 240, 255, 0.90)) drop-shadow(0 0 4px #00f0ff) !important;
}

@keyframes pulse-hex {
  0% { filter: drop-shadow(0 0 3px rgba(0, 229, 255, 0.25)); }
  100% { filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.65)); }
}
@keyframes pulse-hex-attack-p1 {
  0% { filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.35)); }
  100% { filter: drop-shadow(0 0 14px rgba(0, 240, 255, 0.85)) drop-shadow(0 0 2px #00f0ff); }
}

/* ── P2 (VIOLET) CAN-MOVE & CAN-ATTACK ── */
.hex-poly.can-move-p2,
body.turn-p2 .hex-poly.can-move {
  fill: rgba(255, 43, 177, 0.08) !important;
  stroke: rgba(255, 43, 177, 0.85) !important;
  stroke-width: 1.8px !important;
  stroke-dasharray: none !important;
  cursor: pointer !important;
  animation: pulse-hex-p2 1.6s infinite alternate ease-in-out;
}
.hex-poly.can-move-p2:hover,
.hex-poly.can-move-p2.hovered,
body.turn-p2 .hex-poly.can-move:hover,
body.turn-p2 .hex-poly.can-move.hovered {
  fill: rgba(255, 43, 177, 0.22) !important;
  stroke: #ffffff !important;
  stroke-width: 2.4px !important;
  stroke-dasharray: none !important;
  filter: drop-shadow(0 0 12px rgba(255, 43, 177, 0.75)) !important;
}

.hex-poly.can-attack-p2,
body.turn-p2 .hex-poly.can-attack {
  fill: rgba(255, 43, 177, 0.10) !important;
  stroke: #ff2bb1 !important;
  stroke-width: 2.2px !important;
  stroke-dasharray: none !important;
  cursor: pointer !important;
  animation: pulse-hex-attack-p2 1.2s infinite alternate ease-in-out;
}
.hex-poly.can-attack-p2:hover,
.hex-poly.can-attack-p2.hovered,
body.turn-p2 .hex-poly.can-attack:hover,
body.turn-p2 .hex-poly.can-attack.hovered {
  fill: rgba(255, 43, 177, 0.26) !important;
  stroke: #ffffff !important;
  stroke-width: 2.6px !important;
  stroke-dasharray: none !important;
  filter: drop-shadow(0 0 14px rgba(255, 43, 177, 0.90)) drop-shadow(0 0 4px #ff2bb1) !important;
}

@keyframes pulse-hex-p2 {
  0% { filter: drop-shadow(0 0 3px rgba(255, 43, 177, 0.25)); }
  100% { filter: drop-shadow(0 0 10px rgba(255, 43, 177, 0.65)); }
}
@keyframes pulse-hex-attack-p2 {
  0% { filter: drop-shadow(0 0 4px rgba(255, 43, 177, 0.35)); }
  100% { filter: drop-shadow(0 0 14px rgba(255, 43, 177, 0.85)) drop-shadow(0 0 2px #ff2bb1); }
}

/* DESTROYED CHIP STYLE */
.chip-destroyed {
  opacity: 0.3;
  filter: grayscale(100%);
  pointer-events: none;
  position: relative;
}
.chip-destroyed::after {
  content: "X";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  color: #ff3333;
  font-weight: 900;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  pointer-events: none;
}
.chip-destroyed svg, .chip-destroyed .chip-t {
  display: none !important;
}

/* BATTLE REPORT CARD */
.log-battle-card {
  margin: 12px 0;
  background: rgba(20, 20, 30, 0.85);
  border: 1px solid rgba(255,255,255,0.1);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  overflow: hidden;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.lbc-header {
  background: rgba(0,0,0,0.5);
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 900;
  color: var(--gold);
  text-align: center;
  letter-spacing: 1.5px;
}
.lbc-cols {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.lbc-col {
  flex: 1;
  padding: 10px 8px;
  text-align: center;
  border-top: 3px solid transparent;
}
.lbc-col:first-child {
  border-right: 1px solid rgba(255,255,255,0.05);
}
.lbc-player {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.lbc-type {
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 6px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
.lbc-math {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
}
.lbc-events {
  padding: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  text-align: center;
  font-style: italic;
  background: rgba(0,0,0,0.2);
}
.lbc-footer {
  padding: 10px;
  background: rgba(255,255,255,0.05);
  text-align: center;
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.chat-msg:has(.log-battle-card) {
  max-width: 100%;
  width: 100%;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

@keyframes btn-glow-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 var(--gold); }
  50% { transform: scale(1.05); box-shadow: 0 0 20px 5px var(--gold); background: rgba(255, 215, 0, 0.2); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 var(--gold); }
}
.glow-pulse {
  animation: btn-glow-pulse 0.6s ease-out;
}

.pick-action-glow .act-btn.glow-pulse:not(:disabled),
.act-btn.glow-pulse:not(:disabled) {
  animation: btn-glow-pulse 0.6s ease-out !important;
}

/* ── TOOLTIP ── */
.core-tooltip {
  position: absolute;
  background: rgba(10,5,20,0.95);
  border: 1px solid rgba(0,255,100,0.4);
  box-shadow: 0 8px 32px rgba(0,0,0,0.8), 0 0 16px rgba(0,255,100,0.15) inset;
  padding: 12px 16px;
  border-radius: 8px;
  pointer-events: none;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.25,1,0.5,1);
  transform: translateY(10px) translateX(-50%);
  width: 280px; padding: 16px 20px;
  text-align: center;
}
.core-tooltip.tt-visible {
  opacity: 1;
  transform: translateY(0) translateX(-50%);
}
.tt-title {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #00ffb0;
  margin-bottom: 6px;
}
.tt-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  line-height: 1.4;
}

.core-sym{pointer-events:none;}

.plaque-mascot {
  height: clamp(68px, 7.5vw, 110px);
  width: auto;
  pointer-events: none;
  z-index: 20;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.8));
}
.mascot-p1 {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.mascot-p2 {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

#hud-p1.active .mascot-p1,
.ab-p1 .mascot-p1 {
  filter: drop-shadow(0 0 24px rgba(0, 153, 255, 0.85)) brightness(1.2);
  transform: translate(-50%, -50%) scale(1.06);
}
#hud-p1:not(.active) .mascot-p1,
.ab-p2 .mascot-p1 {
  opacity: 0.55;
  filter: grayscale(35%) brightness(0.7);
  transform: translate(-50%, -50%) scale(0.94);
}

#hud-p2.active .mascot-p2,
.ab-p2 .mascot-p2 {
  filter: drop-shadow(0 0 24px rgba(255, 43, 177, 0.85)) brightness(1.2);
  transform: translate(-50%, -50%) scale(1.06);
}
#hud-p2:not(.active) .mascot-p2,
.ab-p1 .mascot-p2 {
  opacity: 0.55;
  filter: grayscale(35%) brightness(0.7);
  transform: translate(-50%, -50%) scale(0.94);
}

.bar-center-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* Holographic Background Overlay */
:root {
  --mouse-x: 50%;
  --mouse-y: 50%;
  --bg-glow-main: rgba(0, 255, 150, 0.4);
  --bg-glow-sub: rgba(0, 180, 100, 0.35);
  --bg-glow-dark: rgba(0, 120, 80, 0.35);
  --bg-glow-mouse: rgba(0, 255, 150, 0.1);
}

body.turn-p1 {
  --bg-glow-main: rgba(0, 153, 255, 0.5);   /* Azure */
  --bg-glow-sub: rgba(0, 100, 255, 0.4);
  --bg-glow-dark: rgba(0, 50, 200, 0.35);
  --bg-glow-mouse: rgba(0, 153, 255, 0.15);
}

body.turn-p2 {
  --bg-glow-main: rgba(255, 43, 177, 0.5);  /* Violet */
  --bg-glow-sub: rgba(200, 0, 150, 0.4);
  --bg-glow-dark: rgba(150, 0, 100, 0.35);
  --bg-glow-mouse: rgba(255, 43, 177, 0.15);
}

.holo-bg,
.celophane-wrap,
.glass-overlay {
  display: none !important;
}

/* removed redefining of game-screen */

body.combat-active .combat-summary {
  bottom: 140px !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
.cb-outcome-text {
  font-size: 14px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: #fff;
  text-align: center;
}

/* COMBAT 50/50 LAYOUT & DYNAMIC SLIDE-OUT EXPANSION */
body.combat-active .stash-grid-wrapper { display: none !important; }
body.combat-active .combat-stash-content { display: flex !important; }

.side-stash {
  transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.45s ease,
              border-color 0.45s ease,
              box-shadow 0.45s ease !important;
}

body.combat-active .side-stash.stash-p1 { 
  width: var(--stash-w, 328px) !important;
  margin-left: var(--stash-margin, 100px) !important;
  margin-top: 0 !important;
  z-index: 8 !important;
  min-height: 806px !important;
  background: linear-gradient(180deg, rgba(0,153,255,0.28) 0%, rgba(0,153,255,0.05) 50%, rgba(0,0,0,0.30) 100%) !important; 
  border: 1px solid rgba(0, 210, 255, 0.3) !important;
  border-top: none !important;
  border-left: none !important;
  border-radius: 0 0 20px 20px !important;
  box-shadow: 0 12px 36px rgba(0,0,0,0.5), inset 0 0 24px rgba(0,210,255,0.10) !important;
}
body.combat-active .side-stash.stash-p2 { 
  width: var(--stash-w, 328px) !important;
  margin-right: var(--stash-margin, 100px) !important;
  margin-top: 0 !important;
  z-index: 8 !important;
  min-height: 806px !important;
  background: linear-gradient(180deg, rgba(255,43,177,0.28) 0%, rgba(255,43,177,0.05) 50%, rgba(0,0,0,0.30) 100%) !important; 
  border: 1px solid rgba(255, 0, 127, 0.3) !important;
  border-top: none !important;
  border-right: none !important;
  border-radius: 0 0 20px 20px !important;
  box-shadow: 0 12px 36px rgba(0,0,0,0.5), inset 0 0 24px rgba(255,43,177,0.10) !important;
}

/* Maintain full rounded corner curves on player name cards during combat */
body.combat-active #hud-p1,
body.combat-active #hud-p2 {
  border-radius: 14px !important;
  z-index: 10 !important;
}
body.combat-active #online-turn-banner-container {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
}

/* BOARD SAFETY DURING COMBAT */
#board-col {
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), padding 0.45s ease;
}
#hex-board {
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (max-width: 1440px) {
  body.combat-active .side-stash.stash-p1,
  body.combat-active .side-stash.stash-p2 {
    width: clamp(250px, 20vw, 310px) !important;
  }
  body.combat-active #hex-board {
    transform: scale(0.92);
  }
}
@media (max-width: 1200px) {
  body.combat-active .side-stash.stash-p1,
  body.combat-active .side-stash.stash-p2 {
    width: 240px !important;
  }
  body.combat-active #hex-board {
    transform: scale(0.85);
  }
}

body.combat-active .holo-bg {
    background: linear-gradient(90deg, rgba(0,153,255,0.3) 0%, rgba(0,153,255,0) 50%, rgba(255,43,177,0) 50%, rgba(255,43,177,0.3) 100%) !important;
    opacity: 1 !important;
}

body.combat-active #action-bar {
    border-top: 1px solid transparent !important;
    box-shadow: none !important;
}

body.combat-active.combat-winner-p1 #action-bar {
    border-image: linear-gradient(90deg, var(--p1-color) 0%, var(--p1-color) 100%) 1 !important;
    background: rgba(0,153,255,0.2) !important;
}

body.combat-active.combat-winner-p2 #action-bar {
    border-image: linear-gradient(90deg, var(--p2-color) 0%, var(--p2-color) 100%) 1 !important;
    background: rgba(255,43,177,0.2) !important;
}

body.combat-active.combat-draw #action-bar {
    border-image: none !important;
    background: rgba(8,4,16,0.92) !important;
}

.csp-title { font-size: 10px; font-weight: 900; letter-spacing: 3px; text-transform: uppercase; color: var(--text-low); margin-bottom: 8px; }
.stash-p1 .csp-title { color: var(--p1-color); }
.stash-p2 .csp-title { color: var(--p2-color); }

@keyframes combat-breathe-p1 {
  0% { filter: drop-shadow(0 0 10px rgba(0,153,255,0.4)); }
  50% { filter: drop-shadow(0 0 30px rgba(0,153,255,0.9)) brightness(1.2); }
  100% { filter: drop-shadow(0 0 10px rgba(0,153,255,0.4)); }
}

@keyframes combat-breathe-p2 {
  0% { filter: drop-shadow(0 0 10px rgba(255,43,177,0.4)); }
  50% { filter: drop-shadow(0 0 30px rgba(255,43,177,0.9)) brightness(1.2); }
  100% { filter: drop-shadow(0 0 10px rgba(255,43,177,0.4)); }
}

@keyframes combat-bg-breathe-p1 {
  0% { background-position: 0% 50%; opacity: 0.1; transform: scale(1); }
  50% { background-position: 100% 50%; opacity: 0.6; transform: scale(1.1); filter: brightness(1.5) blur(20px); }
  100% { background-position: 0% 50%; opacity: 0.1; transform: scale(1); }
}

@keyframes combat-bg-breathe-p2 {
  0% { background-position: 100% 50%; opacity: 0.1; transform: scale(1); }
  50% { background-position: 0% 50%; opacity: 0.6; transform: scale(1.1); filter: brightness(1.5) blur(20px); }
  100% { background-position: 100% 50%; opacity: 0.1; transform: scale(1); }
}

/* TOP MASCOT PRESERVATION: Maintain 100% visibility of 3D dice avatars inside player name cards at all times */
#action-bar .plaque-mascot.mascot-p1,
#action-bar .plaque-mascot.mascot-p2,
body.combat-active #action-bar .plaque-mascot.mascot-p1,
body.combat-active #action-bar .plaque-mascot.mascot-p2 {
  opacity: 1 !important;
  transform: translate(-50%, -50%) !important;
  pointer-events: none;
  visibility: visible !important;
}

/* ══════════════════════════════════════════════════════════════════════════════
   BG3-STYLE INTERACTIVE BATTLE DICE ENGINE & SCI-FI MATRIX FRAME
   ══════════════════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════════════════
   COMBAT MATRIX CELL: APERTURE FOCUS DESIGN SYSTEM
   ══════════════════════════════════════════════════════════════════════════════ */

/* Combat Stash Content Layout */
.combat-stash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 10px 8px 16px 8px;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
}

/* Monolithic Obsidian Combat Matrix Cell (Replaces .bg3-scifi-frame) */
.combat-matrix-cell,
.bg3-scifi-frame {
  position: relative;
  width: 100%;
  max-width: 284px;
  padding: 24px 14px 18px 14px;
  margin: 14px auto 0 auto;
  border-radius: 20px;
  background: radial-gradient(130% 90% at 50% 0%, rgba(12, 18, 34, 0.94) 0%, rgba(5, 7, 15, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
  overflow: visible;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Eliminate AI-generated corner notches completely */
.frame-corner {
  display: none !important;
}

/* Top Razor Aperture Flare (Replacing cheesy corner ticks) */
.combat-matrix-cell::after,
.bg3-scifi-frame::after {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  opacity: 0.8;
  pointer-events: none;
}

/* Player 1 (Azure) Cell */
.p1-matrix,
.p1-frame {
  border-color: rgba(0, 210, 255, 0.22) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), 0 0 28px rgba(0, 210, 255, 0.07) !important;
}
.p1-matrix::after,
.p1-frame::after {
  background: linear-gradient(90deg, transparent, #00d2ff, transparent);
}

/* Player 2 (Violet) Cell */
.p2-matrix,
.p2-frame {
  border-color: rgba(255, 0, 127, 0.22) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), 0 0 28px rgba(255, 0, 127, 0.07) !important;
}
.p2-matrix::after,
.p2-frame::after {
  background: linear-gradient(90deg, transparent, #ff007f, transparent);
}

/* Prominent Stash Role Badges (Above UNIT) */
.cb-role-badge {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', 'Space Grotesk', monospace;
  font-size: 16px !important;
  font-weight: 900 !important;
  letter-spacing: 3px !important;
  text-transform: uppercase;
  padding: 5px 18px !important;
  border-radius: 12px !important;
  margin-bottom: 14px !important;
  line-height: 1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  text-align: center;
}

#cb-p1-role {
  background: rgba(0, 153, 255, 0.18) !important;
  border: 1.5px solid rgba(0, 210, 255, 0.6) !important;
  color: #e0f7ff !important;
  text-shadow: 0 0 12px rgba(0, 210, 255, 0.8) !important;
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.25), inset 0 0 8px rgba(0, 210, 255, 0.15) !important;
}

#cb-p2-role {
  background: rgba(255, 43, 177, 0.18) !important;
  border: 1.5px solid rgba(255, 43, 177, 0.6) !important;
  color: #ffe4f5 !important;
  text-shadow: 0 0 12px rgba(255, 43, 177, 0.8) !important;
  box-shadow: 0 0 16px rgba(255, 43, 177, 0.25), inset 0 0 8px rgba(255, 43, 177, 0.15) !important;
}

/* Unit Label and Value Readout (Above Frame) */
.cb-section-title {
  font-family: 'Inter', sans-serif !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  letter-spacing: 2.5px !important;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65) !important;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
  margin-bottom: 4px !important;
}

.csp-unit {
  font-family: 'Orbitron', sans-serif !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  letter-spacing: 1.5px !important;
  text-transform: uppercase;
  color: #ffffff !important;
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.5), 0 2px 8px rgba(0, 0, 0, 0.8);
  margin-bottom: 16px !important;
}

/* Battle Die Header Capsule Pill (Mounted on top border of frame) */
.frame-header-tag.cb-battle-die-pill,
.cb-battle-die-pill {
  position: absolute !important;
  top: -14px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 4px 16px !important;
  border-radius: 12px !important;
  font-family: 'Orbitron', 'Space Grotesk', sans-serif !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  letter-spacing: 2.5px !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
  z-index: 10 !important;
}

.p1-frame .frame-header-tag.cb-battle-die-pill,
.p1-frame .cb-battle-die-pill {
  background: #060c18 !important;
  border: 1px solid rgba(0, 210, 255, 0.5) !important;
  color: #00d2ff !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.8), 0 0 14px rgba(0, 210, 255, 0.3) !important;
}

.p2-frame .frame-header-tag.cb-battle-die-pill,
.p2-frame .cb-battle-die-pill {
  background: #140612 !important;
  border: 1px solid rgba(255, 0, 127, 0.5) !important;
  color: #ff007f !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.8), 0 0 14px rgba(255, 0, 127, 0.3) !important;
}

.cb-battle-die-pill .fht-text {
  font-family: inherit !important;
  font-size: inherit !important;
  letter-spacing: inherit !important;
  color: inherit !important;
}

/* Interactive Die Widget: 1.5x Scaled Up */
.bg3-battle-die-widget {
  position: relative;
  width: 260px;
  min-height: 270px;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 2px auto !important;
  cursor: pointer;
  user-select: none;
  outline: none;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), filter 0.25s ease;
}

.bg3-battle-die-widget:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

/* Phase A: Idle Breathing & Levitation Float */
@keyframes bg3-die-float {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(1.5deg);
  }
  100% {
    transform: translateY(0px) rotate(0deg);
  }
}

.bg3-battle-die-widget.can-roll:not(.is-tumbling):not(.is-locked) .bg3-die-container {
  animation: bg3-die-float 2.8s ease-in-out infinite;
}

.bg3-battle-die-widget.can-roll:hover:not(.is-tumbling):not(.is-locked) {
  transform: scale(1.06);
}

.p1-widget.can-roll:hover:not(.is-tumbling):not(.is-locked) {
  filter: drop-shadow(0 0 28px rgba(0, 210, 255, 0.85));
}

.p2-widget.can-roll:hover:not(.is-tumbling):not(.is-locked) {
  filter: drop-shadow(0 0 28px rgba(255, 0, 127, 0.85));
}

/* Die Container: 1.5x Enlarge (240px x 240px) with 3D Perspective */
.bg3-die-container {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
  perspective-origin: 50% 50%;
  transform-style: preserve-3d;
  transition: transform 0.2s ease;
}

/* BG3 3D Vector Canvas Mesh */
.bg3-3d-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 240px;
  height: 240px;
  display: block;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 0 14px rgba(0, 153, 255, 0.25));
  transition: opacity 0.4s ease, filter 0.4s ease;
}

.p2-widget .bg3-3d-canvas {
  filter: drop-shadow(0 0 14px rgba(255, 43, 177, 0.25));
}

.bg3-battle-die-widget.is-locked .bg3-3d-canvas {
  opacity: 0.28 !important;
}

.bg3-die-body {
  position: relative;
  width: 232px;
  height: 232px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-style: preserve-3d;
  will-change: transform;
}

/* Dedicated Vector 3D SVG Die Model */
.bg3-3d-die-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.9));
  transition: filter 0.3s ease;
}

.p1-widget .bg3-3d-die-svg {
  filter: drop-shadow(0 0 18px rgba(0, 210, 255, 0.35)) drop-shadow(0 8px 24px rgba(0,0,0,0.9));
}

.p2-widget .bg3-3d-die-svg {
  filter: drop-shadow(0 0 18px rgba(255, 0, 127, 0.35)) drop-shadow(0 8px 24px rgba(0,0,0,0.9));
}

/* Ambient Glow Layer */
.bg3-die-ambient-glow {
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.6;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.p1-widget .bg3-die-ambient-glow {
  background: radial-gradient(circle, rgba(0,210,255,0.4) 0%, rgba(0,153,255,0) 70%);
}
.p2-widget .bg3-die-ambient-glow {
  background: radial-gradient(circle, rgba(255,0,127,0.4) 0%, rgba(255,43,177,0) 70%);
}

/* Face Readout Typography & SVG: Pure White Contrast (#ffffff) */
.bg3-die-face-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
}

.bg3-face-text {
  font-size: 64px !important;
  font-weight: 900;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  letter-spacing: 2px;
  color: #ffffff !important;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.85), 0 2px 8px rgba(0, 0, 0, 0.9);
  opacity: 1;
}

.bg3-boost-num {
  font-size: 64px !important;
  font-weight: 900;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  letter-spacing: 2px;
  color: #ffffff !important;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.85), 0 2px 8px rgba(0, 0, 0, 0.9);
}

.p1-widget .bg3-boost-num,
.p2-widget .bg3-boost-num {
  color: #ffffff !important;
}

.bg3-final-boost {
  font-size: 68px !important;
  font-weight: 900;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
  letter-spacing: 2px;
  color: #ffffff !important;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.9), 0 2px 8px rgba(0, 0, 0, 0.9);
  animation: bg3-face-pop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.p1-widget .bg3-final-boost,
.p2-widget .bg3-final-boost {
  color: #ffffff !important;
}

.bg3-die-face-content svg,
.bg3-final-symbol svg {
  width: 120px !important;
  height: 120px !important;
  display: block;
  color: #ffffff !important;
  fill: #ffffff !important;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.75)) drop-shadow(0 4px 14px rgba(0, 0, 0, 0.95));
  animation: bg3-face-pop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.p1-widget .bg3-die-face-content svg,
.p2-widget .bg3-die-face-content svg {
  color: #ffffff !important;
  fill: #ffffff !important;
}

@keyframes bg3-face-pop {
  0% { transform: scale(0.6); opacity: 0; }
  70% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1.0); opacity: 1; }
}

/* Phase B: BG3 Cinematic Multi-Axis 3D Tumbling Physics */
@keyframes bg3-die-tumble-p1 {
  0% {
    transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg) translateZ(0px);
  }
  20% {
    transform: rotateX(140deg) rotateY(80deg) rotateZ(45deg) translateZ(50px) translateY(-14px);
  }
  45% {
    transform: rotateX(260deg) rotateY(190deg) rotateZ(120deg) translateZ(75px) translateY(-20px);
  }
  70% {
    transform: rotateX(340deg) rotateY(290deg) rotateZ(210deg) translateZ(40px) translateY(-8px);
  }
  85% {
    transform: rotateX(410deg) rotateY(340deg) rotateZ(300deg) translateZ(60px) translateY(-14px);
  }
  100% {
    transform: rotateX(720deg) rotateY(360deg) rotateZ(360deg) translateZ(0px) translateY(0px);
  }
}

@keyframes bg3-die-tumble-p2 {
  0% {
    transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg) translateZ(0px);
  }
  20% {
    transform: rotateX(-140deg) rotateY(-80deg) rotateZ(-45deg) translateZ(50px) translateY(-14px);
  }
  45% {
    transform: rotateX(-260deg) rotateY(-190deg) rotateZ(-120deg) translateZ(75px) translateY(-20px);
  }
  70% {
    transform: rotateX(-340deg) rotateY(-290deg) rotateZ(-210deg) translateZ(40px) translateY(-8px);
  }
  85% {
    transform: rotateX(-410deg) rotateY(-340deg) rotateZ(-300deg) translateZ(60px) translateY(-14px);
  }
  100% {
    transform: rotateX(-720deg) rotateY(-360deg) rotateZ(-360deg) translateZ(0px) translateY(0px);
  }
}

.p1-widget.is-tumbling .bg3-die-body {
  animation: bg3-die-tumble-p1 0.28s linear infinite;
}
.p2-widget.is-tumbling .bg3-die-body {
  animation: bg3-die-tumble-p2 0.28s linear infinite;
}

.bg3-battle-die-widget.is-tumbling {
  cursor: wait;
}
.p1-widget.is-tumbling {
  filter: drop-shadow(0 0 35px rgba(0,210,255,0.9));
}
.p2-widget.is-tumbling {
  filter: drop-shadow(0 0 35px rgba(255,0,127,0.9));
}

/* Phase D: Dramatic Impact Settle with Forward Camera Punch & Elastic Rebound */
@keyframes bg3-die-impact-snap {
  0% {
    transform: translateZ(85px) scale(1.35) rotateX(14deg);
  }
  35% {
    transform: translateZ(-10px) scale(0.92) rotateX(-6deg);
  }
  65% {
    transform: translateZ(25px) scale(1.08) rotateX(3deg);
  }
  85% {
    transform: translateZ(-4px) scale(0.98) rotateX(-1deg);
  }
  100% {
    transform: translateZ(0px) scale(1.0) rotateX(0deg);
  }
}

.bg3-battle-die-widget.is-impact .bg3-die-container {
  animation: bg3-die-impact-snap 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Sci-Fi Radial Energy Shockwave */
.bg3-shockwave-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 20;
}

.bg3-shockwave-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 4px solid transparent;
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 0;
  pointer-events: none;
}

@keyframes bg3-shockwave-burst {
  0% {
    transform: translate(-50%, -50%) scale(0.2);
    opacity: 1;
    border-width: 6px;
  }
  50% {
    opacity: 0.85;
  }
  100% {
    transform: translate(-50%, -50%) scale(3.2);
    opacity: 0;
    border-width: 1px;
  }
}

.p1-widget .bg3-shockwave-ring.active-wave {
  border-color: #00d2ff;
  box-shadow: 0 0 25px #00d2ff, inset 0 0 15px #00d2ff;
  animation: bg3-shockwave-burst 0.55s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
}

.p1-widget .bg3-shockwave-ring.ring-2.active-wave {
  animation-delay: 0.08s;
}

.p2-widget .bg3-shockwave-ring.active-wave {
  border-color: #ff007f;
  box-shadow: 0 0 25px #ff007f, inset 0 0 15px #ff007f;
  animation: bg3-shockwave-burst 0.55s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
}

.p2-widget .bg3-shockwave-ring.ring-2.active-wave {
  animation-delay: 0.08s;
}

/* ── Floating Micro-HUD Prompt Badge ── */
.bg3-prompt-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px auto 0 auto !important;
  align-self: center !important;
  padding: 6px 18px;
  border-radius: 50px;
  background: rgba(8, 12, 22, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  min-width: 130px;
  text-align: center !important;
}

.bg3-prompt-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.p1-widget .bg3-prompt-dot {
  background: #00d2ff;
  box-shadow: 0 0 8px #00d2ff;
}
.p2-widget .bg3-prompt-dot {
  background: #ff007f;
  box-shadow: 0 0 8px #ff007f;
}

.p1-widget.can-roll:not(.is-locked) .bg3-prompt-badge {
  border-color: rgba(0, 210, 255, 0.45);
  box-shadow: 0 0 14px rgba(0, 210, 255, 0.25), 0 4px 16px rgba(0, 0, 0, 0.7);
  animation: bg3-badge-pulse 1.8s infinite ease-in-out;
}
.p2-widget.can-roll:not(.is-locked) .bg3-prompt-badge {
  border-color: rgba(255, 0, 127, 0.45);
  box-shadow: 0 0 14px rgba(255, 0, 127, 0.25), 0 4px 16px rgba(0, 0, 0, 0.7);
  animation: bg3-badge-pulse 1.8s infinite ease-in-out;
}

@keyframes bg3-badge-pulse {
  0% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.03); opacity: 1; }
  100% { transform: scale(1); opacity: 0.85; }
}

.bg3-battle-die-widget.is-locked .bg3-prompt-badge {
  background: rgba(8, 12, 22, 0.95) !important;
  font-size: 11.5px !important;
  letter-spacing: 2px !important;
  padding: 7px 20px !important;
  animation: none !important;
}
.bg3-battle-die-widget.is-locked .bg3-prompt-dot {
  display: none !important;
}
.p1-widget.is-locked .bg3-prompt-badge {
  border-color: #00d2ff !important;
  color: #fff !important;
  box-shadow: 0 0 18px rgba(0, 210, 255, 0.4), inset 0 0 8px rgba(0, 210, 255, 0.15) !important;
}
.p2-widget.is-locked .bg3-prompt-badge {
  border-color: #ff007f !important;
  color: #fff !important;
  box-shadow: 0 0 18px rgba(255, 0, 127, 0.4), inset 0 0 8px rgba(255, 0, 127, 0.15) !important;
}

.bg3-battle-die-widget.cannot-roll:not(.is-locked) {
  cursor: not-allowed;
  opacity: 0.65;
}
.bg3-battle-die-widget.cannot-roll:not(.is-locked) .bg3-prompt-badge {
  opacity: 0.55;
  animation: none;
}

/* ── Streamlined Tactical Outcome Readout (Replaces .bg3-effect-desc nested box) ── */
.combat-outcome-readout,
.bg3-effect-desc {
  margin: 10px auto 0 auto !important;
  padding: 0 6px !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center !important;
  width: 100%;
}
.combat-outcome-readout:empty,
.bg3-effect-desc:empty,
.bg3-effect-desc:has(.bg3-effect-text:empty) {
  display: none !important;
}

.combat-outcome-text,
.bg3-effect-text {
  font-family: 'Inter', sans-serif !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  color: rgba(255, 255, 255, 0.75) !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8) !important;
  letter-spacing: 0.3px !important;
}
.p1-frame .bg3-effect-desc.is-locked,
.p2-frame .bg3-effect-desc.is-locked {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}
.p1-frame .bg3-effect-desc.is-locked .bg3-effect-text,
.p2-frame .bg3-effect-desc.is-locked .bg3-effect-text {
  color: rgba(255, 255, 255, 0.82) !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9) !important;
}

/* Hide player card pills */
.hud-combat-role-pill {
  display: none !important;
}

/* Suppress secondary duplicate roll text and auto-roll indicator */
.csp-roll, #cb-roll-p1, #cb-roll-p2, #combat-timer-pill, .combat-timer-pill {
  display: none !important;
}

body.combat-active::before {
  content: "";
  position: fixed;
  top: 0; bottom: 0; left: 0; width: 50vw;
  background: radial-gradient(circle at center, rgba(0,153,255,0.3) 0%, rgba(0,153,255,0.05) 40%, transparent 70%);
  background-size: 200% 200%;
  animation: combat-bg-breathe-p1 3s ease-in-out infinite alternate;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}
body.combat-active::after {
  content: "";
  position: fixed;
  top: 0; bottom: 0; right: 0; width: 50vw;
  background: radial-gradient(circle at center, rgba(255,43,177,0.3) 0%, rgba(255,43,177,0.05) 40%, transparent 70%);
  background-size: 200% 200%;
  animation: combat-bg-breathe-p2 3s ease-in-out infinite alternate;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* LIGHTNING EFFECT */
.lightning-flash {
  position: fixed;
  top: 0; bottom: 0; left: 0; right: 0;
  background: white;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: overlay;
}

body.combat-active .lightning-flash {
  animation: lightning-strike 0.5s 2;
}

@keyframes lightning-strike {
  0% { opacity: 0; }
  20% { opacity: 0.8; filter: brightness(2) drop-shadow(0 0 50px rgba(255,255,255,1)); }
  40% { opacity: 0; filter: brightness(1); }
  100% { opacity: 0; }
}

/* SETUP SCREEN RE-STYLE (From website_ref) */
.subscribe-mega-card {
    width: 780px !important;
    max-width: 95vw !important;
    padding: 32px 40px 32px 40px !important;
    background: rgba(15, 15, 15, 0.45) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border: 3px solid rgba(126, 0, 71, 0.6) !important;
    box-shadow: 0 0 35px rgba(126, 0, 71, 0.5), inset 0 0 30px rgba(0, 0, 0, 0.8) !important;
    border-radius: 12px !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    overflow: visible;
}

/* ─── GAME MODE SELECT CARDS (3D Flip / Tilt Selection) ─── */
.mode-cards-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto 20px;
  perspective: 1000px;
  position: relative;
}

.mode-card {
  flex: 1;
  height: 135px;
  min-height: 135px;
  background: rgba(20, 10, 30, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 18px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: transform 0.5s cubic-bezier(0.34, 1.4, 0.64, 1),
              border-color 0.4s ease,
              box-shadow 0.4s ease,
              background 0.4s ease,
              opacity 0.4s ease;
  user-select: none;
  transform-style: preserve-3d;
  box-sizing: border-box;
}

.mode-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.15), transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.mode-card:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

/* Left unselected tilts away with clearly defined dim frame */
.mode-card.unselected.card-left {
  transform: rotateY(14deg) scale(0.95);
  opacity: 0.8;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: rgba(18, 10, 30, 0.52);
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.35);
}

/* Right unselected tilts away with clearly defined dim frame */
.mode-card.unselected.card-right {
  transform: rotateY(-14deg) scale(0.95);
  opacity: 0.8;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: rgba(18, 10, 30, 0.52);
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5), 0 4px 16px rgba(0, 0, 0, 0.35);
}

.mode-card.unselected:hover {
  opacity: 0.95;
  border-color: rgba(255, 255, 255, 0.45);
}

/* Selected State */
.mode-card.selected {
  transform: rotateY(0deg) scale(1.04);
  opacity: 1;
  background: rgba(22, 12, 40, 0.78);
  border-color: rgba(0, 180, 255, 0.85);
  box-shadow: 0 0 28px rgba(0, 180, 255, 0.4), inset 0 0 16px rgba(0, 180, 255, 0.18);
}

.mode-card.selected::before {
  opacity: 1;
}

.mode-card.selected.card-online {
  border-color: rgba(255, 43, 177, 0.85);
  box-shadow: 0 0 28px rgba(255, 43, 177, 0.4), inset 0 0 16px rgba(255, 43, 177, 0.18);
}

.mode-card-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  transition: transform 0.4s ease, color 0.4s ease;
}

.mode-card.selected.card-hotseat .mode-card-icon {
  color: #00d2ff;
  transform: scale(1.1);
}

.mode-card.selected.card-online .mode-card-icon {
  color: #ff2bb1;
  transform: scale(1.1);
}

.mode-card-title {
  font-family: 'Inter', sans-serif !important;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 2.5px;
  color: #fff;
  text-transform: uppercase;
  margin: 0;
  text-align: center;
  line-height: 1.2;
}

.mode-card-sub {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-align: center;
  line-height: 1.2;
}

.setup-panels-wrapper {
    height: 295px !important;
    min-height: 295px !important;
    max-height: 295px !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: 360px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

/* ── INTEGRATED AI FACTION SELECTOR ON ROLL-OFF BOXES ── */
.ai-faction-dice-card {
  padding: 6px 8px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  transition: all 0.25s ease;
  user-select: none;
}

.ai-faction-dice-card:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-2px);
}

.ai-faction-dice-card.selected-human#ai-ro-card-p1 {
  border-color: var(--p1-color) !important;
  background: rgba(0, 163, 255, 0.12) !important;
  box-shadow: 0 0 20px rgba(0, 163, 255, 0.35) !important;
}

.ai-faction-dice-card.selected-human#ai-ro-card-p2 {
  border-color: var(--p2-color) !important;
  background: rgba(255, 43, 177, 0.12) !important;
  box-shadow: 0 0 20px rgba(255, 43, 177, 0.35) !important;
}

.ai-role-tag {
  font-family: 'Orbitron', sans-serif;
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 1.5px;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  transition: all 0.25s ease;
}

.ai-role-tag.tag-human {
  background: #00ffcc;
  color: #000;
  box-shadow: 0 0 10px rgba(0, 255, 204, 0.6);
}

.ai-role-tag.tag-ai {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.6);
}

.rolloff-wrap {
    min-height: 175px;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    gap: 12px;
}

.online-box {
    min-height: 175px;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    background: rgba(0,0,0,0.4);
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    margin: 0 auto;
    width: 100%;
    max-width: 350px;
    gap: 10px;
    transition: all 0.3s ease;
}

#setup-screen.modal {
    backdrop-filter: none !important; /* Let the card handle the blur */
    background: transparent !important; /* Let the fluid mesh shine through */
    transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
#setup-screen.fading-out {
    opacity: 0 !important;
    transform: scale(0.97) !important;
    pointer-events: none !important;
}

#game-screen {
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
#game-screen.fading-in {
    animation: gameFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes gameFadeIn {
    0% { opacity: 0; transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}

.subscribe-wrapper {
    align-items: center !important;
    height: 100%;
}

.blue-slot:hover img {
    filter: drop-shadow(0 0 25px rgba(0, 163, 255, 0.8)) brightness(1.3) !important;
    transition: filter 0.2s ease, transform 0.2s ease !important;
    transform: translateY(-10px);
}
.violet-slot:hover img {
    filter: drop-shadow(0 0 25px rgba(163, 0, 255, 0.8)) brightness(1.3) !important;
    transition: filter 0.2s ease, transform 0.2s ease !important;
    transform: translateY(-10px);
}

.dice-slot img {
    transition: filter 0.2s ease, transform 0.2s ease;
}

@media (max-width: 1100px) {
    .dice-slot-container[style*="left: -80px"] {
        left: -40px !important;
    }
    .dice-slot-container[style*="right: -80px"] {
        right: -40px !important;
    }
    .dice-slot {
        width: clamp(70px, 8vw, 110px) !important;
    }
}

@media (max-width: 950px) {
    .dice-slot-container {
        display: none !important;
    }
}

@media (max-width: 900px) {
    .subscribe-mega-card {
        padding: 40px 15px 30px 15px !important;
        max-height: none !important;
        width: 90vw !important;
        max-width: 90vw !important;
        margin: 0 auto !important;
    }
    .cooldown-text-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

#evade-decision-container {
    display: none;
    gap: 12px;
    margin-top: 12px;
    justify-content: center;
    align-items: center;
}
#evade-decision-container button {
    box-shadow: 0 4px 16px rgba(0,0,0,0.8);
    transition: all 0.2s ease;
    cursor: pointer;
    pointer-events: auto !important;
}
#evade-decision-container button:hover {
    transform: scale(1.05);
}

.hp-pips { position: relative; }
.hp-pips::before {
  content: attr(data-tooltip);
  position: absolute;
  background: rgba(10,5,20,0.95);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  top: 50%;
}

/* P1 Tooltip (Blue) - Shows on the right */
#p1-pips-wrapper::before {
  left: 100%;
  transform: translateY(-50%) translateX(4px);
}
#p1-pips-wrapper:hover::before {
  opacity: 1;
  transform: translateY(-50%) translateX(10px);
}

/* P2 Tooltip (Violet) - Shows on the left */
#p2-pips-wrapper::before {
  right: 100%;
  left: auto;
  transform: translateY(-50%) translateX(-4px);
}
#p2-pips-wrapper:hover::before {
  opacity: 1;
  transform: translateY(-50%) translateX(-10px);
}

/* Rulebook Help Icon */
.rb-help-icon {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.6);
  font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 4px auto; cursor: help; position: relative;
  background: transparent; border: none;
}
.rb-help-icon::before {
  content: attr(data-tooltip);
  position: absolute; right: 140%; top: 50%; transform: translateY(-50%) translateX(10px);
  background: rgba(10,5,20,0.95); padding: 6px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 700; color: #fff; border: 1px solid rgba(255,255,255,0.15);
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  z-index: 1000;
}
.rb-help-icon:hover::before {
  opacity: 1;
  transform: translateY(-50%) translateX(0px);
}

/* Left Help Icon Override */
.left-help-icon::before {
  right: auto;
  left: 140%;
  transform: translateY(-50%) translateX(-10px);
}
.left-help-icon:hover::before {
  transform: translateY(-50%) translateX(0px);
}

/* Lateral Sidebar Pips Theming */
#rb-sidebar .rb-hover-btn {
  border-color: rgba(0, 255, 200, 0.15) !important;
}
#rb-sidebar .rb-hover-btn .lt-icon {
  color: #00ffcc !important;
  opacity: 0.6 !important;
  text-shadow: 0 0 8px rgba(0, 255, 200, 0.5) !important;
  transition: opacity 0.2s ease, text-shadow 0.2s ease, transform 0.2s ease;
}
#rb-sidebar .rb-hover-btn:hover {
  background: rgba(0, 255, 200, 0.12) !important;
  border-color: rgba(0, 255, 200, 0.45) !important;
}
#rb-sidebar .rb-hover-btn:hover .lt-icon {
  opacity: 1 !important;
  color: #00ffcc !important;
  text-shadow: 0 0 14px rgba(0, 255, 200, 0.9) !important;
  transform: scale(1.25);
}
#rb-sidebar .rb-help-icon {
  color: #00ffcc !important;
  text-shadow: 0 0 10px rgba(0, 255, 200, 0.6) !important;
}

#left-sidebar .rb-hover-btn {
  border-color: rgba(255, 185, 45, 0.15) !important;
}
#left-sidebar .rb-hover-btn .lt-icon {
  color: #ffb92d !important;
  opacity: 0.6 !important;
  text-shadow: 0 0 8px rgba(255, 185, 45, 0.5) !important;
  transition: opacity 0.2s ease, text-shadow 0.2s ease, transform 0.2s ease;
}
#left-sidebar .rb-hover-btn:hover {
  background: rgba(255, 185, 45, 0.12) !important;
  border-color: rgba(255, 185, 45, 0.45) !important;
}
#left-sidebar .rb-hover-btn:hover .lt-icon {
  opacity: 1 !important;
  color: #ffb92d !important;
  text-shadow: 0 0 14px rgba(255, 185, 45, 0.9) !important;
  transform: scale(1.25);
}
#left-sidebar .left-help-icon {
  color: #ffb92d !important;
  text-shadow: 0 0 10px rgba(255, 185, 45, 0.6) !important;
}

.rb-hover-btn {
  transition: width 0.15s ease-out, background 0.15s ease, border-color 0.15s ease;
}

/* Reference Cards Animations */






/* Sidebar Dimming Transition */
#left-sidebar, #rb-sidebar {
  transition: opacity 0.3s ease, filter 0.3s ease;
}
.sidebar-dimmed {
  opacity: 0.2;
  filter: blur(4px);
}

.physical-edition-link {
  font-weight: 300;
  font-size: 18px;
  letter-spacing: 6px;
  color: inherit;
  text-shadow: none;
  text-decoration: none;
  transition: all 0.3s ease;
  opacity: 0.8;
  white-space: nowrap;
}
.physical-edition-link:hover {
  color: #fff !important;
  opacity: 1.0 !important;
  text-shadow: 0 0 20px rgba(255,255,255,0.85), 0 0 30px rgba(255,255,255,0.6) !important;
  text-decoration: underline !important;
}

/* ── MOBILE BLOCKER ── */
#mobile-blocker {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  box-sizing: border-box;
  background: #09090b;
  z-index: 99999;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
  text-align: center;
  color: #fff;
}
#mobile-blocker .mb-content {
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
#mobile-blocker svg {
  width: 64px; height: 64px;
  color: var(--p1);
  filter: drop-shadow(0 0 16px rgba(0, 153, 255, 0.4));
}
#mobile-blocker h2 {
  font-family: Orbitron, Inter, sans-serif;
  font-size: 24px;
  letter-spacing: 4px;
  margin: 0;
  color: #fff;
}
#mobile-blocker p {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  opacity: 0.7;
  margin: 0;
}

/* ─── ONLINE MULTIPLAYER HUD & TURN STYLES ─── */
.player-identity-label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 2px;
  line-height: 1.1;
  display: block;
}
.hp1 .player-identity-label {
  text-align: left;
}
.hp2 .player-identity-label {
  text-align: right;
}
.player-identity-label.role-you {
  color: #00d2ff;
  text-shadow: 0 0 8px rgba(0, 210, 255, 0.7);
}
.hp2 .player-identity-label.role-you {
  color: #ff2bb1;
  text-shadow: 0 0 8px rgba(255, 43, 177, 0.7);
}
.player-identity-label.role-opp {
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 2px;
}

.is-you-plaque {
  position: relative;
}

/* ─── TURN STATUS PILL & MTG ARENA ROPE / TIMER ─── */
.online-turn-status {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 20px;
  border-radius: 24px;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: auto;
  overflow: hidden;
  box-sizing: border-box;
}

.turn-pill-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}

/* Depleting Rope Progress Bar (Underlay across the pill bottom) */
.turn-rope-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3.5px;
  width: 100%;
  background: linear-gradient(90deg, #00ffcc, #00b4ff);
  box-shadow: 0 0 10px #00ffcc;
  transition: width 0.1s linear, background 0.4s ease, box-shadow 0.4s ease;
  z-index: 1;
}

/* Timer Badge (Clock Icon) */
.turn-timer-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 6px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: inherit;
}

#turn-timer-text {
  display: none !important;
}

.turn-timer-badge svg {
  display: inline-block;
  opacity: 0.85;
}

/* Base Pill States */
.online-turn-status.my-turn {
  color: #00ffcc;
  background: rgba(6, 34, 32, 0.94);
  border: 1.5px solid rgba(0, 255, 200, 0.72);
  text-shadow: 0 0 12px rgba(0, 255, 200, 0.75);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.72), 0 0 22px rgba(0, 255, 200, 0.35);
}

.online-turn-status.opp-turn {
  color: rgba(255, 255, 255, 0.65);
  background: rgba(14, 8, 24, 0.88);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}

.online-turn-status.opp-turn .turn-rope-bar {
  background: linear-gradient(90deg, #a300ff, #ff2bb1);
  box-shadow: 0 0 10px #a300ff;
}

/* Warning State (<= 15 seconds: Amber Glow) */
.online-turn-status.turn-warning {
  color: #ffaa00 !important;
  border-color: rgba(255, 170, 0, 0.85) !important;
  background: rgba(40, 25, 0, 0.88) !important;
  text-shadow: 0 0 14px rgba(255, 170, 0, 0.85) !important;
  box-shadow: 0 0 25px rgba(255, 170, 0, 0.5) !important;
  animation: pulse-warning 1.2s ease-in-out infinite !important;
}

.online-turn-status.turn-warning .turn-rope-bar {
  background: linear-gradient(90deg, #ffaa00, #ff8800) !important;
  box-shadow: 0 0 12px #ffaa00 !important;
}

/* Urgent State (<= 3 seconds: Urgent Crimson Glow & Pill Stroke Pulsation) */
.online-turn-status.turn-urgent {
  color: #ff2b44 !important;
  border-color: rgba(255, 43, 68, 0.95) !important;
  background: rgba(45, 10, 18, 0.92) !important;
  text-shadow: 0 0 18px rgba(255, 43, 68, 0.95) !important;
  box-shadow: 0 0 30px rgba(255, 43, 68, 0.75), inset 0 0 14px rgba(255, 43, 68, 0.4) !important;
  animation: pulse-urgent 0.5s cubic-bezier(0.4, 0, 0.6, 1) infinite !important;
}

.online-turn-status.turn-urgent .turn-rope-bar {
  background: linear-gradient(90deg, #ff2b44, #ff0055) !important;
  box-shadow: 0 0 18px #ff2b44 !important;
}

@keyframes pulse-turn {
  0%, 100% { opacity: 0.92; }
  50% { opacity: 1; }
}

@keyframes pulse-warning {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.02); filter: brightness(1.2); }
}

@keyframes pulse-urgent {
  0%, 100% { 
    transform: scale(1); 
    border-color: rgba(255, 43, 68, 0.95);
    box-shadow: 0 0 22px rgba(255, 43, 68, 0.6), inset 0 0 10px rgba(255, 43, 68, 0.3);
    filter: brightness(1.05); 
  }
  50% { 
    transform: scale(1.035); 
    border-color: rgba(255, 80, 100, 1);
    box-shadow: 0 0 36px rgba(255, 43, 68, 0.95), inset 0 0 18px rgba(255, 43, 68, 0.6);
    filter: brightness(1.35); 
  }
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  display: inline-block;
}

/* ─── MOMENTUM ACTION DOTS & HOTSEAT PILL ─── */
.momentum-dots {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  vertical-align: middle;
}

.momentum-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: transparent;
  transition: all 0.25s ease;
  box-sizing: border-box;
  opacity: 0.45;
}

.momentum-dot.filled {
  background: currentColor;
  opacity: 1;
  box-shadow: 0 0 8px currentColor;
}

.hotseat-momentum-pill {
  gap: 10px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 6px 18px;
  border-radius: 24px;
  backdrop-filter: blur(16px);
  box-sizing: border-box;
}

.hotseat-momentum-pill.p1-turn {
  color: #7cc6ff;
  background: rgba(8, 30, 54, 0.96);
  border: 1.5px solid rgba(47, 140, 255, 0.88);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.72), 0 0 20px rgba(0, 153, 255, 0.38);
  text-shadow: 0 0 10px rgba(0, 153, 255, 0.65);
}

.hotseat-momentum-pill.p2-turn {
  color: #ff77be;
  background: rgba(44, 9, 34, 0.96);
  border: 1.5px solid rgba(255, 43, 177, 0.88);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.72), 0 0 20px rgba(255, 43, 177, 0.38);
  text-shadow: 0 0 10px rgba(255, 43, 177, 0.65);
}


/* ─── IN-GAME MATCH INTRO MODAL ─── */
#match-intro-modal.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 1000 !important;
  visibility: visible !important;
}

/* ─── EXIT GAME LINK / BUTTON ─── */
.btn-exit-link {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ─── DUAL-PLAYER READY SYSTEM ─── */
.ready-system-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 12px 0 8px 0;
  padding: 8px 20px;
  background: rgba(8, 4, 16, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.ready-player-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  transition: all 0.35s ease;
}
.ready-player-badge.is-ready {
  color: #fff;
}
.ready-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  box-shadow: none;
  transition: all 0.35s ease;
}
.ready-player-badge.p1-badge.is-ready .ready-dot {
  background: #00ffcc;
  border-color: #00ffcc;
  box-shadow: 0 0 10px #00ffcc, 0 0 18px rgba(0, 255, 200, 0.6);
  animation: pulse-ready 1.5s infinite alternate;
}
.ready-player-badge.p2-badge.is-ready .ready-dot {
  background: #ff2bb1;
  border-color: #ff2bb1;
  box-shadow: 0 0 10px #ff2bb1, 0 0 18px rgba(255, 43, 177, 0.6);
  animation: pulse-ready 1.5s infinite alternate;
}
@keyframes pulse-ready {
  0% { transform: scale(1); opacity: 0.85; }
  100% { transform: scale(1.25); opacity: 1; }
}

/* ============================================================
   AUDIO TOGGLE BUTTONS (SETUP & IN-GAME)
   ============================================================ */
.audio-controls-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.setup-audio-group {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 120;
}
.in-game-audio-group {
  position: relative;
  margin-left: 14px;
  z-index: 50;
}
.audio-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  padding: 0;
  flex-shrink: 0;
  outline: none;
  user-select: none;
}
.setup-audio-group .audio-toggle-btn {
  width: 36px;
  height: 36px;
}
.in-game-audio-group .audio-toggle-btn {
  width: 32px;
  height: 32px;
}
.codex-toggle-btn {
  font-family: 'Orbitron', sans-serif !important;
  font-weight: 800 !important;
  font-size: 10.5px !important;
  letter-spacing: 1.5px !important;
  width: auto !important;
  padding: 0 16px !important;
  border-radius: 20px !important;
  color: #00ffcc !important;
  border: 1px solid rgba(0, 255, 200, 0.35) !important;
  background: rgba(0, 255, 200, 0.08) !important;
  height: 36px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.codex-toggle-btn:hover {
  background: rgba(0, 255, 200, 0.18) !important;
  border-color: #00ffcc !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(0, 255, 200, 0.4) !important;
  transform: scale(1.05);
}
.audio-toggle-btn:hover {
  background: rgba(0, 255, 200, 0.12);
  border-color: rgba(0, 255, 200, 0.55);
  color: #00ffcc;
  box-shadow: 0 0 14px rgba(0, 255, 200, 0.35);
  transform: scale(1.08);
}
.audio-toggle-btn:active {
  transform: scale(0.94);
}
.audio-toggle-btn.is-muted {
  color: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: none;
}
.audio-toggle-btn.is-muted:hover {
  border-color: rgba(255, 43, 177, 0.45);
  color: #ff2bb1;
  background: rgba(255, 43, 177, 0.1);
  box-shadow: 0 0 12px rgba(255, 43, 177, 0.3);
}
.audio-toggle-btn svg {
  pointer-events: none;
  stroke: currentColor;
}

@media (max-width: 768px), (max-height: 480px) {
  #mobile-blocker {
    display: flex;
  }
  body {
    overflow: hidden !important;
  }
  #setup-screen, #game-screen, aside, .holo-bg, .celophane-wrap, .glass-overlay, .lightning-flash {
    display: none !important;
  }
}

/* ── SUBTLE DOMINION ANTICIPATION FLASH ON CONTROL ZONE HEXES ────────────── */
.hex-poly.hex-cz-anticipation-p1 {
  stroke: rgba(0, 210, 255, 0.75) !important;
  fill: rgba(0, 210, 255, 0.12) !important;
  animation: czAnticipationFlashP1 1.6s ease-in-out infinite !important;
}

@keyframes czAnticipationFlashP1 {
  0%, 100% {
    stroke-width: 1.8px;
    filter: drop-shadow(0 0 4px rgba(0, 210, 255, 0.3));
    opacity: 0.8;
  }
  50% {
    stroke-width: 2.5px;
    filter: drop-shadow(0 0 10px rgba(0, 210, 255, 0.55));
    opacity: 1;
  }
}

.hex-poly.hex-cz-anticipation-p2 {
  stroke: rgba(255, 43, 177, 0.75) !important;
  fill: rgba(255, 43, 177, 0.12) !important;
  animation: czAnticipationFlashP2 1.6s ease-in-out infinite !important;
}

@keyframes czAnticipationFlashP2 {
  0%, 100% {
    stroke-width: 1.8px;
    filter: drop-shadow(0 0 4px rgba(255, 43, 177, 0.3));
    opacity: 0.8;
  }
  50% {
    stroke-width: 2.5px;
    filter: drop-shadow(0 0 10px rgba(255, 43, 177, 0.55));
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   SCALAR CORE SHOCKWAVE PULSE ANIMATIONS
   ═══════════════════════════════════════════════════════════════════ */
.core-shockwave-ring {
  fill: none;
  stroke: #ffd700;
  stroke-width: 4px;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 14px rgba(255, 215, 0, 0.9)) drop-shadow(0 0 28px rgba(0, 255, 200, 0.7));
}

.core-shockwave-ring.active-shockwave {
  animation: coreShockwavePulse 0.65s cubic-bezier(0.12, 0.8, 0.22, 1) forwards;
}

@keyframes coreShockwavePulse {
  0% {
    r: 10px;
    stroke-width: 8px;
    stroke: #ffffff;
    opacity: 1;
  }
  25% {
    stroke: #ffd700;
    opacity: 0.95;
  }
  65% {
    stroke: #00ffcc;
    opacity: 0.65;
  }
  100% {
    r: 440px;
    stroke-width: 0.5px;
    stroke: #0099ff;
    opacity: 0;
  }
}



/* ═══════════════════════════════════════════════════════════════════
   TACTICAL CODEX: FIXED GEOMETRY & GRAPHIC DESIGN SYSTEM v2.0
   ═══════════════════════════════════════════════════════════════════ */

/* Modal Card Geometry Lock (100% Constant Dimensions) */
#tactical-codex-modal .codex-card {
  width: min(1040px, 94vw) !important;
  height: min(720px, 86vh) !important;
  max-width: 1040px !important;
  max-height: 86vh !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 24px 28px 20px 28px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  position: relative !important;
  background: rgba(8, 4, 18, 0.97) !important;
  border: 1.5px solid rgba(0, 255, 200, 0.35) !important;
  box-shadow: 0 0 60px rgba(0, 255, 200, 0.12), 0 24px 64px rgba(0, 0, 0, 0.95) !important;
  border-radius: 14px !important;
  backdrop-filter: blur(24px) !important;
}

/* Header Elements */
.codex-header-bar {
  flex: 0 0 auto !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
  margin-bottom: 14px;
  padding-right: 140px !important;
}
.codex-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.codex-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00ffcc;
  box-shadow: 0 0 10px #00ffcc;
}
.codex-modal-title {
  margin: 0;
  font-family: 'Orbitron', sans-serif !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  letter-spacing: 2.5px !important;
  color: #fff !important;
  text-transform: uppercase;
}
.codex-header-actions {
  position: absolute !important;
  top: 22px !important;
  right: 28px !important;
  z-index: 30 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

/* Tab Navigation Bar */
.codex-tabs-bar {
  flex: 0 0 auto !important;
  display: flex;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
  margin-bottom: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.codex-tabs-bar::-webkit-scrollbar {
  display: none;
}
.codex-tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.65);
  padding: 7px 10px;
  border-radius: 6px;
  font-family: 'Orbitron', sans-serif;
  font-size: 9.5px;
  letter-spacing: 1px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex: 1 1 0;
  text-align: center;
}
.codex-tab-btn:hover {
  background: rgba(0, 255, 200, 0.08);
  color: #00ffcc;
  border-color: rgba(0, 255, 200, 0.35);
}
.codex-tab-btn.active {
  background: rgba(0, 255, 200, 0.16);
  color: #00ffcc;
  border-color: #00ffcc;
  box-shadow: 0 0 16px rgba(0, 255, 200, 0.25);
  font-weight: 700;
}

/* Stable Scroll Container (Zero Jumping) */
.codex-content-container {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-right: 10px;
  scrollbar-gutter: stable;
  color: rgba(255, 255, 255, 0.88);
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  line-height: 1.6;
}
.codex-content-container::-webkit-scrollbar {
  width: 6px;
}
.codex-content-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
}
.codex-content-container::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 200, 0.35);
  border-radius: 4px;
}

/* Tab Panels Animation */
.codex-tab-panel {
  min-height: 100%;
  animation: codexTabFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes codexTabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Banner Cards */
.codex-banner-card {
  border-radius: 10px;
  padding: 16px 20px;
  position: relative;
  overflow: hidden;
}
.banner-cyan {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.12) 0%, rgba(0, 255, 200, 0.04) 100%);
  border: 1px solid rgba(0, 255, 200, 0.35);
}
.banner-gold {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.12) 0%, rgba(255, 170, 0, 0.04) 100%);
  border: 1px solid rgba(255, 215, 0, 0.35);
}
.codex-badge-chip {
  display: inline-block;
  font-family: 'Orbitron', sans-serif;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.badge-cyan { background: rgba(0, 255, 200, 0.2); color: #00ffcc; }
.badge-gold { background: rgba(255, 215, 0, 0.2); color: #ffd700; }
.codex-banner-title {
  margin: 0 0 6px 0;
  font-family: 'Orbitron', sans-serif !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  letter-spacing: 2px !important;
  color: #fff;
}
.codex-banner-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
}

/* Card Boxes & Interactive Physics */
.codex-card-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px 16px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.codex-card-box:hover {
  transform: translateY(-2px);
}
.card-cyan { border-color: rgba(0, 210, 255, 0.3); background: rgba(0, 210, 255, 0.04); }
.card-cyan:hover { border-color: #00d2ff; box-shadow: 0 4px 20px rgba(0, 210, 255, 0.15); }

.card-gold { border-color: rgba(255, 215, 0, 0.3); background: rgba(255, 215, 0, 0.04); }
.card-gold:hover { border-color: #ffd700; box-shadow: 0 4px 20px rgba(255, 215, 0, 0.15); }

.card-magenta { border-color: rgba(255, 43, 177, 0.3); background: rgba(255, 43, 177, 0.04); }
.card-magenta:hover { border-color: #ff2bb1; box-shadow: 0 4px 20px rgba(255, 43, 177, 0.15); }

.card-neutral { border-color: rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.03); }

/* Typography & Badges in Cards */
.codex-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.codex-card-tag {
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  letter-spacing: 1.5px;
  font-weight: 700;
}
.tag-cyan { color: #00d2ff; }
.tag-gold { color: #ffd700; }
.tag-magenta { color: #ff2bb1; }

.codex-card-title {
  margin: 0 0 6px 0;
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  letter-spacing: 1.5px;
  font-weight: 800;
}
.title-cyan { color: #00d2ff; }
.title-gold { color: #ffd700; }
.title-magenta { color: #ff2bb1; }

.codex-card-body {
  margin: 0 0 8px 0;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
}

.codex-card-callout {
  font-size: 11.5px;
  padding: 8px 10px;
  border-radius: 6px;
  line-height: 1.5;
}
.callout-magenta { background: rgba(255, 43, 177, 0.1); border-left: 3px solid #ff2bb1; color: #fff; }

.codex-token-cluster {
  display: flex;
  gap: 4px;
}
.codex-token-pip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff2bb1;
  box-shadow: 0 0 8px #ff2bb1;
}

.codex-badge-mini {
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  color: #ffd700;
}

.codex-check-list {
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
}

/* Dice Class Badges & SVGs */
.codex-class-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}
.badge-magenta { color: #ff2bb1; }

.codex-dice-row {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}
.codex-die-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.45);
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.codex-die-svg {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.35));
}
.codex-die-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}
.codex-speed-arrows {
  font-size: 10px;
  opacity: 0.8;
}

.codex-trait-box {
  font-size: 11.5px;
  padding: 8px 10px;
  border-radius: 6px;
  margin: 6px 0;
  line-height: 1.5;
}
.trait-cyan { background: rgba(0, 210, 255, 0.08); border: 1px solid rgba(0, 210, 255, 0.2); color: rgba(255, 255, 255, 0.85); }
.trait-gold { background: rgba(255, 215, 0, 0.08); border: 1px solid rgba(255, 215, 0, 0.2); color: rgba(255, 255, 255, 0.85); }
.trait-magenta { background: rgba(255, 43, 177, 0.08); border: 1px solid rgba(255, 43, 177, 0.2); color: rgba(255, 255, 255, 0.85); }

.codex-stat-footer {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  font-family: 'Inter', sans-serif;
  margin-top: 4px;
}

/* Turn Action Flow Cards */
.codex-action-row {
  display: flex;
  gap: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px 18px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.codex-action-row:hover {
  transform: translateX(4px);
}
.border-cyan:hover { border-color: #00d2ff; }
.border-gold:hover { border-color: #ffd700; }
.border-magenta:hover { border-color: #ff2bb1; }

.codex-action-num {
  font-family: 'Orbitron', sans-serif;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  opacity: 0.8;
  padding-top: 2px;
}
.num-cyan { color: #00d2ff; }
.num-gold { color: #ffd700; }
.num-magenta { color: #ff2bb1; }

.codex-action-content {
  flex: 1;
}
.codex-action-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.codex-action-title {
  margin: 0;
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
}
.codex-action-chip {
  font-family: 'Orbitron', sans-serif;
  font-size: 9.5px;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 4px;
}
.chip-cyan { background: rgba(0, 210, 255, 0.15); color: #00d2ff; }
.chip-gold { background: rgba(255, 215, 0, 0.15); color: #ffd700; }
.chip-magenta { background: rgba(255, 43, 177, 0.15); color: #ff2bb1; }

.codex-action-desc {
  margin: 0 0 6px 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}
.codex-action-steps {
  margin: 0;
  padding-left: 18px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
}

/* Battle Die Special Faces */
.codex-special-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.codex-special-card:hover {
  transform: translateY(-2px);
}
.codex-special-icon-box {
  width: 56px !important;
  height: 56px !important;
  flex: 0 0 56px !important;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.box-cyan { background: rgba(0, 210, 255, 0.12); border: 1px solid rgba(0, 210, 255, 0.3); }
.box-gold { background: rgba(255, 215, 0, 0.12); border: 1px solid rgba(255, 215, 0, 0.3); }
.box-green { background: rgba(0, 255, 136, 0.12); border: 1px solid rgba(0, 255, 136, 0.3); }
.box-purple { background: rgba(192, 132, 252, 0.12); border: 1px solid rgba(192, 132, 252, 0.3); }
.box-pink { background: rgba(255, 46, 147, 0.12); border: 1px solid rgba(255, 46, 147, 0.3); }

.codex-special-svg {
  width: 40px !important;
  height: 40px !important;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.35));
}
.codex-special-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  margin-bottom: 4px;
}
.title-green { color: #00ff88; }
.title-purple { color: #c084fc; }
.title-pink { color: #ff2e93; }

.codex-special-desc {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.5;
}

.codex-number-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.codex-number-badges span {
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #00ffcc;
  background: rgba(0, 255, 200, 0.1);
  border: 1px solid rgba(0, 255, 200, 0.25);
  padding: 2px 6px;
  border-radius: 4px;
}

.codex-combo-list {
  margin: 0;
  padding-left: 16px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
}

/* Scalar Core Cards */
.codex-core-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.codex-core-box:hover {
  transform: translateY(-2px);
}
.box-aether { border-color: rgba(0, 210, 255, 0.3); background: rgba(0, 210, 255, 0.04); }
.box-aether:hover { border-color: #00d2ff; }

.box-momentum { border-color: rgba(0, 255, 200, 0.3); background: rgba(0, 255, 200, 0.04); }
.box-momentum:hover { border-color: #00ffcc; }

.box-equilibrium { border-color: rgba(255, 215, 0, 0.3); background: rgba(255, 215, 0, 0.04); }
.box-equilibrium:hover { border-color: #ffd700; }

.box-reversal { border-color: rgba(255, 43, 177, 0.3); background: rgba(255, 43, 177, 0.04); }
.box-reversal:hover { border-color: #ff2bb1; }

.codex-core-icon {
  width: 58px !important;
  height: 58px !important;
  flex: 0 0 58px !important;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
}
.codex-core-svg {
  width: 42px !important;
  height: 42px !important;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.35));
}
.codex-core-title {
  margin: 0 0 4px 0;
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.2px;
}
.codex-core-body {
  margin: 0;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.55;
}

/* Board Diagram Styling */
.codex-board-hex {
  transition: opacity 0.2s ease, filter 0.2s ease;
  cursor: default;
}
.codex-board-hex:hover {
  filter: brightness(1.3);
}


/* ═══════════════════════════════════════════════════════════════════
   SETUP 3-CARD MODE LAYOUT (HOTSEAT / VS AI / ONLINE)
   ═══════════════════════════════════════════════════════════════════ */
.mode-cards-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.mode-card.card-ai.selected {
  border-color: #ffd700;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.35);
}

.mode-card.card-ai .mode-card-icon svg {
  color: #ffd700;
}

/* ═══════════════════════════════════════════════════════════════════
   REVAMPED TUTORIAL COMMAND BANNER & BEACON PULSE
   ═══════════════════════════════════════════════════════════════════ */
#tutorial-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 450;
}

#tutorial-banner {
  position: absolute;
  top: clamp(168px, 17vh, 172px);
  left: 50%;
  transform: translateX(-50%);
  width: min(880px, 94vw);
  min-height: 66px;
  background: linear-gradient(
    180deg, 
    rgba(10, 6, 26, 0.94) 0%, 
    rgba(5, 3, 14, 0.97) 100%
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(0, 255, 204, 0.35);
  border-top: 2px solid rgba(0, 255, 204, 0.85);
  border-radius: 12px;
  box-shadow: 
    0 10px 35px rgba(0, 0, 0, 0.75),
    0 0 30px rgba(0, 255, 204, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  padding: 10px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  box-sizing: border-box;
  pointer-events: auto;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Subtle holographic scanline pattern on the banner */
#tutorial-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 204, 0.018) 2px,
    rgba(0, 255, 204, 0.018) 4px
  );
  pointer-events: none;
}

.tut-banner-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

#tut-stage-badge {
  font-family: 'Orbitron', -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2.2px;
  color: #00ffcc;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 0 12px rgba(0, 255, 204, 0.6);
}

#tut-stage-badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #00ffcc;
  border-radius: 50%;
  box-shadow: 0 0 8px #00ffcc;
  animation: tutStatusBlink 1.4s infinite alternate;
}

#tut-instruction-text {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: #ffffff;
  font-weight: 500;
  letter-spacing: 0.2px;
}

#tut-instruction-text strong,
#tut-instruction-text .tut-highlight {
  color: #00ffcc;
  font-weight: 700;
}

@keyframes tutStatusBlink {
  0% { opacity: 0.35; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1.15); box-shadow: 0 0 12px #00ffcc; }
}

/* ── STASH D4 BEACON GLOW ── */
.die-chip.tut-beacon-glow {
  position: relative;
  z-index: 10;
  border-color: #00f0ff !important;
  animation: tutBeaconBreathe 1.8s infinite ease-in-out;
  cursor: pointer !important;
}

/* ── TUTORIAL LOCKED NON-SCRIPTED STASH DICE ── */
.die-chip.tut-die-locked {
  opacity: 0.18 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
  filter: grayscale(0.9) brightness(0.5) !important;
  box-shadow: none !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
}
.die-chip.tut-die-locked:hover {
  transform: none !important;
  box-shadow: none !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
}

.die-chip.tut-beacon-glow .chip-svg {
  filter: drop-shadow(0 0 8px #00ffcc) drop-shadow(0 0 16px rgba(0, 255, 204, 0.7));
  transition: filter 0.3s ease;
}

.die-chip.tut-beacon-glow::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 1.5px solid #00f0ff;
  opacity: 0;
  pointer-events: none;
  animation: tutRadarPing 1.8s infinite cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes tutBeaconBreathe {
  0% {
    transform: scale(1);
    box-shadow: 
      0 0 12px rgba(0, 240, 255, 0.4),
      0 0 24px rgba(0, 240, 255, 0.2),
      inset 0 0 10px rgba(0, 240, 255, 0.3);
  }
  50% {
    transform: scale(1.07);
    box-shadow: 
      0 0 22px rgba(0, 240, 255, 0.85),
      0 0 45px rgba(255, 177, 0, 0.45),
      inset 0 0 18px rgba(0, 240, 255, 0.6);
    border-color: #ffd700 !important;
  }
  100% {
    transform: scale(1);
    box-shadow: 
      0 0 12px rgba(0, 240, 255, 0.4),
      0 0 24px rgba(0, 240, 255, 0.2),
      inset 0 0 10px rgba(0, 240, 255, 0.3);
  }
}

@keyframes tutRadarPing {
  0% {
    transform: scale(0.95);
    opacity: 0.9;
    border-color: #00ffcc;
  }
  70% {
    transform: scale(1.45);
    opacity: 0;
    border-color: #ffb100;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* ── TUTORIAL ACTION BUTTON GUIDANCE PULSE (ONLY IN TUTORIAL) ── */
body.tutorial-active .tut-btn-pulse {
  position: relative !important;
  z-index: 20 !important;
  border-color: #00f0ff !important;
  color: #ffffff !important;
  animation: tutBtnPulseAnim 1.8s infinite ease-in-out !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  opacity: 1 !important;
}

body.tutorial-active .tut-btn-pulse::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: inherit;
  border: 1.5px solid #00f0ff;
  opacity: 0;
  pointer-events: none;
  animation: tutRadarPing 1.8s infinite cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

@keyframes tutBtnPulseAnim {
  0% {
    transform: scale(1);
    box-shadow: 
      0 0 12px rgba(0, 240, 255, 0.4),
      0 0 24px rgba(0, 240, 255, 0.2),
      inset 0 0 10px rgba(0, 240, 255, 0.3);
    border-color: #00f0ff !important;
    color: #ffffff !important;
  }
  50% {
    transform: scale(1.05);
    box-shadow: 
      0 0 22px rgba(0, 240, 255, 0.85),
      0 0 45px rgba(255, 177, 0, 0.45),
      inset 0 0 18px rgba(0, 240, 255, 0.6);
    border-color: #ffd700 !important;
    color: #ffd700 !important;
  }
  100% {
    transform: scale(1);
    box-shadow: 
      0 0 12px rgba(0, 240, 255, 0.4),
      0 0 24px rgba(0, 240, 255, 0.2),
      inset 0 0 10px rgba(0, 240, 255, 0.3);
    border-color: #00f0ff !important;
    color: #ffffff !important;
  }
}

body.tutorial-active .tut-btn-pulse:hover {
  transform: scale(1.07) !important;
  border-color: #ffffff !important;
  color: #ffffff !important;
  box-shadow: 
    0 0 26px rgba(0, 240, 255, 1),
    0 0 50px rgba(255, 215, 0, 0.6),
    inset 0 0 18px rgba(0, 240, 255, 0.7) !important;
}

/* ── TUTORIAL LOCKED ACTION BUTTONS ── */
body.tutorial-active .act-btn:disabled {
  opacity: 0.18 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  border-color: rgba(255, 255, 255, 0.06) !important;
  box-shadow: none !important;
  filter: grayscale(0.8);
}

/* ── DEPLOY CONFIRMATION DISABLED SKIP STATE ── */
.row-popup .btn-ghost.btn-tut-disabled {
  opacity: 0.32 !important;
  cursor: not-allowed !important;
  pointer-events: auto !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: rgba(255, 255, 255, 0.4) !important;
  position: relative;
  filter: grayscale(1);
}

.row-popup .btn-ghost.btn-tut-disabled:hover::after {
  content: "TUTORIAL: Accept roll to continue";
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(12, 6, 24, 0.95);
  border: 1px solid rgba(255, 43, 177, 0.4);
  color: #ff99cc;
  font-size: 10px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 15px rgba(0,0,0,0.8);
  z-index: 1000;
}

/* ── FAST-FORWARD BANNER BUTTON ── */
.tut-banner-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-tut-continue-step {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25) 0%, rgba(0, 150, 255, 0.35) 100%);
  border: 1.5px solid #00f0ff;
  border-radius: 8px;
  color: #ffffff;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 
    0 0 20px rgba(0, 240, 255, 0.4),
    inset 0 0 12px rgba(0, 240, 255, 0.2);
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  white-space: nowrap;
}

.btn-tut-continue-step:hover {
  background: linear-gradient(135deg, #00f0ff 0%, #00aaff 100%);
  color: #041224;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.8);
}

.btn-exit-subtle-hdr {
  background: rgba(255, 60, 100, 0.12);
  border: 1px solid rgba(255, 60, 100, 0.4);
  color: #ff6b8b;
  font-family: 'Orbitron', -apple-system, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  padding: 4px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-exit-subtle-hdr:hover {
  background: rgba(255, 60, 100, 0.28);
  border-color: #ff3366;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(255, 51, 102, 0.5);
}

/* ── FIRST-TIME USER EXPERIENCE (FTUE) MODAL ── */
#ftue-welcome-modal.modal-backdrop-blur,
#ftue-welcome-modal.modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 2, 10, 0.88);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#ftue-welcome-modal.modal-backdrop-blur.active,
#ftue-welcome-modal.active {
  display: flex !important;
}

.ftue-card {
  width: 100%;
  max-width: 520px;
  background: linear-gradient(180deg, rgba(14, 8, 28, 0.98) 0%, rgba(6, 4, 14, 0.99) 100%);
  border: 1.5px solid rgba(0, 255, 204, 0.4);
  border-radius: 16px;
  padding: 38px 36px 32px 36px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.95), 0 0 50px rgba(0, 255, 204, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-sizing: border-box;
  animation: tutModalPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-height: 680px) {
  .ftue-card {
    margin-top: 55px;
  }
}

.ftue-card .preloader-logo-container {
  margin-bottom: 24px;
}

.ftue-card .preloader-title {
  margin-bottom: 20px;
}

.ftue-eyebrow {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  letter-spacing: 4px;
  color: #00ffcc;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 12px;
}

.ftue-desc {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 auto 24px auto;
  max-width: 420px;
}

.ftue-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
}

.ftue-actions #btn-ftue-start {
  padding: 13px 20px;
  font-size: 12px;
  letter-spacing: 2px;
  justify-content: center;
  text-transform: uppercase;
}

.ftue-btn-skip {
  padding: 10px 16px;
  font-size: 11px;
  letter-spacing: 1.5px;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.15);
  text-transform: uppercase;
}

/* ── PRE-GAME TUTORIAL BRIEFING / INTRO MODAL ── */
#tut-intro-modal.modal-backdrop-blur {
  position: fixed;
  inset: 0;
  background: rgba(4, 2, 10, 0.88);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tut-intro-card {
  background: linear-gradient(180deg, rgba(14, 8, 28, 0.98) 0%, rgba(6, 4, 14, 0.99) 100%);
  border: 1.5px solid rgba(0, 255, 204, 0.4);
  border-radius: 16px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.95), 0 0 50px rgba(0, 255, 204, 0.2);
  width: min(780px, 94vw);
  padding: 34px 38px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: tutModalPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.tut-intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.tut-rule-card {
  background: rgba(0, 255, 204, 0.04);
  border: 1px solid rgba(0, 255, 204, 0.22);
  border-top: 2px solid #00ffcc;
  border-radius: 10px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(0, 255, 204, 0.15);
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tut-rule-card:hover {
  background: rgba(0, 255, 204, 0.08);
  border-color: rgba(0, 255, 204, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 0 22px rgba(0, 255, 204, 0.3), inset 0 1px 0 rgba(0, 255, 204, 0.3);
}

.tut-rule-card h3,
.tut-rule-card h4 {
  margin: 0;
  font-family: 'Orbitron', sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #00ffcc;
  text-shadow: 0 0 14px rgba(0, 255, 204, 0.5);
  text-transform: uppercase;
}

.tut-rule-card p {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.8);
}

.tut-rule-card p strong {
  color: #ffffff;
  font-weight: 600;
}

/* ── TUTORIAL COMPLETION MODAL ── */
#tut-completion-modal.modal-backdrop-blur {
  position: fixed;
  inset: 0;
  background: rgba(10, 6, 20, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeInModal 0.4s ease-out;
}

#tut-completion-modal.modal-backdrop-blur.active {
  display: flex !important;
}

.tut-modal-card {
  width: 100%;
  max-width: 680px;
  background: linear-gradient(180deg, rgba(20, 32, 45, 0.72) 0%, rgba(10, 18, 28, 0.82) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(0, 255, 204, 0.45);
  border-radius: 16px;
  padding: 32px 36px;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 50px rgba(0, 255, 204, 0.2);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.tut-modal-header {
  text-align: center;
}

.tut-cert-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 4px;
  color: #00ffcc;
  text-shadow: 0 0 20px rgba(0, 255, 204, 0.4);
  margin: 0 0 8px 0;
  text-transform: uppercase;
}

.tut-modal-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 auto;
  max-width: 520px;
}

/* Dual-Tier Codex Spotlight Box */
.codex-spotlight-box {
  background: rgba(0, 255, 204, 0.03);
  border: 1px solid rgba(0, 255, 204, 0.2);
  border-radius: 12px;
  padding: 18px 20px;
}

.csb-tag {
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ffb92d;
  display: block;
  margin-bottom: 4px;
}

.csb-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  letter-spacing: 1px;
  color: #ffffff;
  margin: 0 0 12px 0;
}

.csb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.csb-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.25s ease;
}

.csb-card-quick {
  background: rgba(0, 162, 255, 0.04);
  border-color: rgba(0, 162, 255, 0.25);
}

.csb-card-quick:hover {
  border-color: rgba(0, 162, 255, 0.6);
  box-shadow: 0 0 16px rgba(0, 162, 255, 0.25);
}

.csb-card-rulebook {
  background: rgba(0, 255, 200, 0.04);
  border-color: rgba(0, 255, 200, 0.25);
}

.csb-card-rulebook:hover {
  border-color: rgba(0, 255, 200, 0.6);
  box-shadow: 0 0 16px rgba(0, 255, 200, 0.25);
}

.csb-card-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #00ffcc;
}

.csb-card h5 {
  margin: 0;
  font-size: 12px;
  color: #fff;
  font-weight: 700;
}

.csb-card p {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.65);
}

/* Modal Actions */
.tut-modal-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.tut-cta-ai {
  padding: 13px 24px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  justify-content: center;
  background: linear-gradient(135deg, #00ffcc 0%, #0099ff 100%) !important;
  color: #04020a !important;
  box-shadow: 0 0 30px rgba(0, 255, 204, 0.4) !important;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.tut-cta-ai:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 45px rgba(0, 255, 204, 0.7) !important;
}

.tut-cta-green,
.tut-cta-orange {
  font-family: 'Orbitron', sans-serif;
  padding: 14px 44px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  justify-content: center;
  align-items: center;
  display: inline-flex;
  gap: 10px;
  background: linear-gradient(135deg, #00ffcc 0%, #00cc99 100%) !important;
  color: #06030c !important;
  border: 1.5px solid rgba(0, 255, 204, 0.9) !important;
  box-shadow: 0 0 30px rgba(0, 255, 204, 0.45), 0 4px 18px rgba(0, 0, 0, 0.7) !important;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  text-shadow: none;
}

.tut-cta-green:hover,
.tut-cta-orange:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #33ffdd 0%, #00e6a8 100%) !important;
  box-shadow: 0 0 45px rgba(0, 255, 204, 0.75), 0 6px 24px rgba(0, 0, 0, 0.8) !important;
  border-color: #66ffe6 !important;
}

.tut-cta-menu {
  padding: 11px 20px;
  font-size: 11px;
  letter-spacing: 1.5px;
  justify-content: center;
  color: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  transition: all 0.2s ease;
}

.tut-cta-menu:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

@keyframes fadeInModal {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* ── IN-GAME EXIT / CONFIRMATION MODAL ── */
#game-confirm-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  align-items: center;
  justify-content: center;
  background: rgba(10, 6, 20, 0.55) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  animation: modal-fade-in 0.25s ease-out;
}

#game-confirm-modal .confirm-card {
  background: linear-gradient(180deg, rgba(28, 14, 42, 0.72) 0%, rgba(14, 7, 24, 0.82) 100%) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1.5px solid rgba(255, 51, 102, 0.45) !important;
  box-shadow: 0 0 35px rgba(255, 51, 102, 0.20), 0 16px 48px rgba(0, 0, 0, 0.5) !important;
  animation: modal-scale-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-scale-in {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

#game-confirm-modal .btn,
#gcm-btn-cancel,
#gcm-btn-confirm {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  line-height: 1 !important;
}

/* ── TUTORIAL GUIDANCE ACTIVE HOVER PULSE GLOW KEYFRAMES ── */
@keyframes tutHoverPulseCyan {
  0%, 100% {
    stroke: #ffffff !important;
    stroke-width: 2.6px !important;
    fill: rgba(0, 229, 255, 0.28) !important;
    filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.70)) drop-shadow(0 0 16px rgba(0, 229, 255, 0.35)) !important;
  }
  50% {
    stroke: #ffffff !important;
    stroke-width: 3.0px !important;
    fill: rgba(0, 229, 255, 0.42) !important;
    filter: drop-shadow(0 0 16px rgba(0, 229, 255, 0.95)) drop-shadow(0 0 28px rgba(0, 229, 255, 0.70)) !important;
  }
}

@keyframes tutHoverPulseCrimson {
  0%, 100% {
    stroke: #ffffff !important;
    stroke-width: 2.6px !important;
    fill: rgba(255, 43, 177, 0.24) !important;
    filter: drop-shadow(0 0 8px rgba(255, 43, 177, 0.70)) drop-shadow(0 0 16px rgba(255, 43, 177, 0.35)) !important;
  }
  50% {
    stroke: #ffffff !important;
    stroke-width: 3.0px !important;
    fill: rgba(255, 43, 177, 0.38) !important;
    filter: drop-shadow(0 0 16px rgba(255, 43, 177, 0.95)) drop-shadow(0 0 28px rgba(255, 43, 177, 0.70)) !important;
  }
}

@keyframes tutChipHoverPulse {
  0%, 100% {
    transform: scale(1.05);
    border-color: #ffffff !important;
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.75), inset 0 0 10px rgba(0, 240, 255, 0.4) !important;
  }
  50% {
    transform: scale(1.09);
    border-color: #ffffff !important;
    box-shadow: 0 0 24px rgba(0, 240, 255, 1), 0 0 38px rgba(0, 240, 255, 0.6), inset 0 0 16px rgba(0, 240, 255, 0.8) !important;
  }
}

@keyframes tutBtnHoverPulse {
  0%, 100% {
    border-color: #ffffff !important;
    color: #ffffff !important;
    box-shadow: 0 0 14px rgba(0, 229, 255, 0.7), inset 0 0 8px rgba(0, 229, 255, 0.35) !important;
  }
  50% {
    border-color: #ffffff !important;
    color: #ffffff !important;
    box-shadow: 0 0 26px rgba(0, 229, 255, 1), 0 0 42px rgba(0, 229, 255, 0.6), inset 0 0 16px rgba(0, 229, 255, 0.7) !important;
  }
}

/* ── SYNCHRONIZED TUTORIAL BEACON KEYFRAMES (CYAN / AMBER GOLD SHIMMER) ── */
@keyframes tutHexBeaconBreathe {
  0%, 100% {
    stroke: #00f0ff;
    stroke-width: 2.2px;
    fill: rgba(0, 210, 255, 0.16);
    filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.6)) drop-shadow(0 0 16px rgba(0, 240, 255, 0.3));
  }
  50% {
    stroke: #ffd700;
    stroke-width: 3.8px;
    fill: rgba(0, 210, 255, 0.30);
    filter: drop-shadow(0 0 16px rgba(0, 240, 255, 0.95)) drop-shadow(0 0 32px rgba(255, 177, 0, 0.75));
  }
}

@keyframes tutHexCombatBeaconBreathe {
  0%, 100% {
    stroke: rgba(255, 43, 177, 0.85);
    stroke-width: 2.2px;
    fill: rgba(255, 43, 177, 0.16);
    filter: drop-shadow(0 0 8px rgba(255, 43, 177, 0.55)) drop-shadow(0 0 16px rgba(255, 43, 177, 0.25));
  }
  50% {
    stroke: #ffd700;
    stroke-width: 3.8px;
    fill: rgba(255, 43, 177, 0.30);
    filter: drop-shadow(0 0 16px rgba(255, 43, 177, 0.9)) drop-shadow(0 0 28px rgba(255, 177, 0, 0.65)) drop-shadow(0 0 42px rgba(255, 177, 0, 0.4));
  }
}

/* ── GUIDED TUTORIAL TARGET HEX BEACON (HARMONIZED SOLID GLOW) ── */
.hex-poly.hex-tut-guide,
body.tutorial-active .hex-poly.hex-tut-guide,
body.tutorial-active .hex-poly.hex-deploy-valid-p1,
body.tutorial-active .hex-poly.hex-valid,
body.tutorial-active .hex-poly.can-move,
body.tutorial-active .hex-poly.can-move-p1,
body.tutorial-active .hex-poly.can-attack-p1 {
  stroke-dasharray: none !important;
  animation: tutHexBeaconBreathe 1.8s infinite ease-in-out !important;
  cursor: pointer !important;
  transition: fill 0.18s ease, stroke 0.18s ease, filter 0.18s ease !important;
}

body.tutorial-active .hex-poly.hex-attack,
body.tutorial-active .hex-poly.can-move-p2,
body.tutorial-active .hex-poly.can-attack-p2 {
  stroke-dasharray: none !important;
  animation: tutHexCombatBeaconBreathe 1.8s infinite ease-in-out !important;
  cursor: pointer !important;
  transition: fill 0.18s ease, stroke 0.18s ease, filter 0.18s ease !important;
}

.hex-poly.hex-tut-guide:hover,
.hex-poly.hex-tut-guide.hovered,
body.tutorial-active .hex-poly.hex-tut-guide:hover,
body.tutorial-active .hex-poly.hex-tut-guide.hovered,
body.tutorial-active .hex-poly.hex-deploy-valid-p1:hover,
body.tutorial-active .hex-poly.hex-deploy-valid-p1.hovered,
body.tutorial-active .hex-poly.hex-valid:hover,
body.tutorial-active .hex-poly.hex-valid.hovered,
body.tutorial-active .hex-poly.can-move:hover,
body.tutorial-active .hex-poly.can-move.hovered,
body.tutorial-active .hex-poly.can-move-p1:hover,
body.tutorial-active .hex-poly.can-move-p1.hovered,
body.tutorial-active .hex-poly.can-attack-p1:hover,
body.tutorial-active .hex-poly.can-attack-p1.hovered {
  animation: tutHoverPulseCyan 1.2s ease-in-out infinite alternate !important;
  stroke: #ffffff !important;
  stroke-dasharray: none !important;
  cursor: pointer !important;
}

body.tutorial-active .hex-poly.hex-attack:hover,
body.tutorial-active .hex-poly.hex-attack.hovered,
body.tutorial-active .hex-poly.can-attack:hover,
body.tutorial-active .hex-poly.can-attack.hovered,
body.tutorial-active .hex-poly.can-move-p2:hover,
body.tutorial-active .hex-poly.can-move-p2.hovered,
body.tutorial-active .hex-poly.can-attack-p2:hover,
body.tutorial-active .hex-poly.can-attack-p2.hovered {
  animation: tutHoverPulseCrimson 1.2s ease-in-out infinite alternate !important;
  stroke: #ffffff !important;
  stroke-dasharray: none !important;
  cursor: pointer !important;
}

.die-chip.tut-beacon-glow:hover {
  animation: tutChipHoverPulse 1.2s ease-in-out infinite alternate !important;
  cursor: pointer !important;
}

.tut-btn-pulse:hover {
  animation: tutBtnHoverPulse 1.2s ease-in-out infinite alternate !important;
  cursor: pointer !important;
}

/* ── TUTORIAL GUIDED HEX RADAR PING (EXACT SAME AS STASH tutRadarPing) ── */
.hex-tut-ping-wrap {
  pointer-events: none !important;
}

.hex-tut-ping {
  fill: none !important;
  stroke: #00f0ff !important;
  stroke-width: 1.5px !important;
  pointer-events: none !important;
  animation: tutHexRadarPing 1.8s infinite cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

@keyframes tutHexRadarPing {
  0% {
    transform: scale(0.95);
    opacity: 0.9;
    stroke: #00ffcc;
  }
  70% {
    transform: scale(1.45);
    opacity: 0;
    stroke: #ffb100;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* ── STASH MOVEMENT SPEED ARROWS & HEADERS ── */
.sg-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 4px 4px 4px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  width: 100% !important;
  max-width: 172px !important;
  box-sizing: border-box !important;
  margin-bottom: 8px !important;
}

.sg-title {
  font-size: 11px !important;
  font-weight: 900 !important;
  letter-spacing: 2px !important;
  text-transform: uppercase !important;
  color: rgba(255, 255, 255, 0.6) !important;
}

.stash-speed-arrows {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Arial Unicode MS', sans-serif !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  user-select: none !important;
  line-height: 1 !important;
  vertical-align: middle !important;
}

/* Stash Movement Speed Arrows (Enlarged hit area + Custom colored tooltips) */
.stash-speed-arrows {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Arial Unicode MS', sans-serif !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  user-select: none !important;
  line-height: 1 !important;
  vertical-align: middle !important;
  color: rgba(255, 255, 255, 0.6) !important;
  text-shadow: none !important;
  position: relative !important;
  cursor: help !important;
  padding: 5px 12px !important;
  margin: -5px -6px !important;
  border-radius: 6px !important;
  transition: background 0.15s ease, color 0.15s ease !important;
}

.stash-speed-arrows:hover {
  background: rgba(255, 255, 255, 0.09) !important;
  color: #ffffff !important;
}

#stash-panel-p1 .stash-speed-arrows,
.stash-p1 .stash-speed-arrows,
#stash-panel-p2 .stash-speed-arrows,
.stash-p2 .stash-speed-arrows {
  color: rgba(255, 255, 255, 0.6) !important;
  text-shadow: none !important;
}

#stash-panel-p1 .stash-speed-arrows.speed-1,
.stash-p1 .stash-speed-arrows.speed-1,
#stash-panel-p2 .stash-speed-arrows.speed-1,
.stash-p2 .stash-speed-arrows.speed-1 {
  font-size: 11px !important;
  letter-spacing: 0px !important;
  text-shadow: none !important;
}

#stash-panel-p1 .stash-speed-arrows.speed-2,
.stash-p1 .stash-speed-arrows.speed-2,
#stash-panel-p2 .stash-speed-arrows.speed-2,
.stash-p2 .stash-speed-arrows.speed-2 {
  font-size: 11px !important;
  letter-spacing: 2.5px !important;
  text-shadow: none !important;
}

/* Tooltip popup for stash movement speed arrows */
.stash-speed-arrows[data-tooltip]:not([data-tooltip=""])::before {
  content: attr(data-tooltip);
  white-space: nowrap;
  position: absolute;
  top: 50%;
  padding: 6px 14px;
  border-radius: 6px;
  font-family: 'Orbitron', 'Inter', sans-serif;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.25, 1, 0.5, 1), transform 0.2s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 100;
}

/* P1 (Azure) stash: Azure tooltip on the RIGHT of the arrows, towards screen center */
#stash-panel-p1 .stash-speed-arrows[data-tooltip]::before,
.stash-p1 .stash-speed-arrows[data-tooltip]::before {
  left: calc(100% + 10px);
  right: auto;
  transform: translateY(-50%) translateX(-4px);
  background: rgba(0, 153, 255, 0.95) !important;
  border: 1px solid rgba(0, 153, 255, 0.8) !important;
  box-shadow: 0 4px 16px rgba(0, 153, 255, 0.45), 0 2px 8px rgba(0, 0, 0, 0.8) !important;
  color: #ffffff !important;
}
#stash-panel-p1 .stash-speed-arrows[data-tooltip]:hover::before,
.stash-p1 .stash-speed-arrows[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* P2 (Violet) stash: Violet tooltip on the LEFT of the arrows, not below */
#stash-panel-p2 .stash-speed-arrows[data-tooltip]::before,
.stash-p2 .stash-speed-arrows[data-tooltip]::before {
  right: calc(100% + 10px);
  left: auto;
  transform: translateY(-50%) translateX(4px);
  background: rgba(255, 43, 177, 0.95) !important;
  border: 1px solid rgba(255, 43, 177, 0.8) !important;
  box-shadow: 0 4px 16px rgba(255, 43, 177, 0.45), 0 2px 8px rgba(0, 0, 0, 0.8) !important;
  color: #ffffff !important;
}
#stash-panel-p2 .stash-speed-arrows[data-tooltip]:hover::before,
.stash-p2 .stash-speed-arrows[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ── TUTORIAL PHASE TRANSITION OVERLAY ── */
#tut-phase-transition-overlay,
.tut-phase-transition-overlay {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(4, 2, 10, 0.75) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  z-index: 850 !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   UNIT DEATH & DISINTEGRATION VFX
   ═══════════════════════════════════════════════════════════════════ */

/* 1. Board Impact Micro-Shake */
.board-impact-shake {
  animation: boardMicroImpact 0.24s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}
@keyframes boardMicroImpact {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3px, 2px); }
  40% { transform: translate(3px, -2px); }
  60% { transform: translate(-2px, -1px); }
  80% { transform: translate(1px, 1px); }
  100% { transform: translate(0, 0); }
}

/* 2. VFX Container */
.unit-death-fx {
  pointer-events: none;
}

/* 3. Shockwave Dissolution Ring */
.unit-death-shock-ring {
  fill: none;
  stroke-width: 6px;
  opacity: 0;
  pointer-events: none;
}
.death-fx-p1 .unit-death-shock-ring {
  stroke: #00d2ff;
  filter: drop-shadow(0 0 12px rgba(0, 210, 255, 0.95)) drop-shadow(0 0 24px rgba(0, 153, 255, 0.6));
  animation: deathRingExpand 0.52s cubic-bezier(0.12, 0.8, 0.22, 1) forwards;
}
.death-fx-p2 .unit-death-shock-ring {
  stroke: #ff2bb1;
  filter: drop-shadow(0 0 12px rgba(255, 43, 177, 0.95)) drop-shadow(0 0 24px rgba(255, 0, 128, 0.6));
  animation: deathRingExpand 0.52s cubic-bezier(0.12, 0.8, 0.22, 1) forwards;
}
@keyframes deathRingExpand {
  0% {
    r: 12px;
    stroke-width: 8px;
    opacity: 1;
    stroke: #ffffff;
  }
  30% {
    opacity: 0.95;
  }
  100% {
    r: 78px;
    stroke-width: 0.5px;
    opacity: 0;
  }
}

/* 4. Central Plasma Core Burst */
.unit-death-plasma-core {
  pointer-events: none;
  opacity: 0;
}
.death-fx-p1 .unit-death-plasma-core {
  fill: #00ffff;
  filter: drop-shadow(0 0 16px #00d2ff) drop-shadow(0 0 30px #0099ff);
  animation: plasmaCoreBurst 0.38s ease-out forwards;
}
.death-fx-p2 .unit-death-plasma-core {
  fill: #ff33aa;
  filter: drop-shadow(0 0 16px #ff2bb1) drop-shadow(0 0 30px #ff007f);
  animation: plasmaCoreBurst 0.38s ease-out forwards;
}
@keyframes plasmaCoreBurst {
  0% {
    r: 8px;
    fill: #ffffff;
    opacity: 1;
  }
  40% {
    r: 32px;
    opacity: 0.85;
  }
  100% {
    r: 48px;
    opacity: 0;
  }
}

/* 5. Ghost Shape Red-Shift Shatter */
.unit-death-ghost-shape {
  pointer-events: none;
  transform-origin: center center;
}
.death-fx-p1 .unit-death-ghost-shape {
  color: var(--p1, #0099ff);
  animation: ghostRedShiftShatter 0.44s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.death-fx-p2 .unit-death-ghost-shape {
  color: var(--p2, #ff2bb1);
  animation: ghostRedShiftShatter 0.44s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes ghostRedShiftShatter {
  0% {
    opacity: 1;
    transform: scale(1);
    filter: brightness(2.8) drop-shadow(0 0 20px #ffffff);
  }
  25% {
    opacity: 0.95;
    transform: scale(1.18) translate(-1px, 2px);
    filter: brightness(2) drop-shadow(0 0 18px #ff1155) drop-shadow(0 0 28px #ff0044);
    color: #ff2255;
  }
  50% {
    opacity: 0.8;
    transform: scale(1.24) translate(2px, -1px);
    filter: brightness(1.6) drop-shadow(0 0 24px #ff1155);
    color: #ff3366;
  }
  75% {
    opacity: 0.4;
    transform: scale(1.12);
    filter: brightness(1.2) blur(2px);
  }
  100% {
    opacity: 0;
    transform: scale(0.85);
    filter: brightness(0.5) blur(6px);
  }
}

/* 6. Exploding Polyhedral Crystal Shards */
.unit-death-shard {
  pointer-events: none;
  transform-origin: 0 0;
  opacity: 0;
}
.death-fx-p1 .unit-death-shard {
  fill: #00d2ff;
  stroke: #ffffff;
  stroke-width: 0.8px;
  filter: drop-shadow(0 0 8px rgba(0, 210, 255, 0.8));
  animation: shardExplode 0.5s cubic-bezier(0.15, 0.85, 0.35, 1) forwards;
}
.death-fx-p2 .unit-death-shard {
  fill: #ff2bb1;
  stroke: #ffffff;
  stroke-width: 0.8px;
  filter: drop-shadow(0 0 8px rgba(255, 43, 177, 0.8));
  animation: shardExplode 0.5s cubic-bezier(0.15, 0.85, 0.35, 1) forwards;
}
@keyframes shardExplode {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  35% {
    opacity: 1;
    stroke: #ff2255;
  }
  70% {
    opacity: 0.7;
    transform: translate(calc(var(--shard-tx, 40px) * 0.8), calc(var(--shard-ty, 40px) * 0.8)) scale(0.7) rotate(calc(var(--shard-rot, 45deg) * 0.7));
  }
  100% {
    opacity: 0;
    transform: translate(var(--shard-tx, 50px), var(--shard-ty, 50px)) scale(0.15) rotate(var(--shard-rot, 90deg));
  }
}



