/* =========================================================
   Hardline Leaderboard — Design System
   Inspired by FlyonUI dark aesthetic
   Inter font · indigo accent · dark surfaces
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── Variables ─────────────────────────────────────────── */
:root {
  /* surfaces */
  --bg:          #0f1117;
  --surface:     #161b27;
  --surface-2:   #1e2535;
  --surface-3:   #242d42;
  --border:      #2a3347;
  --border-soft: #1e2535;

  /* accent */
  --primary:       #6366f1;
  --primary-dim:   rgba(99,102,241,.15);
  --primary-glow:  rgba(99,102,241,.35);

  /* text */
  --text:       #e2e8f0;
  --text-muted: #8892a4;
  --text-dim:   #4d5d73;

  /* status */
  --online:  #22c55e;
  --away:    #f59e0b;
  --dnd:     #ef4444;
  --offline: #64748b;

  /* feedback */
  --success: #22c55e;
  --danger:  #ef4444;
  --warning: #f59e0b;

  /* rank colours */
  --bronze:      #cd7f32;
  --silver:      #94a3b8;
  --gold:        #fbbf24;
  --platinum:    #22d3ee;
  --diamond:     #a78bfa;
  --master:      #c084fc;
  --grandmaster: #fb923c;

  /* layout */
  --sidebar-w:     260px;
  --map-sidebar-w: 220px;
  --navbar-h:      60px;
  --radius:        10px;
  --radius-sm:     6px;
  --radius-lg:     14px;

  /* transitions */
  --ease: cubic-bezier(.4,0,.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }

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

/* ── Typography ─────────────────────────────────────────── */
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 600; }
h4 { font-size: 14px; font-weight: 600; }

.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 12px; }
.text-xs     { font-size: 11px; }
.font-bold   { font-weight: 700; }
.font-medium { font-weight: 500; }

/* ── Utility ────────────────────────────────────────────── */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--navbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 100;
  gap: 16px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  min-width: 160px;
}

.navbar-brand .brand-icon {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.navbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.demo-badge {
  background: var(--warning);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: .4px;
  text-transform: uppercase;
}

/* ── Status selector (Discord-style) ───────────────────── */
.status-selector { position: relative; }

.status-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.status-btn:hover { border-color: var(--primary); background: var(--surface-3); }

.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.online  { background: var(--online); box-shadow: 0 0 6px var(--online); }
.status-dot.away    { background: var(--away);   box-shadow: 0 0 6px var(--away); }
.status-dot.dnd     { background: var(--dnd);    box-shadow: 0 0 6px var(--dnd); }
.status-dot.offline { background: var(--offline); }

.status-chevron {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform .2s;
}
.status-selector.open .status-chevron { transform: rotate(180deg); }

.status-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .15s var(--ease), transform .15s var(--ease);
  z-index: 200;
}
.status-selector.open .status-dropdown {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.status-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  transition: background .1s;
}
.status-option:hover { background: var(--surface-3); }
.status-option.active { color: var(--primary); }

/* ── Layout shell ───────────────────────────────────────── */
.shell {
  display: grid;
  grid-template-columns: var(--map-sidebar-w) 1fr 280px;
  grid-template-rows: 1fr;
  min-height: 100vh;
  padding-top: var(--navbar-h);
}

/* ── Map sidebar ────────────────────────────────────────── */
.map-sidebar {
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
  padding: 16px 0;
  position: sticky;
  top: var(--navbar-h);
  height: calc(100vh - var(--navbar-h));
}

.map-sidebar-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-muted);
  padding: 0 16px 10px;
}

.map-item { border-bottom: 3px solid var(--border); }
.map-panel-inner { padding: 8px 0 12px; }

.map-rank-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: 12px;
  transition: background .1s;
}
.map-rank-row:hover { background: var(--surface-2); }
.map-rank-pos {
  width: 18px;
  text-align: center;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  flex-shrink: 0;
}
.map-rank-pos.top { color: var(--gold); }
.map-rank-name { flex: 1; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-rank-elo  { color: var(--primary); font-weight: 600; font-size: 11px; }

/* ── Scrolling leaderboard ticker ──────────────────────── */
.lb-ticker-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.lb-ticker-wrap::before,
.lb-ticker-wrap::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 32px;
  z-index: 2;
  pointer-events: none;
}
.lb-ticker-wrap::before { top: 0; background: linear-gradient(to bottom, var(--surface), transparent); }
.lb-ticker-wrap::after  { bottom: 0; background: linear-gradient(to top, var(--surface), transparent); }

.lb-ticker-inner {
  display: flex;
  flex-direction: column;
  animation: lb-scroll 40s linear infinite;
}
.lb-ticker-inner:hover { animation-play-state: paused; }

@keyframes lb-scroll {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

.lb-ticker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-soft);
  transition: background .1s;
  cursor: default;
}
.lb-ticker-row:hover { background: var(--surface-2); }

.lb-ticker-pos {
  width: 20px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}
.lb-ticker-pos.gold-pos   { color: #fbbf24; }
.lb-ticker-pos.silver-pos { color: #94a3b8; }
.lb-ticker-pos.bronze-pos { color: #cd7f32; }

.lb-ticker-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.lb-ticker-name {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-ticker-elo {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  flex-shrink: 0;
}

/* ── Verified badge ─────────────────────────────────────── */
.verified-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  background: #3b82f6;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  cursor: default;
  flex-shrink: 0;
  vertical-align: middle;
  margin-left: 5px;
  box-shadow: 0 0 0 2px rgba(59,130,246,.25);
  line-height: 1;
}
.verified-badge.lg {
  width: 22px;
  height: 22px;
  font-size: 13px;
  margin-left: 8px;
  box-shadow: 0 0 0 3px rgba(59,130,246,.25);
}

/* ── Main content ───────────────────────────────────────── */
.main {
  padding: 24px;
  min-width: 0;
  overflow: hidden;
}

/* ── Right panel ────────────────────────────────────────── */
.right-panel {
  border-left: 1px solid var(--border);
  background: var(--surface);
  padding: 20px 16px;
  overflow-y: auto;
  height: calc(100vh - var(--navbar-h));
  position: sticky;
  top: var(--navbar-h);
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.card-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* ── ELO Hero Card ──────────────────────────────────────── */
.elo-hero {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.elo-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.elo-hero::after {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: var(--primary-glow);
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.elo-hero > * { position: relative; z-index: 1; }

/* SVG ring */
.elo-ring-wrap {
  position: relative;
  width: 130px;
  height: 130px;
  flex-shrink: 0;
}

.elo-ring-wrap svg {
  width: 130px;
  height: 130px;
  transform: rotate(-90deg);
}

.elo-ring-bg   { stroke: var(--border); }
.elo-ring-fill {
  stroke-linecap: round;
  transition: stroke-dashoffset .8s var(--ease), stroke .3s;
}

.elo-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.elo-value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.elo-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.elo-hero-info { flex: 1; min-width: 0; }

.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  margin-bottom: 8px;
}

/* rank badge variants */
.rank-bronze     { background: rgba(205,127,50,.15);  color: var(--bronze);      border: 1px solid rgba(205,127,50,.3); }
.rank-silver     { background: rgba(148,163,184,.12); color: var(--silver);      border: 1px solid rgba(148,163,184,.25); }
.rank-gold       { background: rgba(251,191,36,.12);  color: var(--gold);        border: 1px solid rgba(251,191,36,.25); }
.rank-platinum   { background: rgba(34,211,238,.1);   color: var(--platinum);    border: 1px solid rgba(34,211,238,.2); }
.rank-diamond    { background: rgba(167,139,250,.12); color: var(--diamond);     border: 1px solid rgba(167,139,250,.25); }
.rank-master     { background: rgba(192,132,252,.12); color: var(--master);      border: 1px solid rgba(192,132,252,.25); }
.rank-grandmaster{ background: rgba(251,146,60,.12);  color: var(--grandmaster); border: 1px solid rgba(251,146,60,.25); }

.player-name-hero {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}

.elo-progress-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* mini stat pills */
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; }

.stat-pill {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  text-align: center;
}
.stat-pill .val {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  display: block;
}
.stat-pill .lbl {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  display: block;
}

/* ── Pref pills row ─────────────────────────────────────── */
.pref-row {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.pref-card {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.pref-card:hover { border-color: var(--primary); background: var(--surface-2); }

.pref-icon {
  width: 36px; height: 36px;
  background: var(--primary-dim);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.pref-label  { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.pref-value  { font-size: 14px; font-weight: 600; color: var(--text); }

/* ── Match history ──────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border-soft);
  transition: background .1s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }

tbody td {
  padding: 10px 12px;
  font-size: 13px;
  vertical-align: middle;
}

.td-map    { font-weight: 600; }
.td-winner { color: var(--success); font-weight: 600; }
.td-loser  { color: var(--danger);  font-weight: 600; }

.match-row { cursor: pointer; transition: background .15s var(--ease); }
.match-row:hover { background: var(--surface-2); }

.elo-change-pos { color: var(--success); font-weight: 600; }
.elo-change-neg { color: var(--danger);  font-weight: 600; }

/* ── Clan panel ─────────────────────────────────────────── */
.panel-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.clan-empty {
  text-align: center;
  padding: 20px 0;
}

.clan-empty p { color: var(--text-muted); font-size: 13px; margin-bottom: 12px; }

.clan-badge {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
}

.clan-tag-display {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 1px;
}

.clan-name-display {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.clan-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.member-list { display: flex; flex-direction: column; gap: 2px; }

.member-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  transition: background .1s;
}
.member-row:hover { background: var(--surface-2); }

.member-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.member-name  { flex: 1; font-size: 13px; font-weight: 500; }
.member-elo   { font-size: 11px; color: var(--text-muted); }

.member-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: all .15s var(--ease);
  cursor: pointer;
  border: none;
  line-height: 1;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: #818cf8; transform: translateY(-1px); box-shadow: 0 4px 16px var(--primary-glow); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-dim); }

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { opacity: .85; }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-lg { padding: 11px 22px; font-size: 15px; }

.btn-gradient {
  background: linear-gradient(135deg, var(--primary), #818cf8);
}
.btn-gradient:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 6px 20px var(--primary-glow); }

/* ── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-input::placeholder { color: var(--text-dim); }
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.form-input-wrap {
  position: relative;
}
.form-input-wrap .form-input { padding-right: 40px; }
.input-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-size: 16px;
  line-height: 1;
}
.input-toggle:hover { color: var(--text); }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}
.checkbox-row span { font-size: 13px; color: var(--text-muted); }

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 5px;
  display: none;
}
.form-error.visible { display: block; }

/* ── Tabs ───────────────────────────────────────────────── */
.tabs {
  display: flex;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 2px;
  margin-bottom: 24px;
}

.tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  cursor: pointer;
  transition: all .15s var(--ease);
  border: none;
  background: none;
}
.tab.active {
  background: var(--surface-3);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.tab:hover:not(.active) { color: var(--text); }

/* ── Divider ────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
  margin: 16px 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 420px;
  transform: scale(.95) translateY(8px);
  transition: transform .2s var(--ease);
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  overflow: hidden;
}

/* ── Player profile modal ────────────────────────────────── */
.player-profile-modal {
  padding: 0;
}
.player-profile-close {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 20;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(0,0,0,0.30);
  color: rgba(255,255,255,0.80);
  font-size: 14px;
  cursor: pointer;
  border: none;
  backdrop-filter: blur(4px);
  transition: background .15s, color .15s;
  line-height: 1;
}
.player-profile-close:hover { background: rgba(0,0,0,0.55); color: #fff; }
.player-profile-body { padding: 22px 24px 24px; }

/* ── Card skin banner ───────────────────────────────────── */
.player-card-banner {
  width: 100%;
  height: 118px;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  flex-shrink: 0;
}
/* bottom fade into modal surface */
.player-card-banner::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60%;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.60));
  pointer-events: none;
  z-index: 1;
}
/* animated light sweep */
.player-card-banner-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg,
    transparent 20%,
    rgba(255,255,255,0.07) 50%,
    transparent 80%);
  background-size: 200% 100%;
  animation: bannerShimmer 4s ease-in-out infinite;
  z-index: 2;
}
@keyframes bannerShimmer {
  0%   { background-position: -100% 0; }
  55%  { background-position: 200%  0; }
  100% { background-position: 200%  0; }
}
/* ELO ring + name/rank overlaid at bottom of banner */
.player-card-banner-info {
  position: absolute;
  bottom: 14px; left: 16px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 14px;
}
.player-card-banner-ring {
  position: relative;
  width: 72px; height: 72px;
  flex-shrink: 0;
}
.player-card-banner-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.player-card-banner-name {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.65);
  line-height: 1;
  margin-top: 5px;
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title { font-size: 17px; font-weight: 700; }
.modal-close {
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  padding: 2px;
}
.modal-close:hover { color: var(--text); }

/* ── Login page ─────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
  padding: 24px;
}

/* subtle decorative blobs */
.login-page::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,.12) 0%, transparent 70%);
  pointer-events: none;
}
.login-page::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(192,132,252,.08) 0%, transparent 70%);
  pointer-events: none;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.login-logo-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--primary), #818cf8);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.login-logo-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.login-logo-sub { font-size: 13px; color: var(--text-muted); }

.demo-link {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
}
.demo-link:hover { color: var(--warning); background: rgba(245,158,11,.08); }

/* ── Inline clan form ───────────────────────────────────── */
.clan-form {
  margin-top: 12px;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: none;
}
.clan-form.visible { display: block; }
.clan-form .form-group { margin-bottom: 10px; }
.clan-form .form-input { padding: 8px 12px; font-size: 13px; }
.clan-form-btns { display: flex; gap: 8px; margin-top: 12px; }

/* ── Notification toast ─────────────────────────────────── */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  animation: toastIn .25s var(--ease) forwards;
  max-width: 300px;
}
.toast.success { border-left: 3px solid var(--success); color: var(--success); }
.toast.error   { border-left: 3px solid var(--danger);  color: var(--danger); }
.toast.info    { border-left: 3px solid var(--primary);  color: var(--primary); }

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

/* ── Rank strip (progress to next) ─────────────────────── */
.rank-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}
.rank-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .8s var(--ease);
}

/* ── Navbar search ──────────────────────────────────────── */
.navbar-search {
  position: relative;
  flex: 1;
  max-width: 320px;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
  z-index: 1;
  line-height: 1;
}

.search-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 14px 7px 32px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-input::placeholder { color: var(--text-dim); }
.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
  z-index: 200;
  overflow: hidden;
  display: none;
}
.search-dropdown.open { display: block; }

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  transition: background .1s;
}
.search-result-item:hover { background: var(--surface-3); }
.search-result-item .sr-name { flex: 1; font-weight: 500; }
.search-result-item .sr-elo  { font-size: 12px; color: var(--text-muted); }

/* ── Clan locked notice ─────────────────────────────────── */
.clan-locked {
  margin-top: 10px;
  padding: 12px 14px;
  background: rgba(239,68,68,.07);
  border: 1px solid rgba(239,68,68,.18);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
}
.clan-locked strong { color: var(--danger); }

/* ── Clan join requests ──────────────────────────────────── */
.requests-section { margin-top: 16px; }

.requests-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.request-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.request-row .rr-name { flex: 1; font-size: 13px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.request-row .rr-elo  { font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.request-row .rr-btns { display: flex; gap: 5px; flex-shrink: 0; }

/* ── ELO Road ────────────────────────────────────────────── */
.elo-road-btn {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 11px 0;
  background: linear-gradient(90deg, rgba(99,102,241,.18) 0%, rgba(99,102,241,.08) 100%);
  border: 1px solid rgba(99,102,241,.35);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .5px;
  cursor: pointer;
  transition: background .2s var(--ease), border-color .2s;
}
.elo-road-btn:hover {
  background: linear-gradient(90deg, rgba(99,102,241,.3) 0%, rgba(99,102,241,.12) 100%);
  border-color: rgba(99,102,241,.6);
}

.elo-road-wrap {
  margin: 0 0 20px 0;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 24px 20px 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.elo-road-wrap.hidden { display: none; }

.elo-road-track {
  display: flex;
  gap: 10px;
  width: max-content;
  align-items: flex-end;
  padding-bottom: 4px;
}

.road-card {
  position: relative;
  width: 148px;
  height: 200px;
  border-radius: 12px;
  border: 2px solid transparent;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px 12px 12px;
  cursor: default;
  flex-shrink: 0;
  transition: transform .15s var(--ease), border-color .15s;
}
.road-card:hover { transform: translateY(-4px); }
.road-card.current {
  border-color: #fff;
  box-shadow: 0 0 0 1px rgba(255,255,255,.25), 0 8px 28px rgba(0,0,0,.5);
  transform: translateY(-8px);
}

.road-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: .18;
  border-radius: 10px;
}
.road-card-overlay {
  position: absolute;
  inset: 0;
  border-radius: 10px;
}

.road-card-icon {
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 36px;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.6));
}
.road-card-body {
  position: relative;
  z-index: 1;
}
.road-card-label {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .4px;
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
}
.road-card-div {
  font-size: 11px;
  font-weight: 600;
  opacity: .8;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
}
.road-card-elo {
  font-size: 10px;
  color: rgba(255,255,255,.6);
  margin-top: 4px;
}
.road-card-you {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: #0f1117;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .6px;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.road-card-you::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #fff;
  border-bottom: none;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .shell {
    grid-template-columns: 0 1fr 0;
  }
  .map-sidebar, .right-panel {
    display: none;
  }
}

@media (max-width: 640px) {
  .elo-hero { flex-direction: column; text-align: center; }
  .stat-row { justify-content: center; }
  .pref-row { flex-direction: column; }
}

/* ── Map selector ─────────────────────────────────────────── */
.map-selector {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 0 12px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  margin-bottom: 4px;
}
.map-selector::-webkit-scrollbar { height: 4px; }
.map-selector::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.map-sel-card {
  flex: 0 0 120px;
  height: 72px;
  border-radius: var(--radius);
  position: relative;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  overflow: hidden;
}
.map-sel-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
}
.map-sel-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), 0 4px 16px rgba(99,102,241,.3);
}
.map-sel-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.65) 40%, transparent);
  display: flex;
  align-items: flex-end;
  padding: 6px 8px;
}
.map-sel-label {
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .4px;
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ── Match filter buttons ─────────────────────────────────── */
.match-filter-btn {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.match-filter-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}
.match-filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── Challenge panel ──────────────────────────────────────── */
.challenge-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-muted);
  margin: 10px 0 4px;
}
.challenge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  font-size: 12px;
}
.challenge-row.active-challenge {
  border: 1px solid var(--primary);
  background: var(--primary-dim);
}
.challenge-name { color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.challenge-hint { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.challenge-cancel-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 11px;
  line-height: 1;
  flex-shrink: 0;
}
.challenge-cancel-btn:hover { color: var(--danger, #ef4444); background: rgba(239,68,68,.1); }

/* ── Match result modal ───────────────────────────────────── */
.match-result-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.match-result-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.match-result-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 14px);
  width: min(580px, 94vw);
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  animation: mrSlideIn .3s cubic-bezier(.34,1.3,.64,1);
}
.match-result-modal.slide-out {
  animation: mrSlideOut .28s ease-in forwards;
}
@keyframes mrSlideIn {
  from { transform: translateY(-28px) scale(.96); opacity: 0; }
  to   { transform: translateY(0)     scale(1);   opacity: 1; }
}
@keyframes mrSlideOut {
  from { transform: translateY(0)    scale(1);    opacity: 1; }
  to   { transform: translateY(28px) scale(.96);  opacity: 0; }
}

/* Banner */
.match-result-banner {
  position: relative;
  text-align: center;
  overflow: hidden;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.banner-victory {
  background: linear-gradient(135deg, #1a0a2e 0%, #2d1155 50%, #1e0842 100%);
}
.banner-defeat {
  background: linear-gradient(135deg, #0a0a1e 0%, #131333 50%, #0d0d28 100%);
}
.banner-spectator {
  background: linear-gradient(135deg, #0f1117 0%, #1e2535 100%);
  padding: 28px 24px 22px;
}

/* Background SVG layer (faint, behind the main SVG) */
.mr-banner-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.20;
  pointer-events: none;
}

/* Main banner SVG image */
.mr-banner-img {
  position: relative;
  z-index: 1;
  width: 260px;
  height: 260px;
  display: block;
  object-fit: contain;
}

/* ── Victory SVG entrance + shimmer ── */
.banner-victory .mr-banner-img {
  animation:
    bannerVictoryIn  0.65s cubic-bezier(.17,.67,.36,1.45) forwards,
    bannerVictoryGlow 2.8s ease-in-out 0.65s infinite;
}
@keyframes bannerVictoryIn {
  from { transform: scale(0.25) rotate(-8deg); opacity: 0; filter: brightness(3) saturate(0); }
  to   { transform: scale(1)    rotate(0deg);  opacity: 1; filter: brightness(1) saturate(1); }
}
@keyframes bannerVictoryGlow {
  0%   { filter: brightness(1)    saturate(1)    drop-shadow(0 0 10px rgba(251,191,36,.2));  }
  50%  { filter: brightness(1.12) saturate(1.28) drop-shadow(0 0 32px rgba(251,191,36,.65)); }
  100% { filter: brightness(1)    saturate(1)    drop-shadow(0 0 10px rgba(251,191,36,.2));  }
}

/* ── Defeat SVG entrance ── */
.banner-defeat .mr-banner-img {
  animation: bannerDefeatIn 0.55s cubic-bezier(.25,.1,.25,1) forwards;
}
@keyframes bannerDefeatIn {
  from { transform: scale(0.8) translateY(-24px); opacity: 0; filter: saturate(0) brightness(0.4); }
  to   { transform: scale(1)   translateY(0);     opacity: 1; filter: saturate(1) brightness(1);   }
}

/* ── Inline SVG banner container ── */
.mr-banner-svg {
  position: relative;
  z-index: 1;
  width: 360px;
  height: 360px;
  flex-shrink: 0;
}
.mr-banner-svg svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* All animated SVG groups need fill-box so transform-origin is element-center */
#vc-wing-l1, #vc-wing-l2, #vc-wing-l3,
#vc-wing-r1, #vc-wing-r2, #vc-wing-r3,
#vc-facet-t, #vc-facet-r, #vc-facet-b, #vc-facet-l,
#vc-gem, #vc-shadow, #vc-text,
#dt-wing-l1, #dt-wing-l2, #dt-wing-l3,
#dt-wing-r1, #dt-wing-r2, #dt-wing-r3,
#dt-facet-t, #dt-facet-r, #dt-facet-b, #dt-facet-l,
#dt-gem, #dt-shadow, #dt-text {
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

/* ── VICTORY per-part animations ── */

/* Left wings: slide in from left, staggered (outermost first) */
.mr-banner-svg.animated #vc-wing-l3 { animation: vcWingL .55s cubic-bezier(.17,.67,.36,1.2) .02s both; }
.mr-banner-svg.animated #vc-wing-l2 { animation: vcWingL .55s cubic-bezier(.17,.67,.36,1.2) .12s both; }
.mr-banner-svg.animated #vc-wing-l1 { animation: vcWingL .55s cubic-bezier(.17,.67,.36,1.2) .22s both; }
@keyframes vcWingL {
  from { transform: translateX(-160px); opacity: 0; }
  to   { transform: translateX(0);      opacity: 1; }
}

/* Right wings: mirror of left */
.mr-banner-svg.animated #vc-wing-r3 { animation: vcWingR .55s cubic-bezier(.17,.67,.36,1.2) .02s both; }
.mr-banner-svg.animated #vc-wing-r2 { animation: vcWingR .55s cubic-bezier(.17,.67,.36,1.2) .12s both; }
.mr-banner-svg.animated #vc-wing-r1 { animation: vcWingR .55s cubic-bezier(.17,.67,.36,1.2) .22s both; }
@keyframes vcWingR {
  from { transform: translateX(160px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

/* Diamond facets: pop in from center, rotating, staggered */
.mr-banner-svg.animated #vc-facet-t { animation: vcFacet .4s cubic-bezier(.34,1.5,.64,1) .28s both; }
.mr-banner-svg.animated #vc-facet-r { animation: vcFacet .4s cubic-bezier(.34,1.5,.64,1) .34s both; }
.mr-banner-svg.animated #vc-facet-b { animation: vcFacet .4s cubic-bezier(.34,1.5,.64,1) .40s both; }
.mr-banner-svg.animated #vc-facet-l { animation: vcFacet .4s cubic-bezier(.34,1.5,.64,1) .46s both; }
@keyframes vcFacet {
  from { transform: scale(0) rotate(45deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);  opacity: 1; }
}

/* Gem: burst in + continuous gold pulse */
.mr-banner-svg.animated #vc-gem {
  animation:
    vcGemIn   .55s cubic-bezier(.17,.67,.36,1.6) .38s both,
    vcGemGlow  2.6s ease-in-out .93s infinite;
}
@keyframes vcGemIn {
  from { transform: scale(0.15); opacity: 0; filter: brightness(4) saturate(0); }
  to   { transform: scale(1);    opacity: 1; filter: brightness(1) saturate(1); }
}
@keyframes vcGemGlow {
  0%,100% { filter: brightness(1)    saturate(1)    drop-shadow(0 0  8px rgba(237,124,255,.3)); }
  50%     { filter: brightness(1.18) saturate(1.35) drop-shadow(0 0 28px rgba(237,124,255,.85)); }
}

/* Shadow ellipses: scale in from center */
.mr-banner-svg.animated #vc-shadow { animation: vcShadow .5s ease-out .65s both; }
@keyframes vcShadow {
  from { transform: scaleX(0.1); opacity: 0; }
  to   { transform: scaleX(1);   opacity: 1; }
}

/* VICTORY text: rise up + continuous shimmer */
.mr-banner-svg.animated #vc-text {
  animation:
    vcTextIn    .45s ease-out .62s both,
    vcTextShimmer 3s ease-in-out 1.1s infinite;
}
@keyframes vcTextIn {
  from { transform: translateY(18px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes vcTextShimmer {
  0%,100% { filter: brightness(1);    }
  50%     { filter: brightness(1.18) drop-shadow(0 0 14px rgba(236,120,255,.7)); }
}

/* ── DEFEAT per-part animations ── */

/* Left wings: heavier, slower */
.mr-banner-svg.animated #dt-wing-l3 { animation: dtWingL .65s cubic-bezier(.25,.46,.45,.94) .02s both; }
.mr-banner-svg.animated #dt-wing-l2 { animation: dtWingL .65s cubic-bezier(.25,.46,.45,.94) .14s both; }
.mr-banner-svg.animated #dt-wing-l1 { animation: dtWingL .65s cubic-bezier(.25,.46,.45,.94) .26s both; }
@keyframes dtWingL {
  from { transform: translateX(-150px); opacity: 0; }
  to   { transform: translateX(0);      opacity: 1; }
}

/* Right wings */
.mr-banner-svg.animated #dt-wing-r3 { animation: dtWingR .65s cubic-bezier(.25,.46,.45,.94) .02s both; }
.mr-banner-svg.animated #dt-wing-r2 { animation: dtWingR .65s cubic-bezier(.25,.46,.45,.94) .14s both; }
.mr-banner-svg.animated #dt-wing-r1 { animation: dtWingR .65s cubic-bezier(.25,.46,.45,.94) .26s both; }
@keyframes dtWingR {
  from { transform: translateX(150px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

/* Diamond facets: fall from above */
.mr-banner-svg.animated #dt-facet-t { animation: dtFacet .5s ease-out .18s both; }
.mr-banner-svg.animated #dt-facet-r { animation: dtFacet .5s ease-out .26s both; }
.mr-banner-svg.animated #dt-facet-b { animation: dtFacet .5s ease-out .34s both; }
.mr-banner-svg.animated #dt-facet-l { animation: dtFacet .5s ease-out .42s both; }
@keyframes dtFacet {
  from { transform: translateY(-36px) scale(0.75); opacity: 0; }
  to   { transform: translateY(0)     scale(1);    opacity: 1; }
}

/* Gem: emerge cold */
.mr-banner-svg.animated #dt-gem {
  animation:
    dtGemIn  .55s ease-out .32s both,
    dtGemPulse 3.2s ease-in-out .87s infinite;
}
@keyframes dtGemIn {
  from { transform: scale(0.4); opacity: 0; filter: brightness(2.5) saturate(0); }
  to   { transform: scale(1);   opacity: 1; filter: brightness(1)   saturate(1); }
}
@keyframes dtGemPulse {
  0%,100% { filter: brightness(1)    drop-shadow(0 0  6px rgba(93,198,251,.2)); }
  50%     { filter: brightness(1.1)  drop-shadow(0 0 20px rgba(93,198,251,.55)); }
}

/* Shadow */
.mr-banner-svg.animated #dt-shadow { animation: dtShadow .5s ease-out .6s both; }
@keyframes dtShadow {
  from { transform: scaleX(0.1); opacity: 0; }
  to   { transform: scaleX(1);   opacity: 1; }
}

/* DEFEAT text: drop down heavily */
.mr-banner-svg.animated #dt-text {
  animation: dtTextIn .45s cubic-bezier(.55,0,.45,1) .52s both;
}
@keyframes dtTextIn {
  from { transform: translateY(-22px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* Fallback text verdict (shown when not a participant) */
.match-result-verdict {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 6px;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,.5);
  display: block;
  position: relative;
  z-index: 1;
}

/* Body */
.match-result-body { padding: 20px 24px 0; }
.mr-match-info {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.mr-teams {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
}
.mr-team { flex: 1; }
.mr-team-divider {
  width: 1px;
  background: var(--border);
  margin: 0 16px;
  flex-shrink: 0;
}
.mr-team-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.mr-player-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 8px;
  border-radius: 6px;
  margin-bottom: 3px;
  font-size: 13px;
}
.mr-player-row.mr-me {
  background: var(--primary-dim);
  border: 1px solid var(--primary);
}
.mr-player-name { color: var(--text); font-weight: 500; }
.mr-player-stat { color: var(--text-muted); font-size: 12px; }

/* ELO row */
.mr-elo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface-2);
  border-radius: var(--radius);
  margin-bottom: 4px;
}
.mr-elo-pos { font-size: 22px; font-weight: 800; color: #22c55e; }
.mr-elo-neg { font-size: 22px; font-weight: 800; color: #ef4444; }
.mr-elo-detail { font-size: 13px; color: var(--text-muted); }
.mr-coins-earned {
  margin-left: auto;
  font-size: 14px;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(251,191,36,.12);
  border: 1px solid rgba(251,191,36,.25);
  border-radius: 20px;
  padding: 4px 12px;
}

/* Footer */
.match-result-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 24px;
  border-top: 1px solid var(--border);
}
.mr-queue-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-right: auto;
}
#mr-dismiss-btn {
  padding: 13px 36px;
  font-size: 15px;
  border-radius: 10px;
  letter-spacing: .02em;
  min-width: 140px;
  box-shadow: 0 4px 18px rgba(99,102,241,.35);
}
#mr-dismiss-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(99,102,241,.5);
}

/* ── Hero Currency Pill ────────────────────────────────── */
.hero-bottom-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.hero-bottom-row #active-effects-banner {
  padding: 0;
  margin: 0;
}
.hero-currency-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 700;
  color: #fbbf24;
  margin-top: 0;
}
.hero-currency-icon { font-size: 16px; }
.hero-currency-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Sidebar Season Banner ─────────────────────────────── */
.sidebar-season-banner {
  position: relative;
  width: 100%;
  height: 160px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.sidebar-season-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.sidebar-season-banner-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    #1a0a2e 0%,
    #ff6b35 35%,
    #f7931e 60%,
    #ffd700 85%,
    #87ceeb 100%
  );
}
.sidebar-season-banner-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,.5) 0%, transparent 70%);
}
.sidebar-season-banner-content {
  position: relative;
  z-index: 1;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  justify-content: center;
}
.sidebar-season-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  color: rgba(255,255,255,.75);
  text-transform: uppercase;
}
.sidebar-season-name {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
  line-height: 1;
}
.sidebar-season-cta {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.7);
  margin-top: 6px;
}


/* ── Shop Overlay / Page ───────────────────────────────── */
.shop-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  overflow-y: auto;
}
.shop-overlay.open {
  display: block;
}
.shop-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 0 80px;
}

/* Header */
.shop-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 32px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
.shop-back-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all .15s;
}
.shop-back-btn:hover { color: var(--text); background: var(--surface-3); }
.shop-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  flex: 1;
}
.shop-balance {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 18px;
}
.shop-balance-icon { font-size: 20px; }
#shop-balance-amount {
  font-size: 20px;
  font-weight: 800;
  color: #fbbf24;
}
.shop-balance-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Sections */
/* ── Daily bonus card ────────────────────────────────────── */
.daily-bonus-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, var(--surface-2) 0%, color-mix(in srgb, var(--primary) 8%, var(--surface-2)) 100%);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: border-color .2s, box-shadow .2s;
}
.daily-bonus-card:hover:not(.daily-bonus-claimed) {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  box-shadow: 0 0 24px color-mix(in srgb, var(--primary) 12%, transparent);
}
.daily-bonus-claimed {
  opacity: 0.6;
  cursor: default;
}
.daily-bonus-icon {
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0;
}
.daily-bonus-info {
  flex: 1;
}
.daily-bonus-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.daily-bonus-sub {
  font-size: 13px;
  color: var(--text-muted);
}
.daily-bonus-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.shop-section {
  padding: 32px 32px 0;
}
.shop-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin: 0 0 16px;
}

/* Inventory grid */
.shop-inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
}
.inventory-slot {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 2px dashed var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  transition: border-color .15s;
}
.inventory-slot.empty {
  opacity: .4;
}
.inventory-slot:not(.empty) {
  border-style: solid;
  border-color: var(--primary);
  cursor: pointer;
}
.inventory-slot:not(.empty):hover {
  border-color: #818cf8;
  background: var(--primary-dim);
}

/* Season banner */
.season-banner {
  margin: 32px 32px 0;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  min-height: 180px;
  display: flex;
  align-items: center;
}
.season-banner-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    #1a0a2e 0%,
    #ff6b35 30%,
    #f7931e 55%,
    #ffd700 75%,
    #87ceeb 100%
  );
  opacity: .85;
}
.season-banner-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,.55) 0%, transparent 60%);
}
.season-banner-content {
  position: relative;
  z-index: 1;
  padding: 36px 40px;
}
.season-tag {
  display: inline-block;
  background: rgba(255,255,255,.2);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.season-name {
  font-size: 42px;
  font-weight: 900;
  color: #fff;
  margin: 0 0 8px;
  text-shadow: 0 2px 12px rgba(0,0,0,.4);
  letter-spacing: -.5px;
}
.season-sub {
  font-size: 14px;
  color: rgba(255,255,255,.8);
  margin: 0;
}

/* Shop items grid */
.shop-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.shop-item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  cursor: pointer;
}
.shop-item-card:hover:not(.placeholder) {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,.2);
}
.shop-item-card.placeholder {
  opacity: .5;
  cursor: default;
  filter: grayscale(.4);
}
.shop-item-icon { font-size: 40px; }
.shop-item-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.shop-item-desc {
  font-size: 12px;
  color: var(--text-muted);
  flex: 1;
}
.shop-item-price {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 700;
  color: #fbbf24;
  margin-top: 4px;
}
.shop-item-price-icon { font-size: 14px; }

/* ── Shop box cards ──────────────────────────────────────── */
.shop-box-card { position: relative; border-color: color-mix(in srgb, var(--box-color) 40%, var(--border)); overflow: hidden; cursor: pointer; }
.shop-box-card:hover { border-color: var(--box-color); box-shadow: 0 8px 28px color-mix(in srgb, var(--box-color) 30%, transparent); transform: translateY(-3px); }
.shop-box-glow { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--box-color) 18%, transparent) 0%, transparent 70%); pointer-events: none; }

/* ── Shop specials (direct-purchase items) ───────────────── */
.shop-specials-badge {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #f97316, #fbbf24);
  color: #1a1100;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  margin-right: 10px;
  vertical-align: middle;
}

.shop-specials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.shop-special-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(251,191,36,.4);
  background: linear-gradient(180deg, rgba(251,191,36,.06), var(--surface) 60%);
  box-shadow: 0 0 0 1px rgba(251,191,36,.18) inset;
}
.shop-special-card:hover {
  border-color: #fbbf24;
  box-shadow: 0 10px 36px rgba(251,191,36,.25),
              0 0 0 1px rgba(251,191,36,.4) inset;
  transform: translateY(-3px);
}

.shop-special-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(251,191,36,.22) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}
.shop-special-card > * { position: relative; z-index: 1; }

.shop-special-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #f97316, #fbbf24);
  color: #1a1100;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(251,191,36,.4);
}

/* ── Twemoji image sizing (replaces native emoji with <img class="emoji">) ── */
img.emoji { display: inline-block; vertical-align: -0.15em; width: 1.2em; height: 1.2em; }
.inventory-slot .inv-icon img.emoji          { width: 26px; height: 26px; }
.shop-item-icon img.emoji                    { width: 40px; height: 40px; }
.shop-item-price img.emoji,
.shop-item-price-icon img.emoji,
.shop-balance img.emoji                      { width: 16px; height: 16px; }
.lb-reel-item-icon img.emoji                 { width: 36px; height: 36px; }
.lb-reveal-icon img.emoji                    { width: 64px; height: 64px; }
.hero-currency-icon img.emoji                { width: 18px; height: 18px; }
.mr-coins-earned img.emoji                   { width: 14px; height: 14px; }

/* ── Inventory slots ─────────────────────────────────────── */
.inventory-slot { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 3px; }
.inventory-slot .inv-icon { font-size: 26px; }
.inventory-slot.owned { border-style: solid; border-color: var(--border); cursor: pointer; }
.inventory-slot.owned:hover { background: var(--surface-2); }
.inventory-slot.rarity-common    { border-color: #94a3b8; }
.inventory-slot.rarity-rare      { border-color: #6366f1; }
.inventory-slot.rarity-epic      { border-color: #a855f7; }
.inventory-slot.rarity-legendary { border-color: #f59e0b; box-shadow: 0 0 10px rgba(251,191,36,.3); }
.inventory-slot.active-effect { border-style: solid; border-color: #22c55e; box-shadow: 0 0 10px rgba(34,197,94,.3); }
.inv-timer { font-size: 10px; font-weight: 700; color: #22c55e; }

/* ── Lootbox overlay ─────────────────────────────────────── */
.lb-overlay {
  display: none; position: fixed; inset: 0; z-index: 400;
  background: rgba(10,10,18,.92); backdrop-filter: blur(12px);
  align-items: center; justify-content: center; flex-direction: column; gap: 32px;
}
.lb-overlay.open { display: flex; }
.lb-phase { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; width: 100%; }

/* Phase 1 — explosion */
.lb-box-wrap { position: relative; display: flex; align-items: center; justify-content: center; width: 200px; height: 200px; }
.lb-box-icon { display: flex; align-items: center; justify-content: center; transform-origin: center; }
.lb-box-icon img { width: 180px; height: 180px; object-fit: contain; transform: translateX(9%); filter: drop-shadow(0 8px 32px rgba(251,191,36,.5)) drop-shadow(0 0 12px rgba(251,191,36,.3)); }
.lb-opening-label { font-size: 16px; color: var(--text-muted); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }

@keyframes lbShake {
  0%,100% { transform: translateX(0) rotate(0deg); }
  15%  { transform: translateX(-8px) rotate(-4deg); }
  30%  { transform: translateX(8px) rotate(4deg); }
  45%  { transform: translateX(-6px) rotate(-3deg); }
  60%  { transform: translateX(6px) rotate(3deg); }
  75%  { transform: translateX(-4px) rotate(-2deg); }
  90%  { transform: translateX(4px) rotate(2deg); }
}
@keyframes lbExplode {
  0%   { transform: scale(1); opacity: 1; }
  40%  { transform: scale(1.4); opacity: .8; }
  100% { transform: scale(0); opacity: 0; }
}
.lb-box-icon.lb-shake   { animation: lbShake .7s ease-in-out; }
.lb-box-icon.lb-explode { animation: lbExplode .45s cubic-bezier(.4,0,1,1) forwards; }

.lb-particles { position: absolute; inset: 0; pointer-events: none; }
@keyframes lbParticle {
  0%   { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx),var(--dy)) scale(0); opacity: 0; }
}
.lb-particle {
  position: absolute; width: 8px; height: 8px; border-radius: 50%;
  top: 50%; left: 50%; margin: -4px 0 0 -4px;
  animation: lbParticle .7s ease-out forwards;
  animation-delay: var(--animation-delay, 0s);
}

/* Phase 2 — reel */
.lb-reel-title { font-size: 20px; font-weight: 800; color: var(--text); }
.lb-reel-wrap { width: 100%; max-width: 1000px; padding: 0 32px; }
.lb-reel-track-outer {
  position: relative; width: 100%; height: 180px; overflow: hidden;
  border-top: 2px solid var(--border); border-bottom: 2px solid var(--border);
  background: var(--surface);
}
.lb-reel-track { display: flex; align-items: center; height: 100%; will-change: transform; }
.lb-reel-item {
  flex-shrink: 0; width: 140px; height: 160px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border-right: 1px solid var(--border); background: var(--surface);
  box-sizing: border-box; padding: 8px 4px;
}
.lb-reel-item.rarity-rare      { background: color-mix(in srgb, #6366f1 8%, var(--surface)); }
.lb-reel-item.rarity-epic      { background: color-mix(in srgb, #a855f7 10%, var(--surface)); }
.lb-reel-item.rarity-legendary { background: color-mix(in srgb, #f59e0b 12%, var(--surface)); }
.lb-reel-item-icon { font-size: 36px; }
.lb-reel-item-name { font-size: 11px; font-weight: 700; color: var(--text); text-align: center; line-height: 1.2; }
.lb-reel-item-sub  { font-size: 10px; color: var(--text-muted); text-align: center; }

.lb-reel-pointer {
  position: absolute; top: 0; bottom: 0; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; pointer-events: none; z-index: 2;
}
.lb-pointer-top    { width:0; height:0; border-left:10px solid transparent; border-right:10px solid transparent; border-top:14px solid #fbbf24; }
.lb-pointer-line   { width:2px; flex:1; background:#fbbf24; opacity:.7; }
.lb-pointer-bottom { width:0; height:0; border-left:10px solid transparent; border-right:10px solid transparent; border-bottom:14px solid #fbbf24; }

.lb-reel-fade { position: absolute; top:0; bottom:0; width:140px; pointer-events:none; z-index:1; }
.lb-reel-fade-left  { left:0;  background: linear-gradient(to right, var(--surface), transparent); }
.lb-reel-fade-right { right:0; background: linear-gradient(to left,  var(--surface), transparent); }

/* Phase 3 — reveal */
.lb-reveal-label { font-size:14px; color:var(--text-muted); text-transform:uppercase; letter-spacing:.1em; font-weight:600; }
.lb-reveal-card {
  display:flex; flex-direction:column; align-items:center; gap:12px;
  background:var(--surface); border:2px solid var(--rarity-color, var(--border));
  border-radius:20px; padding:40px 60px;
  box-shadow: 0 0 40px color-mix(in srgb, var(--rarity-color, #6366f1) 30%, transparent);
  animation: lbRevealPop .4s cubic-bezier(.34,1.5,.64,1);
}
.lb-reveal-card.rarity-legendary { box-shadow: 0 0 60px rgba(251,191,36,.45); }
@keyframes lbRevealPop { from { transform:scale(.7); opacity:0; } to { transform:scale(1); opacity:1; } }
.lb-reveal-icon { font-size:64px; }
.lb-reveal-name { font-size:24px; font-weight:800; color:var(--text); }
.lb-reveal-sub  { font-size:14px; color:var(--text-muted); }
.lb-claim-btn {
  padding:14px 48px; background:var(--primary); color:#fff; font-size:16px; font-weight:700;
  border-radius:12px; border:none; cursor:pointer; transition:filter .15s, transform .15s;
  box-shadow:0 4px 18px rgba(99,102,241,.4); margin-top:8px;
}
.lb-claim-btn:hover { filter:brightness(1.1); transform:translateY(-1px); }

/* ── Active Effects Banner ──────────────────────────────── */
#active-effects-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0 4px;
}
.active-effect-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 8px;
  background: color-mix(in srgb, var(--effect-color) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--effect-color) 40%, transparent);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  box-shadow: 0 0 10px color-mix(in srgb, var(--effect-color) 20%, transparent);
  animation: aepPulse 2s ease-in-out infinite;
}
.aep-icon img.emoji { width: 16px; height: 16px; }
.aep-icon { font-size: 16px; }
.aep-name { color: var(--effect-color); font-weight: 700; }
.aep-mult { background: var(--effect-color); color: #000; font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 8px; }
.aep-timer { color: var(--text-muted); font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; }
@keyframes aepPulse {
  0%, 100% { box-shadow: 0 0 8px color-mix(in srgb, var(--effect-color) 20%, transparent); }
  50%       { box-shadow: 0 0 16px color-mix(in srgb, var(--effect-color) 40%, transparent); }
}

/* ── Cosmetic skins ────────────────────────────────────── */
@keyframes auroraShift {
  0%   { --primary: #22d3ee; }
  33%  { --primary: #818cf8; }
  66%  { --primary: #c084fc; }
  100% { --primary: #22d3ee; }
}
@keyframes sunriseShift {
  0%   { --primary: #f97316; }
  50%  { --primary: #fbbf24; }
  100% { --primary: #f97316; }
}
body.skin-aurora  { animation: auroraShift  6s linear infinite; }
body.skin-sunrise { animation: sunriseShift 4s ease-in-out infinite; }
@keyframes solarShift {
  0%   { --primary: #dc2626; }
  50%  { --primary: #f59e0b; }
  100% { --primary: #dc2626; }
}
body.skin-solar { animation: solarShift 5s ease-in-out infinite; }

/* Particle canvas — sits behind all UI */
#particle-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Shell sits above particle canvas */
.shell { position: relative; z-index: 1; }

/* Enhanced UI borders & glows when any accent skin is active */
body.skin-active .card {
  border-color: color-mix(in srgb, var(--primary) 22%, var(--border));
}
body.skin-active .elo-hero {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  box-shadow: 0 0 48px color-mix(in srgb, var(--primary) 10%, transparent),
              0 2px 12px rgba(0,0,0,.4);
}
body.skin-active .navbar {
  border-bottom-color: color-mix(in srgb, var(--primary) 20%, var(--border));
  box-shadow: 0 1px 24px color-mix(in srgb, var(--primary) 8%, transparent);
}
body.skin-active .map-sidebar {
  border-right-color: color-mix(in srgb, var(--primary) 18%, var(--border));
}
body.skin-active .right-panel {
  border-left-color: color-mix(in srgb, var(--primary) 18%, var(--border));
}

/* Equipped mark in inventory */
.inv-equipped-mark {
  position: absolute;
  top: 3px; right: 5px;
  font-size: 9px;
  font-weight: 800;
  color: var(--primary);
}
.inventory-slot { position: relative; }

/* ── Match detail modal ──────────────────────────────────── */
.match-detail-modal {
  max-width: 520px;
  width: 100%;
  padding: 0;
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ── Banner ── mirrors .player-card-banner */
.match-detail-header {
  width: 100%;
  height: 160px;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-3);
}
.match-detail-header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 100%;
  background: linear-gradient(to bottom, transparent 30%, rgba(0,0,0,.85) 100%);
  pointer-events: none;
  z-index: 1;
}

.match-detail-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg,
    transparent 20%,
    rgba(255,255,255,.07) 50%,
    transparent 80%);
  background-size: 200% 100%;
  animation: bannerShimmer 4s ease-in-out infinite;
  z-index: 2;
}

.match-detail-header-content {
  position: absolute;
  bottom: 16px; left: 20px; right: 20px;
  z-index: 3;
}

.md-map-name {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,.7);
  line-height: 1;
  letter-spacing: -.3px;
}

.md-map-sub {
  font-size: 11px;
  color: rgba(255,255,255,.7);
  font-weight: 600;
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: .6px;
  text-shadow: 0 1px 6px rgba(0,0,0,.85);
}

/* close — mirrors .player-profile-close */
.match-detail-close {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 10;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(0,0,0,.35);
  color: rgba(255,255,255,.85);
  font-size: 14px;
  cursor: pointer;
  border: none;
  backdrop-filter: blur(4px);
  transition: background .15s, color .15s;
  line-height: 1;
}
.match-detail-close:hover { background: rgba(0,0,0,.6); color: #fff; }

/* ── Score band ── prominent, separate from banner */
#md-score {
  display: flex;
  align-items: stretch;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.md-score-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  gap: 4px;
  transition: background .2s;
}
.md-score-side.md-side-win  { background: linear-gradient(180deg, rgba(34,197,94,.10), transparent); }
.md-score-side.md-side-loss { opacity: .75; }

.md-score-num {
  font-size: 36px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.md-side-win  .md-score-num { color: var(--success); }
.md-side-loss .md-score-num { color: var(--text-muted); }

.md-score-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
}
.md-side-win .md-score-label { color: var(--success); }

.md-score-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: .5px;
  padding: 0 14px;
}

/* ── Body ── */
.match-detail-body {
  overflow-y: auto;
  padding: 18px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.match-detail-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 32px 0;
  font-size: 14px;
}

/* Team section header */
.md-team-section { display: flex; flex-direction: column; gap: 6px; }

.md-team-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 2px 8px;
  border-bottom: 1px solid var(--border);
}

.md-team-bullet {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.md-team-win  .md-team-bullet { background: var(--success); box-shadow: 0 0 8px rgba(34,197,94,.6); }
.md-team-loss .md-team-bullet { background: var(--text-dim); }

.md-team-name {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text);
}

.md-team-result {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 3px 8px;
  border-radius: 4px;
}
.md-team-win  .md-team-result { background: rgba(34,197,94,.15); color: var(--success); }
.md-team-loss .md-team-result { background: var(--surface-3);     color: var(--text-muted); }

/* Player roster */
.md-team-roster { display: flex; flex-direction: column; }

.md-player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border-soft);
  transition: background .12s;
}
.md-player-row:last-child { border-bottom: none; }
.md-player-row:hover { background: var(--surface-2); }
.md-player-row.md-player-me {
  background: linear-gradient(90deg, rgba(99,102,241,.08), transparent);
  padding-left: 10px;
  margin-left: -10px;
  border-radius: var(--radius-sm);
}

.md-player-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: 1px;
}

.md-player-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}
.md-player-me .md-player-name { color: var(--primary); }

.md-player-kd {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .4px;
}

.md-player-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.md-kda {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: .2px;
}
.md-kda b { color: var(--text); font-weight: 700; }

.md-elo-delta {
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  min-width: 44px;
  text-align: right;
}
.md-elo-pos { color: var(--success); }
.md-elo-neg { color: var(--danger); }

.md-disconn { color: var(--danger); font-size: 11px; margin-left: 2px; }

@media (max-width: 520px) {
  .match-detail-modal { max-width: 100%; border-radius: 0; max-height: 100dvh; }
  .match-detail-header { border-radius: 0; }
  .md-score-num { font-size: 30px; }
  .md-player-kd { display: none; }
}
