/* ==========================================================================
   Anglers of Azeroth: the site's foundation (layout, controls, dialogs, toasts).
   The look itself (stone, oak, gold and parchment) is theme.css, which re-colours
   all of this; pages.css and charts.css style the guild's pages.
   ========================================================================== */

:root {
  --bg: #060914;
  --bg-2: #0a1020;
  --panel: rgba(15, 23, 43, 0.74);
  --panel-solid: #0f182d;
  --panel-2: rgba(23, 33, 60, 0.82);
  --panel-hover: rgba(35, 50, 88, 0.6);
  --line: rgba(130, 170, 255, 0.13);
  --line-2: rgba(130, 170, 255, 0.26);
  --text: #e9eeff;
  --text-2: #b9c4e2;
  --muted: #8693b6;
  --accent: #5be7ff;
  --accent-2: #b26bff;
  --accent-ink: #04121c;
  --gold: #ffcf5b;
  --danger: #ff5b7f;
  --success: #4be3a3;
  --warning: #ffb547;
  --live: #ff4d6d;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-xs: 6px;
  --shadow: 0 18px 50px -22px rgba(0, 0, 0, 0.85);
  --shadow-lg: 0 30px 80px -30px rgba(0, 0, 0, 0.95);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Chakra Petch", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --topbar-h: 60px;
  --glow: 0 0 0 1px color-mix(in oklab, var(--accent) 50%, transparent), 0 0 24px -6px color-mix(in oklab, var(--accent) 70%, transparent);
  color-scheme: dark;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}

body { overflow-x: hidden; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; margin: 0 0 .4em; letter-spacing: .01em; }
h1 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.08rem; font-weight: 600; }
h4 { font-size: .95rem; font-weight: 600; }
p { margin: 0 0 .8em; }
code, kbd, .mono { font-family: var(--mono); font-size: .86em; }
code { background: rgba(255, 255, 255, .06); padding: .1em .35em; border-radius: calc(5px * var(--round, 1)); }
kbd { border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: calc(5px * var(--round, 1)); padding: 0 .4em; font-size: .72rem; color: var(--muted); }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }

::selection { background: color-mix(in oklab, var(--accent) 40%, transparent); }

* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: calc(10px * var(--round, 1)); border: 2px solid transparent; background-clip: padding-box; }

.icon { flex: none; vertical-align: -0.18em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.lead { font-size: 1.08rem; color: var(--text-2); }
.grow { flex: 1 1 auto; min-width: 0; }
/* Text typed over several lines shows them. */
.lines { white-space: pre-line; }
.end { justify-content: flex-end; }
.pad { padding: 1rem; }
.row { display: flex; align-items: center; }
.row.gap, .gap { gap: .6rem; }
.row.wrap, .wrap { flex-wrap: wrap; }
.row.between, .between { justify-content: space-between; }
.danger-text { color: var(--danger); font-weight: 600; }
.text-live { color: var(--live); text-shadow: 0 0 18px color-mix(in oklab, var(--live) 70%, transparent); }
.neg { color: var(--danger); }
.pos { color: var(--success); }
.eyebrow { display: inline-block; font-family: var(--display); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: .3rem; }
.section-label { font-family: var(--display); font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 1.1rem 0 .55rem; display: flex; align-items: center; gap: .4rem; }
.section-label small { color: var(--muted); letter-spacing: 0; text-transform: none; font-family: var(--font); opacity: .8; }
.section-title { display: flex; align-items: center; gap: .5rem; font-size: 1.1rem; margin-bottom: .8rem; }
.section-title small { color: var(--muted); font-family: var(--font); font-size: .85rem; font-weight: 500; }
.hint { font-size: .82rem; color: var(--muted); margin: .2rem 0 .6rem; }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }

/* ---------- app shell ---------- */

.app { position: relative; min-height: 100vh; }
.app > :where(:not(.space-bg)) { position: relative; z-index: 1; }
/* No stacking context on the page area, so dialogs opened inside a page can rise above the topbar. */
.app > main.main { z-index: auto; }

.topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar-h); display: flex; align-items: center; gap: 1.2rem; padding: 0 1.2rem; background: color-mix(in oklab, var(--bg) 72%, transparent); backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); text-decoration: none !important; }
.brand-word { font-family: var(--display); font-size: 1.15rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.brand-word b { color: var(--accent); font-weight: 700; margin-left: .2em; }
.brand-lg .brand-word { font-size: 2rem; }
.topnav { display: flex; gap: .3rem; }
.topnav-link { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .75rem; border-radius: calc(999px * var(--round, 1)); color: var(--text-2); font-weight: 500; font-size: .92rem; }
.topnav-link:hover { background: var(--panel-hover); color: var(--text); text-decoration: none; }
.topnav-link.active { color: var(--accent-ink); background: var(--accent); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .7rem; }
.search-trigger { display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .55rem .4rem .75rem; border-radius: calc(999px * var(--round, 1)); background: var(--panel); border: 1px solid var(--line); color: var(--muted); cursor: pointer; font: inherit; font-size: .88rem; }
.search-trigger:hover { border-color: var(--line-2); color: var(--text); }
.user-menu { position: relative; }
.user-chip { display: inline-flex; align-items: center; gap: .5rem; padding: .25rem .6rem .25rem .25rem; border-radius: calc(999px * var(--round, 1)); background: transparent; border: 1px solid transparent; color: var(--text); cursor: pointer; font: inherit; }
.user-chip:hover { background: var(--panel); border-color: var(--line); }
.user-name { font-weight: 600; font-size: .9rem; }
.main { padding: 1.4rem clamp(.8rem, 2.5vw, 2rem) 4rem; }
/* A campaign page shown in a window at the table (Hud/PageWindow): just the page, without the site's bar or the
   campaign's header and tabs (app.js marks the frame). */

.click-away { position: fixed; inset: 0; z-index: 49; }
.menu-wrap { position: relative; display: inline-block; }
.menu { position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; min-width: 220px; padding: .35rem; border-radius: var(--radius-sm); background: var(--panel-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); display: grid; gap: 2px; animation: pop .14s ease-out; }
.menu-right { left: auto; right: 0; }
.menu a, .menu button { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .55rem .7rem; border-radius: calc(7px * var(--round, 1)); color: var(--text); background: none; border: 0; font: inherit; font-size: .92rem; text-align: left; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--panel-hover); text-decoration: none; }
.menu form { margin: 0; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

.live-pill { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .7rem; border-radius: calc(999px * var(--round, 1)); background: color-mix(in oklab, var(--live) 18%, transparent); border: 1px solid color-mix(in oklab, var(--live) 50%, transparent); color: #ffd8df; font-size: .82rem; font-weight: 600; text-decoration: none !important; }
.live-pill:hover { background: color-mix(in oklab, var(--live) 28%, transparent); }
/* A player can step out of a live session the GM forgot to end: the little cross beside its pill. */
.live-pill-wrap { display: inline-flex; align-items: center; gap: .15rem; }
.live-leave { display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 1px solid color-mix(in oklab, var(--live) 40%, transparent); background: transparent; color: #ffd8df; opacity: .55; cursor: pointer; }
.live-leave:hover, .live-leave:focus-visible { opacity: 1; background: color-mix(in oklab, var(--live) 22%, transparent); }
.live-label { font-family: var(--display); letter-spacing: .14em; color: #fff; }
.live-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 rgba(255, 77, 109, .7); animation: pulse 1.6s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 77, 109, .7); } 70% { box-shadow: 0 0 0 10px rgba(255, 77, 109, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0); } }

/* ---------- pages & panels ---------- */

.page { max-width: 1400px; margin: 0 auto; }
.page-wide { max-width: 1500px; margin: 0 auto; }
.page-narrow { max-width: 760px; margin: 0 auto; }
.page-head { margin-bottom: 1.4rem; }
.page-head p { max-width: 70ch; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; backdrop-filter: blur(10px); box-shadow: var(--shadow); }
.panel + .panel { margin-top: 1rem; }
.panel h3:first-child { margin-top: 0; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .86rem; color: var(--muted); margin-bottom: .6rem; }
.crumbs a { color: var(--text-2); }
.crumb-unknown { color: var(--muted); font-family: var(--mono); letter-spacing: .1em; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-2); display: grid; justify-items: center; gap: .4rem; }
.empty-state .empty-icon { width: 72px; height: 72px; border-radius: calc(22px * var(--round, 1)); display: grid; place-items: center; background: radial-gradient(circle at 30% 30%, color-mix(in oklab, var(--accent) 30%, transparent), transparent 70%), var(--panel); border: 1px solid var(--line-2); color: var(--accent); margin-bottom: .4rem; box-shadow: var(--glow); }
.empty-state h3 { font-size: 1.2rem; margin: 0; }
.empty-state p { max-width: 46ch; color: var(--muted); }
.empty-state .row { justify-content: center; }

.page-loader { display: grid; justify-items: center; gap: 1rem; padding: 5rem 0; color: var(--muted); }
.loader-cards { position: relative; width: 70px; height: 90px; }
.loader-cards span { position: absolute; inset: 0; border-radius: calc(9px * var(--round, 1)); border: 1.5px solid var(--accent); background: var(--panel); animation: deal 1.4s ease-in-out infinite; }
.loader-cards span:nth-child(2) { animation-delay: .15s; border-color: var(--accent-2); }
.loader-cards span:nth-child(3) { animation-delay: .3s; border-color: var(--gold); }
@keyframes deal { 0%, 100% { transform: rotate(-12deg) translateX(-14px); } 50% { transform: rotate(12deg) translateX(14px); } }


/* ---------- controls ---------- */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .55rem 1rem; border-radius: calc(10px * var(--round, 1)); border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; }
.btn:hover { background: var(--panel-hover); border-color: color-mix(in oklab, var(--accent) 45%, var(--line-2)); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 92%, white 8%), color-mix(in oklab, var(--accent) 70%, var(--accent-2) 30%)); color: var(--accent-ink); border-color: transparent; box-shadow: 0 8px 24px -10px color-mix(in oklab, var(--accent) 80%, transparent); }
.btn-primary:hover { filter: brightness(1.08); background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 60%, var(--accent-2) 40%)); }
.btn-live { background: linear-gradient(135deg, #ff4d6d, #ff7a3d); color: #fff; border-color: transparent; box-shadow: 0 8px 26px -8px rgba(255, 77, 109, .8); }
.btn-live:hover { filter: brightness(1.08); background: linear-gradient(135deg, #ff4d6d, #ff7a3d); }
.btn-success { background: color-mix(in oklab, var(--success) 22%, transparent); border-color: color-mix(in oklab, var(--success) 50%, transparent); color: #c9ffe9; }
.btn-danger { background: color-mix(in oklab, var(--danger) 25%, transparent); border-color: color-mix(in oklab, var(--danger) 55%, transparent); color: #ffd6df; }
.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: color-mix(in oklab, var(--danger) 14%, transparent); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--panel-hover); border-color: transparent; color: var(--text); }
.btn-lg { padding: .75rem 1.3rem; font-size: 1rem; border-radius: calc(12px * var(--round, 1)); }
.btn-sm { padding: .38rem .7rem; font-size: .84rem; border-radius: calc(8px * var(--round, 1)); }
.btn-xs { padding: .22rem .5rem; font-size: .76rem; border-radius: calc(7px * var(--round, 1)); gap: .3rem; }
.btn-block { width: 100%; }
.btn-icon { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: calc(9px * var(--round, 1)); border: 0; background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.btn-icon:hover { background: var(--panel-hover); color: var(--text); }

.input { width: 100%; padding: .55rem .75rem; border-radius: calc(10px * var(--round, 1)); border: 1px solid var(--line-2); background: rgba(5, 9, 20, .55); color: var(--text); font: inherit; font-size: .94rem; transition: border-color .15s, box-shadow .15s; }
.theme-fantasy .input { background: rgba(20, 13, 8, .6); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent); }
.input::placeholder { color: color-mix(in oklab, var(--muted) 80%, transparent); }
.input:disabled { opacity: .6; }
select.input { appearance: none; padding-right: 2rem; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
select.input option { background: var(--panel-solid); color: var(--text); }
.input-lg { font-size: 1.08rem; padding: .7rem .9rem; }
.input-sm { padding: .38rem .6rem; font-size: .86rem; border-radius: calc(8px * var(--round, 1)); }
.input-xs { padding: .2rem .45rem; font-size: .78rem; border-radius: calc(7px * var(--round, 1)); width: auto; }
select.input-xs { padding-right: 1.6rem; background-position: calc(100% - 12px) 55%, calc(100% - 8px) 55%; }
.input-num { max-width: 110px; min-width: 4.6rem; font-variant-numeric: tabular-nums; }
/* A small field holding a number never squeezes it below three digits and the spinner. */
.field-sm { flex: none; }
input[type=number].input-xs { min-width: 3.9rem; }
.input-code { font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase; }
/* A box for more than a line starts as tall as its rows, grows with what's typed up to a cap (--grow-max, which a
   place can set), then scrolls; it can be dragged taller or shorter too. Browsers with field-sizing grow it here (and
   ignore rows, so the starting height is worked out from them); app.js grows it for the rest. */
.textarea { --rows: 2; resize: vertical; line-height: 1.5; field-sizing: content; min-height: 2.6rem; min-height: calc(var(--rows) * 1lh + 1.1rem + 2px); max-height: var(--grow-max, 60vh); }
.textarea.input-sm { min-height: calc(var(--rows) * 1lh + .76rem + 2px); }
.textarea[rows="1"] { --rows: 1; } .textarea[rows="3"] { --rows: 3; } .textarea[rows="4"] { --rows: 4; } .textarea[rows="5"] { --rows: 5; }
.textarea[rows="6"] { --rows: 6; } .textarea[rows="7"] { --rows: 7; } .textarea[rows="8"] { --rows: 8; } .textarea[rows="9"] { --rows: 9; }
.textarea[rows="10"] { --rows: 10; } .textarea[rows="11"] { --rows: 11; } .textarea[rows="12"] { --rows: 12; }

.form-stack { display: grid; gap: .85rem; }
.field { display: grid; gap: .3rem; min-width: 0; }
.field-label { font-size: .78rem; font-weight: 600; color: var(--text-2); letter-spacing: .02em; }
.field-label small { color: var(--muted); font-weight: 400; }
.field-row { display: flex; gap: .7rem; flex-wrap: wrap; }
.field-row > .field { flex: 1 1 140px; }
.field-row > .field-sm { flex: 0 0 110px; }
.field-inline { display: flex; align-items: center; gap: .5rem; }
.field-inline > .field-label { white-space: nowrap; }
.field-error, .validation-message { color: var(--danger); font-size: .8rem; }
.check { display: inline-flex; align-items: center; gap: .45rem; font-size: .9rem; color: var(--text-2); cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

.toggle { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; font-size: .88rem; color: var(--text-2); user-select: none; }
.toggle input, .ruleset-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track { position: relative; width: 38px; height: 22px; border-radius: calc(99px * var(--round, 1)); background: rgba(255,255,255,.1); border: 1px solid var(--line-2); transition: background .2s; flex: none; }
.toggle-track span { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: transform .2s, background .2s; }
.toggle input:checked + .toggle-track, .ruleset-row input:checked + .toggle-track { background: color-mix(in oklab, var(--accent) 45%, transparent); border-color: var(--accent); }
.toggle input:checked + .toggle-track span, .ruleset-row input:checked + .toggle-track span { transform: translateX(16px); background: #fff; }

.seg { display: inline-flex; padding: 3px; border-radius: calc(11px * var(--round, 1)); background: rgba(0,0,0,.25); border: 1px solid var(--line); gap: 2px; flex-wrap: wrap; }
.seg button { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .7rem; border: 0; border-radius: calc(8px * var(--round, 1)); background: transparent; color: var(--text-2); font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; }
.seg button:hover { color: var(--text); background: var(--panel-hover); }
.seg button.is-on { background: var(--accent); color: var(--accent-ink); }
.seg button.neg.is-on { background: var(--danger); color: #fff; }
.seg button.pos.is-on { background: var(--success); color: #032; }
.seg-wide { display: flex; margin-bottom: 1rem; }
.seg-wide button { flex: 1; justify-content: center; }

.chip { display: inline-flex; align-items: center; gap: .25rem; padding: .12rem .5rem; border-radius: calc(999px * var(--round, 1)); font-size: .74rem; font-weight: 600; background: rgba(255,255,255,.07); border: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }
.chip i { font-style: normal; color: var(--muted); font-weight: 500; }
.chip-xs { font-size: .68rem; padding: .05rem .4rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.seg.seg-wrap { flex-wrap: wrap; }
.chip-toggle { cursor: pointer; font: inherit; font-size: .74rem; font-weight: 600; }
.chip-toggle:hover { color: var(--text); }
.chip-toggle.is-on { color: var(--accent-ink); background: var(--accent); border-color: transparent; }
.chip-open, .chip-friendly { color: #b8ffe0; border-color: color-mix(in oklab, var(--success) 45%, transparent); background: color-mix(in oklab, var(--success) 14%, transparent); }
.chip-closed, .chip-hostile, .chip-dead { color: #ffc2cf; border-color: color-mix(in oklab, var(--danger) 45%, transparent); background: color-mix(in oklab, var(--danger) 14%, transparent); }
.chip-wary { color: #ffe0b0; border-color: color-mix(in oklab, var(--warning) 45%, transparent); background: color-mix(in oklab, var(--warning) 12%, transparent); }
.chip-gold { color: #ffe6a6; border-color: color-mix(in oklab, var(--gold) 45%, transparent); background: color-mix(in oklab, var(--gold) 12%, transparent); }
.chip-new { color: var(--accent-ink); background: var(--accent); border-color: transparent; }
.chip-live { color: #fff; background: color-mix(in oklab, var(--live) 30%, transparent); border-color: var(--live); }
.chip-draft, .chip-pending { color: #ffe0b0; border-color: color-mix(in oklab, var(--warning) 45%, transparent); background: color-mix(in oklab, var(--warning) 10%, transparent); }
.chip-link { text-decoration: none !important; color: var(--text); border-color: color-mix(in oklab, var(--kind, var(--accent)) 45%, transparent); }
.chip-link:hover { background: color-mix(in oklab, var(--kind, var(--accent)) 18%, transparent); }
.chip-tag { color: var(--muted); }
.chip-status-active { color: #b8ffe0; border-color: color-mix(in oklab, var(--success) 45%, transparent); }
.chip-status-used, .chip-status-expired, .chip-status-revoked { color: var(--muted); }
.chip-class { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 45%, transparent); }
.chip-presence-controls { color: #ffe6a6; border-color: var(--gold); }
.chip-presence-major { color: #ffd0b0; }
.chip-ruleset { color: var(--text); }
.chip-ruleset small { color: var(--muted); margin-left: .2rem; }
.chip-btn { display: inline-flex; align-items: center; gap: .35rem; padding: .32rem .7rem; border-radius: calc(999px * var(--round, 1)); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--text-2); }
.chip-btn small { color: var(--muted); font-weight: 500; }
.chip-btn:hover { border-color: color-mix(in oklab, var(--kind, var(--accent)) 50%, transparent); color: var(--text); }
.chip-btn.is-on { background: color-mix(in oklab, var(--kind, var(--accent)) 22%, transparent); border-color: var(--kind, var(--accent)); color: var(--text); }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: .4rem; padding: .6rem .85rem; border: 0; background: none; color: var(--muted); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab small { font-weight: 500; opacity: .8; }
.tab:hover { color: var(--text); }
.tab.is-on { color: var(--text); border-bottom-color: var(--kind, var(--accent)); }
.tabs-sub { margin-bottom: .8rem; }

.alert { padding: .7rem .9rem; border-radius: calc(10px * var(--round, 1)); border: 1px solid var(--line-2); background: var(--panel-2); font-size: .9rem; }
.alert-error { border-color: color-mix(in oklab, var(--danger) 55%, transparent); background: color-mix(in oklab, var(--danger) 12%, transparent); color: #ffd6df; }
.alert-success { border-color: color-mix(in oklab, var(--success) 50%, transparent); background: color-mix(in oklab, var(--success) 10%, transparent); color: #c9ffe9; }
.alert-info { border-color: color-mix(in oklab, var(--accent) 45%, transparent); background: color-mix(in oklab, var(--accent) 9%, transparent); }
.alert-warning { border-color: color-mix(in oklab, var(--warning) 50%, transparent); background: color-mix(in oklab, var(--warning) 10%, transparent); color: #ffe7c4; }

.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: .5rem .6rem; border-bottom: 1px solid var(--line-2); }
.table td { padding: .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: rgba(255,255,255,.02); }
.table .actions { text-align: right; white-space: nowrap; }
.table tr.is-locked td { opacity: .6; }
.table .avatar { margin-right: .4rem; vertical-align: middle; }

.search-box { position: relative; display: flex; align-items: center; min-width: 200px; }
.search-box > .icon { position: absolute; left: .7rem; color: var(--muted); pointer-events: none; }
.search-box .input { padding-left: 2.1rem; }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.avatar { --size: 34px; width: var(--size); height: var(--size); border-radius: 50%; display: inline-grid; place-items: center; flex: none; overflow: hidden; background: radial-gradient(circle at 30% 25%, color-mix(in oklab, var(--who) 70%, white 10%), color-mix(in oklab, var(--who) 55%, #0b1224)); box-shadow: 0 0 0 2px color-mix(in oklab, var(--who) 70%, transparent), 0 4px 12px -4px rgba(0,0,0,.7); color: #fff; font-family: var(--display); font-weight: 700; font-size: calc(var(--size) * .38); text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { --size: 22px; }
.avatar-sm { --size: 28px; }
.avatar-md { --size: 36px; }
.avatar-lg { --size: 56px; }
.avatar-xl { --size: 96px; }
.avatar-row { display: flex; flex-wrap: wrap; gap: .3rem; }

.member-pill { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .6rem; border-radius: calc(999px * var(--round, 1)); border: 1px solid color-mix(in oklab, var(--who) 45%, transparent); background: color-mix(in oklab, var(--who) 10%, transparent); font-size: .84rem; color: var(--text); text-decoration: none !important; }
.member-pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--who); }
.member-pill.is-private { opacity: .55; }

.color-picker { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.15); background: var(--sw); cursor: pointer; padding: 0; position: relative; }
.swatch.is-on { border-color: #fff; box-shadow: 0 0 0 2px var(--sw), 0 0 12px var(--sw); }
.swatch.is-taken { opacity: .35; cursor: not-allowed; }
/* Someone else's: crossed through. */
.swatch.is-taken::after { content: ""; position: absolute; inset: 45% -2px auto; height: 2px; background: rgb(0 0 0 / .7); transform: rotate(-45deg); }
.swatch-custom { background: conic-gradient(#f43, #fd3, #3f6, #3cf, #93f, #f3c, #f43); overflow: hidden; }
.swatch-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.system-badge { display: inline-block; padding: .08rem .45rem; border-radius: calc(6px * var(--round, 1)); font-size: .7rem; font-weight: 700; letter-spacing: .06em; font-family: var(--display); color: var(--accent); border: 1px solid color-mix(in oklab, var(--accent) 40%, transparent); background: color-mix(in oklab, var(--accent) 8%, transparent); vertical-align: middle; }
.role-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: calc(999px * var(--round, 1)); font-size: .74rem; font-weight: 700; border: 1px solid color-mix(in oklab, var(--who, var(--accent)) 50%, transparent); color: var(--text); }
.role-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--who); }
.role-gm { color: #ffe6a6; border-color: color-mix(in oklab, var(--gold) 55%, transparent); background: color-mix(in oklab, var(--gold) 10%, transparent); }


/* ---------- modal, toasts, palette ---------- */

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; background: rgba(2, 4, 10, .66); backdrop-filter: blur(6px); animation: fade .15s ease-out; overflow-y: auto; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: calc(100vh - 2rem); display: flex; flex-direction: column; border-radius: calc(18px * var(--round, 1)); background: linear-gradient(180deg, var(--panel-solid), color-mix(in oklab, var(--panel-solid) 85%, black)); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,.03) inset; animation: rise .22s cubic-bezier(.2,.9,.3,1.2); outline: none; }
.modal-sm { width: min(420px, 100%); }
.modal-lg { width: min(860px, 100%); }
.modal-xl { width: min(1120px, 100%); }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.modal-head { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.2rem .6rem; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; flex: 1; font-size: 1.2rem; }
.modal-body { padding: 1rem 1.2rem; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; gap: .6rem; padding: .8rem 1.2rem 1rem; border-top: 1px solid var(--line); flex-wrap: wrap; }

.toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 200; display: grid; gap: .55rem; width: min(380px, calc(100vw - 2rem)); }
.toast { display: flex; align-items: center; gap: .7rem; padding: .7rem .7rem .7rem .85rem; border-radius: calc(13px * var(--round, 1)); background: color-mix(in oklab, var(--panel-solid) 94%, transparent); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); backdrop-filter: blur(10px); animation: toast-in .3s cubic-bezier(.2,.9,.3,1.2); }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px) scale(.96); } }
.toast-icon { width: 34px; height: 34px; border-radius: calc(10px * var(--round, 1)); display: grid; place-items: center; flex: none; background: color-mix(in oklab, var(--tone, var(--accent)) 20%, transparent); color: var(--tone, var(--accent)); }
.toast-body { flex: 1; min-width: 0; display: grid; font-size: .88rem; }
.toast-body b { font-family: var(--display); font-size: .95rem; }
.toast-body span { color: var(--text-2); }
.toast-success { --tone: var(--success); }
.toast-error, .toast-warning { --tone: var(--danger); }
.toast-warning { --tone: var(--warning); }
.toast-card { --tone: var(--gold); border-color: color-mix(in oklab, var(--gold) 45%, transparent); }
.toast-live { --tone: var(--live); border-color: color-mix(in oklab, var(--live) 45%, transparent); }

.palette-backdrop { position: fixed; inset: 0; z-index: 150; background: rgba(2,4,10,.6); backdrop-filter: blur(5px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 1rem 1rem; animation: fade .12s; }
.palette { width: min(640px, 100%); border-radius: calc(18px * var(--round, 1)); background: var(--panel-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg), var(--glow); overflow: hidden; animation: rise .18s ease-out; }
.palette-input { display: flex; align-items: center; gap: .6rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); color: var(--muted); }
.palette-input input { flex: 1; background: none; border: 0; outline: none; color: var(--text); font: inherit; font-size: 1.1rem; }
.palette-results { max-height: 55vh; overflow-y: auto; padding: .4rem; }
.palette-item { display: flex; align-items: center; gap: .7rem; padding: .55rem .6rem; border-radius: calc(10px * var(--round, 1)); color: var(--text); text-decoration: none !important; }
.palette-item.is-on { background: var(--panel-hover); }
.pi-icon { width: 32px; height: 32px; border-radius: calc(9px * var(--round, 1)); display: grid; place-items: center; flex: none; color: var(--kind); background: color-mix(in oklab, var(--kind) 14%, transparent); border: 1px solid color-mix(in oklab, var(--kind) 35%, transparent); overflow: hidden; }
.pi-icon img { width: 100%; height: 100%; object-fit: cover; }
.pi-text { flex: 1; min-width: 0; display: grid; }
.pi-text small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pi-group { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.palette-empty { padding: 1.5rem; text-align: center; color: var(--muted); }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 300; padding: .7rem 1rem; background: #3b0d1a; color: #ffd6df; border-top: 1px solid var(--danger); }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }
#blazor-error-ui .reload { color: #fff; font-weight: 700; margin-left: .5rem; }

/* reconnect */
#components-reconnect-modal { border: 1px solid var(--line-2); border-radius: calc(18px * var(--round, 1)); background: var(--panel-solid); color: var(--text); padding: 1.6rem; box-shadow: var(--shadow-lg); width: 22rem; margin: 20vh auto; }
#components-reconnect-modal::backdrop { background: rgba(2,4,10,.6); backdrop-filter: blur(4px); }
.components-reconnect-container { display: grid; justify-items: center; gap: 1rem; text-align: center; }
.components-reconnect-first-attempt-visible, .components-reconnect-repeated-attempt-visible, .components-reconnect-failed-visible, .components-pause-visible, .components-resume-failed-visible, .components-rejoining-animation { display: none; }
#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible,
#components-reconnect-modal.components-reconnect-show .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-paused .components-pause-visible,
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible,
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible,
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible { display: block; }
.components-rejoining-animation { position: relative; width: 70px; height: 70px; }
.components-rejoining-animation div { position: absolute; border: 3px solid var(--accent); border-radius: 50%; animation: rejoin 1.5s cubic-bezier(0, .2, .8, 1) infinite; }
.components-rejoining-animation div:nth-child(2) { animation-delay: -.5s; border-color: var(--accent-2); }
@keyframes rejoin { 0% { top: 35px; left: 35px; width: 0; height: 0; opacity: 1; } 100% { top: 0; left: 0; width: 70px; height: 70px; opacity: 0; } }


/* ---------- sign-in and sign-up ---------- */

.hero-card:nth-child(3) { animation-delay: -3s; }
.hero-card:nth-child(4) { animation-delay: -4.5s; }
.hero-fan:hover .hero-card { transform: translateX(calc(var(--x) * 1.35)) rotate(calc(var(--r) * 1.3)) translateY(-8px); }
@keyframes float { 0%, 100% { margin-top: 0; } 50% { margin-top: -8px; } }
.auth-main { padding: 2rem clamp(1rem, 4vw, 4rem); display: grid; place-items: center; }
.auth-card { width: min(460px, 100%); padding: 2rem; border-radius: calc(22px * var(--round, 1)); background: color-mix(in oklab, var(--panel-solid) 88%, transparent); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg), var(--glow); backdrop-filter: blur(14px); animation: rise .35s ease-out; }
.auth-title { font-size: 1.8rem; margin-bottom: .3rem; }
.auth-sub { color: var(--text-2); margin-bottom: 1.3rem; }
.auth-card .form-stack { margin-bottom: .6rem; }
.auth-foot { margin-top: 1.2rem; text-align: center; color: var(--muted); font-size: .9rem; }


/* ---------- Admin → Discord ---------- */
.admin-wow .panel { margin-bottom: 1rem; }
.admin-wow tr.is-on td { background: color-mix(in oklab, var(--accent) 7%, transparent); }
.admin-wow-server { margin: 1.4rem 0 .7rem; }
.admin-wow-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.admin-wow-grid.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-wow-grid h3 { margin: .2rem 0 0; font-size: 1rem; display: flex; gap: .4rem; align-items: center; }
.admin-wow-checks { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .8rem .8rem; margin: 0; min-width: 0; }
.admin-wow-checks legend { font-weight: 600; padding: 0 .3rem; }
.admin-wow-checks p { margin: 0 0 .5rem; }
.check-list { display: grid; gap: .3rem; max-height: 15rem; overflow-y: auto; padding-right: .3rem; }
.admin-wow-officers { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.admin-wow-officers li { display: flex; align-items: center; gap: .5rem; }
@media (max-width: 860px) {
  .admin-wow-grid, .admin-wow-grid.is-three { grid-template-columns: minmax(0, 1fr); }
}
