/* Floor Nine - dark steel and hazard orange. System fonts only. */
:root {
  --bg: #0b0d10; --panel: #161a20; --steel: #252b33; --edge: #333b46; --ink: #e8ecf1; --muted: #98a3b2;
  --orange: #ff8a1f; --slow: #ffc93c; --fast: #3db8ff; --red: #ff3b4e; --green: #43e08f; --violet: #b98bff;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, sans-serif; }
button { font: inherit; color: var(--ink); background: var(--steel); border: 1px solid var(--edge); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--orange); }
button:focus-visible { outline: 2px solid var(--fast); outline-offset: 2px; }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--orange); color: #1a0f02; border-color: var(--orange); font-weight: 700; }
.muted { color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; flex: none; }

.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 16px;
  border-bottom: 2px solid transparent; border-image: repeating-linear-gradient(135deg, var(--orange) 0 10px, #17181a 10px 20px) 2; }
.brand h1 { margin: 0; font-size: 22px; letter-spacing: .06em; text-transform: uppercase; }
.brand p { margin: 0; color: var(--muted); font-size: 12.5px; }
.hud { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hud button { font-size: 13px; padding: 5px 9px; }
.round { font-weight: 800; color: var(--orange); margin-right: 4px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 16px; padding: 12px 16px 24px; max-width: 1240px; margin: 0 auto; }
.board-wrap { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; }
#board { display: block; border-radius: 10px; box-shadow: 0 0 0 2px #1d2228, 0 10px 40px rgba(255, 138, 31, .12); touch-action: manipulation; }
.legend span { white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); margin: 10px 0 0; justify-content: center; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; }
.sw.slow { background: var(--slow); } .sw.fast { background: var(--fast); } .sw.gear { background: #8a939f; border-radius: 50%; }
.sw.push { background: repeating-linear-gradient(135deg, var(--orange) 0 3px, #17181a 3px 6px); }
.sw.crush { background: #9aa3ae; outline: 2px solid var(--orange); } .sw.laser { background: var(--red); box-shadow: 0 0 6px var(--red); }
.sw.pit { background: #000; outline: 2px solid var(--orange); } .sw.fix { background: var(--green); border-radius: 50%; } .sw.crate { background: var(--violet); }

.banner { position: absolute; top: 30%; left: 50%; transform: translateX(-50%); width: min(420px, 90%); text-align: center;
  background: rgba(16, 19, 23, .94); border: 2px solid var(--slow); border-radius: 14px; padding: 16px; box-shadow: 0 0 40px rgba(255, 201, 60, .35); }
.banner h2 { margin: 0 0 6px; color: var(--slow); }

.panel { min-width: 0; }
.panel h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 0 6px; }
.panel h2:first-child { margin-top: 0; }
.panel h2 small { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--orange); }
.card { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 64px; height: 76px; padding: 4px 2px;
  background: linear-gradient(#2c333d, #1d2229); border: 1px solid #46505d; border-radius: 9px; position: relative; }
.card .ic { font-size: 22px; line-height: 1.1; font-weight: 800; color: var(--slow); letter-spacing: -3px; }
.card .nm { font-size: 10.5px; line-height: 1.1; text-align: center; }
.card .pr { position: absolute; top: 2px; right: 5px; font-size: 9.5px; color: var(--muted); }
.card.used { opacity: .25; }
.hand { display: flex; flex-wrap: wrap; gap: 6px; }
.regs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px 6px; border: 1px dashed var(--edge); border-radius: 10px; min-height: 104px; cursor: pointer; }
.slot > b { font-size: 11px; color: var(--muted); }
.slot .card { width: 100%; max-width: 64px; pointer-events: none; }
.slot .empty { margin: auto; font-size: 11px; color: #5d6876; }
.slot em { position: absolute; bottom: -7px; font-style: normal; font-size: 9px; background: var(--orange); color: #1a0f02; border-radius: 4px; padding: 0 4px; }
.slot.locked { border-style: solid; border-color: var(--red); background: rgba(255, 59, 78, .08); cursor: not-allowed; }
.slot.locked > b::after { content: " locked"; color: var(--red); }
.slot.active { border-color: var(--slow); box-shadow: 0 0 12px rgba(255, 201, 60, .5); }
.actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.actions .primary { margin-left: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: flex; flex-direction: column; text-align: left; border-color: var(--violet); }
.chip small { color: var(--muted); font-size: 11px; }
.chip.on { background: var(--violet); color: #1a0f2e; } .chip.on small { color: #2d1d4a; }
.chip.passive { cursor: default; }
.roster { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.roster li { display: grid; grid-template-columns: auto 1fr auto 56px auto auto; align-items: center; gap: 8px; font-size: 13.5px; background: var(--panel); border-radius: 8px; padding: 5px 8px; }
.roster li.out { opacity: .5; }
.roster .nm small { color: var(--muted); }
.roster .flags { display: flex; gap: 2px; }
.roster .flags i { width: 15px; height: 15px; border-radius: 3px; background: #2a3039; font: 700 10px/15px system-ui; text-align: center; font-style: normal; color: #0d0f12; }
.roster .dmg { height: 7px; background: #2a3039; border-radius: 4px; overflow: hidden; }
.roster .dmg i { display: block; height: 100%; background: linear-gradient(90deg, var(--slow), var(--red)); }
.roster .rb, .roster .ch { color: var(--muted); font-size: 12px; min-width: 18px; }
.log { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow: auto; font-size: 13px; }
.log li { padding: 3px 0; border-bottom: 1px solid #1d2228; }
.log q { color: var(--muted); font-style: italic; }

dialog { background: var(--panel); color: var(--ink); border: 1px solid var(--edge); border-radius: 14px; padding: 0; width: min(520px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(5, 6, 8, .7); }
.card-box { padding: 18px; }
.card-box h2 { margin: 0 0 8px; color: var(--orange); text-transform: uppercase; letter-spacing: .06em; }
.card-box ol { padding-left: 20px; } .card-box li { margin-bottom: 6px; }
fieldset { border: 1px solid var(--edge); border-radius: 10px; margin: 10px 0; }
fieldset label { display: inline-flex; align-items: center; gap: 4px; margin: 3px 12px 3px 0; cursor: pointer; }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .card { width: calc((100vw - 32px - 24px) / 5); max-width: 64px; }
}
