/* ─── Design tokens ─────────────────────────────────────────────────────────── */
:root {
  --bg:         #080C14;
  --surface:    #0d1525;
  --surface2:   #131f35;
  --border:     rgba(56,189,248,0.08);
  --text:       #f0f0f0;
  --text2:      #a0a0a0;
  --text3:      #555555;
  --accent:     #38bdf8;
  --accent-dim: rgba(56,189,248,0.12);
  --green:      #22c55e;
  --red:        #ef4448;
  --radius-lg:  14px;
  --radius-md:  10px;
  --radius-sm:  8px;
}

/* ─── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

.card-detail-hero.has-photo {
  font-size: 0;
}

.card-detail-photo-frame {
  position: relative;
  z-index: 1;
  width: min(95%, 520px);
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.32);
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.28);
  background: rgba(15, 23, 42, 0.28);
}

.card-detail-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
main  { flex: 1; position: relative; z-index: 2; }
a     { text-decoration: none; }

/* ─── Radar background ──────────────────────────────────────────────────────── */
.radar-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(215, 196, 157, 0.03) 1px, transparent 1px);
  background-size: 220px 220px;
  opacity: 0.26;
  pointer-events: none;
  z-index: 0;
}
.radar-bg::before,
.radar-bg::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(215, 196, 157, 0.04);
  border-radius: 50%;
  left: 50%;
  top: 30%;
  transform: translate(-50%, -50%);
}
.radar-bg::before { width: 360px; height: 360px; }
.radar-bg::after  { width: 520px; height: 520px; }

/* ─── Header ─────────────────────────────────────────────────────────────────── */
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  margin: 18px auto;
  width: 95%;
  max-width: 1200px;
  background: rgba(20, 20, 20, 0.92);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  position: relative;
  z-index: 10;
}
.logo {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  color: var(--accent);
  font-size: 15px;
  letter-spacing: 0.04em;
}
.logo span { color: var(--text3); }

/* ─── Nav buttons ────────────────────────────────────────────────────────────── */
.nav-buttons { display: flex; gap: 8px; }
.nav-buttons button {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 15px;
  color: var(--text2);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.nav-buttons button:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(215, 196, 157, 0.28);
}
.nav-buttons button.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(232, 213, 176, 0.3);
}

.header-auth-indicator {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(22, 163, 74, 0.35);
  background: rgba(22, 163, 74, 0.14);
  color: #9ff7be;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
}

.header-auth-indicator:hover {
  border-color: rgba(34, 197, 94, 0.45);
}

.auth-panel {
  min-width: 250px;
  padding: 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface2);
}

.auth-state {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-state[hidden] {
  display: none;
}

.auth-panel input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  padding: 7px 9px;
  outline: none;
}

.auth-panel input:focus {
  border-color: rgba(232, 213, 176, 0.35);
}

.auth-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.auth-buttons button,
#auth-logout-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text2);
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  padding: 6px 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.auth-buttons button:hover,
#auth-logout-btn:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

#auth-logout-btn {
  background: rgba(220, 38, 38, 0.18);
  border-color: rgba(248, 113, 113, 0.55);
  color: #fecaca;
}

#auth-logout-btn:hover {
  background: rgba(220, 38, 38, 0.32);
  color: #ffe4e6;
}

.auth-user-email {
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.auth-message {
  min-height: 16px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text3);
}

.auth-message.ok {
  color: var(--green);
}

.auth-message.error {
  color: var(--red);
}

.auth-page-main {
  max-width: 460px;
  margin: 28px auto 0;
  padding: 0 20px 40px;
}

.profile-page .auth-page-main {
  max-width: 1200px;
  margin: 18px auto 0;
  padding: 0 22px 44px;
}

.profile-page .auth-card {
  padding: 26px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}

.auth-title {
  font-family: 'Space Mono', monospace;
  color: var(--accent);
  font-size: 22px;
  margin-bottom: 8px;
}

.auth-subtitle {
  color: var(--text2);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 18px;
}

.auth-page .auth-panel {
  min-width: 0;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
}

.auth-page .auth-state {
  gap: 10px;
}

.auth-page .auth-panel input {
  font-size: 14px;
  padding: 10px 12px;
}

.auth-page .auth-buttons {
  grid-template-columns: 1fr;
}

.auth-page .auth-buttons button,
.auth-page #auth-logout-btn,
.auth-page #auth-home-btn {
  width: 100%;
  font-size: 14px;
  padding: 10px 12px;
}

.auth-page .auth-primary {
  background: var(--accent);
  color: #000;
  border-color: rgba(232, 213, 176, 0.35);
  font-weight: 700;
}

.auth-page .auth-primary:hover {
  opacity: 0.9;
  color: #000;
}

.auth-page .auth-google {
  border-color: rgba(255, 255, 255, 0.2);
}

.auth-forgot-link {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 13px;
  text-align: center;
  margin-top: 10px;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s;
}
.auth-forgot-link:hover { color: var(--accent); }

.auth-terms-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 8px;
  cursor: pointer;
}
.auth-terms-label input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}
.auth-terms-label span {
  font-size: 13px;
  color: var(--text3);
  line-height: 1.5;
}
.auth-terms-label a {
  color: var(--accent);
  text-decoration: none;
}
.auth-terms-label a:hover {
  text-decoration: underline;
}

.auth-page .auth-user-email {
  max-width: 100%;
}

/* ─── Home hero ──────────────────────────────────────────────────────────────── */
.home-hero { text-align: center; padding: 70px 20px 20px; }
.home-title {
  font-family: 'Space Mono', monospace;
  font-size: 48px;
  color: var(--accent);
}
.home-subtitle {
  color: var(--text2);
  max-width: 620px;
  margin: 14px auto 0;
  line-height: 1.6;
}

/* ─── Game mode cards (home) ─────────────────────────────────────────────────── */
.main-buttons {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin: 50px 20px;
}
.game-btn {
  background: linear-gradient(180deg, var(--surface), #111);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 260px;
  padding: 30px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
}
.game-btn:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(232, 213, 176, 0.45);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
/* Shimmer on hover */
.game-btn::before {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  width: 70%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
  transition: left 0.55s ease;
}
.game-btn:hover::before { left: 140%; }
.game-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.game-btn:disabled:hover { transform: none; box-shadow: none; }
.game-btn-icon  { font-size: 44px; }
.game-btn-title { font-size: 18px; font-weight: 700; }
.game-btn-desc  { font-size: 13px; color: var(--text2); text-align: center; }

.coming-soon-chip {
  position: absolute;
  top: 12px; right: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  color: var(--text3);
  font-family: 'Space Mono', monospace;
  letter-spacing: 0.05em;
}

/* ─── Game layout ────────────────────────────────────────────────────────────── */
.game-container { max-width: 560px; margin: 0 auto; padding: 0 20px 100px; }
.game-subheader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.game-label  { color: var(--accent); font-family: 'Space Mono', monospace; font-size: 14px; }
.streak-badge { color: var(--text2); font-size: 14px; }

/* ─── Airport image ──────────────────────────────────────────────────────────── */
.img-wrap {
  height: 300px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 14px;
  position: relative;
  background: var(--surface);
}

.img-wrap.has-correct-overlay {
  z-index: 50;
}

#airport-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, filter 0.35s ease;
}
.stage-0 { transform: scale(5); }
.stage-1 { transform: scale(3.5); }
.stage-2 { transform: scale(2.5); }
.stage-3 { transform: scale(1.8); }
.stage-4 { transform: scale(1); }
.stage-solved { filter: brightness(0.72); }

.answer-correct-overlay {
  position: absolute;
  inset: auto 12px 12px 12px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(7, 18, 35, 0.88);
  border: 1px solid rgba(74, 222, 128, 0.42);
  color: #dcfce7;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.answer-correct-overlay.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.img-credit {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.75);
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  line-height: 1.2;
  padding: 3px 7px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 5;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.img-credit--linked { pointer-events: auto; }
.round-photo-credit {
  font-size: 0.72rem;
  color: var(--text3, #6b8aa2);
  text-align: center;
  margin-top: 4px;
  font-style: italic;
}
.img-credit a {
  color: inherit;
  text-decoration: none;
}
.img-credit a:hover { text-decoration: underline; }

.zoom-chip {
  position: absolute;
  bottom: 12px; left: 12px;
  background: rgba(0, 0, 0, 0.65);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text2);
  pointer-events: none;
}

/* Help button on image */
.help-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.65);
  color: var(--text2);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  z-index: 5;
}

.help-btn:hover {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(232, 213, 176, 0.35);
}

/* Help modal */
.help-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.help-modal[hidden] {
  display: none;
}

.help-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.help-modal-card {
  position: relative;
  width: min(480px, 100%);
  max-height: min(80vh, 600px);
  overflow-y: auto;
  background: linear-gradient(165deg, var(--surface) 0%, #121212 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  padding: 24px;
  z-index: 1;
  animation: fadeUp 0.25s ease;
}

.help-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.help-modal-close:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

.help-modal-title {
  font-family: 'Space Mono', monospace;
  font-size: 20px;
  color: var(--accent);
  margin-bottom: 16px;
  padding-right: 40px;
}

.help-modal-content {
  color: var(--text2);
  font-size: 14px;
  line-height: 1.6;
}

.help-modal-content p {
  margin-bottom: 12px;
}

.help-modal-content ul {
  margin: 12px 0;
  padding-left: 20px;
}

.help-modal-content li {
  margin-bottom: 8px;
}

.help-modal-content strong {
  color: var(--text);
}

.help-modal-tip {
  margin-top: 16px;
  padding: 12px;
  background: var(--accent-dim);
  border: 1px solid rgba(232, 213, 176, 0.2);
  border-radius: var(--radius-sm);
  color: var(--accent);
}

.daily-result {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(8, 8, 8, 0.25) 0%, rgba(8, 8, 8, 0.72) 100%);
  z-index: 3;
}

.daily-result[hidden] {
  display: none;
}

.daily-answer-name {
  color: var(--text);
  font-family: 'Space Mono', monospace;
  font-size: 18px;
  text-align: center;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
  max-width: 90%;
}

/* ─── Clue grid ──────────────────────────────────────────────────────────────── */
.clue-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.clue {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 14px;
  color: var(--text3);
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.clue.revealed {
  color: var(--accent);
  border-color: rgba(232, 213, 176, 0.25);
  background: var(--accent-dim);
}

.clue.revealed.revealed-match {
  color: #89f0b6;
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.14);
}

.clue.revealed.revealed-match::before {
  content: '✓ ';
  font-weight: 700;
}

/* ─── Input ──────────────────────────────────────────────────────────────────── */
.input-row { position: relative; margin-bottom: 12px; }
#guess-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
#guess-input:focus { border-color: rgba(232, 213, 176, 0.4); }
#guess-input::placeholder { color: var(--text3); }

.guess-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  background: linear-gradient(160deg, var(--surface) 0%, #111 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
}

.guess-suggestions[hidden] {
  display: none;
}

.guess-suggestion-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  padding: 11px 14px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.guess-suggestion-item:last-child {
  border-bottom: none;
}

.guess-suggestion-item:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.btn-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.btn-primary {
  background: var(--accent);
  border: none;
  border-radius: var(--radius-md);
  height: 48px;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  cursor: pointer;
  color: #000;
  transition: opacity 0.2s, transform 0.2s;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-secondary {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: var(--radius-md);
  height: 48px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-secondary:hover { background: var(--surface); color: var(--text); }

/* ─── Guess counter ──────────────────────────────────────────────────────────── */
.guess-counter {
  text-align: center;
  color: var(--text3);
  font-size: 14px;
  margin-top: 10px;
}

/* ─── Category change link (infinite game) ──────────────────────────────────── */
.category-link-row {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.category-change-btn {
  min-width: 160px;
  height: 40px;
  font-size: 13px;
}

.game-status {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text2);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
}

.game-status.warn {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
  color: #fcdba2;
}

.game-status.error {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.12);
  color: #ffb8b8;
}

.game-status.ok {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
  color: #9bf3c1;
}

.daily-leaderboard {
  margin-top: 18px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.daily-leaderboard-title {
  font-family: 'Space Mono', monospace;
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 8px;
}

.daily-leaderboard-note {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 8px;
}

.leaderboard-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.leaderboard-info::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: #101010;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  color: var(--text2);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 30;
}

.leaderboard-info::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%) translateY(4px);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #101010;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 29;
}

.leaderboard-info:focus,
.leaderboard-info:hover {
  color: var(--accent);
  border-color: rgba(232, 213, 176, 0.35);
  outline: none;
}

.leaderboard-info:focus::after,
.leaderboard-info:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.leaderboard-info.is-open::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.leaderboard-info:focus::before,
.leaderboard-info:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.leaderboard-info.is-open::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.daily-leaderboard-status {
  font-size: 13px;
  color: var(--text3);
}

.daily-leaderboard-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: decimal;
  padding-left: 22px;
}

.daily-leaderboard-list[hidden] {
  display: none;
}

.daily-leaderboard-list li {
  color: var(--text2);
  font-size: 13px;
  line-height: 1.4;
}

.daily-leaderboard-list li.is-you {
  color: var(--text);
  background: var(--accent-dim);
  border: 1px solid rgba(232, 213, 176, 0.26);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  margin-left: -8px;
}

.daily-leaderboard-player {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text);
  font-weight: 600;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

.daily-leaderboard-player:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Special usernames on leaderboard (customize color below) */
.daily-leaderboard-player.special-user {
  color: #7f0fff; /* Change this color code to whatever you want */
  font-weight: 700;
}

.daily-leaderboard-player.special-user:hover {
  color: #b366ff; /* Lighter purple for hover state */
}

.profile-card {
  max-width: min(1280px, 98vw);
}

.profile-last-updated {
  margin-top: -6px;
  margin-bottom: 14px;
  color: var(--text3);
  font-size: 12px;
}

.profile-header-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(14, 19, 34, 0.96), rgba(11, 16, 30, 0.88));
  padding: 14px;
  margin-bottom: 18px;
}

.profile-header-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid #2dd4bf;
  display: grid;
  place-items: center;
  font-size: 24px;
  background: radial-gradient(circle at 30% 30%, rgba(45, 212, 191, 0.18), rgba(15, 23, 42, 0.95));
}

/* ── Avatar Ring (profile customization) ─────────────────────────────── */
.avatar-ring {
  padding: 3px;
  border-radius: 50%;
  background: var(--ring-color, #2dd4bf);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.avatar-ring > .profile-avatar {
  width: 50px;
  height: 50px;
  border: none;
  background: #090c14;
  color: var(--ring-color, #2dd4bf);
  font-size: 18px;
}

.avatar-ring.ring-style--pulse {
  animation: ringPulse 2.5s ease-in-out infinite;
}
@keyframes ringPulse {
  0%, 100% { filter: brightness(.65); box-shadow: 0 0 0 0 var(--ring-color, #2dd4bf); }
  50%       { filter: brightness(1.2); box-shadow: 0 0 14px 5px var(--ring-color, #2dd4bf); }
}

.avatar-ring.ring-style--shimmer {
  background: linear-gradient(90deg,
    var(--ring-color, #2dd4bf) 0%,
    #fff 35%,
    var(--ring-color, #2dd4bf) 50%,
    #fff 65%,
    var(--ring-color, #2dd4bf) 100%
  );
  background-size: 200% 100%;
  animation: ringShimmer 2s linear infinite;
}
@keyframes ringShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.avatar-ring.ring-style--gradient_rotate {
  background: conic-gradient(
    var(--ring-color, #2dd4bf) 0deg,
    transparent 120deg,
    var(--ring-color, #2dd4bf) 240deg,
    transparent 360deg
  );
  animation: ringGradientRotate 2.5s linear infinite;
}
@keyframes ringGradientRotate { to { transform: rotate(360deg); } }

.avatar-ring.ring-style--gradient_rotate > .profile-avatar {
  animation: ringGradientRotateCounter 2.5s linear infinite;
}
@keyframes ringGradientRotateCounter { to { transform: rotate(-360deg); } }

/* ── Profile custom title & bio ──────────────────────────────────────── */
.profile-custom-title {
  display: inline-block;
  font-size: 11px;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  letter-spacing: .06em;
  color: #c084fc;
  background: rgba(168, 85, 247, .12);
  border: 1px solid rgba(168, 85, 247, .25);
  border-radius: 100px;
  padding: 2px 9px;
  margin-bottom: 2px;
}

.profile-bio-text {
  font-size: 13px;
  color: #94a3b8;
  line-height: 1.5;
  margin-top: 4px;
  max-width: 360px;
  word-break: break-word;
}

/* ── Profile accent overlay (injected via JS) ─────────────────────────── */
.profile-accent-overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
}

.profile-banner-top,
.profile-xp-bar-wrap {
  position: relative;
  z-index: 1;
}

/* ── Profile customize button (own profile) ──────────────────────────── */
.profile-customize-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text3, #64748b);
  background: var(--surface2, #1e293b);
  border: 1px solid var(--border, rgba(148,163,184,.15));
  border-radius: 8px;
  padding: 6px 14px;
  text-decoration: none;
  transition: border-color .15s, color .15s;
  margin-bottom: 12px;
}
.profile-customize-btn:hover {
  border-color: rgba(56, 189, 248, .35);
  color: var(--accent, #38bdf8);
}

.profile-username {
  color: #f8fafc;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.profile-join-streak {
  color: #94a3b8;
  font-size: 12px;
}

.profile-global-rank {
  color: #cbd5e1;
  font-size: 12px;
  margin-top: 2px;
}

.profile-rank-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.profile-rank-info-toggle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(15, 23, 42, 0.8);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.profile-rank-info-toggle:hover {
  border-color: rgba(215, 196, 157, 0.3);
  color: #d7c49d;
}

.profile-rank-info-popover {
  position: absolute;
  top: 24px;
  left: 0;
  width: 220px;
  background: #141414;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
  padding: 10px;
  z-index: 20;
}

.profile-rank-info-popover h4 {
  margin: 0 0 6px;
  font-size: 12px;
  color: #f0f0f0;
  font-family: 'Space Mono', monospace;
}

.profile-rank-info-popover p {
  margin: 0;
  color: #a0a0a0;
  font-size: 11px;
  line-height: 1.45;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  gap: 8px;
}

.profile-stat-card {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.56);
  padding: 10px;
  text-align: center;
}

.profile-stat-card strong {
  display: block;
  font-size: 19px;
  color: #f8fafc;
  font-family: 'Space Mono', monospace;
}

.profile-stat-card span {
  color: #94a3b8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.55px;
}

.profile-showcase {
  margin-bottom: 20px;
}

.profile-section-label {
  margin: 0 0 10px;
  color: #94a3b8;
  font-size: 11px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.profile-showcase-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.profile-inventory {
  display: grid;
  gap: 18px;
  margin-bottom: 20px;
}

.inventory-section {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.45);
  padding: 12px;
}

.inventory-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.inventory-head h3 {
  margin: 0;
  color: #e2e8f0;
  font-size: 14px;
}

.inventory-count {
  color: #94a3b8;
  font-size: 12px;
}

.inventory-percent {
  color: #2dd4bf;
  font-size: 12px;
  font-weight: 700;
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.air-card-mini,
.air-card-showcase,
.pin-picker-card {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  overflow: hidden;
  background: #0f172a;
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.air-card-mini,
.pin-picker-card {
  aspect-ratio: 5 / 6;
}

.air-card-showcase {
  aspect-ratio: 3 / 4;
}

.air-card-face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  isolation: isolate;
  min-width: 0;
}

.air-card-face.text-only {
  grid-template-rows: auto 1fr;
}

.air-card-face::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.24), transparent 42%);
  opacity: 0.35;
  pointer-events: none;
  z-index: -1;
}

.air-card-rarity-top {
  height: 5px;
}

.air-card-rarity-top.legendary-bar {
  background: repeating-linear-gradient(110deg, #f59e0b 0 24px, #ef4444 24px 48px, #ec4899 48px 72px);
  background-size: 200% 100%;
  animation: rarityShimmer 2.4s linear infinite;
}

.air-card-art {
  display: grid;
  place-items: center;
  font-size: clamp(24px, 2vw, 34px);
  color: #f8fafc;
  text-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s ease, text-shadow 0.25s ease;
}

.air-card-mini .air-card-art {
  font-size: clamp(14px, 2.1vw, 18px);
  padding: 8px;
}

.air-card-photo-frame {
  width: calc(100% - 14px);
  margin: 7px;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(2, 6, 23, 0.22);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  max-height: calc(100% - 14px);
  align-self: center;
  justify-self: center;
}

.air-card-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.air-card-mini .air-card-photo,
.air-card-showcase .air-card-photo,
.pin-picker-card .air-card-photo {
  object-fit: cover;
  object-position: center;
  background: transparent;
}

.air-card-mini .air-card-photo-frame,
.air-card-showcase .air-card-photo-frame,
.pin-picker-card .air-card-photo-frame {
  width: calc(100% - 10px);
  height: calc(100% - 10px);
  margin: 5px;
  aspect-ratio: auto;
  max-height: none;
  align-self: stretch;
  justify-self: stretch;
}

.air-card-bottom {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 7px 8px 8px;
}

.air-card-face.text-only .air-card-bottom {
  align-content: start;
  padding-top: 10px;
}

.air-card-rarity-bottom {
  height: 2px;
  border-radius: 999px;
  margin-bottom: 5px;
}

.air-card-name {
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.15px;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  min-width: 0;
}

.air-card-meta {
  display: block;
  color: #cbd5e1;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  min-width: 0;
}

.air-card-sub {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  overflow-wrap: anywhere;
  min-width: 0;
}

.air-card-mini:hover,
.air-card-showcase:hover,
.pin-picker-card:hover {
  border-color: rgba(45, 212, 191, 0.65);
  transform: translateY(-2px);
}

.air-card-mini:hover .air-card-art,
.air-card-showcase:hover .air-card-art,
.pin-picker-card:hover .air-card-art {
  transform: translateY(-1px) scale(1.04);
  text-shadow: 0 16px 28px rgba(0, 0, 0, 0.42);
}

.air-card-mini:hover .air-card-photo-frame,
.air-card-showcase:hover .air-card-photo-frame,
.pin-picker-card:hover .air-card-photo-frame {
  border-color: rgba(148, 163, 184, 0.42);
}

.air-card-mini,
.air-card-showcase,
.pin-picker-card,
.card-detail-share {
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.air-card-mini:hover .air-card-face.rarity-common,
.air-card-showcase:hover .air-card-face.rarity-common,
.pin-picker-card:hover .air-card-face.rarity-common {
  box-shadow: inset 0 -28px 40px rgba(15, 23, 42, 0.42);
}

.air-card-mini:hover .air-card-face.rarity-rare,
.air-card-showcase:hover .air-card-face.rarity-rare,
.pin-picker-card:hover .air-card-face.rarity-rare {
  box-shadow: inset 0 -28px 40px rgba(14, 116, 144, 0.34), 0 0 22px rgba(56, 189, 248, 0.2);
}

.air-card-mini:hover .air-card-face.rarity-epic,
.air-card-showcase:hover .air-card-face.rarity-epic,
.pin-picker-card:hover .air-card-face.rarity-epic {
  box-shadow: inset 0 -28px 40px rgba(88, 28, 135, 0.34), 0 0 24px rgba(168, 85, 247, 0.24);
}

.air-card-mini:hover .air-card-face.rarity-legendary,
.air-card-showcase:hover .air-card-face.rarity-legendary,
.pin-picker-card:hover .air-card-face.rarity-legendary {
  box-shadow: inset 0 -28px 40px rgba(159, 18, 57, 0.3), 0 0 28px rgba(251, 191, 36, 0.28);
}

.air-card-mini[disabled],
.air-card-showcase[disabled] {
  opacity: 0.3;
  filter: grayscale(1);
  cursor: default;
  pointer-events: none;
}

.air-card-showcase-empty {
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
  height: 100%;
  padding: 8px;
}

.profile-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.profile-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface2);
}

.profile-line span {
  color: var(--text3);
  font-size: 12px;
}

.profile-line strong,
.profile-line code {
  color: var(--text);
  font-size: 13px;
}

.profile-line code {
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-badges-section {
  margin-top: 18px;
}

.profile-bests-section {
  margin-top: 18px;
}

.profile-bests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.best-metric-card {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.55);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.best-metric-card strong {
  color: #f8fafc;
  font-size: 20px;
  font-family: 'Space Mono', monospace;
}

.best-metric-card span {
  color: #94a3b8;
  font-size: 12px;
}

.best-metric-card .best-meta {
  color: #cbd5e1;
  font-size: 11px;
}

.profile-badges-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.badge-summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.56);
  padding: 8px 12px;
  color: #cbd5e1;
  font-size: 12px;
}

.badge-summary-pill strong {
  color: #f8fafc;
}

.profile-badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.achievement-badge {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.55);
  padding: 14px;
  text-align: left;
}

.achievement-badge.earned {
  border-color: rgba(34, 197, 94, 0.38);
  background: linear-gradient(180deg, rgba(12, 29, 22, 0.92) 0%, rgba(15, 23, 42, 0.55) 100%);
}

.achievement-badge.locked {
  opacity: 0.72;
}

.achievement-badge-emoji {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 23, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.18);
  flex-shrink: 0;
  font-size: 20px;
}

.achievement-badge-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.achievement-badge-title {
  color: #f8fafc;
  font-size: 14px;
  font-weight: 700;
}

.achievement-badge-desc {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.45;
}

.achievement-badge-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  color: #cbd5e1;
  font-size: 11px;
}

.achievement-badge-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.achievement-badge.earned .achievement-badge-chip {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.3);
  color: #bbf7d0;
}

.achievement-badge.locked .achievement-badge-chip {
  color: #94a3b8;
}

.profile-actions {
  grid-template-columns: 1fr 1fr;
}

.card-detail-modal,
.pin-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 66;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.pin-picker-close {
  position: static;
}

.card-detail-modal[hidden],
.pin-picker-modal[hidden] {
  display: none;
}

.card-detail-backdrop,
.pin-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(3px);
}

.card-detail-panel {
  position: relative;
  z-index: 1;
  width: min(600px, 100%);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: linear-gradient(180deg, #0b1223, #0f172a);
  box-shadow: 0 34px 90px rgba(2, 6, 23, 0.72);
}

.card-detail-close,
.pin-picker-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.36);
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.84);
  cursor: pointer;
}

.card-detail-topbar {
  height: 6px;
}

.card-detail-topbar.legendary {
  background: repeating-linear-gradient(110deg, #f59e0b 0 24px, #ef4444 24px 48px, #ec4899 48px 72px);
  background-size: 200% 100%;
  animation: rarityShimmer 2.4s linear infinite;
}

.card-detail-hero {
  height: 320px;
  display: grid;
  place-items: center;
  font-size: clamp(42px, 8vw, 68px);
  color: #f8fafc;
  background-position: center;
  background-size: cover;
  position: relative;
}

.card-detail-hero::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 70%;
  background: linear-gradient(to top, #0f172a 5%, rgba(15, 23, 42, 0));
}

.card-detail-body {
  position: relative;
  z-index: 1;
  padding: 16px 18px 18px;
}

.card-detail-rarity-pill {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.65px;
  padding: 4px 9px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.card-detail-name {
  margin: 0;
  color: #f8fafc;
  font-size: 38px;
  line-height: 1.03;
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: 0.15px;
}

.card-detail-operator {
  margin: 7px 0 10px;
  color: #94a3b8;
  font-size: 13px;
}

.card-detail-divider {
  border: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
  margin: 10px 0;
}

.card-detail-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 10px;
}

.card-detail-stats-grid div {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  padding: 7px 8px;
  background: rgba(15, 23, 42, 0.5);
}

.card-detail-stats-grid span {
  display: block;
  color: #94a3b8;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.card-detail-stats-grid strong {
  color: #e2e8f0;
  font-size: 12px;
}

.card-detail-footer {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.card-detail-earned {
  color: #94a3b8;
  font-size: 12px;
}

.card-detail-share {
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.75);
  color: #e2e8f0;
  padding: 7px 10px;
  cursor: pointer;
}

.card-detail-share:hover {
  border-color: rgba(45, 212, 191, 0.62);
}

.pin-picker-panel {
  position: relative;
  z-index: 1;
  width: min(740px, 100%);
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: linear-gradient(180deg, #0b1223, #0f172a);
  box-shadow: 0 30px 70px rgba(2, 6, 23, 0.65);
  padding: 14px;
}

.pin-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.pin-picker-head h3 {
  margin: 0;
  color: #e2e8f0;
  font-size: 14px;
}

.pin-picker-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  max-height: min(66vh, 500px);
  overflow-y: auto;
  padding-right: 2px;
}

.card-reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 72;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.card-reveal-overlay[hidden] {
  display: none;
}

.card-reveal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(5px);
}

.card-reveal-panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(180deg, #0b1223, #0f172a);
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.72);
  padding: 14px;
}

.card-reveal-head {
  text-align: center;
  margin-bottom: 8px;
}

.card-reveal-title {
  color: #e2e8f0;
  font-size: 13px;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

.card-reveal-card-wrap {
  perspective: 1200px;
  display: grid;
  place-items: center;
  margin: 4px 0 12px;
}

.card-reveal-card {
  width: min(280px, 74vw);
  aspect-ratio: 3 / 4;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.2, 0.65, 0.2, 1);
}

.card-reveal-card.is-flipped {
  transform: rotateY(180deg);
}

.card-reveal-face {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.3);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.card-reveal-front {
  background: linear-gradient(150deg, #1e293b, #0f172a);
  display: grid;
  place-items: center;
}

.card-reveal-back {
  background: linear-gradient(155deg, #13213f, #0f172a);
  transform: rotateY(180deg);
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
}

.card-reveal-front-mark {
  font-size: 44px;
  color: #e2e8f0;
  text-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.card-reveal-rarity-bar {
  height: 6px;
}

.card-reveal-rarity-bar.legendary {
  background: repeating-linear-gradient(110deg, #f59e0b 0 24px, #ef4444 24px 48px, #ec4899 48px 72px) !important;
  background-size: 200% 100%;
  animation: rarityShimmer 2.2s linear infinite;
}

.card-reveal-art {
  font-size: 48px;
  text-align: center;
  padding-top: 18px;
}

.card-reveal-name {
  color: #f8fafc;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 26px;
  text-align: center;
  line-height: 1.05;
  padding: 8px 12px 0;
}

.card-reveal-pill {
  justify-self: center;
  margin-top: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.card-reveal-summary {
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
  padding: 8px 12px 12px;
}

.card-reveal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.card-reveal-actions .btn-primary,
.card-reveal-actions .btn-secondary {
  height: 42px;
}

@keyframes rarityShimmer {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 200% 0;
  }
}

@media (max-width: 980px) {
  .profile-showcase-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-grid,
  .pin-picker-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 740px) {
  .profile-page .auth-page-main {
    padding: 0 14px 34px;
  }

  .profile-page .auth-card {
    padding: 16px;
  }

  .profile-header-shell {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .inventory-grid,
  .pin-picker-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .card-detail-stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .profile-showcase-slots,
  .inventory-grid,
  .pin-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-header-main {
    align-items: flex-start;
  }

  .profile-stats {
    grid-template-columns: 1fr;
  }

  .card-detail-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-reveal-actions {
    grid-template-columns: 1fr;
  }
}

/* ─── Delete Account Section ─────────────────────────────────────────────────── */

.profile-delete-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}

.profile-delete-btn {
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fecaca;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.profile-delete-btn:hover {
  background: rgba(220, 38, 38, 0.25);
  border-color: rgba(248, 113, 113, 0.6);
}

/* ─── Delete Confirmation Modal ──────────────────────────────────────────────── */

.delete-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.delete-confirm-modal[hidden] {
  display: none;
}

.delete-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.delete-confirm-card {
  position: relative;
  width: min(400px, 100%);
  background: linear-gradient(165deg, var(--surface) 0%, #121212 100%);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  padding: 28px;
  z-index: 1;
  animation: fadeUp 0.25s ease;
  text-align: center;
}

.delete-confirm-title {
  font-family: 'Space Mono', monospace;
  font-size: 22px;
  color: #ef4444;
  margin-bottom: 16px;
}

.delete-confirm-warning {
  color: var(--text2);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.delete-confirm-warning strong {
  color: #ef4444;
}

.delete-confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.delete-confirm-actions .btn-secondary {
  min-width: 100px;
  height: 44px;
}

.btn-danger {
  min-width: 120px;
  height: 44px;
  background: rgba(220, 38, 38, 0.2);
  border: 1px solid rgba(248, 113, 113, 0.5);
  color: #fecaca;
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn-danger:hover:not(:disabled) {
  background: rgba(220, 38, 38, 0.35);
  border-color: rgba(248, 113, 113, 0.7);
}

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

/* ─── Re-authentication Modal ──────────────────────────────────────────────── */

.reauth-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.reauth-modal[hidden] {
  display: none;
}

.reauth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.reauth-card {
  position: relative;
  width: min(400px, 100%);
  background: linear-gradient(165deg, var(--surface) 0%, #121212 100%);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  padding: 28px;
  z-index: 1;
  animation: fadeUp 0.25s ease;
  text-align: center;
}

.reauth-title {
  font-family: 'Space Mono', monospace;
  font-size: 20px;
  color: #ef4444;
  margin-bottom: 12px;
}

.reauth-message {
  color: var(--text2);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.reauth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reauth-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.reauth-input:focus {
  border-color: rgba(239, 68, 68, 0.4);
}

.reauth-error {
  color: var(--red);
  font-size: 13px;
  min-height: 18px;
  margin: 0;
}

.reauth-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}

.reauth-actions .btn-secondary {
  min-width: 100px;
  height: 44px;
}

.reauth-actions .btn-danger {
  min-width: 140px;
  height: 44px;
}

/* ─── Stats card ─────────────────────────────────────────────────────────────── */
.stats-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  max-width: 480px;
  margin: 40px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.stats-title {
  font-family: 'Space Mono', monospace;
  font-size: 22px;
  color: var(--accent);
}
.stats-row {
  display: flex;
  gap: 36px;
  justify-content: center;
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-num {
  font-family: 'Space Mono', monospace;
  font-size: 36px;
  color: var(--text);
  font-weight: 700;
}
.stat-lbl { font-size: 13px; color: var(--text2); margin-top: 4px; }

.countdown-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 999px;
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  color: var(--text2);
}

.stats-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}
.stats-actions .btn-primary  { flex: 1; min-width: 160px; }
.stats-actions .btn-secondary { flex: 1; min-width: 140px; }

/* ─── Global leaderboard panel ───────────────────────────────────────────────── */
.leaderboard-panel {
  width: 100%;
  max-width: 980px;
  margin: 20px auto 0;
  background: linear-gradient(180deg, rgba(13, 21, 37, 0.95), rgba(7, 11, 18, 0.98));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.leaderboard-panel-head {
  padding: 20px 20px 0;
}

.leaderboard-panel-title {
  font-family: 'Space Mono', monospace;
  font-size: 20px;
  color: var(--accent);
  margin-bottom: 8px;
}

.leaderboard-panel-subtitle {
  color: var(--text2);
  font-size: 14px;
  line-height: 1.55;
}

.leaderboard-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 20px 0;
}

.leaderboard-tab {
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  border-radius: 999px;
  padding: 9px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.leaderboard-tab:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

.leaderboard-tab.active {
  background: var(--accent);
  color: #000;
  border-color: transparent;
}

.leaderboard-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 20px 16px;
  color: var(--text2);
  font-size: 14px;
}

.leaderboard-table {
  border-top: 1px solid var(--border);
}

.leaderboard-head,
.leaderboard-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1.5fr) 110px minmax(0, 1fr) 92px;
  gap: 12px;
  align-items: center;
}

.leaderboard-head {
  padding: 14px 20px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
  background: rgba(15, 23, 42, 0.72);
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
}

.leaderboard-row {
  padding: 14px 20px;
  border-top: 1px solid rgba(56, 189, 248, 0.08);
}

.leaderboard-row:nth-child(2n) {
  background: rgba(15, 23, 42, 0.26);
}

.leaderboard-row.is-you {
  background: rgba(56, 189, 248, 0.12);
  border-top-color: rgba(56, 189, 248, 0.18);
}

.leaderboard-rank {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Mono', monospace;
  color: var(--text);
  font-weight: 700;
}

.leaderboard-move {
  font-size: 11px;
  padding: 4px 7px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.leaderboard-move.up {
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.18);
}

.leaderboard-move.down {
  color: #fda4af;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.18);
}

.leaderboard-move.flat {
  color: var(--text3);
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.14);
}

.leaderboard-player {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.leaderboard-player button {
  width: fit-content;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.leaderboard-player button:hover {
  color: var(--accent);
  text-decoration: underline;
}

.leaderboard-subline,
.leaderboard-metrics {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.5;
}

.leaderboard-score {
  font-family: 'Space Mono', monospace;
  font-size: 16px;
  color: var(--accent);
  text-align: right;
}

.leaderboard-user-rank {
  padding: 0 20px 18px;
  color: var(--text2);
  font-size: 13px;
}

.leaderboard-empty {
  padding: 28px 20px;
  color: var(--text2);
  text-align: center;
}

.leaderboard-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
}

.leaderboard-load-more {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  color: var(--text);
  cursor: pointer;
}

.leaderboard-load-more:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

@media (max-width: 760px) {
  .leaderboard-head,
  .leaderboard-row {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .leaderboard-head span:nth-child(3),
  .leaderboard-head span:nth-child(4),
  .leaderboard-head span:nth-child(5),
  .leaderboard-row > div:nth-child(3),
  .leaderboard-row > div:nth-child(4),
  .leaderboard-row > div:nth-child(5) {
    display: none;
  }
}

/* ─── FAQ ────────────────────────────────────────────────────────────────────── */
.faq-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0;
  overflow: hidden;
}

.faq-question {
  width: 100%;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  padding: 14px;
  cursor: pointer;
  font-size: 16px;
  color: var(--accent);
  font-family: 'Space Mono', monospace;
}

.faq-icon {
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: transform 0.24s ease;
  flex-shrink: 0;
  margin-right: 4px;
}

.faq-answer-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
}

.faq-answer {
  overflow: hidden;
  font-size: 14px;
  color: var(--text2);
  line-height: 1.55;
  padding: 0 14px;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.faq-item.open .faq-answer-wrap {
  grid-template-rows: 1fr;
}

.faq-item.open .faq-answer {
  padding: 0 14px 14px;
  opacity: 1;
}

.faq-item.open .faq-icon {
  transform: rotate(-135deg);
}

/* ─── Result Sheet ───────────────────────────────────────────────────────────── */
.result-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}

.result-sheet[hidden] {
  display: none;
}

.result-sheet-card {
  width: min(520px, 100%);
  background: linear-gradient(165deg, var(--surface) 0%, #121212 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform: translateY(14px);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.result-sheet.show .result-sheet-card {
  transform: translateY(0);
  opacity: 1;
}

.result-sheet-close {
  align-self: flex-end;
  background: transparent;
  border: none;
  color: var(--text3);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.result-sheet-title {
  font-family: 'Space Mono', monospace;
  font-size: 18px;
  color: var(--accent);
}

.result-sheet-detail {
  color: var(--text2);
  font-size: 14px;
}

.result-sheet-share {
  margin-top: 4px;
  width: 100%;
  height: 44px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
}

.result-sheet-share:hover {
  opacity: 0.9;
}

.result-sheet-share.result-sheet-continue {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(232, 213, 176, 0.35);
}

.result-sheet-extra-actions {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.result-sheet-extra-actions[hidden] {
  display: none;
}

.result-sheet-expert-cta {
  height: 42px;
}

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
.footer-bar {
  background: rgba(22, 22, 22, 0.9);
  backdrop-filter: blur(10px);
  padding: 24px 40px;
  display: flex;
  justify-content: center;
  gap: 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}
.footer-bar a { color: var(--text2); font-size: 14px; transition: color 0.2s; }
.footer-bar a:hover { color: var(--accent); }

/* ─── Toast Notifications ──────────────────────────────────────────────────── */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 240px;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(165deg, var(--surface) 0%, #151515 100%);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: toastIn 0.3s ease;
}

.toast-ok {
  border-color: rgba(34, 197, 94, 0.4);
  background: linear-gradient(165deg, rgba(34, 197, 94, 0.1) 0%, #111 100%);
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.4);
  background: linear-gradient(165deg, rgba(239, 68, 68, 0.1) 0%, #111 100%);
}

.toast-message {
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

.toast-close {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}

.toast-close:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

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

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

@media (max-width: 600px) {
  .toast-container {
    top: auto;
    bottom: 20px;
    right: 16px;
    left: 16px;
  }
  .toast {
    max-width: none;
  }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .header-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .nav-buttons {
    justify-content: center;
  }
  .auth-panel {
    min-width: 0;
    width: 100%;
  }
  .home-title { font-size: 38px; }
  .main-buttons { margin: 38px 14px; gap: 14px; }
  .game-btn { width: 100%; max-width: 340px; }
  .stats-row     { gap: 20px; }
  .stat-num      { font-size: 28px; }
}
@media (max-width: 700px) {
  .main-buttons  { flex-direction: column; align-items: center; }
  .home-title    { font-size: 32px; }
  .header-bar    { flex-direction: column; gap: 12px; }
  .nav-buttons   { flex-wrap: wrap; justify-content: center; }
}

/* ─── Badge chips ────────────────────────────────────────────────────────────── */
.badge-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  vertical-align: middle;
  margin-left: 5px;
}
.badge-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1;
  cursor: default;
  position: relative;
  user-select: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  transition: transform .12s;
}
.badge-chip:hover {
  transform: scale(1.18);
  z-index: 10;
}
.badge-chip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: #0b1220;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 11px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  z-index: 300;
  color: #e2e8f0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
  width: max-content;
  max-width: 200px;
  white-space: normal;
  text-align: center;
}
.badge-chip:hover::after {
  opacity: 1;
}
.profile-banner-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.profile-banner-badges .badge-chip {
  width: 26px;
  height: 26px;
  font-size: 14px;
  border-radius: 5px;
}

/* ── Update Log Popup ─────────────────────────────────────────────────────── */
.update-log-popup {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 300px;
  max-width: calc(100vw - 32px);
  background: #0d1525;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 16px;
  padding: 18px 18px 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(56, 189, 248, 0.08);
  z-index: 9999;
  transform: translateY(0) scale(1);
  opacity: 1;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}
.update-log-popup--enter {
  transform: translateY(20px) scale(0.97);
  opacity: 0;
}
.update-log-popup--exit {
  transform: translateY(16px) scale(0.97);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.update-log-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.update-log-popup__pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 20px;
  padding: 3px 10px;
  font-family: 'Space Mono', monospace;
}
.update-log-popup__close {
  background: none;
  border: none;
  color: var(--text3, #64748b);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 0 2px;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.update-log-popup__close:hover { opacity: 1; }
.update-log-popup__title {
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: #f0f6ff;
  margin-bottom: 8px;
  line-height: 1.3;
}
.update-log-popup__body {
  font-size: 13px;
  color: var(--text2, #94a3b8);
  line-height: 1.7;
  margin-bottom: 14px;
  max-height: 160px;
  overflow-y: auto;
}
.update-log-popup__btn {
  width: 100%;
  padding: 9px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  color: #7dd3fc;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.update-log-popup__btn:hover { background: rgba(56, 189, 248, 0.2); }

/* ── Friend indicator (leaderboards + profile) ───────────────────────────────── */
.friend-indicator {
  display: inline-flex;
  align-items: center;
  color: #38bdf8;
  opacity: 0.75;
  margin-left: 5px;
  vertical-align: middle;
  flex-shrink: 0;
  pointer-events: none;
}
.profile-friend-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(56,189,248,.12);
  border: 1px solid rgba(56,189,248,.25);
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  border-radius: 6px;
  padding: 2px 7px;
  margin-left: 8px;
  vertical-align: middle;
  text-transform: uppercase;
}
.profile-friend-badge svg { flex-shrink: 0; }

/* ── PWA Install Banner ──────────────────────────────────────────────────────── */
.pwa-install-banner {
  position: fixed;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid rgba(56,189,248,.2);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1400;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  transition: bottom .35s cubic-bezier(.34,1.56,.64,1);
  max-width: calc(100vw - 32px);
  width: 460px;
}
.pwa-install-banner--visible { bottom: 24px; }
.pwa-install-inner { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.pwa-install-icon { color: var(--accent); flex-shrink: 0; }
.pwa-install-inner span { font-size: 13px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pwa-install-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pwa-install-btn { background: var(--accent); color: #000; border: none; border-radius: 8px; padding: 7px 14px; font-size: 13px; font-weight: 700; cursor: pointer; transition: opacity .15s; }
.pwa-install-btn:hover { opacity: .85; }
.pwa-install-dismiss { background: none; border: none; color: var(--text3); font-size: 20px; cursor: pointer; padding: 2px 6px; border-radius: 6px; line-height: 1; transition: color .15s; }
.pwa-install-dismiss:hover { color: var(--text); }

/* ── Push notification bell ──────────────────────────────────────────────────── */
.push-bell-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  color: var(--text3);
  display: flex;
  align-items: center;
  transition: color .15s, background .15s;
}
.push-bell-btn:hover { color: var(--accent); background: var(--accent-dim); }
.push-bell-btn--on { color: var(--accent); }
.push-bell-btn--on svg { fill: rgba(56,189,248,.2); }

@media (max-width: 600px) {
  .pwa-install-banner { width: calc(100vw - 32px); }
}

/* ── Contributor Spotlight banner ──────────────────────────────────────── */
.event-banner--spotlight {
  background: linear-gradient(90deg, #1e3a5f, #1e4d3a);
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.spotlight-username { color: #38bdf8; }
.spotlight-dismiss {
  margin-left: 12px;
  cursor: pointer;
  opacity: 0.6;
  font-size: 0.9rem;
}
.spotlight-dismiss:hover { opacity: 1; }

/* ── Contributor profile badge ──────────────────────────────────────────── */
.contributor-badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 2px 8px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  color: #38bdf8;
}

/* ── Double XP Event banner ─────────────────────────────────────────────── */
.event-banner {
  width: 100%;
  text-align: center;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  box-sizing: border-box;
}
.event-banner--xp {
  background: linear-gradient(90deg, #7c3aed, #2563eb);
  color: #fff;
}

/* ── Community Milestone banner ──────────────────────────────────────── */
.event-banner--milestone {
  background: linear-gradient(90deg, #065f46, #1e3a5f);
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.milestone-claim-btn {
  background: #10b981;
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 4px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: 10px;
  transition: opacity .15s;
}
.milestone-claim-btn:hover { opacity: .85; }
.milestone-claim-btn:disabled { opacity: .5; cursor: default; }

/* ── Community milestone progress strip ─────────────────────────────── */
.milestone-progress-strip {
  width: 100%;
  max-width: 800px;
  margin: 0 auto 16px;
  padding: 10px 16px;
  background: rgba(16, 185, 129, .06);
  border: 1px solid rgba(16, 185, 129, .2);
  border-radius: 10px;
  box-sizing: border-box;
}
.milestone-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #6ee7b7;
  margin-bottom: 6px;
  font-weight: 500;
}
.milestone-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, .08);
  border-radius: 99px;
  overflow: hidden;
}
.milestone-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: 99px;
  transition: width .6s ease;
}
