/* ============================================================
   Base Styles & Reset — Golden Quest
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg-app);
}

body {
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Fixed localized brand glow in background */
.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: var(--glow-brand);
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

input, select, textarea {
  font: inherit;
  color: inherit;
}

ul, ol {
  list-style: none;
}

::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* === Typography === */
.display {
  font-size: 30px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-family: var(--font-display);
}

.h1 {
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-family: var(--font-display);
}

.h2 {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.015em;
  font-family: var(--font-display);
}

.h3 {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-family: var(--font-display);
}

.body {
  font-size: 14px;
  line-height: 1.48;
  font-weight: 400;
}

.body-strong {
  font-size: 14px;
  line-height: 1.48;
  font-weight: 600;
}

.caption {
  font-size: 12px;
  line-height: 1.38;
  font-weight: 400;
  color: var(--text-secondary);
}

.overline {
  font-size: 11px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-400);
}

.count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-secondary); }
.text-gold      { color: var(--gold-400); }
.text-amber     { color: var(--amber-400); }
.text-success   { color: var(--success-text); }
.text-danger    { color: var(--danger-text); }
.text-warning   { color: var(--warning-text); }
.text-center    { text-align: center; }

/* === Layout === */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  z-index: 1;
  padding-bottom: 84px;
}

.screen {
  padding: var(--space-4) var(--gutter);
  animation: fadeIn var(--dur-base) var(--ease-out);
}

.wrap {
  padding: 0 var(--gutter);
}

.section {
  margin-bottom: var(--space-5);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px var(--space-2);
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-2);
  letter-spacing: -0.01em;
}

.section-title .see-all {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gold-400);
  transition: color var(--dur-fast) var(--ease-out);
}

.section-title .see-all:hover {
  color: var(--gold-300);
}

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.w-full { width: 100%; }

/* === Animations === */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .7; transform: scale(0.96); }
}

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

@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

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

/* === Skeleton Loading === */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,.05) 25%, rgba(255,255,255,.12) 50%, rgba(255,255,255,.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  border-radius: 4px;
}
.skeleton-text.w-60 { width: 60%; }
.skeleton-text.w-40 { width: 40%; }
.skeleton-text.w-80 { width: 80%; }
.skeleton-circle { border-radius: 50%; }
.skeleton-card {
  height: 90px;
  border-radius: var(--radius-card);
  margin-bottom: var(--space-3);
}

/* === States (Empty / Error / Loading) === */
.state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-7) var(--space-4);
  text-align: center;
  gap: var(--space-2);
  background: var(--glass-fill);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-card);
  -webkit-backdrop-filter: var(--glass-blur-filter);
  backdrop-filter: var(--glass-blur-filter);
  box-shadow: var(--rim-top);
  margin: var(--space-3) 0;
}

.state-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tint-gold);
  color: #000;
  box-shadow: var(--shadow-brand);
  margin-bottom: var(--space-2);
  font-size: 24px;
}

.state-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-display);
}

.state-desc {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 260px;
  line-height: 1.4;
}

/* === Spinner === */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255,255,255,.12);
  border-top-color: var(--gold-400);
  border-right-color: var(--amber-500);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

.loading-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) 0;
}

/* === Toast Notification === */
.toast {
  position: fixed;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20,21,32,.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  color: var(--text-primary);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  z-index: var(--z-toast);
  box-shadow: 0 12px 36px rgba(0,0,0,.6), var(--rim-top);
  animation: slideUp var(--dur-base) var(--ease-out);
  border: 1px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

/* === Back Header === */
.back-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-1) 0 var(--space-3);
  gap: var(--space-2);
}

.back-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--glass-fill);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  box-shadow: var(--rim-top);
  -webkit-backdrop-filter: var(--glass-blur-filter);
  backdrop-filter: var(--glass-blur-filter);
  transition: transform var(--dur-fast) var(--ease-out), background var(--dur-base) var(--ease-out);
  flex-shrink: 0;
}

.back-btn:hover {
  background: var(--glass-fill-hover);
  border-color: var(--glass-rim);
}

.back-btn:active {
  transform: scale(0.95);
  background: var(--glass-fill-hover);
}

.back-header .title {
  font-size: 16.5px;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--text-primary);
  flex: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
