:root {
  --bg: #0a0f1a;
  --accent: #facc15;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --card: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.12);
  --ok: #4ade80;
  --bad: #f87171;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: "Geeza Pro", "Tahoma", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  background-image: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(250, 204, 21, 0.12), transparent);
  color: var(--text);
  line-height: 1.55;
  min-height: 100dvh;
}
a {
  color: var(--accent);
  text-decoration: none;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 5%;
  background: rgba(10, 15, 26, 0.94);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 800;
}
.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 5% calc(28px + env(safe-area-inset-bottom));
}
h1 {
  font-size: 1.35rem;
  color: var(--accent);
  margin-bottom: 8px;
}
.lead {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 18px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}
label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}
input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 14px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f172a;
  color: #fff;
  font-size: 1.05rem;
  text-align: center;
  letter-spacing: 0.08em;
}
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 12px;
  padding: 14px 16px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  background: var(--accent);
  color: #0a0f1a;
  font-weight: 800;
  font-size: 1rem;
}
[hidden] {
  display: none !important;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.err {
  color: var(--bad);
  font-weight: 700;
  margin-top: 10px;
  min-height: 1.2em;
}
.progress {
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 0.85rem;
}
.q {
  font-size: 1.08rem;
  font-weight: 800;
  margin-bottom: 14px;
  line-height: 1.45;
}
.opt {
  display: block;
  width: 100%;
  text-align: right;
  margin: 8px 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}
.opt:hover,
.opt:focus {
  border-color: var(--accent);
}
.opt.is-ok {
  border-color: var(--ok);
  background: rgba(74, 222, 128, 0.12);
}
.opt.is-bad {
  border-color: var(--bad);
  background: rgba(248, 113, 113, 0.12);
}
.why {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(250, 204, 21, 0.08);
  border: 1px solid rgba(250, 204, 21, 0.28);
  font-size: 0.92rem;
}
.src {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 8px;
}
#gate,
#nick,
#quiz,
#done {
  display: none;
}
#gate.on,
#nick.on,
#quiz.on,
#done.on {
  display: block;
}
.score {
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
  text-align: center;
  margin: 12px 0;
}
.fr {
  unicode-bidi: isolate;
  direction: ltr;
  font-weight: 800;
}
.terms {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: left;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-weight: 800;
  color: var(--accent);
  margin: -6px 0 14px;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.ltr-input {
  direction: ltr;
  letter-spacing: 0.04em;
  text-align: left;
}
.ok-msg {
  color: var(--ok);
  font-weight: 700;
  margin-top: 10px;
}
.wait-msg {
  color: var(--muted);
  font-weight: 700;
  margin-top: 10px;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--accent);
}
.board-page .board-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 20px 4% calc(28px + env(safe-area-inset-bottom));
}
.board-head h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
}
.board-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.board-row {
  display: grid;
  grid-template-columns: 4.5rem 1fr 6.5rem 4.5rem 5rem;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
}
.board-row .time {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.board-row--head {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(0, 0, 0, 0.25);
}
.board-row--top {
  background: rgba(250, 204, 21, 0.08);
}
.board-row .pseudo {
  color: #fff;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}
.admin-reset {
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.9rem;
}
.admin-reset summary {
  cursor: pointer;
  margin-bottom: 10px;
}
.admin-reset .card {
  margin-top: 8px;
}
.btn-danger {
  background: #ef4444;
  color: #fff;
}
