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

html, body { background-color: #1f1e1c; }

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}


:root {
     --c-canvas: #1f1e1c;
     --c-surface: #262624;
     --c-surface-2: #2d2c2a;
     --c-border: rgba(255, 255, 255, 0.08);
     --c-border-hi: rgba(255, 255, 255, 0.14);
     --c-ink: #fdfcfa;
     --c-subtle: #a8a7a0;
     --c-muted: #87867f;
     --c-accent: #ffb547;
     --c-on-accent: #1f1408;
     --c-danger: #ff453a;
     --r-sm: 8px;
     --r-md: 10px;
     --r-lg: 14px;
     --r-card: 20px;
     --r-pill: 9999px;

     --canvas:   #1f1e1c;
     --surface:  #262624;
     --surface2: #2d2c2a;
     --border:   rgba(255, 255, 255, 0.08);
     --border-hi:rgba(255, 255, 255, 0.14);
     --muted:    #87867f;
     --subtle:   #a8a7a0;
     --ink:      #fdfcfa;
     --accent:   #ffb547;
     --accent2:  #e89211;
     --gold:     #b5730a;
     --success:  #5ac8fa;
     --warn:     #ffd60a;
     --danger:   #ff453a;
     --on-accent:#1f1408;
     --ray:      0 0 0 1px rgba(255, 255, 255, 0.06), 0 8px 24px rgba(0, 0, 0, 0.32);
     --glow:     0 0 24px rgba(255, 181, 71, 0.40);

     --c-canvas:    #1f1e1c;
     --c-surface:   #262624;
     --c-surface-2: #2d2c2a;
     --c-border:    rgba(255, 255, 255, 0.08);
     --c-border-hi: rgba(255, 255, 255, 0.14);
     --c-ink:       #fdfcfa;
     --c-subtle:    #a8a7a0;
     --c-muted:     #87867f;
     --c-placeholder: #6b6a64;
     --c-accent:    #ffb547;
     --c-accent-2:  #e89211;
     --c-gold-deep: #b5730a;
     --c-on-accent: #1f1408;
     --c-info:      #5ac8fa;
     --c-warn:      #ffd60a;
     --c-danger:    #ff453a;
     --r-sm:    8px;
     --r-md:    10px;
     --r-lg:    14px;
     --r-xl:    16px;
     --r-card:  20px;
     --r-pill:  9999px;
     --shadow-ray:   0 0 0 1px rgba(255,255,255,0.06), 0 8px 24px rgba(0,0,0,0.32);
     --shadow-glow:  0 0 24px rgba(255,181,71,0.40);
     --shadow-cta:   0 0 0 1px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.35) inset, 0 6px 20px rgba(232,146,17,0.45);
     --shadow-focus: 0 0 0 3px rgba(255,181,71,0.22);
     
 }
 *, *::before, *::after { box-sizing: border-box; }
 html, body { margin: 0; min-height: 100%; }
 body {
     background-color: var(--c-canvas);
     color: var(--c-ink);
     font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
     font-size: 14px;
     line-height: 1.5;
     -webkit-font-smoothing: antialiased;
 }
 a { color: var(--c-accent); text-decoration: none; }
 a:hover { color: #ffc365; }
 button { font-family: inherit; cursor: pointer; }
 .pill { border-radius: var(--r-pill); }
 /* App shell: column-flex with sticky header */
 .rf-app { min-height: 100vh; display: flex; flex-direction: column; }
 .rf-nav {
     position: sticky; top: 0; z-index: 50;
     height: 64px;
     background-color: rgba(31, 30, 28, 0.80);
     border-bottom: 1px solid var(--c-border);
     backdrop-filter: saturate(180%) blur(12px);
     -webkit-backdrop-filter: saturate(180%) blur(12px);
 }
 .rf-nav-inner {
     height: 100%;
     max-width: 1280px;
     margin: 0 auto;
     padding: 0 24px;
     display: flex; align-items: center; gap: 16px;
 }
 .rf-main {
     flex: 1 1 auto;
     display: grid;
     grid-template-columns: 1fr;
     gap: 24px;
     padding: 24px;
     max-width: 1280px;
     width: 100%;
     margin: 0 auto;
 }
 .rf-main.has-sidebar { grid-template-columns: 240px 1fr; }
 @media (max-width: 768px) {
     .rf-main.has-sidebar { grid-template-columns: 1fr; }
 }
 /* Brand mark: 32px gold square with initial */
 .rf-brand-mark {
     display: inline-flex; align-items: center; justify-content: center;
     width: 32px; height: 32px;
     border-radius: var(--r-sm);
     background: linear-gradient(180deg, #ffb547 0%, #b5730a 100%);
     color: var(--c-on-accent);
     font-weight: 800; font-size: 16px;
     box-shadow: 0 0 24px rgba(255,181,71,0.40);
 }
 .rf-nav-links { display: flex; align-items: center; gap: 4px; }
 .rf-nav-link {
     padding: 8px 12px;
     color: var(--c-subtle);
     border-radius: var(--r-md);
     font-size: 13px;
     font-weight: 500;
 }
 .rf-nav-link:hover { color: var(--c-ink); background-color: rgba(255,255,255,0.05); }
 .rf-nav-spacer { flex: 1 1 auto; }
 .rf-stats-pill {
     display: inline-flex; align-items: center; gap: 12px;
     padding: 6px 14px;
     background-color: var(--c-surface);
     border: 1px solid var(--c-border);
     border-radius: var(--r-pill);
     color: var(--c-ink);
     font-size: 13px;
     font-variant-numeric: tabular-nums;
 }
 .rf-stats-pill strong { font-weight: 600; color: var(--c-accent); }
 .rf-user-chip {
     display: inline-flex; align-items: center; gap: 8px;
     padding: 4px 12px 4px 4px;
     background-color: var(--c-surface);
     border: 1px solid var(--c-border);
     border-radius: var(--r-pill);
     color: var(--c-ink);
     font-size: 13px; font-weight: 500;
 }
 .rf-user-avatar {
     width: 28px; height: 28px;
     border-radius: 9999px;
     background: linear-gradient(180deg, #ffb547 0%, #e89211 100%);
     color: var(--c-on-accent);
     display: inline-flex; align-items: center; justify-content: center;
     font-weight: 700; font-size: 13px;
 }
 .rf-btn-logout {
     display: inline-flex; align-items: center;
     padding: 8px 14px;
     background-color: rgba(255,69,58,0.10);
     color: var(--c-danger);
     border: 1px solid rgba(255,69,58,0.25);
     border-radius: var(--r-pill);
     font-size: 13px; font-weight: 500;
 }
 .rf-btn-logout:hover { background-color: rgba(255,69,58,0.18); color: #ff6e64; }
 /* Sidebar */
 .rf-sidebar { display: flex; flex-direction: column; gap: 4px; }
 .rf-side-item {
     display: flex; align-items: center; gap: 10px;
     padding: 8px 12px;
     color: var(--c-subtle);
     border-radius: var(--r-md);
     font-size: 13px; font-weight: 500;
     transition: background-color 120ms ease, color 120ms ease;
 }
 .rf-side-item:hover {
     background-color: rgba(255,255,255,0.05);
     color: var(--c-ink);
 }
 .rf-side-item.active {
     background: linear-gradient(180deg, rgba(255,181,71,0.14) 0%, rgba(232,146,17,0.06) 100%);
     color: var(--c-ink);
     box-shadow: 0 0 0 1px rgba(255,181,71,0.28) inset;
 }
 /* Banner alerts (success/failure) */
 .rf-banner {
     padding: 12px 14px;
     border-radius: var(--r-lg);
     font-size: 13px;
     margin-bottom: 16px;
     display: flex; align-items: flex-start; gap: 10px;
 }
 .rf-banner.is-error {
     background-color: rgba(255,69,58,0.08);
     border: 1px solid rgba(255,69,58,0.30);
     color: #ff6e64;
 }
 .rf-banner.is-success {
     background-color: rgba(90,200,250,0.08);
     border: 1px solid rgba(90,200,250,0.30);
     color: var(--c-info);
 }
 .rf-banner-close {
     margin-left: auto;
     background: transparent;
     border: 0;
     color: var(--c-subtle);
     padding: 4px;
     border-radius: var(--r-sm);
     cursor: pointer;
 }
 .rf-banner-close:hover { color: var(--c-ink); background-color: rgba(255,255,255,0.05); }
 
/* ---------- Font ---------- */

/* ---------- Shape utilities ---------- */

.pill { border-radius: 9999px; }

/* ---------- Scrollbar ---------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); }

/* ---------- Buttons ---------- */

.btn-raycast-primary {
    background: linear-gradient(180deg, #ffb547 0%, #e89211 100%);
    color: #1f1408;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.4),
                0 1px 0 rgba(255,255,255,0.35) inset,
                0 6px 20px rgba(232,146,17,0.45);
    transition: background 140ms ease;
}
.btn-raycast-primary:hover:not(:disabled) {
    background: linear-gradient(180deg, #ffc365 0%, #f0a021 100%);
}
.btn-raycast-primary:disabled {
    background: rgba(255,255,255,0.04);
    color: #6b6a64;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.06) inset;
    cursor: not-allowed;
}

.btn-raycast-secondary {
    background: rgba(255,255,255,0.06);
    color: #fdfcfa;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset;
    transition: background 140ms ease;
}
.btn-raycast-secondary:hover { background: rgba(255,255,255,0.10); }

/* ---------- Inputs ---------- */

.ray-input {
    background-color: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fdfcfa;
    border-radius: 12px;
    transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}
.ray-input::placeholder { color: #6b6a64; }
.ray-input:focus {
    outline: none;
    border-color: #ffb547;
    box-shadow: 0 0 0 3px rgba(255,181,71,0.22);
    background-color: rgba(255,255,255,0.06);
}
.ray-input.is-valid {
    border-color: rgba(90,200,250,0.45);
    background-color: rgba(90,200,250,0.04);
}
.ray-input.is-invalid {
    border-color: rgba(255,69,58,0.45);
    background-color: rgba(255,69,58,0.04);
}

/* Hide native number-input spinners — cleaner Raycast look */
input[type=number].no-spin::-webkit-outer-spin-button,
input[type=number].no-spin::-webkit-inner-spin-button {
    -webkit-appearance: none; margin: 0;
}
input[type=number].no-spin { -moz-appearance: textfield; }

/* ---------- Sidebar ---------- */

.side-item {
    color: #a8a7a0;
    border-radius: 10px;
    transition: background-color 120ms ease, color 120ms ease;
}
.side-item:hover {
    background-color: rgba(255,255,255,0.05);
    color: #fdfcfa;
}
.side-item.active {
    background: linear-gradient(180deg, rgba(255,181,71,0.14) 0%, rgba(232,146,17,0.06) 100%);
    color: #fdfcfa;
    box-shadow: 0 0 0 1px rgba(255,181,71,0.28) inset;
}

/* ---------- Tabs — underline style (account.html) ---------- */

.tab-link {
    color: #a8a7a0;
    border-bottom: 2px solid transparent;
    transition: color 120ms ease, border-color 120ms ease;
}
.tab-link:hover { color: #fdfcfa; }
.tab-link.active {
    color: #fdfcfa;
    border-bottom-color: #ffb547;
}

/* ---------- Tabs — segmented pill style (pay.html) ---------- */

.tab-pill {
    color: #a8a7a0;
    background-color: transparent;
    transition: background-color 120ms ease, color 120ms ease;
}
.tab-pill:hover { color: #fdfcfa; background-color: rgba(255,255,255,0.04); }
.tab-pill.active {
    color: #1f1408;
    background: linear-gradient(180deg, #ffb547 0%, #e89211 100%);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.4),
                0 1px 0 rgba(255,255,255,0.35) inset;
}

/* ---------- Chips ---------- */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    background: rgba(90,200,250,0.12);
    color: #5ac8fa;
    box-shadow: 0 0 0 1px rgba(90,200,250,0.25) inset;
    cursor: pointer;
    transition: background-color 120ms ease;
}
.chip:hover { background: rgba(90,200,250,0.20); }

/* ---------- Preset chip (tbank.html) ---------- */

.preset-chip {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: #a8a7a0;
    border-radius: 9999px;
    transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
    cursor: pointer;
}
.preset-chip:hover {
    background: rgba(255,255,255,0.08);
    color: #fdfcfa;
    border-color: rgba(255,255,255,0.14);
}
.preset-chip.active {
    background: rgba(255,181,71,0.12);
    color: #ffb547;
    border-color: rgba(255,181,71,0.35);
}

/* ---------- Bonus tier card (tbank.html) ---------- */

.tier-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    transition: background 160ms ease, border-color 160ms ease,
                transform 160ms ease, box-shadow 160ms ease;
}
.tier-card.reached {
    background: linear-gradient(180deg, rgba(255,181,71,0.12) 0%, rgba(232,146,17,0.04) 100%);
    border-color: rgba(255,181,71,0.40);
    box-shadow: 0 0 0 1px rgba(255,181,71,0.20) inset,
                0 6px 18px rgba(232,146,17,0.18);
    transform: translateY(-1px);
}

.tier-bar-bg {
    background: rgba(255,255,255,0.06);
    border-radius: 9999px;
    overflow: hidden;
}
.tier-bar-fill {
    background: linear-gradient(90deg, #ffb547 0%, #e89211 100%);
    height: 100%;
    transition: width 220ms ease;
}

/* ---------- Result summary (tbank.html) ---------- */

.result-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

/* ---------- Amount input with suffix (tbank.html) ---------- */

.amount-wrap { position: relative; }
.amount-wrap > .amount-suffix {
    position: absolute;
    top: 0; bottom: 0; right: 0;
    display: flex; align-items: center;
    padding-right: 1rem;
    color: #87867f;
    font-weight: 600;
    pointer-events: none;
}

/* ---------- Pay-method card (pay.html) ---------- */

.pay-method {
    background-color: #262624;
    border: 1px solid rgba(255,255,255,0.08);
    color: #fdfcfa;
    border-radius: 14px;
    transition: background-color 140ms ease, border-color 140ms ease,
                transform 140ms ease, box-shadow 140ms ease;
}
.pay-method:hover {
    background-color: #2d2c2a;
    border-color: rgba(255,181,71,0.35);
    box-shadow: 0 0 0 1px rgba(255,181,71,0.20),
                0 6px 18px rgba(0,0,0,0.30);
    transform: translateY(-1px);
}
.pay-method .pay-arrow {
    color: #87867f;
    transition: color 140ms ease, transform 140ms ease;
}
.pay-method:hover .pay-arrow {
    color: #ffb547;
    transform: translateX(2px);
}

/* ---------- Brand glow (signup.html) ---------- */

.brand-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 480px;
    height: 320px;
    margin-left: -240px;
    margin-top: -160px;
    background: radial-gradient(ellipse at center,
        rgba(255,181,71,0.22) 0%,
        rgba(255,181,71,0.08) 35%,
        transparent 70%);
    pointer-events: none;
    z-index: 0;
    filter: blur(2px);
}

/* ---------- Live form preview pill (signup.html) ---------- */

.login-preview {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #ffb547;
}

/* ---------- Password strength meter (signup.html) ---------- */

.strength-track {
    background: rgba(255,255,255,0.06);
    border-radius: 9999px;
    overflow: hidden;
}
.strength-seg {
    height: 100%;
    transition: background-color 200ms ease, width 200ms ease;
}
.strength-seg.weak   { background: #ff453a; }
.strength-seg.fair   { background: #ffd60a; }
.strength-seg.good   { background: #5ac8fa; }
.strength-seg.strong { background: linear-gradient(90deg, #ffb547, #e89211); }

/* ---------- Tables (chars.html, stat.html) ---------- */

.rf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.rf-table thead th {
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: #87867f;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.rf-table tbody td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: #a8a7a0;
    vertical-align: middle;
}
.rf-table tbody tr:last-child td { border-bottom: 0; }
.rf-table tbody tr {
    transition: background-color 120ms ease;
}
.rf-table tbody tr:hover {
    background-color: rgba(255,255,255,0.02);
}
.rf-table tbody tr:hover td { color: #fdfcfa; }

/* Numbered rank cell */
.rf-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border-radius: 9999px;
    background: rgba(255,255,255,0.04);
    color: #a8a7a0;
    font-weight: 600;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}
.rf-rank.top-1 {
    background: linear-gradient(135deg, #ffb547, #e89211);
    color: #1f1408;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.4) inset;
}
.rf-rank.top-2 {
    background: linear-gradient(135deg, #d6d6d3, #a8a7a0);
    color: #1f1408;
}
.rf-rank.top-3 {
    background: linear-gradient(135deg, #d2915b, #8a5a2b);
    color: #fdfcfa;
}

/* Level / value chips in tables */
.rf-level {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    border-radius: 9999px;
    background: rgba(90,200,250,0.10);
    color: #5ac8fa;
    box-shadow: 0 0 0 1px rgba(90,200,250,0.25) inset;
}

/* Inline link inside a table cell */
.rf-table a.rf-link {
    color: #ffb547;
    font-weight: 500;
    transition: color 120ms ease;
}
.rf-table a.rf-link:hover { color: #ffc365; }

/* Danger action button (delete) */
.rf-action-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    background: rgba(255,69,58,0.10);
    color: #ff453a;
    box-shadow: 0 0 0 1px rgba(255,69,58,0.25) inset;
    transition: background-color 120ms ease, color 120ms ease;
    cursor: pointer;
}
.rf-action-danger:hover {
    background: rgba(255,69,58,0.18);
    color: #ff6e64;
}

/* Race/sex icons in stat.html — small circular swatches */
.rf-race {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}
.rf-race-icon {
    width: 20px;
    height: 20px;
    border-radius: 9999px;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.12) inset;
    background-size: cover;
    background-position: center;
}
.rf-race-icon.bellato   { background: linear-gradient(135deg, #5ac8fa, #0a84ff); }
.rf-race-icon.cora      { background: linear-gradient(135deg, #ff6363, #d93760); }
.rf-race-icon.accretia  { background: linear-gradient(135deg, #ffd60a, #b5730a); }
.rf-race-icon.male      { background: linear-gradient(135deg, #87867f, #5a5953); }
.rf-race-icon.female    { background: linear-gradient(135deg, #fdfcfa, #a8a7a0); }

/* Guild name chip */
.rf-guild {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    background: rgba(255,255,255,0.04);
    color: #fdfcfa;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset;
}

/* Info well (legend block under tables) */
.rf-info {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    color: #a8a7a0;
    font-size: 0.8125rem;
}
.rf-info ul { list-style: disc; padding-left: 1.25rem; }
.rf-info ul li { margin-bottom: 0.25rem; }
.rf-info b { color: #fdfcfa; font-weight: 600; }
.rf-info .accent { color: #ff453a; }

/* Empty-state cells */
.rf-table .muted-cell { color: #6b6a64; }

/* ---------- Coupon input (coupon.html) ---------- */

.coupon-wrap {
    position: relative;
}
.coupon-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.coupon-input::placeholder {
    text-transform: none;
    letter-spacing: 0;
    font-family: 'Inter', system-ui, sans-serif;
}
.coupon-icon {
    position: absolute;
    top: 0; bottom: 0; left: 0;
    display: flex; align-items: center;
    padding-left: 0.875rem;
    color: #87867f;
    pointer-events: none;
}
.coupon-wrap .ray-input:focus ~ .coupon-icon,
.coupon-wrap .ray-input:focus + .coupon-actions + .coupon-icon { /* fallback if order differs */
    color: #ffb547;
}
/* Focus color for icon: use :has on the wrap */
.coupon-wrap:has(.ray-input:focus) .coupon-icon { color: #ffb547; }

.coupon-actions {
    position: absolute;
    top: 0; bottom: 0; right: 0;
    display: flex; align-items: center; gap: 0.5rem;
    padding-right: 0.875rem;
    color: #87867f;
}
.coupon-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border-radius: 9999px;
    background: rgba(255,255,255,0.06);
    color: #a8a7a0;
    transition: background-color 120ms ease, color 120ms ease;
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset;
}
.coupon-clear:hover {
    background: rgba(255,255,255,0.12);
    color: #fdfcfa;
}

/* Help-list bullets for "where to find coupons" block */
.help-list {
    list-style: none;
    padding: 0; margin: 0;
}
.help-list > li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: #a8a7a0;
    font-size: 0.875rem;
}
.help-list > li + li { margin-top: 0.5rem; }
.help-bullet {
    flex: none;
    margin-top: 0.125rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px; height: 16px;
    border-radius: 9999px;
    background: rgba(255,181,71,0.15);
    color: #ffb547;
}

/* ---------- Profile input with leading icon (profile.html) ---------- */

.profile-input-wrap {
    position: relative;
}
.profile-input-icon {
    position: absolute;
    top: 0; bottom: 0; left: 0;
    display: flex; align-items: center;
    padding-left: 0.875rem;
    color: #87867f;
    pointer-events: none;
    transition: color 120ms ease;
}
.profile-input-wrap:has(.ray-input:focus) .profile-input-icon { color: #ffb547; }
.profile-input {
    padding-left: 2.5rem;
}
.profile-input-action {
    position: absolute;
    top: 0; bottom: 0; right: 0;
    display: flex; align-items: center; justify-content: center;
    padding-right: 0.75rem;
    color: #87867f;
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: color 120ms ease;
}
.profile-input-action:hover { color: #fdfcfa; }
/* ─── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1f1e1c;
    color: #fdfcfa;
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; padding: 0; }
code, .mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; }
.num { font-variant-numeric: tabular-nums; }

/* ─── Generic helpers ───────────────────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}
.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.stack { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }

/* ─── Top nav ───────────────────────────────────────────────── */
.topnav {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(31, 30, 28, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.topnav-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 64px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--gold));
    color: var(--on-accent);
    font-weight: 800;
    box-shadow: var(--glow);
    box-shadow: 0 0 0 1px rgba(255, 214, 10, 0.3), 0 0 24px rgba(255, 181, 71, 0.4);
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    border: 1px solid var(--border);
}
.pill .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
}
.pill .dot.gold  { background: var(--accent2); }
.pill .dot.blue  { background: var(--success); }
.pill .dot.yellow{ background: var(--warn); }

.topnav .sep {
    width: 1px;
    height: 14px;
    background: var(--border-hi);
}
.topnav .balance {
    display: flex;
    align-items: center;
    gap: 12px;
}
.topnav .balance strong {
    color: var(--ink);
}
.topnav .balance .label {
    color: var(--muted);
}
.topnav .balance .buy {
    color: var(--accent);
    font-weight: 500;
    padding-left: 4px;
}
.topnav .balance .buy:hover { color: #ffc365; }

.stat-menu {
    position: relative;
}
.stat-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    color: var(--subtle);
    font-size: 13px;
    border-radius: 8px;
}
.stat-menu-btn:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.05);
}
.stat-menu-list {
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 4px;
    min-width: 220px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--ray);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 120ms ease;
    z-index: 40;
}
.stat-menu:hover .stat-menu-list,
.stat-menu:focus-within .stat-menu-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.stat-menu-list a {
    display: block;
    padding: 6px 10px;
    font-size: 13px;
    color: var(--subtle);
    border-radius: 8px;
}
.stat-menu-list a:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.05);
}

.topnav-spacer { flex: 1; }

.topnav .me {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--subtle);
    font-size: 13px;
}
.topnav .me .ava {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--gold));
    color: var(--on-accent);
    font-weight: 800;
    font-size: 12px;
}
.topnav .logout {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 999px;
}
.topnav .logout:hover { background: rgba(255, 255, 255, 0.1); }

/* ─── Layout ────────────────────────────────────────────────── */
.layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    padding: 32px 0 80px;
}
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .topnav-balance { display: none; }
    .topnav-stat-menu { display: none; }
}

/* ─── Sidebar ───────────────────────────────────────────────── */
.sidebar { position: sticky; top: 80px; align-self: start; }
.sidenav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--ray);
}
.sidenav a {
    display: block;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--subtle);
    border-radius: 8px;
    font-weight: 500;
}
.sidenav a:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.04);
}
.sidenav a.active {
    color: var(--ink);
    background: rgba(255, 181, 71, 0.10);
    box-shadow: inset 0 0 0 1px rgba(255, 181, 71, 0.25);
}

/* ─── Card ──────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--ray);
    overflow: hidden;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}
.card-header h2 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.01em;
}
.card-header .sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}
.card-body { padding: 20px 24px; }

/* ─── Hero ──────────────────────────────────────────────────── */
.hero { padding: 24px; }
.hero-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.ava-lg {
    position: relative;
    display: inline-flex;
}
.ava-lg .main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), var(--gold));
    color: var(--on-accent);
    font-weight: 800;
    font-size: 24px;
    box-shadow: var(--glow);
    box-shadow: 0 0 0 1px rgba(255, 214, 10, 0.3), 0 0 24px rgba(255, 181, 71, 0.4);
}
.ava-lg .lvl {
    position: absolute;
    bottom: -2px;
    right: -2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--success);
    color: #06243d;
    font-weight: 700;
    font-size: 11px;
    box-shadow: 0 0 0 2px var(--surface);
}
.hero-meta {
    flex: 1;
    min-width: 200px;
}
.hero-meta .hello {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
}
.hero-meta .hello .sep-dot {
    width: 4px; height: 4px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}
.hero-meta h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 2px 0 0;
    letter-spacing: -0.02em;
}
.hero-meta .progress-text {
    font-size: 13px;
    color: var(--subtle);
    margin-top: 6px;
}
.hero-meta .progress-text strong { color: var(--ink); font-weight: 600; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 999px;
    background: rgba(90, 200, 250, 0.1);
    color: var(--success);
    border: 1px solid rgba(90, 200, 250, 0.25);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.badge-gold {
    background: rgba(255, 181, 71, 0.10);
    color: var(--accent);
    border-color: rgba(255, 181, 71, 0.25);
}
.badge-blue {
    background: rgba(90, 200, 250, 0.15);
    color: var(--success);
    border-color: rgba(90, 200, 250, 0.25);
}
.badge-warn {
    background: rgba(255, 214, 10, 0.15);
    color: var(--warn);
    border-color: rgba(255, 214, 10, 0.25);
}

/* ─── Stats grid ────────────────────────────────────────────── */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--border);
}
@media (max-width: 720px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
}
.stat {
    display: block;
    padding: 16px 24px;
    border-right: 1px solid var(--border);
    transition: background-color 120ms ease;
}
.stat:last-child { border-right: 0; }
.stat:hover { background: rgba(255, 255, 255, 0.02); }
.stat .label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}
.stat .label .dot { width: 6px; height: 6px; border-radius: 50%; }
.stat .value {
    font-size: 24px;
    font-weight: 700;
    margin-top: 4px;
    letter-spacing: -0.02em;
}
.stat .value .small {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
    margin-left: 2px;
}
.stat .hint {
    font-size: 11px;
    color: var(--muted);
    margin-top: 4px;
}
.stat:hover .hint.hover-accent  { color: var(--accent); }
.stat:hover .hint.hover-blue    { color: var(--success); }
.stat:hover .hint.hover-yellow  { color: var(--warn); }

/* ─── 2-column body ─────────────────────────────────────────── */
.row-2 {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
    margin-top: 24px;
}
.row-2-equal {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 24px;
    margin-top: 24px;
}
@media (max-width: 900px) {
    .row-2, .row-2-equal { grid-template-columns: 1fr; }
}

/* ─── Progress bar ──────────────────────────────────────────── */
.progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 6px;
}
.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 999px;
}

/* ─── Quest list ────────────────────────────────────────────── */
.quests { list-style: none; margin: 0; padding: 4px 0; }
.quest {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
}
.quest:last-child { border-bottom: 0; }
.quest a {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 12px 20px;
    border-radius: 0;
}
.quest a:hover { background: rgba(255, 255, 255, 0.03); }
.quest-icon {
    flex-shrink: 0;
    margin-top: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: transparent;
}
.quest.done .quest-icon {
    background: rgba(90, 200, 250, 0.15);
    border-color: rgba(90, 200, 250, 0.3);
    color: var(--success);
}
.quest-body {
    flex: 1;
    min-width: 0;
}
.quest-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
}
.quest.done .quest-title {
    color: var(--subtle);
    text-decoration: line-through;
}
.quest-desc {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}
.quest-cta {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--accent);
    font-weight: 500;
    margin-top: 1px;
    transition: transform 120ms ease;
}
.quest a:hover .quest-cta { transform: translateX(2px); }
.quest-status-done {
    color: var(--success);
}

/* ─── Security card ─────────────────────────────────────────── */
.security-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 181, 71, 0.15);
    color: var(--accent);
}
.field-label {
    font-size: 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}
.field-value {
    font-size: 13px;
    color: var(--ink);
    margin-top: 4px;
}
.field-meta {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}
.ip-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.ip-row code {
    font-size: 13px;
    color: var(--ink);
}
.field-not-set {
    color: var(--accent);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--ink);
    transition: background-color 120ms ease, transform 120ms ease;
}
.btn:hover { background: rgba(255, 255, 255, 0.1); }
.btn-primary {
    background: linear-gradient(180deg, var(--accent), var(--accent2));
    color: var(--on-accent);
    border-color: transparent;
    box-shadow: 0 0 0 1px rgba(255, 214, 10, 0.3), 0 8px 20px rgba(255, 181, 71, 0.25);
}
.btn-primary:hover {
    background: linear-gradient(180deg, #ffc365, var(--accent));
}
.btn-block { display: flex; width: 100%; }

/* ─── Characters grid ───────────────────────────────────────── */
.char-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 12px;
}
.char {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    border-radius: 12px;
    background: var(--canvas);
    border: 1px solid var(--border);
    transition: border-color 120ms ease;
    position: relative;
}
.char:hover { border-color: rgba(255, 181, 71, 0.4); }
.char.filled:hover .char-name { color: var(--accent); }
.char-ava {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: white;
    font-size: 12px;
    font-weight: 700;
}
.char-ava.blue   { background: linear-gradient(135deg, var(--success), #0a84ff); }
.char-ava.red    { background: linear-gradient(135deg, #ff6363, #d93760); }
.char-name {
    font-size: 11px;
    font-weight: 500;
    color: var(--ink);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 120ms ease;
}
.char-lvl {
    font-size: 10px;
    color: var(--muted);
}
.char-empty {
    border-style: dashed;
    color: var(--muted);
}
.char-empty:hover { color: var(--accent); border-color: rgba(255, 181, 71, 0.4); }
.char-empty svg { width: 20px; height: 20px; }

.card-footer-link {
    padding: 10px 24px;
    border-top: 1px solid var(--border);
    background: var(--canvas);
    font-size: 11px;
}
.card-footer-link a {
    color: var(--subtle);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.card-footer-link a:hover { color: var(--accent); }

/* ─── News feed ─────────────────────────────────────────────── */
.news-list { list-style: none; margin: 0; padding: 0; }
.news-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    transition: background-color 120ms ease;
}
.news-item:last-child { border-bottom: 0; }
.news-item:hover { background: rgba(255, 255, 255, 0.02); }
.news-ico {
    flex-shrink: 0;
    margin-top: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
}
.news-ico.gold  { background: linear-gradient(135deg, var(--accent), var(--gold)); color: var(--on-accent); }
.news-ico.blue  { background: rgba(90, 200, 250, 0.15); color: var(--success); }
.news-ico.gray  { background: rgba(255, 255, 255, 0.06); color: var(--subtle); }
.news-ico svg { width: 16px; height: 16px; }
.news-body { flex: 1; min-width: 0; }
.news-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}
.news-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.news-tag.tournament { background: rgba(255, 214, 10, 0.15); color: var(--warn); }
.news-tag.update     { background: rgba(90, 200, 250, 0.15); color: var(--success); }
.news-tag.reminder   { background: rgba(255, 255, 255, 0.06); color: var(--subtle); }
.news-time { font-size: 11px; color: var(--muted); }
.news-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
}
.news-text {
    font-size: 12px;
    color: var(--subtle);
    margin-top: 4px;
    line-height: 1.55;
}
.news-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--accent);
    margin-top: 6px;
}
.news-link:hover { color: #ffc365; }

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 999px;
    background: rgba(255, 181, 71, 0.10);
    color: var(--accent);
    border: 1px solid rgba(255, 181, 71, 0.25);
}
.live-pill .dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
    animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

/* ─── Lang switcher ─────────────────────────────────────────── */
.lang {
    display: flex;
    justify-content: center;
    margin-top: 56px;
}
.lang-menu {
    position: relative;
}
.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--subtle);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
}
.lang-btn:hover { color: var(--ink); }
.lang-btn .chev {
    transition: transform 150ms ease;
}
.lang-menu.open .lang-btn .chev { transform: rotate(180deg); }
.lang-list {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    min-width: 160px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--ray);
    opacity: 0;
    visibility: hidden;
    transition: all 120ms ease;
    z-index: 40;
}
.lang-menu.open .lang-list {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.lang-list a {
    display: block;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--subtle);
    border-radius: 8px;
}
.lang-list a:hover {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.05);
}
.lang-list a.active {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.05);
    font-weight: 500;
}

/* ─── Misc ──────────────────────────────────────────────────── */
.ico { width: 14px; height: 14px; flex-shrink: 0; }
.ico-sm { width: 12px; height: 12px; flex-shrink: 0; }
.ico-md { width: 16px; height: 16px; flex-shrink: 0; }
