/* Premium Customizer (/profile/customizer, 2026-10-26).
   Same look as the other public pages (global_leaderboard.html): warm gray
   #0f0e0d, blue #5b78f7, flat cards. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0f0e0d; --card: #171615; --card-2: #1d1c1a; --line: rgba(255,255,255,.07);
  --text: #e9e8e7; --muted: #88857f; --blue: #5b78f7; --blue-2: #8ba4f2;
  --gold: #facc15; --red: #f87171; --green: #4ade80;
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .85em; background: rgba(255,255,255,.06); padding: .05rem .3rem; border-radius: .3rem; }
a { color: var(--blue-2); }
.ambient { position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse 70% 40% at 50% -5%, rgba(91,120,247,.16) 0%, transparent 60%); }
.blue { background: linear-gradient(135deg, #8ba4f2 0%, #5b78f7 50%, #4a62e8 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── nav (as on the leaderboard page) ── */
#nav { position: fixed; inset: 0 0 auto; z-index: 100; height: 66px; display: flex; align-items: center;
  background: rgba(15,14,13,.92); border-bottom: 1px solid rgba(255,255,255,.06);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.nav-wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: center; gap: 2.5rem; }
.nav-logo { display: flex; align-items: center; gap: .65rem; text-decoration: none; flex-shrink: 0; }
.nav-logo img { width: 34px; height: 34px; border-radius: 8px; border: 1px solid rgba(91,120,247,.35); }
.nav-logo-name { font-size: .95rem; font-weight: 700; color: #fff; letter-spacing: -.02em; }
.nav-links { display: flex; align-items: center; gap: 1.75rem; list-style: none; margin-left: 1rem; }
.nav-links a { font-size: .84rem; font-weight: 500; color: var(--muted); text-decoration: none; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: .75rem; margin-left: auto; }
.nav-burger { display: none; background: none; border: none; cursor: pointer; color: var(--text); padding: .4rem; margin-left: auto; }
#mobile-menu { display: none; position: fixed; inset: 66px 0 auto; z-index: 99; background: rgba(15,14,13,.98);
  border-bottom: 1px solid rgba(255,255,255,.06); padding: 1rem 1.5rem 1.5rem; }
#mobile-menu.open { display: block; }
#mobile-menu a { display: block; padding: .7rem 0; font-size: .95rem; font-weight: 500; color: var(--muted);
  text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.05); }

/* ── buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: none; cursor: pointer;
  font-family: inherit; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background .2s, border-color .2s, opacity .2s; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-sm { font-size: .8rem; padding: .5rem 1rem; border-radius: .5rem; }
.btn-md { font-size: .9rem; padding: .7rem 1.5rem; border-radius: .6rem; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover:not(:disabled) { background: #4a62e8; }
.btn-gold { background: var(--gold); color: #1a1405; }
.btn-gold:hover { background: #fde047; }
.btn-outline { background: rgba(255,255,255,.04); color: var(--text); border: 1px solid rgba(255,255,255,.1); }
.btn-outline:hover:not(:disabled) { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); }
.btn-ghost { background: none; color: var(--muted); border: 1px solid transparent; }
.btn-ghost:hover:not(:disabled) { color: var(--text); }

/* ── page ── */
.page-wrap { position: relative; z-index: 1; padding-top: 66px; }
.page { max-width: 1140px; margin: 0 auto; padding: 2.5rem 1.5rem 7rem; }
.page-hero { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.75rem; }
.page-badge { align-self: flex-start; display: inline-flex; align-items: center; gap: .6rem; padding: .35rem .9rem .35rem .6rem;
  background: rgba(250,204,21,.08); border: 1px solid rgba(250,204,21,.25); border-radius: 99px;
  font-size: .75rem; font-weight: 600; color: #fde68a; }
.page-badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.page-title { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 900; letter-spacing: -.04em; line-height: 1.08; color: #fff; }
.page-sub { font-size: .92rem; color: var(--muted); line-height: 1.7; max-width: 44rem; }

.status { align-self: flex-start; font-size: .8rem; font-weight: 600; padding: .4rem .8rem; border-radius: .5rem;
  border: 1px solid var(--line); background: var(--card); color: var(--muted); }
.status-ok { color: #fde68a; border-color: rgba(250,204,21,.3); background: rgba(250,204,21,.07); }
.status-off { color: var(--muted); }
.status-warn { color: #fdba74; border-color: rgba(251,146,60,.3); background: rgba(251,146,60,.07); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 1rem; padding: 1.4rem; }
.card h2 { font-size: 1.05rem; font-weight: 800; color: #fff; letter-spacing: -.01em; margin-bottom: .35rem; }
.center-card { text-align: center; max-width: 30rem; margin: 2rem auto; display: flex; flex-direction: column; gap: .9rem; align-items: center; }
.center-card p { color: var(--muted); font-size: .9rem; line-height: 1.6; }
.hint { font-size: .82rem; color: var(--muted); line-height: 1.6; margin-bottom: 1rem; }
.hint.small { font-size: .76rem; margin: .9rem 0 0; }

.banner { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 1rem 1.2rem; border-radius: .9rem; margin-bottom: 1.25rem; font-size: .86rem; line-height: 1.55; }
.banner strong { color: #fff; margin-right: .3rem; }
.banner-lock { background: rgba(250,204,21,.06); border: 1px solid rgba(250,204,21,.22); color: #d6d3d1; }
.banner-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* a section = controls next to their preview; stacked on phones */
.section { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 1.25rem; margin-bottom: 1.25rem; align-items: start; }
.section-preview { position: sticky; top: 84px; }
.preview-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .55rem; }
.preview-note { font-size: .74rem; color: var(--muted); margin-top: .55rem; line-height: 1.5; }

.label { display: block; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.1rem 0 .45rem; }
.label small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.input { width: 100%; background: var(--bg); border: 1px solid rgba(255,255,255,.1); color: var(--text); border-radius: .5rem;
  padding: .55rem .75rem; font-family: inherit; font-size: .84rem; outline: none; transition: border-color .2s; }
.input:focus { border-color: rgba(91,120,247,.6); }
.input-row { display: flex; gap: .5rem; }
.row-btns { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.bg-state { font-size: .78rem; color: var(--muted); margin-top: .55rem; min-height: 1.1em; }
.bg-state.changed { color: #fde68a; }

.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: .6rem; background: var(--bg); border: 1px solid var(--line); }
.seg-btn { border: none; background: none; color: var(--muted); font-family: inherit; font-size: .8rem; font-weight: 600;
  padding: .42rem .9rem; border-radius: .45rem; cursor: pointer; }
.seg-btn.active { background: rgba(91,120,247,.15); color: var(--blue-2); }

.presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: .45rem; }
.preset { aspect-ratio: 1.41; border-radius: .45rem; overflow: hidden; border: 2px solid transparent; cursor: pointer; padding: 0; background: var(--bg); }
.preset img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preset.selected { border-color: var(--blue); }
.preset:disabled { cursor: not-allowed; opacity: .55; }

/* switches */
.switch-row { display: flex; gap: 1rem; align-items: center; justify-content: space-between; margin-top: 1.3rem;
  padding-top: 1.1rem; border-top: 1px solid var(--line); }
.switch-row-first { margin-top: .6rem; padding-top: 0; border-top: none; }
.switch-title { display: block; font-size: .88rem; font-weight: 700; color: #fff; }
.switch-help { display: block; font-size: .78rem; color: var(--muted); line-height: 1.55; margin-top: .2rem; }
.switch { position: relative; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track { display: block; width: 44px; height: 24px; border-radius: 99px; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1); position: relative; transition: .2s; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: .2s; }
.switch input:checked + .track { background: rgba(91,120,247,.3); border-color: rgba(91,120,247,.6); }
.switch input:checked + .track::after { transform: translateX(20px); background: #fff; }
.switch input:focus-visible + .track { outline: 2px solid var(--blue-2); outline-offset: 2px; }
.switch input:disabled, .switch input:disabled + .track { cursor: not-allowed; opacity: .55; }

/* name colour */
.color-row { display: flex; gap: .5rem; align-items: center; }
.color-row input[type="color"] { width: 42px; height: 36px; border: 1px solid rgba(255,255,255,.1); border-radius: .5rem; background: var(--bg); padding: 3px; cursor: pointer; }
.input-hex { width: 7.5rem; font-family: ui-monospace, Consolas, monospace; }
.swatches { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch.selected { border-color: #fff; }
.swatch:disabled { cursor: not-allowed; opacity: .55; }
.field-error { font-size: .78rem; color: var(--red); margin-top: .45rem; }

/* ── rank card preview: same grid as the bot (1350 × 957, utils/rank_card.py) ── */
.rankcard { position: relative; width: 100%; aspect-ratio: 1350 / 957; border-radius: .8rem; overflow: hidden;
  background: #111; border: 1px solid var(--line); container-type: inline-size; }
.rc-bg, .rc-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.rc-bg { object-fit: cover; }
.rc-avatar { position: absolute; left: 3.33%; top: 12.5%; width: 8.15%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; background: #222; }
.rc-name { position: absolute; left: 20.2%; top: 14.8%; display: flex; align-items: center; gap: .6cqw;
  font-weight: 900; font-size: 3.7cqw; line-height: 1; color: #e6e4f5; text-transform: uppercase; letter-spacing: .02em;
  text-shadow: 0 .15cqw .4cqw rgba(0,0,0,.6); max-width: 55%; }
.rc-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-vip { width: 3.4cqw; height: 3.4cqw; }
.rc-lvl { position: absolute; top: 43.3%; transform: translateY(-50%); font-weight: 800; font-size: 2.45cqw; color: #e6e4f5; }

/* ── leaderboard row preview (global_leaderboard.html) ── */
.lb-preview { border-radius: 1rem; overflow: hidden; border: 1px solid var(--line); background: rgba(255,255,255,.015); }
.lb-row { display: grid; grid-template-columns: 36px 42px minmax(0,1fr) auto auto; gap: .8rem; align-items: center; padding: .9rem 1.1rem; background: rgba(15,14,13,.35); }
.lb-rank { font-size: .85rem; font-weight: 700; color: var(--muted); }
.lb-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: #222; }
.lb-name-row { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; min-width: 0; }
.lb-name { font-size: .88rem; font-weight: 700; color: #e9e8e7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 12rem; }
.lb-sub { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.lb-stat { font-size: .88rem; font-weight: 700; text-align: right; white-space: nowrap; }
.lb-stat small { color: var(--muted); font-weight: 500; font-size: .72rem; }
.premium-badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; font-size: .68rem; font-weight: 600;
  color: var(--gold); background: rgba(250,204,21,.1); border: 1px solid rgba(250,204,21,.25); border-radius: 99px; }
.premium-badge img { width: 12px; height: 12px; }

/* ── Discord message preview ── */
.dc-msg { display: flex; gap: .85rem; padding: 1rem; border-radius: .9rem; background: #313338; border: 1px solid rgba(0,0,0,.2); }
.dc-bot { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.dc-body { min-width: 0; flex: 1; }
.dc-head { display: flex; align-items: center; gap: .35rem; margin-bottom: .35rem; }
.dc-botname { font-weight: 600; font-size: .9rem; color: #f2f3f5; }
.dc-tag { font-size: .6rem; font-weight: 700; background: #5865f2; color: #fff; padding: 1px 4px; border-radius: 3px; }
.dc-embed { border-left: 4px solid #4CAF50; background: #2b2d31; border-radius: 4px; padding: .7rem .9rem; }
.dc-title { font-weight: 700; font-size: .9rem; color: #f2f3f5; margin-bottom: .35rem; }
.dc-text { font-size: .84rem; color: #dbdee1; line-height: 1.6; }
.dc-mention { background: rgba(88,101,242,.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; }
.dc-vip { width: 18px; height: 18px; vertical-align: -4px; margin-left: 4px; }

/* ── XP preview ── */
.xp-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .6rem; }
.xp-cell { background: var(--card); border: 1px solid var(--line); border-radius: .8rem; padding: .85rem 1rem; display: flex; flex-direction: column; gap: .2rem; }
.xp-cat { font-size: .78rem; color: var(--muted); font-weight: 600; }
.xp-val { font-size: 1.15rem; font-weight: 800; color: #fff; }
.xp-val .x2 { font-size: .72rem; font-weight: 700; color: var(--gold); margin-left: .35rem; }
.xp-unit { font-size: .72rem; color: var(--muted); }

.stats-card .cmd-list { list-style: none; display: flex; flex-direction: column; gap: .55rem; margin-bottom: 1rem; }
.stats-card .cmd-list li { display: flex; gap: .7rem; align-items: baseline; flex-wrap: wrap; font-size: .84rem; }
.stats-card .cmd-list span { color: var(--muted); }
.link { font-size: .84rem; font-weight: 600; text-decoration: none; }

/* locked = Premium missing: everything visible, nothing changeable */
.locked .section-controls { opacity: .75; }

/* ── save bar ── */
.savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
  background: rgba(15,14,13,.94); border-top: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.savebar-inner { max-width: 1140px; margin: 0 auto; padding: 0 .5rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.savebar-msg { font-size: .84rem; color: var(--muted); }
.savebar-msg.dirty { color: #fde68a; font-weight: 600; }
.savebar-msg.ok { color: var(--green); }
.savebar-msg.err { color: var(--red); }
.savebar-btns { display: flex; gap: .5rem; flex-wrap: wrap; }

@media (max-width: 1024px) {
  .nav-links { display: none; }
  .nav-right { display: none; }
  .nav-burger { display: flex; }
}
@media (max-width: 860px) {
  .section { grid-template-columns: minmax(0, 1fr); }
  .section-preview { position: static; }
}
@media (max-width: 520px) {
  .page { padding: 1.75rem 1rem 9rem; }
  .card { padding: 1.1rem; }
  .lb-row { grid-template-columns: 28px 36px minmax(0,1fr) auto; }
  .lb-row .lb-stat:last-child { display: none; }
  .lb-avatar { width: 36px; height: 36px; }
  .savebar-inner { flex-direction: column; align-items: stretch; }
  .savebar-btns { justify-content: stretch; }
  .savebar-btns .btn { flex: 1; }
  .input-row { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
