/* PvPLounge site styles (lane W1). Colours come from /assets/css/palette.css (generated from the palette registry)
   with these fallbacks; art and fonts are lane A1's. Dark by default; [data-theme="light"] is the pale-garden theme.
   No inline styles anywhere (the CSP is style-src 'self'): scripts set custom properties through the CSSOM. */

:root {
  --bg: #120D09;
  --bg-2: #17100A;
  --surface: #1D150E;
  --surface-2: #261C13;
  --surface-3: #312419;
  --line: rgba(255, 215, 151, 0.12);
  --line-strong: rgba(255, 189, 91, 0.34);
  --text: var(--pal-value, #FFF8EC);
  --text-2: var(--pal-label, #F2DDB3);
  --muted: var(--pal-muted, #A89A86);
  --gold: var(--pal-lounge, #FFBD5B);
  --gold-2: #FFD797;
  --gold-3: #FFF1D3;
  --gold-ink: #2A1A06;
  --gold-grad: linear-gradient(100deg, #FFBD5B 0%, #FFD797 38%, #FFF1D3 50%, #FFD797 62%, #FFBD5B 100%);
  --ok: var(--pal-mint, #4ADE80);
  --bad: var(--pal-rose, #F87171);
  --warn: var(--pal-warn, #FB923C);
  --info: var(--pal-info, #60A5FA);
  --ember: var(--pal-ember, #FFB347);
  --ember-end: var(--pal-ember-end, #FF5E3A);
  --tide: var(--pal-tide, #7DF9FF);
  --tide-end: var(--pal-tide-end, #3A8DFF);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --radius-sm: 9px;
  --wrap: 1200px;
  --gutter: 16px;
  --hero-art: url("/assets/art/hero/hero-dark.svg");
  --pattern: url("/assets/art/patterns/tuff.svg");
  --font-display: "Anton", "Impact", "Arial Narrow", sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --font-pixel: "Pixelify Sans", "Figtree", monospace;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #F3F1EA;
  --bg-2: #ECE8DD;
  --surface: #FFFFFF;
  --surface-2: #F8F5ED;
  --surface-3: #EEE8DA;
  --line: rgba(60, 46, 26, 0.12);
  --line-strong: rgba(160, 104, 24, 0.38);
  --text: #231B11;
  --text-2: #4A3C2A;
  --muted: #6D6352;
  --gold: #A86A12;
  --gold-2: #8A5508;
  --gold-3: #6E4206;
  --gold-ink: #FFF8EC;
  --gold-grad: linear-gradient(100deg, #B7791F 0%, #D19A3A 45%, #E2B861 55%, #B7791F 100%);
  --ok: #15803D;
  --bad: #B91C1C;
  --warn: #B45309;
  --info: #1D4ED8;
  --ember: #C2410C;
  --ember-end: #9A3412;
  --tide: #0E7490;
  --tide-end: #1D4ED8;
  --shadow: 0 14px 36px rgba(60, 46, 26, 0.14);
  --hero-art: url("/assets/art/hero/hero-light.svg");
  --pattern: url("/assets/art/patterns/tuff-light.svg");
  color-scheme: light;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font-body);
  overflow-x: hidden;
}

main { flex: 1; outline: none; }

img, svg { display: block; max-width: 100%; }

a { color: var(--gold-2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:root[data-theme="light"] a { color: var(--gold); }

button, input, select { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--gold); color: var(--gold-ink); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { left: 12px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.icon { width: 18px; height: 18px; fill: currentColor; flex: none; }
.icon-lg { width: 24px; height: 24px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---- top bar --------------------------------------------------------------------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand:hover { text-decoration: none; }
.brand-emblem { width: 36px; height: 36px; }
.brand-word { height: 26px; width: auto; }

.nav { display: flex; align-items: center; gap: 2px; flex: 1; }
.nav a {
  color: var(--text-2); font-weight: 600; font-size: 15px; padding: 8px 11px; border-radius: 8px;
}
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent); }

.topbar-tools { display: flex; align-items: center; gap: 8px; flex: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--text-2); font-size: 13px; white-space: nowrap;
  background: var(--surface);
}
.chip b { font-family: var(--font-pixel); font-weight: 600; color: var(--gold); letter-spacing: 0.02em; }
.chip-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.chip-java { font-family: var(--font-pixel); }

.ip-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font-weight: 700;
}
.ip-pill:hover { border-color: var(--gold); }
/* The live count is just the number with a green dot (the title says "N players online"); the hero has the words. */
.ip-count { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-pixel); color: var(--ok); font-size: 13px; }
.ip-count::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--ok); }
.ip-count:empty { display: none; }
.ip-short { display: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
}
.icon-btn:hover { color: var(--gold); border-color: var(--line-strong); text-decoration: none; }
.menu-btn { display: none; }

/* Widths (measured with a live count): brand ~170, 8 nav links ~590, tools ~350 = ~1110 px of content, so the full
   bar needs a viewport above ~1150. The Java chip lives in the hero, never in the bar (it never fits with the count).
   Each step below keeps documentElement.scrollWidth == innerWidth at 360, 375, 390, 1024, 1100, 1280, 1366, 1440. */
@media (max-width: 1180px) {
  .menu-btn { display: inline-grid; }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    gap: 0; padding: 8px var(--gutter) 16px; background: var(--bg-2); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px; font-size: 16px; }
  .topbar-inner { gap: 10px; }
  .topbar-tools { margin-left: auto; }
}
@media (max-width: 680px) {
  .brand-word { display: none; }
}
/* Phones: the pill is the copy icon and "Copy IP" (the hero shows the full address and the count), never a cut
   "play.pvploun..." and never a count that pushes the menu button off the screen. */
@media (max-width: 560px) {
  .ip-text, .ip-count { display: none; }
  .ip-short { display: inline; }
  .discord-link { display: none; }
}
[hidden] { display: none !important; }

/* ---- buttons and common pieces -------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  font-weight: 700; cursor: pointer; text-decoration: none; transition: transform 0.12s ease, border-color 0.12s;
}
.btn:hover { border-color: var(--gold); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-gold { background: var(--gold-grad); color: var(--gold-ink); border-color: transparent; }
.btn-gold:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; }
.btn-danger { border-color: color-mix(in srgb, var(--bad) 55%, transparent); color: var(--bad); background: transparent; }
.btn-big { min-height: 56px; padding: 14px 24px; font-size: 18px; border-radius: 14px; }
.btn-on { border-color: var(--gold); color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--surface-2)); }

.section { padding: 56px 0; }
.section-tight { padding: 32px 0; }
.band { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band-pattern {
  background-color: var(--bg-2);
  background-image: linear-gradient(color-mix(in srgb, var(--bg-2) 88%, transparent), color-mix(in srgb, var(--bg-2) 94%, transparent)), var(--pattern);
  background-size: auto, 64px 32px;
  image-rendering: pixelated;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--gold);
  font: 600 13px/1 var(--font-pixel); letter-spacing: 0.08em; text-transform: uppercase;
}
.display, h1, h2.title {
  font-family: var(--font-display); font-weight: 400; letter-spacing: 0.01em; text-transform: uppercase;
  line-height: 1.05; margin: 0 0 14px;
}
h1, .display { font-size: clamp(36px, 6vw, 64px); }
h2.title { font-size: clamp(26px, 3.6vw, 38px); }
h3 { font-size: 19px; margin: 0 0 8px; }
.gold-text { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 18px; color: var(--text-2); max-width: 680px; margin: 0 0 22px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.pixel { font-family: var(--font-pixel); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.spread { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.head-row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.head-row h2 { margin: 0; }

.grid { display: grid; gap: 18px; }
.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: 980px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; min-width: 0;
}
.card-hover { transition: border-color 0.15s, transform 0.15s; }
.card-hover:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.card h3 { display: flex; align-items: center; gap: 8px; }
.card-art { margin: -20px -20px 16px; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; background: var(--surface-3); aspect-ratio: 16 / 9; }
.card-art img { width: 100%; height: 100%; object-fit: cover; }
/* Art beside the text (the modes page's two columns): no bleed, all four corners rounded. */
.card-art-inline { margin: 0; border-radius: var(--radius-sm); }
/* The Hub's card: the theme's own hero (dark or light), not a fixed dark image. */
.card-art-hero { background: var(--surface-3) var(--hero-art) center / cover no-repeat; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font-size: 12px;
  font-weight: 700; letter-spacing: 0.03em; background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.badge-live { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.badge-ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.badge-warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.badge-gold { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); }

.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot-up { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.dot-down { background: var(--bad); }

.count { font: 600 28px/1 var(--font-pixel); color: var(--text); }
.count small { font-size: 14px; color: var(--muted); font-family: var(--font-body); }

.placeholder {
  display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: var(--radius);
  border: 1px dashed var(--line-strong); background: color-mix(in srgb, var(--surface) 70%, transparent);
  color: var(--text-2);
}
.placeholder .icon { width: 22px; height: 22px; color: var(--gold); margin-top: 2px; }
.placeholder p { margin: 0; }
.placeholder b { color: var(--text); }

.notice {
  display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 10px; margin: 0 0 16px;
  background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
}
.notice-info { background: color-mix(in srgb, var(--info) 12%, var(--surface)); border-color: color-mix(in srgb, var(--info) 40%, transparent); }

.updated { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.updated .icon { width: 14px; height: 14px; }

.kbd {
  display: inline-block; min-width: 22px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line-strong);
  border-bottom-width: 3px; font: 600 13px/1.4 var(--font-pixel); text-align: center; background: var(--surface-2);
}
code, .code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.92em; padding: 1px 6px; border-radius: 6px; background: var(--surface-3); color: var(--gold-2); }
:root[data-theme="light"] code { color: var(--gold); }

/* ---- hero ------------------------------------------------------------------------------------------------ */

.hero {
  position: relative; overflow: hidden; border-bottom: 1px solid var(--line);
  background-color: var(--bg);
  background-image: linear-gradient(90deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 72%, transparent) 46%, transparent 72%), var(--hero-art);
  background-size: cover, cover;
  background-position: center, 72% center;
}
.hero-inner { padding: 72px var(--gutter) 64px; max-width: var(--wrap); margin: 0 auto; }
.hero-copy { max-width: 600px; }
.hero .display { font-size: clamp(44px, 8vw, 86px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 18px; }
.hero-ip {
  display: inline-flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 16px; cursor: pointer;
  background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line-strong);
  color: var(--text); text-align: left; box-shadow: var(--shadow);
}
.hero-ip:hover { border-color: var(--gold); }
.hero-ip .label { display: block; color: var(--muted); font-size: 13px; }
.hero-ip .addr { display: block; font: 600 22px/1.2 var(--font-pixel); color: var(--gold); }
.hero-ip .copy-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--gold-grad); color: var(--gold-ink); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; color: var(--text-2); font-size: 15px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 720px) {
  .hero { background-image: linear-gradient(180deg, color-mix(in srgb, var(--bg) 55%, transparent), var(--bg) 92%), var(--hero-art); background-position: center, 72% top; }
  .hero-inner { padding-top: 48px; }
}

/* ---- server cards, strips -------------------------------------------------------------------------------- */

.server-card .count { margin-top: 6px; }
.server-card .server-state { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.mode-tag { font: 600 12px/1 var(--font-pixel); letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }

.ranked-strip {
  display: grid; grid-template-columns: 1.1fr 1fr 1.4fr; gap: 18px; align-items: stretch;
}
@media (max-width: 900px) { .ranked-strip { grid-template-columns: minmax(0, 1fr); } }
.queue-meter { height: 12px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin: 10px 0 6px; }
.queue-meter span { display: block; height: 100%; width: var(--fill, 0%); background: var(--gold-grad); border-radius: 6px; }

.top3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.top3 .pos { font: 600 13px/1 var(--font-pixel); color: var(--gold); }

.player-chip { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.player-chip img { width: 26px; height: 26px; border-radius: 6px; image-rendering: pixelated; background: var(--surface-3); }
.player-chip .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* news carousel (our own: scroll-snap cards with arrow buttons) */
.carousel { position: relative; }
.carousel-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: 18px; overflow-x: auto;
  scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin;
}
.carousel-track > * { scroll-snap-align: start; }
@media (min-width: 900px) { .carousel-track { grid-auto-columns: calc((100% - 36px) / 3); } }
.news-card h3 { font-size: 20px; }
.news-date { color: var(--muted); font-size: 13px; }

/* ---- tables and leaderboards ------------------------------------------------------------------------------ */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: color-mix(in srgb, var(--gold) 5%, transparent); }
td.num, th.num { text-align: right; font-family: var(--font-pixel); }
.pos-1 td:first-child { color: #FFD166; }
.pos-2 td:first-child { color: #D9D4CC; }
.pos-3 td:first-child { color: #E3A06B; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.tab {
  padding: 10px 14px; border: none; background: none; cursor: pointer; color: var(--muted); font-weight: 700;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab[aria-selected="true"] { color: var(--gold); border-bottom-color: var(--gold); }
.tab:hover { color: var(--text); }

.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
@media (max-width: 640px) { .podium { grid-template-columns: minmax(0, 1fr); } }
.podium .card { text-align: center; }
.podium img { width: 64px; height: 64px; margin: 6px auto 10px; border-radius: 10px; image-rendering: pixelated; }
.podium .value { font: 600 26px/1 var(--font-pixel); color: var(--gold); }

.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); min-height: 42px; }
.search input { border: none; background: transparent; outline: none; min-width: 0; flex: 1; padding: 8px 0; }

/* ---- ranked ------------------------------------------------------------------------------------------------- */

.ladder { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 760px) { .ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Rank colours are art colours (Iron is near-white, Coal near-black), so they never colour text: the name is in
   --text (4.5:1 or better in both themes) and the colour sits on the badge, the tile's left edge and the bars. */
.rank-tile { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--rank, var(--line-strong)); }
.rank-tile img { width: 32px; height: 32px; image-rendering: pixelated; }
.rank-tile .rank-name { font-weight: 800; color: var(--text); }
.rank-tile .rank-from { font: 600 13px/1 var(--font-pixel); color: var(--muted); }
.rank-legend .rank-name { font-weight: 900; }

.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 52px; gap: 10px; align-items: center; font-size: 14px; }
.bar { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.bar span { display: block; height: 100%; width: var(--fill, 0%); background: var(--rank, var(--gold)); }

.game-card .teams { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
@media (max-width: 560px) { .game-card .teams { grid-template-columns: minmax(0, 1fr); } }
.team { border-radius: 10px; padding: 10px 12px; background: var(--surface-2); border-top: 3px solid var(--team, var(--gold)); }
.team-ember { --team: var(--ember); }
.team-tide { --team: var(--tide); }
.team h4 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--team); }
.team ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.team li { display: flex; justify-content: space-between; gap: 8px; }
.delta-up { color: var(--ok); font-family: var(--font-pixel); }
.delta-down { color: var(--bad); font-family: var(--font-pixel); }
.voided { display: inline-block; padding: 2px 10px; border-radius: 6px; background: var(--bad); color: #fff; font-weight: 800; letter-spacing: 0.08em; }
/* A1's 32 px pixel art is shown only at whole multiples of 32 px, so no pixel is dropped or doubled unevenly. */
.kit-icon { width: 32px; height: 32px; image-rendering: pixelated; display: inline-block; vertical-align: middle; }

/* ---- rules and written pages ------------------------------------------------------------------------------- */

.doc-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 900px) { .doc-layout { grid-template-columns: minmax(0, 1fr); } }
.toc { position: sticky; top: 84px; display: grid; gap: 2px; padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.toc a { color: var(--text-2); padding: 6px 10px; border-radius: 8px; font-size: 15px; }
.toc a:hover { background: var(--surface-2); text-decoration: none; color: var(--gold); }
@media (max-width: 900px) { .toc { position: static; grid-auto-flow: column; overflow-x: auto; } .toc a { white-space: nowrap; } }
.doc { max-width: 780px; }
.doc h1 { font-size: clamp(32px, 5vw, 48px); }
.doc h2 { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; font-size: 28px; margin: 36px 0 10px; scroll-margin-top: 84px; }
.doc h3 { margin-top: 22px; scroll-margin-top: 84px; }
.doc p, .doc li { color: var(--text-2); }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 6px 0; }
.doc blockquote { margin: 16px 0; padding: 10px 16px; border-left: 3px solid var(--gold); background: var(--surface); border-radius: 0 10px 10px 0; color: var(--text-2); }
.doc hr { border: none; border-top: 1px solid var(--line); margin: 30px 0; }
.doc pre { padding: 14px; border-radius: 10px; background: var(--surface-2); overflow-x: auto; }
.doc pre code { background: none; padding: 0; }
.quick { display: flex; gap: 12px; padding: 14px 16px; margin: 16px 0; border-radius: 12px; background: color-mix(in srgb, var(--gold) 10%, var(--surface)); border: 1px solid var(--line-strong); }
.quick .icon { color: var(--gold); margin-top: 3px; }
.quick p { margin: 0; color: var(--text); }

/* ---- staff ---------------------------------------------------------------------------------------------- */

.staff-group { margin-bottom: 28px; }
.staff-group h2 { display: inline-block; font: 400 24px/1.1 var(--font-display); text-transform: uppercase; margin: 0 0 12px; background: linear-gradient(90deg, var(--from, var(--gold)), var(--to, var(--gold))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.staff-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.staff-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--from, var(--gold)); }
.staff-card img { width: 34px; height: 34px; border-radius: 8px; image-rendering: pixelated; }

/* ---- status ---------------------------------------------------------------------------------------------- */

.status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.status-row:last-child { border-bottom: none; }
.status-name { display: flex; align-items: center; gap: 10px; font-weight: 700; }

/* ---- voice ----------------------------------------------------------------------------------------------- */

.voice-shell { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .voice-shell { grid-template-columns: minmax(0, 1fr); } }
.voice-stage { text-align: center; padding: 34px 22px; }
.voice-stage .display { font-size: clamp(30px, 5vw, 44px); }
.confirm-digits { font: 700 clamp(64px, 14vw, 120px)/1 var(--font-pixel); letter-spacing: 0.08em; color: var(--gold); margin: 10px 0 12px; }
.conn { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.conn .dot { background: var(--warn); }
.conn-live .dot { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.conn-off .dot { background: var(--bad); }
.staff-banner { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; background: color-mix(in srgb, var(--info) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--info) 45%, transparent); font-weight: 700; }
.roster { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.member { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.member-self { border-color: var(--line-strong); }
.speak { width: 14px; height: 14px; border-radius: 50%; background: var(--surface-3); border: 2px solid var(--line-strong); transition: background 0.1s, box-shadow 0.1s; }
.speaking .speak { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 30%, transparent); }
.member-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-label { font-size: 13px; color: var(--muted); }
.member-tools { display: flex; align-items: center; gap: 8px; }
.member-tools input[type="range"] { width: 110px; }
.controls { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.meter { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; position: relative; }
.meter span { display: block; height: 100%; width: var(--level, 0%); background: var(--ok); transition: width 0.05s linear; }
.meter i { position: absolute; top: 0; bottom: 0; width: 2px; left: var(--threshold, 50%); background: var(--gold); }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 700; font-size: 14px; }
.field select, .field input[type="text"] { padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; }
input[type="range"] { accent-color: var(--gold); }
input[type="checkbox"] { accent-color: var(--gold); width: 18px; height: 18px; }

/* ---- footer ---------------------------------------------------------------------------------------------- */

.footer { margin-top: 64px; border-top: 1px solid var(--line); background: var(--bg-2); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; padding-top: 40px; padding-bottom: 28px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
.footer-brand { display: flex; gap: 14px; align-items: flex-start; color: var(--text-2); font-size: 15px; }
.footer-brand img { width: 56px; height: 56px; flex: none; }
.footer-brand p { margin: 0; }
.footer-title { font: 600 13px/1 var(--font-pixel); text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold); margin: 6px 0 12px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-links a { color: var(--text-2); }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-bottom: 28px; color: var(--muted); font-size: 13px; }
.footer-legal p { margin: 0; }

/* ---- toast ----------------------------------------------------------------------------------------------- */

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80; transform: translateX(-50%);
  padding: 12px 18px; border-radius: 12px; background: var(--surface-3); color: var(--text);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow); font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.toast[hidden] { display: none; }
.toast .icon { color: var(--ok); }

/* ---- loading ----------------------------------------------------------------------------------------------- */

.flip { transform: scaleX(-1); }
h2.title .icon { display: inline-block; vertical-align: -3px; width: 26px; height: 26px; color: var(--gold); }
.skeleton { border-radius: var(--radius); min-height: var(--h, 120px); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.list-plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--gold-grad); color: var(--gold-ink); font: 600 20px/1 var(--font-pixel); }
.faq details { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 0 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq details[open] summary { color: var(--gold); }
.faq details p { margin: 0 0 14px; color: var(--text-2); }
