/* River of Styxx admin panel — dark water, gold coin. */
:root {
  --bg: #0a0f14;
  --surface: #111922;
  --surface-2: #17222e;
  --border: #233243;
  --text: #e4ebf2;
  --muted: #8796a8;
  --river: #2fb8a6;
  --river-dim: #1d6f65;
  --gold: #d4af37;
  --ok: #4fd18b;
  --bad: #ff7a7a;
  --warn: #f0b85a;
  --radius: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(ellipse at 50% -20%, #12302d 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 var(--sans);
  min-height: 100vh;
}
a { color: var(--river); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .01em; }
h1 { font-size: 1.9rem; margin: .2em 0 .8em; }
h2 { font-size: 1.2rem; margin: 0 0 .7em; }
h3 { margin: 0; }
h4 { margin: 1.4em 0 .5em; color: var(--muted); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
small { font-size: .82rem; }
.muted { color: var(--muted); }
.gold { color: var(--gold); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.num { font-variant-numeric: tabular-nums; }

/* Top bar */
.topbar {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .7rem 1rem; border-bottom: 1px solid var(--border);
  background: rgba(10, 15, 20, .85); position: sticky; top: 0; z-index: 5;
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: .55rem; color: var(--text); text-decoration: none; font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }
.obol {
  width: 22px; height: 22px; border-radius: 50%; display: inline-block; flex: none;
  background: radial-gradient(circle at 35% 30%, #f6e08a, var(--gold) 45%, #8a6d14 100%);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .25);
}
.obol-lg { width: 64px; height: 64px; }
.nav { display: flex; gap: .25rem; overflow-x: auto; }
.nav a { color: var(--muted); text-decoration: none; padding: .35rem .7rem; border-radius: 6px; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--river); }
.who { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.who form { margin: 0; }
.status { width: 9px; height: 9px; border-radius: 50%; }
.status.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.status.off { background: var(--bad); }

.wrap { max-width: 980px; margin: 0 auto; padding: 1.2rem 1rem 3rem; }

/* Cards and layout */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.2rem; margin-bottom: 1.2rem;
}
.card h2 + .muted { margin-top: -.3em; }
.card form h2:not(:first-of-type), form.card h2:not(:first-of-type) { margin-top: 1.4em; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .9rem 1.2rem; }
.grid2.cards { gap: 1.2rem; align-items: start; }
.grid2.cards .card { margin: 0; }

/* Forms */
label { display: flex; flex-direction: column; gap: .3rem; font-weight: 500; margin-bottom: .7rem; }
label small { font-weight: 400; color: var(--muted); }
input, select, button { font: inherit; }
input[type="text"], input[type="number"], input[type="time"], input[type="search"], select {
  width: 100%; padding: .55rem .7rem; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px;
}
input[readonly] { opacity: .6; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--river); outline-offset: 1px; }
.actions { margin-top: .6rem; }
.inline { display: flex; gap: .5rem; flex-wrap: wrap; }
.inline input { flex: 1 1 200px; width: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1rem; border-radius: 7px; border: 1px solid var(--river);
  background: var(--river-dim); color: #fff; cursor: pointer; text-decoration: none; font-weight: 600;
}
.btn:hover { background: var(--river); color: #04110f; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: .25rem .6rem; font-size: .85rem; font-weight: 500; }
.btn-discord { background: #5865f2; border-color: #5865f2; padding: .7rem 1.4rem; }
.btn-discord:hover { background: #7983f5; color: #fff; }

/* Flash messages */
.flash { padding: .7rem .9rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.flash-ok { background: rgba(79, 209, 139, .08); border-color: rgba(79, 209, 139, .4); }
.flash-error { background: rgba(255, 122, 122, .08); border-color: rgba(255, 122, 122, .45); }
.flash-warn { background: rgba(240, 184, 90, .08); border-color: rgba(240, 184, 90, .45); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .15rem; }
.stats-sm { margin: 1rem 0; }
.stats-sm .stat { background: var(--surface-2); }
.stat-label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stats-sm .stat-value { font-size: 1.25rem; }
.stat-sub { color: var(--muted); font-size: .85rem; }
progress.meter { width: 100%; height: 8px; appearance: none; border: 0; border-radius: 4px; background: var(--border); margin-top: .3rem; }
progress.meter::-webkit-progress-bar { background: var(--border); border-radius: 4px; }
progress.meter::-webkit-progress-value { background: var(--gold); border-radius: 4px; }
progress.meter::-moz-progress-bar { background: var(--gold); border-radius: 4px; }

/* People lists */
.avatar { width: 28px; height: 28px; border-radius: 50%; flex: none; object-fit: cover; }
.avatar-lg { width: 52px; height: 52px; }
.avatar-blank { display: inline-block; background: var(--surface-2); border: 1px solid var(--border); }
.people, .board { list-style: none; margin: 0 0 1rem; padding: 0; }
.people li, .board li { display: flex; align-items: center; gap: .7rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.people li > form { margin-left: auto; }
.board { counter-reset: place; }
.board li::before { counter-increment: place; content: counter(place); color: var(--muted); width: 1.2rem; text-align: right; }
.board li .num { margin-left: auto; font-weight: 600; }
.pill { margin-left: auto; font-size: .75rem; color: var(--gold); border: 1px solid rgba(212, 175, 55, .4); border-radius: 999px; padding: .1rem .55rem; }
.people-pick li { padding: 0; }
.pick { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .55rem .4rem; text-align: left; background: none; border: 0; color: var(--text); cursor: pointer; border-radius: 6px; }
.pick:hover { background: var(--surface-2); }
.search { margin-bottom: .6rem; }

/* Member card */
.member-card { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: 1rem; }
.member-head { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.adjust { display: grid; grid-template-columns: 110px 120px 1fr auto; gap: .5rem; }
.ledger { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ledger th { text-align: left; color: var(--muted); font-weight: 500; padding: .35rem .4rem; border-bottom: 1px solid var(--border); }
.ledger td { padding: .4rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.ledger td.num { text-align: right; width: 4.5rem; }

/* Login */
.login { max-width: 380px; margin: 14vh auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.login h1 { margin: .4em 0 0; }
.login .btn { margin-top: 1rem; }

/* Kit Pool */
code { font-size: .88em; background: var(--surface-2); padding: .05rem .35rem; border-radius: 4px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
.table-wrap { overflow-x: auto; }
.drop {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 1.6rem 1rem; text-align: center;
  align-items: center; cursor: pointer; font-weight: 400; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.dragging { border-color: var(--river); background: rgba(47, 184, 166, .06); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { outline: 2px solid var(--river); outline-offset: 2px; }
.upload-row { display: flex; gap: .8rem; align-items: flex-end; flex-wrap: wrap; margin-top: .9rem; }
.upload-row label { margin: 0; flex: 0 1 220px; }
.upload progress.meter { margin-top: .8rem; }
.kits td { vertical-align: middle; }
.kits tr.off td:not(:nth-child(5)) { opacity: .45; }
.kit-name { word-break: break-word; min-width: 12rem; }
.flash-inline { margin: .4rem 0 0; padding: .35rem .6rem; font-size: .85rem; }
.rarity-pick { width: auto; padding: .3rem .5rem; }
.rarity { font-size: .72rem; border: 1px solid; border-radius: 999px; padding: .05rem .5rem; white-space: nowrap; }
.rarity-common { color: var(--muted); }
.rarity-rare { color: var(--river); }
.rarity-legendary { color: var(--gold); }
select.rarity-rare { border-color: rgba(47, 184, 166, .6); }
select.rarity-legendary { border-color: rgba(212, 175, 55, .7); }
.switch { width: 42px; height: 24px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); padding: 0; cursor: pointer; position: relative; }
.switch span { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: left .15s; }
.switch.on { background: var(--river-dim); border-color: var(--river); }
.switch.on span { left: 20px; background: #fff; }
.kick-line { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; justify-content: space-between; }

/* Claim message editor + Discord-style preview */
textarea {
  width: 100%; padding: .55rem .7rem; color: var(--text); font: inherit; line-height: 1.45; resize: vertical;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px;
}
textarea:focus { outline: 2px solid var(--river); outline-offset: 1px; }
.claim-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; align-items: start; }
.claim-editor > div:last-child { position: sticky; top: 4.5rem; }
.placeholders { margin: .2rem 0 .6rem; }
.placeholders summary { cursor: pointer; color: var(--river); }
.placeholders dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem .8rem; margin: .6rem 0; }
.placeholders dd { margin: 0; color: var(--muted); }
.actions-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.dc-msg { background: #313338; border-radius: 8px; padding: .9rem 1rem; margin-top: .4rem; color: #dbdee1; font-size: .95rem; }
.dc-embed { border-left: 4px solid var(--gold); background: #2b2d31; border-radius: 4px; padding: .7rem .9rem; }
.dc-title { font-weight: 700; color: #f2f3f5; margin-bottom: .35rem; word-break: break-word; }
.dc-body { line-height: 1.4; word-break: break-word; }
.dc-body code { background: #1e1f22; }
.dc-footer { font-size: .78rem; color: #b5bac1; margin-top: .6rem; }
.dc-button { margin-top: .6rem; display: inline-flex; gap: .35rem; align-items: center; background: #248046; color: #fff; border-radius: 4px; padding: .4rem 1rem; font-size: .9rem; font-weight: 500; }

@media (max-width: 640px) {
  .claim-editor { grid-template-columns: 1fr; }
  .claim-editor > div:last-child { position: static; }
  .grid3 { grid-template-columns: 1fr; }
  .topbar { gap: .6rem; }
  .nav { order: 3; width: 100%; }
  .who-name { display: none; }
  .adjust { grid-template-columns: 1fr 1fr; }
  .adjust input[name="reason"], .adjust .btn { grid-column: 1 / -1; }
  h1 { font-size: 1.55rem; }
}
