/* WispXP design system (v3). Neutral near-black, one modern sans (Satoshi), frosted panels over
   soft light; the wisp's pale ice-blue is the only site accent. In-game pieces (addon.css) keep the
   game's own look. Used by every page; the landing page adds landing.css, pages that show addon
   pieces add addon.css.

   Classes other pages rely on:
     layout   .container .container-narrow .page .page-sm .page-head .grid-2 .grid-3 .grid-4
     panels   .card .card-title .card-parchment (legal text) .prose .toc .legal-meta .todo .glass
     actions  .btn .btn-gold (primary) .btn-ghost .btn-danger .btn-small .btn-large .link
     forms    .form .field .field-check .check .hint .form-actions .seg (segmented radios)
     status   .alert(-success|-error|-info|-warn) .badge(-free|-pro|-comp|-blocked|-new)
     data     .table .table-wrap .stat .kv .tabs .tab .empty .steps .muted .wrap td.when .meter .tag
     account/admin  .account .admin .account-head .upgrade .plan-pick .price .toolbar .actions .pager
                    .auth-page .auth-card .qr .secret .inline .danger-title */

@font-face { font-family: "Satoshi"; src: url("../fonts/satoshi-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("../fonts/satoshi-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("../fonts/satoshi-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Satoshi"; src: url("../fonts/satoshi-900.woff2") format("woff2"); font-weight: 900; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #09090b;
  --bg-2: #0e0e11;
  --bg-3: #131317;
  --surface: rgba(255, 255, 255, .028);
  --surface-2: rgba(255, 255, 255, .05);
  --surface-3: rgba(255, 255, 255, .08);
  --solid: #111114;
  --solid-2: #17171b;
  --line: rgba(255, 255, 255, .075);
  --line-2: rgba(255, 255, 255, .13);
  --line-3: rgba(255, 255, 255, .2);

  --text: #f4f4f5;
  --text-2: #a8a8b1;
  --text-3: #74747e;

  /* the wisp: a pale, cold light (the brand) */
  --wisp: #a8e6ff;
  --wisp-2: #6fcff7;
  --wisp-3: #2ea8e6;
  --wisp-glow: rgba(120, 210, 255, .32);
  --wisp-soft: rgba(168, 230, 255, .08);
  /* the game's quest gold, only next to in-game things */
  --quest: #f2cb4c;
  --quest-soft: rgba(242, 203, 76, .1);

  --green: #5ad17a;
  --green-bg: rgba(90, 209, 122, .1);
  --red: #ff6b5b;
  --red-bg: rgba(255, 107, 91, .1);
  --amber: #ffbe55;
  --amber-bg: rgba(255, 190, 85, .1);
  --blue-bg: rgba(120, 210, 255, .08);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 24px 60px -24px rgba(0, 0, 0, .8);
  --shadow-lg: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 40px 100px -30px rgba(0, 0, 0, .9);
  --font: "Satoshi", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --wrap: 1560px;
  --gutter: clamp(16px, 4vw, 56px);
  --header: 72px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* old names, kept for pages written against v1/v2 */
  --gold: var(--wisp);
  --gold-bright: var(--text);
  --gold-dark: var(--line-2);
  --ink: var(--text);
  --ink-2: var(--text-2);
  --ink-3: var(--text-3);
  --stone-1: var(--solid);
  --font-head: var(--font);
  --font-body: var(--font);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.6; font-weight: 400;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
/* one fixed, very soft light behind every page */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1100px 620px at 82% -12%, rgba(111, 207, 247, .085), transparent 70%),
    radial-gradient(800px 600px at -12% 22%, rgba(160, 170, 200, .045), transparent 70%);
}
main { flex: 1 0 auto; }
img, svg { max-width: 100%; }
a { color: var(--wisp); text-decoration: none; }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--wisp); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(168, 230, 255, .3); color: #fff; }

h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 700; line-height: 1.1; letter-spacing: -.025em; color: var(--text); text-wrap: balance; }
h1 { font-size: clamp(2rem, 3.6vw, 2.9rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.45rem, 2.4vw, 1.9rem); }
h3 { font-size: 1.15rem; letter-spacing: -.012em; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: .1em .4em; color: var(--text); }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.muted { color: var(--text-3); }
.i { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--wisp); color: #061018; padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 700; }
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { max-width: calc(1240px + 2 * var(--gutter)); }
.page { width: 100%; max-width: calc(880px + 2 * var(--gutter)); margin: 0 auto; padding: 48px var(--gutter) 80px; }
.page-sm { max-width: calc(520px + 2 * var(--gutter)); }
.page-head { margin-bottom: 28px; }
.page-head p { color: var(--text-2); font-size: 1.08rem; }

/* small label with an icon: the site's way of listing features */
.tag { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: .9rem; font-weight: 500; line-height: 1.3; white-space: nowrap; }
.tag .i { width: 16px; height: 16px; color: var(--wisp); }
.tag.gold .i { color: var(--quest); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }

/* ---------------------------------------------------------------- header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(9, 9, 11, .66); backdrop-filter: saturate(150%) blur(18px); -webkit-backdrop-filter: saturate(150%) blur(18px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 28px; height: var(--header); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); flex: none; }
.brand:hover { color: var(--text); }
.brand img { width: 34px; height: 34px; filter: drop-shadow(0 0 10px var(--wisp-glow)); }
.brand-name { font-weight: 900; font-size: 1.24rem; letter-spacing: -.035em; }
.brand-name b { font-weight: 900; color: var(--wisp); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex: 1; }
.nav-links { display: flex; gap: 2px; list-style: none; margin: 0 auto; padding: 4px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .025); }
.nav-links a { display: block; padding: 7px 14px; border-radius: 999px; color: var(--text-2); font-weight: 500; font-size: .93rem; transition: color .15s ease, background .15s ease; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--text); background: var(--surface-3); }
.nav-account { display: flex; align-items: center; gap: 6px; }
.nav-account .link { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px; color: var(--text-2); font-weight: 500; font-size: .93rem; }
.nav-account .link:hover { color: var(--text); background: var(--surface-2); }
.nav-account .link .i { width: 16px; height: 16px; }
.nav-toggle { display: none; margin-left: auto; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle .i-close { display: none; }
.site-header.open .nav-toggle .i-open { display: none; }
.site-header.open .nav-toggle .i-close { display: block; }
@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: var(--header); flex-direction: column; align-items: stretch; gap: 10px; padding: 12px var(--gutter) 22px; background: rgba(9, 9, 11, .97); border-bottom: 1px solid var(--line); max-height: calc(100vh - var(--header)); overflow-y: auto; }
  .site-header.open .nav { display: flex; }
  .nav-links { flex-direction: column; margin: 0; padding: 0; border: 0; background: none; }
  .nav-links a, .nav-account .link { padding: 13px 12px; font-size: 1.05rem; border-radius: 12px; }
  .nav-account { flex-direction: column; align-items: stretch; padding-top: 10px; border-top: 1px solid var(--line); }
  .nav-account .btn { justify-content: center; }
}

/* ---------------------------------------------------------------- footer */
.site-footer { position: relative; margin-top: 64px; border-top: 1px solid var(--line); padding: 64px 0 32px; color: var(--text-3); font-size: .93rem; background: linear-gradient(180deg, rgba(255, 255, 255, .015), transparent 60%); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 40px; }
.footer-brand p { max-width: 380px; margin: 14px 0 18px; color: var(--text-3); }
.footer-col h2 { font-size: .9rem; font-weight: 700; color: var(--text); letter-spacing: 0; margin: 6px 0 14px; }
.footer-links { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--text-2); }
.footer-links a:hover { color: var(--text); }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--line); font-size: .83rem; }
.footer-legal p { margin: 0; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-brand { grid-column: 1 / -1; } }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); font: inherit; font-weight: 700; font-size: .97rem; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease, color .18s ease;
}
.btn:hover { background: var(--surface-3); color: #fff; border-color: var(--line-3); }
.btn:active { transform: translateY(1px); }
.btn-gold { background: linear-gradient(180deg, #e2f7ff, #9fe0fb); color: #04121b; border-color: transparent; box-shadow: 0 10px 30px -10px var(--wisp-glow), inset 0 1px 0 rgba(255, 255, 255, .75); }
.btn-gold:hover { background: linear-gradient(180deg, #f2fbff, #b6e9ff); color: #04121b; border-color: transparent; box-shadow: 0 14px 40px -10px rgba(120, 210, 255, .55), inset 0 1px 0 rgba(255, 255, 255, .85); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--red-bg); color: #ffb3aa; border-color: rgba(255, 107, 91, .35); }
.btn-danger:hover { background: rgba(255, 107, 91, .2); color: #fff; border-color: rgba(255, 107, 91, .6); }
.btn-small { min-height: 36px; padding: 6px 15px; font-size: .9rem; }
.btn-large { min-height: 54px; padding: 14px 28px; font-size: 1.05rem; }
.btn .i { width: 18px; height: 18px; }
.btn .arrow-r { transition: transform .2s var(--ease); }
.btn:hover .arrow-r { transform: translateX(3px); }
button[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

/* ---------------------------------------------------------------- panels */
.card {
  position: relative; background: linear-gradient(180deg, rgba(255, 255, 255, .042), rgba(255, 255, 255, .018));
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); min-width: 0;
}
.card > :last-child { margin-bottom: 0; }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 1.14rem; font-weight: 700; letter-spacing: -.012em; margin: 0 0 14px; color: var(--text); }
.card-title .i { color: var(--wisp); }
.card-parchment { background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .012)); }
.glass { background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .025)); border: 1px solid var(--line-2); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

/* legal pages */
.prose { font-size: 1.02rem; line-height: 1.75; color: var(--text-2); }
.prose h2 { font-size: 1.3rem; margin: 2.2em 0 .6em; color: var(--text); scroll-margin-top: 96px; padding-top: 1.4em; border-top: 1px solid var(--line); }
.prose h3 { margin: 1.5em 0 .5em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--text-3); }
.prose strong { color: var(--text); }
.prose a { text-decoration: underline; text-decoration-color: rgba(168, 230, 255, .35); text-underline-offset: 3px; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0 1.4em; font-size: .94rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--text); font-weight: 700; }
.toc { list-style: decimal; columns: 2; column-gap: 40px; padding: 22px 24px 22px 46px !important; margin: 0 0 8px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); border-radius: var(--radius); line-height: 1.5; }
.toc li { margin: 0 0 8px; break-inside: avoid; }
.toc a { color: var(--text-2); text-decoration: none; }
.toc a:hover { color: var(--text); }
@media (max-width: 600px) { .toc { columns: 1; } }
.legal-meta { font-size: .9rem; }
.todo { background: var(--amber-bg); color: var(--amber); border-radius: 4px; padding: 0 4px; }
.legal .page-head h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); letter-spacing: -.045em; margin-bottom: 10px; }

/* ---------------------------------------------------------------- forms */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field label { font-weight: 500; font-size: .92rem; color: var(--text-2); }
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea,
.toolbar input:not([type="checkbox"]), .toolbar select {
  width: 100%; min-height: 48px; padding: 11px 15px;
  background: rgba(0, 0, 0, .38); border: 1px solid var(--line-2); border-radius: var(--radius);
  color: var(--text); font: inherit; font-size: 1rem;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.field select, .toolbar select { appearance: none; -webkit-appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23a8a8b1' stroke-width='2' stroke-linecap='round' d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.field input:hover, .toolbar input:hover { border-color: var(--line-3); }
.field input:focus, .field select:focus, .field textarea:focus, .toolbar input:focus, .toolbar select:focus {
  outline: none; border-color: rgba(168, 230, 255, .6); box-shadow: 0 0 0 4px rgba(168, 230, 255, .12); background: rgba(0, 0, 0, .5); }
.field input::placeholder, .field textarea::placeholder, .toolbar input::placeholder { color: #5c5c66; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--wisp-2); width: 18px; height: 18px; margin: 3px 0 0; flex: none; }
.check, .field-check { display: flex; gap: 11px; align-items: flex-start; cursor: pointer; line-height: 1.5; color: var(--text-2); font-size: .95rem; }
.check.hint { font-size: .88rem; }
.hint { font-size: .87rem; color: var(--text-3); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.card .field + .field { margin-top: 14px; }
.card .form .field + .field { margin-top: 0; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field-row a { font-size: .87rem; }

/* segmented radio choice (e.g. monthly / yearly) */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { position: relative; display: grid; gap: 2px; padding: 12px 16px; border-radius: 12px; cursor: pointer; color: var(--text-2); transition: background .2s ease, color .2s ease, box-shadow .2s ease; }
.seg label b { color: var(--text); font-size: 1.25rem; font-weight: 900; letter-spacing: -.03em; }
.seg label small { font-size: .82rem; }
.seg label:hover { background: var(--surface-2); }
.seg input:checked + label { background: linear-gradient(180deg, rgba(168, 230, 255, .16), rgba(168, 230, 255, .06)); box-shadow: inset 0 0 0 1px rgba(168, 230, 255, .4); color: var(--text); }
.seg input:focus-visible + label { outline: 2px solid var(--wisp); outline-offset: 2px; }
.seg .save { position: absolute; top: 10px; right: 12px; font-size: .72rem; font-weight: 700; color: #04121b; background: var(--wisp); border-radius: 999px; padding: 1px 8px; }

/* ---------------------------------------------------------------- alerts */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font-size: .96rem; }
.alert .i { margin-top: 2px; }
.alert-body { flex: 1; min-width: 0; }
.alert-success { background: var(--green-bg); border-color: rgba(90, 209, 122, .3); }
.alert-success .i { color: var(--green); }
.alert-error { background: var(--red-bg); border-color: rgba(255, 107, 91, .32); }
.alert-error .i { color: var(--red); }
.alert-info { background: var(--blue-bg); border-color: rgba(168, 230, 255, .25); }
.alert-info .i { color: var(--wisp); }
.alert-warn { background: var(--amber-bg); border-color: rgba(255, 190, 85, .3); }
.alert-warn .i { color: var(--amber); }
.alert-close { margin-left: auto; background: none; border: 0; color: var(--text-3); cursor: pointer; padding: 2px; border-radius: 6px; }
.alert-close:hover { color: var(--text); }
.flashes { padding-top: 22px; display: grid; gap: 10px; }

/* ---------------------------------------------------------------- data */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -28px; padding: 0 28px; }
.table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.table th { text-align: left; font-weight: 500; font-size: .8rem; color: var(--text-3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text-2); }
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background: rgba(255, 255, 255, .02); }
.table tr:last-child td { border-bottom: 0; }
.table td a { color: var(--text); }
.table td a:hover { color: var(--wisp); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.wrap { white-space: normal; word-break: break-word; overflow-wrap: anywhere; }
td.wrap { min-width: 220px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; line-height: 1.6; border: 1px solid var(--line-2); color: var(--text-2); background: var(--surface-2); vertical-align: 2px; }
.badge-free { color: var(--text-2); }
.badge-pro { color: #04121b; background: linear-gradient(180deg, #e2f7ff, #9fe0fb); border-color: transparent; }
.badge-comp { color: var(--wisp); background: var(--blue-bg); border-color: rgba(168, 230, 255, .3); }
.badge-blocked { color: #ffb3aa; background: var(--red-bg); border-color: rgba(255, 107, 91, .35); }
.badge-new { color: var(--quest); background: var(--quest-soft); border-color: rgba(242, 203, 76, .3); }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat > b, .stat .stat-value { font-size: clamp(1.6rem, 2.6vw, 2.15rem); font-weight: 900; letter-spacing: -.035em; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
.stat > :not(:first-child), .stat .stat-label { font-size: .88rem; color: var(--text-3); }
.admin .stats .stat { padding: 22px 24px; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 12px 24px; margin: 0 0 8px; }
.kv dt { color: var(--text-3); font-size: .92rem; }
.kv dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 10px; } }

.meter { position: relative; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.meter i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, var(--wisp-3), var(--wisp)); box-shadow: 0 0 16px var(--wisp-glow); }

.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; width: max-content; max-width: 100%; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 999px; color: var(--text-2); font-weight: 500; font-size: .94rem; white-space: nowrap; }
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active { color: #04121b; background: linear-gradient(180deg, #e2f7ff, #9fe0fb); }
.tab.active .muted { color: rgba(4, 18, 27, .6); }

.empty { text-align: center; padding: 40px 20px; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--text-3); background: rgba(0, 0, 0, .18); }
.empty p { margin: 0 auto; max-width: 440px; }
.empty::before { content: ""; display: block; width: 46px; height: 46px; margin: 0 auto 14px; background: url("../img/wisp.svg") center / contain no-repeat; opacity: .85; filter: drop-shadow(0 0 12px var(--wisp-glow)); }
.card.empty::before { display: none; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 12px; }
.steps li { counter-increment: s; position: relative; padding-left: 44px; color: var(--text-2); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .86rem; color: var(--wisp); background: var(--blue-bg); border: 1px solid rgba(168, 230, 255, .25); }

/* ---------------------------------------------------------------- sign-in pages */
.auth-page { width: 100%; max-width: calc(1320px + 2 * var(--gutter)); margin: 0 auto; padding: 48px var(--gutter) 40px; display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 48px; align-items: stretch; }
.auth-card { width: 100%; padding: 40px; align-self: center; }
.auth-card .card-title { font-size: clamp(1.7rem, 2.6vw, 2.15rem); letter-spacing: -.035em; line-height: 1.1; display: block; margin-bottom: 10px; }
.auth-card .form { margin: 26px 0 18px; }
.auth-card .form .btn { width: 100%; }
.auth-card .muted { margin: 8px 0 0; font-size: .95rem; }
.auth-card .lead { color: var(--text-2); margin: 0; }
.auth-mark { display: inline-grid; place-items: center; width: 52px; height: 52px; margin-bottom: 22px; border-radius: 16px; background: radial-gradient(circle at 50% 40%, rgba(168, 230, 255, .2), rgba(255, 255, 255, .03)); border: 1px solid var(--line-2); }
.auth-mark img { width: 34px; height: 34px; filter: drop-shadow(0 0 10px var(--wisp-glow)); }
.auth-alt { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.auth-show { position: relative; min-height: 640px; border-radius: var(--radius-xl); overflow: hidden; border: 1px solid var(--line); isolation: isolate; background: #0b0d10; }
.auth-show-bg { position: absolute; inset: 0; z-index: -1; background: url("../img/addon/scene-duskwood.jpg") 60% 40% / cover no-repeat; opacity: .7; }
.auth-show-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(80% 70% at 60% 40%, transparent, rgba(9, 9, 11, .85)), linear-gradient(180deg, transparent 50%, rgba(9, 9, 11, .9)); }
.auth-show-caption { position: absolute; left: 40px; right: 40px; bottom: 36px; }
.auth-pieces { position: absolute; inset: 0; }
.auth-pieces .ap-arrow { position: absolute; left: 50%; top: 14%; transform: translateX(-50%) scale(1.15); transform-origin: center top; }
.auth-pieces .ap-plate { position: absolute; left: 20%; top: 50%; transform: scale(1.15); transform-origin: left top; }
.auth-pieces .ap-plate .w-plate { position: relative; }
.auth-pieces .ap-toast { position: absolute; right: 8%; top: 44%; }
.auth-show .tags .tag { background: rgba(9, 9, 11, .55); border-color: var(--line-2); color: var(--text); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.auth-show-caption h2 { font-size: clamp(1.4rem, 2.2vw, 2rem); letter-spacing: -.03em; margin-bottom: 14px; max-width: 22ch; }
form.inline { display: inline-flex; margin: 0 0 0 6px; vertical-align: middle; }
@media (max-width: 980px) {
  .auth-page { grid-template-columns: minmax(0, 1fr); max-width: calc(520px + 2 * var(--gutter)); padding-top: 28px; }
  .auth-show { display: none; }
}
@media (max-width: 520px) { .auth-card { padding: 26px 22px; } }

/* ---------------------------------------------------------------- account and admin */
.account, .admin { padding-top: 44px; padding-bottom: 80px; }
.account-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; }
.account-head h1, .account-head h2 { margin: 0 0 6px; }
.account-head p { margin: 0; }
.account .tabs, .admin .tabs { margin-bottom: 24px; }
.account .grid-2, .account .grid-3, .admin .grid-2, .admin .grid-3 { margin-bottom: 20px; }
.account > .card, .admin > .card { margin-bottom: 20px; }
.account .alert, .admin .alert { margin: 0 0 12px; }
.account .alert + .tabs, .admin .alert + .grid-3 { margin-top: 20px; }
.admin form.form { margin-bottom: 20px; }
.admin form.form > p, .admin form.form > .grid-2 { margin: 0; }
.upgrade.highlight { border-color: rgba(168, 230, 255, .4); box-shadow: var(--shadow), 0 0 0 1px rgba(168, 230, 255, .25), 0 0 70px -10px var(--wisp-glow); }
.plan-pick { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(0, 0, 0, .2); }
.plan-pick .price, .price { font-size: 2rem; font-weight: 900; letter-spacing: -.035em; color: var(--text); margin: 0; }
.danger-title { margin-top: 28px; color: #ffb3aa; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar input:not([type=checkbox]), .toolbar select { flex: 1 1 220px; min-width: 0; min-height: 42px; }
.toolbar label { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; color: var(--text-2); }
.toolbar label input { flex: 0 0 auto !important; width: 6.5em !important; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.actions form.inline { margin: 0; }
.card .card-title + .actions, .card .actions + .card-title, .card .toolbar + .card-title, .card .actions + form { margin-top: 22px; }
.card h3.card-title:not(:first-child) { margin-top: 26px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 16px 0 0; }
.qr { text-align: center; margin: 16px 0; }
.qr img { border-radius: var(--radius); background: #fff; padding: 8px; }
code.secret { font-size: 1rem; letter-spacing: .08em; user-select: all; }
@media (max-width: 640px) { .account-head { align-items: flex-start; } .table-wrap { margin: 0 -20px; padding: 0 20px; } .card { padding: 22px 20px; } }
.form > .btn { justify-self: start; }
.auth-card .form > .btn { justify-self: stretch; }

/* ---------------------------------------------------------------- the account page */
.ah-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.ah-id > div { min-width: 0; }
.ah-id p { overflow-wrap: anywhere; }
.ah-avatar { flex: none; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 3px #7a5530, 0 0 0 5px #1e1006, 0 0 34px rgba(120, 210, 255, .35); }
.ah-avatar img { width: 100%; height: 100%; display: block; }
.acct { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.acct-nav { position: sticky; top: calc(var(--header) + 20px); display: grid; gap: 4px; padding: 8px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .015)); }
.acct-link { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; color: var(--text-2); font-weight: 500; transition: background .15s ease, color .15s ease; }
.acct-link .i { color: var(--text-3); }
.acct-link:hover { color: var(--text); background: var(--surface-2); }
.acct-link.active { color: var(--text); background: linear-gradient(180deg, rgba(168, 230, 255, .14), rgba(168, 230, 255, .05)); box-shadow: inset 0 0 0 1px rgba(168, 230, 255, .3); }
.acct-link.active .i { color: var(--wisp); }
.acct-link .count { margin-left: auto; min-width: 24px; padding: 0 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: .8rem; text-align: center; }
.acct-main { display: grid; gap: 20px; min-width: 0; }
.acct-main > .card, .acct-main > .grid-2 { margin: 0; }
.stack { display: grid; gap: 20px; align-content: start; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.card-title.sub { font-size: 1rem; margin-top: 26px; }

.plan-hero { position: relative; padding: 30px; border-radius: var(--radius-xl); border: 1px solid var(--line); overflow: hidden; isolation: isolate;
  background: radial-gradient(70% 90% at 100% 0%, rgba(160, 170, 190, .1), transparent 60%), linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015)); box-shadow: var(--shadow); }
.plan-hero.pro { border-color: rgba(168, 230, 255, .32); background: radial-gradient(70% 100% at 100% 0%, rgba(111, 207, 247, .2), transparent 60%), linear-gradient(180deg, rgba(168, 230, 255, .07), rgba(255, 255, 255, .015)); }
.ph-top { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.ph-k { margin: 0; color: var(--text-3); font-size: .9rem; font-weight: 500; }
.ph-plan { margin: 2px 0 6px; font-size: clamp(2.6rem, 5vw, 3.6rem); font-weight: 700; letter-spacing: -.055em; line-height: 1; }
.plan-hero.pro .ph-plan { background: linear-gradient(180deg, #fff 20%, var(--wisp)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ph-sub { margin: 0; color: var(--text-2); }
.ph-wisp { width: 64px; height: 64px; filter: drop-shadow(0 0 18px var(--wisp-glow)); }
.ph-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 26px; }
.ph-stat { display: grid; gap: 4px; align-content: start; padding: 18px; border-radius: 18px; background: rgba(0, 0, 0, .28); border: 1px solid var(--line); }
.ph-stat b { font-size: 1.4rem; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ph-stat > span:not(.ph-ic) { color: var(--text-3); font-size: .88rem; }
.ph-stat .meter { margin-top: 8px; }
.ph-ic { width: 32px; height: 32px; margin-bottom: 8px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--wisp); }
.ph-ic .i { width: 17px; height: 17px; }

.up-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.up-copy p { color: var(--text-2); }
.up-form { display: grid; gap: 16px; padding: 20px; border-radius: 20px; border: 1px solid var(--line); background: rgba(0, 0, 0, .25); }
.up-form .btn { width: 100%; }
.up-form .hint { margin: 0; }

.devices { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.device { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: rgba(0, 0, 0, .2); }
.device-ic { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--wisp); }
.device-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.device-main b { font-weight: 700; overflow-wrap: anywhere; }
.device-main span { color: var(--text-3); font-size: .86rem; }
.device form { margin: 0; }
.badge-on { color: var(--green); background: var(--green-bg); border-color: rgba(90, 209, 122, .3); }

.meter.big { height: 12px; }
.danger-zone { border-color: rgba(255, 107, 91, .2); background: linear-gradient(180deg, rgba(255, 107, 91, .05), rgba(255, 255, 255, .01)); }
.danger-zone .danger-title { margin-top: 0; }
.danger-zone .card-title .i { color: #ffb3aa; }

@media (max-width: 900px) {
  .acct { grid-template-columns: minmax(0, 1fr); }
  .acct-nav { position: static; display: flex; overflow-x: auto; padding: 4px; border-radius: 999px; scrollbar-width: none; }
  .acct-nav::-webkit-scrollbar { display: none; }
  .acct-link { flex: none; padding: 9px 14px; border-radius: 999px; white-space: nowrap; }
  .acct-link .count { margin-left: 0; }
  .up-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .ph-stats { grid-template-columns: minmax(0, 1fr); }
  .plan-hero { padding: 22px; }
  .ph-wisp { width: 48px; height: 48px; }
  .device { flex-wrap: wrap; }
  .device-main { flex-basis: calc(100% - 60px); }
  .device .badge { margin-left: 56px; }
  .device form { margin-left: auto; }
  .ah-avatar { width: 46px; height: 46px; }
  .account-head .btn { width: 100%; }
}

/* ---------------------------------------------------------------- download */
.dl-hero { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 80px); align-items: center; padding-top: clamp(40px, 6vw, 88px); padding-bottom: 24px; }
.dl-kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 6px 14px 6px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); font-size: .9rem; font-weight: 500; }
.dl-kicker .i { color: var(--wisp); width: 16px; height: 16px; }
.dl-hero h1 { font-size: clamp(2.6rem, 5.2vw, 5rem); letter-spacing: -.055em; line-height: .98; margin: 0 0 20px; }
.dl-lede { color: var(--text-2); font-size: clamp(1.05rem, 1.3vw, 1.2rem); max-width: 42ch; margin: 0 0 30px; }
.dl-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.dl-meta { margin: 0; color: var(--text-3); font-size: .92rem; font-variant-numeric: tabular-nums; }
.dl-needs { margin-top: 28px; }
.dl-shots { position: relative; aspect-ratio: 1.25; }
.dl-shot { position: absolute; display: block; height: auto; border-radius: 10px; box-shadow: 0 50px 100px -30px rgba(0, 0, 0, .95), 0 0 0 1px rgba(255, 255, 255, .06); }
.dl-shot.back { width: 62%; left: 0; top: 0; opacity: .55; filter: saturate(.8); }
.dl-shot.front { width: 80%; right: 0; bottom: 0; }
.dl-shots::before { content: ""; position: absolute; inset: 10% 0 0 10%; z-index: -1; background: radial-gradient(closest-side, rgba(242, 170, 76, .14), transparent); filter: blur(20px); }
.dl-steps-wrap { padding-top: clamp(64px, 8vw, 120px); }
.dl-h2 { font-size: clamp(1.9rem, 3.4vw, 3rem); letter-spacing: -.045em; margin: 0 0 32px; }
.dl-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dl-step { display: flex; flex-direction: column; gap: 22px; padding: 26px; border-radius: 26px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255, 255, 255, .042), rgba(255, 255, 255, .012)); box-shadow: var(--shadow); overflow: hidden; }
.dl-step-text { display: flex; gap: 14px; align-items: flex-start; }
.dl-step-text h3 { margin: 2px 0 6px; font-size: 1.2rem; }
.dl-step-text p { margin: 0; color: var(--text-2); }
.dl-n { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #04121b; background: var(--wisp); box-shadow: 0 0 20px var(--wisp-glow); }
.dl-fig { margin: auto 0 0; }
.dl-fig img { display: block; width: 100%; height: auto; border-radius: 8px; box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .06); }
.dl-fig.game { position: relative; aspect-ratio: 900 / 640; border-radius: 12px; overflow: hidden; background: url("../img/addon/scene-duskwood.jpg") 50% 40% / cover; border: 1px solid var(--line); }
.dl-game { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 14px; }
.dl-game-box { width: 100%; padding: 8px; }
.dl-game-box .w-chips .w-btn { font-size: 12.5px; padding: 0 8px; }
.dl-note { margin-top: 24px; }
@media (max-width: 1080px) {
  .dl-hero { grid-template-columns: minmax(0, 1fr); }
  .dl-shots { max-width: 680px; width: 100%; }
  .dl-steps { grid-template-columns: minmax(0, 1fr); max-width: 640px; }
}
@media (max-width: 520px) {
  .dl-cta .btn { width: 100%; }
  .dl-step { padding: 20px; }
  .dl-game-arrow { transform: scale(.8); transform-origin: center top; }
  .dl-game-box .w-chips .w-btn:nth-child(n+3) { display: none; }
}

/* ---------------------------------------------------------------- error page */
.err { width: 100%; max-width: calc(760px + 2 * var(--gutter)); margin: 0 auto; padding: clamp(40px, 6vw, 80px) var(--gutter) 40px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.err-stage { position: relative; width: 100%; height: 260px; margin-bottom: 36px; border-radius: var(--radius-xl); overflow: hidden; border: 1px solid var(--line); isolation: isolate; display: grid; place-items: center; }
.err-bg { position: absolute; inset: 0; z-index: -1; background: url("../img/addon/scene-rain.jpg") 50% 60% / cover; }
.err-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(70% 90% at 50% 50%, transparent, rgba(9, 9, 11, .8)); }
.err-arrow { transform: scale(1.15); }
.err-code { margin: 0 0 10px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-3); font-size: .85rem; font-weight: 500; }
.err h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -.05em; margin: 0 0 12px; }
.err-text { color: var(--text-2); font-size: 1.1rem; max-width: 46ch; margin: 0 0 30px; }
.err-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
@media (max-width: 520px) { .err-stage { height: 220px; } .err-arrow { transform: scale(.95); } .err-cta .btn { width: 100%; } }
@media (max-width: 640px) { .prose table { -webkit-overflow-scrolling: touch; } .prose th, .prose td { min-width: 150px; } .legal .card, .page .card.prose { padding: 22px 18px; } }
@media (max-width: 680px) { .admin .grid-3.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .admin .stats .stat { padding: 18px; } }
