/* SPIKE - THROWAWAY. Plain, touch-friendly styling; not the Support App design. */
:root {
  --bg: #111418; --bar: #1c2128; --line: #2d333b; --text: #e6edf3; --muted: #9aa4af;
  --accent: #c8102e; --ok: #3fb950; --warn: #d29922; --bad: #f85149;
  --pad-t: env(safe-area-inset-top, 0px); --pad-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; overflow: hidden;
  -webkit-text-size-adjust: 100%; }
body { display: flex; flex-direction: column; height: 100dvh; }

.state { font-size: 13px; color: var(--muted); padding: 0 6px; white-space: nowrap; }
.state.ok { color: var(--ok); } .state.warn { color: var(--warn); } .state.bad { color: var(--bad); }

#bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: calc(6px + var(--pad-t)) 8px 6px; background: var(--bar); border-bottom: 1px solid var(--line); }
.grow { flex: 1; }
button { font: inherit; color: var(--text); background: #2d333b; border: 1px solid #444c56;
  border-radius: 8px; min-height: 40px; min-width: 44px; padding: 6px 12px; cursor: pointer;
  touch-action: manipulation; -webkit-user-select: none; user-select: none; }
button:active { background: #3a424c; }
button.on { background: var(--accent); border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); font-weight: 600; }
button.big { min-height: 56px; font-size: 18px; width: 100%; }

.keys { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 8px; background: var(--bar);
  border-bottom: 1px solid var(--line); }
.keys[hidden] { display: none; }

#screen { flex: 1; min-height: 0; position: relative; background: #000;
  padding-bottom: var(--pad-b); touch-action: none; }

/* off-screen but focusable, so iOS raises its keyboard */
#kbdSink { position: fixed; left: -1000px; top: 40%; width: 10px; height: 10px; opacity: 0;
  font-size: 16px; /* 16px stops iOS zooming on focus */ }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.72); display: grid; place-items: center;
  padding: 16px; z-index: 10; }
.overlay[hidden] { display: none; }
.card { background: var(--bar); border: 1px solid var(--line); border-radius: 14px; padding: 20px;
  width: min(440px, 100%); }
.card h1 { font-size: 20px; margin: 0 0 8px; }
.card p { color: var(--muted); margin: 0 0 12px; word-break: break-word; }
.card ul { padding-left: 18px; color: var(--muted); }
form { display: grid; gap: 10px; }
form[hidden] { display: none; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
input { font: inherit; font-size: 16px; color: var(--text); background: #0d1117; border: 1px solid #444c56;
  border-radius: 8px; padding: 10px; }

/* full-screen / standalone: slimmer bar */
:fullscreen #bar, body.immersive #bar { padding-top: 4px; }
@media (max-width: 600px) { #btnScale, #btnHelp { display: none; } }
