@import url('https://fonts.googleapis.com/css2?family=Russo+One&family=Barlow+Condensed:wght@300;400;500;600;700&family=Barlow:wght@400;500&display=swap');

/* ── Variables ────────────────────────────────────────────── */
:root {
  --bg:          #07080f;
  --bg-2:        #0d0f1c;
  --surface:     #111426;
  --surface-2:   #181c32;
  --border:      rgba(255, 255, 255, 0.07);
  --border-glow: rgba(245, 197, 24, 0.25);

  --gold:        #f5c518;
  --gold-dim:    rgba(245, 197, 24, 0.12);
  --gold-mid:    rgba(245, 197, 24, 0.4);
  --blue:        #2563eb;
  --blue-bright: #3b82f6;
  --blue-dim:    rgba(37, 99, 235, 0.15);

  --bronze:      #c9824a;
  --silver:      #94a3b8;
  --platinum:    #f5c518;

  --text:        #eceef8;
  --text-muted:  #7a85a8;
  --text-dim:    #9ba5c4;

  --font-display: 'Russo One', sans-serif;
  --font-ui:      'Barlow Condensed', sans-serif;
  --font-body:    'Barlow', sans-serif;

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 16px;
}

/* ── Light mode ────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:          #f0f2f5;
  --bg-2:        #e4e7eb;
  --surface:     #ffffff;
  --surface-2:   #f0f2f5;
  --border:      rgba(0, 0, 0, 0.1);
  --border-glow: rgba(245, 197, 24, 0.15);
  --gold-dim:    rgba(245, 197, 24, 0.2);
  --gold-mid:    rgba(245, 197, 24, 0.5);

  --text:        #1a1a2e;
  --text-muted:  #8892b0;
  --text-dim:    #a0a8c0;

  --blue-dim:    rgba(37, 99, 235, 0.1);
}

[data-theme="light"] .arena-bg::after {
  opacity: 0.3;
}

[data-theme="light"] .arena-bg::before {
  opacity: 0.4;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ── Background Scene ─────────────────────────────────────── */
.arena-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Perspective grid floor */
.arena-bg::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200%;
  height: 55%;
  background-image:
    linear-gradient(to right, rgba(37, 99, 235, 0.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(37, 99, 235, 0.18) 1px, transparent 1px);
  background-size: 80px 80px;
  transform-origin: bottom center;
  transform: translateX(-50%) perspective(600px) rotateX(60deg);
  mask-image: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 80%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 80%);
}

/* Radial glow center-top */
.arena-bg::before {
  content: '';
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(ellipse at center,
    rgba(37, 99, 235, 0.12) 0%,
    rgba(245, 197, 24, 0.05) 40%,
    transparent 70%);
  border-radius: 50%;
}

/* Floating geometric shapes */
.arena-shapes {
  position: absolute;
  inset: 0;
}

.shape {
  position: absolute;
  opacity: 0;
  animation: floatShape linear infinite;
}

.shape--diamond {
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--gold);
  transform: rotate(45deg);
  opacity: 0;
  animation: floatDiamond linear infinite;
}

.shape--ring {
  border-radius: 50%;
  border: 1px solid var(--blue-bright);
  opacity: 0;
  animation: floatRing linear infinite;
}

.shape--line {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold-mid), transparent);
  opacity: 0;
  animation: scanLine linear infinite;
}

@keyframes floatDiamond {
  0%   { opacity: 0; transform: rotate(45deg) translateY(0) scale(0.8); }
  10%  { opacity: 0.35; }
  90%  { opacity: 0.2; }
  100% { opacity: 0; transform: rotate(45deg) translateY(-120px) scale(1.1); }
}

@keyframes floatRing {
  0%   { opacity: 0; transform: scale(0.6); }
  15%  { opacity: 0.2; }
  85%  { opacity: 0.1; }
  100% { opacity: 0; transform: scale(1.4); }
}

@keyframes scanLine {
  0%   { opacity: 0; transform: translateX(-30px); }
  20%  { opacity: 0.5; }
  80%  { opacity: 0.3; }
  100% { opacity: 0; transform: translateX(30px); }
}

/* Noise/grain overlay */
.arena-grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.55;
}

/* ── Layout helpers ───────────────────────────────────────── */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Login Page ───────────────────────────────────────────── */
.login {
  align-items: center;
  justify-content: center;
  padding: 40px 24px 80px;
  gap: 0;
}

/* Top eyebrow */
.login__eyebrow {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.login__eyebrow::before,
.login__eyebrow::after {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--gold-mid);
}

/* Hero title */
.login__hero {
  text-align: center;
  margin-bottom: 28px;
}

.login__title {
  font-family: var(--font-display);
  font-size: clamp(56px, 12vw, 112px);
  line-height: 0.9;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: 0 0 80px rgba(245, 197, 24, 0.15);
}

.login__title span {
  display: block;
  color: var(--gold);
  text-shadow:
    0 0 40px rgba(245, 197, 24, 0.6),
    0 0 80px rgba(245, 197, 24, 0.25);
}

.login__tagline {
  font-family: var(--font-ui);
  font-size: clamp(15px, 3vw, 20px);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 16px;
}

.login__tagline em {
  font-style: normal;
  color: var(--gold);
}

/* Grade badges */
.grade-badges {
  display: flex;
  gap: 12px;
  margin: 36px 0;
  flex-wrap: wrap;
  justify-content: center;
}

.grade-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 14px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
  cursor: default;
  animation: badgePulse 6s ease-in-out infinite;
}

.grade-badge:nth-child(2) { animation-delay: 2s; }
.grade-badge:nth-child(3) { animation-delay: 4s; }

.grade-badge::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}

.grade-badge:nth-child(1)::before { background: var(--bronze); box-shadow: 0 0 12px var(--bronze); }
.grade-badge:nth-child(2)::before { background: var(--silver); box-shadow: 0 0 12px var(--silver); }
.grade-badge:nth-child(3)::before { background: var(--platinum); box-shadow: 0 0 12px var(--platinum); }

.grade-badge:hover { transform: translateY(-3px); }
.grade-badge:nth-child(1):hover { border-color: var(--bronze); }
.grade-badge:nth-child(2):hover { border-color: var(--silver); }
.grade-badge:nth-child(3):hover { border-color: var(--platinum); }

.grade-badge__rank {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1;
}

.grade-badge:nth-child(1) .grade-badge__rank { color: var(--bronze); }
.grade-badge:nth-child(2) .grade-badge__rank { color: var(--silver); }
.grade-badge:nth-child(3) .grade-badge__rank { color: var(--platinum); }

.grade-badge__label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

@keyframes badgePulse {
  0%, 100% { box-shadow: none; }
  50%       { box-shadow: 0 4px 24px rgba(245, 197, 24, 0.07); }
}

/* Auth error message */
.login__error {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #ea4335;
  background: rgba(234, 67, 53, 0.08);
  border: 1px solid rgba(234, 67, 53, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  width: 100%;
  text-align: center;
}

/* Sign-in button */
.login__cta {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.btn-google {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 36px;
  background: var(--text);
  color: #111;
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  text-decoration: none;
  box-shadow: 0 0 0 0 rgba(245, 197, 24, 0);
}

.btn-google:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(245, 197, 24, 0.3);
}

.btn-google:active {
  transform: translateY(0);
}

.btn-google__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.login__fine {
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Footer strip */
.login__footer {
  margin-top: auto;
  padding-top: 60px;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: center;
}

/* ── Dashboard ────────────────────────────────────────────── */

/* Nav bar */
.dash-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.dash-nav__logo {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text);
}

.dash-nav__logo span {
  color: var(--gold);
  margin-left: 2px;
}

.dash-nav__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-nav__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--gold-mid);
  object-fit: cover;
  flex-shrink: 0;
}

.dash-nav__avatar--fallback {
  background: var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--gold);
}

.dash-nav__name {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-nav__signout {
  padding: 6px 14px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.dash-nav__signout:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* ── Profile Dropdown ──────────────────────────────────────── */
.profile-dropdown {
  position: relative;
  display: flex;
}

.profile-dropdown__trigger {
  display: flex;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.profile-dropdown__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  z-index: 200;
  overflow: hidden;
}

.profile-dropdown__user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.profile-dropdown__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--gold-mid);
  object-fit: cover;
  flex-shrink: 0;
}

.profile-dropdown__avatar--fallback {
  background: var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--gold);
}

.profile-dropdown__name {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-dropdown__divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.profile-dropdown__item {
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.profile-dropdown__item:hover {
  background: var(--surface-2);
}

.profile-dropdown__item--danger {
  color: #ef4444;
}

/* Page wrapper */
.dash-page {
  align-items: center;
  padding: 88px 24px 80px;
  gap: 0;
}

/* Main content wrapper */
.db-wrap {
  width: 100%;
  max-width: 820px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Hero */
.db-hero {
  text-align: center;
  padding: 44px 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.db-hero__name {
  font-family: var(--font-display);
  font-size: clamp(44px, 9vw, 72px);
  line-height: 1;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: 0 0 60px rgba(245,197,24,0.1);
}

/* ── CTA buttons ── */
.db-cta {
  display: flex;
  gap: 14px;
  margin-bottom: 32px;
}

.db-btn {
  flex: 1;
  padding: 17px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}

.db-btn--gold {
  background: var(--gold);
  color: #07080f;
  box-shadow: 0 0 28px rgba(245,197,24,0.3), 0 4px 14px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
}

.db-btn--gold::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%);
  background-size: 300% 100%;
  background-position: -200% center;
  animation: shimmerSweep 3s ease-in-out infinite;
  pointer-events: none;
}

.db-btn--gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 44px rgba(245,197,24,0.45), 0 8px 20px rgba(0,0,0,0.5);
}

.db-btn--blue {
  background: transparent;
  color: var(--blue-bright);
  border: 1.5px solid var(--blue);
  box-shadow: 0 0 20px rgba(59,130,246,0.15), 0 4px 14px rgba(0,0,0,0.3);
}

.db-btn--blue:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 36px rgba(59,130,246,0.28), 0 8px 20px rgba(0,0,0,0.4);
}

.db-btn:active { transform: translateY(0); }

/* ── Stats strip ── */
.db-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 36px;
}

.db-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 12px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.db-stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--border-glow), transparent);
}

.db-stat__val {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1;
  color: var(--text);
}

.db-stat__label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ── Sections ── */
.db-section {
  margin-bottom: 28px;
}

.db-section__hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 2px;
}

.db-section__title {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.lb-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px;
}

.lb-tab {
  padding: 4px 14px;
  background: none;
  border: none;
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.lb-tab:hover { color: var(--text); }

.lb-tab--active {
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid var(--gold-mid);
}

.db-section__badge {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-dim);
  border: 1px solid var(--gold-mid);
  border-radius: 4px;
  padding: 3px 9px;
}

/* ── Tier Badge ─────────────────────────────────────────────── */
.tier-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tier-color);
  background: color-mix(in srgb, var(--tier-color) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--tier-color) 35%, transparent);
  border-radius: 4px;
  box-shadow: 0 0 10px var(--tier-glow);
  white-space: nowrap;
  flex-shrink: 0;
}

.tier-badge--sm {
  font-size: 9px;
  padding: 2px 7px;
}

/* ── Tier Progress Bar ─────────────────────────────────────── */
.tier-progress {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tier-progress__labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tier-progress__pct {
  color: var(--text-muted);
  font-size: 9px;
}

.tier-progress__bar {
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  overflow: hidden;
}

.tier-progress__fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Greeting + Hero ─────────────────────────────────────────── */
.db-greeting {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.db-hero__namerow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 8px;
}

.db-top-pct {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 4px;
}

.db-top-pct strong {
  color: var(--text);
  font-weight: 700;
}

/* ── Win Streak ──────────────────────────────────────────────── */
.win-streak {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 6px auto 0;
  padding: 4px 14px;
  background: rgba(245, 197, 24, 0.06);
  border: 1px solid rgba(245, 197, 24, 0.2);
  border-radius: 99px;
  animation: streakPulse 2.5s ease-in-out infinite;
}

.win-streak__fire { font-size: 14px; }

.win-streak__label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

@keyframes streakPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,197,24,0); }
  50%       { box-shadow: 0 0 14px 2px rgba(245,197,24,0.12); }
}

/* ── ELO Hero Block ─────────────────────────────────────────── */
.db-elo-block {
  margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
}

.db-elo-block::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--border-glow), transparent);
}

.db-elo-block__inner {
  display: flex;
  align-items: center;
  gap: 28px;
}

.db-elo-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex-shrink: 0;
  gap: 2px;
}

.db-elo-val {
  font-family: var(--font-display);
  font-size: clamp(40px, 7vw, 58px);
  line-height: 1;
}

.db-elo-label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 2px;
}

.db-elo-rank {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.db-elo-rank__total {
  font-size: 11px;
  opacity: 0.6;
}

.db-elo-block__right {
  flex: 1;
  min-width: 0;
}

/* ── Two-column layout ─────────────────────────────────────── */
.db-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.db-section--half {
  margin-bottom: 0;
}

/* ── Match History ──────────────────────────────────────────── */
.match-history {
  display: flex;
  flex-direction: column;
}

.match-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.match-row:last-child { border-bottom: none; }
.match-row:hover {
  background: rgba(255,255,255,0.02);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.match-row--win  { border-left: 2px solid #22c55e; }
.match-row--loss { border-left: 2px solid #ef4444; }

.match-chip {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  flex-shrink: 0;
}

.match-chip--win  { background: rgba(34,197,94,0.12);  color: #22c55e; border: 1px solid rgba(34,197,94,0.3); }
.match-chip--loss { background: rgba(239,68,68,0.10);  color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }

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

.match-elo-after {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.match-time {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.match-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.match-elo-delta {
  font-family: var(--font-display);
  font-size: 15px;
}

.match-elo-delta--pos { color: #22c55e; }
.match-elo-delta--neg { color: #ef4444; }

.match-ago {
  font-family: var(--font-ui);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ── All-grades overview ── */
.db-grades {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.db-grade-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}

.db-grade-cell:hover { border-color: var(--text-muted); transform: translateY(-1px); }

.db-grade-cell--active {
  border-color: var(--gold-mid);
  background: var(--gold-dim);
}

.db-grade-cell__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.db-grade-cell__name {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.db-grade-cell__row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.db-grade-cell__val {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1;
  color: var(--text);
}

.db-grade-cell__val--elo {
  color: var(--gold);
  text-shadow: 0 0 10px rgba(245,197,24,0.3);
}

.db-grade-cell__unit {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* Legacy hero — kept for non-dashboard pages if any */
.dash-hero {
  text-align: center;
  padding: 48px 0 36px;
  width: 100%;
  max-width: 820px;
}

.dash-hero__eyebrow {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.dash-hero__title {
  font-family: var(--font-display);
  font-size: clamp(52px, 11vw, 88px);
  line-height: 1;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 32px;
  text-shadow: 0 0 80px rgba(245, 197, 24, 0.08);
}

.dash-hero__title span { color: var(--gold); }

/* Grade selector */
.dash-grade-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.dash-grade-tab {
  padding: 8px 22px;
  background: none;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.dash-grade-tab:hover { color: var(--text); }

.dash-grade-tab--active {
  background: var(--gold-dim);
  border-color: var(--gold-mid);
  color: var(--gold);
}

/* Start Game CTA */
.dash-cta {
  padding: 8px 0 40px;
  display: flex;
  gap: 16px;
}



.dash-cta__btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 56px;
  background: var(--gold);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(245, 197, 24, 0.3),
    0 0 32px rgba(245, 197, 24, 0.25),
    0 4px 16px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s, box-shadow 0.2s;
}

.dash-cta__btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(245, 197, 24, 0.5),
    0 0 48px rgba(245, 197, 24, 0.35),
    0 8px 24px rgba(0, 0, 0, 0.5);
}

.dash-cta__btn:active { transform: translateY(0); }

.dash-cta__btn--ranked {
  background: transparent;
  border: 1px solid var(--blue);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2), 0 0 24px rgba(59, 130, 246, 0.15), 0 4px 16px rgba(0, 0, 0, 0.4);
}
.dash-cta__btn--ranked:hover {
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4), 0 0 40px rgba(59, 130, 246, 0.25), 0 8px 24px rgba(0, 0, 0, 0.5);
}
.dash-cta__btn--ranked .dash-cta__label { color: var(--blue-bright); }

.dash-cta__icon  { font-size: 20px; line-height: 1; }

.dash-cta__label {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--bg);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

/* Stats row */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 740px;
  margin-bottom: 40px;
}


.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--border-glow), transparent);
}

.stat-card__label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stat-card__value {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 38px);
  line-height: 1;
  color: var(--text);
}

.stat-card__value--accent {
  color: var(--gold);
  text-shadow: 0 0 20px rgba(245, 197, 24, 0.3);
}

/* Content sections */
.dash-section {
  width: 100%;
  max-width: 740px;
  margin-bottom: 32px;
}


.dash-section__hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 2px;
}

.dash-section__title {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Subject tabs */
.dash-tabs { display: flex; gap: 4px; }

.dash-tab {
  padding: 5px 14px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}

.dash-tab:hover { color: var(--text); border-color: var(--text-muted); }

.dash-tab--active {
  background: var(--gold-dim);
  border-color: var(--gold-mid);
  color: var(--gold);
}

/* Leaderboard */
/* Section badge (e.g. "Best Time" label) */
.dash-section__badge {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-dim);
  border: 1px solid var(--gold-mid);
  border-radius: 4px;
  padding: 3px 9px;
}

.lb-table { width: 100%; }

.lb-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--border);
}

.lb-header__rank {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.lb-header__player {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex: 1;
}

.lb-header__time {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background: rgba(255, 255, 255, 0.02); }

.lb-row--current {
  background: var(--gold-dim);
  border-left: 2px solid var(--gold);
  padding-left: 18px;
}

.lb-row--current:hover { background: rgba(245, 197, 24, 0.1); }

.lb-rank {
  font-size: 20px;
  line-height: 1;
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.lb-rank--num {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-muted);
}

.lb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.lb-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.lb-avatar--fallback {
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--text-dim);
}

.lb-name {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-you {
  padding: 2px 7px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-mid);
  border-radius: 3px;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold);
  flex-shrink: 0;
}

.lb-score {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--text);
  flex-shrink: 0;
}

.lb-row--current .lb-score { color: var(--gold); }

.lb-score--time {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
}

/* Ghost (empty slot) rows */
.lb-row--ghost {
  pointer-events: none;
  opacity: 0.28;
}

.lb-row--ghost:hover {
  background: transparent;
}

.lb-avatar--ghost {
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.lb-ghost-bar {
  display: block;
  height: 9px;
  width: 72px;
  border-radius: 5px;
  background: var(--surface-2);
}

.lb-ghost-time {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  flex-shrink: 0;
}

.lb-skeleton {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-skel-row {
  height: 44px;
  border-radius: var(--radius);
  background: var(--surface-2);
  animation: shimmer 1.6s ease-in-out infinite;
}

/* Empty state */
.dash-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 48px 24px;
}

.dash-empty__icon {
  font-size: 28px;
  opacity: 0.5;
  margin-bottom: 8px;
}

.dash-empty__text {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-dim);
}

.dash-empty__sub {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-muted);
}


/* Error banner */
.dash-error-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  max-width: 740px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: rgba(234, 67, 53, 0.08);
  border: 1px solid rgba(234, 67, 53, 0.25);
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  color: #f28b82;
  letter-spacing: 0.02em;
}

.dash-error-banner__dismiss {
  background: none;
  border: none;
  color: #f28b82;
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  opacity: 0.7;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.dash-error-banner__dismiss:hover { opacity: 1; }



/* Loading skeleton */
.skel-pill {
  background: var(--surface-2);
  border-radius: var(--radius);
  animation: shimmer 1.6s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 0.85; }
}

/* ── Trophy Button ─────────────────────────────────────────── */
.lb-trophy-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--gold-mid);
  color: var(--gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  box-shadow: 0 0 20px rgba(245, 197, 24, 0.15);
}

.lb-trophy-btn:hover {
  transform: translateY(-2px) scale(1.05);
  background: var(--gold-dim);
  box-shadow: 0 0 32px rgba(245, 197, 24, 0.3);
}

.lb-trophy-btn:active {
  transform: translateY(0) scale(0.95);
}

.lb-trophy-btn svg {
  width: 24px;
  height: 24px;
}

/* ── Leaderboard Modal ─────────────────────────────────────── */
.lb-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: lbFadeIn 0.2s ease-out;
}

.lb-modal {
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: lbSlideUp 0.25s ease-out;
}

.lb-modal__hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--border);
}

.lb-modal__title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lb-modal__icon {
  color: var(--gold);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
}

.lb-modal__icon svg {
  width: 24px;
  height: 24px;
}

.lb-modal__title {
  font-family: var(--font-display);
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
}

.lb-modal__close {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: color 0.15s, border-color 0.15s;
}

.lb-modal__close:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.lb-modal__grade-tabs {
  display: flex;
  gap: 6px;
  padding: 16px 24px 12px;
}

.lb-modal__grade-tab {
  padding: 6px 18px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}

.lb-modal__grade-tab:hover { color: var(--text); border-color: var(--text-muted); }

.lb-modal__grade-tab--active {
  background: var(--gold-dim);
  border-color: var(--gold-mid);
  color: var(--gold);
}

.lb-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 8px;
}

@keyframes lbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes lbSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Settings Page ─────────────────────────────────────────── */
.settings-page {
  align-items: center;
  padding: 80px 24px 80px;
  gap: 0;
}

.settings-section {
  width: 100%;
  max-width: 520px;
  margin-top: 48px;
}

.settings-title {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.03em;
  color: var(--text);
  margin-bottom: 24px;
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}

.settings-row__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-row__label {
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text);
}

.settings-row__desc {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-dim);
}

.settings-row__action {
  padding: 6px 16px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-mid);
  border-radius: var(--radius-sm);
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  flex-shrink: 0;
}

.settings-row__action:hover {
  background: var(--gold-mid);
  color: #1a1a2e;
}

.settings-row__action:active {
  transform: scale(0.96);
}

.settings-avatar {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid var(--border);
  transition: border-color 0.2s, opacity 0.2s;
}

.settings-avatar:hover {
  border-color: var(--gold-mid);
  opacity: 0.85;
}

.settings-avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.settings-avatar__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--text-muted);
}

.settings-avatar__spinner {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
}

.settings-avatar__spinner::after {
  content: '';
  position: absolute;
  inset: 12px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: settings-spin 0.7s linear infinite;
}

@keyframes settings-spin {
  to { transform: rotate(360deg); }
}

.settings-toggle {
  position: relative;
  width: 48px;
  height: 26px;
  border-radius: 13px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.settings-toggle--on {
  background: var(--gold);
  border-color: var(--gold-mid);
}

.settings-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.2s;
}

.settings-toggle--on .settings-toggle__thumb {
  transform: translateX(22px);
  background: #1a1a2e;
}

.settings-back {
  padding: 6px 14px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.settings-back:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.settings-back-link {
  margin-top: 32px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.2s;
}

.settings-back-link:hover {
  color: var(--text);
}

/* ── Username modal ───────────────────────────────────────── */
.uname-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: lbFadeIn 0.18s ease-out;
}

.uname-modal {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: lbSlideUp 0.2s ease-out;
}

.uname-modal__title {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text);
}

.uname-modal__hint {
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-top: -4px;
}

.uname-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  outline: none;
  transition: border-color 0.15s;
}

.uname-input:focus { border-color: var(--gold-mid); }

.uname-input::placeholder { color: var(--text-muted); }

.uname-error {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #f28b82;
  background: rgba(234, 67, 53, 0.08);
  border: 1px solid rgba(234, 67, 53, 0.2);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.uname-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.uname-btn {
  padding: 9px 22px;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.12s;
  border: none;
}

.uname-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.uname-btn--cancel {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.uname-btn--cancel:hover:not(:disabled) { color: var(--text); }

.uname-btn--save {
  background: var(--gold);
  color: #07080f;
}

.uname-btn--save:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }

/* ── Utility ──────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ── Forfeit / Quit Button ────────────────────────────────── */
.btn-forfeit {
  padding: 8px 20px;
  border-radius: 999px;
  font-family: system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid #e57373;
  background: #fff;
  color: #c62828;
  transition: background 0.15s, color 0.15s;
}
.btn-forfeit:hover {
  background: #c62828;
  color: #fff;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 700px) {
  .db-two-col { grid-template-columns: 1fr; }
  .db-elo-block__inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .db-elo-block__right { width: 100%; }
}

@media (max-width: 600px) {
  .dash-nav { padding: 0 16px; }
  .dash-page { padding-left: 16px; padding-right: 16px; }
  .profile-dropdown__trigger .dash-nav__name { display: none; }
  .db-stats { grid-template-columns: repeat(2, 1fr); }
  .db-stat__val { font-size: clamp(22px, 6vw, 30px); }
  .db-btn { font-size: 15px; padding: 15px 16px; }
  .lb-row { padding: 10px 14px; gap: 10px; }
  .lb-row--current { padding-left: 12px; }
  .db-hero__namerow { flex-direction: column; gap: 8px; }
}

@media (max-width: 480px) {
  .grade-badges { gap: 8px; }
  .grade-badge { padding: 12px 16px; }
  .dash-grade-tab { padding: 8px 14px; font-size: 12px; }
  .db-hero__name { font-size: clamp(38px, 13vw, 72px); }
  .db-grades { grid-template-columns: 1fr; }
}

/* Quiz nav button press feel */
.quiz-nav-btn {
  transition: transform 0.1s ease !important;
}
.quiz-nav-btn:active {
  transform: scale(0.96) !important;
}

@keyframes shimmerSweep {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes rowFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes gradeTabBounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.92); }
  70%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}