/* ============================================
   RETOSABROZON - Fitness Battle RPG Styles
   ============================================ */

:root {
  --bg: #070c1a;
  --bg-card: #0e1530;
  --bg-card2: #141e3e;
  --bg-input: #1b2448;
  --neon-green: #00ff99;
  --neon-cyan: #18d8ff;
  --neon-pink: #ff22ee;
  --neon-gold: #ffd700;
  --neon-orange: #ff8800;
  --neon-red: #ff3355;
  --neon-purple: #bb55ff;
  --text: #edf0ff;
  --text-dim: #aab5d8;
  --text-muted: #6878a8;
  --border: #242d56;
  --border-bright: #323c70;
  --p1-color: #18d8ff;
  --p2-color: #ff22ee;
  --font-game: 'Press Start 2P', monospace;
  --font-body: 'Rajdhani', sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 19px;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 10%, rgba(24,216,255,.10) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 90%, rgba(255,34,238,.10) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 50%, rgba(187,85,255,.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }

/* ============ TYPOGRAPHY ============ */
.font-game { font-family: var(--font-game); }
h1,h2,h3 { font-family: var(--font-body); font-weight: 700; }

.title-game {
  font-family: var(--font-game);
  font-size: clamp(14px, 3vw, 22px);
  line-height: 1.6;
  letter-spacing: 1px;
}

.title-section {
  font-size: clamp(20px, 5vw, 30px);
  font-weight: 700;
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* ============ LAYOUT ============ */
.screen {
  max-width: 780px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 80px;
}

.screen-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 80px;
}

/* ============ NAVBAR ============ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(7,12,26,.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-bright);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-brand {
  font-family: var(--font-game);
  font-size: 9px;
  line-height: 1.4;
  color: var(--neon-gold);
  text-shadow: 0 0 10px var(--neon-gold);
  flex: 1;
  white-space: nowrap;
}

.navbar-player {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s;
}
.navbar-player:hover { border-color: var(--neon-cyan); }

.navbar-player-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* ---- Hamburger button ---- */
.navbar-hamburger {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 12px;
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0;
}
.navbar-hamburger:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); }

.hamburger-label { letter-spacing: 1px; }

.hamburger-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hamburger-lines span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: all .25s;
}

/* Animate to X when open */
.nav-open .hamburger-lines span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-open .hamburger-lines span:nth-child(2) { opacity: 0; }
.nav-open .hamburger-lines span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---- Dropdown menu ---- */
.navbar-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(7,12,26,.98);
  border-bottom: 1px solid var(--border-bright);
  flex-direction: column;
  padding: 8px 12px 14px;
  gap: 4px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.nav-open .navbar-menu { display: flex; }

.navbar-menu-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 13px 16px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all .18s;
}
.navbar-menu-btn:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); background: rgba(24,216,255,.06); }
.navbar-menu-btn.active { border-color: var(--neon-cyan); color: var(--neon-cyan); background: rgba(24,216,255,.10); }
.navbar-menu-logout { color: var(--text-dim); margin-top: 6px; border-color: transparent; }
.navbar-menu-logout:hover { color: var(--neon-red); border-color: var(--neon-red); background: rgba(255,50,50,.06); }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all .2s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-green));
  color: #000;
  box-shadow: 0 0 20px rgba(24,216,255,.35);
}
.btn-primary:hover { box-shadow: 0 0 40px rgba(24,216,255,.65); transform: translateY(-2px); }

.btn-secondary {
  background: var(--bg-card2);
  color: var(--text);
  border: 1px solid var(--border-bright);
}
.btn-secondary:hover { border-color: var(--neon-cyan); color: var(--neon-cyan); }

.btn-danger {
  background: rgba(255,51,85,.1);
  color: var(--neon-red);
  border: 1px solid rgba(255,51,85,.3);
}
.btn-danger:hover { background: rgba(255,51,85,.2); border-color: var(--neon-red); }

.btn-gold {
  background: linear-gradient(135deg, var(--neon-gold), #ff9900);
  color: #000;
  box-shadow: 0 0 20px rgba(255,215,0,.3);
}
.btn-gold:hover { box-shadow: 0 0 40px rgba(255,215,0,.6); transform: translateY(-2px); }

.btn-p1 { background: rgba(24,216,255,.12); color: var(--p1-color); border: 2px solid var(--p1-color); }
.btn-p1:hover { background: rgba(24,216,255,.22); box-shadow: 0 0 24px rgba(24,216,255,.45); }

.btn-p2 { background: rgba(255,0,221,.1); color: var(--p2-color); border: 2px solid var(--p2-color); }
.btn-p2:hover { background: rgba(255,0,221,.2); box-shadow: 0 0 20px rgba(255,0,221,.4); }

.btn-full { width: 100%; }
.btn-lg { padding: 18px 32px; font-size: 18px; }
.btn-sm { padding: 9px 16px; font-size: 14px; }

.btn-notif {
  background: rgba(24,216,255,0.14);
  color: var(--neon-cyan);
  border: 2px solid var(--neon-cyan);
  font-size: 17px;
}
.btn-notif:hover {
  background: rgba(24,216,255,0.26);
  box-shadow: 0 0 24px rgba(24,216,255,.35);
}

.btn-ios {
  background: rgba(187,85,255,0.14);
  color: var(--neon-purple);
  border: 2px solid var(--neon-purple);
  font-size: 17px;
}
.btn-ios:hover {
  background: rgba(187,85,255,0.26);
  box-shadow: 0 0 24px rgba(187,85,255,.35);
}

/* ============ CARDS ============ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 2px 16px rgba(0,0,0,.3);
}

.card-glow-cyan {
  border-color: rgba(24,216,255,.4);
  box-shadow: 0 0 24px rgba(24,216,255,.12), 0 2px 16px rgba(0,0,0,.3);
}

.card-glow-pink {
  border-color: rgba(255,34,238,.4);
  box-shadow: 0 0 24px rgba(255,34,238,.12), 0 2px 16px rgba(0,0,0,.3);
}

.card-glow-gold {
  border-color: rgba(255,215,0,.4);
  box-shadow: 0 0 24px rgba(255,215,0,.12), 0 2px 16px rgba(0,0,0,.3);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text);
  margin-bottom: 14px;
}

/* ============ INPUTS ============ */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  transition: border-color .2s, box-shadow .2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px rgba(24,216,255,.18);
}

.form-input::placeholder { color: var(--text-muted); }

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border-bright);
  border-radius: 3px;
  outline: none;
  padding: 0;
  border: none;
  margin: 8px 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
  cursor: pointer;
}

textarea.form-input { resize: vertical; min-height: 80px; }

/* ============ CHOICE BUTTONS ============ */
.choices { display: flex; flex-direction: column; gap: 8px; }
.choices.row { flex-direction: row; flex-wrap: wrap; }

.choice-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all .2s;
}
.choice-btn:hover { border-color: var(--neon-cyan); }
.choice-btn.selected {
  border-color: var(--neon-cyan);
  background: rgba(24,216,255,.12);
  color: var(--neon-cyan);
}

.scale-row { display: flex; gap: 8px; }
.scale-btn {
  flex: 1;
  aspect-ratio: 1;
  max-width: 60px;
  background: var(--bg-input);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-game);
  font-size: 10px;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scale-btn.selected {
  border-color: var(--neon-gold);
  background: rgba(255,215,0,.15);
  color: var(--neon-gold);
  box-shadow: 0 0 10px rgba(255,215,0,.3);
}

/* ============ WELCOME SCREEN ============ */
.welcome-hero {
  text-align: center;
  padding: 60px 20px 40px;
}

.welcome-logo {
  font-family: var(--font-game);
  font-size: clamp(18px, 5vw, 32px);
  line-height: 1.5;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
  0%,100% { filter: drop-shadow(0 0 8px rgba(0,204,255,.5)); }
  50% { filter: drop-shadow(0 0 20px rgba(255,0,221,.7)); }
}

.welcome-sub {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 20px;
}

.player-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 155px));
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
  justify-content: center;
}

.player-select-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .3s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}

.player-select-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .3s;
}

.player-select-card.p1-card {
  border: 2px solid rgba(24,216,255,.45);
  box-shadow: 0 0 20px rgba(24,216,255,.1), 0 4px 20px rgba(0,0,0,.4);
}
.player-select-card.p1-card::before {
  background: radial-gradient(ellipse at center, rgba(24,216,255,.15), transparent);
}
.player-select-card.p1-card:hover {
  border-color: var(--p1-color);
  box-shadow: 0 0 40px rgba(24,216,255,.4), 0 8px 30px rgba(0,0,0,.5);
  transform: translateY(-6px);
}
.player-select-card.p1-card:hover::before { opacity: 1; }

.player-select-card.p2-card {
  border: 2px solid rgba(255,34,238,.45);
  box-shadow: 0 0 20px rgba(255,34,238,.1), 0 4px 20px rgba(0,0,0,.4);
}
.player-select-card.p2-card::before {
  background: radial-gradient(ellipse at center, rgba(255,34,238,.15), transparent);
}
.player-select-card.p2-card:hover {
  border-color: var(--p2-color);
  box-shadow: 0 0 40px rgba(255,34,238,.4), 0 8px 30px rgba(0,0,0,.5);
  transform: translateY(-6px);
}
.player-select-card.p2-card:hover::before { opacity: 1; }

.player-select-avatar {
  font-size: 66px;
  line-height: 1;
  margin-bottom: 12px;
  animation: float 3s ease-in-out infinite;
}
.player-select-card:nth-child(2) .player-select-avatar {
  animation-delay: -1.5s;
}

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

.player-select-label {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.player-select-card.p1-card .player-select-label { color: var(--p1-color); }
.player-select-card.p2-card .player-select-label { color: var(--p2-color); }

.player-select-name {
  font-size: 18px;
  font-weight: 700;
  margin-top: 4px;
}

.player-select-level {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
}

/* ============ AVATAR GRID ============ */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}

.avatar-option {
  aspect-ratio: 1;
  font-size: 24px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.avatar-option:hover { border-color: var(--neon-cyan); transform: scale(1.1); }
.avatar-option.selected {
  border-color: var(--neon-gold);
  background: rgba(255,215,0,.1);
  box-shadow: 0 0 12px rgba(255,215,0,.4);
  transform: scale(1.15);
}

/* ============ QUESTIONNAIRE ============ */
.quest-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.quest-step-badge {
  background: var(--bg-card2);
  border: 1px solid var(--border-bright);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--neon-cyan);
  white-space: nowrap;
}

.quest-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.quest-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-green));
  border-radius: 3px;
  transition: width .4s ease;
  box-shadow: 0 0 8px var(--neon-cyan);
}

.quest-icon {
  font-size: 48px;
  text-align: center;
  margin-bottom: 16px;
}

.quest-question {
  font-size: clamp(20px, 5vw, 28px);
  font-weight: 700;
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.4;
}

/* ============ MEASUREMENTS ============ */
.measurement-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.measurement-field {
  background: var(--bg-card2);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

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

.mf-emoji { font-size: 24px; }
.mf-label { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.mf-hint { font-size: 11px; color: var(--text-dim); margin-bottom: 8px; }

.mf-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mf-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  transition: border-color .2s;
}
.mf-input:focus { outline: none; border-color: var(--neon-cyan); }
.mf-unit { font-size: 13px; color: var(--text-dim); font-weight: 600; }

/* ============ DASHBOARD ============ */
.dashboard-hero {
  background: linear-gradient(145deg, #0e1a3a 0%, #0b1128 100%);
  border: 1px solid var(--border-bright);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.05);
}

.dashboard-hero::before {
  content: '';
  position: absolute;
  top: -40%; right: -10%;
  width: 340px; height: 340px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(24,216,255,.09), transparent 70%);
}

.dashboard-hero::after {
  content: '';
  position: absolute;
  bottom: -40%; left: -10%;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,34,238,.07), transparent 70%);
  pointer-events: none;
}

.hero-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.hero-avatar {
  font-size: 56px;
  line-height: 1;
  animation: float 3s ease-in-out infinite;
  flex-shrink: 0;
}

.hero-info { flex: 1; }

.hero-name {
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 700;
  margin-bottom: 4px;
}

.level-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card2);
  border: 1px solid var(--border-bright);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
}

.level-chip .level-emoji { font-size: 16px; }
.level-chip .level-name { color: var(--neon-gold); }
.level-chip .level-num { color: var(--text-dim); }

.hero-points {
  font-size: 13px;
  color: var(--text);
  margin-top: 6px;
}

.hero-points span {
  color: var(--neon-gold);
  font-weight: 700;
  font-size: 18px;
}

.xp-bar-wrap {
  margin-top: 4px;
}

.xp-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text);
  margin-bottom: 4px;
}

.xp-bar {
  height: 10px;
  background: var(--border);
  border-radius: 5px;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width .8s ease;
  position: relative;
}

.xp-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 40%;
  background: rgba(255,255,255,.2);
  border-radius: 5px;
}

/* ============ CHALLENGE CARD ============ */
.challenge-card {
  background: linear-gradient(135deg, rgba(255,119,0,.08), rgba(255,215,0,.05));
  border: 1px solid rgba(255,119,0,.3);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.challenge-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.challenge-emoji {
  font-size: 36px;
  flex-shrink: 0;
}

.challenge-meta { flex: 1; }
.challenge-name {
  font-size: clamp(16px, 3vw, 20px);
  font-weight: 700;
  color: var(--neon-gold);
}
.challenge-month {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.challenge-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.challenge-bar {
  height: 12px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.challenge-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-orange), var(--neon-gold));
  border-radius: 6px;
  transition: width .8s ease;
  box-shadow: 0 0 8px rgba(255,119,0,.4);
}

/* ============ QUICK ACTIONS GRID ============ */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.action-card {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all .25s;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}

.action-card:hover {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 24px rgba(24,216,255,.2), 0 4px 16px rgba(0,0,0,.3);
  transform: translateY(-3px);
  background: rgba(24,216,255,.05);
}

.action-icon { font-size: 32px; margin-bottom: 8px; }
.action-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text);
}

/* ============ TIPS ============ */
.tips-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tips-list li {
  font-size: 14px;
  padding: 10px 14px;
  background: rgba(0,255,153,.05);
  border-radius: 8px;
  border-left: 3px solid var(--neon-green);
  color: var(--text);
  border: 1px solid rgba(0,255,153,.12);
  border-left: 3px solid var(--neon-green);
}

/* ============ BATTLE SCREEN ============ */
.battle-screen {
  min-height: 100vh;
  background: radial-gradient(ellipse at center, #0d0028 0%, #050010 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.battle-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 25% 50%, rgba(0,204,255,.07) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 50%, rgba(255,0,221,.07) 0%, transparent 50%);
  pointer-events: none;
}

.battle-stars {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.star {
  position: absolute;
  width: 2px; height: 2px;
  background: white;
  border-radius: 50%;
  animation: twinkle 2s infinite;
}

@keyframes twinkle {
  0%,100% { opacity: 0.2; }
  50% { opacity: 1; }
}

.battle-title {
  font-family: var(--font-game);
  font-size: clamp(10px, 2.5vw, 16px);
  color: var(--neon-gold);
  text-shadow: 0 0 20px var(--neon-gold);
  text-align: center;
  margin-bottom: 8px;
  animation: logoGlow 2s ease-in-out infinite;
  position: relative;
}

.battle-challenge-name {
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 30px;
  position: relative;
}

/* Health bars top section */
.battle-hbars {
  width: 100%;
  max-width: 700px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  position: relative;
}

.hbar-p1, .hbar-p2 {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hbar-p1 { align-items: flex-start; }
.hbar-p2 { align-items: flex-end; }

.hbar-name {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.hbar-p1 .hbar-name { color: var(--p1-color); }
.hbar-p2 .hbar-name { color: var(--p2-color); }

.hbar-track {
  width: 100%;
  height: 18px;
  background: rgba(255,255,255,.10);
  border-radius: 9px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255,255,255,.08);
}

.hbar-fill-p1 {
  height: 100%;
  background: linear-gradient(90deg, rgba(0,204,255,.3), var(--p1-color));
  border-radius: 9px;
  transition: width 1.2s ease;
  box-shadow: 0 0 10px var(--p1-color);
  position: relative;
}

.hbar-fill-p2 {
  height: 100%;
  background: linear-gradient(270deg, rgba(255,0,221,.3), var(--p2-color));
  border-radius: 9px;
  transition: width 1.2s ease;
  box-shadow: 0 0 10px var(--p2-color);
  position: absolute;
  right: 0;
}

.hbar-pct {
  font-size: 11px;
  font-weight: 700;
}
.hbar-p1 .hbar-pct { color: var(--p1-color); }
.hbar-p2 .hbar-pct { color: var(--p2-color); }

.vs-badge {
  background: var(--bg-card);
  border: 2px solid var(--neon-gold);
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-game);
  font-size: 10px;
  color: var(--neon-gold);
  text-shadow: 0 0 10px var(--neon-gold);
  animation: vsPulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes vsPulse {
  0%,100% { box-shadow: 0 0 10px rgba(255,215,0,.4); transform: scale(1); }
  50% { box-shadow: 0 0 30px rgba(255,215,0,.8); transform: scale(1.1); }
}

/* Fighters area */
.battle-fighters {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  width: 100%;
  max-width: 700px;
  gap: 20px;
  position: relative;
}

.fighter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.fighter-avatar {
  font-size: clamp(60px, 14vw, 100px);
  line-height: 1;
  filter: drop-shadow(0 0 20px rgba(0,204,255,.5));
}

.fighter-p2 .fighter-avatar {
  filter: drop-shadow(0 0 20px rgba(255,0,221,.5));
  transform: scaleX(-1);
}

.fighter.is-winning .fighter-avatar {
  animation: winner-bounce 0.6s ease-in-out infinite alternate;
}

@keyframes winner-bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-15px); }
}

.fighter-p2.is-winning .fighter-avatar {
  animation: winner-bounce-p2 0.6s ease-in-out infinite alternate;
}

@keyframes winner-bounce-p2 {
  from { transform: scaleX(-1) translateY(0); }
  to { transform: scaleX(-1) translateY(-15px); }
}

.fighter.is-losing .fighter-avatar {
  animation: loser-wobble 1.2s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(100,100,100,.5)) grayscale(0.4);
}

.fighter-p2.is-losing .fighter-avatar {
  animation: loser-wobble-p2 1.2s ease-in-out infinite;
}

@keyframes loser-wobble {
  0%,100% { transform: rotate(0deg); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}

@keyframes loser-wobble-p2 {
  0%,100% { transform: scaleX(-1) rotate(0deg); }
  25% { transform: scaleX(-1) rotate(-3deg); }
  75% { transform: scaleX(-1) rotate(3deg); }
}

.fighter-name {
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}
.fighter-p1 .fighter-name { color: var(--p1-color); }
.fighter-p2 .fighter-name { color: var(--p2-color); }

.fighter-level {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
}

.fighter-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 10px;
  text-transform: uppercase;
}
.fighter-badge.winner {
  background: rgba(0,255,136,.15);
  color: var(--neon-green);
  border: 1px solid rgba(0,255,136,.3);
}
.fighter-badge.loser {
  background: rgba(100,100,100,.1);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.fighter-badge.tied {
  background: rgba(255,215,0,.1);
  color: var(--neon-gold);
  border: 1px solid rgba(255,215,0,.3);
}

.battle-vs-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.battle-lightning {
  font-size: 32px;
  animation: vsPulse 0.8s ease-in-out infinite;
}

/* Battle result message */
.battle-result {
  text-align: center;
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  max-width: 600px;
  width: 100%;
  position: relative;
}

.battle-result-title {
  font-family: var(--font-game);
  font-size: clamp(10px, 2.5vw, 14px);
  line-height: 1.8;
}

.result-win { color: var(--neon-green); text-shadow: 0 0 15px var(--neon-green); }
.result-lose { color: var(--neon-red); }
.result-tie { color: var(--neon-gold); text-shadow: 0 0 15px var(--neon-gold); }

.battle-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.bstat {
  background: var(--bg-card2);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}
.bstat-value { font-size: 22px; font-weight: 700; }
.bstat-label { font-size: 11px; color: var(--text); margin-top: 2px; }

/* ============ RANKINGS ============ */
.rank-table {
  width: 100%;
  border-collapse: collapse;
}

.rank-table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-bright);
}

.rank-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}

.rank-table tr:last-child td { border-bottom: none; }

.rank-table tr:hover td { background: rgba(255,255,255,.02); }

.rank-num {
  font-family: var(--font-game);
  font-size: 12px;
  color: var(--text-dim);
}

.rank-1 .rank-num { color: var(--neon-gold); }
.rank-2 .rank-num { color: #aaa; }

.rank-avatar { font-size: 28px; }

.rank-name { font-size: 16px; font-weight: 700; }
.rank-sub { font-size: 12px; color: var(--text-dim); }

.rank-points {
  font-size: 20px;
  font-weight: 700;
  color: var(--neon-gold);
}

/* ============ STATS ============ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px;
  text-align: center;
}

.stat-chip-emoji { font-size: 24px; margin-bottom: 6px; }
.stat-chip-value { font-size: 24px; font-weight: 700; color: var(--neon-cyan); }
.stat-chip-label { font-size: 11px; color: var(--text); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }

/* Simple bar chart */
.chart-wrap { padding: 8px 0; }

.chart-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.chart-label {
  width: 80px;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  color: var(--text);
  flex-shrink: 0;
}

.chart-bar-wrap {
  flex: 1;
  height: 28px;
  background: var(--bg-input);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.chart-bar {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding-left: 8px;
  transition: width .8s ease;
  min-width: 2px;
}

.chart-bar-goal {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--neon-gold);
  opacity: 0.7;
}

.chart-val {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,.8);
  white-space: nowrap;
}

/* ============ PRIZE SCREEN ============ */
.prize-display {
  background: linear-gradient(135deg, rgba(255,215,0,.08), rgba(255,119,0,.05));
  border: 1px solid rgba(255,215,0,.3);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.prize-trophy { font-size: 60px; margin-bottom: 12px; animation: float 2s ease-in-out infinite; }
.prize-name {
  font-family: var(--font-game);
  font-size: clamp(11px, 2.5vw, 16px);
  color: var(--neon-gold);
  text-shadow: 0 0 15px rgba(255,215,0,.5);
  margin-bottom: 8px;
  line-height: 1.6;
}
.prize-desc { font-size: 18px; color: var(--text); font-weight: 600; }

.prize-history {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prize-hist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card2);
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  padding: 12px;
}

.prize-hist-month {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  width: 60px;
  flex-shrink: 0;
}

.prize-hist-name { font-size: 14px; font-weight: 600; }

/* ============ SECTION HEADER ============ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* ============ LEVEL UP MODAL ============ */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#modal-overlay.hidden { display: none; }

#modal-box {
  background: linear-gradient(145deg, #0e1a3a, #0b1128);
  border: 1px solid var(--border-bright);
  border-radius: 20px;
  padding: 36px 28px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  animation: modalIn .4s ease;
  position: relative;
  box-shadow: 0 0 60px rgba(0,0,0,.6), 0 0 30px rgba(24,216,255,.08);
}

@keyframes modalIn {
  from { transform: scale(.8) translateY(30px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.levelup-emoji {
  font-size: 80px;
  margin-bottom: 16px;
  display: block;
  animation: levelupBounce .5s ease-in-out infinite alternate;
}

@keyframes levelupBounce {
  from { transform: scale(1) rotate(-5deg); }
  to { transform: scale(1.15) rotate(5deg); }
}

.levelup-subtitle {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--neon-cyan);
  margin-bottom: 8px;
}

.levelup-name {
  font-family: var(--font-game);
  font-size: clamp(14px, 4vw, 20px);
  color: var(--neon-gold);
  text-shadow: 0 0 20px rgba(255,215,0,.6);
  margin-bottom: 16px;
  line-height: 1.5;
}

.levelup-msg {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 24px;
  line-height: 1.5;
}

.modal-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.confetti-dot {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  animation: confettiFall linear infinite;
}

@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(120%) rotate(720deg); opacity: 0; }
}

/* ============ TOAST ============ */
#toast-wrap {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(400px, 90vw);
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  animation: toastIn .3s ease, toastOut .3s ease 2.7s forwards;
  pointer-events: auto;
}

.toast-success { border-left: 4px solid var(--neon-green); }
.toast-error { border-left: 4px solid var(--neon-red); }
.toast-info { border-left: 4px solid var(--neon-cyan); }

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

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

/* ============ SETUP WIZARD ============ */
.wizard-progress {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 32px;
}

.wizard-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border-bright);
  transition: all .3s;
}
.wizard-dot.done {
  background: var(--neon-green);
  box-shadow: 0 0 6px var(--neon-green);
}
.wizard-dot.current {
  background: var(--neon-cyan);
  box-shadow: 0 0 6px var(--neon-cyan);
  width: 20px;
  border-radius: 4px;
}

/* ============ GOAL REVEAL ============ */
.goal-reveal {
  background: linear-gradient(135deg, rgba(0,255,136,.06), rgba(0,204,255,.04));
  border: 1px solid rgba(0,255,136,.2);
  border-radius: var(--radius);
  padding: 20px;
}

.goal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.goal-row:last-child { border-bottom: none; }

.goal-left { display: flex; align-items: center; gap: 8px; }
.goal-emoji { font-size: 20px; }
.goal-field-name { font-size: 14px; font-weight: 600; }

.goal-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--neon-green);
}

.goal-total {
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.goal-total-val {
  font-size: 28px;
  font-weight: 700;
  color: var(--neon-gold);
}

.goal-total-label { font-size: 13px; color: var(--text-dim); }

/* ============ MISC ============ */
.gap-12 { margin-bottom: 12px; }
.gap-16 { margin-bottom: 16px; }
.gap-20 { margin-bottom: 20px; }
.gap-24 { margin-bottom: 24px; }

.text-center { text-align: center; }
.text-dim { color: var(--text-dim); }
.text-green { color: var(--neon-green); }
.text-cyan { color: var(--neon-cyan); }
.text-gold { color: var(--neon-gold); }
.text-red { color: var(--neon-red); }
.text-pink { color: var(--neon-pink); }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.badge-green { background: rgba(0,255,153,.12); color: var(--neon-green); border: 1px solid rgba(0,255,153,.3); }
.badge-gold  { background: rgba(255,215,0,.12); color: var(--neon-gold);  border: 1px solid rgba(255,215,0,.3); }
.badge-cyan  { background: rgba(24,216,255,.12); color: var(--neon-cyan);  border: 1px solid rgba(24,216,255,.3); }
.badge-red   { background: rgba(255,51,85,.12);  color: var(--neon-red);   border: 1px solid rgba(255,51,85,.3); }

.info-box {
  background: rgba(24,216,255,.08);
  border: 1px solid rgba(24,216,255,.22);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: 16px;
  color: var(--text);
  line-height: 1.6;
}

.info-box.warning {
  background: rgba(255,119,0,.06);
  border-color: rgba(255,119,0,.15);
}

/* ============ ANIMATIONS ============ */
.animate-in {
  animation: animateIn .4s ease;
}

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

/* ============ RESPONSIVE ============ */
@media (max-width: 480px) {
  .player-select-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 140px)); gap: 12px; justify-content: center; }
  .measurement-grid { grid-template-columns: 1fr; }
  .avatar-grid { grid-template-columns: repeat(6, 1fr); }
  .actions-grid { grid-template-columns: 1fr 1fr; }
  .arena-3d-outer { height: 260px; }
  .fighter-3d-char { font-size: 60px; }
  .battle-stats-grid-3d { grid-template-columns: 1fr 1fr; }
}

/* ============ 3D BATTLE ARENA ============ */
.battle-3d-page {
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 0%, #130035 0%, #060018 40%, #01000a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  position: relative;
  padding-bottom: 32px;
}

.battle-stars-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.star3d {
  position: absolute;
  border-radius: 50%;
  background: white;
  animation: twinkleStar ease-in-out infinite;
}

@keyframes twinkleStar {
  0%,100% { opacity: .12; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.6); }
}

.battle-nebula {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(0,100,255,.07) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(200,0,200,.07) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(100,0,200,.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.battle-top-section {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 740px;
  padding: 16px 16px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.battle-title-3d {
  font-family: var(--font-game);
  font-size: clamp(14px, 3.5vw, 22px);
  color: var(--neon-gold);
  text-shadow: 0 0 20px var(--neon-gold), 0 0 50px rgba(255,215,0,.4);
  text-align: center;
  margin-bottom: 6px;
  animation: titleFlicker 5s ease-in-out infinite;
}

@keyframes titleFlicker {
  0%,93%,97%,100% { opacity: 1; }
  95% { opacity: .75; }
}

.battle-challenge-badge {
  font-size: 16px;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 18px;
}

/* Health bars */
.hbars-3d {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 720px;
  margin-bottom: 6px;
}

.hbar3d-wrap { flex: 1; }

.hbar3d-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hbar3d-track {
  height: 26px;
  background: rgba(255,255,255,.06);
  border-radius: 13px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.4);
}

.hbar3d-track-rtl { direction: rtl; }

.hbar3d-fill {
  height: 100%;
  border-radius: 13px;
  transition: width 1.3s cubic-bezier(.22,1,.36,1);
  position: relative;
}

.hbar3d-fill::after {
  content: '';
  position: absolute;
  top: 3px; left: 6px; right: 10px;
  height: 7px;
  background: rgba(255,255,255,.28);
  border-radius: 4px;
}

.hbar3d-fill-p1 {
  background: linear-gradient(90deg, rgba(0,80,180,.4), var(--p1-color));
  box-shadow: 0 0 14px var(--p1-color);
}

.hbar3d-fill-p2 {
  background: linear-gradient(90deg, var(--p2-color), rgba(180,0,120,.4));
  box-shadow: 0 0 14px var(--p2-color);
}

.hbar3d-pct-overlay {
  position: absolute;
  top: 50%; left: 10px;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.9);
  text-shadow: 0 0 5px rgba(0,0,0,.9);
  pointer-events: none;
}

.hbar3d-vs {
  font-family: var(--font-game);
  font-size: 12px;
  color: var(--neon-gold);
  text-shadow: 0 0 10px var(--neon-gold);
  background: var(--bg-card);
  border: 1px solid var(--neon-gold);
  border-radius: 50%;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  animation: vsPulse 2s ease-in-out infinite;
}

/* ---- Arena 3D stage ---- */
.arena-3d-outer {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 740px;
  height: 320px;
  margin: 0 auto;
}

.arena-floor-perspective {
  position: absolute;
  bottom: 0;
  left: -8%;
  right: -8%;
  height: 180px;
  perspective: 550px;
  perspective-origin: 50% -30%;
  overflow: hidden;
}

.arena-grid-floor {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 240px;
  transform: rotateX(64deg);
  transform-origin: bottom center;
  background-color: #010013;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 44px, rgba(0,204,255,.2) 45px),
    repeating-linear-gradient(90deg, transparent, transparent 44px, rgba(0,204,255,.2) 45px);
  border-top: 2px solid rgba(0,204,255,.65);
}

.arena-grid-floor::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 100%, rgba(0,204,255,.3) 0%, transparent 55%);
}

.arena-grid-floor::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), var(--neon-pink), var(--neon-cyan), transparent);
  box-shadow: 0 0 18px var(--neon-cyan), 0 0 40px rgba(0,204,255,.4);
}

/* ---- Fighters ---- */
.fighter-3d-pod {
  position: absolute;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 3;
}

.pod-left { left: 2%; }
.pod-right { right: 2%; }

/* Aura rings */
.aura-wrap {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.aura-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid;
  transform: translate(-50%, -50%);
}

.aura-1 { animation: auraExp 2.2s ease-out infinite; }
.aura-2 { animation: auraExp 2.2s ease-out infinite 1.1s; }

@keyframes auraExp {
  0% { width: 75px; height: 75px; opacity: .7; }
  100% { width: 190px; height: 190px; opacity: 0; }
}

.fighter-3d-char {
  font-size: clamp(72px, 15vw, 104px);
  line-height: 1;
  display: block;
  position: relative;
  z-index: 4;
}

.char-flip { transform: scaleX(-1); }

/* Winning/losing/tied animations */
.pod-left.winning .fighter-3d-char {
  animation: charWin .7s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 28px var(--p1-color));
}
.pod-right.winning .fighter-3d-char {
  animation: charWinFlip .7s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 28px var(--p2-color));
}
.fighter-3d-pod.losing .fighter-3d-char {
  animation: charLose 1.1s ease-in-out infinite;
  filter: grayscale(.45) drop-shadow(0 5px 14px rgba(0,0,0,.8));
}
.pod-right.losing .fighter-3d-char { animation: charLoseFlip 1.1s ease-in-out infinite; }
.fighter-3d-pod.tied .fighter-3d-char { animation: charFloat .9s ease-in-out infinite alternate; }
.pod-right.tied .fighter-3d-char { animation: charFloatFlip .9s ease-in-out infinite alternate; }

@keyframes charWin { from { transform:translateY(0) scale(1); } to { transform:translateY(-20px) scale(1.08); } }
@keyframes charWinFlip { from { transform:scaleX(-1) translateY(0); } to { transform:scaleX(-1) translateY(-20px) scale(1.08); } }
@keyframes charLose { 0%,100%{transform:rotate(0)} 25%{transform:rotate(-5deg)} 75%{transform:rotate(5deg)} }
@keyframes charLoseFlip { 0%,100%{transform:scaleX(-1) rotate(0)} 25%{transform:scaleX(-1) rotate(-5deg)} 75%{transform:scaleX(-1) rotate(5deg)} }
@keyframes charFloat { from{transform:translateY(0)} to{transform:translateY(-12px)} }
@keyframes charFloatFlip { from{transform:scaleX(-1) translateY(0)} to{transform:scaleX(-1) translateY(-12px)} }

.fighter-3d-platform {
  width: 95px; height: 16px;
  border-radius: 50%;
  margin-top: -2px;
  animation: platformPulse 2s ease-in-out infinite;
}

.p1-platform { background: radial-gradient(ellipse, rgba(0,204,255,.75), transparent 70%); }
.p2-platform { background: radial-gradient(ellipse, rgba(255,0,221,.75), transparent 70%); }

@keyframes platformPulse {
  0%,100% { transform:scaleX(1); opacity:.6; }
  50% { transform:scaleX(1.45); opacity:1; }
}

.fighter-3d-shadow {
  width: 85px; height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  filter: blur(9px);
  margin-top: -28px;
  position: relative; z-index: 2;
}

.fighter-3d-label { text-align: center; z-index: 4; }
.fighter-3d-name { font-size: 17px; font-weight: 700; }
.fighter-3d-level { font-size: 13px; color: var(--text-dim); margin: 3px 0; }

.fighter-3d-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 14px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.badge-winning {
  background: rgba(0,255,136,.15);
  color: var(--neon-green);
  border: 1px solid rgba(0,255,136,.35);
  animation: badgePulse 1.2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(0,255,136,.3); }
  50% { box-shadow: 0 0 0 7px rgba(0,255,136,0); }
}

.badge-losing { background:rgba(120,120,120,.08); color:var(--text-dim); border:1px solid var(--border); }
.badge-tied { background:rgba(255,215,0,.1); color:var(--neon-gold); border:1px solid rgba(255,215,0,.3); }

/* ---- VS Sphere ---- */
.vs-sphere-center {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid;
}

.orbit-r1 { width:115px; height:115px; border-color:rgba(0,204,255,.4); animation: orbitSpin3d 3s linear infinite; }
.orbit-r2 { width:148px; height:148px; border-color:rgba(255,0,221,.3); animation: orbitSpin3d 5s linear infinite reverse; }
.orbit-r3 { width:182px; height:182px; border-color:rgba(255,215,0,.2); animation: orbitSpin3d 9s linear infinite; }

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

.orbit-dot {
  position: absolute;
  top: -6px; left: 50%;
  transform: translateX(-50%);
  width: 12px; height: 12px;
  border-radius: 50%;
}

.orb-cyan { background:var(--p1-color); box-shadow:0 0 10px var(--p1-color), 0 0 20px var(--p1-color); }
.orb-pink { background:var(--p2-color); box-shadow:0 0 10px var(--p2-color), 0 0 20px var(--p2-color); }
.orb-gold { background:var(--neon-gold); box-shadow:0 0 10px var(--neon-gold); }

.vs-sphere-core {
  width: 70px; height: 70px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 35% 30%, rgba(255,255,200,.15), rgba(80,0,80,.5));
  border: 2px solid var(--neon-gold);
  box-shadow: 0 0 28px rgba(255,215,0,.55), 0 0 60px rgba(255,215,0,.2), inset 0 0 22px rgba(255,215,0,.1);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-game);
  font-size: 12px;
  color: var(--neon-gold);
  text-shadow: 0 0 10px var(--neon-gold);
  animation: vsCorePulse 2s ease-in-out infinite;
  z-index: 6; position: relative;
}

@keyframes vsCorePulse {
  0%,100% { box-shadow:0 0 28px rgba(255,215,0,.55), inset 0 0 22px rgba(255,215,0,.1); transform:scale(1); }
  50% { box-shadow:0 0 50px rgba(255,215,0,.9), 0 0 90px rgba(255,200,0,.35), inset 0 0 32px rgba(255,215,0,.2); transform:scale(1.1); }
}

.vs-flash {
  position: absolute;
  inset: -24px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,215,0,.18), transparent 60%);
  animation: vsFlash 2s ease-in-out infinite;
}

@keyframes vsFlash { 0%,100%{opacity:.4} 50%{opacity:1} }

/* ---- Result panel ---- */
.battle-result-3d {
  position: relative;
  z-index: 2;
  width: calc(100% - 32px);
  max-width: 700px;
  background: var(--bg-card);
  border-radius: 18px;
  padding: 24px;
  margin: 10px 16px 24px;
  text-align: center;
  border: 1px solid var(--border);
}

.result-title-3d {
  font-family: var(--font-game);
  font-size: clamp(13px, 3.5vw, 20px);
  line-height: 1.7;
  margin-bottom: 8px;
}

.result-sub-3d { font-size: 17px; color: var(--text-dim); margin-bottom: 22px; }

.result-tie .result-title-3d { color:var(--neon-gold); text-shadow:0 0 22px rgba(255,215,0,.6); }
.result-p1win .result-title-3d { color:var(--p1-color); text-shadow:0 0 22px rgba(0,204,255,.6); }
.result-p2win .result-title-3d { color:var(--p2-color); text-shadow:0 0 22px rgba(255,0,221,.6); }

.battle-stats-grid-3d { display:grid; grid-template-columns:1fr 1fr; gap:10px; }

.bstat3d {
  background: var(--bg-card2);
  border-radius: 10px;
  padding: 14px 12px;
  border: 1px solid var(--border);
}

.bstat3d-val { font-size: 24px; font-weight: 700; color: var(--acc, var(--neon-cyan)); }
.bstat3d-lbl { font-size: 13px; color: var(--text-dim); margin-top: 3px; }

/* ============ LEVEL UP INFO ============ */
.levelup-info-grid { display:flex; flex-direction:column; gap:8px; }

.lvup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
}
.lvup-row:last-child { border-bottom: none; }
.lvup-label { color: var(--text-dim); font-weight: 600; }
.lvup-val { font-weight: 700; text-align: right; }

/* ============ WINNER BANNER ============ */
.winner-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(255,215,0,.08), rgba(255,119,0,.05));
  border: 1px solid rgba(255,215,0,.3);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}

.winner-banner-avatar { font-size: 44px; flex-shrink: 0; animation: float 2.5s ease-in-out infinite; }
.winner-banner-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--neon-gold); }
.winner-banner-name { font-size: 20px; font-weight: 700; margin-top: 3px; }
.winner-banner-sub { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

/* ============ BADGES EXTRA ============ */
.badge-purple { background:rgba(170,68,255,.1); color:#aa44ff; border:1px solid rgba(170,68,255,.3); }

/* ============ WELCOME PRIZE BANNER ============ */
.welcome-prize-banner {
  background: linear-gradient(135deg, rgba(255,215,0,0.11), rgba(255,119,0,0.08));
  border: 1.5px solid rgba(255,215,0,0.38);
  border-radius: var(--radius);
  padding: 30px 32px;
  text-align: center;
  margin: 24px 0;
  animation: prizeGlow 3s ease-in-out infinite alternate;
}

@keyframes prizeGlow {
  from { box-shadow: 0 0 16px rgba(255,215,0,0.12); }
  to   { box-shadow: 0 0 36px rgba(255,215,0,0.30); }
}

.wpb-eyebrow {
  font-family: var(--font-game);
  font-size: clamp(10px, 1.8vw, 13px);
  color: var(--neon-gold);
  letter-spacing: 3px;
  margin-bottom: 14px;
}

.wpb-prize-text {
  font-size: clamp(20px, 5vw, 30px);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.5;
}

.wpb-prize-text.wpb-empty {
  font-size: clamp(16px, 3.5vw, 20px);
  color: var(--text-dim);
}

.wpb-challenge-tag {
  font-family: var(--font-game);
  font-size: clamp(18px, 3.5vw, 26px);
  font-weight: 700;
  color: var(--neon-gold);
  margin-top: 12px;
  letter-spacing: 2px;
  text-shadow: 0 0 18px rgba(255,215,0,.5);
}

/* ============ DASHBOARD PRIZE CARD ============ */
.dash-prize-card {
  background: linear-gradient(135deg, rgba(255,215,0,0.10), rgba(255,119,0,0.06));
  border: 1px solid rgba(255,215,0,0.30);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-align: center;
  margin-bottom: 16px;
  transition: border-color .2s, box-shadow .2s;
}

.dash-prize-card:hover {
  border-color: rgba(255,215,0,0.5);
  box-shadow: 0 0 20px rgba(255,215,0,0.12);
}

.dpc-eyebrow {
  font-family: var(--font-game);
  font-size: clamp(7px, 1.6vw, 10px);
  color: var(--neon-gold);
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.dpc-prize {
  font-size: clamp(18px, 5vw, 26px);
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 10px;
}

.dpc-prize.dpc-empty {
  font-size: clamp(14px, 3.5vw, 17px);
  color: var(--text-dim);
  line-height: 1.6;
}

.dpc-challenge {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ============ CANVAS BATTLE ============ */
.battle-canvas-page {
  background: #04040e;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.battle-canvas-wrap {
  width: 100%;
  flex-shrink: 0;
}

.battle-canvas {
  display: block;
  width: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 1px solid rgba(0, 204, 255, 0.15);
}

/* ============ PHOTO AVATAR ============ */
.hero-avatar img {
  width: 72px;
  height: 72px;
  image-rendering: pixelated;
  border-radius: 8px;
  object-fit: cover;
  border: 2px solid rgba(0,204,255,.3);
}

.player-select-avatar img {
  border-radius: 6px;
  image-rendering: pixelated;
}

/* ============ CHALLENGE HISTORY CARDS ============ */
.ch-history-card {
  border-left: 3px solid var(--neon-cyan);
}

.ch-lore {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
  font-style: italic;
  padding: 6px 10px;
  background: rgba(0,204,255,0.05);
  border-radius: 6px;
  margin-bottom: 6px;
}

.ch-prize-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(255,215,0,0.07);
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: 8px;
  margin-bottom: 6px;
}

.ch-prize-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.ch-prize-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--neon-gold);
}

.ch-winner-block {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255,215,0,0.1);
  border: 1px solid rgba(255,215,0,0.35);
  border-radius: 10px;
  margin-bottom: 6px;
}

.ch-winner-block.ch-winner-tie {
  background: rgba(0,204,255,0.1);
  border-color: rgba(0,204,255,0.35);
  font-size: 13px;
  font-weight: 700;
  color: var(--neon-cyan);
  justify-content: center;
}

.ch-winner-trophy {
  font-size: 18px;
}

.ch-winner-avatar {
  flex-shrink: 0;
}

.ch-winner-name {
  font-size: 14px;
  font-weight: 700;
  flex: 1;
}

.ch-winner-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--neon-gold);
  letter-spacing: 1px;
  background: rgba(255,215,0,0.15);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ===== MOTIVATION CARD ===== */
.motivation-card {
  background: linear-gradient(135deg, #0f1e40 0%, #0c1530 100%);
  border: 1px solid rgba(24, 216, 255, 0.35);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(24,216,255,.08), 0 2px 12px rgba(0,0,0,.3);
}

.motivation-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
}

.motivation-card.motivation-urgent {
  border-color: rgba(255, 51, 85, 0.55);
  background: linear-gradient(135deg, #1e0d14 0%, #140a18 100%);
  box-shadow: 0 0 20px rgba(255,51,85,.1), 0 2px 12px rgba(0,0,0,.3);
}

.motivation-card.motivation-urgent::before {
  background: linear-gradient(90deg, transparent, var(--neon-red), transparent);
  animation: urgentPulse 1.2s ease-in-out infinite;
}

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

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

.mot-emoji {
  font-size: 26px;
  line-height: 1;
}

.mot-label {
  font-family: var(--font-game);
  font-size: 9px;
  color: var(--neon-cyan);
  letter-spacing: 1px;
}

.motivation-urgent .mot-label {
  color: var(--neon-red);
}

.mot-text {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  font-weight: 500;
}

.mot-days {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ═══════════════════════════════════════════
   RPG PROFILE DASHBOARD (reference: video 4:18)
   ═══════════════════════════════════════════ */

.rpg-profile-row {
  display: grid;
  grid-template-columns: 178px 1fr;
  gap: 12px;
  align-items: start;
}

/* ── Left: character panel ── */
.rpg-profile-panel {
  background: #060d1c;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 24px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.04);
}

.rpp-namebar {
  background: #0b1428;
  border-bottom: 1px solid var(--border-bright);
  padding: 7px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.rpp-name {
  font-family: var(--font-game);
  font-size: 9px;
  letter-spacing: 1px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rpp-niv {
  font-family: var(--font-game);
  font-size: 9px;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}

.rpp-avatar-box {
  background: #04091a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  border-bottom: 1px solid var(--border);
  min-height: 110px;
  position: relative;
}

.rpp-avatar-box::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 100%, rgba(24,216,255,.08) 0%, transparent 65%);
  pointer-events: none;
}

.rpp-rank-box {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
}

.rpp-rank-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  gap: 3px;
}

.rpp-rank-divider {
  width: 1px;
  background: var(--border);
  flex-shrink: 0;
}

.rpp-rlabel {
  font-family: var(--font-game);
  font-size: 8px;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.rpp-rnum {
  font-family: var(--font-game);
  font-size: 30px;
  line-height: 1;
}

.rpp-rname {
  font-size: 12px;
  font-weight: 700;
  color: var(--neon-cyan);
  text-align: center;
  line-height: 1.3;
}

.rpp-stats {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.rpp-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
}

.rpp-stat:last-child { border-bottom: none; }

.rpp-slbl {
  font-family: var(--font-game);
  font-size: 8px;
  color: var(--text-dim);
  letter-spacing: .5px;
  line-height: 1;
}

.rpp-sval {
  font-family: var(--font-game);
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

/* ── Right: data panel ── */
.rpg-main-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rpg-section {
  background: #0b1428;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}

.rpg-sec-label {
  font-family: var(--font-game);
  font-size: 9px;
  color: var(--neon-green);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
  line-height: 1;
}

.rpg-xp-pct {
  font-family: var(--font-game);
  font-size: 28px;
  line-height: 1;
  margin-bottom: 8px;
}

.rpg-xp-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 8px;
}

.rpg-next-name {
  font-family: var(--font-game);
  font-size: 12px;
  color: var(--neon-green);
  line-height: 1.5;
  margin-bottom: 8px;
}

.rpg-next-detail {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.5;
}

.rpg-big-pct {
  font-family: var(--font-game);
  font-size: 34px;
  line-height: 1;
  margin-bottom: 6px;
}

.rpg-reto-name {
  font-size: 14px;
  color: var(--text-dim);
  margin-top: 4px;
}

.rpg-prize-sec {
  border-color: rgba(255,215,0,.35);
  background: linear-gradient(135deg, rgba(255,215,0,.06), rgba(255,119,0,.03));
  transition: border-color .2s;
}
.rpg-prize-sec:hover { border-color: rgba(255,215,0,.6); }

.rpg-prize-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--neon-gold);
  line-height: 1.4;
}

/* Mobile: stack profile above main content */
@media (max-width: 560px) {
  .rpg-profile-row {
    grid-template-columns: 1fr;
  }

  .rpg-profile-panel {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }

  .rpp-namebar {
    grid-column: 1 / -1;
  }

  .rpp-avatar-box {
    border-bottom: none;
    border-right: 1px solid var(--border);
    min-height: 90px;
    padding: 12px;
  }

  .rpp-rank-box {
    border-bottom: none;
    border-bottom: 1px solid var(--border);
  }

  .rpp-stats {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 8px 12px;
    gap: 0;
  }

  .rpp-stat {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 6px 8px;
  }

  .rpp-stat:nth-child(odd) { border-right: 1px solid rgba(255,255,255,.04); }

  .rpg-big-pct { font-size: 24px; }
  .rpg-xp-pct  { font-size: 20px; }
}

/* ============================================
   DESKTOP SIDEBAR & FULL-WINDOW LAYOUT
   ============================================ */

/* Sidebar hidden by default (mobile) */
#sidebar-root { display: none; }

.sidebar {
  position: fixed;
  left: 0; top: 0;
  width: 280px;
  height: 100vh;
  background: rgba(5, 9, 20, 0.99);
  border-right: 1px solid var(--border-bright);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink), var(--neon-cyan));
  background-size: 200%;
  animation: sidebarTopLine 4s linear infinite;
}

@keyframes sidebarTopLine {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

.sidebar-brand {
  padding: 26px 22px 20px;
  font-family: var(--font-game);
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-player-card {
  margin: 14px 12px 6px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0;
}

.sidebar-player-card:hover {
  border-color: var(--neon-cyan);
  background: rgba(24,216,255,.06);
}

.sidebar-player-name {
  font-size: 16px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.sidebar-player-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 4px;
  line-height: 1.2;
}

.sidebar-player-pts {
  font-size: 12px;
  color: var(--neon-gold);
  margin-top: 3px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav-btn {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  background: none;
  border-radius: 8px;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  text-align: left;
  border-left: 3px solid transparent;
}

.sidebar-nav-btn:hover {
  background: rgba(255,255,255,.07);
  color: var(--text);
}

.sidebar-nav-btn.active {
  background: rgba(24,216,255,.12);
  color: var(--neon-cyan);
  border-left-color: var(--neon-cyan);
}

.sidebar-sep {
  height: 1px;
  background: var(--border);
  margin: 8px 12px;
}

.sidebar-bottom {
  padding: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ---- Desktop breakpoint ---- */
@media (min-width: 900px) {
  #sidebar-root { display: block; }

  body.has-sidebar #app {
    margin-left: 280px;
  }

  body.has-sidebar .navbar {
    display: none;
  }

  /* Content fills available width — no max-width, just padding */
  body.has-sidebar .screen {
    max-width: none;
    padding-left: 40px;
    padding-right: 40px;
  }

  body.has-sidebar .screen-wide {
    max-width: none;
    padding-left: 40px;
    padding-right: 40px;
  }

  /* Battle canvas fills the space */
  body.has-sidebar .battle-canvas-wrap {
    padding: 0 40px;
  }

  /* Navbar for desktop-only screens without sidebar */
  .navbar {
    padding: 14px 28px;
    min-height: 62px;
  }
  .navbar-brand { font-size: 13px; }
  .navbar-player { font-size: 15px; gap: 10px; padding: 6px 16px; }
  /* On desktop the hamburger is hidden — sidebar handles navigation */
  .navbar-hamburger { display: none; }

  /* Dashboard RPG profile row — big character card + compact right panel */
  body.has-sidebar .rpg-profile-row {
    grid-template-columns: 360px 1fr;
    align-items: stretch;
  }

  body.has-sidebar .rpg-profile-panel {
    width: 360px;
  }

  /* Scale up all content inside profile panel */
  body.has-sidebar .rpp-namebar {
    padding: 11px 18px;
  }
  body.has-sidebar .rpp-name {
    font-size: 12px;
    letter-spacing: 2px;
  }
  body.has-sidebar .rpp-niv {
    font-size: 12px;
  }
  body.has-sidebar .rpp-avatar-box {
    min-height: 200px;
    padding: 28px 20px;
  }
  body.has-sidebar .rpp-avatar-box img {
    width: 152px !important;
    height: 152px !important;
  }
  body.has-sidebar .rpp-rank-col {
    padding: 16px 12px;
    gap: 6px;
  }
  body.has-sidebar .rpp-rlabel {
    font-size: 10px;
    letter-spacing: 2.5px;
  }
  body.has-sidebar .rpp-rnum {
    font-size: 46px;
  }
  body.has-sidebar .rpp-rname {
    font-size: 16px;
  }
  body.has-sidebar .rpp-stats {
    padding: 10px 18px;
  }
  body.has-sidebar .rpp-stat {
    padding: 10px 0;
  }
  body.has-sidebar .rpp-slbl {
    font-size: 10px;
    letter-spacing: 1px;
  }
  body.has-sidebar .rpp-sval {
    font-size: 13px;
  }

  /* Actualizar Medidas button */
  .dash-update-btn {
    font-size: 16px !important;
    padding: 18px 24px !important;
    letter-spacing: 1.5px;
  }

  /* Right panel sections: compact on desktop */
  body.has-sidebar .rpg-main-panel {
    gap: 8px;
  }
  body.has-sidebar .rpg-section {
    padding: 12px 14px;
  }
  body.has-sidebar .rpg-sec-label {
    font-size: 8px;
    margin-bottom: 8px;
  }
  body.has-sidebar .rpg-xp-pct {
    font-size: 22px;
    margin-bottom: 4px;
  }
  body.has-sidebar .rpg-big-pct {
    font-size: 26px;
    margin-bottom: 4px;
  }
  body.has-sidebar .rpg-xp-labels {
    font-size: 12px;
    margin-top: 6px;
  }
  body.has-sidebar .rpg-next-name {
    font-size: 11px;
    margin-bottom: 4px;
  }
  body.has-sidebar .rpg-next-detail {
    font-size: 13px;
  }
  body.has-sidebar .rpg-reto-name {
    font-size: 12px;
  }
  body.has-sidebar .rpg-prize-val {
    font-size: 15px;
  }

  /* Stats grid: more columns */
  body.has-sidebar .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Battle stats: 3 columns on desktop */
  body.has-sidebar .battle-stats-grid-3d {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---- iPhone stays the same ---- */
@media (max-width: 899px) {
  #sidebar-root { display: none !important; }
  body.has-sidebar #app { margin-left: 0; }
  body.has-sidebar .navbar { display: flex; }
  .player-select-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 140px)); gap: 12px; justify-content: center; }
}

/* ============ PODIO DINÁMICO ============ */
.podium-scroll-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.podium-flex {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 0 0;
  min-width: max-content;
}

/* ============ ADD PLAYER CARD ============ */
.add-player-card {
  border: 2px dashed rgba(0, 255, 153, 0.35) !important;
  background: rgba(0, 255, 153, 0.02) !important;
  box-shadow: none !important;
}

.add-player-card:hover {
  border-color: var(--neon-green) !important;
  background: rgba(0, 255, 153, 0.07) !important;
  box-shadow: 0 0 28px rgba(0, 255, 153, 0.2), 0 8px 30px rgba(0,0,0,.4) !important;
  transform: translateY(-5px) !important;
}

/* ============ DATA BUTTONS (export / import / demo) ============ */
.btn-data {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-dim);
  border-radius: 8px;
  padding: 8px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.btn-data:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  background: rgba(24,216,255,0.07);
}
.btn-data-demo {
  border-color: rgba(255,215,0,0.25);
  color: rgba(255,215,0,0.7);
}
.btn-data-demo:hover {
  border-color: var(--neon-gold);
  color: var(--neon-gold);
  background: rgba(255,215,0,0.07);
}

/* ============ WELCOME DESKTOP HERO ============ */
@media (min-width: 900px) {
  .welcome-hero {
    padding: 60px 48px 48px;
  }

  .welcome-logo {
    font-size: clamp(28px, 4.5vw, 46px);
  }

  .welcome-sub {
    font-size: 22px;
    margin-bottom: 36px;
  }

  .screen-welcome {
    max-width: none;
    padding-left: 80px;
    padding-right: 80px;
  }

  .welcome-prize-banner {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
  }

  .player-select-grid {
    max-width: 900px;
  }
}

/* ============ MAC PWA INSTALL BUTTON ============ */
.btn-mac {
  background: rgba(100, 100, 120, 0.14);
  color: #c0c8e0;
  border: 2px solid rgba(140, 140, 180, 0.4);
  font-size: 17px;
}
.btn-mac:hover {
  background: rgba(140, 140, 180, 0.22);
  border-color: rgba(180, 180, 220, 0.7);
  box-shadow: 0 0 20px rgba(160,160,220,.25);
}

/* ============ PIN PAD ============ */
.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-bright);
  transition: all .2s;
  background: transparent;
}
.pin-dot.filled {
  background: var(--neon-cyan);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan);
}
.pin-dot.shake {
  animation: pinShake .4s ease;
  border-color: var(--neon-red);
}
@keyframes pinShake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.pin-numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 220px;
  margin: 0 auto 8px;
}

.pin-pad-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-bright);
  color: var(--text);
  border-radius: 12px;
  padding: 16px 8px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  font-family: var(--font-body);
}
.pin-pad-btn:hover { background: rgba(24,216,255,0.1); border-color: var(--neon-cyan); color: var(--neon-cyan); }
.pin-pad-btn:active { transform: scale(.92); }
