:root {
  --bg: #0b0e14;
  --panel: #121724;
  --card: #1a2133;
  --card-hover: #232d45;
  --line: #27304a;
  --text: #e8ecf5;
  --muted: #8d99b5;
  --accent: #f6a21b;
  --accent-2: #ff6b3d;
  --green: #3ecf7a;
  --red: #ff5964;
  --blue: #5aa2ff;
  --radius: 14px;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(1200px 700px at 80% -10%, #1b2440 0%, var(--bg) 55%);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  min-height: 100vh;
}

.app {
  display: grid;
  grid-template-columns: 330px 1fr;
  min-height: 100vh;
}

/* ---------- Side panel ---------- */
.panel {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.top h1 {
  font-family: "Roboto Condensed", sans-serif;
  font-size: 1.7rem;
  margin: 0 0 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.accent { color: var(--accent); }
.tagline { margin: 0; color: var(--muted); font-size: 0.85rem; line-height: 1.4; }

.roster { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }

.roster-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  min-height: 48px;
}
.roster-row.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.roster-row.filled { border-color: #35406033; }
.roster-row .pos {
  font-family: "Roboto Condensed", sans-serif;
  font-weight: 800;
  font-size: 0.72rem;
  color: var(--muted);
  width: 86px;
  flex: none;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.roster-row.active .pos { color: var(--accent); }
.roster-row img { width: 36px; height: 36px; image-rendering: auto; flex: none; }
.roster-row .pick-name { font-weight: 600; font-size: 0.9rem; }
.roster-row .empty-dash { color: #3c4663; font-weight: 700; }

.panel-foot { margin-top: auto; }

/* ---------- Main ---------- */
.main { padding: 28px clamp(16px, 4vw, 48px); max-width: 1100px; }

h2.heading {
  font-family: "Roboto Condensed", sans-serif;
  text-transform: uppercase;
  font-size: 1.5rem;
  letter-spacing: 0.5px;
  margin: 0 0 4px;
}
.sub { color: var(--muted); margin: 0 0 22px; font-size: 0.95rem; }
.sub strong { color: var(--text); }

/* Draft choices */
.choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}
.choice {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 12px 14px;
  text-align: center;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
.choice:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: var(--card-hover);
}
.choice img { width: 110px; height: 110px; object-fit: contain; filter: drop-shadow(0 6px 12px #0007); }
.choice .name { font-weight: 700; margin-top: 8px; font-size: 1rem; }
.choice .hint { color: var(--muted); font-size: 0.75rem; margin-top: 3px; }

/* Buttons */
.btn {
  font: inherit;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #19100a;
  transition: filter 0.12s ease, transform 0.12s ease;
}
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  font-weight: 600;
}
.btn.ghost:hover { color: var(--text); border-color: var(--muted); }
.btn.secondary { background: #2a3450; color: var(--text); }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }

/* Ratings */
.ratings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 10px 0 24px;
}
.rating-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.rating-card .label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.rating-card .value {
  font-family: "Roboto Condensed", sans-serif;
  font-size: 2.3rem;
  font-weight: 800;
  margin-top: 4px;
}
.grade-elite { color: var(--green); }
.grade-good { color: var(--blue); }
.grade-mid { color: var(--accent); }
.grade-bad { color: var(--red); }

/* Season */
.season-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.record {
  font-family: "Roboto Condensed", sans-serif;
  font-size: 2.6rem;
  font-weight: 800;
}
.streak-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: #223;
  border: 1px solid var(--line);
  color: var(--muted);
}
.streak-badge.alive { color: var(--green); border-color: var(--green); }
.streak-badge.dead { color: var(--red); border-color: var(--red); }

.game-log {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 6px;
}
.game-row {
  display: grid;
  grid-template-columns: 44px 36px 1fr auto;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 0.9rem;
}
.game-row .gnum { color: var(--muted); font-size: 0.75rem; }
.game-row .res { font-weight: 800; }
.game-row .res.W { color: var(--green); }
.game-row .res.L { color: var(--red); }
.game-row .score { font-variant-numeric: tabular-nums; font-weight: 600; }
.game-row.playoff { border-color: #6a5a2a; background: #201d12; }

.series-banner {
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--accent);
}
.series-banner h3 { margin: 0 0 4px; font-family: "Roboto Condensed", sans-serif; text-transform: uppercase; }
.series-banner .series-score { color: var(--muted); font-size: 0.9rem; }

.final-banner {
  margin: 20px 0;
  padding: 26px;
  text-align: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #2a2210, #1a1408);
  border: 1px solid var(--accent);
}
.final-banner h2 { font-family: "Roboto Condensed", sans-serif; font-size: 2rem; margin: 0 0 8px; }
.final-banner p { color: var(--muted); margin: 0; }

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .panel { border-right: none; border-bottom: 1px solid var(--line); }
  .roster { max-height: 240px; }
}

/* ================= Phase 2: nav, home, auth, admin ================= */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(16px, 4vw, 40px);
  background: #0d1120ee;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(6px);
}
.brand {
  font-family: "Roboto Condensed", sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text);
  text-decoration: none;
}
.nav-links { display: flex; align-items: center; gap: 16px; }
.nav-links > a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.nav-links > a:hover { color: var(--text); }
.nav-auth { display: flex; align-items: center; gap: 8px; }
.user-chip {
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
}
.btn.small { padding: 7px 14px; font-size: 0.85rem; }
.btn.big { padding: 15px 30px; font-size: 1.1rem; text-decoration: none; display: inline-block; }
.btn.wide { width: 100%; }
a.btn { text-decoration: none; display: inline-block; }

body.page .app { min-height: calc(100vh - 57px); }

/* Home */
.home { max-width: 1060px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 40px) 60px; }
.hero { text-align: center; padding: 48px 0 36px; }
.hero h1 {
  font-family: "Roboto Condensed", sans-serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 14px;
}
.hero p { color: var(--muted); max-width: 640px; margin: 0 auto 24px; line-height: 1.6; }
.btn-row.center { justify-content: center; }
.hint-line { color: var(--accent); font-weight: 600; min-height: 1.2em; }

.boards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 24px 0 40px; }
@media (max-width: 760px) { .boards { grid-template-columns: 1fr; } }
.board {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.board .heading { font-size: 1.15rem; margin-bottom: 12px; }
.muted { color: var(--muted); }

.score-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.score-table th {
  text-align: left; color: var(--muted); font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.5px; padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
.score-table td { padding: 8px; border-bottom: 1px solid #1d2438; }
.score-table .score-cell { font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.score-table .you-row td { background: #f6a21b14; }

.invite-box { margin-bottom: 14px; font-size: 0.85rem; }
.invite-row { display: flex; gap: 8px; margin-top: 6px; }
.invite-row input {
  flex: 1; background: var(--card); border: 1px solid var(--line);
  color: var(--text); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 0.82rem;
}

.how { margin-bottom: 30px; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: 14px; }
.how-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.how-card h3 { margin: 8px 0 6px; font-size: 1rem; }
.how-card p { margin: 0; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.how-num {
  display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center;
  background: var(--accent); color: #19100a; font-weight: 800; border-radius: 50%;
}

.foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  color: #5a6683; font-size: 0.75rem; border-top: 1px solid var(--line); padding-top: 18px;
}
.foot a { color: #5a6683; }

/* Auth modal */
.modal-overlay {
  position: fixed; inset: 0; background: #000a; display: flex;
  align-items: center; justify-content: center; z-index: 100; padding: 16px;
}
.modal {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; width: 100%; max-width: 360px; position: relative;
}
.modal-close {
  position: absolute; top: 10px; right: 12px; background: none; border: none;
  color: var(--muted); font-size: 1rem; cursor: pointer;
}
.tabs { display: flex; gap: 6px; margin-bottom: 18px; }
.tab {
  flex: 1; background: var(--card); border: 1px solid var(--line); color: var(--muted);
  font: inherit; font-weight: 700; padding: 9px; border-radius: 9px; cursor: pointer;
}
.tab.active { color: var(--text); border-color: var(--accent); }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 0.75rem; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.field input {
  width: 100%; background: var(--card); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 10px 12px; font: inherit;
}
.field input:focus { outline: none; border-color: var(--accent); }
.form-error { color: var(--red); font-size: 0.82rem; min-height: 1.1em; margin: 4px 0 10px; }
.divider {
  display: flex; align-items: center; gap: 10px; color: var(--muted);
  font-size: 0.75rem; margin: 16px 0;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.small-note { font-size: 0.75rem; text-align: center; line-height: 1.5; }
.small-note code { background: var(--card); padding: 1px 5px; border-radius: 4px; }

/* Admin */
.admin-gate { max-width: 380px; margin: 60px auto; text-align: center; }
.admin-form { display: flex; gap: 10px; margin-top: 14px; }
.admin-form input {
  flex: 1; background: var(--card); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 10px 12px; font: inherit;
}

.score-line { margin-top: 10px !important; color: var(--text) !important; }
.accent-link { color: var(--accent); }

/* ================= Phase 3: theme polish, conference, leaders, share ================= */

/* Court-inspired backdrop: hardwood glow + faint center-court circle */
body {
  background:
    radial-gradient(900px 500px at 50% -200px, #f6a21b14 0%, transparent 60%),
    radial-gradient(1200px 700px at 80% -10%, #1b2440 0%, var(--bg) 55%);
}
.hero { position: relative; }
.hero::before {
  content: "";
  position: absolute;
  left: 50%; top: 46%;
  width: 560px; height: 560px;
  transform: translate(-50%, -50%);
  border: 2px solid #f6a21b17;
  border-radius: 50%;
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  left: 50%; top: 46%;
  width: 180px; height: 180px;
  transform: translate(-50%, -50%);
  border: 2px solid #f6a21b22;
  border-radius: 50%;
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }

/* Pokéball bullet on the brand */
.brand { display: inline-flex; align-items: center; gap: 8px; }

/* Headings get a little court stripe */
h2.heading {
  display: flex; align-items: center; gap: 10px;
}
h2.heading::after {
  content: "";
  flex: 0 0 48px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.board-sub { color: var(--muted); font-size: 0.78rem; margin: -6px 0 12px; }

/* Conference picker */
.conf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 320px));
  gap: 20px;
  margin-top: 10px;
}
.conf-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  padding: 30px 22px 24px;
  text-align: center;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.conf-card h3 {
  font-family: "Roboto Condensed", sans-serif;
  text-transform: uppercase;
  font-size: 1.5rem;
  margin: 10px 0 8px;
  letter-spacing: 1px;
}
.conf-card p { color: var(--muted); font-size: 0.85rem; margin: 0; }
.conf-ball { font-size: 2.2rem; }
.conf-card.east:hover { border-color: #e03a3e; box-shadow: 0 10px 30px #e03a3e22; transform: translateY(-4px); }
.conf-card.west:hover { border-color: #1d6fdc; box-shadow: 0 10px 30px #1d6fdc22; transform: translateY(-4px); }
.conf-card.east h3 { color: #ff6b6e; }
.conf-card.west h3 { color: #6ba6ff; }

.conf-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  vertical-align: middle;
}

/* Season leaders */
.leaders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 10px;
}
.leader-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
}
.leader-card img { width: 80px; height: 80px; object-fit: contain; filter: drop-shadow(0 5px 10px #0007); }
.leader-label {
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--accent); margin-bottom: 8px;
}
.leader-name { font-weight: 700; margin-top: 6px; }
.leader-pos { color: var(--muted); font-size: 0.72rem; }
.leader-stat {
  font-family: "Roboto Condensed", sans-serif;
  font-size: 1.5rem; font-weight: 800; margin-top: 6px;
}
.leader-stat span { font-size: 0.75rem; color: var(--muted); font-family: "Inter", sans-serif; }

.final-banner.champ {
  background: linear-gradient(135deg, #3a2c08, #1a1408);
  box-shadow: 0 0 60px #f6a21b2b inset;
}

/* Scoreboard-style record */
.record { letter-spacing: 1px; text-shadow: 0 0 24px #f6a21b33; }

/* Rating cards: scoreboard vibes */
.rating-card { background: linear-gradient(180deg, #1c2335, #161c2c); }
.rating-card .value { text-shadow: 0 0 18px currentColor; }

/* ================= Phase 4: modes, gens, managers, badges, h2h, recaps ================= */

/* Mode select */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.mode-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); font: inherit; text-align: left; padding: 22px; cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
}
.mode-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.mode-card.hard:hover { border-color: var(--red); }
.mode-card.daily:hover { border-color: var(--blue); }
.mode-card h3 { font-family: "Roboto Condensed", sans-serif; text-transform: uppercase; font-size: 1.2rem; margin: 10px 0 6px; }
.mode-card p { color: var(--muted); font-size: 0.84rem; margin: 0 0 4px; line-height: 1.45; }
.mode-emoji { font-size: 1.8rem; }
.mode-card .daily-theme { color: var(--blue); font-weight: 800; font-size: 0.95rem; }
.mode-card .played-note { color: var(--accent); font-size: 0.75rem; font-weight: 600; }
.mode-card.played { opacity: 0.55; cursor: not-allowed; }
.mode-card:disabled { opacity: 0.4; cursor: not-allowed; }

/* Gen chips */
.gen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.gen-chip {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  color: var(--muted); font: inherit; padding: 12px 8px; cursor: pointer; text-align: center;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.gen-chip strong { display: block; font-size: 1rem; }
.gen-chip span { font-size: 0.72rem; }
.gen-chip.on { border-color: var(--accent); color: var(--text); background: #f6a21b14; }

/* Manager cards */
.mgr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.mgr-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); font: inherit; padding: 16px 12px; cursor: pointer; text-align: center;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.mgr-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.mgr-emoji { font-size: 2rem; }
.mgr-name { font-weight: 800; margin-top: 8px; }
.mgr-title { color: var(--accent); font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; margin: 2px 0 8px; }
.mgr-perk { color: var(--muted); font-size: 0.78rem; line-height: 1.4; }

/* Recaps in game log */
.game-row { grid-template-columns: 56px 36px 1fr auto; }
.game-mid { display: flex; flex-direction: column; }
.recap { color: #6b7694; font-size: 0.74rem; line-height: 1.3; }

/* Red's Challenge */
.red-banner { border-color: var(--red); background: #241114; }
.red-banner h3 { color: #ff8b90; }
.red-note { color: var(--muted); font-size: 0.85rem; margin: 8px 0 0; }
.game-row.red-row { border-color: #5c2328; background: #1d1013; }
.hard-tag { color: #ff8b90; border-color: #5c2328; }
.hard-note { color: #ff8b90; font-size: 0.82rem; }

/* Badges */
.badge-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 20px; }
.badge-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; text-align: center; min-width: 110px;
}
.badge-card.new { border-color: var(--accent); box-shadow: 0 0 20px #f6a21b2b; }
.badge-emoji { font-size: 1.6rem; }
.badge-name { font-weight: 700; font-size: 0.82rem; margin-top: 4px; }
.badge-desc { color: var(--muted); font-size: 0.7rem; margin-top: 2px; }

/* Daily board (home) */
.daily-theme-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #1d2438; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 14px;
}
.daily-name { font-weight: 800; color: var(--blue); }
.small-note-left { font-size: 0.78rem; }
.played-chip { color: var(--green); font-weight: 700; font-size: 0.8rem; white-space: nowrap; }

/* H2H */
.h2h-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 4px; border-bottom: 1px solid #1d2438; font-size: 0.88rem;
}
.h2h-code { font-size: 0.72rem; text-decoration: none; }
.h2h-row .res.W { color: var(--green); font-weight: 800; }
.h2h-row .res.L { color: var(--red); font-weight: 800; }

/* ================= Phase 5: synergies, shinies, confetti, type chips ================= */

/* Synergy tracker (draft) */
.syn-panel {
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.syn-head { font-weight: 800; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.syn-note { display: block; color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 0.74rem; margin-top: 2px; }
.syn-row {
  display: grid;
  grid-template-columns: 26px 150px 48px 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}
.syn-row.active { color: var(--text); background: #f6a21b10; }
.syn-row.t2 { background: #f6a21b22; }
.syn-row .syn-count { font-variant-numeric: tabular-nums; font-weight: 700; }
.syn-row.active .syn-status { color: var(--accent); font-weight: 600; }
.syn-foot { color: var(--muted); font-size: 0.74rem; margin-top: 8px; }
.syn-active { margin: -8px 0 18px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: 0.82rem; }
.syn-chip {
  background: #f6a21b18; border: 1px solid #f6a21b44; color: var(--text);
  border-radius: 999px; padding: 4px 11px; font-size: 0.78rem; font-weight: 600;
}

/* Type chips on draft cards */
.type-row { display: flex; justify-content: center; gap: 4px; margin-top: 7px; flex-wrap: wrap; }
.type-chip {
  font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px;
  padding: 2px 7px; border-radius: 999px; background: #2a3450; color: var(--text);
}
.flag-chip { font-size: 0.72rem; }
.type-fire { background: #a33c22; } .type-water { background: #2a5d9f; } .type-grass { background: #3b7e3b; }
.type-electric { background: #9a7d19; color: #fff; } .type-psychic { background: #a33c6b; } .type-ice { background: #3d8d8d; }
.type-dragon { background: #5a3ca3; } .type-dark { background: #463a35; } .type-fairy { background: #a35a8b; }
.type-normal { background: #6d6d5e; } .type-fighting { background: #8d2f25; } .type-flying { background: #6a7fb8; }
.type-poison { background: #7a3c7a; } .type-ground { background: #8d7439; } .type-rock { background: #7a6a37; }
.type-bug { background: #6d7a1c; } .type-ghost { background: #4e3c6d; } .type-steel { background: #5a5a72; }

/* Shiny */
.shiny-banner {
  background: linear-gradient(135deg, #2c2410, #3a2e0e);
  border: 1px solid #ffd166;
  color: #ffe9b0;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: 0 0 30px #ffd16622;
}

/* Confetti */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.confetti-layer i {
  position: absolute;
  top: -20px;
  display: block;
  border-radius: 2px;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

/* Modal text variant (daily guest prompt) */
.modal-title { margin: 0 0 10px; font-family: "Roboto Condensed", sans-serif; text-transform: uppercase; }
.modal-text { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }

.daily-cta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.attempts-note { font-size: 0.7rem; }

/* ================= Phase 6: court view, manager draft, synergy cards, hoops polish ================= */

/* ---- Half-court roster view ---- */
.court {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.08;
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(80% 50% at 50% 100%, #f6a21b0a, transparent 70%),
    repeating-linear-gradient(90deg, #2b2016 0px, #2b2016 14px, #251b12 14px, #251b12 28px);
  border: 2px solid #f6a21b44;
  box-shadow: inset 0 0 40px #0008;
}
.court::after { /* subtle sheen */
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(90% 60% at 50% 0%, #ffffff08, transparent 70%);
  pointer-events: none;
}
.court-arc {
  position: absolute;
  left: 6%; right: 6%; top: 8%; bottom: -40%;
  border: 2px solid #f6a21b55;
  border-radius: 50%;
}
.court-paint {
  position: absolute;
  left: 31%; right: 31%; bottom: 0; height: 38%;
  border: 2px solid #f6a21b66;
  border-bottom: none;
  background: #f6a21b0d;
}
.court-ft {
  position: absolute;
  left: 38%; right: 38%; bottom: 31%; height: 14%;
  border: 2px solid #f6a21b55;
  border-radius: 50%;
}
.court-board {
  position: absolute;
  left: 42%; right: 42%; bottom: 4.5%; height: 3px;
  background: #e8ecf5aa;
  border-radius: 2px;
}
.court-hoop {
  position: absolute;
  left: 47%; bottom: 6%; width: 6%; aspect-ratio: 1;
  border: 2px solid var(--accent-2);
  border-radius: 50%;
  background: #ff6b3d22;
}

.court-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 76px;
  text-align: center;
  z-index: 2;
}
.cs-ring {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: #121724ee;
  border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px #0009;
  overflow: hidden;
}
.cs-ring img { width: 46px; height: 46px; object-fit: contain; }
.cs-ring.empty { border-style: dashed; background: #12172488; }
.cs-ring.small { width: 40px; height: 40px; }
.cs-ring.small img { width: 34px; height: 34px; }
.cs-pos {
  font-family: "Roboto Condensed", sans-serif;
  font-weight: 800; font-size: 0.72rem; color: #5a6683;
}
.cs-label {
  font-size: 0.62rem; font-weight: 700; color: var(--text);
  background: #0b0e14cc; border-radius: 6px; padding: 1px 6px;
  max-width: 76px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cs-label.muted-label { color: #5a6683; }
.court-slot.active .cs-ring, .bench-slot.active .cs-ring {
  border-color: var(--accent);
  animation: ring-pulse 1.4s ease-in-out infinite;
}
@keyframes ring-pulse {
  0%, 100% { box-shadow: 0 0 0 0 #f6a21b66, 0 4px 10px #0009; }
  50%      { box-shadow: 0 0 0 7px #f6a21b00, 0 4px 10px #0009; }
}

.bench-head {
  text-align: center; color: #5a6683; font-size: 0.66rem; font-weight: 800;
  letter-spacing: 1.5px; text-transform: uppercase; margin: 10px 0 6px;
}
.bench-row { display: flex; justify-content: space-between; gap: 2px; }
.bench-slot {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0;
}
.bs-label {
  font-size: 0.58rem; font-weight: 700; color: var(--muted);
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---- Manager draft cards with character art ---- */
.mgr-grid.draft3 { grid-template-columns: repeat(auto-fit, minmax(220px, 280px)); justify-content: center; gap: 18px; }
.mgr-grid.draft3 .mgr-card { padding: 24px 16px 20px; }
.mgr-img-wrap {
  display: inline-flex; align-items: center; justify-content: center;
  width: 96px; height: 96px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #2a3450, #161c2c);
  border: 2px solid var(--line);
  overflow: hidden;
}
.mgr-card:hover .mgr-img-wrap { border-color: var(--accent); }
.mgr-img { width: 80px; height: 80px; object-fit: contain; image-rendering: pixelated; }
.mgr-grid.draft3 .mgr-emoji { font-size: 2.6rem; }
.mgr-chip-img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; vertical-align: -6px; margin-right: 2px; }
.conf-tag.mgr-tag { display: inline-flex; align-items: center; gap: 2px; }

/* ---- Synergy cards v2 ---- */
.syn-panel {
  margin-top: 20px;
  background: linear-gradient(180deg, #141a2a, #10151f);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 14px;
}
.syn-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.syn-head-title {
  font-family: "Roboto Condensed", sans-serif; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.8px; font-size: 0.95rem;
}
.syn-note { color: var(--muted); font-size: 0.74rem; }
.syn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.syn-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.syn-card.tier1 { border-color: #f6a21b77; box-shadow: 0 0 14px #f6a21b1c; }
.syn-card.tier2 { border-color: var(--accent); box-shadow: 0 0 22px #f6a21b33; background: #f6a21b12; }
.syn-top { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.syn-top .syn-label { font-size: 0.78rem; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.syn-top .syn-count {
  font-family: "Roboto Condensed", sans-serif; font-weight: 800; font-size: 1.05rem;
  color: var(--accent); min-width: 18px; text-align: right;
}
.syn-bar {
  position: relative; height: 7px; border-radius: 4px; background: #0b0e14;
  overflow: visible; margin-bottom: 7px;
}
.syn-bar i {
  display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.3s ease;
}
.syn-bar .tick { position: absolute; top: -2px; width: 2px; height: 11px; background: #39425e; }
.syn-bar .tick.t3 { left: 60%; }
.syn-bar .tick.t5 { left: calc(100% - 2px); }
.syn-card.tier1 .tick.t3, .syn-card.tier2 .tick { background: #ffd166; }
.syn-meta { color: var(--muted); font-size: 0.7rem; min-height: 1em; }
.syn-card.tier1 .syn-meta, .syn-card.tier2 .syn-meta { color: var(--accent); font-weight: 600; }
.syn-pips { color: #ffd166; }
.syn-foot { color: var(--muted); font-size: 0.76rem; margin-top: 10px; }

/* ---- Hoops polish pass ---- */
.panel { background: linear-gradient(180deg, #131a29, #101520); }
.heading .conf-tag { font-size: 0.62rem; }
.btn { box-shadow: 0 4px 14px #f6a21b33; }
.btn.secondary, .btn.ghost { box-shadow: none; }
.game-log { scrollbar-width: thin; scrollbar-color: #2a3450 transparent; }
.game-row .score {
  font-family: "Roboto Condensed", sans-serif;
  font-size: 0.95rem;
  background: #0b0e14;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 8px;
}
.series-banner h3 { letter-spacing: 0.5px; }
.record { color: #fff; }

/* ================= Phase 7: free-order draft, tooltips, auto-sim ================= */

.court-hint {
  color: var(--muted); font-size: 0.68rem; text-align: center;
  margin: 0 0 8px; font-weight: 600;
}
.court-slot.clickable, .bench-slot.clickable { cursor: pointer; }
.court-slot.clickable:not(.filled):hover .cs-ring,
.bench-slot.clickable:not(.filled):hover .cs-ring {
  border-color: var(--accent);
  background: #f6a21b1a;
}
.court-slot.filled, .bench-slot.filled { cursor: help; }
.court-slot[data-roster-slot].filled, .bench-slot[data-roster-slot].filled {
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.roster-dragging { opacity: 0.5; cursor: grabbing !important; }
.roster-drop-target .cs-ring { outline: 3px solid var(--accent); }

/* Full bench position names */
.bs-pos-label {
  font-size: 0.52rem; font-weight: 800; color: #5a6683;
  text-transform: uppercase; letter-spacing: 0; overflow-wrap: anywhere;
  text-align: center; line-height: 1.15; max-width: 100%;
}
.bench-slot.active .bs-pos-label { color: var(--accent); }
.bs-label { min-height: 0.7em; }

/* Scouting tooltip */
.scout-tip {
  position: fixed;
  z-index: 300;
  width: 250px;
  background: #0d1120f8;
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 10px 40px #000c;
  pointer-events: none;
  font-size: 0.8rem;
}
.tip-name { font-weight: 800; margin-bottom: 6px; }
.tip-gen { color: var(--muted); font-weight: 600; font-size: 0.7rem; margin-left: 4px; }
.tip-perk { color: var(--muted); line-height: 1.45; }
.type-row.left { justify-content: flex-start; margin: 0 0 10px; }
.tip-row {
  display: grid;
  grid-template-columns: 110px 1fr 26px;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}
.tip-label { color: var(--muted); font-size: 0.68rem; }
.tip-bar { height: 6px; border-radius: 3px; background: #0b0e14; overflow: hidden; border: 1px solid #1d2438; }
.tip-bar i { display: block; height: 100%; border-radius: 3px; background: currentColor; }
.tip-row b { font-size: 0.74rem; text-align: right; font-variant-numeric: tabular-nums; }

/* Daily reminder during draft */
.daily-reminder {
  background: #14213a;
  border: 1px solid #1d6fdc66;
  border-left: 4px solid var(--blue);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 0 0 14px;
  color: #c7d8f5;
  font-size: 0.85rem;
}

.order-hint { display: block; color: #5a6683; font-size: 0.78rem; margin-top: 4px; }
.auto-note { color: var(--muted); font-size: 0.85rem; align-self: center; }

/* ================= Phase 8: home banner + best run ================= */
.hero2 {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 36px; align-items: center;
  margin: 18px 0 34px; padding: 40px clamp(20px, 4vw, 48px);
  border: 1px solid var(--line); border-radius: 22px; position: relative; overflow: hidden;
  background:
    radial-gradient(600px 300px at 0% 0%, #f6a21b1f, transparent 70%),
    linear-gradient(135deg, #141b2e 0%, #0f1424 100%);
  box-shadow: 0 20px 60px #0007;
}
.hero2::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--accent), #ff6b3d 50%, var(--blue));
}
.hero2-eyebrow {
  display: inline-block; font-size: 0.78rem; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--accent); background: #f6a21b14; border: 1px solid #f6a21b44; padding: 6px 12px; border-radius: 999px;
}
.hero2 h1 {
  font-family: "Roboto Condensed", sans-serif; text-transform: uppercase;
  font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 0.98; letter-spacing: 0.5px; margin: 16px 0 14px;
}
.hero2-copy > p { color: var(--muted); line-height: 1.6; max-width: 520px; margin: 0 0 22px; }
.hero2 .btn-row { flex-wrap: wrap; }
.hero2-stats { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.hero2-stats div {
  flex: 1 1 90px; background: #0b0f1c99; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; text-align: center;
}
.hero2-stats strong { display: block; font-family: "Roboto Condensed", sans-serif; font-size: 1.5rem; color: var(--text); }
.hero2-stats span { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700; }
.hero2 .hint-line { margin: 14px 0 0; }

.hero2-court {
  position: relative; aspect-ratio: 1 / 1; max-width: 420px; width: 100%; justify-self: center;
  border-radius: 18px; border: 2px solid #f6a21b55; overflow: hidden;
  background:
    repeating-linear-gradient(90deg, #00000014 0 2px, transparent 2px 46px),
    linear-gradient(180deg, #c98a4a 0%, #a8693a 100%);
  box-shadow: inset 0 0 60px #0006, 0 14px 40px #0008;
}
.hero2-court > div[class^="hc-"]:not(.hc-mon) { position: absolute; border: 3px solid #ffffffb0; pointer-events: none; }
.hc-arc { left: 6%; right: 6%; top: -40%; height: 128%; border-radius: 0 0 50% 50% / 0 0 46% 46%; border-top: none !important; }
.hc-paint { left: 34%; width: 32%; top: -3px; height: 44%; border-top: none !important; background: #f6a21b2a; }
.hc-circle { left: 38%; width: 24%; top: 32%; aspect-ratio: 1; border-radius: 50%; }
.hc-hoop { left: 46%; width: 8%; top: 5%; aspect-ratio: 1; border-radius: 50%; border-color: #ff6b3d !important; }
.hc-mon {
  position: absolute; transform: translate(-50%, -50%); width: 22%; text-align: center;
  animation: hc-bob 3.2s ease-in-out infinite;
}
.hc-mon:nth-child(6) { animation-delay: -0.6s; } .hc-mon:nth-child(7) { animation-delay: -1.2s; }
.hc-mon:nth-child(8) { animation-delay: -1.8s; } .hc-mon:nth-child(9) { animation-delay: -2.4s; }
.hc-mon img {
  width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 50%;
  background: radial-gradient(circle, #ffffffd9 0%, #ffffff8c 60%, #fff0 72%);
  filter: drop-shadow(0 6px 8px #0007);
}
.hc-mon span {
  display: inline-block; margin-top: -4px; font: 800 0.72rem "Roboto Condensed", sans-serif;
  background: #0d1120; color: var(--accent); border: 1px solid #f6a21b66; padding: 2px 8px; border-radius: 999px;
}
@keyframes hc-bob { 0%, 100% { transform: translate(-50%, -50%); } 50% { transform: translate(-50%, -56%); } }
@media (max-width: 820px) {
  .hero2 { grid-template-columns: 1fr; padding: 28px 20px; }
  .hero2-court { max-width: 320px; }
}
@media (prefers-reduced-motion: reduce) { .hc-mon { animation: none; } }

/* Best run card */
.best-run {
  background: linear-gradient(180deg, #161d31 0%, var(--panel) 100%);
  border: 1px solid #f6a21b55; border-radius: 18px; padding: 24px clamp(16px, 3vw, 30px);
  margin: 0 0 34px; box-shadow: 0 10px 40px #0006;
}
.best-run[hidden] { display: none; }
.br-empty { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.br-empty .heading { margin: 0 0 6px; }
.br-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.br-head .heading { margin: 0 0 10px; }
.br-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.br-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 700;
  background: var(--card); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px;
}
.br-mgr img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; }
.br-count { font-size: 0.78rem; }
.br-score { text-align: right; }
.br-record {
  font: 800 clamp(2.4rem, 6vw, 3.4rem)/1 "Roboto Condensed", sans-serif; color: var(--accent);
  text-shadow: 0 0 24px #f6a21b55;
}
.br-result { font-weight: 700; margin-top: 4px; }
.br-points { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.br-points strong { color: var(--text); }
.br-label {
  margin: 20px 0 10px; font: 800 0.78rem "Roboto Condensed", sans-serif; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted);
}
.br-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.br-mon { text-align: center; min-width: 0; }
.br-ring {
  position: relative; aspect-ratio: 1; max-width: 104px; margin: 0 auto; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #2a3554, #141b2e 70%);
  border: 2px solid #f6a21b66; display: grid; place-items: center;
}
.br-mon.bench .br-ring { max-width: 76px; border-color: var(--line); }
.br-ring img { width: 86%; height: 86%; object-fit: contain; filter: drop-shadow(0 4px 6px #0008); }
.br-shiny { position: absolute; top: -4px; right: -2px; font-size: 1rem; }
.br-name { font-weight: 700; font-size: 0.88rem; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-pos { font-size: 0.66rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.br-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 22px 0 16px; }
.br-ratings { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; align-content: start; }
.br-rating { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; text-align: center; }
.br-rating span { display: block; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); font-weight: 700; }
.br-rating strong { font: 800 1.5rem "Roboto Condensed", sans-serif; color: var(--blue); }
.br-leaders { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.br-leader {
  display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 6px 10px; min-width: 0;
}
.br-leader img { width: 34px; height: 34px; object-fit: contain; }
.br-leader div { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.br-leader div span { font-size: 0.66rem; }
.br-leader div strong { font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.br-leader em { font-style: normal; font-weight: 800; color: var(--accent); font-size: 0.8rem; white-space: nowrap; }
@media (max-width: 820px) {
  .br-foot { grid-template-columns: 1fr; }
  .br-row { gap: 6px; }
  .br-score { text-align: left; }
}

@media (max-width: 560px) {
  .nav { gap: 10px; padding-left: 12px; padding-right: 12px; }
  .brand { font-size: 1.1rem; white-space: nowrap; }
  .nav-links { gap: 8px; min-width: 0; }
  .nav-auth { min-width: 0; }
  .nav-auth > span, .nav-auth .chip { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .br-ratings { grid-template-columns: repeat(3, 1fr); }
  .br-leaders { grid-template-columns: 1fr; }
  .br-name { font-size: 0.74rem; }
  .br-pos { font-size: 0.52rem; overflow-wrap: anywhere; }
  .best-run { padding: 18px 12px; }
}

/* Season history */
.history {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 22px clamp(14px, 3vw, 28px); margin: 0 0 34px;
}
.history[hidden] { display: none; }
.hist-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.hist-head .heading { margin: 0; }
.hist-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.hist-stats div { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; text-align: center; min-width: 70px; }
.hist-stats strong { display: block; font: 800 1.25rem "Roboto Condensed", sans-serif; color: var(--accent); }
.hist-stats span { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); font-weight: 700; }
.hist-chart-wrap { display: flex; gap: 8px; margin: 18px 0 8px; height: 170px; }
.hist-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: 0.66rem; color: var(--muted); padding-bottom: 2px; }
.hist-chart {
  flex: 1; display: flex; align-items: flex-end; gap: 4px; padding: 0 4px;
  border-left: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(0deg, transparent 0 calc(50% - 1px), #ffffff0d calc(50% - 1px) 50%);
}
.hist-bar {
  flex: 1 1 0; max-width: 34px; position: relative; border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #6ea8ff, #3b6fd1); transition: filter 0.15s; cursor: default;
}
.hist-bar:hover { filter: brightness(1.25); }
.hist-bar.hard { background: linear-gradient(180deg, #ff8a5c, #c94b25); }
.hist-bar.champ { background: linear-gradient(180deg, #ffd166, var(--accent)); }
.hist-bar.red { background: linear-gradient(180deg, #ff5a5a, #a11d1d); }
.hist-bar.best { box-shadow: 0 0 0 2px #fff, 0 0 14px #ffd16688; }
.hist-bar span {
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
  font-size: 0.6rem; font-weight: 800; color: var(--muted);
}
.hist-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.72rem; margin-bottom: 14px; }
.hist-legend span { display: inline-flex; align-items: center; gap: 5px; }
.hist-legend .lg { width: 10px; height: 10px; border-radius: 3px; background: #4f86e6; }
.hist-legend .lg.champ { background: var(--accent); }
.hist-legend .lg.hard { background: #e0683d; }
.hist-legend .lg.red { background: #d33; }
.hist-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.hist-row {
  display: grid; grid-template-columns: 54px 1fr auto 130px; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px;
}
.hist-row.champ { border-color: #f6a21b66; }
.hist-no { font: 800 0.9rem "Roboto Condensed", sans-serif; color: var(--muted); }
.hist-rec { font: 800 1.2rem "Roboto Condensed", sans-serif; }
.hist-sub { font-size: 0.72rem; }
.hist-mons { display: flex; }
.hist-mons img { width: 34px; height: 34px; object-fit: contain; margin-left: -6px; filter: drop-shadow(0 2px 3px #0008); }
.hist-res { text-align: right; font-weight: 700; font-size: 0.82rem; }
.hist-res .muted { font-weight: 600; font-size: 0.72rem; }
@media (max-width: 640px) {
  .hist-row { grid-template-columns: 40px 1fr auto; }
  .hist-mons { display: none; }
  .hist-res { font-size: 0.74rem; max-width: 120px; }
  .hist-chart { gap: 2px; }
  .hist-bar span { display: none; }
}
