:root {
  --bg: #0b0f19;
  --panel: rgba(17, 24, 39, 0.86);
  --panel-border: rgba(56, 189, 248, 0.25);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #22d3ee;
  --accent-2: #a78bfa;
  --gold: #fbbf24;
  --danger: #fb7185;
  --success: #34d399;
}

:root[data-theme='light'] {
  --bg: #f1f5f9;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-border: rgba(14, 116, 144, 0.25);
  --text: #0f172a;
  --muted: #475569;
  --accent: #0284c7;
  --accent-2: #7c3aed;
  --gold: #d97706;
  --danger: #e11d48;
  --success: #059669;
}

* {
  box-sizing: border-box;
  user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'JetBrains Mono', 'Cascadia Code', Consolas, 'Microsoft YaHei', monospace;
}

#gameCanvas {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: crosshair;
}

/* HUD */
.hud-top-left {
  position: fixed;
  top: 14px;
  left: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 10;
}

.pill {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(8px);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill strong {
  color: var(--accent);
}

.pill.gold strong {
  color: var(--gold);
}

.btn {
  border: 1px solid var(--panel-border);
  background: rgba(34, 211, 238, 0.14);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.12s ease, background 0.15s ease;
}

.btn:hover {
  background: rgba(34, 211, 238, 0.28);
  transform: translateY(-1px);
}

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

.btn-primary {
  background: linear-gradient(135deg, #06b6d4, #6366f1);
  border: none;
  color: #fff;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #22d3ee, #818cf8);
}

.btn-gold {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  border: none;
  color: #fff;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.45);
}

.btn-gold:hover {
  filter: brightness(1.1);
}

.hud-top-right {
  position: fixed;
  top: 14px;
  right: 14px;
  width: 225px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  padding: 10px 12px;
  z-index: 10;
}

.hud-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.lb-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
}

.lb-list li {
  display: flex;
  justify-content: space-between;
  padding: 3px 4px;
  border-radius: 5px;
}

.lb-list li.me {
  background: rgba(34, 211, 238, 0.18);
  font-weight: 700;
}

.hud-feed {
  position: fixed;
  bottom: 16px;
  left: 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 10;
  pointer-events: none;
}

.feed-item {
  background: var(--panel);
  border-left: 3px solid var(--accent-2);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text);
}

.hud-hint {
  position: fixed;
  bottom: 16px;
  right: 16px;
  font-size: 12px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  padding: 6px 10px;
  border-radius: 8px;
  z-index: 10;
}

/* 底部 1-4 快捷嘲讽栏 */
.taunt-bar {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 12;
}

.taunt-slot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.taunt-slot:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.taunt-slot.locked {
  opacity: 0.62;
  border-style: dashed;
}

.taunt-slot.cooling {
  opacity: 0.45;
  pointer-events: none;
}

.taunt-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.22);
  font-size: 11px;
  font-weight: 700;
}

.shop-card {
  width: min(500px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
}

.shop-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}

/* 大厅自动匹配与红蓝组队样式 */
.lobby-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.online-badge {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 99px;
  background: rgba(52, 211, 153, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: var(--success);
  white-space: nowrap;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-btn {
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: rgba(15, 23, 42, 0.45);
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-btn.active {
  color: #fff;
  border-color: var(--accent);
  background: rgba(34, 211, 238, 0.2);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.2);
}

.advanced-toggle {
  margin-top: 14px;
  text-align: center;
}

.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
}

.link-btn:hover {
  color: var(--accent);
}

.private-box {
  margin-top: 10px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px dashed var(--panel-border);
}

.private-box.hidden,
.team-bar.hidden {
  display: none;
}

.team-bar {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(8px);
  padding: 7px 16px;
  border-radius: 99px;
  font-size: 13px;
  z-index: 12;
}

.team-score.red strong {
  color: #fb7185;
}

.team-score.blue strong {
  color: #38bdf8;
}

.team-vs {
  font-size: 11px;
  font-weight: 800;
  color: var(--gold);
}

/* 弹窗遮罩 */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 17, 0.72);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.overlay.hidden {
  display: none;
}

.card {
  width: min(440px, 92vw);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.card h1, .card h2 {
  margin: 0 0 8px 0;
  font-size: 22px;
}

.subtitle {
  margin: 0 0 18px 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
}

.field input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: rgba(15, 23, 42, 0.55);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}

.color-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
}

.color-dot.active {
  border-color: #fff;
  transform: scale(1.15);
}

.row-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

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

/* 街机复活倒计时 */
.revive-box {
  text-align: center;
  border-color: rgba(251, 191, 36, 0.55);
}

.countdown-num {
  font-size: 54px;
  font-weight: 900;
  color: var(--gold);
  line-height: 1.1;
  margin: 8px 0;
  text-shadow: 0 0 24px rgba(251, 191, 36, 0.55);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 99px;
  overflow: hidden;
  margin: 10px 0 16px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #fbbf24, #fb7185);
  transition: width 0.08s linear;
}

/* LDC 商店 */
.pack-grid {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.pack-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  background: rgba(15, 23, 42, 0.45);
}

.pack-item strong {
  display: block;
  font-size: 14px;
}

.pack-item span {
  font-size: 12px;
  color: var(--muted);
}

.order-panel {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px dashed var(--accent);
  font-size: 12px;
  word-break: break-all;
}

.toast {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid var(--accent);
  color: #fff;
  padding: 9px 16px;
  border-radius: 99px;
  font-size: 13px;
  z-index: 50;
  transition: opacity 0.25s ease;
}

.toast.hidden {
  opacity: 0;
  pointer-events: none;
}
