:root {
  --bg: #f6f2ec;
  --panel: #ffffff;
  --glass: rgba(255, 255, 255, 0.9);
  --ink: #1f2933;
  --muted: #5f6b76;
  --border: #e6dfd4;
  --red: #c8102e;
  --red-dark: #a00d25;
  --green: #1f8a4c;
  --green-dark: #17703d;
  --amber: #c27c0e;
  --soft: #faf7f2;
  --tip: #fff8e6;
  --tip-border: #f1d58a;
  --shadow: 0 6px 24px rgba(31, 41, 51, 0.16);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181c;
    --panel: #1f242a;
    --glass: rgba(31, 36, 42, 0.92);
    --ink: #e8eaed;
    --muted: #a0a9b3;
    --border: #333a42;
    --red: #e5384f;
    --red-dark: #c8102e;
    --green: #2fa863;
    --green-dark: #1f8a4c;
    --amber: #e0a43a;
    --soft: #262c33;
    --tip: #2c2716;
    --tip-border: #6b5a22;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.45;
}

h1, h2 {
  margin: 0 0 12px;
  line-height: 1.2;
}

h1 { font-size: 1.7rem; }
h2 { font-size: 1.1rem; }

p { margin: 0 0 10px; }

a { color: var(--red); }

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* ---------- 3D world and overlay ---------- */

.world {
  position: fixed;
  inset: 0;
  touch-action: none;
}

.world canvas {
  display: block;
}

.app {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.app > * {
  pointer-events: auto;
}

.place-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.place-label {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0;
  border: none;
  background: none;
  pointer-events: auto;
}

.pl-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  font-size: 1.15rem;
  transition: transform 0.15s;
}

.pl-name {
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(31, 41, 51, 0.78);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.place-label:hover .pl-icon,
.place-label:focus-visible .pl-icon {
  transform: scale(1.15);
}

.place-label.is-home .pl-icon {
  border-color: #ffd23f;
}

.place-label.is-home .pl-name::before {
  content: "🏠 ";
}

.place-label.is-work .pl-icon {
  border-color: var(--green);
}

.place-label.is-work .pl-name::before {
  content: "💼 ";
}

.place-label.has-task .pl-icon::after {
  content: "!";
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  animation: pulse 1.4s infinite;
}

@keyframes pulse {
  50% { transform: scale(1.25); }
}

/* ---------- HUD ---------- */

.hud-top {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(1000px, calc(100% - 24px));
  pointer-events: none;
}

.hud-top > * {
  pointer-events: auto;
}

.pill {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 16px;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--glass);
  box-shadow: var(--shadow);
  font-size: 0.95rem;
}

.pill-brand {
  font-weight: 800;
  font-size: 1.1rem;
}

.who {
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--glass);
  box-shadow: var(--shadow);
  font-size: 0.92rem;
}

.chip.money.negative b {
  color: var(--red);
}

.mini {
  display: inline-block;
  width: 40px;
  height: 5px;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
}

.mini-fill {
  display: block;
  height: 100%;
}

.good { background: var(--green); }
.ok { background: var(--amber); }
.low { background: var(--red); }

.ticker {
  max-width: 100%;
  padding: 7px 18px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: var(--shadow);
}

.alert {
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.map-controls {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.map-controls button {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: var(--glass);
  box-shadow: var(--shadow);
  font-size: 1.2rem;
}

.hud-bottom-wrap {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(620px, calc(100% - 24px));
  pointer-events: none;
}

.hud-bottom-wrap > * {
  pointer-events: auto;
}

.hud-bottom {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 20px;
  background: var(--glass);
  box-shadow: var(--shadow);
}

.days {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
}

.days span:last-child {
  margin-left: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--green);
}

.dot.on { background: var(--green); }

.hint {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(31, 41, 51, 0.8);
  color: #fff;
  font-size: 0.88rem;
  text-align: center;
}

/* ---------- Buttons ---------- */

.primary {
  border: none;
  border-radius: 999px;
  padding: 11px 22px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
}

.primary:hover { background: var(--green-dark); }

.primary.big {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  font-size: 1.1rem;
}

.ghost {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--panel);
  font-weight: 600;
  white-space: nowrap;
}

.link {
  align-self: flex-start;
  border: none;
  background: none;
  color: var(--muted);
  text-decoration: underline;
}

.close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--soft);
  font-size: 1.3rem;
  line-height: 1;
}

.small-btn {
  flex-shrink: 0;
  border: 1px solid var(--green);
  border-radius: 999px;
  padding: 6px 12px;
  background: none;
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 600;
}

.small-btn:hover:not(:disabled) {
  background: var(--green);
  color: #fff;
}

.small-btn:disabled {
  border-color: var(--border);
  color: var(--muted);
}

.action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--soft);
  text-align: left;
}

.action:hover:not(:disabled) {
  border-color: var(--green);
  background: var(--panel);
}

.action:disabled {
  opacity: 0.55;
}

.action strong,
.action small {
  display: block;
}

.action small {
  color: var(--muted);
}

.icon {
  font-size: 1.5rem;
}

/* ---------- Place card ---------- */

.place-card {
  position: relative;
  width: 100%;
  max-height: 46vh;
  overflow-y: auto;
  padding: 18px;
  border-radius: 20px;
  background: var(--glass);
  box-shadow: var(--shadow);
  animation: rise 0.18s ease-out;
}

@keyframes rise {
  from { transform: translateY(12px); opacity: 0; }
}

.place-card .close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.place-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding-right: 36px;
}

.place-head h2 {
  margin-bottom: 4px;
}

.place-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--soft);
  font-size: 1.6rem;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 0.72rem;
  vertical-align: middle;
}

.place-options {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

/* ---------- Dashboard drawer ---------- */

.drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(420px, 100%);
  padding: 16px;
  overflow-y: auto;
  background: var(--bg);
  box-shadow: var(--shadow);
  transform: translateX(105%);
  transition: transform 0.25s ease;
}

.drawer.open {
  transform: none;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-head h2 {
  margin: 0;
  font-size: 1.3rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.actions {
  display: grid;
  gap: 8px;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.checklist li:last-child { border-bottom: none; }

.checklist .grow { flex: 1; }

.checklist strong,
.checklist small {
  display: block;
}

.checklist small { color: var(--muted); }

.checklist li.done strong {
  color: var(--muted);
  text-decoration: line-through;
}

.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 12px;
  margin: 0;
}

.facts dt { color: var(--muted); }

.facts dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--border);
  font-size: 0.85rem;
}

.log {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
  font-size: 0.9rem;
}

.log li {
  padding: 6px 0 6px 10px;
  border-left: 3px solid var(--border);
  margin-bottom: 4px;
}

.log li.good { border-left-color: var(--green); }
.log li.bad { border-left-color: var(--red); }
.log li.warn { border-left-color: var(--amber); }

.footnote {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

/* ---------- Setup and end screens ---------- */

.overlay-screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 24px 16px;
  background: linear-gradient(rgba(20, 30, 40, 0.15), rgba(20, 30, 40, 0.45));
}

.setup,
.end {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px;
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.kicker {
  color: var(--red);
  font-weight: 700;
  font-size: 0.9rem;
}

.lead {
  font-size: 1.05rem;
  color: var(--muted);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}

.field input,
.field select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--soft);
  color: var(--ink);
  font: inherit;
}

fieldset {
  margin: 20px 0 0;
  padding: 0;
  border: none;
}

legend {
  margin-bottom: 8px;
  font-weight: 700;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.card {
  position: relative;
  cursor: pointer;
}

.card input {
  position: absolute;
  opacity: 0;
}

.card-body {
  display: block;
  height: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--soft);
}

.card-body strong,
.card-body small {
  display: block;
}

.card-body small {
  margin-top: 4px;
  color: var(--muted);
}

.card input:checked + .card-body {
  border-color: var(--green);
  background: var(--panel);
}

.card input:focus-visible + .card-body {
  outline: 3px solid var(--amber);
}

.end {
  max-width: 640px;
  text-align: center;
}

.end .facts {
  max-width: 360px;
  margin: 0 auto 20px;
  text-align: left;
}

.end .badges { justify-content: center; margin-bottom: 8px; }

.score {
  margin: 20px 0;
  font-size: 1.1rem;
}

.score strong {
  display: block;
  font-size: 2.4rem;
  color: var(--red);
}

/* ---------- Modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.45);
  z-index: 10;
}

.modal.hidden { display: none; }

.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.tip {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid var(--tip-border);
  border-radius: 10px;
  background: var(--tip);
  font-size: 0.95rem;
  text-align: left;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.choice {
  padding: 12px 14px;
  border: 1px solid var(--green);
  border-radius: 14px;
  background: var(--green);
  color: #fff;
  text-align: left;
}

.choice:hover:not(:disabled) { background: var(--green-dark); }

.choice small {
  display: block;
  margin-top: 2px;
  opacity: 0.9;
}

.choice.secondary {
  background: none;
  color: var(--ink);
  border-color: var(--border);
  text-align: center;
}

.choice:disabled {
  background: var(--soft);
  border-color: var(--border);
  color: var(--muted);
}

/* ---------- Without 3D (WebGL unavailable) ---------- */

.no-world {
  overflow: auto;
}

.no-world .world,
.no-world .map-controls,
.no-world .hint {
  display: none;
}

.no-world .app {
  position: static;
  min-height: 100%;
  padding-bottom: 120px;
}

.no-world .hud-top {
  position: static;
  transform: none;
  margin: 12px auto;
}

.no-world .hud-bottom-wrap {
  position: fixed;
}

.no-world .drawer {
  position: static;
  transform: none;
  width: min(720px, 100%);
  margin: 0 auto;
  box-shadow: none;
}

.no-world .drawer-head .close,
.no-world [data-drawer] {
  display: none;
}

.no-world .overlay-screen {
  position: static;
}

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  .pill {
    gap: 2px 10px;
    padding: 8px 14px;
    border-radius: 18px;
    font-size: 0.82rem;
  }

  .pill-brand,
  .who {
    display: none;
  }

  .chip {
    padding: 5px 10px;
    font-size: 0.82rem;
  }

  .mini {
    display: none;
  }

  .ticker {
    display: none;
  }

  .row {
    grid-template-columns: 1fr;
  }

  .map-controls {
    left: auto;
    right: 10px;
    bottom: auto;
    top: 130px;
    grid-template-columns: 1fr;
  }

  .map-controls button {
    width: 38px;
    height: 38px;
  }

  .hud-bottom {
    flex-wrap: wrap;
    padding: 10px;
  }

  .days {
    flex-basis: 100%;
  }

  .hud-bottom .primary,
  .hud-bottom .ghost {
    flex: 1;
  }

  .place-card {
    max-height: 50vh;
  }

  .pl-name {
    display: none;
  }

  .setup,
  .end {
    padding: 18px;
  }
}

/* ---------- Accounts ---------- */

.auth {
  max-width: 560px;
  margin: 4vh auto 0;
  padding: 28px;
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.auth h1 {
  font-size: 1.6rem;
}

.auth form,
.stack {
  display: grid;
  gap: 12px;
}

.form-error {
  min-height: 1.2em;
  margin: 0;
  color: var(--red);
  font-weight: 600;
}

.tabs {
  display: flex;
  gap: 4px;
  margin: 12px 0 16px;
  padding: 4px;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-weight: 600;
}

.tab.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.tab:disabled {
  opacity: 0.45;
}

.tabs.small {
  margin: 0 0 10px;
}

.tabs.small .tab {
  padding: 6px 8px;
  font-size: 0.85rem;
}

/* ---------- HUD extras ---------- */

button.chip {
  border: none;
  font: inherit;
  color: inherit;
}

.banner {
  max-width: 100%;
  padding: 7px 18px;
  border: none;
  border-radius: 999px;
  background: #1f2933;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: var(--shadow);
}

.banner:hover {
  background: #111820;
}

.link-btn {
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: transparent;
}

.link-btn:hover {
  text-decoration-color: currentColor;
}

.icon-btn {
  position: relative;
  padding: 10px 14px;
}

.count {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.here {
  margin: 10px 0 0;
  font-size: 0.9rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.ghost.danger,
.choice.danger {
  border-color: var(--red);
  color: var(--red);
  background: none;
}

.choice.danger:hover {
  background: var(--red);
  color: #fff;
}

.player-label {
  position: absolute;
  left: 0;
  top: 0;
  padding: 2px 8px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: rgba(42, 93, 176, 0.92);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: auto;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* ---------- Side panels (chat, leaderboard, players) ---------- */

.panel-host {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(400px, 100%);
  pointer-events: none;
  z-index: 5;
}

.panel-host.open {
  pointer-events: auto;
}

.side-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px;
  background: var(--bg);
  box-shadow: var(--shadow);
  animation: slide-in 0.2s ease-out;
}

@keyframes slide-in {
  from { transform: translateX(-100%); }
}

.side-panel .drawer-head {
  margin-bottom: 12px;
}

.chat-list {
  flex: 1;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  overflow-y: auto;
}

.msg {
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.msg.mine {
  margin-left: 32px;
  background: color-mix(in srgb, var(--green) 12%, var(--panel));
}

.msg p {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}

.msg-report {
  margin-left: auto;
  border: none;
  background: none;
  color: var(--muted);
  opacity: 0.6;
}

.msg-report:hover {
  opacity: 1;
  color: var(--red);
}

.chat-form {
  display: flex;
  gap: 8px;
}

.chat-form input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
}

.thread-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.people,
.leaders {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
}

.person {
  display: block;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  text-align: left;
}

.person:hover {
  border-color: var(--green);
}

.person .muted {
  display: block;
  font-size: 0.82rem;
}

.leaders li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.leaders .rank {
  width: 28px;
  text-align: center;
  font-weight: 800;
}

.leaders .person {
  flex: 1;
}

.leaders .xp {
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
}

.leaders li.mine .person {
  border-color: var(--green);
}

/* ---------- Election ---------- */

.tallies {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.tallies li {
  display: grid;
  grid-template-columns: 1fr 80px 28px;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.tallies small {
  display: block;
}

.tallies li.mine strong::after {
  content: " ✅";
}

.tally-bar {
  height: 8px;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
}

.tally-bar span {
  display: block;
  height: 100%;
  background: var(--green);
}

.tally-n {
  text-align: right;
  font-weight: 700;
}

/* ---------- Transfer form ---------- */

.segmented {
  display: flex;
  gap: 8px;
}

.segmented label {
  flex: 1;
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: 12px;
  text-align: center;
  font-weight: 600;
  cursor: pointer;
}

.segmented label:has(input:checked) {
  border-color: var(--green);
}

.segmented input {
  margin-right: 4px;
}

.modal .field input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--soft);
  color: var(--ink);
  font: inherit;
}

/* ---------- Toasts ---------- */

.toasts {
  position: fixed;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(340px, calc(100% - 24px));
  z-index: 20;
  pointer-events: none;
}

.toast {
  padding: 10px 14px;
  border-radius: 14px;
  background: #1f2933;
  color: #fff;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  transition: opacity 0.4s, transform 0.4s;
}

.toast.good {
  background: var(--green-dark);
}

.toast.bad {
  background: var(--red-dark);
}

.toast.out {
  opacity: 0;
  transform: translateY(-8px);
}

@media (max-width: 640px) {
  .banner {
    font-size: 0.78rem;
  }

  .icon-btn .lbl {
    display: none;
  }

  .hud-bottom .icon-btn {
    flex: 0 0 auto;
  }

  .player-label {
    font-size: 0.65rem;
  }

  .panel-host {
    width: 100%;
  }
}
