:root { --bar: 56px; --fg: #e8e8e8; --dim: #8a8a8a; --acc: #e82127; --bg: #000; --panel: #161616; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg);
  font: 18px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; }
button, select, input { font: inherit; color: var(--fg); }
.hidden { display: none !important; }

/* ---- app layout ---- */
#bar { position: fixed; inset: 0 0 auto 0; height: var(--bar); display: flex; align-items: center;
  gap: 6px; padding: 0 8px; background: var(--panel); border-bottom: 1px solid #262626; z-index: 5; }
#bar button, #bar select { height: 44px; min-width: 52px; border: 0; border-radius: 10px;
  background: #242424; font-size: 24px; padding: 0 10px; }
#bar select { font-size: 18px; min-width: 84px; }
#bar button:active { background: #333; }
#urlform { flex: 1; display: flex; }
#url { flex: 1; height: 44px; border: 0; border-radius: 10px; background: #0d0d0d; padding: 0 14px; font-size: 19px; }
#net { font-size: 18px; padding: 0 6px; }
.net-ok { color: #3ccf5a; } .net-slow { color: #e8b13c; } .net-bad { color: var(--acc); }

#stage { position: fixed; inset: var(--bar) 0 0 0; background: #000; touch-action: none; }
body.nobar #bar { display: none; }
body.nobar #stage { top: 0; }
body.typing #stage { bottom: 64px; }
#stage canvas { width: 100%; height: 100%; object-fit: contain; display: block; touch-action: none; }

#b-showbar { position: fixed; top: 8px; right: 8px; z-index: 6; width: 52px; height: 44px; border: 0;
  border-radius: 10px; background: rgba(36,36,36,.7); font-size: 22px; }

.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; background: rgba(0,0,0,.85); z-index: 4; }
#b-start { font-size: 32px; padding: 22px 46px; border-radius: 16px; border: 0; background: var(--acc); color: #fff; }
.hint { color: var(--dim); margin-top: 16px; }

.toast { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); background: rgba(22,22,22,.92);
  padding: 10px 18px; border-radius: 10px; z-index: 4; pointer-events: none; }

#typebar { position: fixed; inset: auto 0 0 0; height: 64px; display: flex; gap: 6px; align-items: center;
  padding: 8px; background: var(--panel); border-top: 1px solid #262626; z-index: 5; }
#typer { flex: 1; height: 48px; border: 0; border-radius: 10px; background: #0d0d0d; padding: 0 14px; font-size: 20px; }
#typebar button { height: 48px; min-width: 60px; border: 0; border-radius: 10px; background: #242424; font-size: 24px; }

/* ---- login + probe pages ---- */
body.page { overflow: auto; display: flex; justify-content: center; }
.card { width: min(560px, 92vw); margin: 10vh auto; background: var(--panel); padding: 28px; border-radius: 16px; }
.card h1 { margin: 0 0 18px; font-size: 28px; }
.card input[type=password] { width: 100%; height: 56px; border-radius: 10px; border: 0; background: #0d0d0d;
  padding: 0 16px; font-size: 22px; margin-bottom: 14px; }
.card button { width: 100%; height: 56px; border: 0; border-radius: 10px; background: var(--acc); color: #fff; font-size: 22px; }
.err { color: var(--acc); min-height: 1.3em; }
.probe { width: min(1100px, 96vw); margin: 24px auto; }
.probe table { width: 100%; border-collapse: collapse; font-size: 16px; }
.probe td { padding: 6px 8px; border-bottom: 1px solid #262626; vertical-align: top; word-break: break-word; }
.probe td:first-child { color: var(--dim); width: 34%; }
.ok { color: #3ccf5a; } .no { color: var(--acc); } .warn { color: #e8b13c; }
.probe .row { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.probe .row button { height: 52px; padding: 0 22px; border: 0; border-radius: 10px; background: #242424; font-size: 18px; }
.probe .row button.primary { background: var(--acc); color: #fff; }
.probe canvas { background: #111; border-radius: 8px; max-width: 100%; }
