:root {
  color-scheme: dark;
  --background: #05070d;
  --surface: rgba(15, 21, 33, 0.78);
  --surface-raised: rgba(24, 33, 50, 0.85);
  --border: rgba(97, 116, 148, 0.22);
  --border-strong: rgba(133, 155, 190, 0.34);
  --text: #eef2f9;
  --muted: #8b97ab;
  --accent: #a3ff5e;
  --accent-strong: #7bf93c;
  --accent-dim: rgba(163, 255, 94, 0.12);
  --cyan: #4da3ff;
  --violet: #8b5cf6;
  --danger: #ff7d8b;
  --gold: #ffd166;
  --silver: #d7e0ee;
  --bronze: #e8a56c;
  --shadow: 0 24px 60px rgba(2, 5, 12, 0.55);
  --radius-lg: 18px;
  --radius-md: 13px;
  --radius-sm: 9px;
  font-family: "Inter Tight", Inter, "Segoe UI Variable Display", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}

/* ---------- aurora background ---------- */

body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 38% at 12% -4%, rgba(56, 130, 246, 0.22), transparent),
    radial-gradient(ellipse 42% 30% at 88% 6%, rgba(163, 255, 94, 0.12), transparent),
    radial-gradient(ellipse 50% 36% at 55% 108%, rgba(139, 92, 246, 0.20), transparent),
    radial-gradient(ellipse 40% 30% at 100% 70%, rgba(77, 163, 255, 0.10), transparent);
  animation: aurora-drift 46s ease-in-out infinite alternate;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(133, 155, 190, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(133, 155, 190, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 20%, transparent 75%);
}
@keyframes aurora-drift {
  from { transform: translate3d(-2%, -1%, 0) rotate(-1deg); }
  to { transform: translate3d(2%, 2%, 0) rotate(1.5deg); }
}
.site-footer b { color: var(--accent-strong); letter-spacing: 0.14em; }
.site-footer a { color: var(--muted); text-decoration: none; font-weight: 700; }
.site-footer a:hover { color: var(--accent-strong); }
.profile-banner { display: flex; align-items: center; gap: 20px; }

/* ---------- site nav ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(5, 7, 13, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 13px 0;
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.nav-brand svg { width: 24px; height: 24px; flex: none; }
.nav-brand small {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.nav-links { display: flex; gap: 6px; }
.nav-links a {
  position: relative;
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  transition: color 140ms ease, background 140ms ease;
}
.nav-links a:hover { color: var(--text); background: var(--surface-raised); }
.nav-links a.active {
  color: var(--accent-strong);
  background: var(--accent-dim);
  box-shadow: inset 0 0 0 1px var(--accent-dim);
}
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: var(--accent-strong);
  box-shadow: 0 0 10px var(--accent-strong);
}

/* ---------- layout ---------- */

.shell {
  width: min(1420px, calc(100% - 48px));
  margin: 0 auto;
  padding: 44px 0 40px;
}

.site-footer {
  margin-top: 70px;
  padding: 22px 0 30px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
}
.site-footer .shell {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 0;
}

/* ---------- hero ---------- */

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 28px;
  margin-bottom: 34px;
  animation: rise-in 520ms cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 7px 14px;
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent-strong);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 12px var(--accent-strong);
  animation: pulse-dot 2.6s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

h1, h2, h3, p { margin-top: 0; }
h1 {
  margin-bottom: 12px;
  font-size: clamp(2.5rem, 5.8vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  background: linear-gradient(120deg, #ffffff 30%, var(--accent) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
h2 { margin-bottom: 6px; font-size: 1.28rem; letter-spacing: -0.02em; }
h3 {
  margin-bottom: 14px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--muted);
}
.subtitle, .toolbar p { margin-bottom: 0; color: var(--muted); }
.subtitle { max-width: 620px; line-height: 1.55; font-size: 0.98rem; }
.subtitle code {
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--accent);
  font-size: 0.85em;
}

/* ---------- buttons ---------- */

.hero-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}
.hero-link::after { content: "→"; margin-left: 2px; transition: margin-left 160ms ease; }
.hero-link:hover::after { margin-left: 7px; }

.primary, .secondary, .close {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  cursor: pointer;
  padding: 11px 22px;
  font-weight: 700;
  color: inherit;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.primary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--accent-strong);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #0a1206;
  font-weight: 800;
  box-shadow: 0 6px 22px rgba(163, 255, 94, 0.22);
}
.primary:disabled, .secondary:disabled { opacity: 0.45; cursor: not-allowed; }
.primary:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(163, 255, 94, 0.35);
}
.primary:not(:disabled):active { transform: translateY(0); }
.primary svg { width: 15px; height: 15px; transition: transform 160ms ease; }
.primary:not(:disabled):hover svg { transform: translateX(3px); }
.secondary:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  transform: translateY(-1px);
}
.secondary:active { transform: translateY(0); }

/* ---------- status cards ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 30px;
}
.stats article, .detail-summary article {
  position: relative;
  overflow: hidden;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: rise-in 520ms cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
.stats article:nth-child(2) { animation-delay: 70ms; }
.stats article:nth-child(3) { animation-delay: 140ms; }
.stats article:nth-child(4) { animation-delay: 210ms; }
.stats article::before, .detail-summary article::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), rgba(56, 130, 246, 0.7));
}
.stats span, .detail-summary span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.stats strong {
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #ffffff, #b9c6dd);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- panel / toolbar ---------- */

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: rise-in 560ms cubic-bezier(0.2, 0.8, 0.3, 1) 120ms both;
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 26px 26px 20px;
}

#players th.rank-col, #players td.rank { text-align: center; }
.rank-1, .rank-2, .rank-3 {
  position: relative;
  z-index: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}
.rank-1::before, .rank-2::before, .rank-3::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.search { width: min(340px, 100%); }
.search span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.search input {
  width: 100%;
  padding: 11px 15px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(9, 13, 21, 0.65);
  color: var(--text);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.search input::placeholder { color: #5b677b; }
.search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  outline: none;
}

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 13px 18px;
  border-bottom: 1px solid rgba(65, 79, 102, 0.5);
  text-align: left;
  white-space: nowrap;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(11, 16, 26, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--muted);
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
th button {
  padding: 0;
  color: inherit;
  border: 0;
  background: transparent;
  font-weight: 800;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  transition: color 120ms ease;
}
th button:hover, th button.active { color: var(--accent-strong); }
th button.active::after { content: " ↓"; color: var(--accent); }
th[aria-sort="asc"] button.active::after { content: " ↑"; }
th.number, td.number { text-align: right; font-variant-numeric: tabular-nums; }
td.number { font-weight: 600; }

#players tr {
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease;
}
#players tr:hover, #players tr:focus {
  background: linear-gradient(90deg, var(--accent-dim), transparent 70%);
  outline: none;
}
#players tr:last-child td { border-bottom: 0; }

.rank {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
}
.top-rank { font-weight: 800; font-size: 0.95rem; }
.rank-1::before { background: linear-gradient(135deg, #ffe29a, var(--gold)); box-shadow: 0 0 14px rgba(255, 209, 102, 0.35); }
.rank-2::before { background: linear-gradient(135deg, #f2f7ff, var(--silver)); }
.rank-3::before { background: linear-gradient(135deg, #f5c9a0, var(--bronze)); }
.rank-1 { color: #1b1403; }
.rank-2 { color: #10151f; }
.rank-3 { color: #241405; }

.player-name { font-weight: 750; letter-spacing: -0.01em; }
.player-name a, .mate-name, .back-link {
  color: inherit;
  text-decoration: none;
}
.player-name a:hover, .mate-name:hover {
  color: var(--accent-strong);
}
.platform { color: var(--muted); }
.chip {
  display: inline-block;
  padding: 4px 11px;
  border: 1px solid rgba(77, 163, 255, 0.35);
  border-radius: 999px;
  background: rgba(77, 163, 255, 0.12);
  color: #b9d1ff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.most-played { color: var(--text); }
.most-played small { color: var(--muted); }
.empty { padding: 32px; color: var(--muted); text-align: center; }

.detail-table {
  max-height: 400px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: auto;
}
.detail-table th, .detail-table td { padding: 10px 12px; font-size: 0.86rem; }
.detail-table thead th { background: var(--surface-raised); }
.change-positive { color: var(--accent-strong); }
.change-negative { color: var(--danger); }
.incomplete { color: var(--muted); }

/* ---------- profile ---------- */

.profile-shell { padding-bottom: 72px; }
.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 28px;
  animation: rise-in 520ms cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
.profile-header h1 { margin: 6px 0 8px; display: flex; align-items: center; gap: 18px; }
.monogram {
  display: inline-grid;
  place-items: center;
  width: 76px;
  height: 76px;
  flex: none;
  border-radius: 24px;
  border: 1px solid var(--accent-dim);
  background:
    radial-gradient(ellipse 90% 90% at 20% 15%, rgba(163, 255, 94, 0.22), transparent),
    linear-gradient(160deg, rgba(24, 33, 50, 0.95), rgba(9, 13, 21, 0.95));
  color: var(--accent);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  box-shadow: 0 14px 34px rgba(2, 5, 12, 0.55);
  -webkit-text-fill-color: var(--accent);
}
.profile-summary {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 26px;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}
.profile-panel { padding: 24px; }
.profile-panel h2 { margin: 0; }
.section-note {
  min-height: 42px;
  margin: 7px 0 18px;
  color: var(--muted);
  font-size: 0.86rem;
}
.identity-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.identity-list li {
  display: grid;
  gap: 4px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  transition: border-color 140ms ease, transform 140ms ease;
}
.identity-list li:hover { border-color: var(--border-strong); transform: translateX(2px); }
.identity-list strong { overflow-wrap: anywhere; }
.identity-list span {
  color: var(--muted);
  font-size: 0.76rem;
}

.teammates { margin: 0; padding: 0; list-style: none; counter-reset: mate; }
.teammates li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  margin-bottom: 8px;
  counter-increment: mate;
}
.teammates li::before {
  content: counter(mate);
  margin-right: 12px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}
.teammates li span { color: var(--muted); font-variant-numeric: tabular-nums; }
.mate-name {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-history { padding-bottom: 24px; }
.profile-history .toolbar { border-bottom: 0; }
.profile-history-table {
  max-height: 560px;
  margin: 0 24px;
}
.history-note { margin: 0 26px 14px; min-height: 0; }
.session-kd { font-weight: 800; }
.between-sessions th,
.between-sessions td {
  background: var(--surface-raised);
  color: var(--gold);
  font-size: 0.76rem;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
}

/* ---------- replay details ---------- */

.replay-link {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  transition: color 140ms ease;
}
.replay-link::after {
  content: " ↗";
  color: var(--accent-strong);
  font-size: 0.76em;
}
.replay-link:hover { color: var(--accent-strong); }
.replay-shell { padding-bottom: 72px; }
.replay-back {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--muted);
  font-weight: 700;
  transition: color 140ms ease;
}
.replay-back:hover { color: var(--accent-strong); }
.replay-header { margin-bottom: 28px; animation: rise-in 520ms cubic-bezier(0.2, 0.8, 0.3, 1) both; }
.replay-header h1 { margin: 6px 0 10px; }
.replay-summary { grid-template-columns: repeat(4, 1fr); }
.replay-summary article:first-child strong { font-size: 1.1rem; }
.replay-participants { padding-bottom: 24px; }
.replay-participants .toolbar p { margin: 7px 0 0; }
.replay-data-note { min-height: 0; margin: 0 26px 16px; }
.replay-table-wrap {
  max-height: 680px;
  margin: 0 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: auto;
}
.replay-table-wrap tbody tr { transition: background 120ms ease; }
.replay-table-wrap tbody tr:hover { background: linear-gradient(90deg, var(--accent-dim), transparent 70%); }
.replay-kd { color: var(--accent-strong); }
.stats-chip {
  display: inline-block;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.stats-chip.is-complete {
  border-color: rgba(163, 255, 94, 0.3);
  background: var(--accent-dim);
  color: var(--accent-strong);
}

/* ---------- period comparison ---------- */

.period-panel .toolbar { padding-bottom: 16px; }
.period-inputs { display: flex; align-items: flex-end; gap: 12px; }
.period-field { display: grid; gap: 8px; }
.period-field span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.period-field input {
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(9, 13, 21, 0.65);
  color: var(--text);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.period-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  outline: none;
}
.period-arrow { padding-bottom: 13px; color: var(--muted); font-weight: 800; }
.period-note { margin: 0 26px 14px; min-height: 0; }
.period-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 0 26px 26px;
}
.period-grid article {
  position: relative;
  overflow: hidden;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  animation: rise-in 320ms ease both;
}
.period-grid article:nth-child(2) { animation-delay: 60ms; }
.period-grid article:nth-child(3) { animation-delay: 120ms; }
.period-grid article:nth-child(4) { animation-delay: 180ms; }
.period-grid article:nth-child(5) { animation-delay: 240ms; }
.period-grid article::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), rgba(56, 130, 246, 0.7));
}
.period-grid span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.period-grid strong {
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.period-grid .stat-good strong { color: var(--accent-strong); }
.period-grid .stat-bad strong { color: var(--danger); }

/* ---------- player feedback ---------- */

.feedback-panel {
  margin-top: 26px;
  padding: 26px;
}
.feedback-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.feedback-toolbar h2 { margin: 0; }
.feedback-toolbar .section-note { min-height: 0; margin-bottom: 0; }
.player-votes { display: flex; gap: 10px; flex: none; }
.vote-button {
  display: grid;
  grid-template-columns: 20px auto auto;
  align-items: center;
  gap: 8px;
  min-width: 112px;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease, transform 140ms ease;
}
.vote-button svg { width: 20px; height: 20px; fill: currentColor; }
.vote-button strong {
  color: var(--text);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.vote-button:not(:disabled):hover { transform: translateY(-1px); color: var(--text); }
.vote-button:disabled { opacity: 0.55; cursor: wait; }
.vote-up.is-active {
  border-color: var(--accent-strong);
  background: var(--accent-dim);
  color: var(--accent-strong);
}
.vote-down.is-active {
  border-color: var(--danger);
  background: rgba(255, 125, 139, 0.1);
  color: var(--danger);
}
.comment-form {
  display: grid;
  grid-template-columns: minmax(170px, 0.34fr) 1fr;
  gap: 16px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.comment-form label { display: grid; align-content: start; gap: 8px; }
.comment-form label > span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: rgba(9, 13, 21, 0.72);
  color: var(--text);
  font: inherit;
  line-height: 1.45;
  resize: vertical;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  outline: none;
}
.comment-form input::placeholder,
.comment-form textarea::placeholder { color: #677389; }
.comment-submit-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.feedback-status { min-height: 20px; margin: 0; color: var(--accent-strong); font-size: 0.84rem; }
.feedback-status.is-error { color: var(--danger); }
.comments-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 24px 0 14px;
}
.comments-heading h3 { margin: 0; }
.comments-heading span { color: var(--muted); font-size: 0.8rem; }
.comment-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.comment-list li {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}
.comment-list header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 8px;
}
.comment-list strong { overflow-wrap: anywhere; }
.comment-list time { flex: none; color: var(--muted); font-size: 0.76rem; }
.comment-list p {
  margin: 0;
  color: #d7dfec;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.comment-list .comment-empty { color: var(--muted); text-align: center; }

/* ---------- upload ---------- */

.upload-body { overflow-x: hidden; }
.upload-panel { padding: 26px; display: grid; gap: 22px; }
.upload-drop {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 7px;
  min-height: 250px;
  align-content: center;
  padding: 38px 24px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse 70% 80% at 50% 0%, rgba(56, 130, 246, 0.06), transparent),
    rgba(9, 13, 21, 0.55);
  text-align: center;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
.upload-drop:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(2, 5, 12, 0.45);
}
.upload-drop.is-dragover {
  border-color: var(--accent-strong);
  border-style: solid;
  background:
    radial-gradient(ellipse 70% 80% at 50% 0%, rgba(163, 255, 94, 0.10), transparent),
    var(--accent-dim);
  transform: scale(1.02);
  box-shadow: 0 0 0 5px var(--accent-dim), 0 24px 60px rgba(2, 5, 12, 0.55);
}
.upload-drop.has-file { border-color: var(--accent); border-style: solid; }
.upload-drop.is-error { border-color: var(--danger); }
.drop-icon {
  width: 64px;
  height: 64px;
  color: #6d7d97;
  animation: icon-float 3.4s ease-in-out infinite;
  transition: color 180ms ease, transform 180ms ease;
}
.upload-drop:hover .drop-icon, .upload-drop.has-file .drop-icon { color: var(--accent-strong); }
.upload-drop.is-dragover .drop-icon { color: var(--accent-strong); transform: translateY(-6px) scale(1.08); }
.upload-drop.is-error .drop-icon { color: var(--danger); animation: none; }
@keyframes icon-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
.drop-hint {
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.upload-drop.has-file .drop-hint { color: var(--accent-strong); font-weight: 700; }
.drop-file { overflow-wrap: anywhere; font-size: 1.02rem; }
.drop-meta {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.upload-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.upload-progress { display: grid; gap: 9px; animation: rise-in 240ms ease both; }
.upload-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.82rem;
}
.upload-progress-row span { color: var(--muted); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.68rem; }
.upload-progress-row strong { font-variant-numeric: tabular-nums; }
.upload-bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(9, 13, 21, 0.75);
  border: 1px solid var(--border);
  overflow: hidden;
}
.upload-bar div {
  position: relative;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent), rgba(56, 130, 246, 0.85));
  transition: width 180ms ease;
}
.upload-bar div::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: bar-shimmer 1.3s ease-in-out infinite;
}
.upload-progress.is-importing .upload-bar div::after { animation-duration: 0.7s; }
@keyframes bar-shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.upload-error {
  margin: 0;
  padding: 12px 16px;
  border: 1px solid rgba(255, 125, 139, 0.4);
  border-radius: var(--radius-sm);
  background: rgba(255, 125, 139, 0.08);
  color: var(--danger);
  font-size: 0.9rem;
  animation: rise-in 240ms ease both;
}

.upload-result {
  padding: 22px;
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-md);
  background:
    radial-gradient(ellipse 60% 100% at 0% 0%, rgba(163, 255, 94, 0.07), transparent),
    var(--surface-raised);
  animation: rise-in 360ms cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
.result-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.result-head h2 { margin: 0 0 4px; }
.result-check { width: 44px; height: 44px; flex: none; color: var(--accent-strong); }
.check-ring { stroke-dasharray: 120; stroke-dashoffset: 120; animation: draw 560ms ease-out forwards; }
.check-mark { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 380ms ease-out 420ms forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.result-grid { margin: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.result-grid .stat {
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(9, 13, 21, 0.55);
  animation: rise-in 320ms ease both;
}
.result-grid .stat:nth-child(2) { animation-delay: 60ms; }
.result-grid .stat:nth-child(3) { animation-delay: 120ms; }
.result-grid .stat:nth-child(4) { animation-delay: 180ms; }
.result-grid .stat:nth-child(5) { animation-delay: 240ms; }
.result-grid .stat:nth-child(6) { animation-delay: 300ms; }
.result-grid dt {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.result-grid dd { margin: 5px 0 0; font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-good dd { color: var(--accent-strong); }
.stat-warn dd { color: var(--gold); }
.stat-bad dd { color: var(--danger); }

.upload-history { animation: rise-in 520ms cubic-bezier(0.2, 0.8, 0.3, 1) both; }
.upload-history h3 { margin-bottom: 12px; }
.history-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.history-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 11px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  animation: rise-in 320ms ease both;
}
.history-list li:nth-child(2) { animation-delay: 50ms; }
.history-list li:nth-child(3) { animation-delay: 100ms; }
.history-list li:nth-child(4) { animation-delay: 150ms; }
.history-list li:nth-child(5) { animation-delay: 200ms; }
.history-list li:nth-child(6) { animation-delay: 250ms; }
.history-list strong { overflow: hidden; min-width: 0; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.history-list span { flex: none; color: var(--muted); font-size: 0.76rem; white-space: nowrap; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .stats, .profile-summary { grid-template-columns: repeat(2, 1fr); }
  .profile-grid { grid-template-columns: 1fr; }
  .section-note { min-height: 0; }
  .result-grid { grid-template-columns: repeat(3, 1fr); }
  .history-list li { flex-direction: column; align-items: flex-start; gap: 3px; }
  .nav-brand small { display: none; }
  .period-grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar { flex-direction: column; align-items: flex-start; }
  .feedback-toolbar { flex-direction: column; }
  .comment-form { grid-template-columns: 1fr; }
  .replay-summary { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .shell { width: calc(100% - 28px); padding-top: 28px; }
  .hero, .profile-header { flex-direction: column; align-items: flex-start; }
  .stats, .profile-summary { grid-template-columns: 1fr; }
  .profile-history-table { margin: 0 14px; }
  .result-grid { grid-template-columns: repeat(2, 1fr); }
  .result-head { flex-direction: column; align-items: flex-start; }
  .nav-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .period-grid { grid-template-columns: 1fr; }
  .period-inputs { flex-direction: column; align-items: flex-start; }
  .period-arrow { display: none; }
  .player-votes { width: 100%; }
  .vote-button { min-width: 0; flex: 1; }
  .comment-submit-row { flex-direction: column; align-items: stretch; }
  .comment-submit-row .primary { justify-content: center; }
  .comment-list header { flex-direction: column; gap: 3px; }
  .replay-summary { grid-template-columns: 1fr; }
  .replay-table-wrap { margin: 0 14px; }
}

@media (prefers-reduced-motion: reduce) {
  body::before, .eyebrow::before, .drop-icon, .upload-bar div::after,
  .hero, .profile-header, .panel, .upload-panel, .upload-history,
  .result-grid .stat, .history-list li, .upload-result,
  .upload-progress, .upload-error, .stats article,
  .period-grid article {
    animation: none !important;
  }
  .check-ring, .check-mark { stroke-dashoffset: 0; animation: none; }
}
