:root {
  --bg: #0f1419; --panel: #1a2129; --panel2: #232c36; --line: #2f3a46;
  --fg: #e8eef4; --muted: #93a1b0; --accent: #4fc3f7; --ok: #4caf50; --warn: #ffb300; --err: #ef5350;
  --open: #1e88e5; --close: #e53935; --wait: #546e7a;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: env(safe-area-inset-bottom); }
header { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; letter-spacing: .3px; }
.brand span { color: var(--accent); }
.ctx { flex: 1; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net { font-size: 13px; padding: 3px 8px; border-radius: 999px; background: var(--panel2); white-space: nowrap; }
.net.ok { color: var(--ok); } .net.busy { color: var(--warn); } .net.err { color: var(--err); }
nav { display: flex; overflow-x: auto; background: var(--panel); border-bottom: 1px solid var(--line); }
nav a { flex: 1 0 auto; padding: 12px 14px; color: var(--muted); text-decoration: none; text-align: center; font-size: 15px; border-bottom: 3px solid transparent; }
nav a.on { color: var(--fg); border-bottom-color: var(--accent); }
main { padding: 16px; max-width: 760px; margin: 0 auto; }
h2 { font-size: 20px; margin: 4px 0 12px; }
h3 { font-size: 16px; margin: 18px 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
p.hint, .hint { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
label { display: block; font-size: 14px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--fg); background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
textarea { min-height: 70px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
button { font: inherit; border: 0; border-radius: 10px; padding: 12px 16px; background: var(--panel2); color: var(--fg); cursor: pointer; min-height: 48px; }
button.primary { background: var(--accent); color: #062130; font-weight: 700; }
button.danger { background: var(--err); color: #fff; }
button.big { width: 100%; font-size: 20px; padding: 18px; min-height: 64px; }
button:disabled { opacity: .45; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.btns > * { flex: 1 1 140px; }
.ev { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; text-decoration: none; color: inherit; }
.ev .code { font-weight: 700; min-width: 74px; }
.ev .t { flex: 1; } .ev .t small { display: block; color: var(--muted); }
.chip { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: var(--panel2); color: var(--muted); white-space: nowrap; }
.chip.ok { color: var(--ok); } .chip.q { color: var(--warn); } .chip.err { color: var(--err); }
.progress { height: 8px; background: var(--panel2); border-radius: 8px; overflow: hidden; margin: 8px 0 16px; }
.progress > div { height: 100%; background: var(--accent); }
/* Kayıt ekranı */
.cue { border-radius: 16px; padding: 28px 16px; text-align: center; margin: 8px 0 14px; background: var(--wait); transition: background .2s; }
.cue .big { font-size: clamp(30px, 9vw, 56px); font-weight: 800; line-height: 1.1; }
.cue .sub { font-size: 18px; margin-top: 8px; opacity: .9; }
.cue.open { background: var(--open); } .cue.close { background: var(--close); } .cue.clap { background: var(--warn); color: #1d1500; } .cue.done { background: var(--ok); }
.timer { font-variant-numeric: tabular-nums; font-size: 44px; font-weight: 700; text-align: center; }
.meter { height: 18px; background: var(--panel2); border-radius: 9px; overflow: hidden; position: relative; margin: 8px 0 4px; }
.meter > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--ok), var(--warn) 80%, var(--err)); }
.meterlbl { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.warn { color: var(--warn); } .err { color: var(--err); } .ok { color: var(--ok); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; }
#toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #000d; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 92vw; }
#toast.on { opacity: 1; }
@media (max-width: 420px) { .row { grid-template-columns: 1fr; } }
