:root {
  --bg: #0a0e14;
  --panel: #121822;
  --panel-2: #1a2230;
  --line: #263143;
  --text: #e6ebf2;
  --muted: #8b98a9;
  --gold: #c8aa6e;
  --blue: #3b82f6;
  --blue-deep: #1e3a8a;
  --red: #ef4444;
  --red-deep: #7f1d1d;
  --green: #22c55e;
}

* { box-sizing: border-box; }

/* Reserve the vertical scrollbar's gutter even when no scrollbar is showing,
 * so the picker column doesn't jump ±15px between screens that scroll and
 * screens that don't (e.g. ONLINE draft vs. CPU draft with suggestions). */
html { scrollbar-gutter: stable; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(1200px 700px at 50% -10%, #14203a 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
}

.hidden { display: none !important; }

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 7, 12, 0.85);
  backdrop-filter: blur(6px);
  z-index: 20;
}

.start-card, .end-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px 48px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  max-width: 720px;
}

.app-logo { width: 84px; height: 84px; display: block; margin: 0 auto 14px; filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.45)); }
.start-card h1 { margin: 0 0 6px; font-size: 34px; letter-spacing: 1px; }
.start-card h1 span { color: var(--gold); }
.tagline { color: var(--muted); margin: 0 0 28px; }
.label { text-transform: uppercase; letter-spacing: 2px; font-size: 12px; color: var(--muted); margin-bottom: 12px; }

.side-choice { display: flex; gap: 16px; justify-content: center; margin-bottom: 28px; }

.side-btn {
  flex: 1;
  max-width: 200px;
  padding: 22px 16px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.side-btn span { font-size: 18px; font-weight: 700; }
.side-btn small { color: var(--muted); }
.side-btn.blue:hover, .side-btn.blue.selected { border-color: var(--blue); box-shadow: 0 0 22px rgba(59, 130, 246, 0.35); }
.side-btn.red:hover, .side-btn.red.selected { border-color: var(--red); box-shadow: 0 0 22px rgba(239, 68, 68, 0.35); }
.side-btn.selected { transform: translateY(-2px); }

button {
  font-family: inherit;
  font-size: 15px;
}

#start-btn, #again-btn {
  background: linear-gradient(180deg, var(--gold), #a5854f);
  color: #14100a;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  padding: 14px 34px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.12s, opacity 0.12s;
}
#start-btn:disabled { opacity: 0.4; cursor: not-allowed; }
#start-btn:not(:disabled):hover, #again-btn:hover { filter: brightness(1.1); }

.data-version {
  margin-top: 14px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.5px;
}

/* Discord login block: lives inside the start card, centered horizontally.
 * A prominent CTA when signed out; a compact identity pill when signed in.
 * Empty until initAuth() populates it — :empty hides the whole block so we
 * don't leave a gap during the initial /auth/me round-trip. */
.auth-widget {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 6px auto 24px;
  min-height: 52px;
}
.auth-widget:empty { display: none; }
.auth-widget .auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.12s, background 0.12s, transform 0.12s, box-shadow 0.12s;
}
.auth-widget .auth-btn:hover {
  border-color: #5865f2;
  background: var(--panel-2);
  transform: translateY(-1px);
}
.auth-widget .auth-btn.discord {
  background: #5865f2;
  border-color: #4752c4;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 14px 30px;
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.25);
}
.auth-widget .auth-btn.discord:hover {
  background: #4752c4;
  box-shadow: 0 8px 24px rgba(88, 101, 242, 0.35);
}
.auth-widget .auth-user {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 18px 8px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 15px;
  max-width: 100%;
}
.auth-widget .auth-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--panel-2);
  object-fit: cover;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.auth-widget .auth-avatar.placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
}
.auth-widget .auth-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.auth-widget .auth-logout {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 8px;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.auth-widget .auth-logout:hover {
  color: var(--red);
  border-color: var(--red);
  background: rgba(239, 68, 68, 0.08);
}

.auth-widget .discord-mark {
  width: 20px;
  height: 20px;
  display: inline-block;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .auth-widget .auth-name { max-width: 160px; }
  .auth-widget .auth-btn.discord { padding: 12px 20px; font-size: 14px; }
}

/* When the name input is auto-filled from Discord and locked, dim it a
 * touch so it's obvious it isn't editable. */
#player-name.locked {
  opacity: 0.7;
  cursor: not-allowed;
  border-color: var(--line);
}

.draft { max-width: 1280px; margin: 0 auto; padding: 18px; }

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
}
.topbar-left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand img { width: 28px; height: 28px; display: block; }
.brand span { font-weight: 700; letter-spacing: 1px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.version { display: block; font-size: 10px; color: var(--muted); letter-spacing: 1px; opacity: 0.6; }
.brand .version { display: inline; margin-left: 6px; font-size: 9px; }
.phase { font-size: 15px; text-transform: uppercase; letter-spacing: 2px; color: var(--muted); }
.timer { text-align: center; min-width: 260px; }
.timer-num { font-size: 38px; font-weight: 800; color: var(--gold); line-height: 1; }
.timer-bar { height: 6px; background: var(--panel-2); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.timer-fill { height: 100%; width: 100%; background: var(--gold); transition: width 0.12s linear; }
.timer-fill.low { background: var(--red); }
.turn-indicator { text-align: right; font-weight: 700; letter-spacing: 1px; }
.turn-indicator.blue { color: var(--blue); }
.turn-indicator.red { color: var(--red); }

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  min-width: 0;
}

/* "Leave match" button: subtle by default so it doesn't compete with the
 * primary draft controls, but reads as destructive on hover. */
.abandon-btn {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
  flex-shrink: 0;
}
.abandon-btn:hover {
  color: #fff;
  background: rgba(239, 68, 68, 0.85);
  border-color: var(--red);
}

.board {
  display: grid;
  /* minmax(0, 1fr) prevents the suggestions row (6 × 148px cards) from
   * forcing the middle track wider than its share of the row, so the
   * champion picker gets the same width in CPU and ONLINE modes rather than
   * "expanding" only when suggestions happen to render. */
  grid-template-columns: 240px minmax(0, 1fr) 240px;
  gap: 18px;
  align-items: start;
}

.team h2 {
  margin: 0 0 12px;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}
.team.blue h2 { color: var(--blue); border-color: var(--blue-deep); }
.team.red h2 { color: var(--red); border-color: var(--red-deep); }

.team-header {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}
.team.blue .team-header { border-left-color: var(--blue-deep); }
.team.red .team-header { border-left-color: var(--red-deep); }
.team-header-left { min-width: 0; }
.team-side-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
}
.team.blue .team-side-label { color: var(--blue); }
.team.red .team-side-label { color: var(--red); }
.team-player-name {
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
/* Rounds-won indicator next to the player name. Uses `currentColor` so
 * the pips pick up the team color (blue-side / red-side) — we set that
 * color on the parent per-team rule below. */
.team-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-top: 2px;
}
.team-name-row .team-player-name { margin-top: 0; }
.round-pips {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.round-pips[hidden] { display: none; }
.round-pip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  opacity: 0.35;
  transition: opacity 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}
.round-pip.won {
  background: currentColor;
  opacity: 1;
  transform: scale(1.05);
}
.team.blue .round-pips { color: var(--blue); }
.team.red  .round-pips { color: var(--red);  }
.team-score-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 46px;
}
.team-score {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  transition: transform 0.25s ease;
}
.team-score.hidden { display: none; }
.team-round-pts {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: #7fdc9a;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
}
.team-round-pts.hidden { display: none; }
.team-round-pts.zero { color: var(--muted); opacity: 0.55; }
.team-score-pop {
  position: absolute;
  top: -4px;
  right: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--gold);
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 0 12px rgba(200, 170, 110, 0.75);
}
.team-score-pop.pop { animation: score-pop 1.1s ease-out; }
@keyframes score-pop {
  0%   { opacity: 0; transform: translateY(0) scale(0.85); }
  15%  { opacity: 1; transform: translateY(-6px) scale(1.1); }
  70%  { opacity: 1; transform: translateY(-22px) scale(1); }
  100% { opacity: 0; transform: translateY(-34px) scale(0.9); }
}

.team-turn-badge {
  position: absolute;
  top: -8px;
  right: 10px;
  padding: 2px 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--line);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

/* current turn highlight */
.team-header.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 0 24px rgba(200, 170, 110, 0.35);
  animation: header-pulse 2.2s ease-in-out infinite;
}
.team.blue .team-header.active {
  border-color: var(--blue);
  border-left-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue), 0 0 28px rgba(59, 130, 246, 0.45);
}
.team.red .team-header.active {
  border-color: var(--red);
  border-left-color: var(--red);
  box-shadow: 0 0 0 1px var(--red), 0 0 28px rgba(239, 68, 68, 0.45);
}
.team-header.active .team-turn-badge {
  opacity: 1;
  transform: translateY(0);
}
.team.blue .team-header.active .team-turn-badge {
  color: #cfe0ff;
  background: var(--blue-deep);
  border-color: var(--blue);
}
.team.red .team-header.active .team-turn-badge {
  color: #ffd6d6;
  background: var(--red-deep);
  border-color: var(--red);
}
.team.blue .team-header.active { animation: header-pulse-blue 2.2s ease-in-out infinite; }
.team.red .team-header.active { animation: header-pulse-red 2.2s ease-in-out infinite; }
@keyframes header-pulse-blue {
  0%,100% { box-shadow: 0 0 0 1px var(--blue), 0 0 18px rgba(59, 130, 246, 0.35); }
  50%     { box-shadow: 0 0 0 1px var(--blue), 0 0 32px rgba(59, 130, 246, 0.65); }
}
@keyframes header-pulse-red {
  0%,100% { box-shadow: 0 0 0 1px var(--red), 0 0 18px rgba(239, 68, 68, 0.35); }
  50%     { box-shadow: 0 0 0 1px var(--red), 0 0 32px rgba(239, 68, 68, 0.65); }
}

.award-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 300px;
  z-index: 30;
  padding: 12px 14px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), 0 0 26px rgba(200, 170, 110, 0.2);
  color: var(--text);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: none;
}
.award-toast.enter { opacity: 1; transform: translateY(0); }
.award-toast.leaving { opacity: 0; transform: translateY(16px); }
.award-toast.blue { border-left-color: var(--blue); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), 0 0 26px rgba(59, 130, 246, 0.25); }
.award-toast.red { border-left-color: var(--red); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), 0 0 26px rgba(239, 68, 68, 0.25); }

.award-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.award-pts {
  font-size: 18px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}
.award-toast.blue .award-pts { color: #6aa4ff; }
.award-toast.red .award-pts { color: #ff8080; }
.award-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
}
.award-toast.is-ban .award-label::before { content: "Ban · "; }
.award-toast.is-pick .award-label::before { content: "Pick · "; }

.award-body { display: flex; gap: 10px; align-items: flex-start; }
.award-body img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid var(--line);
  flex: none;
  object-fit: cover;
}
.award-meta { min-width: 0; flex: 1; }
.award-player {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.award-toast.blue .award-player { color: var(--blue); }
.award-toast.red .award-player { color: var(--red); }
.award-champ {
  font-size: 14px;
  font-weight: 700;
  margin: 1px 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.award-reasons { display: flex; flex-direction: column; gap: 2px; font-size: 11px; line-height: 1.35; color: var(--muted); }
.award-reasons .award-reason { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.award-reasons .award-reason-counter { color: #7fdc9a; }
.award-reasons .award-reason-countered { color: #ff9c9c; }
.award-reasons .award-reason-synergy { color: var(--gold); }
.award-reasons .award-reason-counters-ally { color: #ff9c9c; }
.award-reasons .award-reason-enemy-synergy { color: var(--gold); }
.award-reasons .award-reason-tier { color: #d4b45a; font-weight: 700; }
.award-reason-empty { color: var(--muted); font-style: italic; }

@media (max-width: 720px) {
  .award-toast { left: 12px; right: 12px; bottom: 12px; width: auto; }
}

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

.slot {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 60px;
  padding: 6px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.team.blue .slot { border-left-color: var(--blue-deep); }
.team.red .slot { border-left-color: var(--red-deep); }
.slot-role { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); width: 54px; flex: none; }
.slot-body { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.slot-body img { width: 46px; height: 46px; border-radius: 6px; object-fit: cover; object-position: top center; }
.slot-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-empty { color: #3a4557; font-size: 20px; }

.slot.selectable { cursor: pointer; border-color: var(--gold); }
.slot.active { box-shadow: inset 0 0 0 2px var(--gold); }
.team .slot.filled { background: var(--panel-2); }
.slot.reveal { animation: pop 0.4s ease; }

.bans { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.ban {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
}
.ban.filled img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) brightness(0.55); }
.ban.filled::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 45%, var(--red) 47%, var(--red) 53%, transparent 55%);
  opacity: 0.85;
}
.ban.reveal { animation: pop 0.4s ease; }

.center { display: flex; flex-direction: column; gap: 12px; }
.picker-head { display: flex; flex-direction: column; gap: 10px; }
#search {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
}
#search:focus { outline: none; border-color: var(--gold); }

.role-chips { display: flex; gap: 8px; flex-wrap: wrap; min-height: 4px; }
.chip {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.12s;
}
.chip:hover { border-color: var(--gold); color: var(--text); }
.chip.active { background: var(--gold); color: #14100a; border-color: var(--gold); font-weight: 700; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  max-height: 460px;
  overflow-y: auto;
  padding: 4px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
  border-radius: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.grid::-webkit-scrollbar { width: 10px; }
.grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
  border-left: 1px solid var(--line);
  border-radius: 0 10px 10px 0;
}
.grid::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--panel-2), var(--line));
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 8px;
  transition: background 0.15s;
}
.grid::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--gold), #a5854f);
  background-clip: padding-box;
  border: 2px solid transparent;
}
.grid::-webkit-scrollbar-thumb:active {
  background: var(--gold);
  background-clip: padding-box;
  border: 2px solid transparent;
}
.grid:hover { scrollbar-color: var(--gold) transparent; }
.tile {
  border: 1px solid transparent;
  background: var(--panel);
  border-radius: 8px;
  padding: 4px 2px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: transform 0.1s, border-color 0.1s;
}
.tile img { width: 48px; height: 48px; border-radius: 6px; }
.tile span { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tile:hover { transform: translateY(-2px); border-color: var(--gold); }
.tile.selected { border-color: var(--gold); box-shadow: 0 0 14px rgba(200, 170, 110, 0.5); }
.tile.selected span { color: var(--text); }
.tile.unavailable img { filter: grayscale(1) brightness(0.4); }
.tile.disabled { pointer-events: none; opacity: 0.4; }

#lock-btn { align-self: center; margin-top: 4px; }

.end-teams { display: flex; gap: 24px; margin: 20px 0 26px; text-align: left; }
.end-team { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.end-team.blue { border-top: 3px solid var(--blue); }
.end-team.red { border-top: 3px solid var(--red); }
.end-team h3 { margin: 0 0 12px; }
.comp { list-style: none; padding: 0; margin: 0 0 14px; }
.comp li { padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.comp li b { color: var(--gold); font-weight: 600; display: inline-block; width: 66px; font-size: 11px; text-transform: uppercase; }
.profile { font-size: 12px; color: var(--muted); line-height: 1.6; }

@keyframes pop {
  0% { transform: scale(0.85); opacity: 0.4; }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.draft { position: relative; z-index: 1; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  transition: box-shadow 0.6s ease;
}
body { transition: background 0.6s ease; }
body.phase-ban { background: radial-gradient(1200px 700px at 50% -10%, #3d1414 0%, #0a0e14 62%); }
body.phase-pick { background: radial-gradient(1200px 700px at 50% -10%, #12233f 0%, #0a0e14 62%); }
body.phase-ban::before { box-shadow: inset 0 0 220px 60px rgba(190, 30, 30, 0.55); }
body.phase-pick::before { box-shadow: inset 0 0 200px 45px rgba(40, 100, 220, 0.30); }

.phase { font-weight: 800; font-size: 20px; letter-spacing: 3px; transition: color 0.4s; }
body.phase-ban .phase { color: #ff6b6b; }
body.phase-pick .phase { color: #6aa4ff; }
body.phase-ban .timer-num { color: #ff6b6b; }
body.phase-ban .timer-fill { background: #ef4444; }

.slot-index {
  width: 24px;
  height: 24px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 50%;
}
.slot.active { box-shadow: inset 0 0 0 2px var(--gold); }
.slot.active .slot-index { color: var(--gold); border-color: var(--gold); }
.slot-role-tag {
  margin-left: auto;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  background: rgba(200, 170, 110, 0.14);
  padding: 2px 8px;
  border-radius: 10px;
  flex: none;
}

.assign-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 34px 40px;
  text-align: center;
  max-width: 560px;
  width: 92%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.assign-card h1 { margin: 0 0 6px; font-size: 26px; }
.assign-body { display: flex; flex-direction: column; gap: 10px; margin: 22px 0 24px; }
.assign-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 8px 12px;
}
.assign-role {
  width: 84px;
  text-align: left;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--gold);
  flex: none;
}
.assign-portrait { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.assign-portrait img { width: 38px; height: 38px; border-radius: 6px; }
.assign-portrait span { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.assign-portrait .slot-empty { font-size: 18px; }
.assign-row select {
  flex: none;
  width: 148px;
  padding: 8px;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  font-family: inherit;
  font-size: 13px;
}

#assign-btn {
  background: linear-gradient(180deg, var(--gold), #a5854f);
  color: #14100a;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  padding: 13px 32px;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: filter 0.12s, opacity 0.12s;
}
#assign-btn:disabled { opacity: 0.4; cursor: not-allowed; }
#assign-btn:not(:disabled):hover { filter: brightness(1.1); }

.role-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.role-filter .chip {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.12s;
}
.role-filter .chip:hover { border-color: var(--gold); color: var(--text); }
.role-filter .chip.active { background: var(--gold); color: #14100a; border-color: var(--gold); font-weight: 700; }

.suggestions {
  margin: 10px 0 6px;
  padding: 10px 12px;
  background: rgba(200, 170, 110, 0.06);
  border: 1px solid rgba(200, 170, 110, 0.25);
  border-radius: 10px;
}
.suggestions-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 8px;
}
.suggestions-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 6px;
  /* Let the flex row scroll horizontally instead of pushing the grid track
   * wider than the ONLINE picker (which never renders any suggestion cards).
   * Without this, min-content of the cards forces the CPU picker column to
   * expand and the two modes end up with different widths. */
  min-width: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.suggestions-list::-webkit-scrollbar { height: 8px; }
.suggestions-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(200, 170, 110, 0.15);
  border-radius: 0 0 8px 8px;
}
.suggestions-list::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, var(--panel-2), var(--line));
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 8px;
  transition: background 0.15s;
}
.suggestions-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, var(--gold), #a5854f);
  background-clip: padding-box;
  border: 2px solid transparent;
}
.suggestions-list::-webkit-scrollbar-thumb:active {
  background: var(--gold);
  background-clip: padding-box;
  border: 2px solid transparent;
}
.suggestions-list:hover { scrollbar-color: var(--gold) transparent; }
.suggestion {
  flex: 0 0 148px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform 0.1s, border-color 0.1s;
}
.suggestion:hover { border-color: var(--gold); transform: translateY(-2px); }
.suggestion.selected { border-color: var(--gold); box-shadow: 0 0 12px rgba(200, 170, 110, 0.4); }
.suggestion img { width: 44px; height: 44px; border-radius: 6px; }
.suggestion-name { font-size: 12px; font-weight: 700; text-align: center; }
.suggestion-reasons { font-size: 10px; color: var(--muted); text-align: center; line-height: 1.3; }
.suggestion-reasons .reason-counter { color: #7fdc9a; }
.suggestion-reasons .reason-countered { color: #ff9c9c; }
.suggestion-reasons .reason-synergy { color: #c8aa6e; }
.suggestion-reasons .reason-counters-ally { color: #ff9c9c; }
.suggestion-reasons .reason-enemy-synergy { color: #c8aa6e; }
.suggestion-reasons .reason-tier { color: #d4b45a; font-weight: 700; }

.action-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 8px;
  min-height: 68px;
}
.action-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
  justify-content: flex-end;
  text-align: right;
}
.action-preview img { width: 50px; height: 50px; border-radius: 8px; border: 1px solid var(--line); }
.action-preview .name { font-weight: 700; font-size: 15px; }
.action-empty { color: var(--muted); font-size: 13px; }

.lock-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 230px;
  justify-content: center;
  border: none;
  border-radius: 12px;
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  transition: transform 0.12s, filter 0.12s, box-shadow 0.12s, background 0.2s;
}
.lock-btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.lock-btn.pick { background: linear-gradient(180deg, #3f8cff, #1e3a8a); box-shadow: 0 0 24px rgba(59, 130, 246, 0.45); }
.lock-btn.ban { background: linear-gradient(180deg, #f2564b, #7f1d1d); box-shadow: 0 0 24px rgba(239, 68, 68, 0.5); }
.lock-btn:not(:disabled):hover { transform: translateY(-2px); filter: brightness(1.08); }
.lock-icon { display: flex; }
.lock-icon svg { width: 24px; height: 24px; display: block; }

.strategy {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.strategy b { color: var(--gold); }

.mode-choice { display: flex; gap: 16px; justify-content: center; margin-bottom: 22px; }
.mode-btn {
  flex: 1;
  max-width: 220px;
  padding: 18px 16px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.mode-btn span { font-size: 17px; font-weight: 700; }
.mode-btn small { color: var(--muted); }
.mode-btn:hover, .mode-btn.selected { border-color: var(--gold); box-shadow: 0 0 22px rgba(200, 170, 110, 0.3); }
.mode-btn.selected { transform: translateY(-2px); }
.mode-btn.locked {
  cursor: not-allowed;
  opacity: 0.55;
  filter: saturate(0.6);
}
.mode-btn.locked:hover {
  border-color: var(--line);
  box-shadow: none;
  transform: none;
}
.mode-btn .lock-note {
  display: none;
  margin-top: 4px;
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.mode-btn.locked .lock-note { display: inline; }

.end-card { max-width: 900px; width: 94%; max-height: 88vh; overflow-y: auto; position: relative; }

.report-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.report-close:hover { color: var(--text); border-color: var(--gold); }

.post-draft {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
}
.secondary-btn {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 14px 34px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.secondary-btn:hover { background: var(--gold); color: #14100a; }

.scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 12px 0 18px;
}
.score-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
}
.score-card.blue { border-color: rgba(59, 130, 246, 0.6); box-shadow: 0 0 18px rgba(59, 130, 246, 0.15); }
.score-card.red { border-color: rgba(239, 68, 68, 0.6); box-shadow: 0 0 18px rgba(239, 68, 68, 0.15); }
.score-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.score-side {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}
.score-total {
  font-size: 36px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}
.score-total small { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.score-axes { display: grid; gap: 4px; }
.score-axis {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}
.score-axis b { color: var(--text); font-weight: 600; }

.report { text-align: left; margin: 6px 0 24px; }
.report h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin: 20px 0 10px;
}
.verdict {
  text-align: center;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 12px;
  border-radius: 10px;
  margin: 4px 0 8px;
}
.verdict.blue { background: rgba(59, 130, 246, 0.22); color: #8fb8ff; }
.verdict.red { background: rgba(239, 68, 68, 0.22); color: #ff9d9d; }
.verdict.even { background: var(--panel-2); color: var(--muted); }

.lane-row {
  display: grid;
  grid-template-columns: 58px 1fr 130px 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 6px;
  background: var(--panel);
}
.lane-wr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.lane-wr .lane-wr-val {
  font-weight: 800;
  font-size: 14px;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--muted);
  min-width: 46px;
  text-align: center;
}
.lane-wr .lane-wr-val.blue { background: rgba(59, 130, 246, 0.28); color: #cfe0ff; }
.lane-wr .lane-wr-val.red { background: rgba(239, 68, 68, 0.28); color: #ffd6d6; }
.lane-wr .lane-wr-val.even { background: var(--panel-2); color: var(--muted); }
.lane-wr .lane-wr-games { font-size: 9px; color: var(--muted); }
.lane-wr .lane-wr-fallback { font-size: 15px; font-weight: 800; }
.lane-wr .lane-wr-fallback.blue { color: #6aa4ff; }
.lane-wr .lane-wr-fallback.red { color: #ff6b6b; }
.lane-wr .lane-wr-fallback.even { color: var(--muted); }

.radar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.radar-wrap h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin: 0;
  align-self: flex-start;
}
.radar-svg { max-width: 100%; height: auto; }
.radar-legend {
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: var(--muted);
}
.radar-legend .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 6px;
}
.radar-legend .dot.blue { background: rgba(59, 130, 246, 0.75); }
.radar-legend .dot.red { background: rgba(239, 68, 68, 0.75); }
.lane-role { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.lane-side { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lane-side.red { flex-direction: row-reverse; text-align: right; }
.lane-side img { width: 38px; height: 38px; border-radius: 6px; flex: none; }
.lane-side .lane-champ { min-width: 0; }
.lane-side .lane-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-side .lane-edge { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-side.fav .lane-name { color: var(--text); }
.lane-side.blue.fav img { box-shadow: 0 0 0 2px #3b82f6; }
.lane-side.red.fav img { box-shadow: 0 0 0 2px #ef4444; }
.lane-fav { text-align: center; font-weight: 800; font-size: 15px; }
.lane-fav.blue { color: #6aa4ff; }
.lane-fav.red { color: #ff6b6b; }
.lane-fav.even { color: var(--muted); }

.metric-row {
  display: grid;
  grid-template-columns: 150px 1fr 1fr;
  gap: 8px;
  align-items: center;
  padding: 3px 0;
}
.metric-label { font-size: 12px; color: var(--muted); }
.metric-val { font-size: 13px; text-align: center; padding: 4px; border-radius: 6px; background: var(--panel); }
.metric-val.blue.fav { background: rgba(59, 130, 246, 0.28); color: #cfe0ff; font-weight: 700; }
.metric-val.red.fav { background: rgba(239, 68, 68, 0.28); color: #ffd6d6; font-weight: 700; }

@media (max-width: 900px) {
  .board { grid-template-columns: 1fr; }
  .team { order: 2; }
  .center { order: 1; }
}

.fearless-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 22px;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  position: relative;
  transition: background 0.15s, border-color 0.15s;
}
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.15s, background 0.15s;
}
.toggle input:checked + .toggle-track { background: rgba(200, 170, 110, 0.25); border-color: var(--gold); }
.toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(20px); background: var(--gold); }
.toggle-label { font-weight: 700; letter-spacing: 1px; text-transform: uppercase; font-size: 13px; }
.toggle-hint { margin: 0; font-size: 11px; color: var(--muted); }

.series-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  padding: 10px 14px;
  background: rgba(200, 170, 110, 0.08);
  border: 1px solid rgba(200, 170, 110, 0.35);
  border-radius: 10px;
  font-size: 12px;
  color: var(--muted);
}
.series-status button {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.series-status button:hover { color: var(--red); border-color: var(--red); }

.exclude-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 30px 34px;
  text-align: center;
  max-width: 900px;
  width: 94%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.exclude-card h1 { margin: 0 0 6px; font-size: 24px; }
.exclude-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0 12px;
}
.exclude-head #exclude-search {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
}
.exclude-head #exclude-search:focus { outline: none; border-color: var(--gold); }
.exclude-grid { max-height: 420px; }
.exclude-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 18px;
}
.ghost-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.ghost-btn:hover { color: var(--text); border-color: var(--gold); }
#exclude-confirm {
  background: linear-gradient(180deg, var(--gold), #a5854f);
  color: #14100a;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  padding: 12px 28px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.12s;
}
#exclude-confirm:hover { filter: brightness(1.1); }

.tile.locked {
  border-color: rgba(239, 68, 68, 0.4);
  position: relative;
}
.tile.locked img { filter: grayscale(1) brightness(0.45); }
.tile.locked::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  border: 2px solid var(--red);
  border-top: 2px solid transparent;
  transform: translateY(2px);
  box-shadow: 0 -3px 0 -1px var(--red);
}
.exclude-grid .tile.selected img { filter: none; }

/* Lane winrate bar */
.lane-bar {
  width: 100%;
  height: 20px;
  background: rgba(239, 68, 68, 0.28);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.lane-bar-fill {
  height: 100%;
  background: rgba(59, 130, 246, 0.45);
}
.lane-bar-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* Key insights */
.insights-section {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 12px;
}
.insight {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
}
.insight.blue { border-left-color: var(--blue); }
.insight.red { border-left-color: var(--red); }
.insight-icon { font-size: 11px; opacity: 0.7; flex: none; }

/* Team synergies */
.syn-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 6px;
}
.syn-col h3 {
  font-size: 12px;
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.syn-col.blue h3 { color: var(--blue); }
.syn-col.red h3 { color: var(--red); }
.syn-pair {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 12px;
}
.syn-icon { width: 24px; height: 24px; border-radius: 4px; flex: none; }
.syn-name { font-weight: 600; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.syn-plus { color: var(--muted); font-weight: 700; flex: none; }
.syn-delta { color: #7fdc9a; font-weight: 700; margin-left: auto; flex: none; }
.syn-wr { color: var(--muted); font-size: 10px; flex: none; }
.syn-empty { font-size: 11px; color: var(--muted); font-style: italic; }

/* Tier badges */
.tier-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--line);
  vertical-align: middle;
  margin-left: 4px;
}
.tier-badge.op {
  background: rgba(200, 170, 110, 0.25);
  color: var(--gold);
  border-color: rgba(200, 170, 110, 0.5);
}

/* online mode */
#online-block { margin: 4px 0 22px; }
#player-name {
  width: 100%;
  max-width: 320px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  text-align: center;
}
#player-name::placeholder { color: var(--muted); }
#player-name:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 12px rgba(200, 170, 110, 0.25); }
.rounds-choice {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 8px;
}
.rounds-input {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.rounds-input label {
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 11px;
  color: var(--muted);
}
.rounds-input input {
  width: 70px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}
.rounds-input input:focus { outline: none; border-color: var(--gold); }

.searching-card, .room-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 36px 44px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  max-width: 480px;
}
.searching-card h1, .room-card h1 { margin: 8px 0 6px; font-size: 24px; }
.searching-meta { color: var(--muted); font-size: 13px; margin-bottom: 22px; }

.spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid rgba(200, 170, 110, 0.2);
  border-top-color: var(--gold);
  margin: 0 auto 16px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.room-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}
#room-next {
  padding: 12px 22px;
  border-radius: 10px;
  border: none;
  background: var(--gold);
  color: #1a1200;
  font-weight: 700;
  cursor: pointer;
}
#room-next:hover { filter: brightness(1.08); }

.match-type-choice {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 18px;
}
.match-type-btn {
  flex: 1;
  max-width: 180px;
  padding: 12px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.match-type-btn span { font-size: 13px; font-weight: 700; }
.match-type-btn small { color: var(--muted); font-size: 11px; }
.match-type-btn:hover { border-color: var(--gold); }
.match-type-btn.selected { border-color: var(--gold); box-shadow: 0 0 16px rgba(200, 170, 110, 0.28); transform: translateY(-1px); }

.rounds-fixed-choice {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 8px;
}
.rounds-fixed-btn {
  min-width: 72px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}
.rounds-fixed-btn:hover { border-color: var(--gold); }
.rounds-fixed-btn.selected { border-color: var(--gold); box-shadow: 0 0 16px rgba(200, 170, 110, 0.3); color: var(--gold); transform: translateY(-1px); }

#join-code {
  width: 100%;
  max-width: 220px;
  margin: 0 auto;
  display: block;
  padding: 12px 14px;
  text-align: center;
  font-family: "Segoe UI", monospace;
  font-size: 22px;
  letter-spacing: 6px;
  font-weight: 800;
  text-transform: uppercase;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}
#join-code:focus { outline: none; border-color: var(--gold); }
#join-code::placeholder { color: #3a4557; letter-spacing: 4px; font-weight: 600; }

.room-code {
  font-family: "Segoe UI", monospace;
  font-size: 36px;
  letter-spacing: 8px;
  font-weight: 800;
  color: var(--gold);
  padding: 14px 20px;
  margin: 14px auto 12px;
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 12px;
  display: inline-block;
  text-shadow: 0 0 18px rgba(200, 170, 110, 0.35);
  user-select: all;
}
#private-copy { margin-bottom: 18px; }
#private-copy.copied { color: var(--gold); border-color: var(--gold); }
.private-meta { color: var(--muted); font-size: 12px; margin-bottom: 18px; }
#private-cancel { margin-top: 4px; }

/* let the draft board show behind the assign/wait overlays in online mode */
.overlay.peek {
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
  align-items: flex-end;
  padding-bottom: 32px;
}
.overlay.peek > * { pointer-events: auto; }
.overlay.peek .assign-card,
.overlay.peek .room-card {
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
}
/* while peeking, mute the center panel so the two team columns read clean */
body.peeking .center > .picker-head,
body.peeking .center > .suggestions,
body.peeking .center > .grid,
body.peeking .center > .action-bar,
body.peeking .center > .post-draft { visibility: hidden; }

.round-summary {
  margin: 6px 0 22px;
  padding: 18px 20px 16px;
  border: 1px solid var(--gold);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.10), rgba(212, 175, 55, 0.02));
  box-shadow: 0 0 24px rgba(212, 175, 55, 0.12);
  text-align: left;
}
.round-summary-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.round-summary-head h2 {
  margin: 0;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
}
.round-summary-formula { margin: 0; font-size: 13px; color: var(--muted); }
.round-summary-formula b { color: var(--text); font-weight: 700; }
.round-summary-hint { margin: 12px 0 0; font-size: 12px; color: var(--muted); font-style: italic; }
.round-score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.round-score-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
}
.round-score-card.blue { border-color: rgba(59, 130, 246, 0.6); box-shadow: 0 0 14px rgba(59, 130, 246, 0.15); }
.round-score-card.red { border-color: rgba(239, 68, 68, 0.6); box-shadow: 0 0 14px rgba(239, 68, 68, 0.15); }
.round-score-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.round-score-side { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.round-score-player { font-size: 13px; font-weight: 600; color: var(--text); }
.round-score-total { font-size: 30px; font-weight: 800; color: var(--gold); line-height: 1; margin-bottom: 8px; }
.round-score-total small { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 2px; }
.round-score-formula { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.round-score-formula b { color: var(--text); font-weight: 700; }
.round-score-formula em { font-style: normal; opacity: 0.7; font-size: 11px; }

.series-standings { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.series-standings-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.series-standings-head h3 { margin: 0; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.series-winner { font-weight: 800; color: var(--gold); font-size: 14px; }
.standings-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.standings-table th, .standings-table td { padding: 6px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.standings-table th { color: var(--muted); font-weight: 500; letter-spacing: 1px; text-transform: uppercase; font-size: 11px; }
.standings-table .standings-name { text-align: left; font-weight: 600; }
.standings-table .standings-total { font-weight: 800; color: var(--gold); }
.standings-table tr.winner { background: rgba(212, 175, 55, 0.08); }

/* End-of-series ranking points summary (inline in the results card). */
.ranking-deltas { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.ranking-deltas h3 { margin: 0 0 10px; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.rank-delta-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rank-delta-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2);
}
.rank-delta-row.you { border-color: var(--gold); }
.rank-delta-name { font-weight: 600; color: var(--text); }
.rank-delta-name em { font-style: normal; color: var(--muted); font-size: 12px; margin-left: 6px; text-transform: uppercase; letter-spacing: 1px; }
.rank-delta-val { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.rank-delta-row.pos .rank-delta-val { color: var(--green); }
.rank-delta-row.neg .rank-delta-val { color: var(--red); }
.rank-delta-row.zero .rank-delta-val { color: var(--muted); }

@media (max-width: 640px) {
  .round-score-grid { grid-template-columns: 1fr; }
}

/* --- Ad rails (Google AdSense skyscraper slots) ---
 * Fixed to the viewport edges so they never cover the draft board.
 * Hidden below 1400px width to avoid overlapping the app UI on smaller screens
 * (AdSense also penalises ads that interfere with interactive content). */
.ad-rail {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 160px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 8px;
  z-index: 5;
  pointer-events: auto;
}
.ad-rail-left { left: 0; }
.ad-rail-right { right: 0; }
.ad-rail ins.adsbygoogle { display: block; width: 160px; min-height: 600px; }

@media (min-width: 1400px) {
  .ad-rail { display: flex; }
}
@media (min-width: 1700px) {
  .ad-rail { width: 300px; }
  .ad-rail ins.adsbygoogle { width: 300px; }
}

/* --- Start card footer (legal links) --- */
.start-footer {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.start-footer a { color: var(--muted); text-decoration: none; }
.start-footer a:hover { color: var(--gold); }

/* --- Legal / about pages --- */
.legal-page {
  padding: 0;
}
.legal {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  line-height: 1.65;
}
.legal-back {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}
.legal-back:hover { color: var(--gold); }
.legal h1 { font-size: 30px; margin: 0 0 8px; color: var(--text); }
.legal h2 { font-size: 18px; margin: 32px 0 10px; color: var(--gold); }
.legal p, .legal li { color: var(--text); }
.legal ul { padding-left: 22px; }
.legal a { color: var(--blue); }
.legal .updated { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.legal-footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.legal-footer a { color: var(--muted); text-decoration: none; margin: 0 6px; }
.legal-footer a:hover { color: var(--gold); }

/* --- Ranking page --- */
.ranking-page { padding: 0; }
.ranking-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.ranking-header { margin: 8px 0 24px; }
.ranking-header h1 { font-size: 30px; margin: 0 0 6px; color: var(--text); }
.ranking-header .tagline { margin: 0; }

.ranking-me { margin-bottom: 20px; }
.rk-me-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  flex-wrap: wrap;
}
.rk-me-left { display: flex; align-items: center; gap: 14px; }
.rk-me-label {
  text-transform: uppercase; letter-spacing: 2px;
  font-size: 11px; color: var(--muted); margin-bottom: 2px;
}
.rk-me-name { font-size: 18px; font-weight: 600; color: var(--text); }
.rk-me-stats {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
}
.rk-me-stat {
  display: flex; flex-direction: column; align-items: flex-start;
  min-width: 60px;
}
.rk-me-stat b {
  font-size: 18px; color: var(--text); line-height: 1.1;
}
.rk-me-stat span { color: var(--muted); font-size: 12px; }
.rk-me-rank {
  font-size: 22px; font-weight: 700; color: var(--text);
}
.rk-me-rank-gold   { color: var(--gold); }
.rk-me-rank-silver { color: #cfd6df; }
.rk-me-rank-bronze { color: #cd8b5a; }
.rk-me-rank-unranked { color: var(--muted); font-size: 14px; }
.rk-me-total { color: var(--muted); font-size: 12px; margin-left: 4px; }

.ranking-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  margin-bottom: 14px;
}
.ranking-filter { display: flex; flex-direction: column; gap: 4px; }
.ranking-filter label {
  text-transform: uppercase; letter-spacing: 1.5px;
  font-size: 11px; color: var(--muted);
}
.ranking-filter input,
.ranking-filter select {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  min-width: 130px;
}
.ranking-filter input:focus,
.ranking-filter select:focus {
  outline: none; border-color: var(--gold);
}
.ranking-reset {
  align-self: flex-end;
  padding: 8px 14px;
}
.ranking-status {
  color: var(--muted);
  font-size: 12px;
  margin: 6px 2px 10px;
}

.ranking-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 720px;
}
.ranking-table thead th {
  text-align: left;
  padding: 12px 14px;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0;
}
.ranking-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}
.ranking-table tbody tr:last-child td { border-bottom: none; }
.ranking-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.rk-col-num { text-align: right; white-space: nowrap; }
.rk-col-rank { width: 78px; }
.rk-empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.rk-points { color: var(--gold); font-weight: 600; }
.rk-win  { color: #4ade80; }
.rk-loss { color: var(--red); }
.rk-aband { color: var(--red); opacity: 0.85; }

.rk-player { display: flex; align-items: center; gap: 10px; }
.rk-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  object-fit: cover;
  background: var(--panel-2);
  border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px; font-weight: 700;
}
.rk-avatar.placeholder { line-height: 1; }
.rk-name { font-weight: 500; }
.rk-you-chip {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.18);
  color: var(--blue);
  border: 1px solid rgba(59, 130, 246, 0.5);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.rk-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  color: var(--text);
  background: var(--panel-2);
}
.rk-rank-unranked { color: var(--muted); }

/* Top 3 medal styles (rank badge + row highlight). */
.rk-medal {
  color: #1a1300;
  min-width: 34px;
  border: 1px solid transparent;
  box-shadow: 0 0 12px rgba(0,0,0,0.4) inset;
}
.rk-medal-gold   { background: linear-gradient(180deg, #f0d087, #b28a3f); }
.rk-medal-silver { background: linear-gradient(180deg, #e6ecf3, #96a1af); }
.rk-medal-bronze { background: linear-gradient(180deg, #e3a475, #8a5a34); color: #1a0f00; }

.rk-top-gold   { background: linear-gradient(90deg, rgba(200,170,110,0.14), transparent 60%); }
.rk-top-silver { background: linear-gradient(90deg, rgba(207,214,223,0.10), transparent 60%); }
.rk-top-bronze { background: linear-gradient(90deg, rgba(205,139,90,0.12), transparent 60%); }
.rk-top .rk-name { font-weight: 600; }
.rk-top-gold   .rk-name { color: var(--gold); }
.rk-self {
  outline: 1px solid rgba(59,130,246,0.5);
  outline-offset: -1px;
  background: rgba(59,130,246,0.06);
}

/* --- Auth widget rank chip (start card) --- */
.auth-rank-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}
.auth-rank-chip:hover { color: var(--text); border-color: var(--gold); }
.auth-rank-chip b { color: var(--text); font-weight: 600; }
.auth-rank-chip.gold   { border-color: var(--gold); }
.auth-rank-chip.gold b   { color: var(--gold); }
.auth-rank-chip.silver b { color: #cfd6df; }
.auth-rank-chip.bronze b { color: #cd8b5a; }

@media (max-width: 640px) {
  .ranking-wrap { padding: 24px 12px 60px; }
  .rk-me-stats { gap: 14px; }
  .rk-me-stat b { font-size: 16px; }
  .ranking-filter input,
  .ranking-filter select { min-width: 110px; }
}

