/* ==================================================================== */
/*  NINJA BOOST — modern dark theme                                      */
/*  Deep black surfaces + dual CTA language:                             */
/*   • rouge-blanc  = solid red fill, white label (primary)              */
/*   • rouge-noir   = black fill, red border / red label (secondary)     */
/* ==================================================================== */

:root {
  --accent:       #ff2d3f;
  --accent-2:     #ff6b78;
  --accent-dark:  #c41020;
  --accent-bright:#ff4757;
  --accent-soft:  rgba(var(--accent-rgb), 0.12);
  --accent-ring:  rgba(var(--accent-rgb), 0.28);
  --on-accent:    #ffffff;
  --bg:           #050505;
  --bg-2:         #0c0c0c;
  --card:         #0f0f0f;
  --card-2:       #161616;
  --border:       #262026;
  --border-strong:#3a2a2e;
  --text:         #f5f5f5;
  --muted:        #9a9094;
  --ok:           #4ade80;
  --green:        #86efac;
  --red:          #ff7a85;
  --radius:       14px;
  --shadow:       0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-lg:    0 22px 56px rgba(0, 0, 0, 0.65);
  --disp: "Outfit", "Sora", system-ui, sans-serif;
  --body: "Sora", system-ui, sans-serif;
}

* {
  box-sizing: border-box; margin: 0; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
html, body { overflow-x: hidden; }
::selection { background: rgba(var(--accent-rgb), 0.40); color: #fff; }
button, a, .subtab, .auth-tab, .acc-btn, .ts-tab { -webkit-tap-highlight-color: transparent; }

body {
  font-family: var(--body);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(var(--accent-rgb), 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 40% 35% at 100% 50%, rgba(var(--accent-dark-rgb), 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 35% 30% at 0% 80%, rgba(var(--accent-rgb), 0.06) 0%, transparent 55%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* Scrollbars pick up the red accent so the chrome matches the theme. */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: 8px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-dark); }

/* ------------------------------------------------------------------ */
/* Footer watermark                                                   */
/* ------------------------------------------------------------------ */
.site-watermark {
  text-align: center; font-size: 12.5px; color: var(--muted);
  padding: 20px 16px 26px; line-height: 1.7;
}
.site-watermark a { color: var(--text); text-decoration: none; font-weight: 600; }
.site-watermark a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ */
/* Buttons — rouge-blanc (primary) + rouge-noir (ghost)               */
/* ------------------------------------------------------------------ */
.btn {
  border: 1px solid transparent; border-radius: 11px; padding: 10px 18px;
  font-family: var(--body); font-size: 14px; font-weight: 600;
  cursor: pointer; color: #fff; letter-spacing: 0.01em;
  transition: transform .12s ease, background .18s ease, opacity .15s ease,
              border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.985); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none !important; }

/* Rouge-blanc: solid red → white text */
.btn-primary {
  background: linear-gradient(165deg, var(--accent-bright) 0%, var(--accent) 45%, var(--accent-dark) 100%);
  color: var(--on-accent);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 8px 22px rgba(var(--accent-dark-rgb), 0.38);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(165deg, var(--accent-hi) 0%, var(--accent-bright) 40%, var(--accent) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16) inset,
    0 10px 28px rgba(var(--accent-rgb), 0.45);
}

/* Rouge-noir: black surface → red edge / label */
.btn-ghost {
  background: linear-gradient(180deg, #141414 0%, #0a0a0a 100%);
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  color: var(--accent-2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}
.btn-ghost:hover:not(:disabled) {
  color: #fff;
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.18) 0%, #0a0a0a 100%);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.15), 0 6px 18px rgba(0, 0, 0, 0.35);
}

.btn-block { width: 100%; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn-large { padding: 15px 22px; font-size: 16px; }
.btn-mini { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-danger {
  background: linear-gradient(165deg, var(--accent-hi) 0%, #e11d2f 100%);
  color: #fff; border-color: rgba(255, 255, 255, 0.08);
}
.btn-danger:hover:not(:disabled) { filter: brightness(1.08); }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.btn-icon svg { width: 18px; height: 18px; }
.btn-icon-only { display: inline-grid; place-items: center; width: 42px; height: 40px; padding: 0; }
.btn-icon-only svg { width: 20px; height: 20px; }

/* ------------------------------------------------------------------ */
/* Header                                                             */
/* ------------------------------------------------------------------ */
.header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 13px 24px;
  background: rgba(5, 5, 5, 0.72);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.12);
}
.logo {
  display: flex; align-items: center; gap: 11px;
  font-family: var(--disp); font-size: 20px; font-weight: 700;
  color: var(--text); white-space: nowrap; letter-spacing: -0.02em;
}
.logo, .auth-logo { text-decoration: none; cursor: pointer; }
.logo[href="#"], .auth-logo[href="#"] { cursor: default; }
.logo-img {
  width: 34px; height: 34px; object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(var(--accent-rgb), 0.45));
}
.logo-word { display: inline; }
.header-right { display: flex; align-items: center; gap: 12px; }
.balance {
  background: var(--card-2); border: 1px solid var(--border);
  padding: 7px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Layout                                                             */
/* ------------------------------------------------------------------ */
.main { max-width: 760px; margin: 0 auto; padding: 30px 20px 60px; }
.boost-main { max-width: 560px; }
.key-field {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: 2px; text-transform: uppercase;
}
.back-btn { margin-top: 14px; }
.title { font-family: var(--disp); font-size: 25px; font-weight: 700; margin-bottom: 4px; }
.subtitle { color: var(--muted); margin-bottom: 22px; font-size: 14px; }

/* ------------------------------------------------------------------ */
/* Brand heading (public view)                                        */
/* ------------------------------------------------------------------ */
.brand-title {
  font-family: var(--disp);
  font-weight: 800; text-align: center; line-height: 1.04;
  margin: 8px 0 22px; letter-spacing: -0.5px;
}
.brand-top, .brand-bottom {
  display: block;
  background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: brand-slide 8s linear infinite;
}
.brand-top {
  font-size: clamp(30px, 8vw, 44px);
  background-image: linear-gradient(90deg, #ffffff 0%, var(--accent-tint) 30%, var(--accent) 50%, var(--accent-tint) 70%, #ffffff 100%);
}
.brand-bottom {
  font-size: clamp(20px, 5.5vw, 30px); font-weight: 600;
  background-image: linear-gradient(90deg, var(--accent-2) 0%, var(--accent-2) 40%, var(--accent-deep) 50%, var(--accent-2) 60%, var(--accent-2) 100%);
}
@keyframes brand-slide { 0% { background-position: 0% center; } 100% { background-position: -220% center; } }
@media (prefers-reduced-motion: reduce) { .brand-top, .brand-bottom { animation: none; } }

/* ------------------------------------------------------------------ */
/* Feature chips                                                      */
/* ------------------------------------------------------------------ */
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 0 0 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: 11px;
  background: rgba(15, 15, 15, 0.85); border: 1px solid var(--border);
  color: var(--text); font-weight: 600; font-size: 13px;
  backdrop-filter: blur(8px);
  transition: border-color .2s ease, transform .2s ease;
}
.chip:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.chip svg { width: 17px; height: 17px; color: var(--accent-2); }
.chip-neutral { background: var(--card-2); }
.chip-green   { background: var(--card); border-color: var(--border-strong); }
.chip-green svg { color: var(--green); }
/* Chip accent = rouge-blanc */
.chip-accent  {
  background: linear-gradient(165deg, var(--accent-bright), var(--accent-dark));
  border-color: rgba(255, 255, 255, 0.1); color: var(--on-accent);
  box-shadow: 0 6px 18px rgba(var(--accent-dark-rgb), 0.28);
}
.chip-accent svg { color: var(--on-accent); }

/* ------------------------------------------------------------------ */
/* Booster / redeem section cards                                     */
/* ------------------------------------------------------------------ */
.booster { display: flex; flex-direction: column; gap: 18px; }
.byot-group { display: flex; flex-direction: column; gap: 18px; }
.sec-card {
  background: linear-gradient(180deg, rgba(22, 22, 22, 0.95) 0%, rgba(12, 12, 12, 0.98) 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  transition: border-color .2s ease;
}
.sec-card:focus-within { border-color: rgba(var(--accent-rgb), 0.35); }
.sec-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.sec-head-split { justify-content: space-between; }
.sec-head-left { display: flex; align-items: flex-start; gap: 14px; }
.sec-badge {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px;
  display: inline-grid; place-items: center;
  background: var(--accent-soft); border: 1px solid var(--border-strong); color: var(--accent-2);
}
.sec-badge svg { width: 19px; height: 19px; }
.sec-title {
  font-family: var(--disp);
  font-size: 15px; font-weight: 700; letter-spacing: 0.04em; color: var(--text);
  text-transform: uppercase;
}
.sec-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }

.field-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px;
}
.field-label svg { width: 15px; height: 15px; color: var(--accent-2); }
.field-help { font-size: 12px; color: var(--muted); margin-top: 8px; }

.sec-input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 13px 15px;
  color: var(--text);
  font-size: 15px; font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.sec-input::placeholder { color: #8a6169; }
.sec-input:focus {
  outline: none; background: var(--card-2);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
textarea.sec-input.token-area {
  min-height: 150px; resize: vertical;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px; line-height: 1.7;
}
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.tokens-foot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  margin-top: 12px; font-size: 12px; color: var(--muted);
}
.tokens-foot .token-counter { color: var(--text); font-weight: 700; }

/* Buy-pill = rouge-noir compact */
.buy-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 11px;
  background: linear-gradient(180deg, #141414 0%, #0a0a0a 100%);
  border: 1px solid rgba(var(--accent-rgb), 0.40);
  color: var(--accent-2); font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .12s ease;
}
.buy-pill:hover {
  color: #fff; border-color: var(--accent);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.16) 0%, #0a0a0a 100%);
  transform: translateY(-1px);
}
.buy-pill svg { width: 15px; height: 15px; }

/* ------------------------------------------------------------------ */
/* Primary CTA — rouge-blanc hero button                              */
/* ------------------------------------------------------------------ */
.start-btn {
  position: relative; overflow: hidden;
  width: 100%; border: 1px solid rgba(255, 255, 255, 0.1); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  padding: 17px; border-radius: 14px;
  font-family: var(--disp); font-size: 16px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--on-accent);
  background: linear-gradient(165deg, var(--accent-bright) 0%, var(--accent) 42%, var(--accent-dark) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 12px 32px rgba(var(--accent-dark-rgb), 0.42);
  transition: transform .15s ease, background .2s ease, opacity .15s ease, box-shadow .2s ease;
}
.start-btn::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.14) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform .55s ease;
  pointer-events: none;
}
.start-btn:hover:not(:disabled)::after { transform: translateX(120%); }
.start-btn svg { width: 19px; height: 19px; position: relative; z-index: 1; }
.start-btn > * { position: relative; z-index: 1; }
.start-btn:hover:not(:disabled) {
  background: linear-gradient(165deg, var(--accent-hi) 0%, var(--accent-bright) 40%, var(--accent) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 14px 36px rgba(var(--accent-rgb), 0.55);
  transform: translateY(-1px);
}
.start-btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
.start-btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.start-btn:disabled::after { display: none; }

.hint { margin-top: 6px; font-size: 12px; color: var(--muted); }
.hint.center { text-align: center; margin-top: 10px; }
.hint.center strong { color: var(--text); font-weight: 700; }
.solve-note { color: var(--muted); }

/* ------------------------------------------------------------------ */
/* "You pay up to" cost box                                           */
/* ------------------------------------------------------------------ */
.cost-note {
  border-radius: 16px; overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--border);
}
.cost-main {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 20px; flex-wrap: wrap;
}
.cost-eyebrow { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.cost-headline { font-size: 20px; font-weight: 800; line-height: 1.2; color: var(--text); max-width: 20ch; }
.cost-copy { min-width: 0; flex: 1 1 200px; }
.cost-price {
  flex: 0 0 auto; font-size: 28px; font-weight: 800; letter-spacing: -0.01em;
  color: var(--text); white-space: nowrap;
}
.cost-price span { font-size: 32px; }
.cost-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 13px 20px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  font-size: 13px; color: var(--muted);
}
.cost-shield { flex: 0 0 auto; width: 18px; height: 18px; color: var(--accent-2); }
.cost-foot > span:not(.cost-balance-wrap) { flex: 1 1 240px; min-width: 0; }
.cost-balance-wrap { flex: 0 0 auto; margin-left: auto; white-space: nowrap; }
.cost-balance-wrap strong { color: var(--text); font-weight: 800; margin-left: 4px; }
.cost-note.insufficient { border-color: rgba(255, 122, 133, 0.45); }
.cost-note.insufficient .cost-price { color: var(--red); }
.cost-note.insufficient .cost-foot { color: var(--red); background: rgba(255, 122, 133, 0.08); }
.cost-note.insufficient .cost-balance-wrap strong { color: var(--red); }

/* Booster spacing: the flex gap owns the rhythm. */
.booster > .status-box { margin-top: 0; }
.booster > .form-error:empty,
.booster > .form-message:empty,
.booster > .cost-note.hidden { display: none; }

/* Hidden quote box (kept for live quoting) */
.quote-box {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
}
.quote-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; color: var(--muted); }
.quote-row strong { color: var(--text); }

/* ------------------------------------------------------------------ */
/* Discord invite preview card                                        */
/* ------------------------------------------------------------------ */
.invite-preview {
  display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap;
  padding: 13px 15px; border-radius: 13px;
  background: var(--bg-2); border: 1px solid var(--border);
}
.invite-preview.hidden { display: none; }
.ip-icon {
  width: 50px; height: 50px; border-radius: 13px; object-fit: cover; flex: 0 0 auto;
  background: var(--card-2); border: 1px solid var(--border);
}
.ip-info { flex: 1 1 auto; min-width: 0; }
.ip-name { font-weight: 700; font-size: 15px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ip-id { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ip-stats { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; margin-left: auto; }
.ip-stat { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--text); font-size: 14px; }
.ip-stat svg { width: 16px; height: 16px; color: var(--muted); }
.ip-stat.online, .ip-stat.online svg,
.ip-stat.boosts, .ip-stat.boosts svg { color: var(--accent-2); }

/* ------------------------------------------------------------------ */
/* Status box + progress                                              */
/* ------------------------------------------------------------------ */
.status-box {
  border-radius: 18px; padding: 20px;
  background: var(--bg-2); border: 1px solid var(--border);
}
.progress { height: 12px; background: var(--card-2); border-radius: 8px; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; border-radius: 8px; background: linear-gradient(90deg, var(--accent-dark), var(--accent-bright)); box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.45); transition: width .4s ease; }
.status-line { display: flex; justify-content: space-between; margin-top: 12px; font-size: 14px; }
.status-state { font-weight: 700; }
.status-state.completed { color: var(--ok); }
.status-state.failed { color: var(--red); }
.status-detail { color: var(--muted); }
.status-meta { display: flex; gap: 16px; margin-top: 10px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }

/* ------------------------------------------------------------------ */
/* Per-token live status list (BYOT)                                  */
/* ------------------------------------------------------------------ */
.token-status { padding: 18px; }
.ts-tabs { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.ts-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 12px; cursor: pointer; font-weight: 700; font-size: 14px;
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
}
.ts-tab span { color: var(--muted); font-weight: 800; }
.ts-tab.active {
  color: var(--on-accent); border-color: rgba(255, 255, 255, 0.1);
  background: linear-gradient(165deg, var(--accent-bright), var(--accent-dark));
  box-shadow: 0 4px 14px rgba(var(--accent-dark-rgb), 0.28);
}
.ts-tab.active span { color: var(--on-accent); }
.ts-rows { display: flex; flex-direction: column; gap: 12px; }
.ts-row {
  display: flex; flex-direction: column; gap: 10px;
  padding: 13px 16px; border-radius: 14px;
  background: var(--bg-2); border: 1px solid var(--border);
}
.ts-row-top { display: flex; align-items: center; gap: 12px; }
.ts-token {
  flex: 1 1 auto; min-width: 0;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ts-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ts-badge {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; text-transform: capitalize;
}
.ts-badge.waiting { color: var(--muted); background: var(--card-2); border: 1px solid var(--border); }
.ts-badge.joined  { color: var(--accent-2); background: var(--accent-soft); border: 1px solid var(--border-strong); }
.ts-badge.failed  { color: var(--red);   background: rgba(255, 122, 133, 0.12); border: 1px solid rgba(255, 122, 133, 0.32); }
.ts-pill {
  flex: 0 0 auto; display: inline-flex; align-items: center;
  padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.ts-pill.captcha { color: var(--muted); background: var(--card-2); border: 1px solid var(--border); }
.ts-pill.boosts { color: var(--accent-2); background: var(--accent-soft); border: 1px solid var(--border-strong); }
.ts-spin {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--border-strong); border-top-color: var(--accent-2);
  animation: ts-spin .8s linear infinite;
}
@keyframes ts-spin { to { transform: rotate(360deg); } }
.ts-copy {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; cursor: pointer;
  display: inline-grid; place-items: center;
  background: var(--card-2); border: 1px solid var(--border-strong); color: var(--accent-2);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.ts-copy:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-2); }
.ts-copy svg { width: 18px; height: 18px; }

/* ------------------------------------------------------------------ */
/* Auth view (login / register / redeem result)                       */
/* ------------------------------------------------------------------ */
.auth-view { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card {
  width: 100%; max-width: 380px;
  background: linear-gradient(180deg, #161616 0%, #0f0f0f 100%);
  border: 1px solid var(--border);
  border-radius: 20px; padding: 30px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.auth-logo {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--disp); font-size: 24px; font-weight: 700; color: var(--text); text-align: center;
}
.auth-logo-img {
  width: 60px; height: 60px; object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(var(--accent-rgb), 0.5));
}
.auth-sub { text-align: center; color: var(--muted); margin: 8px 0 22px; font-size: 14px; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.auth-tab {
  flex: 1;
  background: linear-gradient(180deg, #141414 0%, #0a0a0a 100%);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  color: var(--accent-2); padding: 9px; border-radius: 10px; cursor: pointer; font-weight: 600;
  transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.auth-tab:hover { border-color: var(--accent); color: #fff; }
.auth-tab.active {
  color: var(--on-accent); border-color: rgba(255, 255, 255, 0.1);
  background: linear-gradient(165deg, var(--accent-bright), var(--accent-dark));
  box-shadow: 0 6px 16px rgba(var(--accent-dark-rgb), 0.32);
}
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }

/* ------------------------------------------------------------------ */
/* Redeem confirmation page                                           */
/* ------------------------------------------------------------------ */
.result-card {
  width: 100%; max-width: 460px;
  background: linear-gradient(180deg, #161616 0%, #0f0f0f 100%);
  border: 1px solid var(--border);
  border-radius: 20px; padding: 28px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  display: flex; flex-direction: column; gap: 16px;
}

#rr-status-section { display: flex; flex-direction: column; gap: 16px; }
.rr-ring-wrap { position: relative; width: 148px; height: 148px; margin: 4px auto 0; }
.rr-ring { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.rr-ring-track { fill: none; stroke: var(--border); stroke-width: 10; }
.rr-ring-bar {
  fill: none; stroke: var(--accent); stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: 326.73; stroke-dashoffset: 326.73;
  transform-origin: 60px 60px;
  transition: stroke-dashoffset .5s ease, stroke .4s ease;
}
.rr-ring-wrap.running .rr-ring-bar {
  stroke: var(--accent);
  stroke-dasharray: 82 244.73; stroke-dashoffset: 0;
  animation: rr-ring-spin 1.1s linear infinite;
}
.rr-ring-wrap.completed .rr-ring-bar { stroke: var(--ok); stroke-dasharray: 326.73; stroke-dashoffset: 0; animation: none; }
.rr-ring-wrap.failed .rr-ring-bar { stroke: var(--red); animation: none; }
@keyframes rr-ring-spin { to { transform: rotate(360deg); } }
.rr-ring-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
}
.rr-ring-icon { width: 42px; height: 42px; }
.rr-ring-wrap.completed .rr-ring-icon { color: var(--ok); }
.rr-ring-wrap.failed .rr-ring-icon { color: var(--red); }
.rr-ring-icon.hidden { display: none; }
.rr-ring-count { font-size: 22px; font-weight: 800; color: var(--text); }
.rr-ring-wrap.completed .rr-ring-count,
.rr-ring-wrap.failed .rr-ring-count { display: none; }

.rr-status-text { text-align: center; }
.rr-status-title { font-family: var(--disp); font-weight: 700; font-size: 17px; color: var(--text); }
.rr-status-title.completed { color: var(--ok); }
.rr-status-title.failed { color: var(--red); }
.rr-status-sub { font-size: 14px; color: var(--muted); margin-top: 4px; }
.rr-status-sub strong { color: var(--text); font-weight: 700; }

.rr-support-note {
  text-align: center; font-size: 13px; font-weight: 600; color: var(--red);
  background: rgba(255, 122, 133, 0.10); border: 1px solid rgba(255, 122, 133, 0.32);
  border-radius: 10px; padding: 10px 14px;
}

.rr-section { display: flex; flex-direction: column; gap: 8px; }
.rr-label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.rr-section .invite-preview { margin-top: 0; }
.rr-info-grid { display: flex; flex-direction: column; gap: 2px; }
.rr-info {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; background: var(--bg-2); border: 1px solid var(--border);
}
.rr-info:first-child { border-radius: 12px 12px 0 0; }
.rr-info:last-child { border-radius: 0 0 12px 12px; }
.rr-info + .rr-info { border-top: none; }
.rr-info span { color: var(--muted); font-size: 14px; }
.rr-info strong { color: var(--text); font-weight: 700; }
.rr-info strong.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 1px; }

/* ------------------------------------------------------------------ */
/* Account bar (logged-in navigation)                                 */
/* ------------------------------------------------------------------ */
.account-bar {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 24px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(var(--accent-rgb), 0.06);
}
.account-info {
  display: flex; align-items: center; justify-content: center; gap: 26px;
  padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border);
  font-size: 15px; flex-wrap: wrap;
}
.ai-item { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.ai-item b { color: var(--text); font-weight: 700; }
.ai-item svg { width: 18px; height: 18px; color: var(--accent-2); }
.account-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.acc-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: 14px;
  background: linear-gradient(180deg, #141414 0%, #0a0a0a 100%);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  color: var(--accent-2); cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .12s ease, box-shadow .18s ease;
}
.acc-btn:hover { border-color: var(--accent); color: #fff; background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.14) 0%, #0a0a0a 100%); }
.acc-btn:active { transform: translateY(1px); }
.acc-btn svg { width: 18px; height: 18px; color: currentColor; }
.acc-btn.active {
  background: linear-gradient(165deg, var(--accent-bright), var(--accent-dark));
  border-color: rgba(255, 255, 255, 0.1); color: var(--on-accent);
  box-shadow: 0 6px 16px rgba(var(--accent-dark-rgb), 0.32);
}
.acc-btn.active svg { color: var(--on-accent); }
.acc-logout { color: var(--muted); border-color: var(--border-strong); }
.acc-logout:hover { color: var(--red); border-color: rgba(255, 122, 133, 0.4); }

/* ------------------------------------------------------------------ */
/* Tabs                                                               */
/* ------------------------------------------------------------------ */
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ */
/* Cards / forms                                                      */
/* ------------------------------------------------------------------ */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.card-narrow { max-width: 440px; }
.card-title { font-family: var(--disp); font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.card code {
  background: var(--accent-soft); border: 1px solid var(--border); border-radius: 5px;
  padding: 1px 5px; font-family: ui-monospace, Menlo, monospace; font-size: 12px;
  color: var(--accent-2);
}

.field { margin-bottom: 18px; }
.field > label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; font-weight: 600; }
input[type=text], input[type=password], input[type=number], textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text); border-radius: 9px; padding: 11px 13px; font-size: 14px; font-family: inherit;
}
input::placeholder, textarea::placeholder { color: #8a6169; }
input:focus, textarea:focus {
  outline: none; background: var(--card-2);
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring);
}
.token-input { height: 120px; resize: vertical; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.settings-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.btn-row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

.gen-result { margin-top: 16px; }
.gen-result .table-head { margin-bottom: 8px; }
#gen-keys-output { height: 140px; }

/* $-prefixed number input */
.input-prefix {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px; padding: 0 12px;
}
.input-prefix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.input-prefix span { color: var(--muted); font-weight: 700; }
.input-prefix input { border: none; background: transparent; padding: 11px 0; }
.input-prefix input:focus { box-shadow: none; }

.profile-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 2px; border-bottom: 1px solid var(--border); font-size: 14px;
}
.profile-row:last-child { border-bottom: none; }
.profile-row span { color: var(--muted); }
.profile-row strong { color: var(--text); }

/* ------------------------------------------------------------------ */
/* Wallet / deposit                                                   */
/* ------------------------------------------------------------------ */
.wallet-balance {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 18px;
}
.wallet-balance span { color: var(--muted); font-size: 14px; }
.wallet-balance strong { font-size: 18px; color: var(--accent-2); font-family: ui-monospace, Menlo, monospace; }
.deposit-box {
  margin-top: 18px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px;
}
.deposit-amount { font-size: 15px; color: var(--muted); margin-bottom: 12px; text-align: center; }
.deposit-amount strong { color: var(--accent-2); font-family: ui-monospace, Menlo, monospace; font-size: 16px; }
.deposit-usd { color: var(--muted); font-size: 13px; margin-left: 4px; }
.qr {
  display: block; width: 200px; height: 200px; margin: 0 auto 16px;
  background: #fff; padding: 10px; border-radius: 12px; border: 1px solid var(--border-strong);
}
.deposit-addr-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.address-row { display: flex; align-items: center; gap: 8px; }
.address-row code {
  flex: 1; background: var(--card-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; font-family: ui-monospace, Menlo, monospace; font-size: 13px;
  word-break: break-all; color: var(--text);
}
.deposit-status { margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--muted); }
.deposit-status.success { color: var(--ok); }
.deposit-status.error { color: var(--red); }

/* ------------------------------------------------------------------ */
/* Admin — password gate + sub-tabs                                   */
/* ------------------------------------------------------------------ */
.admin-lock { display: none; }
.admin-lock.centered { display: flex; flex-direction: column; align-items: center; width: 100%; }
.lock-card { text-align: center; margin: 12px auto 0; }
.lock-card .subtitle { margin-bottom: 18px; }

.subtabs { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.subtab {
  background: var(--card-2); border: 1px solid var(--border); color: var(--muted);
  padding: 8px 16px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px;
}
.subtab:hover { color: var(--text); border-color: var(--border-strong); background: var(--accent-soft); }
.subtab.active {
  color: var(--on-accent); border-color: rgba(255, 255, 255, 0.1);
  background: linear-gradient(165deg, var(--accent-bright), var(--accent-dark));
  box-shadow: 0 6px 16px rgba(var(--accent-dark-rgb), 0.30);
}
.subpanel { display: none; }
.subpanel.active { display: block; }

/* ------------------------------------------------------------------ */
/* Tables                                                             */
/* ------------------------------------------------------------------ */
.table-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.head-actions { display: flex; align-items: center; gap: 10px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.table td.mono { font-family: ui-monospace, Menlo, monospace; }
.table td a { color: var(--accent-2); }
.table td.cell-action { text-align: right; width: auto; white-space: nowrap; }
.table td.cell-action button + button { margin-left: 6px; }
.balance-give { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.balance-give input[type=number] { width: 90px; padding: 6px 9px; font-size: 13px; border-radius: 8px; }

.pill { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.pill.unused, .pill.available, .pill.completed { background: var(--accent-soft); color: var(--accent-2); border: 1px solid var(--border-strong); }
.pill.used, .pill.redeemed {
  background: linear-gradient(165deg, var(--accent-bright), var(--accent-dark));
  color: var(--on-accent);
}
.pill.failed { background: rgba(255, 122, 133, 0.12); color: var(--red); }
.pill.pending, .pill.running { background: var(--card-2); color: var(--muted); border: 1px solid var(--border); }
.badge { font-size: 12px; color: var(--muted); }

/* Keys grid */
.keys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.key-chip {
  position: relative;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px; padding: 12px;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color .15s ease, background .15s ease;
}
.key-chip:hover { border-color: var(--border-strong); background: var(--card-2); }
.key-chip .code { color: var(--accent-2); }
.key-chip .code { font-family: ui-monospace, Menlo, monospace; font-weight: 700; font-size: 13px; padding-right: 20px; }
.key-chip .val { font-size: 12px; color: var(--muted); }
.key-chip.redeemed { opacity: .55; }

/* Icon action buttons */
.icon-btn, .icon-del {
  display: inline-grid; place-items: center; width: 30px; height: 30px;
  border-radius: 8px; cursor: pointer;
  background: var(--card-2); border: 1px solid var(--border); color: var(--accent-2);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.icon-btn:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-2); }
.icon-del:hover { background: rgba(255, 122, 133, 0.12); border-color: rgba(255, 122, 133, 0.45); color: var(--red); }
.icon-btn:disabled, .icon-del:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn svg, .icon-del svg { width: 15px; height: 15px; }
.chip-del {
  position: absolute; top: 8px; right: 8px;
  display: inline-grid; place-items: center; width: 22px; height: 22px;
  border-radius: 6px; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--muted);
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.chip-del:hover { color: var(--red); background: rgba(255, 122, 133, 0.12); border-color: rgba(255, 122, 133, 0.30); }
.chip-del:disabled { opacity: .5; cursor: not-allowed; }
.chip-del svg { width: 13px; height: 13px; }

/* ------------------------------------------------------------------ */
/* Messages / toast                                                   */
/* ------------------------------------------------------------------ */
.form-error { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 16px; }
.form-message { font-size: 13px; margin-top: 10px; min-height: 16px; color: var(--muted); }
.form-message.success { color: var(--ok); font-weight: 600; }
.form-message.error { color: var(--red); }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--card-2); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  padding: 12px 18px; border-radius: 10px; font-size: 14px; font-weight: 600; z-index: 50;
  animation: fade .2s ease; color: var(--text);
}
.toast.success { border-color: var(--accent); box-shadow: var(--shadow-lg), 0 0 18px rgba(var(--accent-rgb), 0.25); }
.toast.error { border-color: var(--red); color: var(--red); }

/* ------------------------------------------------------------------ */
/* Responsive                                                         */
/* ------------------------------------------------------------------ */
@media (max-width: 560px) {
  .settings-row, .settings-grid { grid-template-columns: 1fr; }
  .header { padding: 10px 14px; }
  .ip-stats { gap: 10px; }
  .sec-card { padding: 18px; }
  .account-info { gap: 16px; }
  .cost-main { flex-direction: column; align-items: flex-start; gap: 8px; }
  .rr-info strong { text-align: right; word-break: break-word; }
}

@media (max-width: 400px) {
  .auth-card, .result-card { padding: 22px 18px; }
  .auth-logo-img { width: 50px; height: 50px; }
  .chip { padding: 7px 12px; font-size: 12.5px; }
  .sec-badge { width: 38px; height: 38px; }
  .ts-copy, .btn-icon-only { width: 40px; height: 40px; }
}
