/* 萤火哨站 · 深夜生物荧光 UI
   视觉锚点：独立游戏客户端（Into the Breach 清晰度 × Arknights 玻璃 HUD）
   主色：深渊蓝黑 + 生物荧光青 + 萤火金 */

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

:root {
  --abyss: #070b14;
  --deep: #0b1220;
  --surface: #101826;
  --surface-2: #162033;
  --surface-3: #1c2940;
  --line: rgba(124, 211, 252, 0.12);
  --line-strong: rgba(124, 211, 252, 0.22);
  --ink: #e8f0fa;
  --ink-soft: #b7c5db;
  --muted: #7c8dab;
  --accent: #4ce0c0;
  --accent-dim: rgba(76, 224, 192, 0.14);
  --accent-glow: rgba(76, 224, 192, 0.35);
  --warm: #ffc857;
  --warm-dim: rgba(255, 200, 87, 0.14);
  --danger: #ff6b81;
  --danger-dim: rgba(255, 107, 129, 0.12);
  --info: #6cb6ff;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --font: "Segoe UI", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", sans-serif;
}

html, body {
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(76, 224, 192, 0.08), transparent 55%),
    radial-gradient(900px 500px at 10% 100%, rgba(108, 182, 255, 0.07), transparent 50%),
    linear-gradient(180deg, var(--abyss) 0%, var(--deep) 45%, #090f1a 100%);
  min-height: 100vh;
  padding: 18px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

/* ========== 顶栏 ========== */
.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(22, 32, 51, 0.92), rgba(14, 22, 36, 0.88));
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), transparent 40%),
    linear-gradient(145deg, #1a3d3a, #0d1b22);
  border: 1px solid rgba(76, 224, 192, 0.35);
  box-shadow: 0 0 24px rgba(76, 224, 192, 0.18);
}

.brand-core {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow:
    0 0 12px var(--accent-glow),
    0 0 28px rgba(76, 224, 192, 0.45);
  animation: pulse-core 2.8s ease-in-out infinite;
}

@keyframes pulse-core {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.88); opacity: 0.85; }
}

.brand-text h1 {
  font-size: 1.18em;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.15;
}

.brand-text p {
  margin-top: 3px;
  font-size: 0.68em;
  letter-spacing: 0.28em;
  color: var(--muted);
  text-transform: uppercase;
}

.stat-row {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 118px;
  padding: 10px 14px 10px 12px;
  border-radius: 16px;
  background: rgba(12, 20, 34, 0.65);
  border: 1px solid var(--line);
}

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-dim);
  color: var(--accent);
  flex-shrink: 0;
}

.stat-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat.gold .stat-icon {
  background: var(--warm-dim);
  color: var(--warm);
}

.stat.lives .stat-icon {
  background: rgba(108, 182, 255, 0.12);
  color: var(--info);
}

.stat-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.stat-label {
  font-size: 0.7em;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.stat-val {
  font-size: 1.15em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.stat.gold .stat-val { color: var(--warm); }
.stat.lives .stat-val { color: var(--info); }

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ========== 按钮 ========== */
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(18, 28, 45, 0.8);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.88em;
  min-height: 42px;
  min-width: 42px;
  padding: 0 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
  user-select: none;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  color: var(--ink);
  background: rgba(28, 41, 64, 0.9);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.primary {
  background: linear-gradient(135deg, #37cfae, #2eb3a0);
  border-color: rgba(76, 224, 192, 0.45);
  color: #04241d;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(76, 224, 192, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn.primary:hover {
  background: linear-gradient(135deg, #4ce0c0, #35c4ad);
  color: #03221c;
  box-shadow: 0 12px 28px rgba(76, 224, 192, 0.32);
}

.btn.primary:disabled {
  box-shadow: none;
}

.btn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
  animation: btn-pulse 1.8s ease-out infinite;
}

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

.btn.icon {
  padding: 0;
  width: 42px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.btn.icon.tiny {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 10px;
  font-size: 1.1em;
  line-height: 1;
}

.btn.ghost {
  background: rgba(16, 24, 38, 0.75);
}

.btn.danger {
  background: var(--danger-dim);
  border-color: rgba(255, 107, 129, 0.28);
  color: var(--danger);
}

.btn.danger:hover {
  background: rgba(255, 107, 129, 0.2);
  border-color: rgba(255, 107, 129, 0.45);
  color: #ffd0d8;
}

.btn.lg {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 14px;
  font-size: 0.95em;
}

/* ========== 主布局 ========== */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

/* ========== 舞台 ========== */
.stage {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.stage-frame {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0a1018;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  aspect-ratio: 16 / 10;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: manipulation;
  cursor: crosshair;
  background: #0c121c;
}

.stage-vignette {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 40%, rgba(4, 8, 14, 0.35) 100%),
    linear-gradient(180deg, rgba(8, 14, 24, 0.15), transparent 20%, transparent 80%, rgba(8, 14, 24, 0.25));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

/* 覆盖层 */
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(60% 50% at 50% 40%, rgba(76, 224, 192, 0.08), transparent 60%),
    rgba(5, 9, 16, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 5;
}

.overlay.hidden,
.hidden {
  display: none !important;
}

.overlay-card {
  width: min(460px, 100%);
  padding: 32px 28px 26px;
  border-radius: 24px;
  text-align: center;
  background: linear-gradient(180deg, rgba(22, 34, 54, 0.96), rgba(12, 20, 34, 0.96));
  border: 1px solid var(--line-strong);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.overlay-kicker {
  font-size: 0.72em;
  letter-spacing: 0.32em;
  color: var(--accent);
  margin-bottom: 12px;
}

.overlay-card h2 {
  font-size: 2em;
  letter-spacing: 0.22em;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #ffffff, #b8c7db);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.overlay-card p {
  color: var(--ink-soft);
  line-height: 1.8;
  font-size: 0.95em;
}

.overlay-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 14px;
}

.overlay-tip {
  font-size: 0.82em !important;
  letter-spacing: 0.08em;
  color: var(--warm) !important;
}

/* 波次条 */
.wave-strip {
  padding: 14px 16px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(18, 28, 45, 0.9), rgba(12, 20, 34, 0.88));
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.wave-meta {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
}

.wave-eyebrow,
.eyebrow {
  font-size: 0.68em;
  letter-spacing: 0.24em;
  color: var(--muted);
  text-transform: uppercase;
}

.wave-title {
  margin-top: 4px;
  font-size: 1.05em;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.wave-side {
  font-size: 0.84em;
  color: var(--accent);
  text-align: right;
}

.wave-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(8, 14, 24, 0.8);
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
}

.wave-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2eb3a0, var(--accent), #b8fff0);
  box-shadow: 0 0 18px rgba(76, 224, 192, 0.45);
  transition: width 0.28s ease;
  position: relative;
}

.wave-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: translateX(-100%);
  animation: shimmer 2.4s ease-in-out infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ========== 右侧玻璃坞 ========== */
.dock {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.glass {
  border-radius: 22px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(22, 32, 51, 0.88), rgba(13, 21, 35, 0.92));
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.glass-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.glass-head h2 {
  margin-top: 4px;
  font-size: 1.05em;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.hotkey-hint {
  font-size: 0.72em;
  letter-spacing: 0.12em;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(8, 14, 24, 0.45);
}

/* 商店 */
.shop-list {
  display: grid;
  gap: 8px;
}

.shop-item {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(10, 18, 30, 0.55);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  min-height: 68px;
}

.shop-item:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: rgba(18, 30, 48, 0.8);
}

.shop-item.active {
  border-color: rgba(76, 224, 192, 0.55);
  background: linear-gradient(135deg, rgba(76, 224, 192, 0.14), rgba(10, 18, 30, 0.75));
  box-shadow: 0 0 0 1px rgba(76, 224, 192, 0.18), 0 10px 28px rgba(76, 224, 192, 0.08);
}

.shop-item.disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.shop-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #061018;
  font-weight: 800;
  font-size: 1.05em;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.shop-name {
  font-size: 0.95em;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.shop-sub {
  margin-top: 3px;
  font-size: 0.74em;
  line-height: 1.45;
  color: var(--muted);
}

.shop-cost {
  font-size: 0.92em;
  font-weight: 700;
  color: var(--warm);
  font-variant-numeric: tabular-nums;
}

.shop-hint {
  margin-top: 12px;
  font-size: 0.76em;
  line-height: 1.55;
  color: var(--muted);
}

/* 选中面板 */
.select-desc {
  font-size: 0.86em;
  line-height: 1.65;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.select-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.chip {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(8, 14, 24, 0.55);
  border: 1px solid var(--line);
  font-size: 0.74em;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.chip b {
  display: block;
  margin-top: 4px;
  font-size: 1.15em;
  letter-spacing: 0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.select-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* 简报 */
.tips {
  list-style: none;
  display: grid;
  gap: 8px;
}

.tips li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(8, 14, 24, 0.45);
  border: 1px solid var(--line);
  font-size: 0.8em;
  line-height: 1.55;
  color: var(--ink-soft);
}

.tips li span {
  color: var(--accent);
  font-size: 0.78em;
  letter-spacing: 0.12em;
  padding-top: 2px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  padding: 13px 20px;
  border-radius: 999px;
  background: rgba(12, 22, 36, 0.92);
  border: 1px solid rgba(76, 224, 192, 0.28);
  color: var(--ink);
  font-size: 0.9em;
  letter-spacing: 0.04em;
  z-index: 50;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35), 0 0 24px rgba(76, 224, 192, 0.12);
  pointer-events: none;
}

/* ========== 响应式 ========== */
@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .dock {
    grid-template-columns: 1fr 1fr;
  }

  .briefing {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  body {
    padding: 10px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
  }

  .brand {
    min-width: 0;
  }

  .stat-row {
    width: 100%;
  }

  .stat {
    flex: 1 1 42%;
    min-width: 0;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions .btn {
    flex: 1;
  }

  .top-actions .btn.icon {
    flex: 0 0 46px;
  }

  .top-actions .btn.primary {
    flex: 1.4;
  }

  .dock {
    grid-template-columns: 1fr;
  }

  .stage-frame {
    /* 画布缓冲固定 960x600（16:10），这里必须跟着走。
       改成 4/3 会把贴图纵向拉伸约 20%，贴图一接入就明显变形。 */
    aspect-ratio: 16 / 10;
    border-radius: 18px;
  }

  .overlay-card {
    padding: 24px 18px;
  }

  .overlay-card h2 {
    font-size: 1.55em;
    letter-spacing: 0.16em;
  }

  .wave-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .wave-side {
    text-align: left;
  }
}

@media (max-width: 520px) {
  .stat {
    flex: 1 1 100%;
  }

  .shop-item {
    min-height: 62px;
  }

  .brand-text h1 {
    letter-spacing: 0.14em;
    font-size: 1.08em;
  }
}
