:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --ink: #1b1b1f;
  --muted: #6b6b73;
  --line: #d9d8d3;
  --accent: #1b1b1f;
  --accent-ink: #ffffff;
  --danger: #c4312f;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16161a;
    --surface: #1f1f24;
    --ink: #ededef;
    --muted: #a0a0a8;
    --line: #34343b;
    --accent: #ededef;
    --accent-ink: #16161a;
    --danger: #ff6b6b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { touch-action: manipulation; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 Poppins, system-ui, -apple-system, "Segoe UI", sans-serif;
  padding: env(safe-area-inset-top, 0px) 16px env(safe-area-inset-bottom, 0px);
}
a { color: inherit; }
[hidden] { display: none !important; }

.page { max-width: 460px; margin: 0 auto; padding-block: 28px 48px; display: flex; flex-direction: column; gap: 18px; }
.brand { margin: 0; color: var(--muted); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
h1 { margin: 4px 0 0; font-size: 1.6rem; font-weight: 600; line-height: 1.2; }
h2 { margin: 0; font-size: 1.15rem; }
.lede { color: var(--muted); margin: 8px 0 0; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; display: flex; flex-direction: column; gap: 14px;
}
.card p { margin: 0; }
.note { color: var(--muted); font-size: 0.92rem; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tab {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
label small { color: var(--muted); font-weight: 400; font-size: 0.82rem; }
input {
  font: inherit; font-size: 16px; /* 16px keeps iOS from zooming into the field */
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink);
}
input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; }
label.check input { width: 20px; height: 20px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.error { color: var(--danger); font-size: 0.92rem; min-height: 0; }
.error:empty { display: none; }

.code {
  font: 600 1.35rem/1.2 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.06em;
  text-align: center; padding: 14px; border-radius: 10px; background: var(--bg);
  border: 1px dashed var(--line); user-select: all;
}

.games { margin: 0; padding-left: 1.2em; }
.games li { margin: 2px 0; }

details.danger summary { cursor: pointer; color: var(--danger); font-weight: 500; }
details.danger form { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }

footer { color: var(--muted); font-size: 0.82rem; }
