/* ===================================================
   MELON STORE — Design tokens & base
   =================================================== */

:root {
  /* Surfaces */
  --bg: #0a0a0b;
  --bg-2: #0e0e10;
  --surface: #141416;
  --surface-2: #1a1a1d;
  --surface-3: #222226;
  --border: #26262b;
  --border-strong: #34343a;

  /* Text */
  --text: #f5f5f7;
  --text-2: #c8c8cc;
  --text-muted: #7a7a82;
  --text-dim: #54545c;

  /* Accent (yellow from the moon logo) */
  --accent: #F5C84B;
  --accent-hi: #FFD968;
  --accent-lo: #d6a92a;
  --accent-soft: rgba(245, 200, 75, 0.14);
  --accent-softer: rgba(245, 200, 75, 0.06);
  --accent-glow: 0 0 60px rgba(245, 200, 75, 0.18);

  /* Status */
  --success: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;
  --info: #60a5fa;

  /* Geometry */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* Type */
  --font-display: "Unbounded", "Inter", system-ui, sans-serif;
  --font-body: "Onest", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  /* Motion */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(245, 200, 75, 0.06), transparent 60%),
    radial-gradient(900px 500px at -10% 30%, rgba(245, 200, 75, 0.03), transparent 60%),
    var(--bg);
}

/* Subtle grain over everything for texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence baseFrequency='0.9' /></filter><rect width='100%' height='100%' filter='url(%23n)' /></svg>");
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

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

/* ===========================
   App shell
   =========================== */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.shell-inner {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ===========================
   Navigation
   =========================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  background: rgba(10, 10, 11, 0.72);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-2);
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  overflow: hidden;
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; }

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  line-height: 1;
}
.brand-name span { color: var(--accent); }
.brand-tag {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 4px;
}

.nav-links {
  display: flex;
  gap: 4px;
  margin-left: 28px;
}
.nav-link {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease);
  position: relative;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.nav-spacer { flex: 1; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.balance-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.balance-chip:hover { border-color: var(--accent); }
.balance-chip .coin {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  display: grid; place-items: center;
  color: #1a1500; font-size: 10px; font-weight: 800;
}
.balance-chip .plus {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #1a1500;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 800;
  margin-right: -6px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 6px 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s var(--ease);
}
.user-chip:hover { border-color: var(--border-strong); }
.user-chip .avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6c4ef5, #f54e9b);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: white;
}

/* ===========================
   Buttons
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text);
  transition: transform .08s var(--ease), background .15s var(--ease), border-color .15s var(--ease);
  white-space: nowrap;
  font-family: var(--font-body);
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #1a1500;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hi); }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--border-strong); }

.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 52px; padding: 0 24px; font-size: 15px; border-radius: 12px; }

/* ===========================
   Cards
   =========================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color .2s var(--ease), transform .2s var(--ease), background .2s var(--ease);
}
.card:hover { border-color: var(--border-strong); }

.card-interactive { cursor: pointer; }
.card-interactive:hover { transform: translateY(-2px); }

/* ===========================
   Badge / tags
   =========================== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.tag-accent {
  background: var(--accent);
  color: #1a1500;
  border-color: var(--accent);
}
.tag-soft {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(245, 200, 75, 0.2);
}
.tag-danger {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.25);
}

/* ===========================
   Section header / labels
   =========================== */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--accent);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.02em;
}

/* ===========================
   Live dot
   =========================== */
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
  70%  { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* ===========================
   Screen transitions
   =========================== */
.screen {
  animation: screen-in .4s var(--ease-out) both;
}
@keyframes screen-in {
  from { transform: translateY(10px); }
  to   { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
}

/* ===========================
   Utility
   =========================== */
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.center { display: grid; place-items: center; }
.row { display: flex; align-items: center; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.flex1 { flex: 1; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }
