/* =========================================================================
   GoodUp — design system
   Deep-water dark UI · glassmorphism · neon accents · micro-motion
   ========================================================================= */

/* ------------------------------------------------------------------ tokens */
:root {
  --bg-0: #04060d;
  --bg-1: #070b16;
  --bg-2: #0b1122;
  --bg-3: #101832;
  --panel: rgba(15, 22, 43, 0.66);
  --panel-solid: #0d1428;
  --panel-hi: rgba(30, 41, 74, 0.55);
  --stroke: rgba(148, 178, 230, 0.14);
  --stroke-hi: rgba(148, 209, 255, 0.34);
  --ink: #eaf2ff;
  --ink-2: #b9c6e2;
  --ink-3: #8593b4;
  --ink-4: #5d6b8c;

  --cyan: #22d3ee;
  --aqua: #38bdf8;
  --blue: #4f7cff;
  --violet: #8b5cf6;
  --magenta: #e879f9;
  --green: #34d399;
  --gold: #fbbf24;
  --red: #fb7185;

  --grad-brand: linear-gradient(120deg, #22d3ee 0%, #4f7cff 45%, #a855f7 100%);
  --grad-brand-soft: linear-gradient(120deg, rgba(34, 211, 238, .16), rgba(168, 85, 247, .16));
  --grad-gold: linear-gradient(120deg, #fde68a, #fbbf24 40%, #f59e0b);
  --grad-danger: linear-gradient(120deg, #fb7185, #f43f5e);
  --grad-success: linear-gradient(120deg, #34d399, #10b981);

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-pill: 999px;

  --shadow-sm: 0 4px 16px rgba(2, 6, 18, .45);
  --shadow-md: 0 18px 50px -18px rgba(2, 8, 26, .8);
  --shadow-lg: 0 40px 90px -30px rgba(0, 0, 0, .85);
  --shadow-glow: 0 0 0 1px rgba(56, 189, 248, .22), 0 18px 60px -20px rgba(34, 211, 238, .45);

  --font: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
  --header-h: 72px;
  --shell: 1320px;
}

/* -------------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg-0);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: rgba(56, 189, 248, .32); color: #fff; }
:focus-visible { outline: 2px solid var(--aqua); outline-offset: 2px; border-radius: 6px; }

/* scrollbar */
* { scrollbar-width: thin; scrollbar-color: rgba(110, 160, 230, .34) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(56, 189, 248, .5), rgba(139, 92, 246, .5));
  border-radius: 99px; border: 2px solid transparent; background-clip: padding-box;
}

/* -------------------------------------------------------------- background */
.bg-stage { position: fixed; inset: 0; z-index: -3; overflow: hidden; background: var(--bg-0); }
.bg-stage::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(59, 130, 246, .20), transparent 60%),
    radial-gradient(900px 600px at 8% 12%, rgba(34, 211, 238, .12), transparent 62%),
    radial-gradient(900px 700px at 60% 108%, rgba(168, 85, 247, .14), transparent 60%),
    linear-gradient(180deg, #04060d 0%, #050915 40%, #04060d 100%);
}
.bg-grid {
  position: absolute; inset: -10%;
  background-image:
    linear-gradient(rgba(120, 170, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 170, 255, .05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(80% 60% at 50% 20%, #000 20%, transparent 80%);
  transform: perspective(600px) rotateX(46deg) translateY(-6%);
  animation: gridDrift 26s linear infinite;
}
@keyframes gridDrift { to { background-position: 0 64px, 64px 0; } }
.blob {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5;
  mix-blend-mode: screen; will-change: transform;
}
.blob.b1 { width: 620px; height: 620px; left: -160px; top: -180px; background: radial-gradient(circle, #0ea5e9, transparent 65%); animation: blobFloat 22s var(--ease) infinite alternate; }
.blob.b2 { width: 560px; height: 560px; right: -140px; top: 8%; background: radial-gradient(circle, #7c3aed, transparent 65%); animation: blobFloat 27s var(--ease) infinite alternate-reverse; }
.blob.b3 { width: 480px; height: 480px; left: 34%; bottom: -260px; background: radial-gradient(circle, #06b6d4, transparent 65%); animation: blobFloat 19s var(--ease) infinite alternate; }
@keyframes blobFloat {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(40px, 60px, 0) scale(1.08); }
  100% { transform: translate3d(-30px, 20px, 0) scale(.94); }
}
.bg-noise {
  position: absolute; inset: 0; opacity: .35; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.cursor-glow {
  position: fixed; width: 520px; height: 520px; border-radius: 50%; pointer-events: none; z-index: -1;
  background: radial-gradient(circle, rgba(56, 189, 248, .10), transparent 62%);
  transform: translate(-50%, -50%); transition: opacity .4s; opacity: 0;
}

/* ---------------------------------------------------------------- layout */
.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: 22px; }
.page-main { padding-top: calc(var(--header-h) + 26px); padding-bottom: 80px; min-height: 100vh; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.center { display: grid; place-items: center; }
.stack { display: grid; gap: 18px; }
.grid { display: grid; gap: 18px; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); }
.muted { color: var(--ink-3); }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.text-grad {
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-fill-color: transparent;
}
.text-gold { color: var(--gold); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }

/* --------------------------------------------------------------- typography */
.h1 { font-size: clamp(34px, 5.4vw, 68px); line-height: 1.02; font-weight: 800; letter-spacing: -.035em; }
.h2 { font-size: clamp(24px, 3.1vw, 38px); line-height: 1.12; font-weight: 800; letter-spacing: -.025em; }
.h3 { font-size: clamp(19px, 2.1vw, 24px); line-height: 1.2; font-weight: 750; letter-spacing: -.015em; }
.h4 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--aqua);
}
.eyebrow::before {
  content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--grad-brand);
}
.lead { color: var(--ink-2); font-size: clamp(15px, 1.4vw, 17px); line-height: 1.65; }

/* ----------------------------------------------------------------- buttons */
.btn {
  --btn-bg: rgba(24, 34, 62, .78);
  --btn-bd: rgba(138, 180, 255, .18);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 44px; padding: 0 20px; border-radius: var(--r-pill);
  background: var(--btn-bg); border: 1px solid var(--btn-bd);
  font-weight: 650; font-size: 14px; letter-spacing: .01em; color: var(--ink);
  overflow: hidden; isolation: isolate;
  transition: transform .22s var(--ease-bounce), box-shadow .25s var(--ease), border-color .25s, background .25s;
  -webkit-tap-highlight-color: transparent;
}
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, .22) 50%, transparent 80%);
  transform: translateX(-120%); transition: opacity .3s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--stroke-hi); box-shadow: 0 14px 34px -16px rgba(56, 189, 248, .6); }
.btn:hover::after { opacity: 1; animation: sheen .8s var(--ease); }
@keyframes sheen { from { transform: translateX(-120%); } to { transform: translateX(120%); } }
.btn:active { transform: translateY(0) scale(.985); }
.btn[disabled], .btn.is-loading { opacity: .55; pointer-events: none; }
.btn-primary {
  background: var(--grad-brand); border: 0; color: #041018; font-weight: 800;
  box-shadow: 0 10px 30px -12px rgba(56, 189, 248, .75), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn-primary:hover { box-shadow: 0 18px 44px -14px rgba(34, 211, 238, .85), inset 0 1px 0 rgba(255, 255, 255, .45); }
.btn-gold { background: var(--grad-gold); color: #241a02; font-weight: 800; border: 0; box-shadow: 0 10px 30px -14px rgba(251, 191, 36, .8); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { color: var(--ink); background: rgba(120, 170, 255, .08); }
.btn-outline { background: transparent; border: 1px solid var(--stroke-hi); }
.btn-danger { background: rgba(251, 113, 133, .12); border-color: rgba(251, 113, 133, .4); color: #ffd7dd; }
.btn-success { background: rgba(52, 211, 153, .14); border-color: rgba(52, 211, 153, .4); color: #ccffe9; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 12.5px; gap: 6px; }
.btn-lg { height: 54px; padding: 0 30px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: 42px; height: 42px; padding: 0; border-radius: 50%; }
.btn .spinner { width: 16px; height: 16px; border-width: 2px; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .22); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ cards */
.card {
  position: relative; border-radius: var(--r-lg);
  background: linear-gradient(165deg, rgba(23, 33, 61, .82), rgba(10, 15, 30, .86));
  border: 1px solid var(--stroke); box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), transparent 42%);
}
.card-pad { padding: 22px; }
.card-hover { transition: transform .34s var(--ease), box-shadow .34s var(--ease), border-color .3s; }
.card-hover:hover { transform: translateY(-5px); border-color: var(--stroke-hi); box-shadow: var(--shadow-lg), 0 0 40px -18px rgba(56, 189, 248, .55); }
.glass-soft { background: rgba(18, 26, 48, .5); border: 1px solid var(--stroke); border-radius: var(--r-md); }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head .h2 { margin-top: 6px; }

/* ----------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: var(--r-pill); font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  background: rgba(120, 170, 255, .1); border: 1px solid var(--stroke); color: var(--ink-2);
  white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.badge-live { color: #7ff3d1; background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .3); }
.badge-gold { color: #ffe9a8; background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .32); }
.badge-violet { color: #e2d4ff; background: rgba(139, 92, 246, .16); border-color: rgba(139, 92, 246, .34); }
.badge-red { color: #ffd4da; background: rgba(251, 113, 133, .12); border-color: rgba(251, 113, 133, .32); }
.badge-cyan { color: #c8f6ff; background: rgba(34, 211, 238, .12); border-color: rgba(34, 211, 238, .3); }

/* rarity colours (shared with server lib/rarities.js) */
:root {
  --rar-common: #93a4b8;
  --rar-uncommon: #4ade80;
  --rar-rare: #38bdf8;
  --rar-epic: #a78bfa;
  --rar-legendary: #fbbf24;
  --rar-mythic: #fb7185;
  --rar-divine: #f5d0fe;
}
.rar-common { --rar: var(--rar-common); }
.rar-uncommon { --rar: var(--rar-uncommon); }
.rar-rare { --rar: var(--rar-rare); }
.rar-epic { --rar: var(--rar-epic); }
.rar-legendary { --rar: var(--rar-legendary); }
.rar-mythic { --rar: var(--rar-mythic); }
.rar-divine { --rar: var(--rar-divine); }
.rar-tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--rar, var(--ink-2));
  background: color-mix(in srgb, var(--rar, #93a4b8) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--rar, #93a4b8) 38%, transparent);
}

/* ------------------------------------------------------------------ forms */
.field { display: grid; gap: 7px; }
.label { font-size: 12px; font-weight: 650; letter-spacing: .04em; color: var(--ink-3); text-transform: uppercase; }
.input, .select, .textarea {
  width: 100%; height: 46px; padding: 0 15px; border-radius: var(--r-sm);
  background: rgba(8, 13, 27, .72); border: 1px solid var(--stroke);
  color: var(--ink); transition: border-color .2s, box-shadow .2s, background .2s;
}
.textarea { height: auto; min-height: 118px; padding: 13px 15px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input:hover, .select:hover, .textarea:hover { border-color: rgba(148, 178, 230, .26); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: rgba(56, 189, 248, .62);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, .12); background: rgba(10, 16, 33, .9);
}
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-right: 96px; }
.input-suffix { position: absolute; right: 6px; display: flex; gap: 4px; }
.chip-btn {
  height: 34px; padding: 0 11px; border-radius: 9px; font-size: 12px; font-weight: 700;
  background: rgba(120, 170, 255, .1); border: 1px solid var(--stroke); color: var(--ink-2);
  transition: all .18s;
}
.chip-btn:hover { background: rgba(56, 189, 248, .18); color: #fff; border-color: var(--stroke-hi); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { appearance: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 6px; border: 1px solid var(--stroke-hi); background: rgba(8, 13, 27, .8); position: relative; flex: none; cursor: pointer; }
.check input:checked { background: var(--grad-brand); border-color: transparent; }
.check input:checked::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 900; color: #06121c; }
.hint { font-size: 12px; color: var(--ink-4); }
.err { font-size: 12.5px; color: #ffb3bd; }
.form-error {
  padding: 10px 14px; border-radius: var(--r-sm); font-size: 13px;
  background: rgba(251, 113, 133, .1); border: 1px solid rgba(251, 113, 133, .3); color: #ffd7dd;
}

/* segmented control */
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: var(--r-pill); background: rgba(8, 13, 27, .7); border: 1px solid var(--stroke); }
.seg button {
  height: 34px; padding: 0 14px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 650; color: var(--ink-3);
  transition: all .2s var(--ease);
}
.seg button:hover { color: var(--ink); }
.seg button.active { background: var(--grad-brand); color: #04121b; font-weight: 800; box-shadow: 0 6px 18px -8px rgba(56, 189, 248, .8); }

/* ------------------------------------------------------------------ header */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 70; height: var(--header-h);
  display: flex; align-items: center;
  background: rgba(5, 9, 20, .62); border-bottom: 1px solid transparent;
  backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
  transition: background .3s, border-color .3s, box-shadow .3s;
}
.site-header.scrolled { background: rgba(4, 8, 18, .88); border-color: var(--stroke); box-shadow: 0 18px 40px -30px #000; }
.header-inner { display: flex; align-items: center; gap: 22px; width: 100%; }
.logo { display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: -.03em; font-size: 21px; }
.logo-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--grad-brand); box-shadow: 0 8px 24px -10px rgba(56, 189, 248, .9); }
.logo-mark svg { width: 22px; height: 22px; }
.logo b { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.main-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  position: relative; height: 38px; display: inline-flex; align-items: center; gap: 7px; padding: 0 13px;
  border-radius: var(--r-pill); font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  transition: color .2s, background .2s;
}
.nav-link svg { width: 16px; height: 16px; opacity: .8; }
.nav-link:hover { color: #fff; background: rgba(120, 170, 255, .09); }
.nav-link.active { color: #fff; background: rgba(56, 189, 248, .13); box-shadow: inset 0 0 0 1px rgba(56, 189, 248, .25); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.wallet-pill {
  display: flex; align-items: center; gap: 9px; height: 42px; padding: 0 6px 0 14px;
  border-radius: var(--r-pill); background: rgba(9, 15, 30, .8); border: 1px solid var(--stroke);
  transition: border-color .2s, box-shadow .2s;
}
.wallet-pill:hover { border-color: var(--stroke-hi); box-shadow: 0 0 0 4px rgba(56, 189, 248, .06); }
.wallet-pill .cur { color: var(--aqua); font-weight: 800; }
.wallet-amount { font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: -.01em; }
.wallet-plus {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 900;
  background: var(--grad-brand); color: #05121b; font-size: 17px; line-height: 1;
}
.user-menu {
  display: flex; align-items: center; gap: 9px; height: 42px; padding: 0 12px 0 5px;
  border-radius: var(--r-pill); background: rgba(9, 15, 30, .8); border: 1px solid var(--stroke);
  transition: all .2s;
}
.user-menu:hover { border-color: var(--stroke-hi); background: rgba(15, 24, 46, .9); }
.avatar { border-radius: 50%; overflow: hidden; flex: none; background: rgba(120, 170, 255, .12); display: grid; place-items: center; }
.avatar svg { width: 100%; height: 100%; }
.user-menu .avatar { width: 32px; height: 32px; }
.user-name { font-size: 13px; font-weight: 650; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown { position: relative; }
.dropdown-panel {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 232px; padding: 8px;
  border-radius: var(--r-md); background: rgba(9, 14, 28, .97); border: 1px solid var(--stroke);
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-8px) scale(.97); pointer-events: none;
  transition: opacity .2s var(--ease), transform .24s var(--ease-bounce); z-index: 90;
  backdrop-filter: blur(22px);
}
.dropdown.open .dropdown-panel { opacity: 1; transform: none; pointer-events: auto; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  font-size: 13.5px; color: var(--ink-2); transition: background .16s, color .16s; width: 100%; text-align: left;
}
.dropdown-item:hover { background: rgba(120, 170, 255, .1); color: #fff; }
.dropdown-item svg { width: 16px; height: 16px; opacity: .75; }
.dropdown-sep { height: 1px; margin: 6px 4px; background: var(--stroke); }
.burger { display: none; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--stroke); background: rgba(9, 15, 30, .8); }
.burger span { display: block; width: 18px; height: 2px; margin: 4px auto; background: var(--ink); border-radius: 2px; transition: .3s; }
.mobile-drawer {
  position: fixed; inset: var(--header-h) 0 auto 0; z-index: 69; padding: 16px 18px 22px;
  background: rgba(5, 9, 20, .98); border-bottom: 1px solid var(--stroke);
  transform: translateY(-110%); transition: transform .35s var(--ease); backdrop-filter: blur(24px);
  display: grid; gap: 6px;
}
.mobile-drawer.open { transform: none; }
.mobile-drawer .nav-link { height: 46px; border-radius: 12px; }
.mobile-drawer .btn { margin-top: 8px; }

/* -------------------------------------------------------------- reveal anim */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .06s; }
.reveal[data-delay="2"] { transition-delay: .12s; }
.reveal[data-delay="3"] { transition-delay: .18s; }
.reveal[data-delay="4"] { transition-delay: .24s; }
.reveal[data-delay="5"] { transition-delay: .3s; }

/* ---------------------------------------------------------------- toasts */
.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: grid; gap: 10px; width: min(360px, calc(100vw - 36px)); }
.toast {
  position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px;
  border-radius: var(--r-md); background: rgba(10, 16, 32, .96); border: 1px solid var(--stroke);
  box-shadow: var(--shadow-lg); font-size: 13.5px; color: var(--ink-2);
  animation: toastIn .45s var(--ease-bounce);
  overflow: hidden;
}
.toast::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--grad-brand); animation: toastBar 4.6s linear forwards; }
.toast.ok::after { background: var(--grad-success); }
.toast.err::after { background: var(--grad-danger); }
.toast .t-icon { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; background: rgba(56, 189, 248, .14); color: var(--aqua); font-weight: 900; }
.toast.ok .t-icon { background: rgba(52, 211, 153, .14); color: var(--green); }
.toast.err .t-icon { background: rgba(251, 113, 133, .14); color: var(--red); }
.toast .t-title { font-weight: 700; color: var(--ink); margin-bottom: 1px; }
.toast .t-close { margin-left: auto; color: var(--ink-4); font-size: 18px; line-height: 1; padding: 0 2px; }
@keyframes toastIn { from { transform: translateX(30px) scale(.96); opacity: 0; } }
@keyframes toastBar { from { width: 100%; } to { width: 0; } }

/* ---------------------------------------------------------------- modals */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px;
  background: rgba(2, 5, 12, .72); backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease);
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  width: min(520px, 100%); max-height: min(88vh, 900px);
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--r-xl); background: linear-gradient(165deg, #121b34, #0a0f20 65%);
  border: 1px solid var(--stroke-hi); box-shadow: var(--shadow-lg), 0 0 90px -40px rgba(56, 189, 248, .6);
  transform: translateY(18px) scale(.97); transition: transform .38s var(--ease-bounce);
  position: relative;
}
.modal-backdrop.open .modal { transform: none; }
.modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px 22px 12px; flex: none; }
.modal-body { padding: 6px 22px 24px; overflow-y: auto; overscroll-behavior: contain; }
.modal-foot {
  flex: none; padding: 14px 22px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--stroke); background: rgba(9, 14, 28, .92);
  backdrop-filter: blur(12px);
}
.modal-close { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(120, 170, 255, .08); color: var(--ink-2); font-size: 20px; }
.modal-close:hover { background: rgba(251, 113, 133, .16); color: #ffd7dd; }

/* ----------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--stroke); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.tbl th {
  text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-4);
  font-weight: 700; padding: 12px 14px; background: rgba(8, 13, 27, .6); border-bottom: 1px solid var(--stroke);
  white-space: nowrap;
}
.tbl td { padding: 12px 14px; border-bottom: 1px solid rgba(148, 178, 230, .07); color: var(--ink-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .16s; }
.tbl tbody tr:hover { background: rgba(120, 170, 255, .05); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------- skeleton */
.skel { position: relative; overflow: hidden; background: rgba(120, 170, 255, .08); border-radius: var(--r-sm); }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .09), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* -------------------------------------------------------------- misc parts */
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--stroke), transparent); }
.kpi { display: grid; gap: 4px; }
.kpi .v { font-size: clamp(20px, 2.6vw, 28px); font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi .k { font-size: 11.5px; color: var(--ink-4); text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
.pill-list { display: flex; gap: 8px; flex-wrap: wrap; }
.empty-state { display: grid; place-items: center; gap: 10px; padding: 46px 20px; text-align: center; color: var(--ink-3); }
.empty-state svg { width: 54px; height: 54px; opacity: .4; }
.spin-once { animation: spin .8s var(--ease); }
.fade-in { animation: fadeIn .5s var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } }
.pop-in { animation: popIn .45s var(--ease-bounce); }
@keyframes popIn { from { transform: scale(.86); opacity: 0; } }

/* toast/notification dot */
.dot-live { position: relative; }
.dot-live::after {
  content: ""; position: absolute; top: -2px; right: -2px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 3px rgba(52, 211, 153, .2); animation: pulseDot 2s infinite;
}
@keyframes pulseDot { 50% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); } }

/* ------------------------------------------------------------------ footer */
.site-footer {
  position: relative; margin-top: 40px; padding: 46px 0 34px; border-top: 1px solid var(--stroke);
  background: linear-gradient(180deg, transparent, rgba(4, 8, 18, .7));
}
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 30px; }
.footer-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .16em; color: var(--ink-4); font-weight: 700; margin-bottom: 12px; }
.footer-link { display: block; padding: 5px 0; color: var(--ink-3); font-size: 13.5px; transition: color .16s, transform .16s; }
.footer-link:hover { color: var(--aqua); transform: translateX(3px); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--stroke); font-size: 12.5px; color: var(--ink-4); }
.age-badge { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 2px solid rgba(251, 113, 133, .55); color: #ffd7dd; font-weight: 900; font-size: 13px; }

/* ------------------------------------------------------------------- chat */
.chat-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 120; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; background: var(--grad-brand); color: #04121b;
  box-shadow: 0 18px 40px -14px rgba(34, 211, 238, .9); transition: transform .28s var(--ease-bounce);
}
.chat-fab:hover { transform: scale(1.08) rotate(-4deg); }
.chat-fab svg { width: 25px; height: 25px; }
.chat-fab .unread {
  position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center;
  border: 2px solid #050912;
}
.chat-panel {
  position: fixed; right: 20px; bottom: 88px; z-index: 121; width: min(390px, calc(100vw - 40px));
  height: min(560px, calc(100vh - 130px)); display: flex; flex-direction: column;
  border-radius: var(--r-lg); overflow: hidden;
  background: rgba(8, 13, 27, .97); border: 1px solid var(--stroke-hi); box-shadow: var(--shadow-lg);
  transform: translateY(18px) scale(.97); opacity: 0; pointer-events: none;
  transition: transform .34s var(--ease-bounce), opacity .26s; backdrop-filter: blur(22px);
}
.chat-panel.open { transform: none; opacity: 1; pointer-events: auto; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--stroke); }
.chat-body { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { display: flex; gap: 9px; align-items: flex-start; animation: fadeIn .3s var(--ease); }
.chat-msg .avatar { width: 28px; height: 28px; }
.chat-bubble { background: rgba(120, 170, 255, .08); border: 1px solid rgba(148, 178, 230, .1); border-radius: 4px 12px 12px 12px; padding: 7px 11px; font-size: 13px; color: var(--ink-2); max-width: 260px; word-break: break-word; }
.chat-msg.mine .chat-bubble { background: rgba(56, 189, 248, .14); border-color: rgba(56, 189, 248, .25); color: #eaf6ff; }
.chat-name { font-size: 11.5px; font-weight: 750; color: var(--aqua); margin-bottom: 1px; }
.chat-msg.admin .chat-name { color: var(--gold); }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--stroke); }
.chat-form .input { height: 40px; }

/* --------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .main-nav { display: none; }
  .burger { display: block; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  :root { --header-h: 64px; }
  .shell { padding-inline: 15px; }
  .page-main { padding-top: calc(var(--header-h) + 16px); }
  .user-name, .wallet-label { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .modal { border-radius: 22px; }
  .chat-panel { right: 10px; left: 10px; width: auto; bottom: 82px; }
  .toast-stack { right: 10px; left: 10px; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------- splash */
.splash {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center;
  background: radial-gradient(70% 70% at 50% 40%, rgba(34, 211, 238, .10), transparent 70%), #04060d;
  transition: opacity .55s var(--ease), visibility .55s;
}
.splash.done { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-inner { display: grid; justify-items: center; gap: 16px; transform: translateY(-8px); }
.splash-drop { width: 74px; height: 74px; animation: splashPulse 1.8s ease-in-out infinite; filter: drop-shadow(0 12px 30px rgba(56, 189, 248, .55)); }
.splash-drop svg { width: 100%; height: 100%; }
@keyframes splashPulse { 50% { transform: translateY(-6px) scale(1.05); } }
.splash-logo { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.splash-logo b { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.splash-bar { width: 190px; height: 4px; border-radius: 99px; background: rgba(120, 170, 255, .14); overflow: hidden; }
.splash-bar i { display: block; height: 100%; width: 40%; border-radius: 99px; background: var(--grad-brand); animation: splashBar 1.2s var(--ease) infinite; }
@keyframes splashBar { 0% { transform: translateX(-110%); } 100% { transform: translateX(320%); } }
.splash-hint { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-4); font-weight: 650; }
body.bare-page .splash { display: none; }
