:root {
  --bg: #07070a;
  --ink: #ece8e1;
  --dim: #8d8a85;
  --line: rgba(236, 232, 225, 0.12);
  --neon: #ff3d3d;
  --ok: #7ee0a8;
  --card: rgba(12, 12, 16, 0.86);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font: 14px/1.45 Inter, system-ui, sans-serif; }
canvas#bevy { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
[hidden] { display: none !important; }

.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; text-align: center; background: var(--bg); z-index: 20; }
.screen.dim { background: rgba(4, 4, 6, 0.82); backdrop-filter: blur(2px); }

.sign { margin: 0; font: 400 clamp(44px, 9vw, 96px)/1 "Tilt Neon", Inter, sans-serif; letter-spacing: 0.06em; color: #ffe9e9; text-shadow: 0 0 6px var(--neon), 0 0 22px var(--neon), 0 0 60px rgba(255, 61, 61, 0.5); }
.sign.small { font-size: 40px; }
.sign .no { animation: buzz 6s infinite steps(1); }
@keyframes buzz {
  0%, 18%, 22%, 64%, 66%, 100% { opacity: 1; }
  19%, 21%, 65% { opacity: 0.15; text-shadow: none; }
}
.tag { margin: 0; color: var(--dim); max-width: 34ch; font-size: 16px; }
.fine { margin: 0; color: var(--dim); font-size: 12px; }
.label { color: var(--dim); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.big { margin: 0; font-size: 28px; font-variant-numeric: tabular-nums; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: 500 14px Inter, sans-serif; text-decoration: none; cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.1s; }
.btn:hover { border-color: rgba(236, 232, 225, 0.35); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: #111; border-color: var(--ink); }
.btn.primary:hover { background: #fff; }
.btn.ghost { height: 30px; padding: 0 12px; font-size: 12px; }
.btn:disabled { opacity: 0.4; cursor: default; }

#devform { display: flex; gap: 8px; }
input:not([type]) { height: 38px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; }

.bar { width: min(320px, 70vw); height: 2px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width 0.2s; }

.card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card header b { font-size: 16px; letter-spacing: 0.12em; }
.row { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.row.slider { justify-content: space-between; }
.row input[type=range] { width: 60%; accent-color: var(--ink); }
.row input[type=checkbox] { accent-color: var(--ink); }
.keys { line-height: 1.6; }

#players, #r-crew { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
#players li { display: flex; align-items: center; gap: 10px; height: 32px; }
.av { width: 28px; height: 28px; border-radius: 6px; background: #222 center/cover; flex: none; display: grid; place-items: center; font-size: 12px; color: var(--dim); outline: 2px solid transparent; outline-offset: 1px; transition: outline-color 0.1s; }
.av.talk { outline-color: var(--ok); }
#players .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#players .state { font-size: 12px; color: var(--dim); }
#players .state.ready { color: var(--ok); }
#r-crew { flex-direction: row; flex-wrap: wrap; justify-content: center; }
#r-crew li { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 72px; font-size: 11px; color: var(--dim); }
#r-crew .av { width: 44px; height: 44px; }
#r-crew li.gone .av { filter: grayscale(1) brightness(0.4); }
#result h2 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px #000; }
#hud .clock { position: absolute; top: 16px; left: 18px; display: flex; gap: 10px; align-items: baseline; font-size: 18px; }
#hud .clock #night { font-size: 11px; color: var(--dim); letter-spacing: 0.14em; text-transform: uppercase; }
#hud .clock.late #clock { color: var(--neon); }
#hud .money { position: absolute; top: 16px; right: 18px; font-size: 18px; }
#hud .money .of { color: var(--dim); font-size: 14px; }
#hud .money.met #total { color: var(--ok); }
#dot { position: absolute; left: 50%; top: 50%; width: 3px; height: 3px; margin: -1.5px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); }
#prompt { position: absolute; left: 50%; top: calc(50% + 28px); transform: translateX(-50%); font-size: 13px; letter-spacing: 0.02em; white-space: nowrap; }
#stamina { position: absolute; left: 50%; bottom: 28px; width: 120px; height: 2px; margin-left: -60px; background: var(--line); opacity: 0; transition: opacity 0.4s; }
#stamina.show { opacity: 1; }
#stamina i { display: block; height: 100%; background: var(--ink); }
#rec { position: absolute; left: 18px; top: 44px; color: var(--neon); font-size: 12px; letter-spacing: 0.1em; animation: blink 1s infinite steps(1); }
@keyframes blink { 50% { opacity: 0.35; } }
#mic { position: absolute; left: 18px; bottom: 22px; width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--dim); overflow: hidden; }
#mic i { position: absolute; inset: 0; background: var(--ink); transform: scale(0); border-radius: 50%; }
#mic.loud { border-color: var(--neon); }
#mic.loud i { background: var(--neon); }
#mic.off { border-style: dashed; opacity: 0.5; }
#plates span { position: absolute; transform: translate(-50%, -100%); font-size: 12px; color: rgba(236, 232, 225, 0.8); white-space: nowrap; }
#watch { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); font-size: 13px; color: var(--dim); text-align: center; }
#watch b { display: block; color: var(--ink); font-size: 18px; font-weight: 500; margin-bottom: 4px; }

#toast { position: fixed; z-index: 30; left: 50%; top: 22%; transform: translateX(-50%); font-size: 15px; letter-spacing: 0.04em; text-shadow: 0 1px 3px #000; pointer-events: none; animation: fade 3.2s forwards; }
@keyframes fade { 0% { opacity: 0; } 8%, 75% { opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .sign .no, #rec { animation: none; }
}
#clickin { position: fixed; z-index: 12; left: 50%; top: 58%; transform: translateX(-50%); padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-size: 13px; pointer-events: none; }

.steam { display: inline-block; line-height: 0; border-radius: 3px; transition: filter 0.15s; }
.steam:hover { filter: brightness(1.15); }

.me { position: absolute; top: 18px; right: 20px; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.me .av { width: 26px; height: 26px; }
.menu { display: flex; flex-direction: column; gap: 10px; width: min(280px, 80vw); margin-top: 10px; }
.menu .btn { width: 100%; height: 42px; }
.join { display: flex; gap: 8px; }
.join input { flex: 1; min-width: 0; height: 42px; text-transform: uppercase; letter-spacing: 0.3em; text-align: center; }
.join .btn { width: auto; }
.row2 { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.link { background: none; border: 0; text-decoration: none; padding: 4px 0; color: var(--dim); font: 500 13px Inter, sans-serif; cursor: pointer; }
.link:hover { color: var(--ink); }
.link.danger:hover { color: var(--neon); }

.slides { position: relative; width: min(440px, 86vw); min-height: 230px; }
.slide { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; align-items: center; opacity: 0; transform: translateY(6px); transition: opacity 0.3s, transform 0.3s; pointer-events: none; }
.slide.on { opacity: 1; transform: none; }
.slide h2 { margin: 0; font-size: 26px; font-weight: 600; }
.slide p { margin: 0; color: #c9c5be; font-size: 15px; line-height: 1.6; }
.slide .keys { color: var(--dim); font-size: 12px; margin-top: 8px; }
.dots { display: flex; gap: 6px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--ink); }

.modal { position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; background: rgba(4, 4, 6, 0.55); padding: 16px; }
.modal .card { width: min(360px, 100%); max-height: calc(100vh - 32px); overflow: auto; display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); backdrop-filter: blur(8px); }
.modal .card.wide { width: min(440px, 100%); }
.card h3 { margin: 8px 0 0; font-size: 11px; font-weight: 500; color: var(--dim); letter-spacing: 0.14em; text-transform: uppercase; }
.roomline { display: flex; align-items: center; gap: 8px; }
.roomline b { letter-spacing: 0.2em; font-size: 16px; flex: 1; }
.set { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; min-height: 28px; cursor: pointer; }
.set input[type=range] { flex: 1; max-width: 170px; margin-left: auto; accent-color: var(--ink); }
.set output { width: 34px; text-align: right; color: var(--dim); font-variant-numeric: tabular-nums; font-size: 12px; }
.set input[type=checkbox] { accent-color: var(--ink); width: 16px; height: 16px; }
.set select { max-width: 200px; height: 30px; border-radius: 6px; border: 1px solid var(--line); background: #111; color: var(--ink); font: inherit; padding: 0 6px; }
.meter { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--ok); transition: width 0.08s; }
#hint { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); font-size: 12px; color: var(--dim); white-space: nowrap; }
#go { width: 100%; }
