/**
 * CoinRush Barbarian Arena - React Premium UI
 * Necrotic Knight Theme with Green Accents
 */

/* ============================================
   CSS VARIABLES - NECROTIC GREEN THEME (ENHANCED)
   ============================================ */
:root {
  --bg-dark: #05070a;
  --bg-darker: #020304;
  --bg-card: #0a0e14;
  --bg-card-hover: #11161f;
  --bg-elevated: #0f141a;
  --bg-input: #06080b;
  
  --border: rgba(91, 255, 178, 0.15);
  --border-hover: rgba(91, 255, 178, 0.3);
  --border-active: rgba(91, 255, 178, 0.5);
  
  --text: #f0f6fc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Necrotic Knight theme - Toxic green */
  --primary: #5bffb2;
  --primary-dark: #3dd68a;
  --primary-dim: rgba(91, 255, 178, 0.08);
  --primary-glow: rgba(91, 255, 178, 0.5);
  --primary-glow-strong: rgba(91, 255, 178, 0.8);
  
  /* Green accent alias */
  --green-accent: #5bffb2;
  
  --accent: #a0ffcc;
  --accent-dim: rgba(160, 255, 204, 0.1);
  
  --green: #4fffb0;
  --red: #ff4d4d;
  --blue: #3b82f6;
  --purple: #a855f7;
  --gold: #fbbf24;
  
  --hp-full: #10b981;
  --hp-mid: #f59e0b;
  --hp-low: #ef4444;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 40px rgba(91, 255, 178, 0.2);
  
  --font-display: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* ============================================
   BASE STYLES
   ============================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg-darker);
  color: var(--text);
  font-family: 'Sora', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================
   APP LAYOUT
   ============================================ */
.barbarian-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-darker);
  position: relative;
  overflow: hidden;
}

/* Animated Background Effect */
.barbarian-app::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle at 50% 50%, rgba(91, 255, 178, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 20% 80%, rgba(168, 85, 247, 0.03) 0%, transparent 40%);
  animation: bgMove 30s ease-in-out infinite alternate;
  z-index: 0;
  pointer-events: none;
  filter: blur(60px);
}

.barbarian-app::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(91, 255, 178, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 255, 178, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  background-position: center top;
  mask-image: radial-gradient(circle at 50% 50%, black 30%, transparent 90%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, black 30%, transparent 90%);
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  animation: gridPulse 10s ease-in-out infinite;
}

@keyframes bgMove {
  0% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(-5%, 5%) rotate(2deg); }
  66% { transform: translate(5%, -5%) rotate(-2deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.02); }
}

.barbarian-main {
  flex: 1;
  padding: 24px;
  padding-top: 24px;
  position: relative;
  z-index: 1;
}

.barbarian-layout {
  display: grid;
  grid-template-columns: 320px 1fr 360px;
  gap: 24px;
  max-width: 1600px;
  margin: 0 auto;
  height: calc(100vh - 180px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar--right {
  height: 100%;
}

/* Arena Chat Container - Full Height */
#arena-chat-container {
  height: 100%;
  min-height: unset;
  max-height: unset;
}

#arena-chat-container .cr-chat-container {
  height: 100%;
  max-height: none;
  /* Override gold theme with green for barbarian arena */
  --cr-chat-primary: #5bffb2;
  --cr-chat-primary-rgb: 91, 255, 178;
  --cr-chat-secondary: #34d399;
  --cr-chat-accent: #6ee7b7;
  --cr-chat-border: rgba(91, 255, 178, 0.2);
  --cr-chat-border-light: rgba(91, 255, 178, 0.1);
  --cr-chat-glow: rgba(91, 255, 178, 0.4);
}

/* ============================================
   TICKER - History Bar
   ============================================ */
.ba-ticker {
  overflow: hidden;
  padding: 12px 0;
  background: rgba(8, 12, 10, 0.95);
  border-bottom: 1px solid rgba(91, 255, 178, 0.08);
  position: relative;
  margin-top: 70px;
}

.ba-ticker::before,
.ba-ticker::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 80px;
  z-index: 10;
  pointer-events: none;
}

.ba-ticker::before {
  left: 0;
  background: linear-gradient(90deg, rgba(5, 8, 7, 1), transparent);
}

.ba-ticker::after {
  right: 0;
  background: linear-gradient(-90deg, rgba(5, 8, 7, 1), transparent);
}

.ba-ticker-track {
  display: flex;
  gap: 16px;
  animation: baTickerScroll 60s linear infinite;
  white-space: nowrap;
  padding: 0 40px;
}

.ba-ticker-track:hover {
  animation-play-state: paused;
}

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

.ba-ticker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.ba-ticker-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.ba-ticker-id {
  color: var(--primary);
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  background: rgba(91, 255, 178, 0.1);
  border-radius: 6px;
}

.ba-ticker-winner {
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
}

.ba-ticker-text {
  color: var(--text-muted);
  font-size: 12px;
}

.ba-ticker-amount {
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--primary);
  background: rgba(91, 255, 178, 0.1);
}

.main-content {
  min-width: 0;
  height: 100%;
  overflow-y: auto;
}

/* ============================================
   PANEL STYLES - COINFLIP CLEAN DESIGN
   ============================================ */
.panel-header {
  position: relative;
  padding: 20px 24px;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
  border-bottom: 1px solid rgba(91, 255, 178, 0.08);
  background: rgba(0, 0, 0, 0.25);
}

.panel-header-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(91, 255, 178, 0.08) 0%, transparent 100%);
  z-index: 0;
}

.panel-header-bg::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(91, 255, 178, 0.1) 0%, transparent 60%);
  animation: pulseGlow 8s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

.panel-header-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/static/img/barbarian/knight.idle.png') no-repeat right center;
  background-size: contain;
  opacity: 0.2;
  filter: drop-shadow(0 0 10px rgba(91, 255, 178, 0.5));
}

.panel-header-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.panel-header.simple {
  background: linear-gradient(135deg, rgba(91, 255, 178, 0.12) 0%, rgba(61, 214, 138, 0.06) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header.simple .header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, #22c55e 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(91, 255, 178, 0.25);
  position: relative;
  overflow: hidden;
}

.panel-icon::after {
  display: none;
}

@keyframes iconPulse {
  0% { opacity: 0; transform: scale(0.5); }
  50% { opacity: 0.3; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.5); }
}

.panel-icon svg {
  width: 18px;
  height: 18px;
  color: #0a0d12;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.panel-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-stats {
  display: flex;
  gap: 8px;
}

.header-stats .stat {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.header-stats .stat.active {
  background: rgba(91, 255, 178, 0.15);
  color: var(--primary);
}

.header-stats .stat.open {
  background: rgba(59, 130, 246, 0.15);
  color: var(--blue);
}

/* ============================================
   CREATE DUEL PANEL - COINFLIP STYLE
   ============================================ */
.create-duel-panel {
  background: rgba(12, 20, 16, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  border: 1px solid rgba(91, 255, 178, 0.08);
  overflow: hidden;
  transition: border-color 0.2s ease;
  position: relative;
}

.create-duel-panel:hover {
  border-color: rgba(91, 255, 178, 0.15);
}

.create-duel-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(91, 255, 178, 0.3), transparent);
}

.panel-body {
  padding: 20px;
}

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

.stake-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.sound-toggle {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sound-toggle svg {
  width: 18px;
  height: 18px;
}

.sound-toggle:hover {
  border-color: rgba(91, 255, 178, 0.3);
  color: var(--primary);
  background: rgba(91, 255, 178, 0.08);
}

.sound-toggle.on {
  color: var(--primary);
  border-color: rgba(91, 255, 178, 0.3);
  background: rgba(91, 255, 178, 0.1);
}

.stake-input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  font-family: 'JetBrains Mono', var(--font-display), monospace;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.2s ease;
}

.stake-input:focus {
  outline: none;
  border-color: rgba(91, 255, 178, 0.4);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(91, 255, 178, 0.1);
}

.stake-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.quick-amounts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.quick-btn {
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-btn:hover {
  background: rgba(91, 255, 178, 0.08);
  border-color: rgba(91, 255, 178, 0.3);
  color: var(--primary);
  transform: translateY(-1px);
}

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

.quick-btn.max {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.3);
  color: var(--gold);
  font-weight: 700;
}

.quick-btn.max:hover {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.1));
  border-color: var(--gold);
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.1);
}

.create-btn {
  width: 100%;
  margin-top: 16px;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, #22c55e 100%);
  border: none;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: #020304;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.25s ease;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 4px 20px rgba(91, 255, 178, 0.25);
  position: relative;
  overflow: hidden;
}

.create-btn::after {
  display: none;
}

.create-btn svg {
  width: 20px;
  height: 20px;
}

.create-btn:hover:not(.disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(91, 255, 178, 0.35);
  filter: brightness(1.05);
}

.create-btn:active:not(.disabled) {
  transform: translateY(0);
}

.create-btn.disabled {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   DUELS PANEL - COINFLIP STYLE
   ============================================ */
.duels-panel {
  background: rgba(12, 20, 16, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  border: 1px solid rgba(91, 255, 178, 0.08);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.duels-panel:hover {
  border-color: rgba(91, 255, 178, 0.15);
}

.duels-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

.duels-loading {
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  padding: 80px 20px;
  text-align: center;
  background: radial-gradient(circle at center, rgba(91, 255, 178, 0.03) 0%, transparent 70%);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.empty-state::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  background: var(--primary);
  filter: blur(100px);
  opacity: 0.05;
  pointer-events: none;
}

.empty-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 24px;
  background: linear-gradient(135deg, rgba(91, 255, 178, 0.1), rgba(91, 255, 178, 0.02));
  border: 1px solid rgba(91, 255, 178, 0.2);
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px rgba(91, 255, 178, 0.1);
  animation: emptyIconFloat 4s ease-in-out infinite;
  position: relative;
}

.empty-icon::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 30px;
  padding: 1px;
  background: linear-gradient(135deg, var(--primary), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.5;
}

@keyframes emptyIconFloat {
  0%, 100% { transform: translateY(0); box-shadow: 0 0 30px rgba(91, 255, 178, 0.1); }
  50% { transform: translateY(-10px); box-shadow: 0 10px 40px rgba(91, 255, 178, 0.2); }
}

.empty-icon svg {
  width: 48px;
  height: 48px;
  color: var(--primary);
  filter: drop-shadow(0 0 10px rgba(91, 255, 178, 0.5));
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 0 20px rgba(91, 255, 178, 0.2);
}

.empty-state p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 300px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ============================================
   BATTLE CARD - COINFLIP STYLE
   ============================================ */
.battle-card {
  position: relative;
  background: linear-gradient(180deg, rgba(16, 22, 18, 0.9) 0%, rgba(10, 14, 12, 0.95) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  border: 1px solid rgba(91, 255, 178, 0.1);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  animation: cardEntry 0.4s ease-out backwards;
}

@keyframes cardEntry {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.battle-card:hover {
  border-color: rgba(91, 255, 178, 0.35);
  transform: translateY(-4px);
  box-shadow: 
    0 16px 48px rgba(0, 0, 0, 0.4), 
    0 0 30px rgba(91, 255, 178, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  z-index: 10;
}

/* Player avatar base styles */
.player-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: #0a0d12;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  border: 2px solid rgba(255,255,255,0.1);
}

.player-avatar.small {
  width: 36px;
  height: 36px;
  font-size: 14px;
}

.player-avatar.empty {
  background: var(--bg-input);
  border: 2px dashed var(--border);
  color: var(--text-muted);
  box-shadow: none;
}

.you-badge {
  padding: 3px 8px;
  background: var(--primary);
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  color: #0a0d12;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px var(--primary-glow);
  animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 2px 8px var(--primary-glow); }
  50% { transform: scale(1.05); box-shadow: 0 4px 12px var(--primary-glow-strong); }
}

/* ============================================
   OPEN BATTLE CARD - COMPACT
   ============================================ */
.battle-card.open.compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: linear-gradient(90deg, rgba(10, 14, 20, 0.95) 0%, rgba(5, 7, 10, 0.98) 100%);
  border: 1px solid rgba(91, 255, 178, 0.1);
  border-radius: 12px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
  height: 64px;
}

.battle-card.open.compact:hover {
  border-color: var(--primary);
  transform: translateX(4px);
  box-shadow: -4px 4px 12px rgba(0, 0, 0, 0.4);
}

.compact-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
}

.compact-left .player-avatar {
  width: 40px;
  height: 40px;
  font-size: 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-weight: 800;
}

.compact-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.compact-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compact-name-row .creator-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.time-badge-mini {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.time-badge-mini.urgent {
  color: var(--red);
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  animation: pulseUrgent 1s infinite;
}

@keyframes pulseUrgent {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.compact-status {
  font-size: 10px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

.compact-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.compact-stake-group {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.stake-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 50px;
}

.stake-pill .label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 1px;
}

.stake-pill .value {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
}

.stake-pill.entry .value { color: var(--gold); }
.stake-pill.win .value { color: var(--green); }

.stake-arrow {
  color: var(--text-muted);
  opacity: 0.3;
  display: flex;
  align-items: center;
}

.stake-arrow svg {
  width: 14px;
  height: 14px;
}

.compact-right {
  min-width: 120px;
  display: flex;
  justify-content: flex-end;
}

.compact-btn {
  padding: 0 20px;
  font-size: 12px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.waiting-pulse {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: 8px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

/* ============================================
   ACTIVE BATTLE CARD - COMPACT
   ============================================ */
.battle-card.active.compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: linear-gradient(90deg, rgba(10, 14, 20, 0.95) 0%, rgba(5, 7, 10, 0.98) 100%);
  border: 1px solid rgba(91, 255, 178, 0.3);
  border-radius: 12px;
  margin-bottom: 12px; /* Increased margin for pop-out borders */
  transition: all 0.2s ease;
  height: 72px; /* Increased height for avatars */
  box-shadow: 0 0 15px rgba(91, 255, 178, 0.05);
  overflow: visible; /* Allow borders to pop out */
  z-index: 1;
}

.battle-card.active.compact:hover {
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(91, 255, 178, 0.15);
  transform: translateY(-2px);
  z-index: 10;
}

.compact-players-vs {
  display: flex;
  align-items: center;
  gap: 16px; /* Increased gap */
  min-width: 260px;
}

.player-mini {
  display: flex;
  align-items: center;
  gap: 12px; /* Increased gap for avatar */
}

/* Removed .player-avatar.tiny styles as we use .cf-avatar now */

.player-mini-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mini-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.hp-bar-micro {
  width: 60px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.hp-bar-micro .hp-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.vs-micro {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-muted);
  opacity: 0.5;
}

.compact-pot-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
  padding: 4px 12px;
  border-radius: 8px;
  min-width: 80px;
}

.compact-pot-pill .label {
  font-size: 9px;
  font-weight: 700;
  color: var(--gold);
  opacity: 0.8;
}

.compact-pot-pill .value {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: var(--gold);
}

.live-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  color: var(--red);
  margin-right: 12px;
}

.live-tag .live-dot {
  width: 6px;
  height: 6px;
  background: var(--red);
  border-radius: 50%;
  animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
  0% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { opacity: 0.7; transform: scale(1.2); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
  100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ============================================
   RESOLVED BATTLE CARD - COMPACT
   ============================================ */
.battle-card.resolved {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: linear-gradient(90deg, rgba(10, 14, 20, 0.95) 0%, rgba(5, 7, 10, 0.98) 100%);
  border: 1px solid rgba(79, 255, 176, 0.1);
  border-radius: 12px;
  margin-bottom: 12px;
  transition: all 0.2s ease;
  height: 72px;
  opacity: 0.8;
  position: relative;
  overflow: visible;
  z-index: 1;
}

.battle-card.resolved:hover {
  opacity: 1;
  border-color: rgba(79, 255, 176, 0.3);
  transform: translateY(-2px);
  z-index: 10;
}

.resolved-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
}

.resolved-players {
  display: flex;
  align-items: center;
  gap: 12px;
}

.resolved-player {
  display: flex;
  align-items: center;
  gap: 8px;
}

.resolved-player .player-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.resolved-player.winner .player-name {
  color: var(--green);
  font-weight: 700;
}

.winner-crown {
  width: 14px;
  height: 14px;
  color: var(--gold);
}

.resolved-vs {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  opacity: 0.5;
}

.resolved-prize {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  margin-right: 48px; /* Space for replay button */
}

.resolved-prize .prize-amount {
  font-size: 14px;
  font-weight: 800;
  color: var(--gold);
}

.resolved-prize .prize-label {
  font-size: 9px;
  color: var(--text-muted);
}

.replay-btn-mini {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.replay-btn-mini svg {
  width: 14px;
  height: 14px;
}

.replay-btn-mini:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(91, 255, 178, 0.1);
}

/* ============================================
   BATTLE CARD - COINFLIP STYLE (.bc)
   ============================================ */
.bc {
  background: linear-gradient(165deg, 
    rgba(14, 24, 19, 0.97) 0%, 
    rgba(10, 18, 14, 0.98) 50%,
    rgba(12, 20, 16, 0.97) 100%);
  border: 1px solid rgba(91, 255, 178, 0.1);
  border-radius: 12px;
  overflow: visible;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.3);
}

.bc::before {
  content: '';
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  border-radius: 1px;
}

.bc:hover {
  border-color: rgba(91, 255, 178, 0.25);
  transform: translateY(-4px);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 60px rgba(91, 255, 178, 0.08);
}

.bc--own {
  border-color: rgba(91, 255, 178, 0.2);
  background: linear-gradient(165deg, 
    rgba(91, 255, 178, 0.06) 0%,
    rgba(14, 24, 19, 0.97) 50%,
    rgba(91, 255, 178, 0.03) 100%);
}

.bc--own::after {
  content: 'YOUR BATTLE';
  position: absolute;
  top: -10px;
  left: 20px;
  padding: 4px 10px;
  background: linear-gradient(135deg, var(--green-accent), #3dd492);
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #0a0f0d;
  box-shadow: 0 2px 10px rgba(91, 255, 178, 0.4);
}

.bc--active {
  animation: bcPulse 2s ease-in-out infinite;
  border-color: rgba(251, 191, 36, 0.3);
}

@keyframes bcPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); }
  50% { 
    box-shadow: 
      0 4px 20px rgba(0, 0, 0, 0.3),
      0 0 30px rgba(251, 191, 36, 0.2),
      inset 0 0 20px rgba(251, 191, 36, 0.03);
  }
}

.bc--resolved {
  opacity: 0.7;
}

.bc--resolved:hover {
  opacity: 0.9;
}

/* Main row */
.bc__row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  gap: 12px;
  min-height: 56px;
}

/* Player */
.bc__player {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.bc__player--right {
  justify-content: flex-end;
}

.bc__player--winner {
  position: relative;
}

.bc__avatar-wrap {
  position: relative;
  flex-shrink: 0;
  z-index: 1;
}

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

.bc__info--right {
  align-items: flex-end;
  text-align: right;
}

.bc__name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.bc__bet {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  font-family: 'JetBrains Mono', monospace;
}

.bc__crown {
  display: inline-flex;
  width: 16px;
  height: 16px;
  margin: 0 4px;
  color: var(--gold);
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.6));
  animation: crownPulse 2s ease-in-out infinite;
}

@keyframes crownPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.bc__crown svg {
  width: 100%;
  height: 100%;
}

/* VS */
.bc__vs {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.3), rgba(34, 197, 94, 0.3));
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.3),
    inset 0 0 10px rgba(255, 255, 255, 0.1);
}

/* Waiting slot */
.bc__waiting {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
}

.bc__waiting-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(91, 255, 178, 0.1), rgba(91, 255, 178, 0.05));
  border: 1.5px dashed rgba(91, 255, 178, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: rgba(91, 255, 178, 0.6);
  animation: waitPulse 2s ease-in-out infinite;
}

@keyframes waitPulse {
  0%, 100% { border-color: rgba(91, 255, 178, 0.25); }
  50% { border-color: rgba(91, 255, 178, 0.5); }
}

/* Footer */
.bc__footer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.35));
  border-top: 1px solid rgba(91, 255, 178, 0.08);
  gap: 8px;
}

.bc__pot {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  font-family: 'JetBrains Mono', monospace;
}

.bc__coin {
  width: 16px;
  height: 16px;
}

.bc__status {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bc__status--open {
  background: rgba(91, 255, 178, 0.1);
  color: rgba(91, 255, 178, 0.9);
}

.bc__status--active {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.bc__status--resolved {
  background: rgba(156, 163, 175, 0.1);
  color: #9ca3af;
}

.bc__status--urgent {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  animation: urgentPulse 1s ease-in-out infinite;
}

.bc__status--warning {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

@keyframes urgentPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.bc__live-dot {
  width: 6px;
  height: 6px;
  background: #fbbf24;
  border-radius: 50%;
  animation: liveDot 1.5s ease-in-out infinite;
}

@keyframes liveDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.bc__timer-icon {
  display: inline-flex;
  width: 12px;
  height: 12px;
}

.bc__timer-icon svg {
  width: 100%;
  height: 100%;
}

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

.bc__btn {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
}

.bc__btn--view {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px;
}

.bc__btn--view:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.bc__btn--join {
  background: linear-gradient(135deg, #5bffb2, #3dd492);
  color: #0a0f0d;
  font-weight: 800;
  padding: 8px 16px;
  box-shadow: 0 2px 8px rgba(91, 255, 178, 0.3);
}

.bc__btn--join:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(91, 255, 178, 0.4);
}

.bc__btn--join:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.bc__btn-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
}

.bc__btn-icon svg {
  width: 100%;
  height: 100%;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */
.action-btn {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  border: none;
}

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

.action-btn.primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #020304;
  font-weight: 700;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.action-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow-strong);
  filter: brightness(1.1);
}

.action-btn.primary.full {
  width: 100%;
  justify-content: center;
  padding: 12px;
  font-size: 14px;
}

.action-btn.secondary {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.action-btn.secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.replay-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ============================================
   BATTLE OVERLAY (ARENA) - NECROTIC KNIGHT THEME
   ============================================ */
.battle-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: overlayFadeIn 0.3s ease-out;
}

@keyframes overlayFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* ============================================
   SIMPLE COUNTDOWN (Like coinflip)
   ============================================ */
.battle-countdown-simple {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.battle-countdown-num {
  font-size: 120px;
  font-weight: 900;
  color: #5bffb2;
  text-shadow: 0 0 60px rgba(91, 255, 178, 0.6);
  animation: countdown-pop 1s ease-out;
}

@keyframes countdown-pop {
  0% { transform: scale(1.5); opacity: 0; }
  40% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.9; }
}

.countdown-rolling-simple {
  animation: rollingSpin 0.5s linear infinite;
}

.countdown-rolling-simple .dice-spinning {
  font-size: 80px;
  color: #5bffb2;
}

.countdown-rolling-simple .dice-spinning svg {
  width: 100px;
  height: 100px;
}

/* ============================================
   COUNTDOWN SCREEN (Before battle starts) - OLD
   ============================================ */
.battle-countdown-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 40px;
  z-index: 10;
}

.countdown-title {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--green-accent);
  text-transform: uppercase;
  letter-spacing: 4px;
  text-shadow: 
    0 0 20px rgba(91, 255, 178, 0.5),
    0 0 40px rgba(91, 255, 178, 0.3);
  animation: titlePulse 1.5s ease-in-out infinite;
}

@keyframes titlePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.02); opacity: 0.9; }
}

.countdown-players {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 1.5rem;
  font-weight: 700;
}

.countdown-player {
  text-shadow: 0 0 10px currentColor;
}

.countdown-vs {
  color: #666;
  font-size: 1.2rem;
  font-weight: 400;
}

.countdown-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 255, 178, 0.15) 0%, transparent 70%);
  border: 4px solid var(--green-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 0 40px rgba(91, 255, 178, 0.4),
    inset 0 0 40px rgba(91, 255, 178, 0.1);
  animation: circlePulse 1s ease-in-out infinite;
}

@keyframes circlePulse {
  0%, 100% { 
    transform: scale(1); 
    box-shadow: 0 0 40px rgba(91, 255, 178, 0.4), inset 0 0 40px rgba(91, 255, 178, 0.1);
  }
  50% { 
    transform: scale(1.05); 
    box-shadow: 0 0 60px rgba(91, 255, 178, 0.6), inset 0 0 60px rgba(91, 255, 178, 0.2);
  }
}

.countdown-number-big {
  font-size: 6rem;
  font-weight: 900;
  color: var(--green-accent);
  text-shadow: 
    0 0 30px rgba(91, 255, 178, 0.8),
    0 0 60px rgba(91, 255, 178, 0.4);
  animation: numberPop 1s ease-out;
}

@keyframes numberPop {
  0% { transform: scale(1.5); opacity: 0; }
  50% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

.countdown-rolling {
  animation: rollingSpin 0.5s linear infinite;
}

.dice-spinning {
  font-size: 4rem;
  color: var(--green-accent);
}

.dice-spinning svg {
  width: 80px;
  height: 80px;
}

@keyframes rollingSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.countdown-subtitle {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.countdown-first-attacker {
  font-size: 1.3rem;
  color: #f59e0b;
  font-weight: 700;
  padding: 12px 24px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.battle-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at center, rgba(91, 255, 178, 0.1), transparent 70%),
    rgba(2, 3, 4, 0.92);
  backdrop-filter: blur(16px);
}

.battle-arena {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: 90vh;
  max-height: 850px;
  background-image: url('/static/img/barbarian/knight.duel.background.png');
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-color: #0a0502;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(91, 255, 178, 0.3);
  padding: 32px;
  box-shadow: 
    0 32px 100px rgba(0, 0, 0, 0.8),
    0 0 80px rgba(91, 255, 178, 0.15),
    inset 0 0 100px rgba(0,0,0,0.8);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Dark overlay for readability */
.battle-arena::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(180deg, rgba(2, 3, 4, 0.6) 0%, rgba(2, 3, 4, 0.3) 50%, rgba(2, 3, 4, 0.7) 100%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.1) 2px,
      rgba(0, 0, 0, 0.1) 4px
    );
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background-size: 100% 100%, 100% 4px;
}

.battle-arena > * {
  position: relative;
  z-index: 1;
}

/* Default SVG sizing in battle arena to prevent unconstrained expansion */
.battle-arena svg {
  max-width: 100%;
  max-height: 100%;
}

/* Green flames animation */
.battle-arena::after {
  content: '';
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: 
    radial-gradient(ellipse at 20% 40%, rgba(91, 255, 178, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 40%, rgba(91, 255, 178, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 50%, rgba(91, 255, 178, 0.1) 0%, transparent 70%);
  animation: flamesFlicker 5s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
  filter: blur(40px);
  opacity: 0.7;
}

/* Floating Particles in Arena */
.battle-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle, rgba(91, 255, 178, 0.4) 1px, transparent 1px),
    radial-gradient(circle, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  background-size: 60px 60px, 40px 40px;
  background-position: 0 0, 20px 20px;
  animation: particlesFloat 20s linear infinite;
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

@keyframes particlesFloat {
  0% { background-position: 0 0, 20px 20px; }
  100% { background-position: 0 -60px, 20px -20px; }
}

@keyframes flamesFlicker {
  0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
  25% { opacity: 0.7; transform: translateX(-50%) scale(1.05) translateY(-10px); }
  50% { opacity: 0.6; transform: translateX(-50%) scale(0.98); }
  75% { opacity: 0.8; transform: translateX(-50%) scale(1.03) translateY(-5px); }
}

.arena-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(15, 60, 40, 0.35);
  border: 1px solid rgba(91, 255, 178, 0.3);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

.arena-close svg {
  width: 20px;
  height: 20px;
}

.arena-close:hover {
  background: rgba(255, 107, 107, 0.25);
  border-color: var(--red);
  color: var(--red);
}

.arena-header {
  text-align: center;
  margin-bottom: 24px;
}

.arena-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
  text-shadow: 0 0 30px rgba(91, 255, 178, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.arena-title svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.arena-pot {
  font-size: 16px;
  color: var(--text-secondary);
}

.arena-pot strong {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

/* ============================================
   UNIFIED ARENA - Both fighters in one stage
   ============================================ */
.unified-arena {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex: 1;
  padding: 20px;
}

.fighter-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 120px;
}

.fighter-stats.left {
  align-items: flex-start;
}

.fighter-stats.right {
  align-items: flex-end;
}

.fighter-name {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.you-tag {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--primary);
  color: var(--bg-dark);
  border-radius: 4px;
  font-weight: 700;
}

.fighter-hp-bar {
  width: 120px;
  height: 10px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.fighter-hp-bar .hp-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.fighter-hp-bar .hp-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 100%
  );
  transform: skewX(-20deg) translateX(-150%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: skewX(-20deg) translateX(-150%); }
  100% { transform: skewX(-20deg) translateX(150%); }
}

.fighter-hp-text {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.fighter-hp-text svg {
  width: 14px;
  height: 14px;
  color: var(--red);
}

/* Battle Stage - The main arena box */
.battle-stage {
  flex: 1;
  max-width: 500px;
  height: 200px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 20px 40px;
  background: linear-gradient(180deg, 
    rgba(10, 15, 20, 0.8) 0%,
    rgba(20, 25, 30, 0.9) 100%
  );
  border-radius: var(--radius-lg);
  border: 2px solid rgba(91, 255, 178, 0.2);
  box-shadow: 
    inset 0 -20px 40px rgba(0, 0, 0, 0.5),
    0 10px 40px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

/* Arena floor effect */
.battle-stage::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(91, 255, 178, 0.1) 20%,
    rgba(91, 255, 178, 0.2) 50%,
    rgba(91, 255, 178, 0.1) 80%,
    transparent 100%
  );
}

/* VS badge in the middle */
.vs-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.15);
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  z-index: 1;
  letter-spacing: 2px;
}

/* Fighter sprite containers */
.fighter-sprite-container {
  position: relative;
  z-index: 2;
  transition: transform 0.1s;
}

.fighter-sprite-container.left {
  transform-origin: bottom right;
}

.fighter-sprite-container.right {
  transform-origin: bottom left;
}

/* Attack animations - lunge toward opponent */
.fighter-sprite-container.left.attacking {
  animation: containerLungeRight 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fighter-sprite-container.right.attacking {
  animation: containerLungeLeft 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Healing animation - green glow pulse */
.fighter-sprite-container.healing {
  animation: healingGlow 1.2s ease-out;
}

@keyframes healingGlow {
  0% { 
    filter: drop-shadow(0 0 0 transparent);
  }
  25% { 
    filter: drop-shadow(0 0 30px rgba(34, 197, 94, 0.9)) drop-shadow(0 0 60px rgba(34, 197, 94, 0.6));
  }
  50% { 
    filter: drop-shadow(0 0 40px rgba(34, 197, 94, 1)) drop-shadow(0 0 80px rgba(34, 197, 94, 0.7));
  }
  75% { 
    filter: drop-shadow(0 0 25px rgba(34, 197, 94, 0.8)) drop-shadow(0 0 50px rgba(34, 197, 94, 0.5));
  }
  100% { 
    filter: drop-shadow(0 0 0 transparent);
  }
}

/* Container lunge animations (don't affect sprite flip) */
@keyframes containerLungeRight {
  0% { transform: translateX(0); }
  40% { transform: translateX(80px) scale(1.1); }
  60% { transform: translateX(80px) scale(1.1); }
  100% { transform: translateX(0); }
}

@keyframes containerLungeLeft {
  0% { transform: translateX(0); }
  40% { transform: translateX(-80px) scale(1.1); }
  60% { transform: translateX(-80px) scale(1.1); }
  100% { transform: translateX(0); }
}

/* Legacy fighters section (keeping for compatibility) */
.arena-fighters {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 60px;
  flex: 1;
  padding-bottom: 20px;
}

.fighter {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: rgba(10, 15, 20, 0.6);
  border-radius: var(--radius-lg);
  border: 2px solid rgba(91, 255, 178, 0.15);
  backdrop-filter: blur(8px);
  transition: all 0.3s;
}

.fighter.active {
  border-color: rgba(91, 255, 178, 0.6);
  box-shadow: 
    0 0 40px rgba(91, 255, 178, 0.3),
    inset 0 0 30px rgba(91, 255, 178, 0.05);
}

/* VS text in battle stage center */
.stage-vs {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.12);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  z-index: 1;
  letter-spacing: 4px;
  user-select: none;
}

/* Countdown in center of battle stage (like coinflip) */
.stage-countdown {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stage-countdown .battle-countdown-num {
  font-size: 72px;
  font-weight: 900;
  color: #5bffb2;
  text-shadow: 0 0 40px rgba(91, 255, 178, 0.6);
  animation: countdown-pop 1s ease-out;
}

.first-attacker-announce {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #f59e0b;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
  animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes countdown-pop {
  0% { transform: scale(1.5); opacity: 0; }
  40% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.9; }
}

/* Loading spinner for waiting phase */
.stage-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(91, 255, 178, 0.2);
  border-top-color: #5bffb2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.fighter-sprite {
  width: 140px;
  height: 140px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: 
    drop-shadow(0 8px 16px rgba(0, 0, 0, 0.8))
    drop-shadow(0 0 20px rgba(0, 0, 0, 0.5));
  image-rendering: pixelated;
  transition: all 0.3s;
  animation: spriteBreathe 3s ease-in-out infinite;
}

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

/* Knight sprites - idle state */
.fighter-sprite.creator {
  background-image: url('/static/img/barbarian/knight.idle.png');
  transform: scaleX(-1); /* Always face right */
  animation: spriteBreatheCreator 3s ease-in-out infinite;
}

@keyframes spriteBreatheCreator {
  0%, 100% { transform: scaleX(-1) translateY(0); }
  50% { transform: scaleX(-1) translateY(-4px); }
}

.fighter-sprite.opponent {
  background-image: url('/static/img/barbarian/knight.idle.png');
  transform: scaleX(1); /* Always face left */
  animation: spriteBreatheOpponent 3s ease-in-out infinite;
}

@keyframes spriteBreatheOpponent {
  0%, 100% { transform: scaleX(1) translateY(0); }
  50% { transform: scaleX(1) translateY(-4px); }
}

/* ============================================
   SPRITE STATES - Based on attack type
   Creator always keeps scaleX(-1) to face right
   ============================================ */

/* Idle state sprites (default) */
.fighter-sprite.creator.sprite-idle {
  background-image: url('/static/img/barbarian/knight.idle.png');
  transform: scaleX(-1); /* Keep facing right */
}

.fighter-sprite.opponent.sprite-idle {
  background-image: url('/static/img/barbarian/knight.idle.png');
}

/* Quick Strike sprites */
.fighter-sprite.creator.sprite-quick {
  background-image: url('/static/img/barbarian/knight.quick.png');
  transform: scaleX(-1); /* Keep facing right */
}

.fighter-sprite.opponent.sprite-quick {
  background-image: url('/static/img/barbarian/knight.quick.png');
}

/* Normal Attack sprites */
.fighter-sprite.creator.sprite-normal {
  background-image: url('/static/img/barbarian/knight.normal.png');
  transform: scaleX(-1); /* Keep facing right */
}

.fighter-sprite.opponent.sprite-normal {
  background-image: url('/static/img/barbarian/knight.normal.png');
}

/* Heavy Smash / Power Attack sprites */
.fighter-sprite.creator.sprite-hard {
  background-image: url('/static/img/barbarian/knight.power.png');
  transform: scaleX(-1); /* Keep facing right */
}

.fighter-sprite.opponent.sprite-hard {
  background-image: url('/static/img/barbarian/knight.power.png');
}

/* Hurt state sprites */
.fighter-sprite.creator.sprite-hurt {
  background-image: url('/static/img/barbarian/knight.hurt.png');
  transform: scaleX(-1); /* Keep facing right */
}

.fighter-sprite.opponent.sprite-hurt {
  background-image: url('/static/img/barbarian/knight.hurt.png');
}

/* Potion drinking state sprites */
.fighter-sprite.creator.sprite-potion {
  background-image: url('/static/img/barbarian/knight.potion.png');
  transform: scaleX(-1); /* Keep facing right */
}

.fighter-sprite.opponent.sprite-potion {
  background-image: url('/static/img/barbarian/knight.potion.png');
}

/* Attacking animation */
.fighter.attacking .fighter-sprite.creator {
  background-image: url('/static/img/barbarian/knight.normal.png');
  transform: scaleX(-1); /* Keep facing right */
}

.fighter.attacking .fighter-sprite.opponent {
  background-image: url('/static/img/barbarian/knight.normal.png');
}

/* Hurt animation */
.fighter.hurt .fighter-sprite.creator {
  background-image: url('/static/img/barbarian/knight.hurt.png');
  transform: scaleX(-1); /* Keep facing right */
  animation: hurtShake 0.6s ease;
}

.fighter.hurt .fighter-sprite.opponent {
  background-image: url('/static/img/barbarian/knight.hurt.png');
  animation: hurtShake 0.6s ease;
}

/* Lunge animations - creator lunges right (toward opponent) while staying mirrored */
@keyframes lungeRight {
  0% { transform: scaleX(-1) translateX(0); }
  35% { transform: scaleX(-1) translateX(80px) scale(1.1); }
  50% { transform: scaleX(-1) translateX(90px) scale(1.12); }
  100% { transform: scaleX(-1) translateX(0); }
}

@keyframes lungeLeft {
  0% { transform: scaleX(1) translateX(0); }
  35% { transform: scaleX(1) translateX(-80px) scale(1.1); }
  50% { transform: scaleX(1) translateX(-90px) scale(1.12); }
  100% { transform: scaleX(1) translateX(0); }
}

/* Power attack lunge - slower, more dramatic */
@keyframes powerLungeRight {
  0% { transform: scaleX(-1) translateX(0) scale(1); }
  20% { transform: scaleX(-1) translateX(-20px) scale(1.05); } /* Wind-up */
  50% { transform: scaleX(-1) translateX(100px) scale(1.2); } /* Power strike */
  60% { transform: scaleX(-1) translateX(110px) scale(1.25); }
  100% { transform: scaleX(-1) translateX(0) scale(1); }
}

@keyframes powerLungeLeft {
  0% { transform: scaleX(1) translateX(0) scale(1); }
  20% { transform: scaleX(1) translateX(20px) scale(1.05); } /* Wind-up */
  50% { transform: scaleX(1) translateX(-100px) scale(1.2); } /* Power strike */
  60% { transform: scaleX(1) translateX(-110px) scale(1.25); }
  100% { transform: scaleX(1) translateX(0) scale(1); }
}

/* Hurt shake for creator (keeps facing right) */
@keyframes hurtShakeCreator {
  0%, 100% { transform: scaleX(-1) translateX(0); filter: brightness(1); }
  10%, 30%, 50%, 70%, 90% { transform: scaleX(-1) translateX(-8px); filter: brightness(2) saturate(0); }
  20%, 40%, 60%, 80% { transform: scaleX(-1) translateX(8px); filter: brightness(1.5); }
}

/* Hurt shake for opponent (faces left) */
@keyframes hurtShakeOpponent {
  0%, 100% { transform: scaleX(1) translateX(0); filter: brightness(1); }
  10%, 30%, 50%, 70%, 90% { transform: scaleX(1) translateX(-8px); filter: brightness(2) saturate(0); }
  20%, 40%, 60%, 80% { transform: scaleX(1) translateX(8px); filter: brightness(1.5); }
}

/* General hurt shake (legacy) */
@keyframes hurtShake {
  0%, 100% { transform: translateX(0); filter: brightness(1); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); filter: brightness(2) saturate(0); }
  20%, 40%, 60%, 80% { transform: translateX(8px); filter: brightness(1.5); }
}

.fighter-info {
  text-align: center;
  width: 100%;
}

.fighter-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.you-tag {
  padding: 2px 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  color: #0a0d12;
  box-shadow: 0 2px 8px rgba(91, 255, 178, 0.5);
}

.fighter-hp-bar {
  width: 100%;
  height: 14px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid rgba(91, 255, 178, 0.2);
}

.hp-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
  box-shadow: 0 0 10px currentColor;
}

.fighter-hp-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.fighter-hp-text svg {
  width: 16px;
  height: 16px;
  color: var(--red);
}

.arena-vs {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vs-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  animation: vsGlow 2s ease-in-out infinite;
}

@keyframes vsGlow {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

.arena-vs span {
  position: relative;
  font-size: 28px;
  font-weight: 900;
  color: var(--primary);
  text-shadow: 0 0 20px var(--primary-glow);
}

/* Controls */
.arena-controls {
  text-align: center;
  margin-bottom: 24px;
}

.turn-indicator {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
}

.turn-indicator.your-turn {
  background: linear-gradient(135deg, var(--primary-dim), rgba(251, 191, 36, 0.15));
  color: var(--primary);
  border: 1px solid var(--primary);
}

.turn-pulse {
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse 1s ease-in-out infinite;
}

.turn-timer {
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 20px;
  font-size: 14px;
}

.turn-indicator.waiting {
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.waiting-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--text-muted);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Combat controls - attacks + potion side by side */
.combat-controls {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: stretch;
  margin-bottom: 16px;
}

.attack-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.attack-btn {
  flex: 1;
  max-width: 180px;
  padding: 16px 20px;
  background: rgba(10, 15, 20, 0.8);
  border: 2px solid rgba(91, 255, 178, 0.2);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}

.attack-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(91, 255, 178, 0.2), transparent);
  transition: left 0.4s;
}

.attack-btn:hover::before {
  left: 100%;
}

.attack-btn:hover {
  transform: translateY(-4px);
}

/* Quick Attack - Blue/Lightning */
.attack-btn.quick {
  --attack-color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.3);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(10, 15, 20, 0.9));
}

.attack-btn.quick:hover {
  border-color: var(--attack-color);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 30px rgba(59, 130, 246, 0.4);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(10, 15, 20, 0.9));
}

/* Normal Attack - Necro Green */
.attack-btn.normal {
  --attack-color: #5bffb2;
  border-color: rgba(91, 255, 178, 0.3);
  background: linear-gradient(135deg, rgba(91, 255, 178, 0.15), rgba(10, 15, 20, 0.9));
}

.attack-btn.normal:hover {
  border-color: var(--attack-color);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 30px rgba(91, 255, 178, 0.4);
  background: linear-gradient(135deg, rgba(91, 255, 178, 0.25), rgba(10, 15, 20, 0.9));
}

/* Heavy Attack - Red/Fire */
.attack-btn.hard {
  --attack-color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(10, 15, 20, 0.9));
}

.attack-btn.hard:hover {
  border-color: var(--attack-color);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 30px rgba(239, 68, 68, 0.4);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(10, 15, 20, 0.9));
}

.attack-icon {
  font-size: 32px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.attack-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.attack-stats {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 10px;
  color: var(--text-muted);
}

.keyboard-hints {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================
   POTION SECTION
   ============================================ */
.potion-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 20px;
  min-width: 100px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(10, 15, 20, 0.9));
  border: 2px solid rgba(34, 197, 94, 0.4);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.potion-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.3), transparent);
  transition: left 0.4s;
}

.potion-btn:not(.used):hover::before {
  left: 100%;
}

.potion-btn:not(.used):hover {
  transform: translateY(-4px);
  border-color: #22c55e;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 
              0 0 30px rgba(34, 197, 94, 0.5),
              inset 0 0 20px rgba(34, 197, 94, 0.1);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.3), rgba(10, 15, 20, 0.9));
}

.potion-btn:not(.used):active {
  transform: translateY(-2px) scale(0.98);
}

.potion-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(34, 197, 94, 0.5));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.potion-btn:not(.used):hover .potion-img {
  transform: scale(1.1) rotate(-5deg);
  filter: drop-shadow(0 6px 12px rgba(34, 197, 94, 0.7));
}

.potion-icon-fallback {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #22c55e;
}

.potion-icon-fallback svg {
  width: 100%;
  height: 100%;
}

.potion-label {
  font-size: 12px;
  font-weight: 700;
  color: #22c55e;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Used potion state */
.potion-btn.used {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: rgba(100, 100, 100, 0.3);
  background: linear-gradient(135deg, rgba(50, 50, 50, 0.3), rgba(10, 15, 20, 0.9));
}

.potion-btn.used .potion-img {
  filter: grayscale(100%) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.potion-btn.used .potion-label {
  color: var(--text-muted);
  text-decoration: line-through;
}

/* Heal animation effect when potion is used */
@keyframes healPulse {
  0%, 100% { 
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
  }
  50% { 
    box-shadow: 0 0 30px 10px rgba(34, 197, 94, 0.6);
  }
}

.potion-heal-effect {
  animation: healPulse 0.5s ease-out 2;
}

.keyboard-hints kbd {
  padding: 3px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  margin: 0 2px;
}

.spectator-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 14px;
  color: var(--text-muted);
}

.spectator-badge svg {
  width: 18px;
  height: 18px;
}

/* Countdown */
.countdown-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.countdown-ring {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, var(--primary-dim), rgba(251, 191, 36, 0.15));
  border: 3px solid var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: countdownPulse 1s ease-in-out infinite;
}

@keyframes countdownPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.countdown-number {
  font-size: 48px;
  font-weight: 900;
  color: var(--primary);
}

.countdown-text {
  font-size: 16px;
  color: var(--text-muted);
}

/* Result Banner */
.result-banner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 12, 0.95);
  z-index: 20;
}

.result-banner.victory {
  background: radial-gradient(circle at center, rgba(79, 255, 176, 0.1) 0%, rgba(6, 8, 12, 0.95) 70%);
}

.result-banner.defeat {
  background: radial-gradient(circle at center, rgba(255, 107, 107, 0.1) 0%, rgba(6, 8, 12, 0.95) 70%);
}

.result-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  animation: resultBounce 0.6s ease-out;
}

.result-icon svg {
  width: 100%;
  height: 100%;
}

.result-banner.victory .result-icon {
  color: var(--gold);
}

.result-banner.defeat .result-icon {
  color: var(--red);
}

.result-banner.neutral .result-icon {
  color: var(--accent);
}

@keyframes resultBounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.result-text {
  font-size: 48px;
  font-weight: 900;
  margin-bottom: 16px;
}

.result-banner.victory .result-text {
  color: var(--green);
  text-shadow: 0 0 40px rgba(79, 255, 176, 0.5);
}

.result-banner.defeat .result-text {
  color: var(--red);
  text-shadow: 0 0 40px rgba(255, 107, 107, 0.5);
}

.result-banner.neutral .result-text {
  color: var(--text);
}

.result-prize {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 32px;
}

.result-close-btn {
  padding: 14px 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.result-close-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Battle Log */
.battle-log {
  background: var(--bg-darker);
  border-radius: var(--radius-md);
  overflow: hidden;
  max-height: 150px;
}

.log-header {
  padding: 10px 16px;
  background: var(--bg-input);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.log-entries {
  padding: 12px 16px;
  max-height: 100px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-entry {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.log-entry.system {
  color: var(--blue);
}

.log-entry.attack {
  color: var(--primary);
}

.log-entry.heal {
  color: #22c55e;
}

/* ============================================
   CHAT PLACEHOLDER
   ============================================ */
.chat-placeholder {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.chat-body {
  padding: 40px 20px;
}

.chat-coming-soon {
  text-align: center;
  color: var(--text-muted);
}

.chat-coming-soon span {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
}

/* ============================================
   RULES MODAL - COINFLIP STYLE
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.rules-modal {
  position: relative;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  background: linear-gradient(180deg, rgba(16, 22, 18, 0.98) 0%, rgba(10, 14, 12, 0.99) 100%);
  border-radius: 20px;
  border: 1px solid rgba(91, 255, 178, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 
    0 30px 80px rgba(0, 0, 0, 0.7),
    0 0 60px rgba(91, 255, 178, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  backdrop-filter: blur(8px);
}

.modal-close svg {
  width: 20px;
  height: 20px;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
  transform: rotate(90deg);
}

.rules-header {
  padding: 36px 36px 28px;
  text-align: center;
  background: linear-gradient(180deg, rgba(91, 255, 178, 0.1) 0%, transparent 100%);
  border-bottom: 1px solid rgba(91, 255, 178, 0.1);
}

.rules-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--primary) 0%, #22c55e 100%);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 12px 40px rgba(91, 255, 178, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.rules-icon svg {
  width: 36px;
  height: 36px;
  color: #0a0d12;
}

.rules-header h2 {
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), #a0ffcc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.rules-header p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.5;
}

.rules-content {
  padding: 28px 36px 36px;
  overflow-y: auto;
}

.rules-section {
  margin-bottom: 28px;
}

.rules-section h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.rules-section h3::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 2px;
}

.rules-section ol,
.rules-section ul {
  padding-left: 24px;
}

.rules-section li {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.6;
}

.rules-section li strong {
  color: var(--primary);
  font-weight: 600;
}

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

.rules-section .attack-card {
  background: rgba(91, 255, 178, 0.05);
  border-radius: 14px;
  padding: 18px;
  border: 1px solid rgba(91, 255, 178, 0.1);
  transition: all 0.2s ease;
}

.rules-section .attack-card:hover {
  border-color: rgba(91, 255, 178, 0.3);
  background: rgba(91, 255, 178, 0.08);
  transform: translateY(-2px);
}

.rules-section .attack-card.quick {
  border-color: rgba(59, 130, 246, 0.3);
}

.rules-section .attack-card.normal {
  border-color: rgba(245, 158, 11, 0.3);
}

.rules-section .attack-card.hard {
  border-color: rgba(239, 68, 68, 0.3);
}

.rules-section .attack-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.rules-section .attack-header .icon {
  font-size: 18px;
}

.rules-section .attack-header .name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.rules-section .attack-body {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.rules-section .attack-desc {
  font-size: 10px;
  color: var(--text-muted);
  font-style: italic;
}

.rules-tip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--primary-dim);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-secondary);
}

.rules-tip .tip-icon {
  width: 20px;
  height: 20px;
  color: var(--primary);
  flex-shrink: 0;
}

.rules-tip .tip-icon svg {
  width: 100%;
  height: 100%;
}

.rules-tip strong {
  color: var(--primary);
}

/* Section icons in h3 headers */
.rules-section h3 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  color: var(--primary);
}

.section-icon svg {
  width: 100%;
  height: 100%;
}

/* ============================================
   RULES MODAL V2 - REDESIGNED
   ============================================ */
.rules-modal-v2 {
  position: relative;
  width: 100%;
  max-width: 700px;
  max-height: 85vh;
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-card) 100%);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(91, 255, 178, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

.modal-close-btn svg {
  width: 20px;
  height: 20px;
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ef4444;
  transform: rotate(90deg);
}

/* Header */
.rules-header-v2 {
  padding: 32px 32px 24px;
  text-align: center;
  background: linear-gradient(180deg, rgba(91, 255, 178, 0.08) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
}

.rules-title-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--primary) 0%, #22c55e 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(91, 255, 178, 0.3);
}

.rules-title-icon svg {
  width: 32px;
  height: 32px;
  color: #0a0d12;
}

.rules-header-v2 h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.rules-header-v2 p {
  font-size: 15px;
  color: var(--text-muted);
}

/* Tabs */
.rules-tabs {
  display: flex;
  padding: 0 24px;
  background: var(--bg-darker);
  border-bottom: 1px solid var(--border);
  gap: 4px;
}

.rules-tab {
  flex: 1;
  padding: 14px 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  margin-bottom: -1px;
}

.rules-tab svg {
  width: 16px;
  height: 16px;
}

.rules-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.rules-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(91, 255, 178, 0.05);
}

/* Body */
.rules-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.rules-tab-content {
  animation: tabFadeIn 0.2s ease-out;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.rules-intro {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  text-align: center;
}

/* Cards */
.rules-card {
  background: var(--bg-input);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.rules-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.rules-card-number {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), #22c55e);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #0a0d12;
  flex-shrink: 0;
}

.rules-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.rules-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Info Box */
.rules-info-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.rules-info-box .info-icon {
  width: 48px;
  height: 48px;
  background: rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3b82f6;
  flex-shrink: 0;
}

.rules-info-box .info-icon svg {
  width: 24px;
  height: 24px;
}

.rules-info-box .info-content strong {
  display: block;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 4px;
}

.rules-info-box .info-content span {
  font-size: 13px;
  color: var(--text-muted);
}

/* Combat Moves Grid */
.combat-moves-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.combat-move-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-input);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  transition: all 0.2s;
}

.combat-move-card:hover {
  transform: translateX(4px);
}

.combat-move-card.quick {
  border-color: rgba(59, 130, 246, 0.4);
}

.combat-move-card.quick:hover {
  background: rgba(59, 130, 246, 0.08);
}

.combat-move-card.normal {
  border-color: rgba(91, 255, 178, 0.4);
}

.combat-move-card.normal:hover {
  background: rgba(91, 255, 178, 0.08);
}

.combat-move-card.hard {
  border-color: rgba(239, 68, 68, 0.4);
}

.combat-move-card.hard:hover {
  background: rgba(239, 68, 68, 0.08);
}

.combat-move-card .move-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.combat-move-card .move-icon svg {
  width: 32px;
  height: 32px;
}

.combat-move-card.quick .move-icon { color: #3b82f6; }
.combat-move-card.normal .move-icon { color: var(--primary); }
.combat-move-card.hard .move-icon { color: #ef4444; }

.combat-move-card .move-details {
  flex: 1;
}

.combat-move-card .move-details h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.combat-move-card .move-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 6px;
}

.combat-move-card .move-stats .stat {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.combat-move-card .move-stats .stat.hit {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.combat-move-card .move-stats .stat.dmg {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.combat-move-card .move-details p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Tip Box */
.rules-tip-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 14px 18px;
  background: rgba(251, 191, 36, 0.1);
  border-radius: var(--radius-md);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.rules-tip-box .tip-badge {
  font-size: 14px;
  flex-shrink: 0;
}

.rules-tip-box p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.rules-tip-box kbd {
  display: inline-block;
  padding: 3px 8px;
  background: var(--bg-darker);
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--primary);
  margin: 0 2px;
}

/* Item Showcase */
.item-showcase {
  margin-bottom: 20px;
}

.item-card {
  display: flex;
  gap: 24px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(10, 15, 20, 0.9));
  border-radius: var(--radius-lg);
  border: 2px solid rgba(34, 197, 94, 0.4);
}

.item-card .item-image {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-card .item-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(34, 197, 94, 0.4));
}

.item-card .item-info h4 {
  font-size: 20px;
  font-weight: 700;
  color: #22c55e;
  margin-bottom: 8px;
}

.item-card .item-effect {
  margin-bottom: 12px;
}

.item-card .effect-value {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-md);
  font-size: 18px;
  font-weight: 800;
  color: #22c55e;
}

.item-card .item-rules {
  list-style: none;
  padding: 0;
  margin: 0;
}

.item-card .item-rules li {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding-left: 20px;
  position: relative;
}

.item-card .item-rules li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #22c55e;
  font-weight: 700;
}

.item-card .item-rules li strong {
  color: var(--text);
}

.item-card .item-rules kbd {
  display: inline-block;
  padding: 2px 6px;
  background: var(--bg-darker);
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--primary);
}

/* Strategy Box */
.rules-strategy-box {
  background: var(--bg-input);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
}

.rules-strategy-box h5 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

.rules-strategy-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rules-strategy-box li {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding-left: 20px;
  position: relative;
}

.rules-strategy-box li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--primary);
}

/* Rewards */
.rewards-showcase {
  text-align: center;
  margin-bottom: 24px;
}

.reward-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 40px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(10, 15, 20, 0.9));
  border-radius: var(--radius-lg);
  border: 2px solid rgba(251, 191, 36, 0.4);
}

.reward-card .reward-icon {
  width: 60px;
  height: 60px;
  color: #fbbf24;
}

.reward-card .reward-icon svg {
  width: 100%;
  height: 100%;
}

.reward-card h4 {
  font-size: 20px;
  font-weight: 800;
  color: #fbbf24;
}

.reward-card p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Prize Breakdown */
.prize-breakdown {
  background: var(--bg-input);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.prize-breakdown h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  text-align: center;
}

.prize-formula {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.formula-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-darker);
  border-radius: var(--radius-md);
  font-size: 13px;
}

.formula-row .label {
  color: var(--text-secondary);
}

.formula-row .value {
  color: var(--text);
  font-weight: 600;
}

.formula-row.fee {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.formula-row.fee .value {
  color: #ef4444;
}

.formula-row.final {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(91, 255, 178, 0.1));
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.formula-row.final .label,
.formula-row.final .value {
  color: #22c55e;
  font-weight: 700;
}

/* Example Box */
.example-box {
  background: rgba(59, 130, 246, 0.08);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.example-box h5 {
  font-size: 14px;
  font-weight: 700;
  color: #3b82f6;
  margin-bottom: 12px;
}

.example-box p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.example-box strong {
  color: var(--text);
}

/* Warning Box */
.rules-warning-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  background: rgba(251, 191, 36, 0.1);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.rules-warning-box .warning-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.rules-warning-box strong {
  display: block;
  font-size: 14px;
  color: #fbbf24;
  margin-bottom: 4px;
}

.rules-warning-box p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

/* Footer */
.rules-footer {
  padding: 20px 24px;
  background: var(--bg-darker);
  border-top: 1px solid var(--border);
  text-align: center;
}

.rules-close-btn {
  padding: 14px 40px;
  background: linear-gradient(135deg, var(--primary), #22c55e);
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  color: #0a0d12;
  cursor: pointer;
  transition: all 0.2s;
}

.rules-close-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(91, 255, 178, 0.4);
}

/* Responsive Rules Modal */
@media (max-width: 600px) {
  .rules-modal-v2 {
    max-height: 95vh;
    border-radius: var(--radius-lg);
  }
  
  .rules-header-v2 {
    padding: 24px 20px 20px;
  }
  
  .rules-header-v2 h2 {
    font-size: 22px;
  }
  
  .rules-tabs {
    padding: 0 12px;
    overflow-x: auto;
  }
  
  .rules-tab {
    padding: 12px 10px;
    font-size: 12px;
    white-space: nowrap;
  }
  
  .rules-body {
    padding: 16px;
  }
  
  .item-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .item-card .item-rules li {
    text-align: left;
  }
  
  .combat-move-card {
    flex-direction: column;
    text-align: center;
  }
  
  .combat-move-card .move-stats {
    justify-content: center;
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
  .barbarian-layout {
    grid-template-columns: 280px 1fr;
  }
  
  .sidebar:last-child {
    display: none;
  }
}

@media (max-width: 900px) {
  .barbarian-layout {
    grid-template-columns: 1fr;
  }
  
  .barbarian-main {
    padding: 16px;
    padding-top: 80px;
  }
  
  .arena-fighters {
    flex-direction: column;
    gap: 20px;
  }
  
  .arena-vs {
    transform: rotate(90deg);
  }
  
  .attack-buttons {
    flex-direction: column;
  }
  
  .attack-btn {
    max-width: 100%;
  }
  
  .attack-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .battle-arena {
    padding: 20px;
  }
  
  .fighter-sprite {
    width: 80px;
    height: 80px;
  }
  
  .result-text {
    font-size: 32px;
  }
  
  .potion-btn {
    padding: 10px 18px;
  }
  
  .potion-img {
    width: 36px;
    height: 36px;
  }
  
  .potion-label {
    font-size: 10px;
  }
}

/* ============================================
   DICE ROLL ANIMATION
   ============================================ */
.dice-roll-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px;
}

.dice-container {
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.dice-container.rolling {
  border-color: var(--primary);
  box-shadow: 0 0 30px rgba(91, 255, 178, 0.3);
  animation: containerPulse 0.5s ease-in-out infinite alternate;
}

@keyframes containerPulse {
  from { transform: scale(1); box-shadow: 0 0 20px rgba(91, 255, 178, 0.2); }
  to { transform: scale(1.05); box-shadow: 0 0 40px rgba(91, 255, 178, 0.5); }
}

.dice-container.rolling .dice {
  animation: diceRoll 0.3s ease-in-out infinite;
}

.dice-container.stopped {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.dice {
  width: 56px;
  height: 56px;
  color: var(--primary);
  filter: drop-shadow(0 0 20px rgba(91, 255, 178, 0.5));
}

.dice svg {
  width: 100%;
  height: 100%;
}

@keyframes diceRoll {
  0%, 100% { 
    transform: rotate(-20deg) scale(1);
  }
  25% { 
    transform: rotate(20deg) scale(1.1);
  }
  50% { 
    transform: rotate(-15deg) scale(0.95);
  }
  75% { 
    transform: rotate(15deg) scale(1.05);
  }
}

.dice-text {
  font-size: 18px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
  animation: pulse 1.5s ease-in-out infinite;
}

.dice-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: fadeInUp 0.5s ease-out;
}

.dice-winner {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  text-shadow: 0 0 20px var(--primary-glow);
  animation: winnerPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes winnerPop {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Turn timer urgency colors */
.turn-timer {
  transition: color 0.3s ease, background 0.3s ease;
}

.turn-indicator .turn-timer {
  font-size: 18px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  margin-left: 12px;
}

/* Add urgency effect when timer is low */
.turn-indicator.your-turn .turn-timer {
  color: var(--primary);
}

.turn-timer.warning {
  color: var(--gold) !important;
  background: rgba(251, 191, 36, 0.15);
}

.turn-timer.critical {
  color: var(--red) !important;
  background: rgba(239, 68, 68, 0.2);
  animation: timerPulse 0.5s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

@keyframes timerPulse {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% { 
    transform: scale(1.05);
    box-shadow: 0 0 15px 2px rgba(239, 68, 68, 0.3);
  }
}

.turn-indicator.urgent {
  animation: urgentGlow 0.5s ease-in-out infinite;
}

@keyframes urgentGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.5);
  }
}

/* ============================================
   COMBAT ANIMATIONS
   ============================================ */

/* Fighter sprite container for positioning effects */
.fighter-sprite-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Shake animation when taking damage - separate for creator (mirrored) and opponent */
.fighter-sprite.creator.shake {
  animation: damageShakeCreator 0.5s cubic-bezier(.36,.07,.19,.97) both;
  filter: drop-shadow(0 0 15px rgba(239, 68, 68, 0.8)) brightness(1.5) sepia(1) hue-rotate(-50deg) saturate(5);
}

.fighter-sprite.opponent.shake {
  animation: damageShakeOpponent 0.5s cubic-bezier(.36,.07,.19,.97) both;
  filter: drop-shadow(0 0 15px rgba(239, 68, 68, 0.8)) brightness(1.5) sepia(1) hue-rotate(-50deg) saturate(5);
}

/* Creator shake maintains scaleX(-1) to keep facing right */
@keyframes damageShakeCreator {
  0%, 100% { transform: scaleX(-1) translate3d(0, 0, 0); }
  10%, 90% { transform: scaleX(-1) translate3d(-2px, 0, 0); }
  20%, 80% { transform: scaleX(-1) translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: scaleX(-1) translate3d(-8px, 0, 0); }
  40%, 60% { transform: scaleX(-1) translate3d(8px, 0, 0); }
}

/* Opponent shake maintains scaleX(1) to keep facing left */
@keyframes damageShakeOpponent {
  0%, 100% { transform: scaleX(1) translate3d(0, 0, 0); }
  10%, 90% { transform: scaleX(1) translate3d(-2px, 0, 0); }
  20%, 80% { transform: scaleX(1) translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: scaleX(1) translate3d(-8px, 0, 0); }
  40%, 60% { transform: scaleX(1) translate3d(8px, 0, 0); }
}

/* Fighter taking damage visual feedback */
.fighter.taking-damage {
  animation: damageFlash 0.3s ease-out;
}

@keyframes damageFlash {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.5) saturate(0.5); }
}

/* ============================================
   FLOATING DAMAGE TEXT
   ============================================ */
.floating-damage {
  position: absolute;
  top: -20px;
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 900;
  text-shadow: 
    3px 3px 0 #000,
    -1px -1px 0 #000,
    0 0 20px currentColor;
  animation: floatUp 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  pointer-events: none;
  z-index: 100;
  letter-spacing: -1px;
}

.floating-damage.left {
  left: 50%;
  transform: translateX(-50%);
}

.floating-damage.right {
  left: 50%;
  transform: translateX(-50%);
}

.floating-damage.hit {
  color: #ef4444;
  background: linear-gradient(180deg, #ff6b6b 0%, #ef4444 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.5));
}

.floating-damage.crit {
  font-size: 56px;
  color: #fbbf24;
  background: linear-gradient(180deg, #fcd34d 0%, #fbbf24 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.8));
  animation: critFloat 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes critFloat {
  0% { opacity: 0; transform: translate(-50%, 20px) scale(0.5); }
  20% { opacity: 1; transform: translate(-50%, -20px) scale(1.5); }
  100% { opacity: 0; transform: translate(-50%, -100px) scale(1); }
}

.floating-damage.miss {
  color: #9ca3af;
  font-size: 32px;
  -webkit-text-fill-color: #9ca3af;
}

.floating-damage.heal {
  color: #22c55e;
  background: linear-gradient(180deg, #4ade80 0%, #22c55e 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 15px rgba(34, 197, 94, 0.6));
}

@keyframes float-up {
  0% { transform: translate(-50%, 0) scale(0.5); opacity: 0; }
  20% { transform: translate(-50%, -40px) scale(1.5); opacity: 1; }
  100% { transform: translate(-50%, -120px) scale(1); opacity: 0; }
}

/* ============================================
   BLOOD SPLATTER EFFECT
   ============================================ */
.blood-splatter {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

.blood-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--size);
  height: var(--size);
  background: radial-gradient(circle, #dc2626 0%, #7f1d1d 70%, transparent 100%);
  border-radius: 50%;
  animation: bloodSplat var(--duration) ease-out var(--delay) forwards;
  opacity: 0;
}

@keyframes bloodSplat {
  0% {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(0);
  }
  30% {
    opacity: 0.8;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x) * 1.5), calc(-50% + var(--y) * 1.5 + 30px)) scale(0.5);
  }
}

/* Blood drip effect */
.blood-splatter::after {
  content: '';
  position: absolute;
  top: 60%;
  left: 50%;
  width: 3px;
  height: 0;
  background: linear-gradient(to bottom, #dc2626, transparent);
  animation: bloodDrip 1s ease-in 0.3s forwards;
  border-radius: 50%;
}

@keyframes bloodDrip {
  0% {
    height: 0;
    opacity: 0.8;
  }
  70% {
    height: 40px;
    opacity: 0.6;
  }
  100% {
    height: 50px;
    opacity: 0;
  }
}

/* ============================================
   ATTACK BUTTON ICONS
   ============================================ */
.attack-btn .attack-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.attack-btn .attack-icon svg {
  width: 100%;
  height: 100%;
}

.attack-btn.quick .attack-icon {
  color: var(--blue);
}

.attack-btn.normal .attack-icon {
  color: var(--gold);
}

.attack-btn.hard .attack-icon {
  color: var(--red);
}

/* Hover effects for attack icons */
.attack-btn:hover .attack-icon svg {
  filter: drop-shadow(0 0 8px currentColor);
  transform: scale(1.1);
  transition: all 0.2s ease;
}

/* ============================================
   RESUME BATTLE BUTTON
   ============================================ */
.battle-actions {
  display: flex;
  gap: 8px;
  width: 100%;
}

.resume-btn {
  flex: 1;
  animation: resumePulse 2s ease-in-out infinite;
}

@keyframes resumePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(91, 255, 178, 0.4);
  }
  50% {
    box-shadow: 0 0 20px 4px rgba(91, 255, 178, 0.3);
  }
}

.resume-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: resumeShine 2s ease-in-out infinite;
}

@keyframes resumeShine {
  0% { left: -100%; }
  50%, 100% { left: 100%; }
}

/* ============================================
   DAILY REWARDS MODAL
   ============================================ */
.daily-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.daily-modal-v2 {
  position: relative;
  background: linear-gradient(180deg, #12161c 0%, #0a0d12 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 
    0 32px 64px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  animation: dailyModalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dailyModalSlideIn {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Background Orbs */
.daily-modal-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.daily-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
}

.daily-bg-orb.orb-1 {
  width: 200px;
  height: 200px;
  background: #4fffb0;
  top: -60px;
  right: -60px;
}

.daily-bg-orb.orb-2 {
  width: 160px;
  height: 160px;
  background: #ffd700;
  bottom: -40px;
  left: -40px;
}

/* Close Button */
.daily-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.daily-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text, #fff);
}

.daily-close-btn svg {
  width: 18px;
  height: 18px;
}

/* Content */
.daily-modal-content {
  position: relative;
  padding: 32px 28px;
  overflow-y: auto;
  max-height: 90vh;
}

/* Loading */
.daily-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px 0;
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
}

.daily-spinner {
  width: 48px;
  height: 48px;
  animation: spin 1s linear infinite;
}

.daily-spinner svg {
  width: 100%;
  height: 100%;
  color: var(--green, #4fffb0);
}

/* Login Prompt */
.daily-login-prompt {
  text-align: center;
  padding: 60px 20px;
}

.login-prompt-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
}

.login-prompt-icon svg {
  width: 36px;
  height: 36px;
}

.daily-login-prompt h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text, #fff);
  margin: 0 0 8px;
}

.daily-login-prompt p {
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
  margin: 0 0 28px;
}

.daily-login-btn {
  padding: 14px 36px;
  background: var(--green, #4fffb0);
  color: #000;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.daily-login-btn:hover {
  background: #6aff9f;
  transform: translateY(-2px);
}

/* Hero Section */
.daily-hero {
  text-align: center;
  margin-bottom: 28px;
}

.daily-hero-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  box-shadow: 0 12px 40px rgba(79, 255, 176, 0.35);
  animation: heroIconFloat 3s ease-in-out infinite;
}

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

.daily-hero-icon svg {
  width: 40px;
  height: 40px;
}

.daily-hero-streak {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.15), rgba(255, 165, 0, 0.1));
  border: 1px solid rgba(255, 165, 0, 0.25);
  border-radius: 24px;
  margin-bottom: 16px;
}

.streak-flame-icon {
  width: 20px;
  height: 20px;
  color: #ff6b35;
  animation: flamePulse 1s ease-in-out infinite alternate;
}

@keyframes flamePulse {
  0% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(1.15); opacity: 1; }
}

.streak-flame-icon svg {
  width: 100%;
  height: 100%;
}

.streak-count {
  font-size: 20px;
  font-weight: 900;
  color: #ffa500;
}

.streak-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.daily-hero-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text, #fff);
  margin: 0 0 8px;
}

.daily-hero-subtitle {
  font-size: 14px;
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
  margin: 0;
}

/* Reward Box */
.daily-reward-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  margin-bottom: 24px;
  transition: all 0.3s ease;
}

.daily-reward-box:not(.claimed) {
  border-color: rgba(var(--reward-color), 0.3);
  box-shadow: 0 0 30px rgba(var(--reward-color), 0.1);
}

.daily-reward-box.claimed {
  opacity: 0.6;
}

.reward-box-badge {
  position: absolute;
  top: -10px;
  left: 16px;
  padding: 4px 12px;
  background: var(--green, #4fffb0);
  color: #000;
  font-size: 11px;
  font-weight: 800;
  border-radius: 8px;
  text-transform: uppercase;
}

.reward-box-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
}

.reward-box-icon svg {
  width: 28px;
  height: 28px;
}

.reward-box-info {
  flex: 1;
  min-width: 0;
}

.reward-box-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text, #fff);
  margin: 0 0 4px;
}

.reward-box-desc {
  font-size: 13px;
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
  margin: 0;
  line-height: 1.4;
}

.reward-box-check {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: var(--green, #4fffb0);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
}

.reward-box-check svg {
  width: 18px;
  height: 18px;
}

/* Timeline */
.daily-timeline {
  margin-bottom: 24px;
}

.timeline-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.timeline-track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
}

.timeline-track::-webkit-scrollbar {
  height: 4px;
}

.timeline-track::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

.timeline-track::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.timeline-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 52px;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.timeline-day.past {
  opacity: 0.4;
}

.timeline-day.current {
  background: rgba(79, 255, 176, 0.08);
  border-color: rgba(79, 255, 176, 0.3);
  transform: scale(1.05);
}

.timeline-day.future {
  opacity: 0.6;
}

.timeline-day-num {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
  text-transform: uppercase;
}

.timeline-day.current .timeline-day-num {
  color: var(--green, #4fffb0);
}

.timeline-day-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-day-icon svg {
  width: 18px;
  height: 18px;
}

.timeline-check {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  background: var(--green, #4fffb0);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
}

.timeline-check svg {
  width: 12px;
  height: 12px;
}

/* Bonuses Section */
.daily-bonuses-section {
  align-items: center;
  justify-content: center;
  color: #000;
}

.timeline-check svg {
  width: 12px;
  height: 12px;
}

/* Bonuses Section */
.daily-bonuses-section {
  margin-bottom: 24px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}

.bonuses-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

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

.power-up-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.power-up-chip svg {
  width: 14px;
  height: 14px;
}

.power-up-chip.xp {
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.25);
  color: #ffd700;
}

.power-up-chip.cf {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #3b82f6;
}

.power-up-chip.bd {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ef4444;
}

.power-up-chip.jp {
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.25);
  color: #a855f7;
}

/* Action */
.daily-action {
  margin-top: 8px;
}

.daily-claim-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  background: var(--btn-gradient, linear-gradient(135deg, #4fffb0, #2dd490));
  color: #000;
  font-size: 16px;
  font-weight: 800;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(79, 255, 176, 0.35);
}

.daily-claim-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(79, 255, 176, 0.45);
}

.daily-claim-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.daily-claim-button.loading {
  background: rgba(79, 255, 176, 0.4);
}

.daily-claim-button svg {
  width: 20px;
  height: 20px;
}

.btn-spinner {
  animation: spin 1s linear infinite;
}

.daily-claimed-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
  font-size: 14px;
}

.daily-claimed-notice svg {
  width: 18px;
  height: 18px;
  color: var(--green, #4fffb0);
}

.daily-claimed-notice strong {
  color: var(--green, #4fffb0);
}

.daily-error {
  margin-top: 12px;
  padding: 12px;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.2);
  border-radius: 10px;
  color: #ff6b6b;
  text-align: center;
  font-size: 13px;
}

/* Confetti */
.daily-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 100;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  top: -20px;
  border-radius: 2px;
  animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(500px) rotate(720deg) scale(0.5);
    opacity: 0;
  }
}

/* Responsive */
@media (max-width: 480px) {
  .daily-modal-v2 {
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 95vh;
  }
  
  .daily-modal-content {
    padding: 24px 20px;
  }
  
  .daily-hero-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
  }
  
  .daily-hero-icon svg {
    width: 32px;
    height: 32px;
  }
  
  .daily-hero-title {
    font-size: 22px;
  }
  
  .timeline-day {
    min-width: 46px;
    padding: 8px 6px;
  }
}

/* ============================================
   AVATAR COMPONENT - With PNG Border Frames
   ============================================ */
.cf-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-weight: 700;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  isolation: isolate; /* For PNG overlay z-index */
  overflow: visible; /* Allow border frame to extend beyond */
}

.cf-avatar--xs { width: 24px; height: 24px; font-size: 10px; border-radius: 6px; }
.cf-avatar--sm { width: 40px; height: 40px; font-size: 12px; border-radius: 8px; }
.cf-avatar--md { width: 48px; height: 48px; font-size: 14px; }
.cf-avatar--lg { width: 56px; height: 56px; font-size: 16px; }
.cf-avatar--xl { width: 68px; height: 68px; font-size: 18px; }

.cf-avatar__initials {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  z-index: 1;
  position: relative;
}

/* Level badge on avatar */
.cf-avatar__level {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #1a1a2e, #0f0f1a);
  color: #ffd700;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 215, 0, 0.4);
  z-index: 15;
  font-family: 'JetBrains Mono', monospace;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

/* Size-specific level badge adjustments */
.cf-avatar--xs .cf-avatar__level {
  font-size: 7px;
  padding: 1px 4px;
  bottom: -4px;
}

.cf-avatar--sm .cf-avatar__level {
  font-size: 8px;
  padding: 2px 5px;
  bottom: -5px;
}

.cf-avatar--lg .cf-avatar__level,
.cf-avatar--xl .cf-avatar__level {
  font-size: 10px;
  padding: 2px 7px;
  bottom: -8px;
}

/* PNG Border Frame Image Element */
.cf-avatar__frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 10;
  object-fit: contain;
}

/* Add glow effect based on tier class */
.cf-avatar.avatar-bronze .cf-avatar__frame {
  filter: drop-shadow(0 0 8px rgba(205, 127, 50, 0.6));
}
.cf-avatar.avatar-silver .cf-avatar__frame {
  filter: drop-shadow(0 0 10px rgba(192, 192, 192, 0.7));
}
.cf-avatar.avatar-gold .cf-avatar__frame {
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.8));
}
.cf-avatar.avatar-gold-elite .cf-avatar__frame,
.cf-avatar.avatar-platinum .cf-avatar__frame {
  filter: drop-shadow(0 0 15px rgba(220, 20, 60, 0.9));
}
