:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f1f5f9;
  --card: #ffffff;
  --brand: #0284c7;
  --brand-dark: #0369a1;
  --danger: #dc2626;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body { background: var(--bg); color: var(--ink); font: 14px/1.45 "Segoe UI", system-ui, sans-serif; }

[hidden] { display: none !important; }

button, input, select, textarea { font: inherit; }

button { cursor: pointer; }

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

.page { min-height: 100%; display: flex; justify-content: center; padding: 32px 16px; }

.column { width: 100%; max-width: 860px; display: flex; flex-direction: column; gap: 14px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }

.narrow { width: 100%; max-width: 360px; align-self: center; display: flex; flex-direction: column; gap: 10px; }

.narrow img { border-radius: 10px; }

h1 { margin: 4px 0 0; font-size: 20px; }

h2 { margin: 0 0 10px; font-size: 15px; }

p { margin: 0; }

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

.error { color: var(--danger); }

label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; }

input:not([type=checkbox]), textarea { width: 100%; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; font-weight: 400; }

.primary { padding: 9px 18px; border: 0; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 600; }

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

.primary:disabled { opacity: .6; cursor: default; }

.link { border: 0; background: none; color: var(--brand-dark); text-decoration: underline; padding: 0; }

.home-top { display: flex; align-items: center; gap: 12px; }

.home-top .muted { margin-left: auto; }

#join-form { display: flex; flex-direction: column; gap: 8px; }

#join-form label { font-weight: 600; }

.join-row { display: flex; gap: 10px; }

.code-input { font-size: 28px; font-weight: 600; letter-spacing: .08em; font-variant-numeric: tabular-nums; max-width: 240px; }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }

th { text-align: left; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); padding: 6px 10px 6px 0; white-space: nowrap; }

td { border-bottom: 1px solid #f1f5f9; padding: 7px 10px 7px 0; white-space: nowrap; }

.live { position: fixed; inset: 0; display: flex; flex-direction: column; background: #020617; color: #e2e8f0; }

.bar { flex-shrink: 0; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 10px; background: #111827; font-size: 13px; }

.bar button, .bar select { padding: 4px 10px; border: 1px solid #374151; border-radius: 6px; background: #1f2937; color: #e5e7eb; white-space: nowrap; }

.bar button:hover { background: #374151; }

.bar .danger { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 600; }

.machine { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.tag { flex-shrink: 0; padding: 1px 7px; border-radius: 10px; background: #78350f; color: #fde68a; font-size: 11px; }

.spacer { flex: 1; }

.stats { color: #94a3b8; font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.check { flex-direction: row; align-items: center; gap: 5px; font-weight: 400; white-space: nowrap; }

.stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }

#video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; outline: none; touch-action: none; }

.stage-message { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #94a3b8; pointer-events: none; text-align: center; padding: 20px; }

.blocked-hint { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: min(720px, calc(100% - 32px)); margin: 0; padding: 9px 14px; border-radius: 8px; background: #78350f; color: #fef3c7; font-size: 13px; pointer-events: none; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); max-width: min(680px, calc(100vw - 32px)); padding: 9px 16px; border-radius: 8px; background: #111827; border: 1px solid #374151; color: #f8fafc; font-size: 13px; }

dialog { width: min(520px, calc(100vw - 32px)); border: 0; border-radius: 12px; padding: 18px; }

dialog::backdrop { background: rgba(2, 6, 23, .6); }

#text-form { display: flex; flex-direction: column; gap: 10px; }

.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

.dialog-actions button:not(.primary) { padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

@media (max-width: 1100px) { .stats { display: none; } }
