/* ── Grind Pass Page Styles ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --black: #0A0A0A; --surface: #1A1A1A; --border: #242424; --border-light: #2E2E2E;
  --green: #00E676; --green-dark: #00C853;
  --yellow: #F5C518; --gold: #c8a820; --gold-bright: #FFD700;
  --white: #F0F0F0; --gray: #888888; --gray-light: #AAAAAA;
  --font: 'Inter', system-ui, sans-serif; --mono: 'JetBrains Mono', monospace;
}
body { font-family: var(--font); background: #07070a; color: var(--white); -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: var(--green); text-decoration: none; }

/* ── Nav ── */
nav { position: sticky; top: 0; z-index: 999; background: rgba(7,7,10,0.95); backdrop-filter: blur(24px); border-bottom: 1px solid rgba(200,168,32,0.15); height: 52px; display: flex; align-items: center; padding: 0 20px; }
.nav-inner { max-width: 1100px; width: 100%; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
nav a { color: var(--gray); font-size: 0.8rem; font-weight: 600; }
nav a:hover { color: var(--gold-bright); }

/* ── Page background ── */
.gp-page {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(200,168,32,0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 30% 80%, rgba(0,230,118,0.03) 0%, transparent 40%),
    #07070a;
}

/* ── Header ── */
.gp-header { max-width: 900px; margin: 0 auto; padding: 48px 20px 32px; text-align: center; }
.gp-eyebrow { font-family: 'Cinzel', serif; font-size: 0.55rem; letter-spacing: 6px; color: rgba(200,168,32,0.6); margin-bottom: 12px; text-transform: uppercase; }
.gp-title { font-family: 'Cinzel', serif; font-size: 2.2rem; font-weight: 900; color: var(--white); margin-bottom: 24px; text-shadow: 0 0 40px rgba(200,168,32,0.15); }

.gp-level-row { display: flex; align-items: center; justify-content: center; gap: 24px; flex-wrap: wrap; }
.gp-level-circle {
  width: 80px; height: 80px; border-radius: 50%;
  border: 3px solid var(--gold); display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: linear-gradient(160deg, #1a1508, #0a0a0a);
  box-shadow: 0 0 30px rgba(200,168,32,0.1);
}
.gp-level-num { font-family: 'Cinzel', serif; font-size: 1.8rem; font-weight: 900; color: var(--gold-bright); line-height: 1; }
.gp-level-label { font-size: 0.45rem; letter-spacing: 3px; color: rgba(200,168,32,0.6); text-transform: uppercase; }

.gp-xp-section { flex: 1; max-width: 400px; min-width: 200px; }
.gp-xp-bar { width: 100%; height: 12px; background: rgba(255,255,255,0.06); border-radius: 6px; overflow: hidden; border: 1px solid rgba(255,255,255,0.05); }
.gp-xp-fill { height: 100%; background: linear-gradient(90deg, var(--green-dark), var(--green)); border-radius: 6px; transition: width 0.6s ease; }
.gp-xp-text { font-family: var(--mono); font-size: 0.7rem; color: var(--gray); margin-top: 6px; }
.gp-streak { font-size: 0.65rem; color: var(--yellow); margin-top: 4px; }

/* Premium button */
.gp-premium-btn {
  background: linear-gradient(135deg, #2a1f08, #1a1508); border: 2px solid var(--gold);
  color: var(--gold-bright); font-family: 'Cinzel', serif; font-size: 0.75rem; font-weight: 700;
  padding: 10px 20px; border-radius: 8px; cursor: pointer; letter-spacing: 1px;
  transition: 0.2s; margin-top: 16px;
}
.gp-premium-btn:hover { background: linear-gradient(135deg, #3a2a0a, #2a1f08); box-shadow: 0 0 20px rgba(200,168,32,0.2); }
.gp-premium-btn.active { background: rgba(200,168,32,0.15); border-color: var(--gold-bright); cursor: default; }
.gp-premium-btn.locked { opacity: 0.4; cursor: not-allowed; border-color: var(--gray); color: var(--gray); }

/* ── Reward Track ── */
.gp-track-section { padding: 20px 0 40px; overflow: hidden; }
.gp-track-scroll {
  overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
  padding: 60px 40px 60px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.gp-track-scroll::-webkit-scrollbar { height: 6px; }
.gp-track-scroll::-webkit-scrollbar-track { background: transparent; }
.gp-track-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.gp-track-inner { display: flex; align-items: center; position: relative; width: max-content; }
.gp-track-line { position: absolute; top: 50%; left: 0; right: 0; height: 3px; background: var(--border); transform: translateY(-50%); z-index: 0; }
.gp-track-line-fill { position: absolute; top: 0; left: 0; height: 100%; background: linear-gradient(90deg, var(--green-dark), var(--green)); border-radius: 2px; transition: width 0.4s; }

/* Track node */
.gp-node {
  position: relative; z-index: 1; width: 44px; height: 44px; flex-shrink: 0;
  margin: 0 18px; cursor: pointer; transition: transform 0.2s;
}
.gp-node:hover { transform: scale(1.15); }
.gp-node-circle {
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 0.65rem; font-weight: 700; color: var(--gray);
  transition: 0.2s;
}

/* Milestone nodes */
.gp-node.milestone .gp-node-circle {
  width: 56px; height: 56px; border-radius: 12px; transform: rotate(45deg);
  margin: -6px;
}
.gp-node.milestone .gp-node-circle span { transform: rotate(-45deg); }

/* Node states */
.gp-node.locked .gp-node-circle { opacity: 0.4; }
.gp-node.current .gp-node-circle { border-color: var(--green); color: var(--green); box-shadow: 0 0 12px rgba(0,230,118,0.3); animation: gpNodePulse 2s ease-in-out infinite; }
@keyframes gpNodePulse { 0%,100% { box-shadow: 0 0 12px rgba(0,230,118,0.3); } 50% { box-shadow: 0 0 24px rgba(0,230,118,0.5); } }
.gp-node.claimable .gp-node-circle { border-color: var(--gold-bright); color: var(--gold-bright); background: linear-gradient(160deg, #1a1508, #0a0a0a); box-shadow: 0 0 16px rgba(255,215,0,0.2); animation: gpNodeGold 2s ease-in-out infinite; }
@keyframes gpNodeGold { 0%,100% { box-shadow: 0 0 16px rgba(255,215,0,0.2); } 50% { box-shadow: 0 0 28px rgba(255,215,0,0.4); } }
.gp-node.claimed .gp-node-circle { border-color: var(--green-dark); background: rgba(0,230,118,0.1); color: var(--green); }
.gp-node.claimed .gp-node-circle::after { content: '✓'; position: absolute; font-size: 0.7rem; }

/* Reward labels above/below nodes */
.gp-reward-label {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: 0.5rem; font-weight: 700; color: var(--gray); white-space: nowrap;
  letter-spacing: 0.3px; max-width: 80px; text-align: center; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis;
}
.gp-reward-label.free { bottom: calc(100% + 8px); }
.gp-reward-label.premium { top: calc(100% + 8px); color: var(--gold); opacity: 0.5; }
.gp-node.claimed .gp-reward-label.free { color: var(--green); opacity: 0.6; }
.gp-node:not(.premium-active) .gp-reward-label.premium { opacity: 0.25; }

/* ── Detail Popup ── */
.gp-popup-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.88); z-index: 10000;
  align-items: center; justify-content: center; backdrop-filter: blur(8px);
}
.gp-popup-overlay.open { display: flex; }
.gp-popup {
  background: #111; border: 1px solid var(--border-light); border-radius: 16px;
  padding: 32px; max-width: 380px; width: 90%; text-align: center;
  animation: gpPopIn 0.3s ease;
}
@keyframes gpPopIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.gp-popup-level { font-family: 'Cinzel', serif; font-size: 0.65rem; letter-spacing: 4px; color: var(--gold); margin-bottom: 16px; }
.gp-popup-reward {
  padding: 16px; border-radius: 10px; margin-bottom: 12px;
  border: 1px solid rgba(255,255,255,0.06);
}
.gp-popup-reward.free-reward { background: rgba(0,230,118,0.05); }
.gp-popup-reward.premium-reward { background: rgba(200,168,32,0.05); }
.gp-popup-reward.locked-reward { opacity: 0.35; }
.gp-popup-reward-type { font-size: 0.6rem; letter-spacing: 2px; text-transform: uppercase; color: var(--gray); margin-bottom: 6px; }
.gp-popup-reward-value { font-size: 1rem; font-weight: 800; }
.gp-popup-claimed { color: var(--green); font-size: 0.75rem; font-weight: 700; margin-top: 8px; }
.gp-popup-btn {
  background: var(--green); color: #000; border: none; font-family: var(--font);
  font-size: 0.85rem; font-weight: 800; padding: 12px 28px; border-radius: 8px;
  cursor: pointer; margin-top: 12px; transition: 0.2s;
}
.gp-popup-btn:hover { background: var(--green-dark); }
.gp-popup-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.gp-popup-btn.gold { background: var(--gold-bright); }
.gp-popup-close {
  position: absolute; top: 12px; right: 16px; background: none; border: none;
  color: var(--gray); font-size: 1.4rem; cursor: pointer;
}

/* ── Titles Section ── */
.gp-section { max-width: 900px; margin: 0 auto; padding: 32px 20px; }
.gp-section-title { font-family: 'Cinzel', serif; font-size: 1rem; font-weight: 700; color: var(--white); margin-bottom: 16px; letter-spacing: 1px; }
.gp-titles-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.gp-title-chip {
  padding: 6px 14px; border-radius: 20px; font-size: 0.7rem; font-weight: 700;
  border: 1px solid var(--border); background: var(--surface); color: var(--gray);
  cursor: pointer; transition: 0.2s;
}
.gp-title-chip:hover { border-color: var(--gold); color: var(--white); }
.gp-title-chip.active { border-color: var(--gold-bright); color: var(--gold-bright); background: rgba(200,168,32,0.1); }

/* ── XP Log ── */
.gp-log-list { display: flex; flex-direction: column; gap: 8px; }
.gp-log-entry {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; font-size: 0.75rem;
}
.gp-log-activity { color: var(--white); font-weight: 600; }
.gp-log-xp { color: var(--green); font-family: var(--mono); font-weight: 700; }
.gp-log-time { color: var(--gray); font-size: 0.65rem; }

/* ── How to Earn XP ── */
.gp-howto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.gp-howto-card {
  padding: 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; display: flex; justify-content: space-between; align-items: center;
}
.gp-howto-label { font-size: 0.78rem; font-weight: 600; color: var(--white); }
.gp-howto-xp { font-family: var(--mono); font-size: 0.75rem; color: var(--green); font-weight: 700; }

/* ── Empty / Sign-in state ── */
.gp-empty { text-align: center; padding: 80px 20px; }
.gp-empty h3 { font-family: 'Cinzel', serif; font-size: 1.2rem; margin-bottom: 8px; }
.gp-empty p { color: var(--gray); font-size: 0.85rem; margin-bottom: 20px; }
.gp-empty .btn-primary { display: inline-block; background: var(--green); color: #000; font-weight: 800; padding: 12px 24px; border-radius: 8px; text-decoration: none; }

/* ── Confetti ── */
.gp-confetti { position: fixed; width: 8px; height: 8px; z-index: 200001; pointer-events: none; animation: gpConfettiFall 1.5s ease-in forwards; }
@keyframes gpConfettiFall { 0% { transform: translateY(0) rotate(0deg); opacity: 1; } 100% { transform: translateY(100vh) rotate(720deg); opacity: 0; } }

/* ── Responsive ── */
@media (max-width: 768px) {
  .gp-header { padding: 32px 16px 24px; }
  .gp-title { font-size: 1.6rem; }
  .gp-level-circle { width: 64px; height: 64px; }
  .gp-level-num { font-size: 1.4rem; }
  .gp-track-scroll { padding: 50px 16px 50px; }
  .gp-node { width: 36px; height: 36px; margin: 0 12px; }
  .gp-node-circle { width: 36px; height: 36px; font-size: 0.55rem; }
  .gp-node.milestone .gp-node-circle { width: 48px; height: 48px; margin: -6px; }
  .gp-howto-grid { grid-template-columns: 1fr; }
  .gp-section { padding: 24px 16px; }
}
@media (max-width: 480px) {
  .gp-level-row { flex-direction: column; gap: 16px; }
  .gp-xp-section { max-width: 100%; }
}
