* { box-sizing: border-box; }

:root {
  --x-color: #ff3d6e;
  --x-glow: #ff89aa;
  --o-color: #3dc9ff;
  --o-glow: #89e3ff;
  --bg-0: #05060b;
  --bg-1: #0b0f1e;
  --ink: #e7ecf5;
  --ink-dim: #8993a8;
  --panel: rgba(10, 14, 26, 0.82);
  --panel-stroke: rgba(120, 160, 220, 0.18);
  --accent: #7c9cff;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: radial-gradient(ellipse at center, var(--bg-1) 0%, var(--bg-0) 70%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  touch-action: none;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  cursor: grab;
}
#scene:active { cursor: grabbing; }

/* --- HUD ----------------------------------------------------------------- */
#hud {
  position: fixed;
  top: env(safe-area-inset-top, 0);
  left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 18px 22px;
  pointer-events: none;
  z-index: 10;
}

/* Turn indicator sits bottom-center, under the cube. */
#turn-indicator {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 22px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  max-width: 92vw;
}

.turn {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px 10px 14px;
  background: var(--panel);
  border: 1px solid var(--panel-stroke);
  border-radius: 14px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: border-color .3s, box-shadow .3s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.turn .glyph {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 18px;
}
.turn.x-turn .glyph {
  color: var(--x-color);
  background: rgba(255, 61, 110, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 61, 110, 0.4);
}
.turn.o-turn .glyph {
  color: var(--o-color);
  background: rgba(61, 201, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(61, 201, 255, 0.4);
}
.turn.x-turn { box-shadow: 0 0 0 1px rgba(255,61,110,.25), 0 10px 30px rgba(255,61,110,.08); }
.turn.o-turn { box-shadow: 0 0 0 1px rgba(61,201,255,.25), 0 10px 30px rgba(61,201,255,.08); }

/* --- Buttons ------------------------------------------------------------- */
.btn {
  pointer-events: auto;
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--panel-stroke);
  padding: 9px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .05s;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.btn:hover { background: rgba(30, 40, 70, 0.8); border-color: rgba(160, 180, 230, 0.35); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: rgba(10, 14, 26, 0.55); }
.btn.primary {
  background: linear-gradient(180deg, #3e5bff, #2b40cc);
  border-color: #6a7dff;
  box-shadow: 0 6px 20px rgba(62, 91, 255, 0.35);
}
.btn.primary:hover { filter: brightness(1.1); }

#menu-btn {
  font-size: 18px;
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

/* --- Hint ---------------------------------------------------------------- */
/* Pushed above the turn indicator. */
#hint {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 88px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  pointer-events: none;
  z-index: 5;
  opacity: 0.6;
  max-width: 92vw;
  text-align: center;
}

/* --- Layer pager --------------------------------------------------------- */
#layer-pager {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 6;
}
#layer-pager .btn {
  padding: 8px 10px;
  font-size: 12px;
  min-width: 50px;
  text-align: center;
}
#layer-pager .btn.active {
  background: rgba(124, 156, 255, 0.25);
  border-color: var(--accent);
  color: #fff;
}

/* --- Modal --------------------------------------------------------------- */
#modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  z-index: 100;
  padding: 16px;
}
#modal.hidden { display: none; }

.modal-card {
  position: relative;
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #121830, #0a0f20);
  border: 1px solid var(--panel-stroke);
  border-radius: 18px;
  padding: 24px 26px 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.modal-card h2 {
  margin: 0 0 18px;
  font-size: 22px;
  letter-spacing: 0.01em;
}
.modal-card h2 .dim { color: var(--ink-dim); font-weight: 400; }
.modal-card h3 {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 18px 0 8px;
}
.modal-card section { border-top: 1px solid var(--panel-stroke); padding-top: 6px; }
.modal-card section:first-of-type { border-top: 0; padding-top: 0; }

.modal-card .row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

/* Mode button group: a row of full-width pill buttons that wrap on narrow
   screens. Selected button gets the accent ring + bright text. */
.mode-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mode-btn {
  flex: 1 1 140px;
  font: inherit;
  font-size: 13px;
  color: var(--ink-dim);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-stroke);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s, box-shadow .15s;
  text-align: center;
  white-space: nowrap;
}
.mode-btn:hover { color: var(--ink); border-color: rgba(124, 156, 255, 0.35); }
.mode-btn.active {
  color: var(--ink);
  border-color: var(--accent);
  background: rgba(124, 156, 255, 0.14);
  box-shadow: 0 0 0 3px rgba(124, 156, 255, 0.18);
}
.modal-card label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.modal-card label.block { display: block; margin-top: 10px; }
.modal-card input[type=text],
.modal-card input[type=password],
.modal-card select {
  font: inherit;
  padding: 8px 10px;
  background: #070b18;
  color: var(--ink);
  border: 1px solid var(--panel-stroke);
  border-radius: 8px;
  min-width: 160px;
}
.modal-card label.block input { width: 100%; margin-top: 6px; }
.modal-card p { color: var(--ink-dim); font-size: 13px; line-height: 1.55; }
.close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: transparent;
  color: var(--ink-dim);
  font-size: 22px;
  border: 0;
  cursor: pointer;
}
.close:hover { color: var(--ink); }

.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--panel-stroke);
}

/* --- End-game overlay ---------------------------------------------------- */
#endgame {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(3px);
  z-index: 50;
  animation: fadein .35s ease;
}
#endgame.hidden { display: none; }
.endgame-card {
  text-align: center;
  padding: 30px 40px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--panel-stroke);
  min-width: 280px;
}
.endgame-card h2 {
  font-size: 40px;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.endgame-card.x h2 { color: var(--x-color); text-shadow: 0 0 30px var(--x-glow); }
.endgame-card.o h2 { color: var(--o-color); text-shadow: 0 0 30px var(--o-glow); }
.endgame-card.draw h2 { color: var(--ink); }
.endgame-card p { color: var(--ink-dim); margin: 0 0 20px; }

@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* --- AI thinking spinner ------------------------------------------------- */
#ai-status {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--panel);
  border: 1px solid var(--panel-stroke);
  border-radius: 12px;
  z-index: 20;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 13px;
}
#ai-status.hidden { display: none; }
.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(124, 156, 255, 0.25);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  #hint { font-size: 10px; bottom: 10px; }
  #hud { padding: 12px 14px; }
  .endgame-card h2 { font-size: 32px; }
  .welcome-title { font-size: clamp(36px, 13vw, 80px) !important; }
}

/* --- Password gate ------------------------------------------------------- */
#password-gate {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(ellipse at center,
      rgba(20, 30, 70, 0.45) 0%,
      rgba(6, 8, 18, 0.9) 55%,
      rgba(2, 3, 8, 0.98) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadein 0.3s ease;
}
#password-gate.hidden { display: none; }
/* .pending = we haven't yet heard from /config.json. Keep the overlay opaque
   to hide the welcome behind it, but skip the fade-in so the reveal after
   config loads feels instant. */
#password-gate.pending .password-card { opacity: 0; pointer-events: none; }
.password-card {
  width: min(360px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 28px 26px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--panel-stroke);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.password-tag {
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--ink-dim);
  text-transform: uppercase;
}
.password-card h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.password-card input[type=password] {
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-stroke);
  border-radius: 10px;
  padding: 11px 13px;
  outline: none;
}
.password-card input[type=password]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 156, 255, 0.18);
}
.password-card .btn.primary { justify-content: center; text-align: center; }
.password-error {
  color: var(--x-color);
  font-size: 13px;
  margin-top: -4px;
}
.password-error.hidden { display: none; }
.password-card.shake { animation: shake 0.35s ease; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

/* --- Opening screen ------------------------------------------------------ */
#welcome {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(ellipse at center,
      rgba(20, 30, 70, 0.35) 0%,
      rgba(6, 8, 18, 0.82) 55%,
      rgba(2, 3, 8, 0.95) 100%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: background 0.9s ease, backdrop-filter 0.9s ease, opacity 0.6s ease 0.6s;
  overflow: hidden;
}
/* When dismissing, fade the backdrop + non-title content, but leave the title
   in place so it can FLIP-animate up to the header. */
#welcome.hiding {
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}
#welcome.hiding .welcome-aura,
#welcome.hiding .welcome-tag,
#welcome.hiding .welcome-sub,
#welcome.hiding .welcome-cta {
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
#welcome.gone { display: none; }

/* Animated glow aura behind the title */
.welcome-aura {
  position: absolute;
  width: 900px;
  height: 900px;
  max-width: 140vmin;
  max-height: 140vmin;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 61, 110, 0.28), transparent 45%),
    radial-gradient(circle at 70% 70%, rgba(61, 201, 255, 0.28), transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(124, 156, 255, 0.18), transparent 60%);
  filter: blur(40px);
  animation: auraSpin 18s linear infinite, auraPulse 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes auraSpin { to { transform: rotate(360deg); } }
@keyframes auraPulse {
  0%, 100% { opacity: 0.85; transform: scale(1) rotate(0); }
  50% { opacity: 1; transform: scale(1.05) rotate(180deg); }
}

.welcome-inner {
  position: relative;
  text-align: center;
  padding: 0 20px;
  max-width: 100%;
}

.welcome-tag {
  font-size: 13px;
  letter-spacing: 0.5em;
  color: #aab6d8;
  margin-bottom: 22px;
  padding-left: 0.5em; /* optical center for tracked text */
  opacity: 0;
  animation: tagIn 1.1s ease 0.25s forwards;
}
@keyframes tagIn {
  0% { opacity: 0; letter-spacing: 0.2em; transform: translateY(10px); }
  100% { opacity: 0.9; letter-spacing: 0.5em; transform: translateY(0); }
}

.welcome-title {
  font-size: clamp(42px, 9vw, 104px);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.0;
  margin: 0 0 20px;
  perspective: 800px;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
}

.welcome-title .char {
  display: inline-block;
  background: linear-gradient(180deg, #ffffff 0%, #c3d2ff 45%, #6a85e8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  opacity: 0;
  transform-origin: 50% 80%;
  will-change: transform, opacity, filter;
  animation:
    charIn 0.95s cubic-bezier(0.2, 1.4, 0.45, 1) forwards,
    charFloat 3.6s ease-in-out infinite;
  animation-delay:
    calc(0.6s + var(--i) * 0.07s),
    calc(1.9s + var(--i) * 0.14s);
}
.welcome-title .char.accent-x {
  background: linear-gradient(180deg, #ffd0dd 0%, #ff6a90 45%, #c11a46 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.welcome-title .char.accent-o {
  background: linear-gradient(180deg, #cbf1ff 0%, #49cdff 45%, #1a80b2 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.welcome-title .char.bang {
  background: linear-gradient(180deg, #fff2a8 0%, #ffb84d 50%, #ff3d6e 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.welcome-title .space { display: inline-block; width: 0.35em; }
/* A whole word wraps as one unit — chars inside never break mid-word. */
.welcome-title .word { display: inline-block; white-space: nowrap; }

@keyframes charIn {
  0% {
    opacity: 0;
    transform: translateY(-80px) rotateX(-90deg) scale(0.35);
    filter: blur(8px) drop-shadow(0 0 18px rgba(124, 156, 255, 0.9));
  }
  55% {
    opacity: 1;
    transform: translateY(10px) rotateX(20deg) scale(1.08);
    filter: blur(0) drop-shadow(0 0 14px rgba(124, 156, 255, 0.8));
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateX(0) scale(1);
    filter: blur(0) drop-shadow(0 2px 6px rgba(124, 156, 255, 0.35));
  }
}
@keyframes charFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-6px) rotate(-1deg); }
}

/* Docked header state: small, pinned to top center of the viewport. */
.welcome-title.docked {
  position: fixed;
  top: 14px;
  left: 50%;
  margin: 0;
  padding: 0 14px;
  font-size: clamp(14px, 2.3vw, 22px);
  letter-spacing: 0;
  z-index: 30;
  pointer-events: none;
  perspective: 400px;
  filter: drop-shadow(0 4px 14px rgba(60, 90, 180, 0.35));
  /* transform is driven by JS (FLIP) to animate from center → top */
}
.welcome-title.docked .char {
  /* kill the entrance animation, keep a subtle ambient float */
  animation: charFloat 4.5s ease-in-out infinite !important;
  animation-delay: calc(var(--i) * 0.2s) !important;
  /* charIn's forwards end state is lost once we swap animations, so the base
     opacity: 0 would re-assert and make the docked title invisible. */
  opacity: 1;
}

@media (max-width: 768px) {
  .welcome-title.docked {
    top: 8px !important;
    font-size: 12px !important;
    padding: 0 8px !important;
    max-width: 96vw !important;
    white-space: nowrap !important;
    line-height: 1 !important;
  }
  .welcome-title.docked .char { font-size: 12px !important; }
}

.welcome-sub {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8993a8;
  margin: 10px 0 34px;
  opacity: 0;
  animation: subIn 1s ease 2.1s forwards;
}
@keyframes subIn { to { opacity: 0.9; transform: translateY(0); } }

.welcome-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px 14px 30px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(180deg, #4d6bff 0%, #2b40cc 100%);
  border: 1px solid #8296ff;
  border-radius: 999px;
  box-shadow:
    0 10px 30px rgba(62, 91, 255, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px) scale(0.92);
  animation:
    ctaIn 0.7s cubic-bezier(0.2, 1.3, 0.4, 1) 2.35s forwards,
    ctaPulse 2.8s ease-in-out 3.4s infinite;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.welcome-cta:hover { filter: brightness(1.1); transform: translateY(-2px) scale(1.02); }
.welcome-cta:active { transform: translateY(0) scale(0.99); }
.welcome-cta::after {
  content: '';
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg,
    transparent 0%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 100%);
  transform: skewX(-20deg);
  animation: ctaShine 3.5s ease-in-out 4s infinite;
  pointer-events: none;
}
@keyframes ctaIn { to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes ctaPulse {
  0%, 100% {
    box-shadow: 0 10px 30px rgba(62, 91, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
  50% {
    box-shadow:
      0 10px 44px rgba(62, 91, 255, 0.75),
      0 0 80px rgba(124, 156, 255, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.35);
  }
}
@keyframes ctaShine {
  0% { left: -120%; }
  60%, 100% { left: 130%; }
}

/* --- Name prompt --------------------------------------------------------- */
#name-prompt {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(ellipse at center,
      rgba(20, 30, 70, 0.45) 0%,
      rgba(6, 8, 18, 0.9) 55%,
      rgba(2, 3, 8, 0.98) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadein 0.3s ease;
}
#name-prompt.hidden { display: none; }
.name-card {
  width: min(380px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 28px 26px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--panel-stroke);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.name-card h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.01em;
}
#name-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.name-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.name-role {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}
.name-role.x {
  color: var(--x-color);
  background: rgba(255, 61, 110, 0.12);
  border: 1px solid rgba(255, 61, 110, 0.35);
}
.name-role.o {
  color: var(--o-color);
  background: rgba(61, 201, 255, 0.12);
  border: 1px solid rgba(61, 201, 255, 0.35);
}
.name-row input {
  flex: 1;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-stroke);
  border-radius: 10px;
  padding: 11px 13px;
  outline: none;
}
.name-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 156, 255, 0.18);
}
.name-card .btn.primary { justify-content: center; text-align: center; }

/* --- WarGames easter-egg overlay ---------------------------------------- */
#wargames {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(ellipse at center,
      rgba(10, 14, 30, 0.78) 0%,
      rgba(2, 3, 8, 0.97) 70%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadein 0.8s ease;
}
#wargames.hidden { display: none; }
.wargames-card {
  width: min(520px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 40px 32px 30px;
  border-radius: 18px;
  text-align: center;
  background: rgba(3, 7, 20, 0.88);
  border: 1px solid rgba(124, 200, 255, 0.35);
  box-shadow: 0 0 60px rgba(80, 180, 255, 0.18);
}
.wargames-quote {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: clamp(16px, 2.4vw, 22px);
  line-height: 1.55;
  color: #cfe9ff;
  letter-spacing: 0.02em;
  text-shadow: 0 0 14px rgba(80, 180, 255, 0.35);
}
.wargames-link {
  display: inline-block;
  padding: 16px 28px;
  margin: 4px auto 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #7cd6ff 0%, #7c9cff 55%, #ff6b9a 120%);
  color: #0a0f1e;
  font-weight: 700;
  font-size: clamp(17px, 2.8vw, 22px);
  letter-spacing: 0.03em;
  text-decoration: none;
  box-shadow: 0 12px 40px rgba(80, 180, 255, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.wargames-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 52px rgba(80, 180, 255, 0.55);
  color: #0a0f1e;
}
.wargames-link:active { transform: translateY(0); }
.wargames-card .btn.primary { justify-content: center; text-align: center; }

