@font-face {
  font-family: 'Pixel';
  src: url('/assets/ui/font.ttf') format('truetype');
}

:root {
  --bg: #1b1f2e;
  --panel: #2a2f45;
  --panel-dark: #1f2335;
  --edge: #0e1018;
  --hi: #4a5272;
  --text: #f4ecd8;
  --muted: #9aa0bc;
  --gold: #ffcc4d;
  --green: #5fe08a;
  --red: #ff5a5a;
  --blue: #4fa3ff;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Pixel', 'Segoe UI', monospace;
  font-size: 16px;
  word-spacing: 0.4em;
  image-rendering: pixelated;
}
img { image-rendering: pixelated; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap { gap: 10px; }
h1, h2, h3 { margin: 0 0 12px; font-weight: normal; letter-spacing: 1px; }
h2 { font-size: 24px; color: var(--gold); }
h3 { font-size: 17px; color: var(--muted); }

/* Pixel-bordered panel (stepped corners via box-shadow) */
.panel {
  background: var(--panel);
  padding: 24px 28px;
  box-shadow:
    0 -4px 0 0 var(--edge), 0 4px 0 0 var(--edge), -4px 0 0 0 var(--edge), 4px 0 0 0 var(--edge),
    inset 0 4px 0 0 var(--hi), inset 0 -4px 0 0 var(--panel-dark),
    0 12px 0 0 rgba(0, 0, 0, 0.35);
}

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 204, 77, 0.08), transparent 55%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.025) 0 8px, transparent 8px 16px),
    linear-gradient(#232842, #141726);
}
#end-screen { background: rgba(10, 12, 20, 0.7); }

input, button {
  word-spacing: inherit;
}
input {
  font: inherit;
  color: var(--text);
  background: var(--panel-dark);
  border: none;
  padding: 10px 12px;
  outline: none;
  box-shadow: inset 0 0 0 3px var(--edge), inset 0 4px 0 3px rgba(0, 0, 0, 0.3);
  width: 100%;
}
input:focus { box-shadow: inset 0 0 0 3px var(--gold); }

.btn {
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--hi);
  border: none;
  padding: 9px 18px 12px;
  cursor: pointer;
  box-shadow: 0 0 0 3px var(--edge), inset 0 -4px 0 0 rgba(0, 0, 0, 0.35), inset 0 3px 0 0 rgba(255, 255, 255, 0.15);
  transition: transform 0.05s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(2px); box-shadow: 0 0 0 3px var(--edge), inset 0 -1px 0 0 rgba(0, 0, 0, 0.35); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: #d9822b; }
.btn.big { font-size: 22px; padding: 12px 34px 15px; }
.btn.small { font-size: 13px; padding: 5px 10px 7px; }

/* menu */
.menu-panel { width: 400px; text-align: center; display: flex; flex-direction: column; gap: 16px; }
.logo { font-size: 46px; color: var(--gold); text-shadow: 0 4px 0 #8a4b14, 0 8px 0 rgba(0, 0, 0, 0.4); margin: 0; }
.logo span { display: block; color: var(--text); font-size: 38px; text-shadow: 0 4px 0 #5a5f80, 0 8px 0 rgba(0, 0, 0, 0.4); }
.tagline { margin: 0; color: var(--muted); }
.menu-heroes { display: flex; justify-content: center; gap: 14px; }
.menu-heroes img { width: 76px; height: 76px; box-shadow: 0 0 0 4px var(--edge); background: var(--panel-dark); }
.field { display: flex; flex-direction: column; gap: 6px; text-align: left; color: var(--muted); font-size: 14px; }

/* lobby */
.lobby-panel { width: 560px; display: flex; flex-direction: column; gap: 14px; }
.room-list { display: flex; flex-direction: column; gap: 8px; min-height: 160px; max-height: 50vh; overflow-y: auto; padding: 4px; }
.room-item { display: flex; justify-content: space-between; align-items: center; background: var(--panel-dark); padding: 10px 14px; box-shadow: inset 0 0 0 3px var(--edge); }
.room-item .meta { font-size: 13px; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* room */
.room-panel { width: min(1040px, 96vw); display: flex; flex-direction: column; gap: 14px; }
.room-body { display: flex; gap: 24px; }
.room-left { width: 300px; display: flex; flex-direction: column; }
.room-right { flex: 1; }
.room-players { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.room-players li { display: flex; align-items: center; gap: 10px; background: var(--panel-dark); padding: 6px 10px; box-shadow: inset 0 0 0 3px var(--edge); }
.room-players li.me { box-shadow: inset 0 0 0 3px var(--gold); }
.room-players img { width: 36px; height: 36px; }
.room-players .cls { color: var(--muted); font-size: 13px; }
.room-players .host { margin-left: auto; color: var(--gold); font-size: 12px; }
.room-chat { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.room-chat-log { height: 120px; overflow-y: auto; background: var(--panel-dark); padding: 6px 8px; font-size: 13px; box-shadow: inset 0 0 0 3px var(--edge); }
.class-select { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-height: 58vh; overflow-y: auto; padding: 4px; align-content: start; }
.card-abs { display: flex; gap: 8px; margin-top: 8px; }
.card-abs img { width: 36px; height: 36px; box-shadow: 0 0 0 2px var(--edge); }
.class-card { background: var(--panel-dark); padding: 14px; cursor: pointer; box-shadow: inset 0 0 0 3px var(--edge); display: flex; flex-direction: column; gap: 8px; transition: transform 0.08s; }
.class-card:hover { transform: translateY(-3px); }
.class-card.selected { box-shadow: inset 0 0 0 3px var(--gold), 0 0 0 3px rgba(255, 204, 77, 0.25); }
.class-card .head { display: flex; align-items: center; gap: 10px; }
.class-card .head img { width: 56px; height: 56px; box-shadow: 0 0 0 3px var(--edge); }
.class-card .name { font-size: 22px; }
.class-card .role { font-size: 13px; color: var(--muted); }
.class-card .stats { font-size: 12px; color: var(--muted); }
.class-card .ab { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; line-height: 1.3; }
.class-card .ab img { width: 28px; height: 28px; flex: none; }
.class-card .ab b { color: var(--gold); font-weight: normal; }
.room-foot { margin-top: 4px; }
.start-wrap { text-align: right; }

/* in-game HUD */
#game-container { position: fixed; inset: 0; }
#game-container canvas { display: block; }
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.7); }
#topbar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); text-align: center; }
#timer { font-size: 30px; background: rgba(15, 17, 28, 0.75); padding: 2px 18px 6px; box-shadow: 0 0 0 3px var(--edge); }
#goal { margin-top: 6px; }
#scores { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 220px; }
.score-row { display: flex; align-items: center; gap: 8px; background: rgba(15, 17, 28, 0.75); padding: 4px 10px; box-shadow: 0 0 0 2px var(--edge); font-size: 14px; }
.score-row .sw { width: 10px; height: 10px; box-shadow: 0 0 0 2px var(--edge); }
.score-row .n { flex: 1; }
.score-row .k { color: var(--gold); min-width: 26px; text-align: right; }
.score-row .d { color: var(--muted); font-size: 12px; min-width: 30px; text-align: right; }
.score-row.me { box-shadow: 0 0 0 2px var(--gold); }
#killfeed { position: absolute; right: 14px; bottom: 52px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.kf { background: rgba(15, 17, 28, 0.75); padding: 4px 10px; font-size: 14px; box-shadow: 0 0 0 2px var(--edge); animation: kfin 0.2s; }
.kf .x { color: var(--muted); margin: 0 6px; }
@keyframes kfin { from { transform: translateX(20px); opacity: 0; } }
#announce { position: absolute; top: 22%; width: 100%; text-align: center; font-size: 40px; color: var(--gold); text-shadow: 0 4px 0 #8a4b14, 0 7px 0 rgba(0, 0, 0, 0.5); opacity: 0; transition: opacity 0.3s; }
#announce.show { opacity: 1; }
#respawn { position: absolute; top: 40%; width: 100%; text-align: center; font-size: 34px; color: var(--red); }
#respawn-time { font-size: 60px; color: var(--text); }
#chat { position: absolute; left: 12px; bottom: 150px; width: 380px; pointer-events: auto; }
#chat-log { display: flex; flex-direction: column; gap: 2px; font-size: 14px; max-height: 200px; overflow: hidden; }
#chat-log div { animation: fadeout 9s forwards; }
#chat.open #chat-log div { animation: none; }
@keyframes fadeout { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
#chat-input { margin-top: 6px; }

#bottom { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 12px; align-items: flex-end; background: rgba(15, 17, 28, 0.82); padding: 10px 14px; box-shadow: 0 0 0 4px var(--edge), inset 0 3px 0 0 var(--hi); pointer-events: auto; }
#portrait img { width: 88px; height: 88px; box-shadow: 0 0 0 3px var(--edge); display: block; background: var(--panel-dark); }
#status { position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -12px); display: flex; gap: 10px; }
.badge { padding: 4px 10px; font-size: 14px; white-space: nowrap; box-shadow: 0 0 0 3px var(--edge); }
.badge.hidden-st { color: #b9f5c6; background: rgba(20, 60, 34, 0.9); }
.badge.stun { color: #2a2000; background: #ffe14d; }
.badge.silence { color: #f3e3ff; background: #7a3fb0; }
.badge.root { color: #e6f7ff; background: #2f7fb8; }
.badge.slow { color: #0e1e30; background: #9fc8ff; }
#bottom-main { display: flex; flex-direction: column; gap: 8px; }
#hp-bar { position: relative; height: 22px; background: #3a1018; box-shadow: 0 0 0 3px var(--edge); }
#hp-fill { position: absolute; inset: 0; width: 100%; background: linear-gradient(#7cf29a 0 30%, #36b35a 30% 100%); transition: width 0.12s; }
#res-bar { position: relative; height: 14px; margin-top: -2px; background: #141a2e; box-shadow: 0 0 0 3px var(--edge); }
#res-fill { position: absolute; inset: 0; width: 100%; transition: width 0.12s; }
#res-text { position: relative; display: block; text-align: center; font-size: 11px; line-height: 14px; }
.ability.poor img { filter: saturate(0.3) brightness(0.55) sepia(0.4) hue-rotate(190deg); }
#hp-text { position: relative; display: block; text-align: center; font-size: 15px; line-height: 21px; }
#abilities { display: flex; gap: 10px; }
.ability { position: relative; width: 60px; height: 60px; background: var(--panel-dark); box-shadow: 0 0 0 3px var(--edge), inset 0 0 0 2px var(--hi); }
.ability img { width: 100%; height: 100%; display: block; }
.ability .key { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); background: var(--edge); padding: 0 5px 2px; font-size: 11px; color: var(--gold); white-space: nowrap; }
.ability .cost { position: absolute; top: 1px; left: 3px; font-size: 12px; text-shadow: 0 0 2px #000, 0 2px 0 #000; }
#char-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; align-self: center; font-size: 11px; padding-right: 10px; margin-right: 2px; border-right: 2px solid rgba(255, 255, 255, 0.08); }
#char-stats div { display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; }
#char-stats span { color: var(--muted); }
#char-stats b { color: var(--text); font-weight: normal; }
.ability .cd { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; background: rgba(0, 0, 0, 0.6); }
.ability.ready { box-shadow: 0 0 0 3px var(--edge), inset 0 0 0 2px var(--gold); }
.ability.flash { animation: flash 0.3s; }
.ability.locked img { filter: grayscale(1) brightness(0.5); }
@keyframes flash { 50% { filter: brightness(2); } }

#help-hint { position: absolute; right: 14px; bottom: 14px; font-size: 13px; color: var(--muted); background: rgba(15, 17, 28, 0.75); padding: 4px 10px; box-shadow: 0 0 0 2px var(--edge); pointer-events: auto; cursor: pointer; }
#help { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 460px; pointer-events: auto; line-height: 1.7; }
#help kbd { display: inline-block; background: var(--panel-dark); padding: 0 6px; box-shadow: 0 0 0 2px var(--edge); color: var(--gold); font-family: inherit; }
#tooltip { position: absolute; max-width: 280px; background: rgba(15, 17, 28, 0.95); padding: 10px 12px; box-shadow: 0 0 0 3px var(--edge); font-size: 13px; line-height: 1.4; }
#tooltip b { color: var(--gold); font-weight: normal; font-size: 16px; }

/* end */
.end-panel { width: 560px; text-align: center; }
#end-title { font-size: 56px; color: var(--gold); text-shadow: 0 4px 0 #8a4b14, 0 8px 0 rgba(0, 0, 0, 0.4); }
#end-title.lose { color: var(--red); text-shadow: 0 4px 0 #6a1414, 0 8px 0 rgba(0, 0, 0, 0.4); }
.end-table { width: 100%; border-collapse: collapse; margin: 10px 0 20px; font-size: 15px; }
.end-table th { color: var(--muted); font-weight: normal; font-size: 13px; padding: 4px; }
.end-table td { padding: 6px 4px; background: var(--panel-dark); border-top: 4px solid var(--panel); }
.end-table td img { width: 28px; height: 28px; vertical-align: middle; }
.end-table tr.me td { color: var(--gold); }

.bot-controls { display: flex; align-items: center; gap: 8px; margin: -4px 0 14px; flex-wrap: wrap; }
.room-players .kick { margin-left: 8px; padding: 2px 8px 4px; }
.room-players .host + .kick { margin-left: 8px; }

/* main menu extras */
.menu-row { display: flex; gap: 10px; }
.menu-row .btn { flex: 1; }
.credits { margin: 0; font-size: 11px; opacity: 0.7; }
.btn.danger { background: #b23b3b; }

/* modals */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(8, 10, 18, 0.6); }
.modal-panel { display: flex; flex-direction: column; gap: 12px; min-width: 340px; }
.pause-panel { width: 340px; text-align: center; }
.pause-panel p { margin: -6px 0 4px; }
.settings-panel { width: 420px; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 15px; }
.setting.check { justify-content: flex-start; cursor: pointer; }
.setting input[type=range] { width: 180px; padding: 0; }
.setting select { font: inherit; word-spacing: inherit; font-size: 14px; color: inherit; background: var(--panel-dark); border: none; padding: 4px 8px; box-shadow: 0 0 0 3px var(--edge); cursor: pointer; }
body.dev #chat { display: none; }
#dev { position: absolute; left: 12px; top: 150px; bottom: 16px; width: 330px; overflow-y: auto; padding: 10px 14px; font-size: 13px; pointer-events: auto; text-shadow: none; }
.dev-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; color: var(--gold); }
.dev-sec { padding: 6px 0; border-top: 2px solid rgba(0, 0, 0, 0.25); }
.dev-label { margin-bottom: 6px; }
.dev-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.dev-check { display: flex; align-items: center; gap: 6px; margin: 2px 4px 2px 0; cursor: pointer; }
.dev-inline { align-self: center; }
.dev-check input { width: 16px; height: 16px; }
.dev-ab { display: grid; grid-template-columns: 52px 1fr auto; gap: 6px; align-items: center; margin: 5px 0; }
.dev-key { color: var(--gold); font-size: 12px; }
.dev-ab select { font: inherit; word-spacing: inherit; font-size: 12px; color: inherit; background: var(--panel-dark); border: none; padding: 4px 6px; box-shadow: 0 0 0 2px var(--edge); min-width: 0; }
#dev-json { width: 100%; height: 200px; resize: vertical; font: 12px/1.35 ui-monospace, Consolas, monospace; word-spacing: normal; color: var(--text); background: var(--panel-dark); border: none; padding: 8px; box-shadow: inset 0 0 0 2px var(--edge); }
.dev-error { margin: 6px 0 0; white-space: pre-wrap; color: #ff8a8a; font: 12px/1.35 ui-monospace, Consolas, monospace; word-spacing: normal; }
.tip-stats { margin-top: 6px; font-size: 12px; color: var(--gold); line-height: 1.5; }
.setting input[type=checkbox] { width: 20px; height: 20px; }
.howto-panel { width: 520px; line-height: 1.7; }
.howto-panel kbd { display: inline-block; background: var(--panel-dark); padding: 0 6px; box-shadow: 0 0 0 2px var(--edge); color: var(--gold); font-family: inherit; }
.howto-panel .cls { margin-top: 6px; font-size: 13px; color: var(--muted); }
.howto-panel .cls b { font-weight: normal; }

/* stats overlay, top-left */
#stats { position: fixed; top: 10px; left: 12px; z-index: 15; pointer-events: none; font-size: 13px; line-height: 1.45; background: rgba(15, 17, 28, 0.78); padding: 6px 10px 7px; box-shadow: 0 0 0 2px var(--edge); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.7); min-width: 190px; }
#stats .row { display: flex; justify-content: space-between; gap: 14px; }
#stats .k { color: var(--muted); }
#stats .good { color: var(--green); }
#stats .ok { color: var(--gold); }
#stats .bad { color: var(--red); }

/* ---------------------------------------------------------------- creators (client/workshop/) */
.ws-panel { width: min(1280px, 96vw); height: min(880px, 94vh); display: flex; flex-direction: column; gap: 12px; padding: 18px 22px; }
.ws-panel h2 { margin: 0; }
.ws-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px 1fr 320px; gap: 18px; }
.ws-side, .ws-preview { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.ws-preview { overflow-y: auto; }
.ws-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding: 3px; }
.ws-item { position: relative; display: flex; align-items: center; gap: 8px; text-align: left; font: inherit; font-size: 13px; word-spacing: inherit; color: var(--text); background: var(--panel-dark); border: none; padding: 6px 8px; cursor: pointer; box-shadow: inset 0 0 0 2px var(--edge); }
.ws-item:hover { filter: brightness(1.15); }
.ws-item.selected { box-shadow: inset 0 0 0 2px var(--gold); }
.ws-item img { width: 32px; height: 32px; image-rendering: pixelated; flex: none; }
.ws-item small { display: block; color: var(--muted); font-size: 11px; }
.ws-badge { margin-left: auto; font-style: normal; font-size: 10px; color: var(--gold); white-space: nowrap; }
.ws-main { overflow-y: auto; min-height: 0; padding: 0 8px 0 2px; }
.ws-sec { padding: 6px 0 14px; border-top: 2px solid rgba(0, 0, 0, 0.25); }
.ws-sec h3 { margin: 6px 0 10px; color: var(--gold); }
.ws-grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 8px 12px; flex: 1; }
.ws-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.ws-field input, .ws-field select, .ws-field textarea, .ws-foot select { font: inherit; font-size: 13px; word-spacing: inherit; color: var(--text); background: var(--panel-dark); border: none; padding: 7px 8px; box-shadow: inset 0 0 0 3px var(--edge); width: 100%; }
.ws-field textarea { resize: vertical; margin-bottom: 4px; }
.ws-field input[type=color] { height: 34px; padding: 3px; cursor: pointer; }
.ws-bool { flex-direction: row; align-items: center; gap: 8px; margin: 6px 0; cursor: pointer; }
.ws-bool input { width: 18px; height: 18px; }
.ws-help { color: var(--muted); font-size: 11px; margin-left: 6px; }
.ws-basics { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 8px; }
.ws-icon { flex: none; width: 76px; height: 76px; padding: 8px; background: var(--panel-dark); border: none; cursor: pointer; box-shadow: 0 0 0 3px var(--edge), inset 0 0 0 2px var(--hi); }
.ws-icon:hover { box-shadow: 0 0 0 3px var(--edge), inset 0 0 0 2px var(--gold); }
.ws-icon img { width: 100%; height: 100%; image-rendering: pixelated; }
.ws-preview canvas { width: 100%; height: auto; box-shadow: 0 0 0 3px var(--edge); }
.ws-errors { margin: 0; white-space: pre-wrap; color: #ff8a8a; font: 12px/1.35 ui-monospace, Consolas, monospace; word-spacing: normal; }
.ws-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ws-foot > span:first-child { margin-right: auto; }
.ws-foot select { width: auto; }
.ws-try { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.ws-picker { width: min(780px, 92vw); max-height: 86vh; display: flex; flex-direction: column; gap: 12px; }
.ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; overflow-y: auto; padding: 3px; }
.ws-pick { background: var(--panel-dark); border: none; padding: 6px; cursor: pointer; box-shadow: inset 0 0 0 2px var(--edge); }
.ws-pick img { width: 42px; height: 42px; image-rendering: pixelated; }
.ws-pick:hover, .ws-pick.selected { box-shadow: inset 0 0 0 2px var(--gold); }
.ws-json { width: 100%; height: 52vh; resize: vertical; font: 12px/1.4 ui-monospace, Consolas, monospace; word-spacing: normal; color: var(--text); background: var(--panel-dark); border: none; padding: 10px; box-shadow: inset 0 0 0 3px var(--edge); }
.ws-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px 18px; }
.ws-stat { display: grid; grid-template-columns: 150px 1fr 52px; align-items: center; gap: 10px; font-size: 13px; }
.ws-stat small { display: block; color: var(--muted); font-size: 10px; }
.ws-stat input[type=range] { width: 100%; padding: 0; }
.ws-stat output { text-align: right; color: var(--gold); }
.ws-slot { display: grid; grid-template-columns: 52px 36px 1fr; align-items: center; gap: 10px; margin: 6px 0; }
.ws-slot img { width: 36px; height: 36px; box-shadow: 0 0 0 2px var(--edge); }
.ws-slot select { font: inherit; font-size: 13px; word-spacing: inherit; color: var(--text); background: var(--panel-dark); border: none; padding: 7px 8px; box-shadow: inset 0 0 0 3px var(--edge); }
.ws-sprite { align-self: center; width: 160px; height: 160px; image-rendering: pixelated; background: #1b2033; box-shadow: 0 0 0 3px var(--edge); }
.ch-summary h3 { margin: 0; }
.ch-summary p { margin: 2px 0 8px; }
.ch-ab { display: flex; gap: 8px; margin: 8px 0; font-size: 12px; }
.ch-ab img { width: 32px; height: 32px; flex: none; }
.ch-ab .tip-stats { margin-top: 2px; font-size: 11px; }

/* ---------------------------------------------------------------- pixel UI kit (client/ui.js): no native widgets */
select[data-ui] { display: none !important; }
.ui-select { position: relative; display: block; width: 100%; min-width: 90px; text-align: left; font: inherit; font-size: 13px; word-spacing: inherit; color: var(--text); background: var(--panel-dark); border: none; padding: 7px 28px 7px 8px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: inset 0 0 0 3px var(--edge); }
.ui-select::after { content: ''; position: absolute; right: 10px; top: 50%; margin-top: -2px; border: 5px solid transparent; border-top-color: var(--gold); border-bottom: 0; }
.ui-select:hover { box-shadow: inset 0 0 0 3px var(--hi); }
.ui-select:disabled { opacity: 0.5; cursor: default; }
.ui-menu { position: fixed; z-index: 200; overflow-y: auto; display: flex; flex-direction: column; padding: 3px; background: var(--panel-dark); box-shadow: 0 0 0 3px var(--edge), 0 8px 0 rgba(0, 0, 0, 0.35); }
.ui-option { text-align: left; font: inherit; font-size: 13px; word-spacing: inherit; color: var(--text); background: none; border: none; padding: 6px 10px; cursor: pointer; white-space: nowrap; }
.ui-option:hover { background: var(--hi); }
.ui-option.selected { color: var(--gold); }
.ui-tip { position: fixed; z-index: 300; max-width: 320px; pointer-events: none; background: rgba(15, 17, 28, 0.96); padding: 8px 10px; box-shadow: 0 0 0 3px var(--edge); font-size: 12px; line-height: 1.4; color: var(--text); }
.ui-modal { z-index: 250; }
.ui-dialog { width: min(440px, 90vw); }
.ui-dialog p { margin: 0; line-height: 1.5; }
.ui-actions { justify-content: flex-end; }
.ui-palette { display: grid; grid-template-columns: repeat(10, 34px); gap: 6px; }
.ui-swatch { width: 34px; height: 34px; border: none; cursor: pointer; box-shadow: inset 0 0 0 2px var(--edge); }
.ui-swatch:hover, .ui-swatch.selected { box-shadow: inset 0 0 0 2px var(--edge), 0 0 0 3px var(--gold); }
.ui-color-field { display: block; }
.ui-color { display: block; width: 100%; height: 34px; border: none; cursor: pointer; box-shadow: inset 0 0 0 3px var(--edge), inset 0 0 0 5px rgba(255, 255, 255, 0.15); }

/* checkboxes: pixel box with a pixel check */
input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 0; padding: 0; flex: none; cursor: pointer; background: var(--panel-dark); box-shadow: inset 0 0 0 3px var(--edge); }
input[type=checkbox]:checked { background: #d9822b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 9' shape-rendering='crispEdges'%3E%3Cpath fill='%23fff3d6' d='M7 2h1v2H7zM6 3h1v2H6zM5 4h1v2H5zM4 5h1v2H4zM3 6h1v1H3zM2 5h1v1H2zM1 4h1v1H1z'/%3E%3C/svg%3E") center / 14px no-repeat; box-shadow: inset 0 0 0 3px var(--edge); }
input[type=checkbox]:hover { box-shadow: inset 0 0 0 3px var(--hi); }

/* sliders */
input[type=range] { appearance: none; -webkit-appearance: none; height: 20px; padding: 0; background: transparent; box-shadow: none; cursor: pointer; }
.setting .ui-select { width: 190px; }
.ws-try .ui-select { width: 86px; }
.dev-ab .ui-select { font-size: 12px; padding-top: 5px; padding-bottom: 5px; }
input[type=range]::-webkit-slider-runnable-track { height: 8px; background: var(--panel-dark); box-shadow: 0 0 0 2px var(--edge); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 18px; margin-top: -5px; background: #d9822b; box-shadow: 0 0 0 2px var(--edge), inset 0 3px 0 rgba(255, 255, 255, 0.3); }
input[type=range]::-moz-range-track { height: 8px; background: var(--panel-dark); box-shadow: 0 0 0 2px var(--edge); }
input[type=range]::-moz-range-thumb { width: 12px; height: 18px; border: none; border-radius: 0; background: #d9822b; box-shadow: 0 0 0 2px var(--edge), inset 0 3px 0 rgba(255, 255, 255, 0.3); }

/* number fields without the browser's spinner arrows */
input[type=number] { appearance: textfield; -moz-appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* scrollbars */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--panel-dark); box-shadow: inset 0 0 0 2px var(--edge); }
::-webkit-scrollbar-thumb { background: var(--hi); box-shadow: inset 0 0 0 2px var(--edge), inset 0 3px 0 rgba(255, 255, 255, 0.15); }
::-webkit-scrollbar-thumb:hover { background: #5d668a; }
::-webkit-scrollbar-button, ::-webkit-scrollbar-corner { display: none; background: transparent; }
@supports (-moz-appearance: none) {
  * { scrollbar-color: var(--hi) var(--panel-dark); }
}
