@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,400;0,500;1,400&family=Outfit:wght@400;500;600;700;800;900&display=swap');

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

:root {
  --bg:        #080a0f;
  --bg2:       #0e1118;
  --bg3:       #141820;
  --border:    #1e2530;
  --border2:   #2a3545;
  --text:      #e8edf5;
  --muted:     #6b7a90;
  --accent:    #00e5ff;
  --accent2:   #7b4fff;
  --accent3:   #ff3d7f;
  --success:   #00e096;
  --warn:      #ffb800;
  --danger:    #ff4545;
  --glow:      0 0 30px rgba(0,229,255,0.15);
  --glow2:     0 0 30px rgba(123,79,255,0.2);
  --radius:    10px;
  --radius2:   16px;
  --font-head: 'Outfit', sans-serif;
  --font-mono: 'DM Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── NOISE TEXTURE OVERLAY ────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  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.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

/* ── TYPOGRAPHY ───────────────────────────────────────── */
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.6rem, 7vw, 5.5rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.8rem); }
h3 { font-size: 1.3rem; }
p { color: var(--muted); line-height: 1.8; }
a { color: var(--accent); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.75; }

/* ── LAYOUT ───────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 720px; margin: 0 auto; padding: 0 24px; }

/* ── NAV ──────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(8,10,15,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 0 24px; height: 68px; max-width: 1100px; margin: 0 auto;
}
.nav__links { justify-self: center; }
.nav__cta { justify-self: end; }
.nav__logo {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 8px;
  position: relative;
}
.nav__logo span { color: var(--accent); }
.nav__logo-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
.nav__logo-beta {
  position: absolute;
  bottom: -9px;
  right: 0;
  font-size: 0.4rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  background: rgba(0,229,255,0.12);
  color: var(--accent);
  border: 1px solid rgba(0,229,255,0.25);
  border-radius: 3px;
  padding: 1px 4px;
  line-height: 1.4;
  white-space: nowrap;
}
@media (max-width: 1024px) {
  .nav__logo-beta { display: none; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}
.nav__links { display: flex; align-items: center; gap: 24px; }
.nav__links a { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.05em; text-transform: uppercase; }
.nav__links a:hover { color: var(--text); opacity: 1; }
.nav__links a.nav__link--active { color: var(--text); }
.nav__cta { display: flex; align-items: center; gap: 10px; }
.nav-dash-mobile { display: none !important; }

/* ── Avatar dropdown ──────────────────────────────────── */
.nav__avatar-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--border2);
  background: var(--bg3);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 0.85rem;
  color: var(--accent);
  overflow: hidden;
  transition: border-color 0.2s;
  flex-shrink: 0;
  padding: 0;
}
.nav__avatar-btn:hover { border-color: var(--accent); }
.nav__avatar-btn img { width:100%;height:100%;object-fit:cover;border-radius:50%; }
.nav--signed-in .nav__avatar-btn { display: flex; }
/* On mobile signed-in: hide the burger, avatar is the only menu trigger */
@media (max-width: 768px) {
  .nav--signed-in #nav-burger { display: none !important; }
}

.nav__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 6px;
  min-width: 180px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.18s, transform 0.18s;
}
.nav__dropdown--open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}
.nav__dropdown-wrap {
  position: relative;
}
.nav__dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-mono);
  transition: background 0.15s, color 0.15s;
}
.nav__dropdown-item:hover { background: var(--bg3); color: var(--text); opacity: 1; }
.nav__dropdown-item--danger:hover { background: rgba(255,69,69,0.08); color: var(--danger); }
.nav__dropdown-divider { height: 1px; background: var(--border); margin: 4px 6px; }
.nav__dropdown-section {
  padding: 8px 12px 2px;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: var(--border2);
  text-transform: uppercase;
}
.nav__dropdown-email {
  padding: 8px 12px 4px;
  font-size: 0.68rem;
  color: var(--muted);
  font-family: var(--font-mono);
  opacity: 0.7;
}

/* ── Burger menu ─────────────────────────────────────── */
.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: none;
  transition: border-color 0.2s;
  flex-shrink: 0;
}
.nav__burger:hover { border-color: var(--border2); }
.nav__burger-line {
  width: 20px; height: 1.5px;
  background: var(--muted);
  border-radius: 2px;
  transition: all 0.25s;
  transform-origin: center;
}
.nav__burger--open .nav__burger-line:nth-child(1) { transform: rotate(45deg) translate(4.5px, 4.5px); }
.nav__burger--open .nav__burger-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav__burger--open .nav__burger-line:nth-child(3) { transform: rotate(-45deg) translate(4.5px, -4.5px); }

/* Mobile drawer */
.nav__drawer {
  position: fixed;
  top: 68px; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
  z-index: 998;
  padding: 16px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
}
.nav__drawer--open { transform: translateX(0); }
.nav__drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  border-radius: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  color: var(--muted);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav__drawer-item:hover,
.nav__drawer-item:active { background: var(--bg2); color: var(--text); opacity: 1; }
.nav__drawer-item--accent { color: var(--accent); }
.nav__drawer-item--danger { color: var(--danger); }
.nav__drawer-divider { height: 1px; background: var(--border); margin: 8px 0; }
.nav__drawer-section {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--border2);
  text-transform: uppercase;
  padding: 8px 12px 4px;
}

/* ── BUTTONS ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}
.btn--primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 20px rgba(0,229,255,0.3);
}
.btn--primary:hover { box-shadow: 0 0 30px rgba(0,229,255,0.5); transform: translateY(-1px); opacity: 1; color: var(--bg); }
.btn--secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border2);
}
.btn--secondary:hover { border-color: var(--accent); color: var(--accent); opacity: 1; }
.btn--ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn--ghost:hover { color: var(--text); opacity: 1; }
.btn--danger { background: var(--danger); color: #fff; }
.btn--large { padding: 14px 32px; font-size: 0.9rem; }
.btn--full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* ── CARDS ────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 28px;
}
.card--glow { box-shadow: var(--glow); border-color: rgba(0,229,255,0.2); }
.card--accent { border-color: var(--accent2); box-shadow: var(--glow2); }

/* ── FORM ELEMENTS ────────────────────────────────────── */
.input, .select, .textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); }
.input::placeholder { color: var(--muted); }
.label { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
.form-group { margin-bottom: 20px; }
.form-error { font-size: 0.78rem; color: var(--danger); margin-top: 6px; }

/* ── BADGE ────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.badge--accent { background: rgba(0,229,255,0.1); color: var(--accent); border: 1px solid rgba(0,229,255,0.25); }
.badge--purple { background: rgba(123,79,255,0.15); color: #a880ff; border: 1px solid rgba(123,79,255,0.3); }
.badge--success { background: rgba(0,224,150,0.1); color: var(--success); border: 1px solid rgba(0,224,150,0.25); }
.badge--warn { background: rgba(255,184,0,0.1); color: var(--warn); border: 1px solid rgba(255,184,0,0.25); }

/* ── DIVIDER ──────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

/* ── ALERT ────────────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  display: flex; gap: 10px; align-items: flex-start;
}
.alert--success { background: rgba(0,224,150,0.08); border: 1px solid rgba(0,224,150,0.2); color: var(--success); }
.alert--error { background: rgba(255,69,69,0.08); border: 1px solid rgba(255,69,69,0.2); color: var(--danger); }
.alert--info { background: rgba(0,229,255,0.08); border: 1px solid rgba(0,229,255,0.2); color: var(--accent); }

/* ── PAGE PADDING ─────────────────────────────────────── */
.page { padding-top: 80px; min-height: 100vh; }

/* ── SECTION SPACING ──────────────────────────────────── */
.section { padding: 80px 0; }
.section--sm { padding: 48px 0; }

/* ── TAG LINE ─────────────────────────────────────────── */
.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 16px;
}

/* ── GRID ─────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

/* ── SCROLLBAR ────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── SPINNER ──────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(0,229,255,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── WAVEFORM BAR ─────────────────────────────────────── */
.waveform-bars {
  display: flex; align-items: center; gap: 3px; height: 40px;
}
.waveform-bars .bar {
  flex: 1; background: var(--accent);
  border-radius: 2px;
  opacity: 0.6;
  animation: wave 1.2s ease-in-out infinite;
}
.waveform-bars .bar:nth-child(2n) { animation-delay: 0.1s; }
.waveform-bars .bar:nth-child(3n) { animation-delay: 0.2s; }
.waveform-bars .bar:nth-child(4n) { animation-delay: 0.15s; }
@keyframes wave {
  0%, 100% { height: 20%; }
  50% { height: 100%; }
}

/* ── RESPONSIVE ───────────────────────────────────────── */
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .nav__links { display: none; }
  .nav__burger { display: flex; }
  h1 { font-size: 2rem; }
}

/* ── UTILITY ──────────────────────────────────────────── */
.text-accent { color: var(--accent); }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.hidden { display: none !important; }

/* ── SIGNED-IN NAV STATE ──────────────────────────────────── */
.nav--signed-in {
  border-bottom-color: rgba(0,229,255,0.15);
  background: rgba(8,10,15,0.92);
}
.nav--signed-in::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(0,229,255,0.3), transparent);
}
.nav__logo-dot--active {
  background: var(--success) !important;
  box-shadow: 0 0 12px var(--success) !important;
  animation: pulse-green 2s ease-in-out infinite !important;
}
@keyframes pulse-green {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.8); }
}

/* ── NAV USER EMAIL ───────────────────────────────────────── */
.nav-user-email {
  display: none; /* hidden until JS sets it up */
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: var(--accent);
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.nav-user-dot {
  width: 7px; height: 7px;
  background: var(--success);
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--success);
  display: inline-block;
}
.nav-user-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Desktop: show inline in nav__cta area */
@media (min-width: 601px) {
  .nav-user-email {
    display: flex !important;
  }
  /* Move it into the cta row */
  .nav__inner { flex-wrap: nowrap; }
}
/* Mobile: compact CTA */
@media (max-width: 768px) {
  .nav-user-email { display: none !important; }
  .nav__links { display: none; }
  .nav__burger { display: flex; }
  .btn-full-text { display: none; }
  .btn-short-text { display: inline; }
  .nav__cta { gap: 8px; }
  .nav__cta .btn { padding: 8px 14px; font-size: 0.72rem; }
  /* Hide login on mobile — it's in the burger drawer */
  #nav-login { display: none !important; }
  /* Avatar dropdown opens drawer on mobile instead */
  #nav-dropdown { display: none !important; }
}
@media (min-width: 601px) {
  .btn-full-text { display: inline; }
  .btn-short-text { display: none; }
}

/* ── PRICING MOBILE FIXES ─────────────────────────────────── */
@media (max-width: 600px) {
  /* Spacing between cards */
  .price-grid { gap: 16px; padding-bottom: 8px; }
  /* Reduce bottom padding on pricing page */
  .page > .container { padding-bottom: 48px !important; }
  /* Fix "First feedback always free" wrapping */
  .price-grid + p { white-space: normal; padding: 0 16px; }
  /* Copyright year */
  footer p { font-size: 0.72rem; }
}

/* ── GENERAL MOBILE POLISH ────────────────────────────────── */
/* NOTE: .container / .container--narrow side padding lives in layout.css */
@media (max-width: 600px) {
  /* Reduce excessive bottom padding on narrow pages */
  .container--narrow { padding-bottom: 60px !important; }
  .section { padding: 48px 0; }
  /* Feature cards on homepage */
  .features-grid { grid-template-columns: 1fr; gap: 14px; }
  /* Nav height */
  .nav__inner { height: 60px; }
}

/* ── FEEDBACK CARDS (shared between analyze + dashboard) ───── */
.fb-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  padding: 20px;
  margin-bottom: 14px;
}
.fb-card__title {
  font-family: var(--font-head);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.fb-text p { font-size: 0.88rem; margin-bottom: 10px; color: var(--muted); line-height: 1.75; }
.fb-text p:last-child { margin-bottom: 0; }
.score-grid { display: flex; flex-direction: column; gap: 2px; }
.score-row-v2 { padding: 10px 0; border-bottom: 1px solid var(--border); }
.score-row-v2:last-child { border-bottom: none; }
.score-row-v2__top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.score-dot { font-size: 0.85rem; flex-shrink: 0; }
.score-label-v2 { font-size: 0.85rem; flex: 1; }
.score-num-v2 { font-family: var(--font-head); font-weight: 800; font-size: 1rem; flex-shrink: 0; }
.score-bar-wrap-v2 { height: 3px; background: var(--bg3); border-radius: 2px; overflow: hidden; margin-bottom: 6px; }
.score-bar-v2 { height: 100%; border-radius: 2px; }
.score-reason-v2 { font-size: 0.78rem; color: var(--muted); line-height: 1.5; }
.fb-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.fb-list__item { display: flex; gap: 10px; align-items: flex-start; font-size: 0.85rem; line-height: 1.6; }
.fb-list__icon { flex-shrink: 0; font-size: 0.9rem; margin-top: 1px; min-width: 16px; }
.fb-list__item--label { font-size: 0.85rem; color: var(--text); }
.ai-detect-row { display: flex; gap: 14px; align-items: flex-start; }
.ai-detect-icon { font-size: 1.4rem; flex-shrink: 0; }
.ai-detect-likelihood { font-family: var(--font-head); font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.ai-detect-detail { font-size: 0.82rem; color: var(--muted); line-height: 1.6; }

/* ── PDF PRINT STYLES ──────────────────────────────────────── */
@media print {
  /* Hide everything except the modal content */
  body > *:not(.modal-overlay) { display: none !important; }
  .modal-overlay {
    display: block !important;
    position: static !important;
    background: none !important;
    padding: 0 !important;
    overflow: visible !important;
  }
  .modal {
    position: static !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    max-width: 100% !important;
    background: #fff !important;
  }
  body { background: #fff !important; color: #111 !important; }
  .modal__close, #pdf-export-btn { display: none !important; }
  .fb-card {
    background: #f9f9f9 !important;
    border: 1px solid #ddd !important;
    break-inside: avoid;
    margin-bottom: 12px !important;
  }
  .fb-card__title { color: #0099bb !important; border-bottom-color: #ddd !important; }
  .fb-text p, .score-reason-v2, .fb-list__item, .ai-detect-detail { color: #333 !important; }
  .score-bar-wrap-v2 { background: #eee !important; }
  .score-row-v2 { border-bottom-color: #eee !important; }
  .score-dot, .fb-list__icon { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .pdf-header { display: block !important; }
  #pdf-print-header { display: block !important; padding-bottom: 16px; margin-bottom: 20px; border-bottom: 2px solid #00bbcc; }
  .modal__title-area { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 2px solid #00e5ff; }
}
.pdf-header { 
  display: none !important;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #00e5ff;
}


/* ══════════════════════════════════════════════════════════
   GAMIFICATION — v2 — Soft, alive, game-inspired
   ══════════════════════════════════════════════════════════ */

/* ── Gamification Card ───────────────────────────────────── */
.gm-card {
  position: relative;
  border-radius: 18px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
  overflow: hidden;
}
.gm-card__header {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--bg2);
  padding: 22px 22px 0;
}

/* ── Level orb ───────────────────────────────────────────── */
.gm-level-orb {
  position: relative;
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gm-level-orb__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid var(--lv-color, #00e5ff);
  box-shadow: 0 0 20px color-mix(in srgb, var(--lv-color, #00e5ff) 70%, transparent), inset 0 0 20px color-mix(in srgb, var(--lv-color, #00e5ff) 15%, transparent);
  animation: gm-orb-pulse 2.5s ease-in-out infinite;
}
.gm-level-orb__ring--2 {
  inset: 8px;
  border-color: color-mix(in srgb, var(--lv-color, #00e5ff) 40%, transparent);
  animation-delay: -1.25s;
  box-shadow: none;
}
@keyframes gm-orb-pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:0.7; transform:scale(1.04); }
}
.gm-level-orb__num {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 2rem;
  color: var(--lv-color, #00e5ff);
  line-height: 1;
  letter-spacing: -0.04em;
  text-shadow: 0 0 20px color-mix(in srgb, var(--lv-color, #00e5ff) 80%, transparent);
  position: relative;
  z-index: 1;
}

/* ── Level meta ──────────────────────────────────────────── */
.gm-level-meta { flex: 1; min-width: 0; }
.gm-prestige-stars {
  display: flex; gap: 3px; margin-bottom: 4px;
  font-size: 0.9rem;
}
.gm-level-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1.2;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.gm-xp-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(0,229,255,0.08);
  border: 1px solid rgba(0,229,255,0.2);
  border-radius: 20px;
  padding: 4px 12px;
}
.gm-xp-pill__icon { font-size: 0.8rem; }
.gm-xp-pill__val {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--accent);
}
.gm-xp-pill__label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* ── Progress bar ────────────────────────────────────────── */
.gm-bar-section {
  background: var(--bg2);
  padding: 16px 22px 20px;
}
.gm-bar-track {
  height: 12px;
  background: var(--bg3);
  border-radius: 20px;
  overflow: visible;
  margin-bottom: 8px;
  position: relative;
}
.gm-bar-fill {
  height: 100%;
  border-radius: 20px;
  transition: width 1.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}
.gm-bar-shimmer {
  position: absolute;
  top: 0; left: -80%; width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: gm-shimmer 2s ease-in-out infinite;
}
@keyframes gm-shimmer {
  0%   { left: -60%; }
  100% { left: 120%; }
}
/* Spark at bar tip */
.gm-bar-spark {
  position: absolute;
  right: -4px; top: 50%;
  transform: translateY(-50%);
  width: 10px; height: 10px;
  border-radius: 50%;
  background: white;
  opacity: 0;
  box-shadow: 0 0 8px 4px currentColor, 0 0 2px 1px white;
  transition: opacity 0.5s 1.2s;
  animation: gm-spark-flicker 1.5s ease-in-out 1.3s infinite;
}
@keyframes gm-spark-flicker {
  0%,100% { opacity:1; transform:translateY(-50%) scale(1); }
  50%      { opacity:0.5; transform:translateY(-50%) scale(0.7); }
}
.gm-bar-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--muted);
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}
.gm-bar-meta > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.gm-bar-meta > span:nth-child(2) {
  flex: 1;
  text-align: center;
  font-size: 0.6rem;
}
@media (max-width: 400px) {
  .gm-bar-meta { flex-direction: column; align-items: flex-start; gap: 3px; }
  .gm-bar-meta > span:nth-child(2) { text-align: left; }
}

/* ── Badges section ──────────────────────────────────────── */
.gm-badges-section {
  background: var(--bg2);
  border-radius: 0 0 16px 16px;
  border-top: 1px solid var(--border);
  overflow: hidden;
}
.gm-badges-toggle {
  width: 100%;
  background: none;
  border: none;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
  text-align: left;
  transition: background 0.15s;
}
.gm-badges-toggle:hover { background: rgba(255,255,255,0.02); }
.gm-badges-toggle__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.82rem;
  flex: 1;
  color: var(--text);
}
.gm-badges-toggle__count {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.75rem;
}
.gm-badges-toggle__arrow {
  color: var(--muted);
  font-size: 1.1rem;
  transition: transform 0.3s;
}
.gm-badges-open .gm-badges-toggle__arrow { transform: rotate(90deg); }

/* Badge preview row */
.gm-badges-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 22px 16px;
  flex-wrap: wrap;
}

/* Drawer */
.gm-badges-drawer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1);
}
.gm-badges-open .gm-badges-drawer { max-height: 2000px; }

/* ── Badge wall ──────────────────────────────────────────── */
.gm-badge-wall { padding: 0 22px 20px; }
.gm-badge-cat { margin-bottom: 20px; }
.gm-badge-cat__label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.gm-badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 12px;
}

/* ── Individual badge ────────────────────────────────────── */
.gm-badge {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}
.gm-badge__circle {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.gm-badge--earned .gm-badge__circle {
  animation: gm-badge-breathe 3s ease-in-out infinite;
}
@keyframes gm-badge-breathe {
  0%,100% { filter: brightness(1); }
  50%      { filter: brightness(1.3); }
}
.gm-badge:hover .gm-badge__circle { transform: scale(1.12); }
.gm-badge--locked .gm-badge__circle { filter: grayscale(1); opacity: 0.3; }

/* Tooltip */
.gm-badge__tooltip {
  position: fixed;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 8px 12px;
  width: 160px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 99999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  /* Position calculated by JS */
  top: 0; left: 0;
}
.gm-badge:hover .gm-badge__tooltip {
  opacity: 1;
}
.gm-badge__tooltip-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--text);
  margin-bottom: 3px;
}
.gm-badge__tooltip-desc {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.5;
}
.gm-badge__tooltip-locked {
  font-size: 0.65rem;
  color: var(--border2);
  margin-top: 4px;
  font-family: var(--font-mono);
}


/* Mobile: tap lightbox instead of hover */
@media (max-width: 768px) {
  .gm-badge__tooltip { display: none; }
  .gm-badge.tapped .gm-badge__tooltip {
    display: block;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    position: fixed;
    bottom: 24px;
    left: 50% !important;
    top: auto;
    width: 240px;
    z-index: 9999;
  }
}

/* ── Toast notifications ─────────────────────────────────── */
.gm-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
  max-width: 280px;
}
.gm-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  opacity: 0;
  transform: translateX(16px) scale(0.96);
  transition: opacity 0.3s, transform 0.3s;
  backdrop-filter: blur(16px);
}
.gm-toast--in { opacity:1; transform: translateX(0) scale(1); }
.gm-toast--xp {
  background: rgba(8,10,15,0.92);
  border: 1px solid rgba(0,229,255,0.35);
  box-shadow: 0 4px 20px rgba(0,229,255,0.15);
}
.gm-toast--badge {
  background: rgba(8,10,15,0.92);
  border: 1px solid color-mix(in srgb, var(--badge-color,#ffd700) 50%, transparent);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--badge-color,#ffd700) 20%, transparent);
}
.gm-toast__icon { font-size: 1.2rem; flex-shrink: 0; color: var(--accent); }
.gm-toast__badge-icon { flex-shrink: 0; }
.gm-toast__main { font-family: var(--font-head); font-weight: 800; font-size: 0.85rem; color: var(--text); }
.gm-toast__sub { font-size: 0.7rem; color: var(--muted); font-family: var(--font-mono); margin-top: 1px; }

/* ── Level up overlay ────────────────────────────────────── */
.gm-levelup {
  position: fixed; inset: 0;
  background: rgba(8,10,15,0.95);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s;
}
.gm-levelup--in { opacity: 1; }
.gm-levelup__card {
  background: var(--bg2);
  border: 1px solid color-mix(in srgb, var(--lv-color, #00e5ff) 40%, transparent);
  border-radius: 24px;
  padding: 52px 44px;
  text-align: center;
  max-width: 380px;
  width: 90%;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 80px color-mix(in srgb, var(--lv-color, #00e5ff) 20%, transparent), 0 0 2px color-mix(in srgb, var(--lv-color, #00e5ff) 60%, transparent);
}
.gm-levelup__sparks { position:absolute; inset:0; pointer-events:none; overflow:hidden; }
.gm-levelup__flash {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--lv-color, #00e5ff) 8%, transparent), transparent 60%);
}
.gm-levelup__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: var(--accent);
  margin-bottom: 16px;
  animation: gm-flicker 0.8s ease-in-out infinite alternate;
}
@keyframes gm-flicker { from { opacity:1; } to { opacity:0.5; } }
.gm-levelup__num {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 6rem;
  line-height: 1;
  letter-spacing: -0.05em;
  margin-bottom: 8px;
  position: relative;
}
.gm-levelup__title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.5rem;
  margin-bottom: 10px;
}
.gm-levelup__sub {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 32px;
}
.gm-levelup__btn {
  background: var(--accent);
  color: #080a0f;
  border: none;
  border-radius: 10px;
  padding: 12px 28px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  transition: opacity 0.2s;
}
.gm-levelup__btn:hover { opacity: 0.85; }
.gm-spark {
  position: absolute;
  border-radius: 50%;
  animation: gm-spark-fly 1.4s ease-out forwards;
}
@keyframes gm-spark-fly {
  0%   { transform: scale(0) translateY(0) rotate(0deg); opacity:1; }
  100% { transform: scale(1) translateY(-80px) rotate(180deg); opacity:0; }
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 600px) {
  .gm-card__header { padding: 18px 16px 0; gap: 14px; }
  .gm-level-orb { width: 60px; height: 60px; }
  .gm-level-orb__num { font-size: 1.6rem; }
  .gm-level-title { font-size: 0.95rem; }
  .gm-bar-section { padding: 14px 16px 16px; }
  .gm-badge-wall { padding: 0 14px 16px; }
  .gm-badges-toggle { padding: 12px 16px; }
  .gm-badges-preview { padding: 0 16px 14px; }
  .gm-badge-grid { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 10px; }
  .gm-toast-container { bottom:16px; right:12px; left:12px; max-width:100%; }
  .gm-levelup__card { padding: 40px 28px; }
  .gm-levelup__num { font-size: 4.5rem; }
}

/* ── Badge Lightbox ──────────────────────────────────────────── */
.gm-badge-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(8,10,15,0.85); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.3s;
}
.gm-badge-lightbox--in { opacity: 1; }
.gm-badge-lightbox__card {
  position: relative; overflow: hidden;
  background: #0e1118; border: 1px solid #2a3545;
  border-radius: 20px; padding: 40px 36px 32px;
  text-align: center; max-width: 340px; width: 90%;
  transform: scale(0.85); transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
.gm-badge-lightbox--in .gm-badge-lightbox__card { transform: scale(1); }
.gm-badge-lightbox__glow {
  position: absolute; inset: 0; pointer-events: none;
}
.gm-badge-lightbox__eyebrow {
  font-family: var(--font-mono); font-size: 0.6rem;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 20px;
}
.gm-badge-lightbox__icon {
  margin: 0 auto 16px;
  animation: badgePop 0.5s cubic-bezier(0.34,1.56,0.64,1) 0.15s both;
}
@keyframes badgePop {
  from { transform: scale(0.4) rotate(-15deg); opacity: 0; }
  to   { transform: scale(1) rotate(0deg);     opacity: 1; }
}
.gm-badge-lightbox__name {
  font-family: var(--font-head); font-weight: 900;
  font-size: 1.4rem; margin-bottom: 8px;
}
.gm-badge-lightbox__desc {
  font-size: 0.82rem; color: var(--muted); line-height: 1.5; margin-bottom: 4px;
}
.gm-badge-lightbox__btn {
  display: inline-flex; align-items: center; padding: 10px 18px;
  border-radius: 8px; font-family: var(--font-head); font-weight: 700;
  font-size: 0.8rem; text-decoration: none; cursor: pointer; border: none;
  transition: opacity 0.2s;
}
.gm-badge-lightbox__btn:hover { opacity: 0.85; }
.gm-badge-lightbox__btn--primary { background: var(--accent); color: #080a0f; }
.gm-badge-lightbox__btn--secondary { background: var(--bg3); color: var(--muted); border: 1px solid var(--border2); }

/* Badge wall — shimmer on newly earned (unseen) */
.gm-badge--new-shine {
  animation: badgeShine 1.2s ease-in-out 0.3s 2;
}
@keyframes badgeShine {
  0%   { box-shadow: 0 0 0px transparent; }
  50%  { box-shadow: 0 0 16px 4px var(--badge-glow, #00e5ff88); }
  100% { box-shadow: 0 0 0px transparent; }
}

/* ── SITE FOOTER (shared across all pages) ─────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 40px;
}
.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.site-footer__links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.site-footer__links a {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
}
.site-footer__links a:hover { color: var(--text); }
.site-footer__copy {
  font-size: 0.75rem;
  color: var(--border2);
  margin: 0;
}
@media (max-width: 600px) {
  .site-footer__inner { flex-direction: column; align-items: flex-start; gap: 12px; }
}
