:root {
  --bg: #0d1117;
  --panel: #161b22;
  --line: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #9146ff;
  --ok: #3fb950;
  --danger: #f85149;
  --gold: #e3b341;
  --marks: #a371f7;
  --pixel: "Press Start 2P", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, sans-serif; }

.admin, .page { max-width: 640px; margin: 0 auto; padding: 32px 16px; }
.page { max-width: 960px; }
.admin h1, .page h1 { margin: 0 0 8px; color: var(--accent); font-size: 26px; }
.page h2 { margin: 32px 0 12px; font-size: 20px; }
a { color: var(--accent); }

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.row small { display: block; color: var(--muted); }
.row input.check { width: 24px; height: 24px; accent-color: var(--gold); }
.row input.text { width: min(420px, 55vw); }
.row input { width: 96px; padding: 6px 8px; font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 20px; }
button { padding: 8px 16px; font: inherit; font-weight: 600; color: #fff; background: var(--accent); border: 0; border-radius: 6px; cursor: pointer; }
button.ghost { color: var(--text); background: transparent; border: 1px solid var(--line); }
#logout { margin-top: 32px; }

.muted { color: var(--muted); }
.ok { color: var(--ok); }
.err { color: var(--danger); }

/* ---------- players page ---------- */
.search { width: 100%; max-width: 320px; margin: 16px 0; padding: 8px 10px; font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:nth-child(2), td:nth-child(2) { text-align: left; }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
th button { padding: 0; font: inherit; color: inherit; background: none; border: 0; text-transform: inherit; cursor: pointer; }
th button.on { color: var(--accent); }
tbody tr:hover { background: var(--panel); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 16px; }
.tile { padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.tile b { display: block; font-size: 28px; font-variant-numeric: tabular-nums; }
.tile span { color: var(--muted); font-size: 14px; }
.win { color: var(--ok); }
.loss { color: var(--muted); }
.history th:first-child, .history td:first-child { text-align: left; }

/* ---------- profile page ---------- */
code { color: var(--accent); }
.classes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 16px; }
.class-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  text-align: left;
  font-weight: 400;
  color: var(--text);
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 10px;
}
.class-card strong { font-size: 20px; color: var(--class-color); }
.class-card[aria-checked="true"] { border-color: var(--class-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--class-color) 30%, transparent); }
.bar { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.bar i { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar b { display: block; height: 100%; background: var(--class-color); }
button:disabled { opacity: .5; cursor: not-allowed; }
.notice { margin: 12px 0; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; }
.notice p { margin: 4px 0 0; color: var(--muted); }
.class-card:disabled { cursor: default; opacity: 1; }
.class-card.locked { opacity: .4; }
.tag { margin-left: 6px; padding: 1px 8px; font-size: 12px; font-weight: 600; color: var(--bg); background: var(--class-color); border-radius: 999px; vertical-align: middle; }
.lock-note { flex: 1 1 280px; margin: 0; padding-left: 12px; color: var(--muted); border-left: 3px solid var(--accent); }

/* ---------- navigation bar (js/nav.js) ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 0 rgba(145, 70, 255, 0.35);
}
.nav-inner { display: flex; align-items: center; gap: 24px; max-width: 960px; height: 64px; margin: 0 auto; padding: 0 16px; }

.nav-brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; letter-spacing: .01em; color: var(--text); text-decoration: none; white-space: nowrap; }
.nav-logo {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font-size: 20px;
  background: linear-gradient(135deg, #9146ff, #e3b341);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(145, 70, 255, 0.35);
}

.nav-menu { display: flex; flex: 1; align-items: center; gap: 16px; }
.nav-links { display: flex; gap: 4px; }
.nav-home { padding: 8px 10px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; border-right: 1px solid var(--line); }
.nav-home:hover { color: var(--text); }
.nav-links a { padding: 8px 14px; font-weight: 600; color: var(--muted); text-decoration: none; border-radius: 8px; transition: color .15s, background .15s; }
.nav-links a:hover { color: var(--text); background: var(--panel); }
.nav-links a[aria-current="page"] { color: var(--text); background: rgba(145, 70, 255, 0.18); box-shadow: inset 0 -2px 0 var(--accent); }

.nav-live { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; }
.nav-live:hover { color: var(--text); }
.nav-live i { width: 8px; height: 8px; background: var(--danger); border-radius: 50%; box-shadow: 0 0 0 0 rgba(248, 81, 73, .6); animation: nav-pulse 2s infinite; }
@keyframes nav-pulse { 70% { box-shadow: 0 0 0 8px rgba(248, 81, 73, 0); } 100% { box-shadow: 0 0 0 0 rgba(248, 81, 73, 0); } }
@media (prefers-reduced-motion: reduce) { .nav-live i { animation: none; } }

.nav-user { display: flex; align-items: center; }
.nav-login { padding: 7px 14px; font-size: 14px; }
.nav-me { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; color: var(--text); text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; }
.nav-me:hover { border-color: var(--accent); }
.nav-me img, .nav-avatar { width: 32px; height: 32px; border-radius: 50%; box-shadow: 0 0 0 2px var(--accent); }
.nav-avatar { display: grid; place-items: center; font-weight: 700; text-transform: uppercase; background: var(--accent); }
.nav-name { font-weight: 600; }
.nav-gold { display: flex; align-items: center; gap: 4px; padding: 2px 8px; font-size: 13px; font-weight: 700; color: var(--gold); background: rgba(227, 179, 65, 0.12); border-radius: 999px; font-variant-numeric: tabular-nums; }
.nav-gold b { font-size: 10px; }

.nav-toggle { display: none; flex-direction: column; justify-content: center; gap: 4px; width: 40px; height: 40px; margin-left: auto; padding: 0 10px; background: transparent; border: 1px solid var(--line); }
.nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 1px; }

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .nav.open .nav-menu { display: flex; }
  .nav-links { flex-direction: column; }
  .nav-live { margin-left: 0; }
  .nav-home { padding: 8px 14px; border-right: none; }
}

.page h1 { font-size: 28px; color: var(--text); }
.site-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; max-width: 960px; margin: 48px auto 0; padding: 20px 16px 32px; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); }
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--text); }

/* ---------- level & attributes ---------- */
.level-box { padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.level-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.level-head b { font-size: 22px; }
.xp-bar { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.xp-bar i { display: block; height: 100%; background: linear-gradient(90deg, #9146ff, #e3b341); border-radius: 5px; transition: width .4s; }

.attrs { display: grid; gap: 8px; }
.attr { display: grid; grid-template-columns: 120px 90px 1fr 40px; align-items: center; gap: 12px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.attr-name { font-weight: 600; }
.attr-points { font-variant-numeric: tabular-nums; }
.attr-points em { color: var(--ok); font-style: normal; font-weight: 700; }
.attr-add { width: 36px; height: 36px; padding: 0; font-size: 20px; line-height: 1; }
@media (max-width: 520px) { .attr { grid-template-columns: 1fr auto 40px; } .attr-bonus { display: none; } }
.nav-level { padding: 2px 8px; font-size: 13px; font-weight: 700; color: var(--accent); background: rgba(145, 70, 255, 0.15); border-radius: 999px; }
.admin h2 { margin: 28px 0 4px; font-size: 18px; color: var(--accent); }
.admin h2.section { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 22px; }
.find { display: flex; gap: 8px; align-items: center; }
.find .search { margin: 12px 0; }
.found { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.found button { color: var(--text); background: var(--panel); border: 1px solid var(--line); }
.found button[aria-pressed="true"] { border-color: var(--accent); }
#player h3 { margin: 20px 0 0; font-size: 20px; }
#player select, #player .num { padding: 6px 8px; font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
#player .num { width: 90px; margin-left: 6px; }

/* ---------- shop ---------- */
.small { font-size: 13px; }
.r-common { --rarity: #8b949e; }
.r-uncommon { --rarity: #3fb950; }
.r-rare { --rarity: #58a6ff; }
.r-epic { --rarity: #a371f7; }
.r-legendary { --rarity: #e3b341; }

.wallet { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.coin { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; font-weight: 700; border-radius: 999px; font-variant-numeric: tabular-nums; }
.coin b { font-size: 11px; }
.coin.gold { color: var(--gold); background: rgba(227, 179, 65, 0.12); }
.coin.marks { color: var(--marks); background: rgba(163, 113, 247, 0.14); }

.slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.slot { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--rarity, var(--line)); border-radius: 8px; }
.slot strong { color: var(--rarity, var(--text)); }
.slot.empty { border-style: dashed; border-left-width: 1px; }
.small-btn { align-self: flex-start; margin-top: 8px; padding: 4px 10px; font-size: 13px; }

.shop-filters { margin-top: 24px; color: var(--muted); }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 12px; }
.item { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--rarity); border-radius: 8px; }
.item header { display: flex; justify-content: space-between; align-items: center; }
.item .rarity { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--rarity); }
.item strong { font-size: 17px; }
.item .bonus, .slot .bonus { color: var(--ok); font-size: 14px; }
.item footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 10px; }
.item footer button { padding: 6px 12px; font-size: 14px; white-space: nowrap; }
.item footer button:only-child { margin-left: auto; }
.tag-owned { padding: 1px 8px; font-size: 12px; font-weight: 600; color: var(--bg); background: var(--ok); border-radius: 999px; }
.r-legendary.item { box-shadow: 0 0 0 1px rgba(227, 179, 65, .25), 0 6px 20px rgba(227, 179, 65, .08); }

/* ---------- pixel style ---------- */
.page h1, .admin h1 { font: 22px/1.4 var(--pixel); color: var(--gold); text-shadow: 3px 3px 0 #4b2a10; }
.page h2, .admin h2 { font-family: var(--pixel); font-size: 14px; line-height: 1.6; }
.nav-brand { font-family: var(--pixel); font-size: 13px; color: var(--gold); }
.sprite { image-rendering: pixelated; }
.class-card .sprite { width: 32px; height: 64px; }
.tile, .item, .slot, .class-card, .level-box, .attr, .notice { border-radius: 0; box-shadow: 4px 4px 0 rgba(0, 0, 0, .45); }
button { border-radius: 0; box-shadow: 3px 3px 0 rgba(0, 0, 0, .45); }
button:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(0, 0, 0, .45); }

/* item icons and hero preview */
.icon { width: 48px; height: 48px; flex: none; }
.item-main { display: flex; flex-direction: column; gap: 6px; }
.item .icon { width: 64px; height: 64px; margin: 4px 0; padding: 4px; background: rgba(0, 0, 0, .25); }
.item-main > div, .slot > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.slot { flex-direction: row; gap: 12px; align-items: flex-start; }
.equipped { display: flex; gap: 16px; align-items: center; }
.equipped .slots { flex: 1; }
.hero { width: 96px; height: 160px; padding: 8px 16px; object-fit: contain; flex: none; background: var(--panel); border: 1px solid var(--line); box-shadow: 4px 4px 0 rgba(0, 0, 0, .45); }
@media (max-width: 640px) { .equipped { flex-direction: column; align-items: stretch; } .hero { align-self: center; } }

/* ---------- character sheet (profile.html) ---------- */
.sheet-page { max-width: 1440px; }
.panel { padding: 18px 20px; background: linear-gradient(180deg, #17212b, #131a22); border: 3px solid #0b0f14; box-shadow: 0 0 0 2px #2c3a48, 6px 6px 0 2px rgba(0, 0, 0, .45); }
.panel h2 { margin: 0 0 14px; font: 13px/1.5 var(--pixel); color: var(--gold); }
.panel-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
#login.panel, #create.panel { max-width: 960px; margin: 0 auto; }

.sheet {
  display: grid;
  grid-template-columns: 220px 480px 1fr 280px;
  grid-template-areas:
    "classes hero stats stats"
    "record record inv detail";
  gap: 22px;
  align-items: start;
}
.p-classes { grid-area: classes; }
.p-hero { grid-area: hero; }
.p-stats { grid-area: stats; }
.p-inv { grid-area: inv; }
.p-detail { grid-area: detail; }
.p-record { grid-area: record; }
@media (max-width: 1280px) {
  .sheet { grid-template-columns: 1fr 1fr; grid-template-areas: "hero stats" "classes inv" "detail inv" "record record"; }
}
@media (max-width: 820px) {
  .sheet { grid-template-columns: 1fr; grid-template-areas: "hero" "stats" "inv" "detail" "classes" "record"; }
}

/* class list */
.class-list { display: grid; gap: 8px; margin-bottom: 14px; }
.class-row {
  display: flex; align-items: center; gap: 10px; padding: 6px 10px; text-align: left; font-weight: 600;
  color: var(--text); background: #0f151c; border: 2px solid #2c3a48; box-shadow: none;
}
.class-row img { width: 20px; height: 40px; }
.class-row em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--bg); background: var(--class-color); padding: 1px 6px; }
.class-row[aria-checked="true"] { border-color: var(--class-color); box-shadow: inset 0 0 0 1px var(--class-color); }
.class-row.current span { color: var(--class-color); }
.class-row:disabled { opacity: .45; }
.class-row { position: relative; }
/* hover card: what the class does (class menu on the character sheet) */
.class-tip {
  display: none; position: absolute; z-index: 20; left: calc(100% + 12px); top: 50%; transform: translateY(-50%);
  width: 280px; padding: 12px; gap: 6px; flex-direction: column; text-align: left; font-weight: 400; font-size: 13px;
  color: var(--text); background: #0f151c; border: 2px solid var(--class-color); box-shadow: 4px 4px 0 rgba(0, 0, 0, .45); pointer-events: none;
}
.class-tip strong { font-size: 16px; color: var(--class-color); }
.class-tip .ult { color: var(--muted); font-size: 12px; }
.class-tip .ult b { color: var(--gold); }
.class-row:hover .class-tip, .class-row:focus-visible .class-tip { display: flex; }
.class-row:disabled:hover { opacity: .8; }
@media (max-width: 820px) { .class-tip { left: 0; top: calc(100% + 6px); transform: none; width: min(280px, 100%); } }
#switch { width: 100%; }
.p-classes .lock-note { margin-top: 10px; }

/* hero / paperdoll */
.hero-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.hero-head h2 { margin: 0; font-size: 22px; }
.hero-level { display: grid; gap: 4px; min-width: 150px; text-align: right; }
.hero-level b { font: 11px var(--pixel); color: var(--accent); }
.paperdoll { display: grid; grid-template-columns: 92px minmax(0, 1fr) 92px; gap: 10px; align-items: center; }
.slot-col { display: grid; gap: 22px; justify-items: center; }
.doll {
  display: grid; place-items: center; min-height: 260px;
  background: radial-gradient(circle at 50% 70%, rgba(227, 179, 65, .14), transparent 60%),
              repeating-linear-gradient(0deg, transparent 0 7px, rgba(255, 255, 255, .03) 7px 8px);
}
.doll img { width: 112px; height: 224px; image-rendering: pixelated; filter: drop-shadow(0 10px 0 rgba(0, 0, 0, .35)); }
.eq-slot {
  position: relative; display: grid; place-items: center; width: 84px; height: 84px; cursor: pointer;
  background: #0f151c; border: 3px dashed #2c3a48; outline: none;
}
.eq-slot.filled { border-style: solid; border-color: var(--rarity); box-shadow: inset 0 0 14px color-mix(in srgb, var(--rarity) 35%, transparent); }
.eq-slot img { width: 64px; height: 64px; image-rendering: pixelated; }
.eq-slot .slot-label { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font: 8px var(--pixel); color: var(--muted); white-space: nowrap; }
.eq-slot.selected, .eq-slot:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.eq-slot.drop-hint { border-color: var(--gold); animation: slot-pulse 1s infinite; }
.eq-slot.drop-ok { background: rgba(227, 179, 65, .2); }
@keyframes slot-pulse { 50% { box-shadow: 0 0 0 4px rgba(227, 179, 65, .3); } }
@media (prefers-reduced-motion: reduce) { .eq-slot.drop-hint { animation: none; } }
.wallet-box { display: grid; gap: 6px; justify-items: center; margin-top: 8px; }
.hint { margin: 18px 0 0; text-align: center; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: #0f151c; border: 2px solid #2c3a48; }
.stat strong { font-size: 14px; }
.stat-value { font: 20px/1.4 var(--pixel); color: var(--text); }
.attr-card { border-color: #4b3a1c; background: linear-gradient(180deg, #1d1810, #0f151c); }
.stat-top { display: flex; justify-content: space-between; align-items: center; }
.stat-top .attr-add { width: 28px; height: 28px; padding: 0; font-size: 18px; line-height: 1; }
.pips { display: flex; gap: 3px; margin-top: 6px; }
.pips i { flex: 1; height: 6px; background: #2c3a48; }
.pips i.on { background: var(--gold); }
.pips i.new { background: var(--ok); }
.points-bar { margin-top: 14px; }

/* inventory */
.tabs { display: flex; gap: 4px; margin-left: auto; }
.tab { padding: 5px 10px; font-size: 13px; color: var(--text); background: #0f151c; border: 2px solid #2c3a48; box-shadow: none; }
.tab[aria-selected="true"] { color: var(--bg); background: var(--gold); border-color: var(--gold); }
.inventory { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.cell { position: relative; display: grid; place-items: center; aspect-ratio: 1; padding: 0; background: #0f151c; border: 2px solid #2c3a48; box-shadow: none; }
.cell.empty { opacity: .6; }
button.cell { border-color: var(--rarity); cursor: grab; }
.cell img { width: 86%; height: 86%; image-rendering: pixelated; }
.cell.equipped::after { content: ""; position: absolute; top: -4px; left: -4px; width: 10px; height: 10px; background: var(--gold); border: 2px solid #0b0f14; }
.cell.off { opacity: .4; cursor: not-allowed; }
.cell.selected { outline: 2px solid var(--gold); outline-offset: 2px; }

/* selected item */
.detail { display: flex; gap: 14px; align-items: flex-start; }
.detail img { width: 80px; height: 80px; flex: none; padding: 6px; background: #0f151c; border: 2px solid var(--rarity); image-rendering: pixelated; }
.detail > div { display: flex; flex-direction: column; gap: 3px; }
.detail .rarity { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--rarity); }
.detail strong { font-size: 18px; }
.detail .bonus { color: var(--ok); }
.p-detail .actions { margin-top: 14px; }

/* Special move (shop) */
.skill-card { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 8px; }
.skill-card > div { flex: 1; min-width: 0; }
.skill-card p { margin: 4px 0; }
.skill-card .pips { max-width: 200px; }
.ultimate-card { border-left-color: #ff5aff; }
@media (max-width: 640px) { .skill-card { flex-direction: column; align-items: stretch; } }

/* Appearance picker (character sheet) */
.look-picker { margin-top: 14px; }
.look-picker h3 { margin: 0 0 8px; font-size: 14px; }
.coats { display: flex; flex-wrap: wrap; gap: 6px; }
.coats .coat { padding: 4px 6px; background: #121a23; border: 2px solid var(--line); border-radius: 6px; cursor: pointer; line-height: 0; }
.coats .coat.on { border-color: var(--gold); }
.eyes { display: flex; gap: 8px; margin-top: 10px; }
.eyes .eye { width: 26px; height: 26px; padding: 0; border-radius: 50%; background: var(--eye); border: 3px solid #0d1117; box-shadow: 0 0 0 2px var(--line); cursor: pointer; }
.eyes .eye.on { box-shadow: 0 0 0 3px var(--gold); }

/* Admin: chat commands reference */
.commands { width: 100%; margin-top: 12px; }
.commands th, .commands td { text-align: left; white-space: normal; vertical-align: top; }
.commands code { color: var(--gold); white-space: nowrap; }
.commands .cmd-group { padding-top: 18px; text-align: left; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }

/* Admin tabs */
.admin-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin: 20px 0 18px; border-bottom: 2px solid var(--line); }
.admin-tabs button { padding: 10px 10px; font: 11px var(--pixel); color: var(--muted); background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; border-radius: 0; cursor: pointer; }
.admin-tabs button[aria-selected="true"] { color: var(--gold); border-bottom-color: var(--gold); }
.group-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 4px; }
.group-tabs button { padding: 6px 12px; font: inherit; font-size: 14px; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.group-tabs button[aria-pressed="true"] { color: #0d1117; background: var(--gold); border-color: var(--gold); }
.admin fieldset { margin: 0; padding: 0; border: 0; }
.admin legend { margin: 18px 0 4px; padding: 0; font-size: 18px; color: var(--accent); }
.commands .cmd-note { margin-left: 8px; color: var(--err, #f05050); text-transform: none; letter-spacing: 0; }

/* Selling items (profile): the second click confirms. */
.sell-row { margin: 10px 0 0; }
button.confirm { color: #ffd84a; border-color: #ffd84a; }

/* Admin overview */
.overview h3 { margin: 22px 0 10px; }
.ov-table { border-collapse: collapse; min-width: 280px; }
.ov-table th, .ov-table td { padding: 6px 14px 6px 0; text-align: left; border-bottom: 1px solid var(--line); }
.ov-table td + td, .ov-table th + th { text-align: right; }
.ov-bars div { display: grid; grid-template-columns: 60px 1fr 50px; align-items: center; gap: 10px; margin: 6px 0; }
.ov-bars i { display: block; height: 12px; min-width: 2px; background: var(--gold); border-radius: 3px; }
.ov-bars b { text-align: right; }
button.danger { color: #ff7a7a; border-color: #ff7a7a; }

/* Boss fight control page (boss.html) */
.boss-page { max-width: 760px; }
.boss-help { margin: 16px 0; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); }
.boss-help summary { cursor: pointer; font-weight: 700; color: var(--gold); }
.boss-help li { margin: 6px 0; line-height: 1.45; }
.boss-page kbd { display: inline-block; padding: 1px 5px; font: 11px var(--pixel); color: var(--text); background: #0b0f14; border: 1px solid var(--line); }
.boss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.boss-pick { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; color: var(--text);
  background: var(--panel); border: 2px solid var(--line); font-size: 12px; }
.boss-pick canvas { width: 64px; height: 56px; object-fit: contain; image-rendering: pixelated; }
.boss-pick canvas.kitten { object-position: 50% 100%; }
.boss-pick[aria-checked="true"] { border-color: var(--gold); background: #2a2410; }
.boss-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0; }
.boss-fight { padding: 12px; background: var(--panel); border: 1px solid var(--line); }
.boss-fight.off .boss-controls, .boss-fight.off canvas { opacity: .35; pointer-events: none; }
.boss-hud { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 10px; }
.boss-hp { position: relative; flex: 1 1 260px; height: 22px; background: #0b0f14; border: 1px solid var(--line); }
.boss-hp i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--danger); transition: width .3s; }
.boss-hp i.rage { background: repeating-linear-gradient(45deg, #f85149 0 8px, #b02020 8px 16px); }
.boss-hp span { position: relative; padding: 0 8px; font-size: 12px; line-height: 22px; }
#map { display: block; width: 100%; max-width: 440px; margin: 0 auto 12px; aspect-ratio: 880 / 620; height: auto; border: 1px solid var(--line); }
.boss-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 20px; }
.boss-stick { position: relative; width: 150px; height: 150px; border-radius: 50%; background: #0b0f14; border: 2px solid var(--line); touch-action: none; }
.boss-stick i { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px; border-radius: 50%; background: var(--accent); pointer-events: none; }
.boss-moves { display: grid; gap: 8px; min-width: 220px; }
.boss-moves button { text-align: left; }
.boss-moves button i { font-style: normal; color: var(--gold); }
.boss-say { display: flex; gap: 8px; max-width: 440px; margin: 0 auto 8px; }
.boss-say input { flex: 1; min-width: 0; padding: 8px 10px; font: inherit; color: var(--text); background: #0b0f14; border: 1px solid var(--line); }
.boss-taunts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 520px; margin: 0 auto 14px; }
.boss-taunts button { padding: 4px 8px; font-size: 12px; }

/* Scrolls (shop) */
.scroll-list { display: grid; gap: 8px; }
.scroll-rules { margin: 4px 0 10px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); line-height: 1.5; }
.scroll-card { border-left-color: #8ad8ff; }
.scroll-head { margin: 16px 0 8px; font-size: 15px; }
.scroll-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.scroll-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; font-size: 13px; background: #0b0f14; border: 1px solid var(--line); border-left: 3px solid #8ad8ff; cursor: help; }
.scroll-chip b { color: var(--gold); }
.scroll-chip code { font-size: 11px; color: var(--muted); }

/* Admin: channel points */
.pts-help { padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); }
.pts-help li { margin: 6px 0; line-height: 1.45; }
.pts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; padding: 10px; margin: 8px 0; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid #9146ff; }
.pts-row > div { grid-column: 1 / -1; }
.pts-row input, .pts-row select { min-width: 0; padding: 6px 8px; font: inherit; color: var(--text); background: #0b0f14; border: 1px solid var(--line); }
.pts-table { width: 100%; border-collapse: collapse; }
.pts-table th, .pts-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--line); }
.pts-table td:last-child { width: 1%; white-space: nowrap; }
.pts-table button { padding: 4px 8px; font-size: 12px; }
.pts-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.pts-list li { padding: 6px 10px; background: var(--panel); border: 1px solid var(--line); }
.pts-list li.done { opacity: .6; }
.pts-which { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; font-weight: 600; }
.pts-which select { flex: 1; }
.points-head { margin: 26px 0 6px; color: var(--accent); font-size: 18px; }

/* admin: games paused / running */
.pause-bar[hidden] { display: none; }
.pause-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; padding: 10px 14px; border: 2px solid var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.pause-bar.paused { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent); }
.pause-bar > span:first-child { font-weight: 600; }
.pause-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#pause-text { flex: 1; min-width: 180px; padding: 8px 10px; font: inherit; color: var(--text); background: #0f151c; border: 1px solid var(--line); border-radius: 6px; }
#lobby-msg { margin: -10px 0 14px; }
#lobby-msg:empty { display: none; }

/* admin: announcement bar */
.announce-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; padding: 10px 14px; border: 2px solid var(--line); background: var(--panel); }
.announce-bar[hidden] { display: none; }
.announce-bar label { font-weight: 600; white-space: nowrap; }
.announce-bar input { flex: 1; min-width: 200px; padding: 8px 10px; font: inherit; color: var(--text); background: #0f151c; border: 1px solid var(--line); border-radius: 6px; }
#announce-msg { margin: -10px 0 14px; }
#announce-msg:empty { display: none; }

/* Stream bar (admin): the game the stream launcher shows (streamStage.js). */
.stream-bar[hidden] { display: none; }
.stream-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 6px; padding: 10px 14px; border: 2px solid var(--gold); }
.stream-bar > span:first-child { font-weight: 600; }
.stream-games { display: flex; gap: 6px; flex-wrap: wrap; }
.stream-games button[aria-pressed="true"] { background: var(--gold); color: #1a1408; }
.stream-help { margin: 0 0 16px; }
