:root {
  color-scheme: dark;
  --bg: #070b08;
  --panel: #0d1410;
  --panel-soft: #111b15;
  --line: rgba(222, 238, 216, .13);
  --line-strong: rgba(159, 211, 110, .35);
  --text: #edf2e9;
  --muted: #96a193;
  --green: #9fd36e;
  --amber: #e7b85d;
  --red: #df786f;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); }
body { overflow: hidden; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.app-shell { height: calc(100vh - 28px); display: grid; grid-template-rows: 66px minmax(0, 1fr); }
.topbar {
  z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 9px 18px; border-bottom: 1px solid var(--line); background: rgba(7, 11, 8, .96);
}
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(159, 211, 110, .42);
  border-radius: 12px; color: var(--green); background: rgba(159, 211, 110, .08); font-size: 11px; font-weight: 900;
}
.brand-mark.large { width: 54px; height: 54px; margin: 0 auto 8px; border-radius: 15px; font-size: 13px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; }
.top-actions { display: flex; gap: 8px; }
.top-actions button {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; color: var(--text);
  background: rgba(255, 255, 255, .04); font-size: 12px; font-weight: 750;
}
.top-actions button:hover { border-color: var(--line-strong); }
.top-actions .quiet-button { color: var(--muted); }
.view-switch { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .025); }
.view-switch button { min-width: 42px; border: 0; border-radius: 0; background: transparent; }
.view-switch button + button { border-left: 1px solid var(--line); }
.view-switch button.active { color: #0b110c; background: var(--green); }
.floor-control { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 10px; padding: 0 8px 0 10px; color: var(--muted); font-size: 10px; }
.floor-control select { border: 0; padding: 7px 2px; color: var(--text); outline: none; background: transparent; font-size: 11px; font-weight: 800; }
.floor-control option { color: var(--text); background: var(--panel); }

.workspace { min-height: 0; display: grid; grid-template-columns: 320px minmax(0, 1fr); }
.sidebar {
  z-index: 20; min-height: 0; overflow-y: auto; border-right: 1px solid var(--line); background: var(--panel);
  scrollbar-width: thin; scrollbar-color: rgba(159, 211, 110, .25) transparent;
}
.side-section { padding: 20px 18px; border-bottom: 1px solid var(--line); }
.eyebrow { color: #71806f; font-size: 9px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.server-state { display: flex; align-items: center; gap: 11px; margin-top: 11px; }
.server-state strong, .server-state small { display: block; }
.server-state strong { font-size: 14px; }
.server-state small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.status-dot, .live-dot { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; background: #667066; }
.status-dot.online, .live-dot { background: var(--green); box-shadow: 0 0 0 5px rgba(159, 211, 110, .09), 0 0 18px rgba(159, 211, 110, .3); }
.status-dot.offline { background: var(--red); box-shadow: 0 0 0 5px rgba(223, 120, 111, .08); }
.address-row {
  display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 11px; color: var(--muted); font-size: 10px;
}
.address-row code { overflow: hidden; color: #d8dfd4; font: 10px "SFMono-Regular", Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading h2 { margin: 4px 0 0; font-size: 14px; }
.count-badge { min-width: 27px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 8px; color: var(--green); background: rgba(159, 211, 110, .07); font-size: 11px; font-weight: 800; text-align: center; }

.player-list { display: grid; gap: 7px; margin-top: 14px; }
.player-item {
  display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 9px; width: 100%;
  border: 1px solid var(--line); border-radius: 11px; padding: 9px; color: var(--text); background: rgba(255, 255, 255, .025); text-align: left;
}
button.player-item:hover { border-color: var(--line-strong); background: rgba(159, 211, 110, .05); }
.player-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--green); background: rgba(159, 211, 110, .1); font-size: 10px; font-weight: 900; }
.player-copy { min-width: 0; }
.player-copy strong, .player-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-copy strong { font-size: 12px; }
.player-copy small { margin-top: 3px; color: var(--muted); font: 9px "SFMono-Regular", Consolas, monospace; }
.empty-state { border: 1px dashed var(--line); border-radius: 11px; padding: 16px 9px; color: var(--muted); font-size: 11px; text-align: center; }
.section-note { margin: 11px 0 0; color: #707a6e; font-size: 9px; line-height: 1.5; }

.restart-safe, .restart-pending { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 13px; background: rgba(255, 255, 255, .02); }
.restart-safe strong { font-size: 12px; }
.restart-safe p, .restart-pending p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.restart-reason { display: block; color: var(--amber); font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.countdown { display: block; margin: 7px 0 9px; color: var(--text); font: 600 30px "SFMono-Regular", Consolas, monospace; letter-spacing: -.05em; }
.progress-track { height: 4px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .07); }
.progress-track span { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--amber); transition: width .25s linear; }
.request-button { width: 100%; margin-top: 12px; border: 1px solid rgba(231, 184, 93, .4); border-radius: 9px; padding: 9px; color: #fff2d8; background: rgba(231, 184, 93, .1); font-size: 10px; font-weight: 800; }
.request-button:disabled { cursor: wait; opacity: .55; }
.request-feedback { display: block; margin-top: 8px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.sidebar-footer { padding: 15px 18px 20px; color: var(--muted); }
.sidebar-footer span, .sidebar-footer small { display: block; }
.sidebar-footer span { font-size: 10px; font-weight: 750; }
.sidebar-footer small { margin-top: 5px; color: #697367; font-size: 9px; line-height: 1.5; }

.map-stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #0a100c; }
#mapViewer { position: absolute; inset: 0; background: #0a100c; }
.map-label, .coordinate-readout {
  position: absolute; z-index: 10; border: 1px solid var(--line); border-radius: 10px; color: #d6ddd2;
  background: rgba(10, 16, 12, .9); backdrop-filter: blur(12px); box-shadow: 0 10px 35px rgba(0, 0, 0, .25);
}
.map-label { top: 14px; left: 14px; display: flex; align-items: center; gap: 9px; padding: 9px 11px; font-size: 10px; font-weight: 800; }
.coordinate-readout { right: 14px; bottom: 14px; padding: 8px 11px; font: 10px "SFMono-Regular", Consolas, monospace; }
.player-marker { position: relative; width: 18px; height: 18px; border: 3px solid #10170f; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(159, 211, 110, .32), 0 4px 18px rgba(0, 0, 0, .65); }
.player-marker::after { content: attr(data-label); position: absolute; left: 50%; bottom: 23px; transform: translateX(-50%); border: 1px solid rgba(255, 255, 255, .13); border-radius: 8px; padding: 5px 8px; color: #fff; background: rgba(8, 13, 10, .92); font: 800 10px system-ui, sans-serif; white-space: nowrap; }

.login-overlay { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 22px; background: rgba(5, 8, 6, .94); backdrop-filter: blur(14px); }
.login-card { width: min(360px, 100%); border: 1px solid var(--line); border-radius: 20px; padding: 28px; background: var(--panel); box-shadow: 0 28px 90px rgba(0, 0, 0, .45); text-align: center; }
.login-card h1 { margin: 8px 0 0; font: 500 32px Georgia, serif; }
.login-card p { margin: 9px 0 20px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.login-card label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; text-align: left; }
.login-card input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; color: var(--text); outline: none; background: #080d0a; }
.login-card input:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(159, 211, 110, .08); }
.login-card button { width: 100%; margin-top: 10px; border: 0; border-radius: 10px; padding: 11px; color: #0b110c; background: var(--green); font-weight: 850; }
.login-error { display: block; min-height: 16px; margin-top: 9px; color: #ed9b93; font-size: 10px; }
footer { height: 28px; overflow: hidden; padding: 7px 12px; color: #657064; background: #070b08; font-size: 9px; text-align: center; white-space: nowrap; }
footer a { color: #aebca8; }

@media (max-width: 760px) {
  body { overflow: auto; }
  .app-shell { height: auto; min-height: calc(100vh - 28px); }
  .workspace { grid-template-columns: 1fr; grid-template-rows: auto minmax(520px, 65vh); }
  .sidebar { max-height: 46vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .topbar { padding-inline: 12px; }
  .top-actions .quiet-button { display: none; }
  .floor-control span { display: none; }
  footer { white-space: normal; height: auto; min-height: 28px; }
}
