:root {
  color-scheme: dark;
  --bg: #090909;
  --surface: #121214;
  --surface-raised: #18181b;
  --surface-soft: #202024;
  --line: #2b2a2d;
  --line-strong: #3a3638;
  --text: #f4f1ec;
  --muted: #a19b95;
  --faint: #706b67;
  --red: #a3232b;
  --red-bright: #d4474f;
  --red-soft: #351619;
  --bone: #d5c6ae;
  --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(145,29,36,.035)); z-index: -1; }
::selection { background: var(--red); 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(--red-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: grayscale(1) contrast(1.08); z-index: -3; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7,7,8,.94) 0%, rgba(7,7,8,.68) 54%, rgba(7,7,8,.22) 100%), linear-gradient(0deg, #090909 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-avatar { width: 54px; height: 54px; object-fit: cover; border-radius: 50%; box-shadow: 0 8px 18px rgba(0,0,0,.48); }
.brand h1 { font-size: 25px; line-height: 1; letter-spacing: -.025em; font-weight: 820; text-transform: lowercase; }
.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(--red-soft); }
#main-nav button.active svg { color: var(--red-bright); }
#main-nav button:active { transform: scale(.96); }

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

.quick-claim, .status-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: #0c0c0e; color: #fff; padding: 11px 12px; font-size: 15px; caret-color: var(--red-bright); }
.quick-claim input::placeholder { color: #686368; }
.quick-claim button, .claim { border: 0; border-radius: 10px; background: var(--red); color: #fff; padding: 11px 14px; font-weight: 780; }
.quick-claim button:active, .claim:active { background: #8e1e25; 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; }
.profit-image { display: block; width: 100%; height: auto; max-height: none; object-fit: contain; object-position: top; background: #1a1b1e; border-bottom: 1px solid var(--line); }
.card-body { padding: 15px; }
.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: #ff656b; 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; }
.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); }
.claim { width: 100%; }
.claim.secondary { background: var(--surface-soft); color: #ddd7d1; border: 1px solid var(--line-strong); }

.status-panel { padding: 16px; }
.section-heading { margin-bottom: 13px; }
.status-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.status-item span { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.status-item strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.status-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-soft); color: var(--bone); font-size: 12px; font-style: normal; font-weight: 800; }

.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: #ff8b90; background: var(--red-soft); }
.service-state.inactive .service-dot, .service-state.failed .service-dot, .service-state.unavailable .service-dot { background: var(--red-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(--red-soft); color: #ff9ca0; border-color: #62292e; }
.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(--red-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-avatar { width: 62px; height: 62px; }
  .brand h1 { font-size: 29px; }
  main { padding-left: 18px; padding-right: 18px; }
  .discord-panel { margin-top: -34px; }
  .card-body { padding: 18px; }
}
