:root {
  --bg: #0f1117;
  --panel: #171a23;
  --panel-2: #1e2230;
  --line: #2a2f40;
  --text: #e7e3d8;
  --muted: #9a9bab;
  --gold: #e3b448;
  --gold-dim: #8a6d2a;
  --green: #5fc27e;
  --red: #e0645c;
  --blue: #6aa8e8;
  --purple: #b48ae8;
  --radius: 10px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
a { color: var(--gold); }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 600; margin: 0 0 .5em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Header */
.top {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--line); background: #12141b;
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-family: Georgia, serif; font-size: 1.15rem; }
.brand .coin { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe28a, var(--gold) 45%, var(--gold-dim)); box-shadow: inset 0 0 0 2px #00000033; }
.top .spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.who img { width: 26px; height: 26px; border-radius: 50%; }

main { max-width: 1040px; margin: 0 auto; padding: 20px 16px 60px; }

/* Panels & layout */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 140px; }
.stack > * + * { margin-top: 10px; }

/* Forms */
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
input, select, textarea {
  width: 100%; padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line);
  background: #0c0e13; color: var(--text); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold-dim); border-color: var(--gold-dim); }
textarea { min-height: 70px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--gold); }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: .95rem; margin: 0; cursor: pointer; }

button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap;
}
button:hover, .btn:hover { border-color: var(--gold-dim); }
button:disabled { opacity: .5; cursor: wait; }
.primary { background: var(--gold); color: #1a1405; border-color: var(--gold); font-weight: 600; }
.primary:hover { background: #f0c45c; }
.danger { color: var(--red); }
.danger.solid { background: var(--red); color: #1b0605; border-color: var(--red); font-weight: 600; }
.ghost { background: transparent; }
.tiny { padding: 4px 9px; font-size: .82rem; }
.discord { background: #5865f2; border-color: #5865f2; color: #fff; font-weight: 600; padding: 12px 20px; font-size: 1.05rem; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 16px 0; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--gold); border-bottom-color: var(--gold); }

/* Currency header */
.chead { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.chead .title { flex: 1 1 240px; }
.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; min-width: 120px; }
.stat b { display: block; font-size: 1.4rem; color: var(--gold); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .8rem; }

/* Cards */
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: var(--text); text-decoration: none; }
.card:hover { border-color: var(--gold-dim); }
.card .bal { font-size: 1.5rem; color: var(--gold); font-variant-numeric: tabular-nums; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: .75rem; border: 1px solid var(--line); color: var(--muted); vertical-align: middle; }
.badge.leader { color: var(--gold); border-color: var(--gold-dim); }
.badge.admin { color: var(--blue); border-color: #355a80; }
.badge.pending { color: var(--purple); border-color: #5b4680; }
.badge.removed, .badge.rejected { color: var(--red); border-color: #6e302c; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 500; font-size: .82rem; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }
.scroll { overflow-x: auto; }

/* Ledger */
.txn { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.txn:last-child { border-bottom: 0; }
.txn .icon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: .9rem; background: var(--panel-2); }
.txn .memo { font-weight: 500; }
.txn .meta { color: var(--muted); font-size: .82rem; }
.txn .delta { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.txn.reversed .memo { text-decoration: line-through; color: var(--muted); }
.t-award .icon { color: var(--green); }
.t-trade .icon { color: var(--blue); }
.t-burn .icon, .t-decay .icon { color: var(--red); }
.t-redistribute .icon { color: var(--purple); }
.t-reversal .icon { color: var(--muted); }
.pos { color: var(--green); }
.neg { color: var(--red); }
.entries { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .85rem; }
details summary { cursor: pointer; color: var(--muted); font-size: .85rem; }

/* Player picker */
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 12px; max-height: 280px; overflow: auto; padding: 8px; background: #0c0e13; border: 1px solid var(--line); border-radius: 8px; }
.picker-tools { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.take-row { display: grid; grid-template-columns: 1fr 110px; gap: 8px; align-items: center; margin-bottom: 6px; }

.flash { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); padding: 10px 16px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); z-index: 20; max-width: calc(100% - 32px); box-shadow: 0 8px 30px #0008; }
.flash.err { border-color: var(--red); color: #ffb3ad; }
.flash.ok { border-color: #2f6b44; color: #b6ecc6; }

.hero { text-align: center; padding: 60px 16px; max-width: 620px; margin: 0 auto; }
.hero .coin-big { width: 84px; height: 84px; margin: 0 auto 20px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe28a, var(--gold) 45%, var(--gold-dim)); box-shadow: 0 0 40px #e3b44833, inset 0 0 0 4px #00000033; }
.hero p { color: var(--muted); }
.features { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-top: 36px; text-align: left; }
.features div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; font-size: .9rem; color: var(--muted); }
.features b { display: block; color: var(--text); margin-bottom: 2px; }
/* Guide page */
.toplink { color: var(--muted); text-decoration: none; font-size: .9rem; margin-right: 12px; }
.toplink:hover, .toplink.on { color: var(--gold); }
.brand, .toplink { white-space: nowrap; }
@media (max-width: 560px) {
  .toplink { margin-right: 0; font-size: .85rem; }
  .toplink.on { display: none; }
}
.guide { max-width: 900px; }
.guide h2 { font-size: 1.4rem; }
.guide h3 { margin-top: .4em; }
.guide-hero { padding: 24px 0 8px; }
.guide-hero h1 { font-size: 2rem; }
.lead { font-size: 1.08rem; line-height: 1.6; }
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 6px; }
.toc a { padding: 5px 11px; border: 1px solid var(--line); border-radius: 99px; text-decoration: none; color: var(--text); font-size: .88rem; background: var(--panel); }
.toc a:hover { border-color: var(--gold-dim); }
.guide section { scroll-margin-top: 70px; }
.guide-cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.guide-cards .card p { color: var(--muted); font-size: .92rem; margin: 0; }
.cols { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.steps, .ticks { padding-left: 22px; margin: 0; }
.steps li, .ticks li { margin-bottom: 8px; }
.ticks { list-style: none; padding-left: 0; }
.ticks li { padding-left: 22px; position: relative; }
.ticks li::before { content: "◆"; position: absolute; left: 2px; top: 1px; color: var(--gold); font-size: .75rem; }
.flow { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 16px 0 20px; }
.flow-step { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; position: relative; }
.flow-step h3 { margin: 0 0 4px 36px; }
.flow-step p { margin: 6px 0 0; color: var(--muted); font-size: .92rem; }
.flow-n { position: absolute; left: 12px; top: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #1a1405; font-weight: 700; display: grid; place-items: center; font-size: .9rem; }
.callout { border: 1px solid var(--gold-dim); background: #221d10; border-radius: var(--radius); padding: 14px 16px; margin-top: 18px; }
.callout h3 { margin-top: 0; }
.guide details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.guide details:last-child { border-bottom: 0; }
.guide details summary { color: var(--text); font-size: 1rem; font-weight: 500; }
.guide details p { margin: 8px 0 0; color: var(--muted); }
.guide-foot { text-align: center; padding: 10px 0 20px; }
code { font-family: ui-monospace, Consolas, monospace; background: #0c0e13; border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-size: .88em; color: var(--gold); }
.lock-banner { border-color: var(--gold-dim); background: #2a2414; margin: 12px 0 0; }
.item { color: var(--purple); }
table.review td { vertical-align: top; }
table.review select { width: auto; max-width: 220px; padding: 5px 6px; }
input.amt { width: 80px; padding: 5px 6px; text-align: right; }
select.needs { border-color: var(--red); }
.needs-row td:first-child { box-shadow: inset 3px 0 var(--red); }
.problem-row td { background: #3a1716; }
.row.adj { margin-bottom: 6px; }
.reversed-row td { opacity: .55; }
.danger-zone { border-color: #6e302c; }
.danger-zone h2 { color: var(--red); }
.signin-info { text-align: left; margin-top: 24px; }
.signin-info ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: .9rem; }
.signin-info li + li { margin-top: 4px; }
.code { font-family: ui-monospace, Consolas, monospace; letter-spacing: .12em; font-size: 1.2rem; color: var(--gold); background: #0c0e13; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line); }
.empty { color: var(--muted); text-align: center; padding: 24px 0; }

@media (max-width: 560px) {
  .txn { grid-template-columns: 28px 1fr; }
  .txn .icon { width: 28px; height: 28px; }
  .txn .delta { grid-column: 2; text-align: left; }
  .who span { display: none; }
}
