/* ============================================================================
   Stake Code Claimer — Modern Glass Dark design system
   Single source of truth for all pages. Violet→azure, frosted glass, aurora.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    /* ── Surfaces ─────────────────────────────────────────────── */
    --bg:            #07080c;
    --bg-2:          #0a0c12;
    --surface:       rgba(255, 255, 255, 0.035);
    --surface-2:     rgba(255, 255, 255, 0.055);
    --surface-hover: rgba(255, 255, 255, 0.075);
    --glass-blur:    18px;

    /* ── Borders ──────────────────────────────────────────────── */
    --border:        rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);

    /* ── Accents ──────────────────────────────────────────────── */
    --accent:        #7b4bff;
    --accent-light:  #9b7bff;
    --accent-cyan:   #2ea6ff;
    --accent-dim:    rgba(123, 75, 255, 0.14);
    --grad:          linear-gradient(135deg, #7b4bff 0%, #2ea6ff 100%);
    --grad-soft:     linear-gradient(135deg, rgba(123,75,255,0.16), rgba(46,166,255,0.12));

    /* ── Text ─────────────────────────────────────────────────── */
    --text:          #eef0f6;
    --text-muted:    #9098ac;
    --text-dim:      #626a7e;

    /* ── Status ───────────────────────────────────────────────── */
    --green:         #4ade80;
    --green-bg:      rgba(74, 222, 128, 0.10);
    --red:           #fb7185;
    --red-bg:        rgba(251, 113, 133, 0.10);
    --yellow:        #facc15;
    --yellow-bg:     rgba(250, 204, 21, 0.10);
    --blue:          #38bdf8;

    /* ── Geometry ─────────────────────────────────────────────── */
    --r-sm:  9px;
    --r-md:  13px;
    --r-lg:  18px;
    --r-xl:  24px;

    /* ── Shadow / glow ────────────────────────────────────────── */
    --shadow:      0 12px 40px rgba(0, 0, 0, 0.45);
    --shadow-lg:   0 24px 70px rgba(0, 0, 0, 0.6);
    --glow-accent: 0 0 40px rgba(123, 75, 255, 0.32);
    --glow-cyan:   0 0 40px rgba(46, 166, 255, 0.28);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --mono: 'SF Mono', 'Fira Code', ui-monospace, 'Cascadia Code', monospace;
}

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* ── Aurora background ────────────────────────────────────────── */
/* Add <div class="aurora"><span></span><span></span><span></span></div> once per page */
.aurora {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: radial-gradient(1200px 600px at 50% -10%, rgba(123,75,255,0.10), transparent 70%);
}
.aurora span {
    position: absolute;
    display: block;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
    animation: drift 22s ease-in-out infinite;
}
.aurora span:nth-child(1) { width: 520px; height: 520px; top: -140px; left: -120px; background: #7b4bff; }
.aurora span:nth-child(2) { width: 460px; height: 460px; bottom: -160px; right: -100px; background: #2ea6ff; animation-delay: -7s; opacity: 0.35; }
.aurora span:nth-child(3) { width: 380px; height: 380px; top: 40%; left: 55%; background: #4f2bd9; animation-delay: -14s; opacity: 0.3; }

@keyframes drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(40px, -30px) scale(1.08); }
    66%      { transform: translate(-30px, 40px) scale(0.94); }
}

@media (prefers-reduced-motion: reduce) {
    .aurora span { animation: none; }
    * { animation-duration: 0.001ms !important; transition-duration: 0.06s !important; }
}

/* ── Typography ───────────────────────────────────────────────── */
h1, h2, h3 { font-weight: 800; letter-spacing: -0.02em; color: #fff; line-height: 1.2; }
h1 { font-size: clamp(28px, 5vw, 44px); }
h2 { font-size: clamp(22px, 3vw, 30px); }
h3 { font-size: 18px; }
a  { color: var(--accent-light); text-decoration: none; transition: color 0.15s; }
a:hover { color: #fff; }

.text-grad {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.muted { color: var(--text-muted); }
.dim   { color: var(--text-dim); }
.mono  { font-family: var(--mono); }

/* ── Glass card ───────────────────────────────────────────────── */
.card, .glass {
    background: var(--surface);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}
.card-hover { transition: transform 0.2s cubic-bezier(.4,0,.2,1), border-color 0.2s, background 0.2s; }
.card-hover:hover { transform: translateY(-3px); border-color: var(--border-strong); background: var(--surface-2); }

.card-title {
    display: flex; align-items: center; gap: 9px;
    font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 16px;
}

/* ── Buttons ──────────────────────────────────────────────────── */
button, .btn {
    font-family: inherit; font-size: 15px; font-weight: 600;
    color: #fff; cursor: pointer; border: none;
    padding: 13px 22px; border-radius: var(--r-sm);
    background: var(--grad); background-size: 160% 160%;
    transition: transform 0.18s cubic-bezier(.4,0,.2,1), box-shadow 0.18s, opacity 0.18s, background-position 0.4s;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
button:hover:not(:disabled), .btn:hover:not(:disabled) {
    transform: translateY(-2px); box-shadow: 0 10px 26px rgba(123, 75, 255, 0.34); background-position: 100% 0;
}
button:active:not(:disabled), .btn:active:not(:disabled) { transform: translateY(0); }
button:disabled, .btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
button.block, .btn.block { width: 100%; }

.btn-ghost {
    background: var(--surface-2); color: var(--text);
    border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--border-strong); box-shadow: none; }

.btn-ghost-sm {
    background: var(--surface-2); color: var(--text);
    border: 1px solid var(--border); padding: 8px 14px; font-size: 13px; border-radius: var(--r-sm);
}
.btn-ghost-sm:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--border-strong); box-shadow: none; transform: none; }

.btn-danger { background: var(--red-bg); color: var(--red); border: 1px solid rgba(251,113,133,0.3); }
.btn-danger:hover:not(:disabled) { background: rgba(251,113,133,0.2); box-shadow: none; }

.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ── Forms ────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
label {
    display: block; font-size: 12px; font-weight: 600; color: var(--text-muted);
    margin-bottom: 7px; letter-spacing: 0.02em;
}
input, select, textarea {
    width: 100%; font-family: inherit; font-size: 15px; color: var(--text);
    padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-sm);
    background: rgba(0, 0, 0, 0.28); transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }
input:focus, select:focus, textarea:focus {
    outline: none; border-color: rgba(123, 75, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(123, 75, 255, 0.13); background: rgba(0, 0, 0, 0.4);
}

/* ── Badges / pills ───────────────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 100px;
    text-transform: uppercase; letter-spacing: 0.04em;
}
.badge-green  { background: var(--green-bg);  color: var(--green);  border: 1px solid rgba(74,222,128,0.25); }
.badge-red    { background: var(--red-bg);    color: var(--red);    border: 1px solid rgba(251,113,133,0.25); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); border: 1px solid rgba(250,204,21,0.25); }
.badge-accent { background: var(--accent-dim); color: var(--accent-light); border: 1px solid rgba(123,75,255,0.3); }

/* ── Notices ──────────────────────────────────────────────────── */
.notice { border-radius: var(--r-sm); padding: 12px 14px; font-size: 13px; line-height: 1.5; }
.notice.error   { background: var(--red-bg);    border: 1px solid rgba(251,113,133,0.22); color: var(--red); }
.notice.success { background: var(--green-bg);  border: 1px solid rgba(74,222,128,0.22);  color: var(--green); }
.notice.info    { background: var(--yellow-bg); border: 1px solid rgba(250,204,21,0.22);  color: var(--yellow); }

.error-notice { background: var(--red-bg); border: 1px solid rgba(251,113,133,0.22); color: var(--red); border-radius: var(--r-sm); padding: 12px 14px; font-size: 13px; }
.warn-notice  { background: var(--yellow-bg); border: 1px solid rgba(250,204,21,0.22); color: var(--yellow); border-radius: var(--r-sm); padding: 12px 14px; font-size: 13px; }
.info-text    { color: var(--text-muted); font-size: 13px; line-height: 1.6; }

/* ── Tables ───────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
    text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.05em; color: var(--text-dim); padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
td { padding: 12px; border-bottom: 1px solid rgba(255,255,255,0.05); color: var(--text); }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: var(--surface); }

/* ── Modal ────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(4, 5, 9, 0.72); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center; padding: 20px;
    animation: fade 0.2s ease;
}
.modal {
    background: var(--bg-2); border: 1px solid var(--border-strong);
    border-radius: var(--r-lg); padding: 28px; max-width: 460px; width: 100%;
    box-shadow: var(--shadow-lg); animation: pop 0.22s cubic-bezier(.4,0,.2,1);
}

/* ── Spinner ──────────────────────────────────────────────────── */
.loading, .spinner {
    display: inline-block; width: 16px; height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.14); border-left-color: var(--accent-light);
    border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: middle;
}

/* ── Animations ───────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop  { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.animate-rise { animation: rise 0.5s cubic-bezier(.4,0,.2,1) both; }

/* ── Utilities ────────────────────────────────────────────────── */
.hidden { display: none !important; }
.flex   { display: flex; }
.center { align-items: center; justify-content: center; }
.gap-2  { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.page-wrap { max-width: 1120px; margin: 0 auto; padding: 24px 20px 80px; }

/* ── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* ── Dashboard helpers (page header, stat tiles, grids, pills) ──── */
.page-header {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    flex-wrap: wrap; margin-bottom: 26px;
}
.page-header .ph-title { display: flex; align-items: center; gap: 12px; }
.page-header h1 { font-size: clamp(22px, 3vw, 30px); }
.page-header .ph-sub { color: var(--text-muted); font-size: 13.5px; margin-top: 2px; }
.brand-mark {
    position: relative; width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 19px; color: #fff;
    background: var(--bg-2); box-shadow: var(--glow-accent); isolation: isolate;
}
/* Signature: a slow conic gradient ring — the Stake Code Claimer mark. */
.brand-mark::before {
    content: ''; position: absolute; inset: -2px; border-radius: inherit; z-index: -1;
    background: conic-gradient(from 0deg, var(--accent), var(--accent-cyan), var(--accent-light), var(--accent));
    animation: markSpin 6s linear infinite;
}
.brand-mark::after {
    content: ''; position: absolute; inset: 1px; border-radius: 11px; z-index: -1; background: var(--bg-2);
}
@keyframes markSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .brand-mark::before { animation: none; } }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
    padding: 18px 20px; backdrop-filter: blur(var(--glass-blur));
}
.stat .stat-num { font-size: 28px; font-weight: 800; color: #fff; line-height: 1.1; }
.stat .stat-num.accent { color: var(--accent-light); }
.stat .stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); margin-top: 6px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
@media (max-width: 820px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.pulse-dot {
    display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--green);
    box-shadow: 0 0 0 0 rgba(74,222,128,0.6); animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
    0%   { box-shadow: 0 0 0 0 rgba(74,222,128,0.6); }
    70%  { box-shadow: 0 0 0 8px rgba(74,222,128,0); }
    100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

.copied { background: var(--green-bg) !important; color: var(--green) !important; border-color: rgba(74,222,128,0.3) !important; }
