/* ==========================================================================
   Drawn to War — style.css
   Vanilla port of the Next.js/Tailwind look: military dark neutral-950
   field, amber command accents, Black Ops One titles, Rajdhani UI text,
   clipped stencil corners, film grain and ember light.
   ========================================================================== */

/* ------------------------------ base ------------------------------ */

:root {
  --n950: #0a0a0a;
  --n900: #171717;
  --n800: #262626;
  --n700: #404040;
  --n600: #525252;
  --n500: #737373;
  --n400: #a3a3a3;
  --n300: #d4d4d4;
  --n200: #e5e5e5;
  --n100: #f5f5f5;
  --amber200: #fde68a;
  --amber300: #fcd34d;
  --amber400: #fbbf24;
  --amber500: #f59e0b;
  --amber600: #d97706;
  --amber700: #b45309;
  --orange500: #f97316;
  --orange600: #ea580c;
  --orange700: #c2410c;
  --red200: #fecaca;
  --red300: #fca5a5;
  --red400: #f87171;
  --red500: #ef4444;
  --red600: #dc2626;
  --red700: #b91c1c;
  --red800: #991b1b;
  --red900: #7f1d1d;
  --red950: #450a0a;
  --emerald200: #a7f3d0;
  --emerald300: #6ee7b7;
  --emerald400: #34d399;
  --emerald500: #10b981;
  --emerald900: #064e3b;
  --emerald950: #022c22;
  --sky300: #7dd3fc;
  --sky400: #38bdf8;
  --zinc800: #27272a;
  --font-ui: "Rajdhani", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-title: "Black Ops One", "Impact", "Arial Black", sans-serif;
}

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

html,
body {
  height: 100%;
}

body {
  background: var(--n950);
  color: var(--n100);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.font-title {
  font-family: var(--font-title);
  font-weight: 400;
}

.font-ui {
  font-family: var(--font-ui);
}

.amber { color: var(--amber400); }
.red { color: var(--red400); }
.emerald { color: var(--emerald400); }
.sky { color: var(--sky400); }
.gray { color: var(--n600); }
.italic { font-style: italic; }

.pulse {
  animation: dtow-pulse 1.6s ease-in-out infinite;
}

@keyframes dtow-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.cursor-crosshair { cursor: crosshair; }
.cursor-cell { cursor: cell; }

kbd {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.6);
  padding: 0 4px;
  font-family: var(--font-ui);
  font-size: 9px;
  color: var(--n300);
}

/* hidden on small screens, visible from 640px up */
.hidden-sm { display: none; }

/* ---------------------- shared atmosphere effects ---------------------- */

.dtow-grain {
  position: absolute;
  inset: -100%;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: dtow-grain-shift 0.9s steps(4) infinite;
}

@keyframes dtow-grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 3%); }
  50% { transform: translate(3%, -2%); }
  75% { transform: translate(-3%, -3%); }
  100% { transform: translate(2%, 2%); }
}

.dtow-scanlines {
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.16) 3px,
    rgba(0, 0, 0, 0.16) 4px
  );
}

.dtow-kenburns {
  animation: dtow-kenburns 45s ease-in-out infinite alternate;
}

@keyframes dtow-kenburns {
  from { transform: scale(1) translateX(0); }
  to { transform: scale(1.12) translateX(-1.5%); }
}

.dtow-title-glow {
  text-shadow:
    0 0 18px rgba(245, 158, 11, 0.55),
    0 0 45px rgba(234, 88, 12, 0.35),
    0 2px 0 rgba(0, 0, 0, 0.8);
}

.dtow-blink {
  animation: dtow-blink 1.6s steps(2) infinite;
}

@keyframes dtow-blink {
  0%, 55% { opacity: 1; }
  56%, 100% { opacity: 0.15; }
}

.dtow-scroll::-webkit-scrollbar { width: 6px; }
.dtow-scroll::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.04); }
.dtow-scroll::-webkit-scrollbar-thumb { background: rgba(245, 158, 11, 0.45); }
.dtow-scroll::-webkit-scrollbar-thumb:hover { background: rgba(245, 158, 11, 0.7); }

.dtow-divider {
  background: repeating-linear-gradient(
    -45deg,
    rgba(245, 158, 11, 0.55) 0px,
    rgba(245, 158, 11, 0.55) 2px,
    transparent 2px,
    transparent 8px
  );
}

@media (prefers-reduced-motion: reduce) {
  .dtow-grain,
  .dtow-kenburns,
  .dtow-blink,
  .pulse {
    animation: none;
  }
}

/* ------------------------------ main menu ------------------------------ */

.menu-root {
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  background: var(--n950);
  font-family: var(--font-ui);
}

.menu-bg-wrap {
  position: absolute;
  inset: 0;
}

.menu-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-grad-r {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(10, 10, 10, 0.95),
    rgba(10, 10, 10, 0.7),
    rgba(10, 10, 10, 0.4)
  );
}

.menu-grad-t {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10, 10, 10, 0.85),
    transparent,
    rgba(10, 10, 10, 0.4)
  );
}

.menu-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 45%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

.menu-scanlines {
  position: absolute;
  inset: 0;
  opacity: 0.4;
}

.menu-root .dtow-grain {
  position: absolute;
}

.menu-content {
  position: relative;
  z-index: 10;
  margin: 0 auto;
  min-height: 100vh;
  width: 100%;
  max-width: 80rem;
  display: flex;
  align-items: center;
  padding: 40px 24px;
}

.menu-col {
  display: flex;
  width: 100%;
  max-width: 28rem;
  flex-direction: column;
  justify-content: center;
}

.menu-anim {
  animation: menu-fade-in 0.7s ease-out both;
  animation-delay: var(--md, 0ms);
}

@keyframes menu-fade-in {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

.menu-title {
  line-height: 0.95;
}

.menu-title-top,
.menu-title-amber {
  display: block;
  font-size: 48px;
  letter-spacing: 0.025em;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.9);
}

.menu-title-top { color: var(--n100); }
.menu-title-amber { color: var(--amber400); font-weight: 400; }

.menu-tagline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.menu-chevrons {
  display: flex;
  flex-direction: column;
  color: rgba(245, 158, 11, 0.9);
}

.menu-chevrons .chev { width: 16px; height: 16px; }
.menu-chevrons .chev-1,
.menu-chevrons .chev-2 { margin-bottom: -8px; }
.menu-chevrons.small .chev { width: 14px; height: 14px; }
.menu-chevrons.small .chev-1 { margin-bottom: -6px; }

.menu-tagline-text {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--n400);
}

.menu-divider {
  margin: 32px 0;
  height: 1px;
  width: 256px;
  transform-origin: left;
  background: linear-gradient(
    to right,
    rgba(245, 158, 11, 0.7),
    rgba(245, 158, 11, 0.2),
    transparent
  );
  animation: menu-divider-in 0.6s ease-out 0.4s both;
}

@keyframes menu-divider-in {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.menu-nav {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 12px;
}

.menu-status {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 20px;
  row-gap: 4px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--n600);
}

.menu-status .dot-sep { display: none; }

.menu-server {
  color: rgba(217, 119, 6, 0.9);
}

/* ---- floating embers ---- */

.ember-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ember {
  position: absolute;
  bottom: -12px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    #fde68a 0%,
    #f59e0b 60%,
    transparent 100%
  );
  animation-name: ember-rise;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}

.ember-orange {
  background: radial-gradient(
    circle,
    #fdba74 0%,
    #f97316 60%,
    transparent 100%
  );
}

@keyframes ember-rise {
  0% {
    transform: translate(0, 0);
    opacity: 0;
  }
  15% {
    transform: translate(calc(var(--drift) * 0.4), -16.5vh);
    opacity: var(--op);
  }
  75% {
    transform: translate(var(--drift), -82.5vh);
    opacity: var(--op);
  }
  100% {
    transform: translate(calc(var(--drift) * 0.6), -110vh);
    opacity: 0;
  }
}

/* ------------------------------ menu button ------------------------------ */

.menu-btn {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.3);
  padding: 16px 20px;
  text-align: left;
  backdrop-filter: blur(4px);
  transition: border-color 0.2s;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  animation: menu-btn-in 0.5s ease-out both;
  animation-delay: var(--mb-delay, 0ms);
}

@keyframes menu-btn-in {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

.menu-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(245, 158, 11, 0),
    rgba(245, 158, 11, 0.07)
  );
  opacity: 0;
  transition: opacity 0.2s;
}

.menu-btn:hover:not(.is-disabled) {
  border-color: rgba(245, 158, 11, 0.4);
}

.menu-btn:hover:not(.is-disabled)::before {
  opacity: 1;
}

.menu-btn.is-disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.menu-btn-accent {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 3px;
  transform: scaleY(0);
  transform-origin: bottom;
  background: linear-gradient(
    to bottom,
    var(--amber300),
    var(--amber500),
    var(--orange700)
  );
  transition: transform 0.2s;
}

.menu-btn:hover:not(.is-disabled) .menu-btn-accent {
  transform: scaleY(1);
}

.menu-btn-icon {
  position: relative;
  display: flex;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.4);
  color: var(--n300);
  transition: all 0.2s;
}

.menu-btn:hover:not(.is-disabled) .menu-btn-icon {
  border-color: rgba(245, 158, 11, 0.5);
  color: var(--amber400);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.25);
}

.menu-ico { width: 20px; height: 20px; }

.menu-btn-text {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.menu-btn-label {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.22em;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--n200);
  transition: color 0.2s;
}

.menu-btn:hover:not(.is-disabled) .menu-btn-label {
  color: #fef3c7;
}

.menu-btn-hint {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--n500);
  transition: color 0.2s;
}

.menu-btn:hover:not(.is-disabled) .menu-btn-hint {
  color: rgba(245, 158, 11, 0.8);
}

.menu-btn-arrow {
  position: relative;
  margin-left: auto;
  transform: translateX(8px);
  color: var(--amber500);
  opacity: 0;
  transition: all 0.2s;
}

.menu-btn:hover:not(.is-disabled) .menu-btn-arrow {
  transform: translateX(0);
  opacity: 1;
}

/* ------------------------------ dev chip (menu) ------------------------------ */

.dev-chip {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(16, 185, 129, 0.45);
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--emerald300);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.18);
  backdrop-filter: blur(4px);
  transition: all 0.2s;
}

.dev-chip:hover {
  border-color: var(--emerald400);
  background: rgba(2, 44, 34, 0.6);
  color: var(--emerald200);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.35);
}

.dev-chip svg { width: 14px; height: 14px; animation: dtow-pulse 1.6s infinite; }

/* ------------------------------ dialog framework ------------------------------ */

.dlg-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  animation: dlg-fade-in 0.2s ease-out;
  padding: 16px;
}

.dlg-overlay.dlg-out {
  animation: dlg-fade-out 0.18s ease-in both;
}

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

.dlg-panel {
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  border: 1px solid rgba(245, 158, 11, 0.25);
  background: rgba(10, 10, 10, 0.95);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
}

.dlg-newgame { max-width: 672px; }
.dlg-loadgame { max-width: 512px; overflow: hidden; }
.dlg-settings { max-width: 512px; }
.dlg-credits { max-width: 448px; }

.dlg-topline {
  height: 4px;
  width: 100%;
  background: linear-gradient(
    to right,
    var(--amber300),
    var(--orange500),
    var(--red700)
  );
}

.dlg-body { padding: 24px; }

.dlg-head { text-align: left; }

.dlg-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 28px;
  letter-spacing: 0.05em;
  color: var(--amber400);
}

.dlg-title-ico { width: 20px; height: 20px; }

.dlg-desc {
  margin-top: 4px;
  letter-spacing: 0.025em;
  color: var(--n400);
}

.dlg-footer {
  margin-top: 24px;
  display: flex;
  gap: 12px;
}

.dlg-anim {
  animation: dlg-slide-up 0.28s ease-out;
}

@keyframes dlg-slide-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ------------------------------ buttons ------------------------------ */

.btn-primary {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid rgba(245, 158, 11, 0.6);
  background: linear-gradient(
    to right,
    rgba(217, 119, 6, 0.9),
    rgba(234, 88, 12, 0.9),
    rgba(185, 28, 28, 0.9)
  );
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--n950);
  transition: box-shadow 0.2s;
  clip-path: polygon(
    10px 0,
    100% 0,
    100% calc(100% - 10px),
    calc(100% - 10px) 100%,
    0 100%,
    0 10px
  );
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.45);
}

.btn-primary:disabled {
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.4);
  color: var(--n600);
}

.btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.5);
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--n300);
  transition: all 0.2s;
}

.btn-ghost:hover:not(:disabled) {
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--amber300);
}

.btn-danger:hover:not(:disabled) {
  border-color: rgba(153, 27, 27, 0.5);
  color: rgba(248, 113, 113, 0.8);
}

.btn-sm { padding: 6px 10px; font-size: 10px; letter-spacing: 0.14em; }
.btn-xs { padding: 6px 10px; font-size: 10px; letter-spacing: 0.2em; flex: 0 0 auto; }

.btn-ico { width: 16px; height: 16px; flex-shrink: 0; }

.icon-btn {
  display: flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--n300);
  transition: all 0.2s;
}

.icon-btn:hover {
  border-color: rgba(245, 158, 11, 0.5);
  color: var(--amber300);
}

.icon-btn-svg { width: 16px; height: 16px; }

/* ------------------------------ new game wizard ------------------------------ */

.wiz-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.wiz-step {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
}

.wiz-step-dot {
  display: flex;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid;
  font-size: 10px;
  font-weight: 700;
}

.wiz-step-dot.done {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.2);
  color: var(--amber400);
}

.wiz-step-dot.now {
  border-color: var(--amber400);
  background: rgba(245, 158, 11, 0.3);
  color: var(--amber300);
}

.wiz-step-dot.todo {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.4);
  color: var(--n600);
}

.wiz-step-label {
  display: none;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--n600);
}

.wiz-step-label.now { color: var(--amber300); }

.wiz-step-line {
  margin: 0 4px;
  height: 1px;
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
}

.wiz-nations {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-height: 46vh;
  overflow-y: auto;
  padding-right: 4px;
  margin-top: 20px;
}

.nation-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.4);
  padding: 14px;
  text-align: left;
  transition: all 0.2s;
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 10px),
    calc(100% - 10px) 100%,
    0 100%
  );
}

.nation-card:hover {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.05);
}

.nation-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.nation-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--n200);
}

.nation-card:hover .nation-name { color: var(--amber300); }

.nation-blurb {
  font-size: 11px;
  line-height: 1.35;
  color: var(--n500);
}

.nation-special {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(245, 158, 11, 0.9);
}

/* flags */
.flag-art {
  position: relative;
  display: inline-block;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.6);
  background: rgba(0, 0, 0, 0.3);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.flag-svg { display: block; }
.flag-md { width: 44px; height: 28px; margin-top: 2px; }

.tiny-ico { width: 12px; height: 12px; flex-shrink: 0; }
.amber-ico { width: 16px; height: 16px; color: var(--amber400); }

/* campaigns */
.wiz-campaigns {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.campaign-card,
.mode-card {
  position: relative;
  display: block;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.4);
  padding: 16px;
  text-align: left;
  transition: all 0.2s;
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 10px),
    calc(100% - 10px) 100%,
    0 100%
  );
}

.campaign-card:hover,
.mode-card:hover {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.05);
}

.campaign-card.selected,
.mode-card.selected {
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.1);
  box-shadow: inset 0 0 30px rgba(245, 158, 11, 0.08);
}

.mode-card.selected.zombie {
  border-color: rgba(16, 185, 129, 0.6);
  background: rgba(16, 185, 129, 0.1);
  box-shadow: inset 0 0 30px rgba(16, 185, 129, 0.08);
}

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

.campaign-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--n300);
}

.campaign-name.amber { color: var(--amber300); }

.campaign-theater {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--n500);
}

.campaign-trail {
  display: flex;
  flex-wrap: wrap;
  column-gap: 12px;
  row-gap: 6px;
  margin-top: 12px;
}

.mission-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 0.025em;
  color: var(--n500);
}

.swatch {
  width: 10px;
  height: 10px;
  border: 1px solid rgba(0, 0, 0, 0.6);
}

.campaign-meta {
  display: block;
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--n600);
}

.card-check {
  position: absolute;
  top: 12px;
  right: 12px;
  color: var(--amber400);
}

.card-check svg { width: 16px; height: 16px; }

/* special unit preview */
.special-preview {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.5);
  padding: 14px;
}

.special-ico {
  display: flex;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.1);
}

.special-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.special-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--amber300);
}

.special-desc {
  font-size: 12px;
  line-height: 1.35;
  color: var(--n400);
}

.special-tag {
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--n600);
}

/* alternate modes */
.alt-modes {
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
}

.alt-modes-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--n500);
}

.alt-modes .mode-card,
.alt-modes .campaign-card {
  margin-top: 8px;
}

.mode-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
}

.mode-ico {
  display: flex;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.1);
  color: var(--amber400);
}

.mode-ico.zombie {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.1);
  color: var(--emerald400);
}

.mode-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.mode-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--n300);
}

.mode-name.amber { color: var(--amber300); }
.mode-name.emerald { color: var(--emerald300); }

.mode-brief {
  font-size: 11px;
  line-height: 1.35;
  color: var(--n500);
}

.mode-tag {
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--n600);
}

/* difficulty */
.wiz-difficulty {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.diff-card {
  position: relative;
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.4);
  padding: 16px;
  text-align: left;
  transition: all 0.2s;
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 10px),
    calc(100% - 10px) 100%,
    0 100%
  );
}

.diff-card:hover {
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.05);
}

.diff-card.selected {
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.1);
  box-shadow: inset 0 0 30px rgba(245, 158, 11, 0.08);
}

.diff-ico {
  display: flex;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.5);
  color: var(--n500);
}

.diff-card.selected .diff-ico {
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber400);
}

.diff-ico-svg { width: 20px; height: 20px; }

.diff-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.diff-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--n300);
}

.diff-card.selected .diff-name { color: var(--amber300); }

.diff-desc {
  font-size: 13px;
  line-height: 1.35;
  color: var(--n400);
}

.diff-tag {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--n600);
}

.op-name { margin-top: 16px; }

.op-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--n500);
}

.op-input {
  margin-top: 8px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.5);
  padding: 10px 12px;
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: 0.05em;
  color: var(--n200);
  outline: none;
}

.op-input::placeholder { color: var(--n600); }
.op-input:focus { border-color: rgba(245, 158, 11, 0.6); }

/* ------------------------------ load game ------------------------------ */

.save-list {
  display: flex;
  max-height: 46vh;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
  margin-top: 20px;
}

.save-slot {
  position: relative;
  display: block;
  width: 100%;
  border: 1px solid rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.1);
  padding: 16px;
  text-align: left;
  box-shadow: inset 0 0 30px rgba(245, 158, 11, 0.08);
  transition: box-shadow 0.2s;
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 10px),
    calc(100% - 10px) 100%,
    0 100%
  );
}

.save-slot:hover {
  box-shadow: inset 0 0 40px rgba(245, 158, 11, 0.15);
}

.save-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.save-op {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--amber300);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.save-date {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--n500);
}

.save-wave {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--n500);
}

.save-fort {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.save-bar {
  position: relative;
  height: 6px;
  flex: 1;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.1);
}

.save-bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(to right, var(--amber400), var(--orange600));
  animation: save-bar-in 0.7s ease-out 0.25s both;
}

@keyframes save-bar-in { from { width: 0 !important; } }

.save-pct {
  width: 36px;
  text-align: right;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--n400);
}

.save-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.save-time {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--n600);
}

.save-ready {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(245, 158, 11, 0.9);
  opacity: 0.75;
}

.save-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.3);
  padding: 24px;
  text-align: center;
}

.save-empty span:first-child {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--n600);
}

.save-empty span:last-child {
  font-size: 11px;
  color: var(--n700);
}

.save-locked {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  padding: 16px;
  opacity: 0.6;
}

.lock-ico { width: 16px; height: 16px; color: var(--n700); flex-shrink: 0; }

.save-locked span:first-of-type {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--n700);
}

.save-locked span:last-of-type {
  font-size: 10px;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: var(--n800);
}

/* ------------------------------ settings ------------------------------ */

.settings-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px;
  margin-top: 20px;
}

.settings-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--n500);
  transition: all 0.2s;
}

.settings-tab.active {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber400);
}

.settings-tab svg { width: 14px; height: 14px; }

.settings-content { margin-top: 16px; }

.setting-seg,
.setting-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding: 14px 0;
}

.setting-seg:last-child,
.setting-row:last-child { border-bottom: none; }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.setting-labels {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.setting-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--n300);
}

.setting-hint {
  font-size: 11px;
  color: var(--n500);
}

.seg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.seg-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.4);
  padding: 10px 8px;
  color: var(--n500);
  transition: all 0.15s;
}

.seg-btn:hover {
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--n300);
}

.seg-btn.active {
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.1);
  color: var(--amber300);
  box-shadow: inset 0 0 20px rgba(245, 158, 11, 0.06);
}

.seg-ico { width: 16px; height: 16px; }

.seg-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.seg-hint {
  font-size: 9px;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: var(--n600);
}

.setting-control { display: flex; flex-shrink: 0; align-items: center; }

.slider-wrap {
  display: flex;
  width: 176px;
  align-items: center;
  gap: 12px;
}

.dtow-range {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.dtow-range::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--amber500);
  border: 1px solid rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

.dtow-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--amber500);
  border: 1px solid rgba(0, 0, 0, 0.6);
  border-radius: 0;
  cursor: pointer;
}

.slider-val {
  width: 32px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--amber400);
}

.dtow-switch {
  position: relative;
  width: 40px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.5);
  transition: all 0.2s;
  flex-shrink: 0;
}

.dtow-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--n500);
  transition: all 0.2s;
}

.dtow-switch.on {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(217, 119, 6, 0.35);
}

.dtow-switch.on .dtow-switch-knob {
  left: 20px;
  background: var(--amber400);
}

/* ------------------------------ credits ------------------------------ */

.credits-lead {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(245, 158, 11, 0.4);
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.1),
    transparent,
    transparent
  );
  padding: 20px;
  margin-top: 24px;
}

.credits-scan {
  position: absolute;
  inset: 0;
  opacity: 0.2;
}

.credits-lead-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.credits-role {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(245, 158, 11, 0.9);
}

.credits-name {
  position: relative;
  margin-top: 12px;
  font-size: 30px;
  letter-spacing: 0.025em;
  color: var(--n100);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.credits-name-amber {
  display: block;
  background: linear-gradient(
    to right,
    var(--amber200),
    var(--amber500),
    var(--orange700)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.credits-strip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.credits-divider { height: 8px; width: 80px; }

.credits-supreme {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--n500);
}

.credits-crew {
  list-style: none;
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.credits-crew li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.credits-crew li + li { border-top: 1px solid rgba(255, 255, 255, 0.05); }

.credits-crew-role {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--n400);
}

.crew-ico { width: 16px; height: 16px; color: var(--n500); }

.credits-crew-name {
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--n300);
}

.credits-copy {
  margin-top: 24px;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--n600);
}

/* ==========================================================================
   GAME SCREEN — battlefield, HUD, tactical map, banner, overlays
   ========================================================================== */

.game-root {
  position: relative;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  background: var(--n950);
  user-select: none;
  -webkit-user-select: none;
}

.canvas-wrap {
  position: absolute;
  inset: 0;
}

.game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.game-canvas.cursor-cell { cursor: cell; }

.fx-scanlines {
  position: absolute;
  inset: 0;
  opacity: 0.25;
  z-index: 5;
}

.fx-grain { z-index: 6; }

.fort-critical {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(153, 27, 27, 0.4) 100%
  );
  animation: dtow-pulse 1.6s ease-in-out infinite;
}

.strike-prompt {
  position: absolute;
  inset-inline: 0;
  bottom: 96px;
  z-index: 30;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
}

.strike-prompt-card {
  display: flex;
  align-items: center;
  border: 1px solid rgba(239, 68, 68, 0.6);
  background: rgba(0, 0, 0, 0.7);
  padding: 6px 16px;
  text-align: center;
  backdrop-filter: blur(4px);
  animation: dtow-pulse 1.6s infinite;
}

.sp-main {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--red300);
}

.sp-sub {
  margin-left: 8px;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--n500);
  display: none;
}

/* ------------------------------ HUD shell ------------------------------ */

.hud {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.15);
  background: linear-gradient(
    to bottom,
    rgba(10, 10, 10, 0.85),
    rgba(10, 10, 10, 0.2)
  );
  padding: 6px 8px;
  backdrop-filter: blur(2px);
  pointer-events: auto;
}

.tb-left {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.tb-campaign {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(245, 158, 11, 0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tb-campaign i { font-style: normal; color: var(--n500); }

.tb-mission {
  display: none;
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--n500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tb-twist {
  display: none;
  font-size: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245, 158, 11, 0.6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tb-meter {
  display: flex;
  align-items: center;
  gap: 6px;
}

.meter-ico { width: 14px; height: 14px; flex-shrink: 0; }
.meter-ico.amber { color: var(--amber400); }
.meter-ico.red { color: var(--red400); }
.meter-ico.emerald { color: var(--emerald400); }
.meter-ico.sky { color: var(--sky400); }
.meter-ico.gray { color: var(--n600); }

.bar {
  display: block;
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.5);
}

.bar.fort { width: 96px; }
.bar.morale { height: 6px; width: 64px; border-color: rgba(255, 255, 255, 0.1); }
.bar.morale.enemy { width: 40px; }
.bar.enemyfort { height: 6px; width: 112px; border-color: rgba(239, 68, 68, 0.3); }
.bar.sniper { height: 6px; width: 48px; background: rgba(255, 255, 255, 0.1); border: none; }

.bar-fill {
  display: block;
  height: 100%;
  transition: width 0.3s;
}

.bar-fill.fort {
  background: linear-gradient(to right, var(--amber400), var(--orange600));
}

.bar-fill.emerald { background: var(--emerald500); }
.bar-fill.amber { background: var(--amber500); }
.bar-fill.red { background: var(--red600); }

.bar-fill.enemyfort {
  background: linear-gradient(to right, var(--red600), var(--amber400));
  transition: width 0.2s;
}

.meter-val {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  white-space: nowrap;
  color: var(--n300);
}

.meter-tag {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--n400);
  white-space: nowrap;
}

.meter-tag.red { color: var(--red300); }

.tac-mobile { margin-top: 2px; }

/* center column */
.tb-center {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.tb-wave {
  font-size: 18px;
  letter-spacing: 0.05em;
  color: var(--n100);
}

.tb-phase {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(245, 158, 11, 0.8);
}

/* right column */
.tb-right {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
}

.chip,
.chip-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(245, 158, 11, 0.25);
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 6px;
  transition: border-color 0.2s;
}

.chip-btn:hover { border-color: rgba(245, 158, 11, 0.5); }

.chip-ico { width: 12px; height: 12px; }
.chip-ico.amber { color: var(--amber400); }
.chip-ico.red { color: var(--red400); }

.chip-strong {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--n200);
}

.chip-strong.amber { color: var(--amber200); }
.chip-strong.red { color: var(--red200); }

.chip-sub {
  display: none;
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--n500);
}

.diff-label {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 6px;
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--n400);
}

.pause-btn {
  display: flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.5);
  color: var(--n300);
  transition: all 0.2s;
}

.pause-btn:hover {
  border-color: rgba(245, 158, 11, 0.5);
  color: var(--amber300);
}

.pause-ico { width: 14px; height: 14px; }

/* ------------------------------ tactical map ------------------------------ */

.tac-map {
  position: relative;
  height: 20px;
  width: min(380px, 56vw);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
  outline: none;
}

.tac-fort {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 0;
  width: 6px;
  background: rgba(217, 119, 6, 0.9);
}

.tac-enemyfort {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 10px;
  border-left: 1px solid rgba(248, 113, 113, 0.8);
  border-right: 1px solid rgba(248, 113, 113, 0.8);
  background: rgba(185, 28, 28, 0.7);
}

.tac-trench {
  position: absolute;
  top: 6px;
  bottom: 6px;
  border-left: 1px solid rgba(251, 191, 36, 0.5);
  border-right: 1px solid rgba(251, 191, 36, 0.5);
  background: rgba(252, 211, 77, 0.1);
}

.tac-trench.storm {
  border-color: rgba(248, 113, 113, 0.6);
  background: rgba(248, 113, 113, 0.1);
}

.tac-barricade {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 4px;
  background: #c8b06a;
}

.tac-wire {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 6px;
  background:
    repeating-linear-gradient(
      to bottom,
      #b8b2a6 0 2px,
      transparent 2px 4px
    );
  border-left: 1px solid rgba(184, 178, 166, 0.5);
  border-right: 1px solid rgba(184, 178, 166, 0.5);
}

.tac-nest {
  position: absolute;
  top: 4px;
  bottom: 4px;
  width: 4px;
  background: var(--orange500);
}

.tac-unit,
.tac-enemy {
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.tac-unit { background: var(--amber300); }

.tac-enemy {
  background: var(--red500);
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.8);
}

.tac-cam {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid rgba(252, 211, 77, 0.7);
  border-right: 1px solid rgba(252, 211, 77, 0.7);
  background: rgba(253, 230, 138, 0.1);
}

/* ------------------------------ bottom bar ------------------------------ */

.bottom-bar {
  margin: 0 auto;
  display: flex;
  width: 100%;
  max-width: min(96vw, 1200px);
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-top: 1px solid rgba(245, 158, 11, 0.15);
  background: linear-gradient(
    to top,
    rgba(10, 10, 10, 0.85),
    rgba(10, 10, 10, 0.3)
  );
  padding: 6px;
  backdrop-filter: blur(2px);
  pointer-events: auto;
}

.buy-btn {
  display: flex;
  min-width: 62px;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 6px;
  backdrop-filter: blur(4px);
  transition: all 0.15s;
}

.buy-btn:hover:not(:disabled) {
  border-color: rgba(245, 158, 11, 0.5);
}

.buy-btn:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.buy-btn.active {
  border-color: rgba(239, 68, 68, 0.7);
  background: rgba(127, 29, 29, 0.4);
  animation: dtow-pulse 1.6s infinite;
}

.buy-btn.heavy {
  border-color: rgba(217, 119, 6, 0.4);
  background: linear-gradient(to bottom, rgba(63, 63, 70, 0.6), rgba(0, 0, 0, 0.6));
}

.buy-btn.heavy:hover:not(:disabled) {
  border-color: rgba(245, 158, 11, 0.7);
}

.buy-ico {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: var(--n300);
  transition: color 0.15s;
}

.buy-btn:hover:not(:disabled) .buy-ico { color: var(--amber300); }

.buy-txt {
  display: flex;
  min-width: 0;
  flex-direction: column;
  text-align: left;
}

.buy-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--n200);
}

.buy-btn:hover:not(:disabled) .buy-label { color: #fef3c7; }

.buy-sub {
  font-size: 7px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--n500);
}

.buy-sub.red { color: var(--red300); }

/* line selector */
.line-select {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.45);
  padding: 4px;
}

.line-label {
  display: none;
  padding: 0 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--n500);
}

.line-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--n300);
  transition: all 0.2s;
}

.line-btn:hover { border-color: rgba(245, 158, 11, 0.4); color: var(--amber200); }

.line-btn.sel {
  border-color: rgba(251, 191, 36, 0.7);
  background: rgba(245, 158, 11, 0.2);
  color: var(--amber200);
}

.line-btn.storm { border-color: rgba(239, 68, 68, 0.3); color: var(--red300); }
.line-btn.storm:hover { border-color: rgba(248, 113, 113, 0.6); color: var(--red200); }
.line-btn.storm.sel {
  border-color: rgba(248, 113, 113, 0.7);
  background: rgba(239, 68, 68, 0.2);
  color: var(--red200);
}

.line-btn.locked {
  border-color: rgba(245, 158, 11, 0.25);
  color: var(--n500);
}

.line-btn.locked:hover { border-color: rgba(251, 191, 36, 0.6); color: var(--amber300); }

.line-btn.lost {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(127, 29, 29, 0.3);
  color: var(--red300);
}

.line-btn.lost:hover { border-color: rgba(248, 113, 113, 0.8); color: var(--red200); }

.line-lock { width: 10px; height: 10px; }

.line-btn .pulse { animation: dtow-pulse 1.6s infinite; }

.line-prog {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: -2px;
  height: 3px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.7);
}

.line-prog-fill { display: block; height: 100%; }
.line-prog-fill.red { background: var(--red500); }
.line-prog-fill.amber { background: var(--amber400); }

.advance-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(16, 185, 129, 0.4);
  background: rgba(6, 78, 59, 0.3);
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a7f3d0;
  transition: all 0.2s;
}

.advance-btn:hover {
  border-color: rgba(52, 211, 153, 0.7);
  color: #d1fae5;
}

.advance-btn.dim {
  border-color: rgba(16, 185, 129, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: rgba(110, 231, 183, 0.5);
}

.advance-ico { width: 10px; height: 10px; }

/* sniper + pan + dev */
.sniper-meter,
.pan-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.45);
  padding: 6px 8px;
}

.pan-hint { display: none; }

.pan-hint .font-ui {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--n500);
}

.dev-chip-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(16, 185, 129, 0.5);
  background: rgba(0, 0, 0, 0.6);
  padding: 6px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--emerald300);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.22);
  transition: all 0.2s;
}

.dev-chip-bar:hover {
  border-color: var(--emerald400);
  background: rgba(2, 44, 34, 0.6);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.dev-bar-ico { width: 14px; height: 14px; }

/* ------------------------------ wave banner ------------------------------ */

.banner {
  position: absolute;
  inset-inline: 0;
  top: 20%;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: scale(1.25);
  transition: opacity 0.3s, transform 0.3s;
}

.banner.show {
  opacity: 1;
  transform: scale(1);
}

.banner-title {
  font-size: 40px;
  letter-spacing: 0.05em;
  color: var(--amber400);
}

.banner-sub {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--n300);
}

/* ------------------------------ overlays ------------------------------ */

.overlay-layer {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

.ovl {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  animation: ovl-fade-in 0.2s ease-out;
}

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

.ovl-pause {
  z-index: 40;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.ovl-trench {
  z-index: 40;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(3px);
}

.ovl-upgrade {
  z-index: 50;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  background: linear-gradient(
    to bottom,
    rgba(10, 10, 10, 0.95),
    rgba(10, 10, 10, 0.92),
    rgba(0, 0, 0, 0.97)
  );
  backdrop-filter: blur(3px);
}

.ovl-gameover {
  z-index: 50;
  background: linear-gradient(
    to bottom,
    rgba(69, 10, 10, 0.6),
    rgba(0, 0, 0, 0.85),
    rgba(0, 0, 0, 0.95)
  );
  backdrop-filter: blur(3px);
}

.ovl-victory {
  z-index: 50;
  background: linear-gradient(
    to bottom,
    rgba(69, 26, 3, 0.5),
    rgba(0, 0, 0, 0.85),
    rgba(0, 0, 0, 0.95)
  );
  backdrop-filter: blur(3px);
}

.ovl-debrief {
  z-index: 50;
  background: linear-gradient(
    to bottom,
    rgba(10, 10, 10, 0.7),
    rgba(0, 0, 0, 0.88),
    rgba(0, 0, 0, 0.95)
  );
  backdrop-filter: blur(3px);
}

.ovl-dev {
  z-index: 60;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
}

.panel {
  border: 1px solid rgba(245, 158, 11, 0.25);
  background: rgba(10, 10, 10, 0.95);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.85);
  animation: panel-in 0.3s ease-out;
}

@keyframes panel-in {
  from { opacity: 0; transform: scale(0.94) translateY(16px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.panel-body { padding: 24px; }
.panel-body.center { text-align: center; }

/* pause */
.pause-panel { width: min(92vw, 420px); }

.pause-title {
  font-size: 30px;
  letter-spacing: 0.05em;
  color: var(--amber400);
}

.pause-sub {
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--n500);
}

.pause-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

.pause-nav .menu-btn { animation: none; }

.pause-hint {
  margin-top: 20px;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--n700);
}

/* upgrade console */
.up-head {
  flex-shrink: 0;
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  background: linear-gradient(
    to right,
    var(--n950),
    rgba(23, 23, 23, 0.6),
    var(--n950)
  );
  padding: 10px 12px;
}

.up-head-inner {
  margin: 0 auto;
  display: flex;
  max-width: 64rem;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.up-head-left {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.up-head-ico {
  display: flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.1);
}

.up-head-ico svg { width: 18px; height: 18px; }

.up-title {
  font-size: 20px;
  letter-spacing: 0.05em;
  color: var(--amber400);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.up-sub {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--n500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.up-head-right {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
}

.up-next-chip {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--n300);
}

.up-cols {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 8px;
}

.up-cols-grid {
  margin: 0 auto;
  display: grid;
  max-width: 64rem;
  grid-template-columns: 1fr;
  gap: 12px;
}

.up-branch {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
}

.up-branch-head {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid;
  padding: 10px;
}

.up-branch-ico {
  display: flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 1px solid;
  flex-shrink: 0;
}

.up-branch-svg { width: 16px; height: 16px; }

.up-branch-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.up-branch-blurb {
  font-size: 9px;
  color: var(--n500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.up-branch-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
}

.up-node {
  position: relative;
  display: block;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.45);
  padding: 10px;
  text-align: left;
  transition: all 0.15s;
}

.up-node.maxed { border-color: rgba(255, 255, 255, 0.05); opacity: 0.7; }
.up-node.locked { opacity: 0.45; }
.up-node.owned { border-color: rgba(255, 255, 255, 0.2); }
.up-node.avail:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.4); }
.up-node.sel { border-color: rgba(255, 255, 255, 0.6); background: rgba(255, 255, 255, 0.07); }
.up-node:disabled { cursor: default; }

.up-node > span.up-node-ico {
  display: flex;
  float: left;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  align-items: center;
  justify-content: center;
  border: 1px solid;
  flex-shrink: 0;
  margin-right: 8px;
}

.up-ico, .up-lock { width: 14px; height: 14px; }
.up-lock { color: var(--n500); }

.up-node-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.up-node-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--n100);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pips { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.pip {
  display: inline-block;
  width: 6px;
  height: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.up-node-info { display: block; overflow: hidden; }

.up-node-fx {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--n400);
}

.fx-maxed { color: var(--n300); }
.fx-req { color: inherit; }
.fx-lv { font-weight: 700; }

.up-node-check {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
}

.up-check { width: 12px; height: 12px; color: #000; }

.up-foot {
  flex-shrink: 0;
  border-top: 1px solid rgba(245, 158, 11, 0.2);
  background: rgba(10, 10, 10, 0.95);
  padding: 10px 12px;
}

.up-foot-inner {
  margin: 0 auto;
  display: flex;
  max-width: 64rem;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.up-foot-hint {
  display: none;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--n500);
}

.up-foot-actions {
  display: flex;
  width: 100%;
  justify-content: flex-end;
}

.up-foot-actions .btn-primary { flex: 0 1 auto; }

/* trench works */
.trench-panel {
  display: flex;
  max-height: 92vh;
  width: min(94vw, 560px);
  flex-direction: column;
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(10, 10, 10, 0.97);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9);
}

.t-accent { height: 4px; width: 100%; flex-shrink: 0; }

.t-head {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 20px;
}

.t-head-info { min-width: 0; flex: 1; }

.t-title {
  font-size: 20px;
  letter-spacing: 0.05em;
  color: var(--amber200);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.t-doctrine {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.t-tagline {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 20px;
  font-size: 11px;
  letter-spacing: 0.025em;
  color: var(--n400);
  font-style: italic;
}

.t-tiers {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
}

.t-tier {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.45);
  padding: 12px;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}

.t-tier.owned {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(69, 26, 3, 0.15);
}

.t-tier.next { border-color: rgba(255, 255, 255, 0.25); }
.t-tier.locked { opacity: 0.7; }

.t-tier-row { display: flex; align-items: flex-start; gap: 10px; }

.t-tier-ico {
  display: flex;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--n600);
}

.t-tier.owned .t-tier-ico {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(120, 53, 15, 0.25);
  color: var(--amber300);
}

.t-tier.next .t-tier-ico { border-color: rgba(255, 255, 255, 0.3); color: var(--n300); }

.t-ico-svg { width: 16px; height: 16px; }
.t-ico-svg.small { width: 14px; height: 14px; }

.t-tier-info { min-width: 0; flex: 1; }

.t-tier-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.t-tier-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--n500);
}

.t-tier-name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: var(--n200);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.t-tier.owned .t-tier-name { color: var(--amber200); }

.t-tier-effect {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--n400);
}

.t-tier-flavor {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.35;
  color: var(--n600);
  font-style: italic;
}

.t-tier-right {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.t-pips { display: flex; gap: 4px; }

.t-pip {
  width: 8px;
  height: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.t-pip.on {
  border-color: var(--amber400);
  background: var(--amber400);
}

.t-dug {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(245, 158, 11, 0.7);
}

.t-perk {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  border-top: 1px solid;
  padding-top: 8px;
  font-size: 10px;
  font-weight: 600;
}

.t-perk-label {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.t-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.4);
  padding: 10px 12px;
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 0.025em;
  color: var(--n500);
}

.t-summary-ico { width: 16px; height: 16px; color: rgba(245, 158, 11, 0.7); flex-shrink: 0; }
.t-summary b { color: var(--amber300); font-weight: 700; }

/* dev console */
.dev-panel {
  width: min(92vw, 420px);
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(10, 10, 10, 0.97);
}

.dev-topline {
  height: 4px;
  width: 100%;
  background: linear-gradient(to right, #059669, #14b8a6, #06b6d4);
}

.dev-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dev-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  letter-spacing: 0.05em;
  color: var(--emerald400);
}

.dev-title-ico { width: 20px; height: 20px; }

.dev-gate { margin-top: 20px; }

.dev-gate-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--n500);
}

.dev-gate-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.6);
  padding: 10px 12px;
  margin-top: 12px;
  transition: border-color 0.2s;
}

.dev-gate-row:focus-within { border-color: rgba(16, 185, 129, 0.6); }
.dev-gate-row.wrong {
  border-color: rgba(239, 68, 68, 0.6);
  animation: dtow-pulse 1.6s infinite;
}

.gate-ico { width: 16px; height: 16px; color: var(--n500); flex-shrink: 0; }

.dev-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: 0.3em;
  color: var(--n200);
}

.dev-input::placeholder { color: var(--n600); letter-spacing: 0.1em; }

.btn-dev-unlock {
  flex-shrink: 0;
  border: 1px solid rgba(16, 185, 129, 0.5);
  background: rgba(6, 78, 59, 0.4);
  padding: 4px 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--emerald300);
  transition: background 0.2s;
}

.btn-dev-unlock:hover { background: rgba(6, 95, 70, 0.6); }

.dev-wrong {
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red400);
}

.dev-note {
  margin-top: 12px;
  font-size: 9px;
  line-height: 1.6;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--n600);
}

.dev-menu-hint {
  border: 1px solid rgba(245, 158, 11, 0.3);
  background: rgba(69, 26, 3, 0.3);
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(253, 230, 138, 0.9);
}

.dev-menu-hint b { color: var(--amber300); font-weight: 700; }
.dev-menu-hint .emerald { color: var(--emerald300); }

.dev-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.dev-actions-wrap .dev-grid { margin-top: 0; }
.dev-actions-wrap { margin-top: 16px; }

.dev-action {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid rgba(16, 185, 129, 0.25);
  background: rgba(0, 0, 0, 0.5);
  padding: 12px;
  text-align: left;
  transition: all 0.15s;
}

.dev-action:hover:not(:disabled) {
  border-color: rgba(52, 211, 153, 0.6);
  background: rgba(6, 78, 59, 0.25);
}

.dev-action:disabled {
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.05);
  opacity: 0.35;
}

.dev-action-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #a7f3d0;
}

.dev-action-desc {
  font-size: 9px;
  line-height: 1.35;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: var(--n500);
}

/* result panels */
.result-panel {
  width: min(92vw, 440px);
  text-align: center;
}

.result-line {
  height: 4px;
  width: 100%;
}

.result-line.red {
  background: linear-gradient(to right, var(--red700), var(--red500), var(--amber500));
}

.result-line.amber {
  background: linear-gradient(to right, var(--amber500), var(--orange500), var(--red600));
}

.result-line.red-amber {
  background: linear-gradient(to right, var(--red700), var(--amber500), var(--red700));
}

.result-title {
  font-size: 30px;
  letter-spacing: 0.05em;
}

.result-title.red {
  color: var(--red400);
  text-shadow: 0 2px 10px rgba(200, 40, 30, 0.6);
}

.result-title.amber {
  color: var(--amber300);
  text-shadow: 0 2px 10px rgba(245, 158, 11, 0.5);
}

.result-title.small { font-size: 22px; }

.result-sub {
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--n500);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 24px;
}

.debrief-panel .result-grid { grid-template-columns: repeat(5, 1fr); gap: 6px; }

.result-cell {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.4);
  padding: 12px 4px;
  text-align: center;
}

.debrief-panel .result-cell { padding: 10px 2px; }

.result-value {
  font-size: 22px;
  color: var(--amber400);
}

.debrief-panel .result-value { font-size: 18px; }
.result-value.red { color: var(--red300); }
.result-value.emerald { color: var(--emerald300); }

.result-label {
  margin-top: 2px;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--n500);
}

.debrief-panel .result-label { font-size: 7px; letter-spacing: 0.16em; color: var(--n600); }

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 28px;
}

.victory-trophy { margin: 0 auto; width: 40px; height: 40px; color: var(--amber400); }

/* debrief */
.debrief-panel {
  width: min(92vw, 500px);
  background: rgba(10, 10, 10, 0.96);
}

.debrief-head {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.debrief-ico { width: 32px; height: 32px; color: var(--amber400); flex-shrink: 0; }

.debrief-withdraw {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border-left: 2px solid rgba(239, 68, 68, 0.55);
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 12px;
}

.debrief-withdraw .debrief-ico { width: 20px; height: 20px; }

.debrief-withdraw p {
  font-size: 11px;
  line-height: 1.45;
  color: var(--n400);
}

.debrief-next {
  margin-top: 20px;
  border-left: 2px solid rgba(245, 158, 11, 0.5);
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 12px;
}

.debrief-next-head {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(245, 158, 11, 0.8);
}

.debrief-next-brief {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--n400);
}

.debrief-continue { margin-top: 24px; width: 100%; }

/* ------------------------------ toasts ------------------------------ */

.toast-layer {
  position: fixed;
  right: 16px;
  bottom: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

body.dtow-in-game .toast-layer { bottom: 104px; }

.toast-card {
  position: relative;
  display: flex;
  min-width: 260px;
  max-width: 380px;
  background: rgba(23, 23, 23, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
  animation: toast-in 0.22s ease-out;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast-card.toast-out {
  animation: toast-out 0.24s ease-in both;
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(24px); }
}

.toast-accent {
  width: 4px;
  flex-shrink: 0;
  background: linear-gradient(to bottom, var(--amber400), var(--orange700));
}

.toast-body { padding: 10px 14px; min-width: 0; }

.toast-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--n100);
}

.toast-desc {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--n400);
}

/* ------------------------------ responsive ------------------------------ */

@media (min-width: 640px) {
  .hidden-sm { display: inline-block; }
  .menu-status .dot-sep { display: inline; }
  .menu-title-top,
  .menu-title-amber { font-size: 60px; }

  .tb-center { display: flex; }
  .tac-mobile { display: none; }
  .bar.fort { width: 160px; }
  .bar.morale { width: 96px; }
  .bar.morale.enemy { display: block; }
  .bar.enemyfort { width: 176px; }
  .sp-sub { display: inline; }
  .strike-prompt { bottom: 86px; }
  .bottom-bar { gap: 6px; padding: 6px 16px; }
  .buy-btn { min-width: 70px; padding: 4px 8px; }
  .bar.sniper { width: 64px; }
  .banner-title { font-size: 56px; }
}

@media (min-width: 768px) {
  .tb-mission { display: block; }
  .chip-sub { display: inline; }
  .diff-label { display: inline-block; }
  .wiz-nations { grid-template-columns: repeat(2, 1fr); }
  .wiz-step-label { display: inline; }
  .result-title { font-size: 36px; }
  .result-actions { flex-direction: row; }
}

@media (min-width: 1024px) {
  .tb-twist { display: block; }
  .pan-hint { display: flex; }
  .line-label { display: inline; }
  .up-cols-grid { grid-template-columns: repeat(2, 1fr); }
  .up-next-chip { display: inline-block; }
  .up-foot-hint { display: block; }
  .menu-title-top,
  .menu-title-amber { font-size: 72px; }
  .menu-content { padding: 40px 64px; }
}

@media (min-width: 1280px) {
  .up-cols-grid { grid-template-columns: repeat(4, 1fr); }
}
