/* ===================================================================
   Name Clash · 名字对决 - Production Grade Styling & Animations
   =================================================================== */

:root {
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.85);
  --bg-card-border: rgba(255, 255, 255, 0.12);
  --bg-card-hover: rgba(30, 41, 59, 0.95);

  --color-primary: #3b82f6;
  --color-primary-glow: rgba(59, 130, 246, 0.45);
  --color-accent: #f59e0b;
  --color-accent-glow: rgba(245, 158, 11, 0.45);
  --color-red: #ef4444;
  --color-green: #10b981;
  --color-purple: #8b5cf6;
  --color-cyan: #06b6d4;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --side-a-color: #3b82f6;
  --side-a-glow: rgba(59, 130, 246, 0.6);
  --side-b-color: #ef4444;
  --side-b-glow: rgba(239, 68, 68, 0.6);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --shadow-card: 0 16px 36px -8px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--bg-card-border);
}

/* Base Reset & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.5;
  user-select: none;
}

/* Background Layers */
.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
}

.glow-a {
  top: -150px;
  left: -150px;
  background: radial-gradient(circle, var(--color-primary), transparent 70%);
}

.glow-b {
  bottom: -200px;
  right: -150px;
  background: radial-gradient(circle, var(--color-purple), transparent 70%);
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 35%, rgba(9, 13, 22, 0.85) 100%);
}

/* Header & Navigation Bar */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--bg-card-border);
}

.header-left .app-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.logo-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(234, 179, 8, 0.4));
}

.logo-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mode-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mode-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-tab-btn:hover {
  color: #fff;
}

.mode-tab-btn.active {
  background: linear-gradient(135deg, var(--color-primary), #2563eb);
  color: #fff;
  box-shadow: 0 4px 12px var(--color-primary-glow);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

/* Glass Card Common */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* Main Container */
.game-container {
  position: relative;
  z-index: 10;
  max-width: 960px;
  margin: 24px auto;
  padding: 0 16px 40px;
  min-height: calc(100vh - 120px);
}

.hidden {
  display: none !important;
}

/* Lobby Screens */
.lobby-screen {
  padding: 32px 28px;
  animation: fadeIn 0.3s ease-out;
}

.lobby-header {
  text-align: center;
  margin-bottom: 28px;
}

.lobby-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.lobby-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Duel Control Mode Selector */
.duel-control-mode-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  margin-bottom: 20px;
}

.control-mode-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.mode-toggle-group {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.45);
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.12);
  gap: 4px;
}

.ctrl-mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ctrl-mode-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.ctrl-mode-btn.active {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* Duel Players Input Cards */
.setup-players-deck {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.player-input-card {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
  transition: border-color 0.2s ease;
}

.player-input-card.card-a:focus-within {
  border-color: var(--side-a-color);
  box-shadow: 0 0 16px var(--side-a-glow);
}

.player-input-card.card-b:focus-within {
  border-color: var(--side-b-color);
  box-shadow: 0 0 16px var(--side-b-glow);
}

.card-side-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.card-side-tag.side-a {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.card-side-tag.side-b {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.input-wrapper input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

/* Live Fighter Preview Card */
.fighter-preview-card {
  margin-top: 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.25s ease;
  animation: fadeIn 0.25s ease;
}

.fighter-preview-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(30, 41, 59, 0.8);
}

.preview-badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 800;
}

.preview-tier {
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  font-weight: 900;
}

.preview-arch {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  color: var(--text-main);
}

.preview-elem {
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid;
}

.preview-power {
  margin-left: auto;
  color: #fbbf24;
  font-weight: 900;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.preview-trait-badge {
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(129, 140, 248, 0.35);
  color: #c7d2fe;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.preview-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #f8fafc;
}

.preview-sig {
  font-size: 0.8rem;
  font-weight: 700;
  color: #38bdf8;
}

.preview-quote {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.4;
}

.vs-badge-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.vs-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid var(--color-accent);
  color: var(--color-accent);
  font-weight: 900;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px var(--color-accent-glow);
}

.swap-players-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.swap-players-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: #fbbf24;
  color: #fbbf24;
  transform: scale(1.05);
}

/* Presets Chips */
.presets-section {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 28px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.presets-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.presets-category-badge {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--color-accent);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.chip-refresh-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
}

.presets-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 700;
}

.presets-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-chip:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

/* Action Buttons */
.setup-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.primary-btn {
  background: linear-gradient(135deg, #c0392b, #e11d48);
  border: none;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 14px 32px;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(192, 57, 43, 0.45);
  transition: all 0.2s ease;
}

.primary-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 30px rgba(225, 29, 72, 0.55);
}

.primary-btn:active {
  transform: translateY(1px);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s ease;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.glow-pulse {
  animation: glowPulse 2.2s infinite ease-in-out;
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 15px var(--color-primary-glow); }
  50% { box-shadow: 0 0 30px rgba(59, 130, 246, 0.8); }
}

/* ==================== TOURNAMENT BRACKET ==================== */
.bracket-tree-wrapper {
  display: flex;
  justify-content: space-around;
  gap: 16px;
  margin-bottom: 28px;
  overflow-x: auto;
  padding: 16px 8px;
}

.bracket-column {
  flex: 1;
  min-width: 170px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bracket-round-title {
  text-align: center;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--color-accent);
  padding: 4px;
  border-bottom: 2px solid rgba(245, 158, 11, 0.3);
  margin-bottom: 8px;
}

.bracket-match {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  transition: border-color 0.2s ease;
}

.bracket-match.current-match {
  border-color: var(--color-accent);
  box-shadow: 0 0 15px var(--color-accent-glow);
}

.bracket-slot {
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
}

.bracket-slot.winner {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.bracket-vs {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-dim);
  text-align: center;
}

.champ-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 28px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(15, 23, 42, 0.85));
  border: 2px solid var(--color-accent);
  animation: popIn 0.3s ease-out;
}

.trophy-huge {
  font-size: 3.5rem;
}

.champ-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-accent);
}

.champ-name {
  font-size: 1.8rem;
  font-weight: 900;
  color: #fff;
}

.champ-title {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ==================== TOWER ROGUELITE ==================== */
.tower-setup-box {
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tower-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.hero-input-wrap input {
  font-size: 1.3rem;
  font-weight: 800;
}

.tower-floors-preview {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
}

.tower-floor-card {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tower-floor-card.boss-card {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.05);
}

.floor-badge {
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--color-primary);
}

.tower-floor-card.boss-card .floor-badge {
  color: var(--color-accent);
}

.floor-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==================== ARENA BATTLEFIELD ==================== */
.arena-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.3s ease-out;
}

.arena-top-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}

.fighter-hud-card {
  flex: 1;
}

.hud-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.side-b .hud-identity {
  justify-content: flex-end;
}

.hud-fighter-name {
  font-weight: 800;
  font-size: 1.15rem;
}

.hud-tier {
  font-size: 0.72rem;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 4px;
}

.tier-sss { background: #ea580c; color: #fff; }
.tier-ss { background: #9333ea; color: #fff; }
.tier-s { background: #2563eb; color: #fff; }

.hud-element {
  font-size: 0.8rem;
  font-weight: 800;
}

.hud-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hud-bar-track {
  width: 100%;
  height: 12px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hud-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.25s ease-out;
}

.hp-fill.side-a {
  background: linear-gradient(90deg, #2563eb, #38bdf8);
}

.hp-fill.side-b {
  background: linear-gradient(90deg, #f87171, #dc2626);
}

.hp-fill.danger {
  background: linear-gradient(90deg, #dc2626, #b91c1c) !important;
  animation: hpBlink 0.6s infinite alternate;
}

@keyframes hpBlink {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

.energy-track {
  height: 6px;
}

.energy-fill {
  background: linear-gradient(90deg, #eab308, #fbbf24);
}

.energy-fill.ready {
  background: linear-gradient(90deg, #f59e0b, #fff);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.8);
}

.hud-bar-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
}

/* Arena Center Controls */
.arena-controls-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.speed-control-group {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.4);
  padding: 3px;
  border-radius: var(--radius-full);
}

.speed-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
}

.speed-btn.active {
  background: var(--color-primary);
  color: #fff;
}

.action-btn-group {
  display: flex;
  gap: 6px;
}

.hud-control-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.hud-control-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.skip-btn {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

/* Tug of War Momentum Meter */
.arena-tug-of-war {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.tug-meter-bar {
  position: relative;
  width: 100%;
  height: 10px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: var(--radius-full);
  display: flex;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.tug-fill-a {
  height: 100%;
  background: linear-gradient(90deg, #1d4ed8, #38bdf8);
  transition: width 0.3s ease-out;
}

.tug-fill-b {
  height: 100%;
  background: linear-gradient(90deg, #f87171, #b91c1c);
  transition: width 0.3s ease-out;
}

.tug-needle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.85rem;
  pointer-events: none;
  transition: left 0.3s ease-out;
  filter: drop-shadow(0 0 4px #fbbf24);
  z-index: 5;
}

.tug-status-text {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* Arena Stage */
.arena-battlefield {
  position: relative;
  height: 380px;
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.4) 0%, rgba(9, 13, 22, 0.95) 100%);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 20px;
  overflow: hidden;
}

.arena-ground-grid {
  position: absolute;
  bottom: 0;
  left: -20%;
  width: 140%;
  height: 180px;
  background-image: 
    linear-gradient(rgba(59, 130, 246, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.12) 1px, transparent 1px);
  background-size: 32px 32px;
  transform: perspective(300px) rotateX(60deg);
  pointer-events: none;
}

.fighter-stage-box {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Fighter Status Bar */
.fighter-status-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  min-height: 24px;
}

.status-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  animation: badgePop 0.2s ease-out;
}

@keyframes badgePop {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.badge-awakened {
  background: linear-gradient(135deg, #f59e0b, #dc2626);
  color: #fff;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.8);
  animation: flamePulse 1.2s infinite alternate;
}

@keyframes flamePulse {
  from { filter: drop-shadow(0 0 4px #fbbf24); }
  to { filter: drop-shadow(0 0 10px #ef4444); }
}

.badge-burn {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid #ef4444;
  color: #fca5a5;
}

.badge-bleed {
  background: rgba(185, 28, 28, 0.3);
  border: 1px solid #b91c1c;
  color: #f87171;
}

.badge-freeze {
  background: rgba(6, 182, 212, 0.25);
  border: 1px solid #06b6d4;
  color: #a5f3fc;
}

.badge-cheer {
  background: rgba(234, 179, 8, 0.25);
  border: 1px solid #eab308;
  color: #fde047;
}

.fighter-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  font-weight: 900;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  animation: floatIdle 3s infinite ease-in-out;
}

.avatar-a {
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  border: 3px solid #60a5fa;
  color: #fff;
}

.avatar-b {
  background: linear-gradient(135deg, #881337, #ef4444);
  border: 3px solid #f87171;
  color: #fff;
  animation-delay: -1.5s;
}

@keyframes floatIdle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.impact-shake {
  animation: shake 0.25s ease-in-out !important;
}

.impact-crit {
  animation: critShake 0.35s ease-in-out !important;
}

@keyframes shake {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-8px, 4px); }
  50% { transform: translate(6px, -4px); }
  75% { transform: translate(-4px, 2px); }
  100% { transform: translate(0, 0); }
}

@keyframes critShake {
  0% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-14px, 8px) scale(0.92); }
  50% { transform: translate(12px, -8px) scale(1.08); }
  75% { transform: translate(-8px, 4px) scale(0.96); }
  100% { transform: translate(0, 0) scale(1); }
}

.screen-shake {
  animation: arenaScreenShake 0.32s ease-in-out;
}

@keyframes arenaScreenShake {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-6px, 6px); }
  40% { transform: translate(6px, -6px); }
  60% { transform: translate(-4px, 4px); }
  80% { transform: translate(4px, -2px); }
  100% { transform: translate(0, 0); }
}

/* Combat Actions & Movement */
.lunge-right {
  animation: lungeRightAnim 0.26s ease-in-out !important;
}

.lunge-left {
  animation: lungeLeftAnim 0.26s ease-in-out !important;
}

@keyframes lungeRightAnim {
  0% { transform: translateX(0) scale(1); }
  45% { transform: translateX(45px) scale(1.12) rotate(4deg); }
  100% { transform: translateX(0) scale(1); }
}

@keyframes lungeLeftAnim {
  0% { transform: translateX(0) scale(1); }
  45% { transform: translateX(-45px) scale(1.12) rotate(-4deg); }
  100% { transform: translateX(0) scale(1); }
}

.dodge-sway {
  animation: dodgeSwayAnim 0.35s ease-out !important;
}

@keyframes dodgeSwayAnim {
  0% { transform: translateX(0); opacity: 1; }
  35% { transform: translateY(-18px) scale(0.92); opacity: 0.5; filter: blur(1.5px); }
  100% { transform: translateX(0); opacity: 1; filter: none; }
}

.block-shield {
  animation: blockShieldAnim 0.32s ease-in-out !important;
}

@keyframes blockShieldAnim {
  0% { transform: scale(1); }
  40% { transform: scale(0.95); box-shadow: 0 0 25px rgba(251, 191, 36, 0.95); }
  100% { transform: scale(1); }
}

.desperate-awakened {
  border-color: #fbbf24 !important;
  box-shadow: 0 0 35px rgba(251, 191, 36, 0.9), 0 0 15px rgba(239, 68, 68, 0.9) !important;
  animation: awakenedPulse 1s infinite alternate !important;
}

@keyframes awakenedPulse {
  from { filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.6)); }
  to { filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.9)); }
}

/* Fighter Tactile Action Cluster */
.fighter-tactile-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 260px;
}

.tactile-btn {
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.tactile-btn:active {
  transform: scale(0.92);
}

.tactile-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.parry-btn {
  background: rgba(30, 58, 138, 0.35);
  border: 1.5px solid rgba(96, 165, 250, 0.6);
  color: #93c5fd;
}

.parry-btn:hover:not(:disabled) {
  background: rgba(37, 99, 235, 0.5);
  border-color: #93c5fd;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.parry-btn.parry-active {
  background: linear-gradient(135deg, #f59e0b, #ef4444) !important;
  border-color: #fde047 !important;
  color: #fff !important;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.95), 0 0 40px rgba(239, 68, 68, 0.8) !important;
  animation: parryPulse 0.45s ease-in-out infinite alternate !important;
  transform: scale(1.08);
}

@keyframes parryPulse {
  from { transform: scale(1.04); filter: brightness(1.2); }
  to { transform: scale(1.14); filter: brightness(1.5); }
}

.burst-btn {
  background: rgba(185, 28, 28, 0.25);
  border: 1.5px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.burst-btn.ready {
  background: linear-gradient(135deg, #b91c1c, #dc2626) !important;
  border-color: #f87171 !important;
  color: #fff !important;
  box-shadow: 0 0 15px rgba(220, 38, 38, 0.8) !important;
}

.cheer-btn {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.cheer-btn:hover:not(:disabled) {
  background: rgba(245, 158, 11, 0.35);
  transform: translateY(-2px);
}

/* Arena Hotkey / Tactile Hint Bar */
.arena-hotkey-bar {
  margin-top: 8px;
  margin-bottom: 4px;
  text-align: center;
}

.hotkey-hint-text {
  font-size: 0.76rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  display: inline-block;
  letter-spacing: 0.02em;
}

/* Parry Indicator Target Ring */
.parry-target-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 170px;
  height: 170px;
  margin-top: -85px;
  margin-left: -85px;
  border-radius: 50%;
  border: 3px dashed #fbbf24;
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.8), inset 0 0 20px rgba(239, 68, 68, 0.5);
  pointer-events: none;
  z-index: 10;
  animation: shrinkRing 0.48s ease-in forwards;
}

@keyframes shrinkRing {
  0% { transform: scale(1.4); opacity: 0.3; }
  60% { opacity: 1; }
  100% { transform: scale(0.92); opacity: 0.9; border-color: #ef4444; }
}

/* Parry Shockwave Explosion */
.parry-shockwave {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  margin-left: -15px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 20;
  animation: shockwaveExpand 0.5s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

.parry-shockwave.perfect {
  border: 4px solid #f59e0b;
  box-shadow: 0 0 40px #f59e0b, inset 0 0 25px #fbbf24;
}

.parry-shockwave.good {
  border: 3px solid #38bdf8;
  box-shadow: 0 0 25px #38bdf8;
}

@keyframes shockwaveExpand {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(7.5); opacity: 0; }
}

/* Comeback Burst Ring */
.comeback-burst-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  margin-left: -20px;
  border-radius: 50%;
  border: 5px solid #ef4444;
  box-shadow: 0 0 50px #ef4444;
  pointer-events: none;
  z-index: 20;
  animation: shockwaveExpand 0.55s ease-out forwards;
}

/* Squash & Stretch Dynamics (Juice) */
.squash-stretch-attack {
  animation: squashStretchAnim 0.28s ease-in-out !important;
}

@keyframes squashStretchAnim {
  0% { transform: scale(1, 1); }
  35% { transform: scale(1.25, 0.82); }
  65% { transform: scale(0.88, 1.18); }
  100% { transform: scale(1, 1); }
}

.squash-impact {
  animation: squashImpactAnim 0.3s ease-out !important;
}

@keyframes squashImpactAnim {
  0% { transform: scale(1, 1); }
  30% { transform: scale(0.78, 1.25) translateY(4px); }
  70% { transform: scale(1.12, 0.92); }
  100% { transform: scale(1, 1); }
}

.parry-miss-shake {
  animation: parryMissAnim 0.28s ease-in-out !important;
}

@keyframes parryMissAnim {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); filter: grayscale(0.5); }
  75% { transform: translateX(6px); filter: grayscale(0.5); }
}

/* Low HP Danger Heartbeat Pulse */
.low-hp-danger {
  border-color: #ef4444 !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.7), inset 0 0 15px rgba(239, 68, 68, 0.4) !important;
  animation: heartbeatDanger 1.1s infinite cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

@keyframes heartbeatDanger {
  0% { transform: scale(1); filter: brightness(1); }
  15% { transform: scale(1.06); filter: brightness(1.25); }
  30% { transform: scale(0.98); }
  45% { transform: scale(1.04); filter: brightness(1.15); }
  60% { transform: scale(1); filter: brightness(1); }
}

/* Floating Damage Numbers */
.floating-combat-num {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.6rem;
  font-weight: 900;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  animation: floatNum 0.9s ease-out forwards;
  z-index: 50;
  white-space: nowrap;
}

.floating-combat-num.crit {
  font-size: 2.2rem;
  color: #fbbf24 !important;
  text-shadow: 0 0 20px rgba(245, 158, 11, 0.8), 0 2px 8px rgba(0,0,0,0.9);
}

.floating-combat-num.ult {
  font-size: 2.6rem;
  color: #f43f5e !important;
  text-shadow: 0 0 25px rgba(244, 63, 94, 0.9), 0 2px 10px rgba(0,0,0,0.9);
}

.floating-combat-num.dodge {
  font-size: 1.4rem;
  color: #38bdf8 !important;
}

.floating-combat-num.block {
  font-size: 1.3rem;
  color: #fb923c !important;
}

.floating-combat-num.cheer {
  font-size: 1.5rem;
  color: #facc15 !important;
}

@keyframes floatNum {
  0% { opacity: 0; transform: translate(-50%, 15px) scale(0.7); }
  25% { opacity: 1; transform: translate(-50%, -15px) scale(1.15); }
  60% { opacity: 1; transform: translate(-50%, -35px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -60px) scale(0.9); }
}

/* Hit Sparks */
.hit-spark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  pointer-events: none;
  animation: hitSparkFade 0.35s ease-out forwards;
  z-index: 40;
}

@keyframes hitSparkFade {
  0% { transform: translate(-50%, -50%) scale(0.3) rotate(0deg); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.6) rotate(35deg); opacity: 0; }
}

/* ==================== REAL-TIME COMBAT LOG ==================== */
.arena-log-card {
  padding: 16px 20px;
}

.log-card-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.log-title {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.combat-log-stream {
  height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 6px;
}

.combat-log-stream::-webkit-scrollbar {
  width: 5px;
}

.combat-log-stream::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}

.log-line {
  font-size: 0.88rem;
  line-height: 1.4;
  color: #cbd5e1;
}

.log-intro { color: #f59e0b; font-weight: 700; }
.log-ult { color: #f43f5e; font-weight: 800; }
.log-crit { color: #fbbf24; font-weight: 700; }
.log-dodge { color: #38bdf8; }
.log-block { color: #fdba74; }

/* ==================== COMIC CUT-IN OVERLAY ==================== */
.comic-cutin-layer {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.cutin-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
}

.cutin-slash-bar {
  position: relative;
  width: 120%;
  height: 200px;
  background: linear-gradient(90deg, #1e1b4b 0%, #b91c1c 40%, #ea580c 80%, #7c2d12 100%);
  transform: rotate(-5deg) scaleY(1);
  box-shadow: 0 0 50px rgba(234, 88, 12, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 0 80px;
  border-top: 4px solid #fef08a;
  border-bottom: 4px solid #fef08a;
  animation: cutinSlide 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cutinSlide {
  0% { transform: rotate(-5deg) translateY(-200px) scale(0.8); opacity: 0; }
  15% { transform: rotate(-5deg) translateY(0) scale(1); opacity: 1; }
  85% { transform: rotate(-5deg) translateY(0) scale(1); opacity: 1; }
  100% { transform: rotate(-5deg) translateY(200px) scale(0.9); opacity: 0; }
}

.cutin-avatar-wrap {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #fef08a;
  border: 4px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  font-weight: 900;
  color: #991b1b;
  box-shadow: 0 0 25px rgba(254, 240, 138, 0.8);
}

.cutin-info-wrap {
  color: #fff;
}

.cutin-awakening-badge {
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #fef08a;
  text-shadow: 0 0 10px rgba(254, 240, 138, 0.8);
}

.cutin-fighter-name {
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1.1;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.8);
}

.cutin-fighter-quote {
  font-size: 1.1rem;
  font-style: italic;
  color: #fed7aa;
  margin: 4px 0;
}

.cutin-skill-name {
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

/* ==================== VICTORY RESULTS MODAL ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.result-modal {
  width: 100%;
  max-width: 520px;
  padding: 32px;
  text-align: center;
  animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.trophy-badge {
  font-size: 3.5rem;
  margin-bottom: 8px;
}

.winner-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border: 3px solid #fef08a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 900;
  margin: 0 auto 12px;
  color: #fff;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.6);
}

.winner-announcement {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
}

.winner-name {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 20px;
  color: #fff;
}

.result-stats-table {
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.92rem;
}

.stat-name {
  color: var(--text-muted);
}

.stat-val {
  font-weight: 800;
  color: #fff;
}

/* Tower Boon Drafting */
.tower-boon-container {
  margin-bottom: 24px;
  text-align: left;
}

.boon-heading {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-accent);
  margin-bottom: 12px;
  text-align: center;
}

.boon-cards-row {
  display: flex;
  gap: 10px;
}

.boon-card {
  flex: 1;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.boon-card:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: var(--color-accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px var(--color-accent-glow);
}

.boon-icon {
  font-size: 2rem;
}

.boon-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
}

.boon-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Toast Notification */
.toast-message {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--color-accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  z-index: 1000;
  pointer-events: none;
  animation: toastIn 0.25s ease-out;
}

.toast-message.fade-out {
  opacity: 0;
  transition: opacity 0.3s ease;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 15px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
  .app-header {
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 14px;
  }

  .mode-tabs {
    order: 3;
    width: 100%;
    justify-content: space-around;
  }

  .mode-tab-btn {
    padding: 5px 10px;
    font-size: 0.8rem;
  }

  .setup-players-deck {
    flex-direction: column;
    gap: 12px;
  }

  .vs-badge-container {
    margin: -4px 0;
  }

  .arena-top-hud {
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
  }

  .side-b .hud-identity {
    justify-content: flex-start;
  }

  .arena-tug-of-war {
    padding: 6px 12px;
  }

  .arena-battlefield {
    height: 270px;
    padding: 14px;
  }

  .fighter-avatar {
    width: 82px;
    height: 82px;
    font-size: 1.9rem;
  }

  .cheer-btn {
    font-size: 0.72rem;
    padding: 4px 10px;
  }

  .arena-log-card {
    padding: 10px 14px;
  }

  .combat-log-stream {
    max-height: 180px;
  }

  .cutin-slash-bar {
    padding: 0 20px;
    gap: 14px;
    height: 160px;
  }

  .cutin-avatar-wrap {
    width: 70px;
    height: 70px;
    font-size: 1.8rem;
  }

  .cutin-fighter-name {
    font-size: 1.5rem;
  }

  .cutin-skill-name {
    font-size: 1.1rem;
  }

  .boon-cards-row {
    flex-direction: column;
  }

  .tower-floors-preview {
    flex-direction: column;
  }
}
