/* ============ EL BRUTO - Dark Gaming Theme ============ */
:root {
  --bg-dark: #0a0a0f;
  --bg-card: #12121a;
  --bg-card2: #1a1a28;
  --bg-card3: #0f0f1a;
  --border: #2a2a3a;
  --gold: #ffd700;
  --gold-dim: #b8960f;
  --red: #ff4444;
  --red-dim: #cc2222;
  --green: #44ff66;
  --green-dim: #22cc44;
  --blue: #4488ff;
  --purple: #aa44ff;
  --text-bright: #eeeef2;
  --text: #c8c8d4;
  --text-dim: #777790;
  --hp-green: #44ff66;
  --hp-yellow: #ffcc00;
  --hp-red: #ff4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0,0,0,0.5);
}

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

html, body {
  min-height: 100%; width: 100%;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

body {
  background-image: 
    radial-gradient(ellipse at 20% 50%, rgba(60,20,80,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(20,40,80,0.12) 0%, transparent 50%);
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  overflow-y: auto;
  padding-bottom: 40px;
}

/* ============ LOADING SCREEN ============ */
#loading-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; text-align: center;
}
.loading-content { animation: fadeIn 0.5s ease; }
.logo-big { font-size: 80px; animation: pulse 2s infinite; filter: drop-shadow(0 0 20px rgba(255,215,0,0.3)); }
.game-title {
  font-size: 42px; font-weight: 900; letter-spacing: 4px;
  background: linear-gradient(135deg, var(--gold), #fff, var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; text-shadow: none;
  margin-top: 8px;
}
.game-subtitle { color: var(--text-dim); font-size: 14px; letter-spacing: 6px; text-transform: uppercase; margin-top: 4px; }
.loading-bar {
  width: 200px; height: 4px; background: var(--bg-card2);
  border-radius: 2px; margin: 24px auto 0; overflow: hidden;
}
.loading-fill {
  height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-dim));
  animation: loadingFill 1.4s ease forwards;
}

/* ============ SCREEN ============ */
.screen { padding: 16px; animation: fadeIn 0.3s ease; }
.screen.active { display: block; }

/* ============ HEADER ============ */
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.header-back {
  background: none; border: 1px solid var(--border); color: var(--text);
  width: 36px; height: 36px; border-radius: 50%; font-size: 18px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.header-back:hover { border-color: var(--gold); color: var(--gold); }
.header-title { font-size: 18px; font-weight: 700; color: var(--text-bright); }
.header-player { font-size: 13px; color: var(--text-dim); }

/* ============ PLAYER GRID ============ */
.player-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; padding: 4px 0;
}
.player-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.player-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,215,0,0) 0%, rgba(255,215,0,0.03) 100%);
  opacity: 0; transition: opacity 0.3s;
}
.player-card:hover::before, .player-card:active::before { opacity: 1; }
.player-card:hover, .player-card:active {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255,215,0,0.1);
}
.player-card.has-character { border-color: rgba(255,215,0,0.25); }
.player-card .name { font-size: 14px; font-weight: 700; color: var(--text-bright); margin-top: 8px; }
.player-card .status { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.level-badge {
  position: absolute; top: 6px; right: 6px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: #000; font-size: 10px; font-weight: 800;
  padding: 2px 6px; border-radius: 10px;
}

/* ============ AVATAR IMAGES ============ */
.avatar-img-sm { width: 56px; height: 56px; margin: 0 auto; }
.avatar-img-sm img,
.preview-avatar-img img,
.stats-avatar-img img,
.opp-avatar-img img,
.lb-avatar-img img,
.fighter-avatar-img img {
  width: 100%; height: 100%; object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

/* ============ CHARACTER CREATE ============ */
.create-form { padding: 16px 0; }
.preview-character { text-align: center; margin-bottom: 24px; }
.preview-avatar-img { width: 100px; height: 100px; margin: 0 auto 8px; }
.avatar-class { color: var(--gold); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; }
.preview-name { font-size: 22px; font-weight: 800; color: var(--text-bright); margin-top: 6px; min-height: 30px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; color: var(--text-dim); font-size: 12px; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 1px; }
.form-group input {
  width: 100%; padding: 12px 14px;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-bright);
  font-size: 16px; outline: none; transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--gold); }

/* ============ BUTTONS ============ */
.btn {
  display: block; width: 100%; padding: 14px;
  border: none; border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 700; cursor: pointer;
  transition: all 0.2s; text-align: center;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: #000; box-shadow: 0 4px 16px rgba(255,215,0,0.3);
}
.btn-gold:hover { box-shadow: 0 6px 24px rgba(255,215,0,0.4); transform: translateY(-1px); }
.btn-gold:active { transform: scale(0.98); }
.btn-outline {
  background: transparent; border: 1px solid var(--border); color: var(--text);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ============ STATS CARD ============ */
.stats-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
}
.stats-header { display: flex; gap: 14px; margin-bottom: 16px; align-items: center; }
.stats-avatar-img { width: 72px; height: 72px; flex-shrink: 0; }
.stats-info { flex: 1; }
.stats-info h2 { font-size: 20px; color: var(--text-bright); margin-bottom: 2px; }
.stats-level { color: var(--gold); font-size: 14px; font-weight: 700; }

/* XP Bar */
.xp-bar {
  height: 8px; background: var(--bg-card2); border-radius: 4px;
  margin-top: 6px; overflow: hidden;
}
.xp-fill {
  height: 100%; background: linear-gradient(90deg, var(--blue), var(--purple));
  border-radius: 4px; transition: width 0.5s ease;
}
.xp-text { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* Stat Bars */
.stat-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.stat-name { font-size: 12px; color: var(--text-dim); width: 90px; white-space: nowrap; }
.stat-name .emoji { font-size: 14px; }
.stat-bar-container { flex: 1; height: 8px; background: var(--bg-card2); border-radius: 4px; overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.stat-bar-fill.hp { background: linear-gradient(90deg, var(--red), var(--green)); }
.stat-bar-fill.str { background: linear-gradient(90deg, #ff6644, #ff4422); }
.stat-bar-fill.def { background: linear-gradient(90deg, #4488ff, #2266dd); }
.stat-bar-fill.spd { background: linear-gradient(90deg, #ffcc00, #ff8800); }
.stat-value { font-size: 13px; font-weight: 700; color: var(--text-bright); width: 32px; text-align: right; }

.record-row { display: flex; gap: 12px; justify-content: center; margin-top: 8px; font-size: 14px; font-weight: 700; }
.wins { color: var(--green); }
.losses { color: var(--red); }

/* Abilities */
.abilities-section { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.abilities-title { font-size: 13px; color: var(--gold); font-weight: 700; margin-bottom: 6px; }
.ability-tag {
  display: inline-block; background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 10px; font-size: 11px; margin: 2px 4px 2px 0;
  color: var(--text-bright);
}

/* ============ EQUIPMENT ============ */
.equip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px;
}
.equip-title { font-size: 14px; font-weight: 700; color: var(--gold); margin-bottom: 10px; }
.equip-slots { display: flex; flex-direction: column; gap: 8px; }
.equip-slot {
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.equip-slot.equipped { border-color: rgba(255,215,0,0.2); }
.slot-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.slot-item { font-size: 14px; color: var(--text-bright); font-weight: 600; }
.slot-desc { font-size: 11px; color: var(--text-dim); }
.slot-empty { font-size: 13px; color: var(--text-dim); font-style: italic; }
.slot-select {
  width: 100%; margin-top: 6px; padding: 6px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); font-size: 12px; outline: none;
}

/* ============ ACTION GRID ============ */
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.action-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.action-card:hover, .action-card:active {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255,215,0,0.1);
}
.action-card.action-fight {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(255,50,50,0.1), rgba(255,150,0,0.1));
  border-color: rgba(255,100,50,0.3);
}
.action-card.action-fight:hover { border-color: var(--red); box-shadow: 0 4px 20px rgba(255,50,50,0.2); }
.action-icon { font-size: 32px; margin-bottom: 4px; }
.action-name { font-size: 14px; font-weight: 700; color: var(--text-bright); }
.action-desc { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ============ OPPONENT LIST ============ */
.opponent-list { display: flex; flex-direction: column; gap: 8px; }
.opponent-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
  cursor: pointer; transition: all 0.2s;
}
.opponent-card:hover { border-color: var(--red-dim); transform: translateX(4px); }
.opp-avatar-img { width: 48px; height: 48px; flex-shrink: 0; }
.opp-info { flex: 1; }
.opp-name { font-size: 15px; font-weight: 700; color: var(--text-bright); }
.opp-stats { font-size: 12px; color: var(--text-dim); }

/* ============ LEADERBOARD ============ */
.leaderboard-list { display: flex; flex-direction: column; gap: 6px; }
.lb-entry {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.lb-entry:nth-child(1) { border-color: rgba(255,215,0,0.3); background: linear-gradient(90deg, rgba(255,215,0,0.05), transparent); }
.lb-entry:nth-child(2) { border-color: rgba(192,192,192,0.2); }
.lb-entry:nth-child(3) { border-color: rgba(205,127,50,0.2); }
.lb-rank { font-size: 20px; width: 36px; text-align: center; }
.lb-avatar-img { width: 40px; height: 40px; flex-shrink: 0; }
.lb-info { flex: 1; }
.lb-name { font-size: 14px; font-weight: 700; color: var(--text-bright); }
.lb-stats { font-size: 11px; color: var(--text-dim); }
.lb-level { font-size: 16px; font-weight: 800; color: var(--gold); }

/* ============ ARENA / COMBAT ============ */
.arena {
  min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg-dark);
  background-image: 
    radial-gradient(ellipse at 50% 30%, rgba(180,40,40,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 80%, rgba(20,20,60,0.15) 0%, transparent 50%);
  padding: 12px; position: relative; overflow-x: hidden; overflow-y: auto;
}
.arena-bg {
  position: absolute; inset: 0; opacity: 0.04;
  background: repeating-linear-gradient(45deg, transparent, transparent 20px, rgba(255,255,255,0.02) 20px, rgba(255,255,255,0.02) 40px);
  pointer-events: none;
}
.arena-header { text-align: center; padding: 12px 0; position: relative; z-index: 1; }
.arena-vs { font-size: 16px; font-weight: 800; color: var(--gold); letter-spacing: 3px; }
.arena-fighters {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 16px 0; position: relative; z-index: 1;
}
.fighter-panel {
  flex: 1; text-align: center; position: relative;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 8px;
}
.fighter-avatar-img {
  width: 80px; height: 80px; margin: 0 auto 6px;
  transition: transform 0.15s ease;
}
.fighter-avatar-img.left img { transform: scaleX(1); }
.fighter-avatar-img.right img { transform: scaleX(-1); }
.fighter-name { font-size: 14px; font-weight: 700; color: var(--text-bright); }
.fighter-level { font-size: 11px; color: var(--gold); margin-bottom: 6px; }
.fighter-hp-bar { height: 10px; background: var(--bg-card2); border-radius: 5px; overflow: hidden; margin: 4px 0 2px; }
.fighter-hp-fill {
  height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, var(--hp-green), #66ff88);
  transition: width 0.4s ease, background 0.4s ease;
  box-shadow: 0 0 8px rgba(68,255,102,0.3);
}
.fighter-hp-fill.low {
  background: linear-gradient(90deg, var(--hp-yellow), #ffdd44);
  box-shadow: 0 0 8px rgba(255,204,0,0.3);
}
.fighter-hp-fill.critical {
  background: linear-gradient(90deg, var(--hp-red), #ff6666);
  box-shadow: 0 0 8px rgba(255,68,68,0.3);
  animation: hpPulse 0.8s infinite;
}
.fighter-hp-text { font-size: 11px; color: var(--text-dim); }
.arena-vs-icon { font-size: 28px; flex-shrink: 0; filter: drop-shadow(0 0 8px rgba(255,100,50,0.4)); }

/* Combat Log */
.arena-log {
  flex: 1; overflow-y: auto; position: relative; z-index: 1;
  background: var(--bg-card3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px; margin-top: 12px;
  max-height: 40vh; min-height: 140px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.log-entry {
  padding: 4px 8px; margin-bottom: 3px; font-size: 12px;
  border-radius: 4px; animation: slideIn 0.2s ease;
  line-height: 1.4;
}
.log-entry.damage { color: var(--text); }
.log-entry.critical { color: #ff6644; font-weight: 700; text-shadow: 0 0 6px rgba(255,100,50,0.3); }
.log-entry.heal { color: var(--green); }
.log-entry.dodge { color: var(--blue); font-style: italic; }
.log-entry.ability { color: var(--purple); }
.log-entry.end { color: var(--gold); font-weight: 800; font-size: 14px; text-align: center; padding: 8px; margin-top: 4px; }

/* Damage Numbers */
.damage-number {
  position: absolute; font-size: 22px; font-weight: 900;
  color: var(--red); z-index: 10;
  animation: damageFloat 0.9s ease-out forwards;
  text-shadow: 0 0 8px rgba(255,0,0,0.5), 2px 2px 0 rgba(0,0,0,0.8);
  pointer-events: none;
}
.damage-number.heal {
  color: var(--green);
  text-shadow: 0 0 8px rgba(0,255,0,0.5), 2px 2px 0 rgba(0,0,0,0.8);
}
.damage-number.critical {
  font-size: 30px; color: #ff4400;
  text-shadow: 0 0 12px rgba(255,50,0,0.7), 2px 2px 0 rgba(0,0,0,0.8);
}

/* ============ COMBAT ANIMATIONS ============ */
.attack-anim-left { animation: attackLeft 0.35s ease; }
.attack-anim-right { animation: attackRight 0.35s ease; }
.hit-flash { animation: hitFlash 0.2s ease; }
.dodge-anim { animation: dodgeAnim 0.35s ease; }
.screen-shake { animation: screenShake 0.3s ease; }

@keyframes attackLeft {
  0% { transform: translateX(0); }
  40% { transform: translateX(30px) scale(1.1); }
  100% { transform: translateX(0) scale(1); }
}
@keyframes attackRight {
  0% { transform: translateX(0); }
  40% { transform: translateX(-30px) scale(1.1); }
  100% { transform: translateX(0) scale(1); }
}
@keyframes hitFlash {
  0% { filter: brightness(1); }
  30% { filter: brightness(3) saturate(0); }
  100% { filter: brightness(1); }
}
@keyframes dodgeAnim {
  0% { transform: translateX(0); opacity: 1; }
  40% { transform: translateX(-16px); opacity: 0.4; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes screenShake {
  0%, 100% { transform: translate(0,0); }
  20% { transform: translate(-4px, 2px); }
  40% { transform: translate(4px, -2px); }
  60% { transform: translate(-3px, 1px); }
  80% { transform: translate(3px, -1px); }
}
@keyframes damageFloat {
  0% { opacity: 1; transform: translateY(0) scale(0.5); }
  20% { transform: translateY(-10px) scale(1.2); }
  100% { opacity: 0; transform: translateY(-60px) scale(0.8); }
}
@keyframes hpPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============ VICTORY / DEFEAT ============ */
.victory-screen {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 24px;
  animation: fadeIn 0.6s ease;
}
.victory-crown { font-size: 100px; animation: bounceIn 0.8s ease; filter: drop-shadow(0 0 30px rgba(255,215,0,0.4)); }
.victory-text {
  font-size: 38px; font-weight: 900; letter-spacing: 4px;
  background: linear-gradient(135deg, var(--gold), #fff, var(--gold));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-top: 12px;
}
.defeat-text {
  background: linear-gradient(135deg, var(--red), #ff8888, var(--red));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.victory-sub { font-size: 20px; color: var(--blue); margin-top: 12px; font-weight: 700; }
.level-up-text {
  font-size: 24px; font-weight: 800; color: var(--gold);
  margin-top: 8px; animation: pulse 1.5s infinite;
}

@keyframes bounceIn {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); opacity: 1; }
}

/* ============ MODALS ============ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85); z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn 0.3s ease;
}
.modal-content {
  background: var(--bg-card); border: 1px solid var(--gold-dim);
  border-radius: var(--radius); padding: 24px;
  max-width: 400px; width: 100%; max-height: 85vh; overflow-y: auto;
}
.modal-title {
  font-size: 22px; font-weight: 800; color: var(--gold);
  text-align: center; margin-bottom: 4px;
}
.ability-choice {
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
  margin-bottom: 10px; cursor: pointer; transition: all 0.2s;
}
.ability-choice:hover {
  border-color: var(--gold); transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(255,215,0,0.15);
}
.choice-type-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 10px; margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 1px;
}
.choice-type-badge.weapon { background: rgba(255,68,68,0.2); color: var(--red); }
.choice-type-badge.ability { background: rgba(170,68,255,0.2); color: var(--purple); }
.choice-type-badge.armor { background: rgba(68,136,255,0.2); color: var(--blue); }
.choice-type-badge.accessory { background: rgba(255,215,0,0.2); color: var(--gold); }
.choice-type-badge.boost { background: rgba(68,255,102,0.2); color: var(--green); }
.ab-name { font-size: 15px; font-weight: 700; color: var(--text-bright); }
.ab-desc { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* ============ TOURNAMENT ============ */
.tournament-section { padding: 16px 0; }
.tournament-champion {
  text-align: center; padding: 24px 16px;
  background: linear-gradient(135deg, rgba(255,215,0,0.08), rgba(255,150,0,0.05));
  border: 1px solid rgba(255,215,0,0.3); border-radius: var(--radius);
  margin-bottom: 16px; animation: fadeIn 0.5s ease;
}
.champion-emoji { font-size: 64px; animation: pulse 2s infinite; }
.champion-text { font-size: 20px; font-weight: 800; color: var(--gold); margin-top: 8px; }

.bracket-container { overflow-x: auto; padding: 8px 0; }
.bracket { display: flex; gap: 16px; min-width: max-content; }
.bracket-round { min-width: 160px; }
.round-title {
  text-align: center; font-size: 13px; font-weight: 700;
  color: var(--gold); margin-bottom: 10px; text-transform: uppercase;
  letter-spacing: 2px;
}
.bracket-match {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px;
  margin-bottom: 10px; transition: all 0.2s;
}
.bracket-match.playable {
  border-color: var(--gold-dim); cursor: pointer;
  animation: glowPulse 2s infinite;
}
.bracket-match.playable:hover { border-color: var(--gold); transform: scale(1.03); }
.bracket-match.played { opacity: 0.8; }
.bracket-fighter { padding: 6px 8px; border-radius: 4px; font-size: 13px; color: var(--text); }
.bracket-fighter.winner { color: var(--gold); font-weight: 700; background: rgba(255,215,0,0.08); }
.bracket-fighter.loser { color: var(--text-dim); text-decoration: line-through; opacity: 0.5; }
.bf-name { display: block; }
.bracket-vs { text-align: center; font-size: 11px; color: var(--text-dim); padding: 2px 0; }

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 4px rgba(255,215,0,0.1); }
  50% { box-shadow: 0 0 16px rgba(255,215,0,0.25); }
}

/* ============ TOAST ============ */
#toast-container {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 6px;
  width: 90%; max-width: 380px; pointer-events: none;
}
.toast {
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; text-align: center;
  pointer-events: auto; animation: slideDown 0.3s ease;
  transition: all 0.3s ease;
}
.toast.info { background: var(--bg-card2); border: 1px solid var(--border); color: var(--text); }
.toast.success { background: rgba(68,255,102,0.15); border: 1px solid var(--green-dim); color: var(--green); }
.toast.error { background: rgba(255,68,68,0.15); border: 1px solid var(--red-dim); color: var(--red); }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ GENERAL ANIMATIONS ============ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes loadingFill {
  0% { width: 0; }
  100% { width: 100%; }
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 360px) {
  .player-grid { grid-template-columns: repeat(2, 1fr); }
  .game-title { font-size: 32px; }
  .fighter-avatar-img { width: 60px; height: 60px; }
  .action-grid { grid-template-columns: 1fr; }
  .action-card.action-fight { grid-column: span 1; }
}
@media (min-width: 481px) {
  #app { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
}

/* ============ PVE ARENA STYLES ============ */
.action-card.action-pve {
  background: linear-gradient(135deg, rgba(50,180,50,0.12), rgba(50,255,100,0.08));
  border-color: rgba(68,255,102,0.3);
}
.action-card.action-pve:hover {
  border-color: var(--green);
  box-shadow: 0 4px 20px rgba(68,255,102,0.2);
}

.arena-pve {
  background-image: 
    radial-gradient(ellipse at 50% 30%, rgba(40,180,40,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 80%, rgba(20,60,20,0.15) 0%, transparent 50%) !important;
}

/* PvE Fight Counter */
.pve-counter {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pve-counter-icon { font-size: 24px; }
.pve-counter-text { flex: 1; font-size: 14px; color: var(--text); }
.pve-count { font-weight: 800; color: var(--text-bright); font-size: 18px; }
.pve-max { color: var(--text-dim); }
.pve-counter-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-card2);
  border-radius: 3px;
  overflow: hidden;
}
.pve-counter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--green-dim));
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* Catch-up bonus banner */
.pve-catchup {
  background: linear-gradient(135deg, rgba(68,136,255,0.15), rgba(170,68,255,0.1));
  border: 1px solid rgba(68,136,255,0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 12px;
  text-align: center;
}
.catchup-badge {
  display: inline-block;
  background: rgba(68,136,255,0.25);
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-right: 6px;
}
.catchup-text {
  color: var(--text-bright);
  font-size: 13px;
}

/* Difficulty Grid */
.pve-difficulty-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.pve-difficulty-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}
.pve-difficulty-card:hover {
  border-color: var(--gold-dim);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255,215,0,0.1);
}
.pve-difficulty-card:active {
  transform: scale(0.98);
}
.pve-difficulty-card.disabled {
  opacity: 0.4;
  pointer-events: none;
}
.pve-diff-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.pve-diff-emoji { font-size: 28px; }
.pve-diff-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-bright);
}
.pve-diff-stats { margin-bottom: 8px; }
.pve-diff-danger {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.pve-diff-percent {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}
.pve-diff-xp {
  font-size: 12px;
  color: var(--text);
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 8px;
}
.pve-xp-label { color: var(--text-dim); }
.pve-xp-value { color: var(--green); font-weight: 700; }
.pve-xp-bonus {
  color: var(--blue);
  font-weight: 700;
  font-size: 11px;
}

/* PvE Limit Message */
.pve-limit-msg {
  text-align: center;
  padding: 16px;
  color: var(--red);
  font-weight: 700;
  font-size: 14px;
  background: rgba(255,68,68,0.08);
  border: 1px solid rgba(255,68,68,0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

/* PvE Info Box */
.pve-info-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 20px;
}
.pve-info-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.pve-info-list {
  list-style: none;
  padding: 0;
}
.pve-info-list li {
  font-size: 12px;
  color: var(--text-dim);
  padding: 3px 0;
  padding-left: 16px;
  position: relative;
}
.pve-info-list li::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: var(--green-dim);
}

/* PvE Result Counter */
.pve-result-counter {
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 12px;
  background: var(--bg-card);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

@media (max-width: 360px) {
  .pve-difficulty-grid { grid-template-columns: 1fr; }
}

/* ============ COMBO BOOK ============ */
.combo-book-header { text-align: center; margin-bottom: 20px; }
.combo-book-header h2 { font-size: 1.5rem; margin-bottom: 4px; }
.combo-counter { color: var(--text-muted); font-size: 0.85rem; }

.combo-grid { display: flex; flex-direction: column; gap: 10px; }

.combo-card {
  background: var(--bg-card, #1a1a2e);
  border: 2px solid #333;
  border-radius: 12px;
  padding: 14px;
  transition: all 0.3s ease;
}
.combo-card.discovered {
  border-color: #ffd700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.15);
}
.combo-card.locked { opacity: 0.6; }

.combo-name { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.combo-discovered .combo-name { color: #ffd700; }
.combo-locked .combo-name { color: #666; }

.combo-weapons { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.combo-weapon-tag {
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  font-size: 0.75rem;
  color: #aaa;
}
.combo-weapon-tag.owned { background: rgba(0,210,255,0.15); color: #00d2ff; }

.combo-effect {
  font-size: 0.8rem;
  color: #aaa;
  margin-top: 4px;
  font-style: italic;
}

.combo-locked-hint { color: #555; font-size: 0.75rem; margin-top: 4px; }

/* Multi weapon slots */
.weapon-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 8px 0; }
.weapon-slot {
  background: rgba(255,255,255,0.05);
  border: 2px dashed #333;
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.weapon-slot:hover { border-color: #666; background: rgba(255,255,255,0.08); }
.weapon-slot.equipped { border-color: #ffd700; border-style: solid; }
.weapon-slot .slot-emoji { font-size: 1.3rem; }
.weapon-slot .slot-name { font-size: 0.65rem; color: #aaa; margin-top: 2px; }
.weapon-slot .slot-empty { color: #444; font-size: 0.7rem; }

.active-combos { margin-top: 8px; }
.active-combo-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,215,0,0.2), rgba(255,165,0,0.2));
  border: 1px solid rgba(255,215,0,0.4);
  color: #ffd700;
  font-size: 0.75rem;
  font-weight: 600;
  margin: 2px 4px;
  animation: comboPulse 2s ease-in-out infinite;
}
@keyframes comboPulse {
  0%, 100% { box-shadow: 0 0 5px rgba(255,215,0,0.2); }
  50% { box-shadow: 0 0 15px rgba(255,215,0,0.4); }
}

/* Fix bottom cutoff on mobile */
.screen {
  padding-bottom: 40px !important;
  overflow-y: auto !important;
}

#app {
  min-height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom, 20px);
}

body {
  overflow-y: auto !important;
  min-height: 100vh;
}

.hub-screen, .pve-screen, .pvp-screen, .leaderboard-screen {
  padding-bottom: 60px !important;
}


/* ============ GOLD SYSTEM ============ */
.gold-display {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 4px 10px;
  background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,165,0,0.08));
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #ffd700;
  width: fit-content;
}
.gold-icon { font-size: 16px; }
.gold-amount { color: #ffed4a; font-size: 15px; }

.gold-reward {
  font-size: 20px;
  font-weight: 800;
  color: #ffd700;
  margin: 8px 0;
  text-shadow: 0 0 10px rgba(255,215,0,0.5);
  animation: goldPulse 1.5s ease-in-out infinite;
}
@keyframes goldPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.header-gold {
  font-weight: 700;
  color: #ffd700;
  font-size: 14px;
  padding: 2px 8px;
  background: rgba(255,215,0,0.1);
  border-radius: 6px;
  border: 1px solid rgba(255,215,0,0.2);
}

/* Market action card */
.action-market {
  background: linear-gradient(135deg, rgba(255,215,0,0.12), rgba(255,165,0,0.06)) !important;
  border-color: rgba(255,215,0,0.25) !important;
}

/* PvE gold range */
.pve-diff-gold {
  font-size: 12px;
  margin-top: 4px;
  color: #ffd700;
}
.pve-gold-label { opacity: 0.7; }
.pve-gold-value { font-weight: 700; }

/* ============ MARKET TABS ============ */
.market-tabs {
  display: flex;
  gap: 0;
  margin: 0 16px 16px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
}
.market-tab {
  flex: 1;
  text-align: center;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255,255,255,0.03);
  color: var(--text-dim);
  transition: all 0.2s;
}
.market-tab.active {
  background: linear-gradient(135deg, rgba(255,215,0,0.15), rgba(255,165,0,0.08));
  color: #ffd700;
  border-bottom: 2px solid #ffd700;
}
.market-tab:hover:not(.active) {
  background: rgba(255,255,255,0.06);
}

/* ============ SHOP (MERCADER) ============ */
.shop-section { padding: 0 16px 16px; }
.shop-npc-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(147,51,234,0.15), rgba(79,70,229,0.1));
  border: 1px solid rgba(147,51,234,0.3);
  border-radius: 10px;
  color: #c084fc;
}
.shop-npc-emoji { font-size: 28px; }
.shop-rotation {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(255,255,255,0.05);
  padding: 3px 8px;
  border-radius: 6px;
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.shop-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s, border-color 0.15s;
}
.shop-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,215,0,0.3);
}
.shop-type-badge {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.shop-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-bright);
}
.shop-item-desc {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.3;
}
.shop-item-price {
  font-size: 16px;
  font-weight: 800;
  color: #ffd700;
  margin-top: auto;
}

/* ============ CHARACTER SELECT ============ */
.char-count-badge { position: absolute; top: 6px; left: 6px; background: var(--accent, #7c4dff); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 8px; }
.char-select-list { padding: 8px 0; }
.char-select-card { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.06); cursor: pointer; gap: 12px; transition: background 0.15s; }
.char-select-card:hover, .char-select-card:active { background: rgba(255,255,255,0.04); }
.char-select-avatar { width: 48px; height: 48px; flex-shrink: 0; }
.char-select-avatar img { width: 100%; height: 100%; object-fit: contain; }
.char-select-info { flex: 1; min-width: 0; }
.char-select-name { font-size: 16px; font-weight: 700; color: var(--text-bright); }
.char-select-stats { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.char-select-gold { font-size: 11px; color: var(--gold); margin-top: 2px; }
.char-select-arrow { font-size: 18px; color: var(--text-dim); }
.create-new-char { display: flex; align-items: center; padding: 16px; margin: 8px 12px; border: 2px dashed rgba(255,255,255,0.15); border-radius: 12px; cursor: pointer; gap: 12px; transition: border-color 0.2s; }
.create-new-char:hover { border-color: var(--gold); }
.create-new-icon { font-size: 32px; }
.create-new-title { font-size: 14px; font-weight: 600; color: var(--text-bright); }
.create-new-cost { font-size: 12px; color: var(--gold); margin-top: 2px; }

/* ============ MARKETPLACE ============ */
.marketplace-section { padding: 0 16px 16px; }
.mp-block {
  margin-bottom: 20px;
}
.mp-block h3 {
  font-size: 15px;
  color: var(--text-bright);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.listing-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.listing-card.mine {
  border-color: rgba(255,215,0,0.2);
  background: rgba(255,215,0,0.04);
}
.listing-item {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-bright);
}
.listing-seller {
  font-size: 11px;
  color: var(--text-dim);
}
.listing-price {
  font-size: 15px;
  font-weight: 800;
  color: #ffd700;
}
.empty-text {
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  padding: 16px;
}

/* Sell form */
.sell-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.sell-select {
  flex: 2;
  min-width: 120px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text-bright);
  font-size: 13px;
}
.sell-price {
  flex: 1;
  min-width: 80px;
  max-width: 120px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #ffd700;
  font-size: 13px;
  font-weight: 700;
}
.sell-price::placeholder { color: rgba(255,215,0,0.4); }

/* Disabled button */
.btn-disabled {
  background: rgba(255,255,255,0.05) !important;
  color: var(--text-dim) !important;
  cursor: not-allowed !important;
  border-color: rgba(255,255,255,0.05) !important;
}

/* ============ CHALLENGES / RETOS ============ */

/* Notification Bell */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.notif-bell {
  position: relative;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s;
  filter: grayscale(0.5);
}
.notif-bell.has-notif {
  filter: none;
  animation: bell-shake 0.5s ease-in-out;
}
.notif-bell:active {
  transform: scale(0.9);
}
.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ff4444;
  color: white;
  font-size: 10px;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  box-shadow: 0 0 6px rgba(255, 68, 68, 0.6);
}

@keyframes bell-shake {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(15deg); }
  40% { transform: rotate(-15deg); }
  60% { transform: rotate(10deg); }
  80% { transform: rotate(-5deg); }
}

/* Challenges Modal */
.challenges-modal-content {
  max-width: 420px;
  width: 95%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 0;
}
.challenges-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.challenges-modal-header h2 {
  margin: 0;
  font-size: 20px;
  color: var(--gold);
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}
.modal-close:hover {
  color: var(--text-bright);
  background: rgba(255,255,255,0.1);
}

/* Challenge Tabs */
.challenges-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.challenges-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
}
.challenges-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
.challenges-tab:hover {
  color: var(--text-bright);
}
.challenges-tab-content {
  padding: 12px 16px;
}

/* Challenge Card */
.challenge-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  transition: all 0.2s;
}
.challenge-card.incoming {
  border-left: 3px solid #ff8844;
}
.challenge-card.outgoing {
  border-left: 3px solid #44aaff;
  opacity: 0.8;
}
.challenge-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.challenge-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.challenge-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.challenge-info {
  flex: 1;
  min-width: 0;
}
.challenge-name {
  font-weight: 700;
  color: var(--text-bright);
  font-size: 14px;
}
.challenge-player {
  font-size: 11px;
  color: var(--text-dim);
}
.challenge-bet {
  text-align: right;
  flex-shrink: 0;
}
.challenge-bet-label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
}
.challenge-bet-amount {
  font-size: 16px;
  font-weight: 800;
  color: #ffd700;
}
.challenge-time {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
  padding-left: 50px;
}
.challenge-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.challenge-accept-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.challenge-accept-label {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}
.challenge-bet-input {
  width: 80px;
  padding: 6px 10px;
  background: rgba(255,215,0,0.08);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 8px;
  color: #ffd700;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}
.challenge-bet-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(255,215,0,0.2);
}
.challenge-bet-hint {
  font-size: 16px;
}
.challenge-btn-row {
  display: flex;
  gap: 8px;
}
.challenge-accept-btn {
  flex: 1;
}
.challenge-decline-btn {
  flex: 0.6;
}

/* Challenge Create Screen */
.challenge-create-info {
  text-align: center;
  padding: 12px 20px;
  color: var(--text-dim);
  font-size: 13px;
}
.challenge-bet-setup {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255,215,0,0.06);
  border: 1px solid rgba(255,215,0,0.15);
  border-radius: 12px;
  margin: 0 16px 16px;
}
.challenge-bet-setup-label {
  font-size: 13px;
  color: var(--gold);
  font-weight: 600;
  white-space: nowrap;
}
.challenge-bet-input-big {
  flex: 1;
  padding: 10px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 10px;
  color: #ffd700;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
}
.challenge-bet-input-big:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(255,215,0,0.3);
}
.challenge-opponent {
  position: relative;
}
.challenge-send-icon {
  font-size: 22px;
  flex-shrink: 0;
  opacity: 0.7;
}

/* Challenge Action Card */
.action-challenge {
  background: linear-gradient(135deg, rgba(255,136,68,0.15), rgba(255,68,68,0.15));
  border-color: rgba(255,136,68,0.3);
}

/* Challenge Result */
.challenge-result-bets {
  margin: 16px 0;
  text-align: center;
}
.challenge-result-pot {
  font-size: 16px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.challenge-result-gold {
  font-size: 22px;
  font-weight: 800;
}
.challenge-result-gold.win {
  color: #44ff66;
}
.challenge-result-gold.lose {
  color: #ff4444;
}

/* Header gold display */
.header-gold {
  font-size: 13px;
  font-weight: 700;
  color: #ffd700;
  padding: 4px 10px;
  background: rgba(255,215,0,0.1);
  border-radius: 8px;
}

/* ============ QTE (Quick Time Event) SYSTEM ============ */
.qte-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.qte-overlay.qte-visible {
  opacity: 1;
  pointer-events: auto;
}

/* "ATTACK!" prompt */
.qte-prompt {
  font-size: 28px;
  font-weight: 900;
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 40px rgba(255, 100, 0, 0.4);
  letter-spacing: 4px;
  margin-bottom: 20px;
  animation: qtePromptPulse 0.4s ease infinite alternate;
}

@keyframes qtePromptPulse {
  0% { transform: scale(1); text-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 40px rgba(255, 100, 0, 0.4); }
  100% { transform: scale(1.08); text-shadow: 0 0 30px rgba(255, 215, 0, 1), 0 0 60px rgba(255, 100, 0, 0.6); }
}

/* Bar container */
.qte-bar-container {
  width: 85%;
  max-width: 380px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.qte-bar {
  position: relative;
  width: 100%;
  height: 40px;
  background: linear-gradient(180deg, #1a1a2e 0%, #16162a 100%);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Critical zone in center */
.qte-zone-critical {
  position: absolute;
  /* left set by JS */
  /* width set by JS */
  height: 100%;
  background: linear-gradient(180deg, rgba(255, 50, 0, 0.5) 0%, rgba(255, 150, 0, 0.4) 50%, rgba(255, 50, 0, 0.5) 100%);
  border-left: 2px solid #ffd700;
  border-right: 2px solid #ffd700;
  box-shadow: 
    inset 0 0 15px rgba(255, 215, 0, 0.3),
    0 0 20px rgba(255, 215, 0, 0.2);
  animation: qteCritZonePulse 0.6s ease infinite alternate;
}

@keyframes qteCritZonePulse {
  0% { box-shadow: inset 0 0 15px rgba(255, 215, 0, 0.3), 0 0 20px rgba(255, 215, 0, 0.2); }
  100% { box-shadow: inset 0 0 25px rgba(255, 215, 0, 0.5), 0 0 35px rgba(255, 215, 0, 0.35); }
}

/* Moving marker */
.qte-marker {
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #fff 0%, #ffe066 50%, #fff 100%);
  border-radius: 2px;
  box-shadow: 
    0 0 8px rgba(255, 255, 255, 0.9),
    0 0 20px rgba(255, 215, 0, 0.6);
  will-change: transform;
}

/* Hint text */
.qte-hint {
  margin-top: 16px;
  font-size: 15px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 3px;
  text-transform: uppercase;
  animation: qteHintBlink 0.7s ease infinite alternate;
}

@keyframes qteHintBlink {
  0% { opacity: 0.4; }
  100% { opacity: 0.9; }
}

/* ============ QTE RESULTS ============ */

/* Critical hit feedback */
.qte-result-critical {
  text-align: center;
  animation: qteCriticalAppear 0.3s ease;
}

.qte-critical-text {
  font-size: 36px;
  font-weight: 900;
  color: #ff4400;
  text-shadow: 
    0 0 20px rgba(255, 68, 0, 0.8),
    0 0 40px rgba(255, 50, 0, 0.5),
    0 0 80px rgba(255, 50, 0, 0.3);
  letter-spacing: 3px;
  animation: qteCritTextPulse 0.15s ease infinite alternate;
}

.qte-critical-x2 {
  font-size: 24px;
  font-weight: 900;
  color: #ffd700;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
  margin-top: 8px;
  letter-spacing: 6px;
  animation: qteX2Scale 0.5s ease;
}

@keyframes qteCriticalAppear {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.3); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes qteCritTextPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.06); }
}

@keyframes qteX2Scale {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); opacity: 1; }
}

/* Miss feedback */
.qte-result-miss {
  font-size: 18px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.35);
  font-style: italic;
  letter-spacing: 2px;
  animation: qteMissAppear 0.3s ease;
}

@keyframes qteMissAppear {
  0% { transform: translateY(-10px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Screen shake for QTE critical */
.qte-shake {
  animation: qteShake 0.4s ease !important;
}

@keyframes qteShake {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-8px, 4px); }
  20% { transform: translate(8px, -4px); }
  30% { transform: translate(-6px, 3px); }
  40% { transform: translate(6px, -3px); }
  50% { transform: translate(-4px, 2px); }
  60% { transform: translate(4px, -2px); }
  70% { transform: translate(-2px, 1px); }
  80% { transform: translate(2px, -1px); }
}

/* Flash on critical */
.qte-flash::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(255, 100, 0, 0.3);
  z-index: 501;
  pointer-events: none;
  animation: qteFlash 0.4s ease forwards;
}

@keyframes qteFlash {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* Arena glow when QTE critical hits */
.qte-arena-critical {
  box-shadow: inset 0 0 60px rgba(255, 68, 0, 0.3) !important;
}

/* ============ QTE RESPONSIVE ============ */
@media (max-width: 400px) {
  .qte-prompt { font-size: 22px; }
  .qte-bar { height: 48px; }
  .qte-bar-container { width: 92%; }
  .qte-critical-text { font-size: 28px; }
  .qte-critical-x2 { font-size: 20px; }
  .qte-hint { font-size: 13px; }
}

@media (min-width: 401px) and (max-width: 600px) {
  .qte-bar { height: 44px; }
}


/* ============ COMBAT HISTORY ============ */
.action-history {
  background: linear-gradient(135deg, rgba(147, 112, 219, 0.15), rgba(106, 90, 205, 0.1));
  border-color: rgba(147, 112, 219, 0.3);
}

.history-stats {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 12px;
  margin: 8px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
}

.history-stat-item {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-bright);
}

.history-list {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border-left: 4px solid;
  background: rgba(255,255,255,0.03);
}

.history-win {
  border-left-color: #44ff66;
  background: rgba(68, 255, 102, 0.05);
}

.history-loss {
  border-left-color: #ff4444;
  background: rgba(255, 68, 68, 0.05);
}

.history-result-badge {
  font-size: 11px;
  font-weight: 800;
  min-width: 60px;
  text-align: center;
  padding: 4px 6px;
  border-radius: 6px;
}

.history-win .history-result-badge {
  background: rgba(68, 255, 102, 0.15);
  color: #44ff66;
}

.history-loss .history-result-badge {
  background: rgba(255, 68, 68, 0.15);
  color: #ff4444;
}

.history-main {
  flex: 1;
  min-width: 0;
}

.history-opponent {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.history-opp-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-pve-badge {
  font-size: 11px;
  padding: 2px 6px;
  background: rgba(255, 204, 0, 0.15);
  color: #ffcc00;
  border-radius: 4px;
  font-weight: 700;
  white-space: nowrap;
}

.history-rewards {
  display: flex;
  gap: 8px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.history-xp {
  font-size: 11px;
  color: #88ccff;
  font-weight: 600;
}

.history-gold {
  font-size: 11px;
  font-weight: 600;
}

.history-gold.positive {
  color: #ffcc00;
}

.history-gold.negative {
  color: #ff6b6b;
}

.history-wager {
  font-size: 11px;
  color: #cc88ff;
  font-weight: 600;
}

.history-date {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  min-width: 70px;
  text-align: right;
}
