:root {
  color-scheme: dark;
  --bg: #0d0914;
  --surface: #191222;
  --surface-raised: #23192f;
  --surface-soft: #2c203b;
  --line: #3e2e50;
  --line-strong: #66507e;
  --text: #f7f2ff;
  --muted: #c0b3cf;
  --faint: #a18daf;
  --accent: #6637a8;
  --accent-bright: #b98aef;
  --accent-soft: #291b40;
  --accent-contrast: #d8b9ff;
  --accent-border: #9667ca;
  --accent-strong: #4c257d;
  --bone: #e1d5ef;
  --green: #63cf9d;
  --green-soft: #153528;
  --orange: #e4ad5d;
  --orange-soft: #3a2b16;
  --radius: 14px;
  --shadow: 0 12px 24px rgba(0,0,0,.34);
  font-family: Aptos, "Segoe UI Variable", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); scrollbar-color: #464145 var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
body::after { content: ""; position: fixed; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 45%, rgba(102,55,168,.035)); z-index: -1; }
::selection { background: var(--accent); color: #fff; }
button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.hero { position: relative; height: 196px; overflow: hidden; isolation: isolate; border-bottom: 1px solid var(--line); }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 27%; filter: contrast(1.08); z-index: -3; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(13,9,20,.94) 0%, rgba(13,9,20,.68) 54%, rgba(13,9,20,.22) 100%), linear-gradient(0deg, var(--bg) 0%, transparent 45%); z-index: -2; }
.brand { position: absolute; left: max(18px, calc((100% - 720px)/2 + 18px)); bottom: 34px; display: flex; align-items: center; gap: 13px; }
.brand h1 { font-size: 25px; line-height: 1; letter-spacing: -.025em; font-weight: 820; text-transform: uppercase; }
.brand p { margin-top: 6px; color: #c6beb5; font-size: 13px; }
.hero-status { position: absolute; left: max(20px, calc((100% - 720px)/2 + 20px)); top: 22px; display: flex; align-items: center; gap: 7px; color: #d7d0c8; font-size: 12px; font-weight: 650; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
#refresh { position: absolute; right: max(18px, calc((100% - 720px)/2 + 18px)); top: 18px; width: 42px; height: 42px; padding: 11px; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; background: rgba(10,10,11,.68); color: var(--text); backdrop-filter: blur(10px); }
#refresh svg { width: 100%; height: 100%; }
#refresh:active { transform: rotate(25deg) scale(.96); }

main { max-width: 720px; margin: 0 auto; padding: 14px 14px 28px; }
.hidden { display: none !important; }

.discord-panel { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 13px; margin: -29px 0 13px; position: relative; z-index: 2; border: 1px solid var(--line-strong); border-radius: var(--radius); background: rgba(20,20,22,.98); }
.discord-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: #29283a; color: #a9a8d8; }
.discord-mark svg { width: 25px; height: 25px; }
.discord-copy { display: grid; gap: 2px; min-width: 0; }
.discord-label { color: var(--faint); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.discord-panel strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.discord-panel small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.discord-panel button { border: 1px solid #555273; border-radius: 10px; padding: 9px 11px; background: #383653; color: #f2f1ff; font-size: 12px; font-weight: 750; }
.discord-panel button:disabled { opacity: .45; }

.stats { display: grid; grid-template-columns: repeat(3,1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 13px; overflow: hidden; }
.stats div { min-width: 0; padding: 13px 12px; text-align: center; position: relative; }
.stats div + div::before { content: ""; position: absolute; left: 0; top: 13px; bottom: 13px; width: 1px; background: var(--line); }
.stats strong { display: block; font-size: 21px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stats span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

#main-nav { position: fixed; z-index: 20; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100% - 20px), 700px); display: flex; align-items: stretch; gap: 3px; padding: 6px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; border-radius: 16px; background: rgba(17,17,19,.97); box-shadow: 0 14px 30px rgba(0,0,0,.58); backdrop-filter: blur(18px); }
#main-nav::-webkit-scrollbar { display: none; }
#main-nav button { flex: 1 1 56px; min-width: 56px; min-height: 56px; display: grid; place-items: center; align-content: center; gap: 4px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; }
#main-nav button svg { width: 20px; height: 20px; }
#main-nav button.active { color: #fff; background: var(--accent-soft); }
#main-nav button.active svg { color: var(--accent-bright); }
#main-nav button:active { transform: scale(.96); }

#notice { min-height: 0; margin: 7px 2px 10px; color: var(--accent-contrast); font-size: 12px; line-height: 1.45; }
#notice:empty { display: none; }

.quick-claim, .referrals-panel, .service-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.quick-claim { padding: 16px; margin-bottom: 13px; }
.quick-claim h2, .section-heading h2, .services-title h2 { font-size: 17px; letter-spacing: -.015em; }
.quick-claim p, .section-heading p, .services-title p { color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 4px; }
.quick-claim form { display: flex; gap: 8px; margin-top: 14px; }
.quick-claim input { min-width: 0; flex: 1; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); color: #fff; padding: 11px 12px; font-size: 15px; caret-color: var(--accent-bright); }
.quick-claim input::placeholder { color: #686368; }
.quick-claim button, .claim { border: 0; border-radius: 10px; background: var(--accent); color: #fff; padding: 11px 14px; font-weight: 780; }
.quick-claim button:active, .claim:active { background: var(--accent-strong); transform: scale(.985); }
.quick-claim button:disabled, .claim:disabled { opacity: .4; }

.card { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 13px; }
.card-body { padding: 15px; }
.profit-avatar-footer { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.profit-avatar-footer img { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-strong); }
.row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.row h2 { font-size: 17px; line-height: 1.2; }
.steam { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.value { color: var(--accent-bright); text-align: right; font-size: 15px; font-variant-numeric: tabular-nums; }
.tags { margin: 12px 0 8px; }
.tag { display: inline-block; font-size: 11px; font-weight: 850; letter-spacing: .025em; border-radius: 999px; padding: 5px 8px; }
.tag.green { background: var(--green-soft); color: #81e3b6; }
.tag.orange { background: var(--orange-soft); color: #f0bd70; }
.tag.fallen { background: var(--accent-soft); color: var(--accent-contrast); }
.profit-timer { display: flex; justify-content: space-between; gap: 10px; margin: 4px 0 11px; padding: 9px 11px; border: 1px solid #6b552e; border-radius: 9px; background: #2b2318; font-size: 12px; }
.profit-timer span { color: var(--muted); }
.profit-timer strong { color: #ffd278; font-size: 13px; font-variant-numeric: tabular-nums; }
.profit-timer.expired strong { color: var(--accent-contrast); }
.owner { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding: 12px 0; font-size: 12px; }
.owner span { color: var(--muted); }
.owner b { text-align: right; }
.owner.free b { color: var(--green); }
.referral-audit { display: flex; justify-content: space-between; gap: 12px; margin-top: -1px; padding: 10px 0 12px; border-top: 1px solid var(--line); font-size: 11px; }
.referral-audit span { color: var(--muted); }
.referral-audit b { max-width: 68%; text-align: right; color: var(--bone); }
.telegram-contact-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; margin-bottom: 11px; }
.telegram-contact { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #355c80; border-radius: 10px; background: #17334b; color: #d8edff; font-size: 12px; font-weight: 750; text-align: center; }
.telegram-contact.small { width: auto; max-width: 100%; min-height: 34px; padding: 7px 10px; border-color: var(--line-strong); background: var(--surface-soft); color: var(--muted); font-size: 11px; }
.telegram-contact:active { transform: scale(.985); }
.telegram-contact:disabled { opacity: .5; }
.claim { width: 100%; }
.claim.secondary { background: var(--surface-soft); color: #ddd7d1; border: 1px solid var(--line-strong); }
.delete-profit { width: 100%; margin-top: 8px; border: 1px solid var(--accent-border); border-radius: 10px; background: transparent; color: var(--accent-contrast); padding: 10px 14px; font-size: 12px; font-weight: 750; }
.delete-profit:active { background: var(--accent-soft); transform: scale(.985); }
.delete-profit:disabled { opacity: .4; }

.section-heading { margin-bottom: 13px; }

.referrals-panel { padding: 16px; }
.referral-code-card { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #0c0c0e; }
.referral-code-card > span { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.referral-code-card > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.referral-code-card strong { font-size: 20px; letter-spacing: .08em; color: var(--bone); font-variant-numeric: tabular-nums; }
.referral-code-card button { border: 1px solid var(--accent-border); border-radius: 9px; background: var(--accent-soft); color: var(--accent-contrast); padding: 9px 11px; font-size: 12px; font-weight: 780; }
.referral-rules { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin-top: 12px; }
.referral-rules div { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-raised); }
.referral-rules span { color: var(--muted); font-size: 11px; }
.referral-rules strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.referral-rules .positive { color: var(--green); }
.referral-rules .negative { color: var(--accent-contrast); }
.referral-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 12px; }
.referral-stats div { min-width: 0; padding: 12px 7px; text-align: center; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-raised); }
.referral-stats strong { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.referral-stats span { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.2; }
.referral-note { margin-top: 13px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.referral-people { margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.referral-people h3 { margin-bottom: 8px; font-size: 13px; }
.referral-person { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.referral-person:first-child { border-top: 0; }
.referral-person div { display: grid; gap: 3px; min-width: 0; }
.referral-person strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.referral-person span, .referral-empty { color: var(--muted); font-size: 11px; }
.referral-person .referral-branch { color: var(--bone); font-weight: 750; }
.referral-person em { flex: 0 0 auto; padding: 5px 7px; border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: 10px; font-style: normal; font-weight: 800; }
.referral-person em.approved { color: #81e3b6; background: var(--green-soft); }
.referral-person em.rejected { color: var(--accent-contrast); background: var(--accent-soft); }
.user-badge.referral { color: var(--bone); background: #2b251d; border-color: #554a39; }
.referral-directory { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.section-heading + .referral-directory { margin-top: 0; padding-top: 0; border-top: 0; margin-bottom: 20px; }
.referral-directory-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 7px 15px; margin-bottom: 13px; }
.referral-directory-heading h3 { font-size: 16px; }
.referral-directory-heading span { color: var(--muted); font-size: 11px; }
.referral-group { margin-top: 9px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-raised); }
.referral-group summary { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 13px; cursor: pointer; list-style: none; }
.referral-group summary::-webkit-details-marker { display: none; }
.referral-group summary > span, .referral-group-person > span { display: grid; gap: 4px; min-width: 0; }
.referral-group summary strong, .referral-group-person strong { overflow-wrap: anywhere; font-size: 12px; }
.referral-group small { color: var(--muted); font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
.referral-group summary b { flex: 0 0 auto; min-width: 27px; padding: 4px 6px; border-radius: 6px; background: var(--green-soft); color: var(--green); text-align: center; font-size: 12px; }
.referral-group-people { border-top: 1px solid var(--line); padding: 1px 13px 5px; }
.referral-group-person { padding: 10px 0; border-bottom: 1px solid var(--line); }
.referral-group-person:last-child { border-bottom: 0; }

.services-panel { display: grid; gap: 11px; }
.services-title { display: flex; align-items: center; justify-content: space-between; margin: 2px 2px 5px; }
.services-title button { width: 39px; height: 39px; padding: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 11px; }
.services-title button svg { width: 100%; height: 100%; }
.service-card { padding: 16px; }
.service-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 11px; }
.service-head h3 { font-size: 15px; margin: 0 0 4px; }
.service-head p { color: var(--muted); font-size: 12px; line-height: 1.4; }
.service-state { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; white-space: nowrap; padding: 6px 8px; border-radius: 999px; background: var(--surface-soft); }
.service-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.service-state.active { color: #81e3b6; background: var(--green-soft); }
.service-state.active .service-dot { background: var(--green); }
.service-state.inactive, .service-state.failed, .service-state.unavailable { color: var(--accent-contrast); background: var(--accent-soft); }
.service-state.inactive .service-dot, .service-state.failed .service-dot, .service-state.unavailable .service-dot { background: var(--accent-bright); }
.service-actions { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin-top: 15px; }
.service-actions button, .access-toggle { border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-soft); color: var(--text); padding: 10px 7px; font-size: 12px; font-weight: 750; }
.service-actions button[data-service-action="start"] { background: var(--green-soft); color: #8de8bd; border-color: #285b45; }
.service-actions button[data-service-action="stop"] { background: var(--accent-soft); color: var(--accent-contrast); border-color: var(--accent-border); }
.service-actions button:disabled, .access-toggle:disabled { opacity: .35; }
.access-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.access-row span { color: var(--muted); font-size: 12px; }
.access-toggle.on { background: var(--green-soft); color: #8de8bd; border-color: #285b45; }
.manager-note { color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

.loading, .empty { text-align: center; color: var(--muted); padding: 52px 15px; font-size: 13px; }
.loading::before { content: ""; display: block; width: 44px; height: 8px; border-radius: 4px; margin: 0 auto 14px; background: linear-gradient(90deg,#202024,#3a373a,#202024); background-size: 200% 100%; animation: skeleton 1.3s ease-in-out infinite; }
.locked-screen { padding: 72px 20px; text-align: center; }
.locked-screen .lock-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 15px; border-radius: 14px; background: var(--accent-soft); font-size: 24px; }
.locked-screen h2 { font-size: 20px; margin-bottom: 8px; }
.locked-screen p { color: var(--muted); line-height: 1.5; }

@keyframes skeleton { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
@media (min-width: 760px) {
  .hero { height: 228px; }
  .hero-art { object-position: 50% 31%; }
  .brand { bottom: 46px; }
  .brand h1 { font-size: 29px; }
  main { padding-left: 18px; padding-right: 18px; }
  .discord-panel { margin-top: -34px; }
  .card-body { padding: 18px; }
}
