/* ===== Perk design system ===== */
:root {
  /* navy backgrounds */
  --bg-0: #070b18;
  --bg-1: #0b1024;
  --bg-2: #0f1630;
  --panel: #141d3d;
  --panel-2: #1a2450;
  --panel-3: #212c5c;
  --hover: #263168;

  /* borders + text */
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #eaecf7;
  --muted: #8b95c4;
  --muted-2: #5f699a;

  /* brand */
  --gold-1: #ffd874;
  --gold: #f6b93b;
  --gold-2: #e38b1f;
  --purple: #7c5cff;
  --purple-2: #a78bfa;
  --cyan: #38e1ff;
  --green: #2fd07b;
  --green-dk: #16351f;
  --red: #ff5c7a;
  --red-dk: #3a1622;

  --grad-gold: linear-gradient(135deg, #ffd874, #f6b93b 55%, #e38b1f);
  --grad-purple: linear-gradient(135deg, #7c5cff, #a78bfa);
  --grad-hero: radial-gradient(120% 120% at 80% 0%, #3a2a6e 0%, #241a4d 40%, #131a3a 100%);

  --shadow-1: 0 8px 30px rgba(0, 0, 0, 0.35);
  --shadow-gold: 0 10px 30px rgba(246, 185, 59, 0.25);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --maxw: 1280px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-1);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
::selection { background: rgba(246, 185, 59, 0.3); }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--panel-2); border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: var(--panel-3); }

/* ===== brand / logo ===== */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { width: 34px; height: 34px; }
.brand-name {
  font-weight: 800; font-size: 22px; letter-spacing: 0.5px;
}
.brand-name .p { color: var(--gold); }

/* ===== token coin ===== */
.coin {
  display: inline-block; width: 1em; height: 1em;
  border-radius: 4px; background: var(--grad-gold);
  box-shadow: inset 0 0 0 1.5px rgba(0,0,0,.25);
  position: relative; flex: none; vertical-align: -2px;
}
.coin::after {
  content: ""; position: absolute; inset: 22%;
  border-radius: 2px; border: 1.5px solid rgba(11,16,36,.7);
}

/* ===== buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--r-md); font-weight: 700;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-gold { background: var(--grad-gold); color: #251400; box-shadow: var(--shadow-gold); }
.btn-gold:hover { box-shadow: 0 12px 34px rgba(246,185,59,.4); }
.btn-purple { background: var(--grad-purple); color: #fff; }
.btn-ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--panel-3); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 26px; font-size: 16px; }

/* ===== forms ===== */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.input, select.input {
  width: 100%; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
  outline: none; transition: border .15s ease, box-shadow .15s ease;
}
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(246,185,59,.15); }
select.input { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238b95c4' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}

/* ===== icons ===== */
.icon { display: inline-block; vertical-align: middle; flex: none; }

/* ===== utility ===== */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(124,92,255,.15); color: var(--purple-2);
  border: 1px solid rgba(124,92,255,.25);
}
.chip-gold { background: rgba(246,185,59,.14); color: var(--gold-1); border-color: rgba(246,185,59,.28); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ===== toast ===== */
#toasts {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  padding: 12px 16px; border-radius: var(--r-md); background: var(--panel-2);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-1);
  font-size: 14px; font-weight: 600; max-width: 320px;
  animation: toastIn .25s ease;
}
.toast.ok { border-left: 3px solid var(--green); }
.toast.err { border-left: 3px solid var(--red); }
.toast.win { border-left: 3px solid var(--gold); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } }

/* ===== modal ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(4, 7, 18, 0.7); backdrop-filter: blur(6px);
}
.modal-overlay.open { display: flex; animation: fadeIn .2s ease; }
.modal {
  width: 100%; max-width: 420px; background: var(--panel);
  border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1); padding: 28px; animation: popIn .25s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(10px); } }
