/* ============================================================
   CARD CHAMPIONS – stylesheet
   ============================================================ */

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --bg:         #0d0d1a;
  --bg2:        #1a1a2e;
  --bg3:        #16213e;
  --border:     #2a2a4a;
  --text:       #e8eaf6;
  --text2:      #9fa8da;
  --blue:       #4a90d9;
  --green:      #43a047;
  --gold:       #ffc107;
  --red:        #e53935;
  --nav-h:      62px;
  --radius:     12px;
  --card-w:     158px;
  --card-h:     225px;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Nav ─────────────────────────────────────────────────────── */
#navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 20px; gap: 16px;
  z-index: 200;
}
.nav-brand {
  font-size: 1.15rem; font-weight: 800;
  color: var(--gold); white-space: nowrap; min-width: 160px;
}
.nav-links { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.nav-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 7px 14px; border-radius: 8px;
  cursor: pointer; font-size: 0.85rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nav-btn:hover  { background: var(--bg3); color: var(--text); }
.nav-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.nav-coins { margin-left: auto; font-weight: 700; color: var(--gold); white-space: nowrap; }

/* ── Main ────────────────────────────────────────────────────── */
#main-content {
  margin-top: var(--nav-h);
  padding: 28px 24px;
  min-height: calc(100vh - var(--nav-h));
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-block; padding: 10px 22px;
  border: none; border-radius: 8px;
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}
.btn:hover  { filter: brightness(1.15); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-gold     { background: var(--gold); color: #1a1a00; }
.btn-blue     { background: var(--blue); color: #fff; }
.btn-green    { background: var(--green); color: #fff; }
.btn-red      { background: var(--red); color: #fff; }
.btn-disabled { background: #333; color: #666; cursor: not-allowed; }
.btn-disabled:hover { filter: none; transform: none; }

/* ── Shared Screen Elements ──────────────────────────────────── */
.screen-header {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.screen-header h2 { font-size: 1.6rem; font-weight: 800; }
.screen-sub  { color: var(--text2); font-size: 0.95rem; }

.mode-tabs { display: flex; gap: 8px; }
.tab-btn {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); padding: 8px 18px; border-radius: 8px;
  cursor: pointer; font-size: 0.9rem; font-weight: 600;
  transition: all 0.15s;
}
.tab-btn:hover  { color: var(--text); border-color: #555; }
.tab-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }

.coins-inline {
  margin-left: auto; font-weight: 700; color: var(--gold); font-size: 1rem;
}

/* ── Cards grid ──────────────────────────────────────────────── */
.cards-grid {
  display: flex; flex-wrap: wrap; gap: 18px;
}

/* ── Pokemon Card ────────────────────────────────────────────── */
.pokemon-card {
  position: relative;
  width: var(--card-w); height: var(--card-h);
  border-radius: var(--radius); border: 3px solid;
  padding: 10px 8px 8px;
  display: flex; flex-direction: column; gap: 4px;
  transition: transform 0.18s, box-shadow 0.18s;
  user-select: none;
}
.pokemon-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.55);
}
.pokemon-card.selectable { cursor: pointer; }
.pokemon-card.selected   { outline: 3px solid var(--gold); transform: translateY(-5px); box-shadow: 0 0 20px rgba(255,193,7,0.5); }

.pc-header  { display: flex; justify-content: space-between; align-items: center; }
.pc-name    { font-weight: 800; font-size: 0.8rem; color: #fff; text-shadow: 0 1px 3px #0008; }
.pc-hp      { font-size: 0.75rem; font-weight: 700; color: #fff; background: rgba(0,0,0,0.35); padding: 1px 5px; border-radius: 4px; }
.pc-emoji   { font-size: 2.6rem; text-align: center; line-height: 1; margin: 4px 0; filter: drop-shadow(0 2px 4px #0005); }
.pc-type    { font-size: 0.7rem; font-weight: 600; padding: 2px 7px; border-radius: 10px; width: fit-content; margin: 0 auto; }
.pc-attacks { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; flex: 1; }
.pc-attack  { display: flex; justify-content: space-between; align-items: center; background: rgba(0,0,0,0.3); padding: 3px 6px; border-radius: 5px; font-size: 0.68rem; }
.atk-dmg    { font-weight: 800; color: #fff; }
.pc-footer  { display: flex; justify-content: space-between; align-items: center; margin-top: 3px; }
.pc-rarity  { font-size: 0.65rem; letter-spacing: -1px; }
.pc-label   { font-size: 0.6rem; color: rgba(255,255,255,0.7); }

/* ── Football Card ───────────────────────────────────────────── */
.football-card {
  position: relative;
  width: var(--card-w); height: var(--card-h);
  border-radius: var(--radius); border: 2px solid;
  padding: 10px 9px 8px;
  display: flex; flex-direction: column; gap: 4px;
  transition: transform 0.18s, box-shadow 0.18s;
  user-select: none;
}
.football-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.55);
}
.football-card.selectable { cursor: pointer; }
.football-card.selected   { outline: 3px solid var(--gold); transform: translateY(-5px); box-shadow: 0 0 20px rgba(255,193,7,0.5); }

.fc-top { display: flex; align-items: flex-start; justify-content: space-between; }
.fc-rating { font-size: 1.7rem; font-weight: 900; line-height: 1; }
.fc-pos-nation { display: flex; flex-direction: column; align-items: center; }
.fc-pos  { font-size: 0.7rem; font-weight: 800; color: var(--text); }
.fc-nation { font-size: 1rem; }
.fc-tier-badge { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.fc-name { font-size: 0.82rem; font-weight: 800; color: #fff; text-align: center; margin-top: 4px; text-shadow: 0 1px 3px #0007; }
.fc-team { font-size: 0.65rem; color: rgba(255,255,255,0.6); text-align: center; font-weight: 600; letter-spacing: 1px; }
.fc-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 4px; margin-top: auto;
}
.fc-stat { display: flex; flex-direction: column; align-items: center; background: rgba(0,0,0,0.3); border-radius: 4px; padding: 3px 0; }
.fc-stat span  { font-size: 0.78rem; font-weight: 800; color: #fff; }
.fc-stat label { font-size: 0.55rem; color: rgba(255,255,255,0.6); font-weight: 600; letter-spacing: 0.5px; }

/* ── Shared card badges ──────────────────────────────────────── */
.card-count {
  position: absolute; top: -8px; right: -8px;
  background: var(--blue); color: #fff;
  font-size: 0.65rem; font-weight: 800;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.selected-badge {
  position: absolute; top: -8px; left: -8px;
  background: var(--gold); color: #1a1a00;
  font-size: 0.7rem; font-weight: 900;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.pokemon-card.small, .football-card.small {
  width: 130px; height: 185px; font-size: 0.85em;
}
.pokemon-card.small .pc-emoji   { font-size: 2rem; }
.pokemon-card.small .fc-rating  { font-size: 1.3rem; }

/* ── Home Screen ─────────────────────────────────────────────── */
.home-screen { max-width: 900px; }
.home-hero { text-align: center; margin-bottom: 36px; }
.hero-title { font-size: 3rem; font-weight: 900; background: linear-gradient(135deg, var(--gold), #ff9800); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub   { color: var(--text2); font-size: 1.1rem; margin-top: 6px; letter-spacing: 2px; }

.home-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 16px; text-align: center;
}
.stat-num { font-size: 2rem; font-weight: 900; color: var(--gold); }
.stat-lbl { font-size: 0.85rem; color: var(--text2); margin-top: 4px; }

.home-daily {
  border-radius: var(--radius); padding: 18px 22px;
  margin-bottom: 28px; border: 2px solid;
}
.home-daily.can-claim { background: linear-gradient(135deg,#1a2a00,#2a4400); border-color: var(--gold); }
.home-daily.claimed   { background: var(--bg2); border-color: var(--border); }
.daily-inner { display: flex; align-items: center; gap: 16px; }
.claimed-inner { opacity: 0.5; }
.daily-icon  { font-size: 2rem; }
.daily-title { font-weight: 700; font-size: 1rem; }
.daily-sub   { color: var(--text2); font-size: 0.85rem; margin-top: 2px; }

.home-modes { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.mode-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer; transition: border-color 0.2s, transform 0.2s;
}
.mode-card:hover { transform: translateY(-3px); }
.pokemon-mode:hover { border-color: #FFEE58; }
.football-mode:hover { border-color: var(--green); }
.mode-emoji { font-size: 2.5rem; }
.mode-name  { font-size: 1.2rem; font-weight: 800; }
.mode-desc  { color: var(--text2); font-size: 0.88rem; text-align: center; }

/* ── Empty State ─────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 60px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty-icon { font-size: 4rem; }
.empty-state p  { font-size: 1.1rem; font-weight: 600; }
.empty-sub { color: var(--text2); font-size: 0.9rem; }

/* ── Packs Screen ────────────────────────────────────────────── */
.packs-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.pack-card {
  background: var(--bg2); border: 2px solid;
  border-radius: var(--radius); padding: 24px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center;
}
.pack-emoji { font-size: 3rem; }
.pack-name  { font-size: 1.15rem; font-weight: 800; }
.pack-desc  { color: var(--text2); font-size: 0.85rem; }
.pack-count { font-size: 0.9rem; color: var(--text2); }
.pack-count strong { color: var(--text); font-size: 1.1rem; }
.pack-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; width: 100%; }

/* ── Battle Screen – Setup ───────────────────────────────────── */
.battle-select-info {
  display: flex; align-items: center; gap: 16px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 20px;
  margin-bottom: 20px; font-weight: 600;
}

/* ── Battle Screen – Active ──────────────────────────────────── */
.battle-active {
  display: flex; flex-direction: column; gap: 12px;
  max-width: 680px;
}
.team-bar {
  display: flex; gap: 12px; align-items: center;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 14px;
}
.team-slot {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 8px; border-radius: 6px; min-width: 48px;
  font-size: 1.4rem;
}
.team-slot small  { font-size: 0.65rem; color: var(--text2); }
.team-slot.active { background: rgba(74,144,217,0.2); border: 1px solid var(--blue); }
.team-slot.fainted{ opacity: 0.3; text-decoration: line-through; }

.arena-half {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
}
.arena-pokemon { display: flex; align-items: center; gap: 16px; }
.arena-emoji   { font-size: 3.5rem; line-height: 1; }
.arena-info    { flex: 1; }
.arena-name    { font-weight: 700; font-size: 1rem; margin-bottom: 6px; }
.arena-type    { font-size: 0.8rem; margin-left: 8px; font-weight: 600; }
.hp-bar-wrap   { background: #333; border-radius: 4px; height: 10px; overflow: hidden; margin-bottom: 4px; }
.hp-bar        { height: 100%; border-radius: 4px; transition: width 0.3s; }
.hp-text       { font-size: 0.75rem; color: var(--text2); }

.battle-log {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px;
  min-height: 70px; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px;
}
.battle-log p { font-size: 0.85rem; color: var(--text2); }
.battle-log p:last-child { color: var(--text); font-weight: 600; }

.attack-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.attack-btn {
  background: var(--bg3); border: 2px solid var(--border);
  color: var(--text); border-radius: 10px; padding: 12px 16px;
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  font-size: 0.9rem; font-weight: 600;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.attack-btn:hover { background: var(--blue); border-color: var(--blue); transform: scale(1.02); }
.attack-btn .atk-name { font-weight: 700; }
.attack-btn .atk-dmg  { background: rgba(255,255,255,0.15); padding: 2px 8px; border-radius: 10px; font-size: 0.8rem; }

.battle-result {
  border-radius: var(--radius); padding: 24px;
  text-align: center; display: flex; flex-direction: column; gap: 12px;
}
.battle-result.win  { background: linear-gradient(135deg,#0a2a00,#1a5c00); border: 2px solid var(--green); }
.battle-result.lose { background: linear-gradient(135deg,#2a0000,#5c1400); border: 2px solid var(--red); }
.result-title  { font-size: 2rem; font-weight: 900; }
.result-reward { color: var(--gold); font-size: 1.1rem; font-weight: 700; }
.result-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Match Screen ────────────────────────────────────────────── */
.match-result-screen { display: flex; flex-direction: column; gap: 24px; max-width: 760px; }

.match-scoreboard {
  display: grid; grid-template-columns: 1fr auto 1fr;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  align-items: center; gap: 20px;
}
.match-team { text-align: center; }
.team-label { font-size: 1.1rem; font-weight: 800; color: var(--text2); letter-spacing: 2px; }
.team-avg   { font-size: 0.85rem; color: var(--gold); margin-top: 4px; }
.match-score { text-align: center; }
.score-nums  { font-size: 3rem; font-weight: 900; line-height: 1; }
.result-label{ font-size: 1.1rem; font-weight: 700; margin-top: 6px; }


/* ── Status badges (battle) ──────────────────────────────────── */
.status-badge {
  display: inline-block; font-size: 0.65rem; font-weight: 700;
  padding: 2px 6px; border-radius: 6px; border: 1px solid; margin-left: 6px;
  vertical-align: middle;
}
.slot-status { font-size: 0.75rem; }
.atk-type    { font-size: 0.65rem; opacity: 0.8; margin-left: 4px; }
.atk-right   { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.atk-status  { background: rgba(255,255,255,0.12); padding: 1px 7px; border-radius: 8px; font-size: 0.75rem; color: #ccc; }
.atk-effect  { font-size: 0.7rem; opacity: 0.75; }
.eff-super   { color: #fff176; font-size: 0.72rem; font-weight: 700; }
.eff-weak    { color: #90a4ae; font-size: 0.72rem; }
.log-latest  { color: var(--text) !important; font-weight: 700 !important; }
.disabled-btn { opacity: 0.5; cursor: not-allowed; }

/* ── Live match screen ───────────────────────────────────────── */
.match-live-screen { max-width: 700px; display: flex; flex-direction: column; gap: 14px; }
.live-minute { font-size: 0.95rem; font-weight: 700; color: var(--text2); margin-top: 4px; }

#pitch-canvas {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  border: 2px solid #2e7d32;
  display: block;
  background: #1b5e20;
}

.live-ticker {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  max-height: 200px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 5px;
}
.ticker-waiting { color: var(--text2); text-align: center; padding: 20px; }

/* ── Match result screen ─────────────────────────────────────── */
.match-result-screen { display: flex; flex-direction: column; gap: 20px; }
.match-body   { display: grid; grid-template-columns: 340px 1fr; gap: 20px; }
.match-left   { display: flex; flex-direction: column; gap: 16px; }
.match-right  { overflow: hidden; }

.match-stats-block {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}
.match-stats-block h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 12px; }

.poss-bar {
  display: flex; height: 24px; border-radius: 6px; overflow: hidden;
  margin-bottom: 4px;
}
.poss-fill-p { background: var(--blue); color: #fff; font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.poss-fill-a { background: #c62828; color: #fff; font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.poss-labels { font-size: 0.75rem; color: var(--text2); text-align: center; margin-bottom: 10px; }

.stats-table { display: flex; flex-direction: column; gap: 4px; }
.stat-row { display: grid; grid-template-columns: 1fr 2fr 1fr; text-align: center; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.stat-row.header { font-size: 0.75rem; font-weight: 700; color: var(--text2); border-bottom: 2px solid var(--border); }
.sr-label { color: var(--text2); font-size: 0.8rem; }
.sr-val   { font-weight: 700; }
.sr-val.high { color: var(--gold); }

.match-reward-box {
  background: linear-gradient(135deg,#1a1a00,#3a3000); border: 1px solid var(--gold);
  border-radius: 8px; padding: 12px 20px; text-align: center; font-size: 1.1rem; color: var(--gold);
}

.match-timeline {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  max-height: 520px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.match-timeline h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 10px; }

.match-event { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; padding: 5px 8px; border-radius: 6px; }
.match-event.player   { background: rgba(76,175,80,0.1);  color: #a5d6a7; }
.match-event.ai       { background: rgba(244,67,54,0.1);  color: #ef9a9a; }
.match-event.divider  { justify-content: center; color: var(--text2); font-weight: 700; font-size: 0.82rem; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }
.event-min  { background: var(--bg3); padding: 2px 6px; border-radius: 5px; font-weight: 700; font-size: 0.75rem; min-width: 32px; text-align: center; flex-shrink: 0; }
.event-icon { flex-shrink: 0; }
.event-text { flex: 1; }

.match-squads { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.squad-section h4 { margin-bottom: 12px; font-size: 0.95rem; color: var(--text2); font-weight: 700; }
.squad-cards  { display: flex; flex-wrap: wrap; gap: 10px; }
.match-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Pack Opening Modal ──────────────────────────────────────── */
#modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
}
#modal-overlay.hidden { display: none; }

.pack-open-modal {
  background: var(--bg2); border: 2px solid var(--border);
  border-radius: 16px; padding: 28px 24px;
  max-width: 740px; width: 95vw;
  display: flex; flex-direction: column; gap: 20px;
  max-height: 92vh; overflow-y: auto;
}
.pack-open-header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 1.2rem; font-weight: 800;
}
.pack-open-sub { color: var(--text2); font-size: 0.9rem; }
.pack-open-cards { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.pack-card-slot { cursor: pointer; }

.card-back {
  width: var(--card-w); height: var(--card-h);
  border-radius: var(--radius); border: 3px solid;
  background: linear-gradient(135deg, #1a1a2e, #0d0d1a);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform 0.15s;
}
.card-back:hover { transform: translateY(-4px) scale(1.03); }
.card-back-inner { font-size: 3.5rem; opacity: 0.4; }

.pack-open-actions { display: flex; gap: 12px; justify-content: center; }

/* ── Beyblade card ───────────────────────────────────────────── */
.bey-card {
  position: relative;
  width: var(--card-w); height: var(--card-h);
  border-radius: var(--radius); border: 2px solid;
  padding: 10px 9px 8px;
  display: flex; flex-direction: column; gap: 5px;
  transition: transform 0.18s, box-shadow 0.18s;
  user-select: none;
}
.bey-card:hover { transform: translateY(-5px); box-shadow: 0 12px 28px rgba(0,0,0,0.6); }
.bey-card.selectable { cursor: pointer; }
.bey-card.selected   { outline: 3px solid var(--gold); transform: translateY(-5px); box-shadow: 0 0 22px rgba(255,193,7,0.55); }
.bc-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 4px; }
.bc-name   { font-size: 0.72rem; font-weight: 800; color: #fff; text-shadow: 0 1px 4px #0009; line-height: 1.2; }
.bc-type-badge { font-size: 0.58rem; font-weight: 800; text-transform: uppercase; white-space: nowrap; }
.bc-emoji  { font-size: 2.4rem; text-align: center; filter: drop-shadow(0 2px 6px #0007); }
.bc-type-label { font-size: 0.62rem; font-weight: 700; letter-spacing: 2px; color: rgba(255,255,255,0.55); text-align: center; }
.bc-stats  { display: flex; flex-direction: column; gap: 3px; flex: 1; margin-top: 2px; }
.bc-stat-row { display: flex; align-items: center; gap: 5px; font-size: 0.62rem; color: rgba(255,255,255,0.7); }
.bc-stat-row span:last-child { font-weight: 800; color: #fff; min-width: 22px; text-align: right; }
.bc-bar    { flex: 1; height: 5px; background: rgba(255,255,255,0.15); border-radius: 3px; overflow: hidden; }
.bc-fill   { height: 100%; border-radius: 3px; transition: width 0.3s; }
.atk-fill  { background: #f44336; }
.def-fill  { background: #2196f3; }
.stm-fill  { background: #4caf50; }
.spd-fill  { background: #ffc107; }
.bc-special { font-size: 0.6rem; color: rgba(255,220,80,0.85); font-weight: 700; margin-top: 2px;
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bey-card.small { width: 130px; height: 185px; }
.bey-card.small .bc-emoji { font-size: 1.8rem; }

/* ── Beyblade arena ──────────────────────────────────────────── */
.bey-arena-screen {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 720px;
}
#bey-canvas {
  width: 100%; aspect-ratio: 16/9;
  border-radius: var(--radius);
  border: 2px solid #3a2070;
  display: block; background: #0a0a1a;
}
.bey-hud {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.bey-hp-row {
  display: flex; align-items: center; gap: 10px;
}
.bey-hp-row.ai-row { opacity: 0.85; }
.bey-hp-name { font-size: 0.82rem; font-weight: 700; min-width: 130px; }
.bey-hp-bar-wrap { flex: 1; height: 10px; background: #333; border-radius: 5px; overflow: hidden; }
.bey-hp-bar  { height: 100%; border-radius: 5px; transition: width 0.3s; }
.bey-hp-val  { font-size: 0.78rem; font-weight: 800; min-width: 34px; text-align: right; }
.bey-hud-log { font-size: 0.82rem; display: flex; flex-direction: column; gap: 2px; min-height: 52px; }
.bey-hud-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.bey-hp-name { font-size: 0.80rem; font-weight: 700; min-width: 110px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }

/* Stadium selector */
.bey-stadium-selector {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px;
}
.bey-stad-btn {
  flex: 1; min-width: 160px; display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 10px 12px; border-radius: var(--radius);
  border: 2px solid var(--border); background: var(--bg2); cursor: pointer;
  transition: border-color 0.2s, background 0.2s; color: var(--text);
}
.bey-stad-btn:hover   { border-color: #9575cd; background: var(--bg3); }
.bey-stad-btn.active  { border-color: #ce93d8; background: #2a1a40; box-shadow: 0 0 14px #9575cd55; }
.bey-stad-emoji       { font-size: 1.5rem; }
.bey-stad-name        { font-size: 0.82rem; font-weight: 700; }
.bey-stad-desc        { font-size: 0.72rem; color: var(--text2); text-align: center; }

/* Ability preview (setup) */
.bey-ability-preview {
  background: #1a1030; border: 1px solid #5e35b1;
  border-radius: var(--radius); padding: 8px 14px;
  font-size: 0.84rem; color: #ce93d8; margin-bottom: 4px;
}

/* Arena header bar */
.bey-arena-header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 6px;
  background: #120825; border: 1px solid #3a2070;
  border-radius: var(--radius); padding: 7px 14px;
  font-size: 0.78rem;
}
.bey-stadium-label { font-weight: 700; color: #ce93d8; }
.bey-ability-label { color: var(--text2); }

/* Type badge inside HP row */
.bey-type-badge {
  font-size: 0.66rem; font-weight: 700; padding: 1px 5px;
  border-radius: 6px; background: #2a1a40; color: #ce93d8;
  border: 1px solid #5e35b1; white-space: nowrap;
}

/* Status badges (buff / curse) */
.bey-badge {
  font-size: 0.68rem; font-weight: 700; padding: 1px 5px;
  border-radius: 6px; white-space: nowrap;
}
.bey-buff  { background: #1a3a20; color: #69f0ae; border: 1px solid #388e3c; }
.bey-curse { background: #3a1010; color: #ff5252; border: 1px solid #c62828; }

/* Combo counter */
.bey-combo {
  font-size: 1.0rem; font-weight: 900; text-align: center;
  color: #ff9800; letter-spacing: 1px; min-height: 1.2em;
  transition: color 0.2s;
}
.bey-combo.bey-combo-hot { color: #ff1744; text-shadow: 0 0 10px #ff1744; }

.bey-result {
  border: 2px solid; border-radius: var(--radius); padding: 28px;
  background: var(--bg2); max-width: 600px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.bey-result-beys { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center; }
.vs-label { font-size: 1.8rem; font-weight: 900; color: var(--text2); }
.beyblade-mode:hover  { border-color: #ef5350; }
.badminton-mode:hover { border-color: #66bb6a; }

/* ── Badminton card ──────────────────────────────────────────── */
.bad-card {
  position: relative; border-radius: var(--radius); border: 2px solid;
  padding: 12px; width: 170px; display: flex; flex-direction: column; gap: 6px;
  transition: transform 0.18s, box-shadow 0.18s;
}
.bad-card:hover   { transform: translateY(-5px); box-shadow: 0 12px 28px rgba(0,0,0,0.6); }
.bad-card.selectable { cursor: pointer; }
.bad-card.selected   { outline: 3px solid var(--gold); transform: translateY(-5px); box-shadow: 0 0 22px rgba(255,193,7,0.55); }
.bad-card.small      { width: 130px; }

.bad-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; }
.bad-rating { font-size: 1.6rem; font-weight: 900; line-height: 1; }
.bad-info { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.bad-specialty { font-size: 0.65rem; color: var(--text2); text-align: center; font-style: italic; }
.bad-nation    { font-size: 0.72rem; font-weight: 600; }
.bad-rarity-badge { font-size: 0.68rem; font-weight: 700; text-align: right; }
.bad-name { font-size: 0.92rem; font-weight: 800; text-align: center; }
.bad-rarity-stars { font-size: 0.7rem; text-align: center; letter-spacing: 1px; }

.bad-stats { display: flex; flex-direction: column; gap: 3px; }
.bad-stat-row { display: flex; align-items: center; gap: 5px; font-size: 0.68rem; }
.bad-stat-row span:first-child { width: 24px; font-weight: 700; color: var(--text2); }
.bad-stat-row span:last-child  { width: 24px; text-align: right; font-weight: 700; }
.bad-bar { flex: 1; height: 5px; background: rgba(255,255,255,0.12); border-radius: 3px; overflow: hidden; }
.bad-fill { height: 100%; border-radius: 3px; }
.bad-smh { background: #ef5350; }
.bad-drv { background: #42a5f5; }
.bad-net { background: #66bb6a; }
.bad-ftw { background: #ffa726; }
.bad-stm { background: #ab47bc; }

/* ── Badminton screen ────────────────────────────────────────── */
.bad-screen { display: flex; flex-direction: column; gap: 16px; max-width: 800px; }
#bad-canvas {
  width: 100%; aspect-ratio: 2 / 1;
  border-radius: var(--radius);
  border: 2px solid #2e7d32;
  display: block; background: #1a3a1c;
}

/* Live match header */
.bad-match-header {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
}
.bad-player-side { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.bad-ai-side { align-items: flex-end; }
.bad-player-name { font-size: 1rem; font-weight: 800; }
.bad-player-nation { font-size: 0.75rem; color: var(--text2); }
.bad-score-center { text-align: center; flex: 0 0 120px; }
.bad-live-score { font-size: 2.4rem; font-weight: 900; color: var(--gold); line-height: 1; }
.bad-set-label { font-size: 0.72rem; color: var(--text2); margin: 2px 0; }
.bad-set-score { font-size: 0.85rem; font-weight: 700; padding: 2px 6px; border-radius: 6px; margin: 0 2px; background: var(--bg3); }
.bad-set-score.player { color: #66bb6a; }
.bad-set-score.ai     { color: #ef5350; }

/* Court */
.bad-court-wrap { display: flex; justify-content: center; }
.bad-court {
  position: relative; width: 100%; max-width: 520px; height: 160px;
  background: #2e7d32; border: 3px solid #fff; border-radius: 4px;
  display: flex; overflow: hidden;
}
.bad-court-half { flex: 1; position: relative; border: 1px solid rgba(255,255,255,0.4); }
.bad-court-net {
  width: 6px; background: #fff; align-self: stretch; flex-shrink: 0;
  box-shadow: 0 0 8px rgba(255,255,255,0.8);
}
.bad-shuttle {
  position: absolute; top: 50%; transform: translateY(-50%);
  left: 50%; width: 14px; height: 14px; background: #fff;
  border-radius: 50%; box-shadow: 0 0 10px #fff, 0 0 20px rgba(255,255,255,0.7);
  transition: left 0.4s ease;
  margin-left: -7px;
}

/* Ticker */
.bad-ticker { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; min-height: 80px; max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }

/* Result */
.bad-result {
  border: 2px solid; border-radius: var(--radius); padding: 24px;
  background: var(--bg2); display: flex; flex-direction: column;
  align-items: center; gap: 16px; max-width: 640px;
}
.bad-result-title { font-size: 1.8rem; font-weight: 900; }
.bad-result-scoreline { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center; }
.bad-result-player { text-align: center; }
.bad-result-name   { font-weight: 800; font-size: 1rem; }
.bad-result-nation { font-size: 0.75rem; color: var(--text2); }
.bad-result-rating { font-size: 1.4rem; font-weight: 900; color: var(--gold); }
.bad-result-sets   { font-size: 2.2rem; font-weight: 900; }
.bad-result-sets-detail { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.bad-set-pill { padding: 4px 12px; border-radius: 20px; font-size: 0.82rem; font-weight: 700; }
.bad-set-pill.player { background: #1b3a1d; color: #66bb6a; border: 1px solid #66bb6a; }
.bad-set-pill.ai     { background: #3a1b1b; color: #ef5350; border: 1px solid #ef5350; }
.bad-result-stats { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; font-size: 0.88rem; }
.bad-result-cards { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center; }

/* ── Toast ───────────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(60px);
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text); padding: 12px 28px; border-radius: 30px;
  font-weight: 600; font-size: 0.95rem; z-index: 999;
  transition: transform 0.3s, opacity 0.3s; opacity: 0;
}
#toast.show    { transform: translateX(-50%) translateY(0); opacity: 1; }
#toast.success { border-color: var(--green); }
#toast.error   { border-color: var(--red); background: #2a0000; }

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

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 700px) {
  :root { --card-w: 140px; --card-h: 200px; }
  #main-content { padding: 16px 12px; }
  .home-stats { grid-template-columns: repeat(2,1fr); }
  .home-modes { grid-template-columns: 1fr 1fr; }
  .match-squads { grid-template-columns: 1fr; }
  .nav-links { gap: 4px; }
  .nav-btn   { padding: 6px 10px; font-size: 0.78rem; }
}
