:root {
  --bg: #121a0e;
  --card: #1d2817;
  --line: #33442a;
  --text: #ece6d6;
  --muted: #a8a28f;
  --accent: #d9a441;
  --green: #4ade80;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }
button {
  background: #2c3a23; border: 1px solid var(--line); border-radius: 8px; padding: 0.45rem 0.8rem; cursor: pointer;
}
button:hover:not(:disabled) { background: #384a2c; }
button:disabled { opacity: 0.45; cursor: default; }
button.primary { background: var(--accent); color: #1b1408; border-color: #b9862b; font-weight: 600; }
button.primary:hover:not(:disabled) { background: #e8b553; }
button.link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 0; }
input, select { background: #0f150b; border: 1px solid var(--line); border-radius: 8px; padding: 0.45rem 0.7rem; }
a { color: var(--accent); }

/* ---------- menu ---------- */
#screen { max-width: 980px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.brand { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.brand h1 { margin: 0; font-size: 2rem; letter-spacing: 0.02em; }
.brand h1 span { color: var(--accent); }
.brand .who { color: var(--muted); font-size: 0.9rem; display: flex; gap: 0.75rem; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem 1.25rem; }
.card h2 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.card p { color: var(--muted); margin: 0.25rem 0 0.9rem; line-height: 1.45; }
.row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.stack > * + * { margin-top: 0.6rem; }
.list { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.45rem 0; border-top: 1px solid var(--line); }
.list li small { color: var(--muted); }
.list li button { flex-shrink: 0; padding: 0.3rem 0.6rem; font-size: 0.85rem; }
.muted { color: var(--muted); }
.status { min-height: 1.3em; color: var(--muted); font-size: 0.9rem; }
.login { max-width: 420px; margin: 12vh auto 0; }
.share { display: flex; gap: 0.5rem; }
.share input { flex: 1; min-width: 0; }
.players li .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 0.4rem; }
.chatlog { height: 140px; overflow: auto; background: #0f150b; border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem; font-size: 0.9rem; }

/* ---------- game ---------- */
#game { position: fixed; inset: 0; overflow: hidden; user-select: none; }
#game .view { position: absolute; inset: 0; display: block; cursor: default; outline: none; }
.topbar {
  position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 1rem; padding: 0.4rem 0.75rem;
  background: linear-gradient(#0e1409ee, #0e140900); pointer-events: none; font-size: 0.95rem;
}
.topbar > * { pointer-events: auto; }
.topbar .res { display: flex; gap: 0.9rem; font-weight: 600; }
.topbar .res .warn { color: #f87171; }
.topbar .info { flex: 1; color: var(--muted); font-size: 0.88rem; }
.topbar .btns { display: flex; gap: 0.4rem; }
.topbar .btns button { padding: 0.3rem 0.6rem; font-size: 0.85rem; background: #1d2817dd; }
.pl::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 4px; }
.pl.dead { text-decoration: line-through; opacity: 0.6; }
.toasts { position: absolute; top: 3rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 0.35rem; align-items: center; pointer-events: none; }
.toast { background: #0e1409dd; border: 1px solid var(--line); padding: 0.35rem 0.8rem; border-radius: 8px; font-size: 0.9rem; transition: opacity 0.6s; }
.toast.fade { opacity: 0; }
.bottom { position: absolute; left: 0.6rem; right: 0.6rem; bottom: 0.6rem; display: flex; gap: 0.6rem; align-items: flex-end; pointer-events: none; }
.bottom > * { pointer-events: auto; }
.minimap { background: #0e1409; border: 1px solid var(--line); border-radius: 8px; cursor: crosshair; }
.panel { flex: 1; min-height: 110px; background: #0e1409e6; border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.8rem; display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.panel .sel { min-width: 160px; }
.panel h3 { margin: 0 0 0.2rem; font-size: 1rem; }
.panel .sub { color: var(--muted); font-size: 0.85rem; }
.panel .acts { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; flex: 1; }
.panel .acts button { display: flex; flex-direction: column; align-items: flex-start; font-size: 0.85rem; padding: 0.35rem 0.6rem; }
.panel .acts button small { color: var(--muted); font-size: 0.75rem; }
.panel .acts button img { width: 64px; height: 56px; display: block; margin: 0 auto 0.15rem; align-self: center; }
.panel .acts button:has(img) { align-items: center; min-width: 84px; }
.panel .hint { color: var(--muted); font-size: 0.85rem; flex-basis: 100%; }
.prog { width: 120px; height: 6px; background: #2c3a23; border-radius: 3px; overflow: hidden; }
.prog i { display: block; height: 100%; background: #60a5fa; }
.queue { display: flex; gap: 0.3rem; align-items: center; }
.queue span { width: 30px; height: 30px; border-radius: 5px; background: #2c3a23; display: grid; place-items: center; }
.queue span img { width: 28px; height: 26px; }
.chat { position: absolute; left: 50%; bottom: 140px; transform: translateX(-50%); width: min(480px, 80vw); }
.overlay { position: absolute; inset: 0; background: #000a; display: grid; place-items: center; }
.overlay .card { text-align: center; min-width: 300px; }
.overlay h2 { font-size: 1.6rem; }

@media (max-width: 700px) {
  .minimap { display: none; }
  .topbar { flex-wrap: wrap; }
}
