:root {
  --bg: #000;
  --fg: #fff;
  --accent: #00ff6a;      /* matrix green accent */
  --dim: #7a7a7a;
  --ok: #00c853;
  --no: #ff3b30;
  --card: #111;
  --line: #262626;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; width: 100%;
  background: var(--bg); color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  -webkit-user-select: none; user-select: none;
  overscroll-behavior: none;
}

/* ---------- screen system ---------- */
.screen {
  position: fixed; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
}
.screen.active { display: flex; }
.scroll { width: 100%; max-width: 560px; max-height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--fg);
  font-size: 18px; font-weight: 600;
  padding: 16px 22px; border-radius: 14px;
  cursor: pointer; touch-action: manipulation;
}
.btn:active { transform: scale(0.98); }
.btn.big { font-size: 22px; padding: 20px 28px; width: 100%; margin-top: 16px; }
.btn-primary { background: var(--accent); color: #000; border-color: var(--accent); }
.btn-ghost { background: transparent; }
.btn-ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn-no { background: var(--no); color: #fff; border-color: var(--no); }

/* ---------- welcome ---------- */
#matrix-bg, #matrix-cats, #neurons { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.welcome-inner, .brain-inner, .roulette-inner, .result-inner { position: relative; z-index: 1; text-align: center; }
.sponsor-tag { color: var(--dim); letter-spacing: 2px; text-transform: uppercase; font-size: 13px; margin-bottom: 24px; }
.sponsor-tag b { color: var(--accent); }
h1 { font-size: clamp(40px, 12vw, 96px); margin: 0 0 8px; letter-spacing: 4px; }
h2 { font-size: 28px; margin: 0 0 20px; }
.subtitle { color: var(--dim); font-size: 18px; margin: 0 0 28px; }
.admin-dot { position: fixed; top: 8px; right: 8px; width: 44px; height: 44px; z-index: 5; opacity: 0; }

.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%;
  overflow: hidden; opacity: .8;
}
.glitch::before { color: var(--accent); transform: translate(-2px, 0); }
.glitch::after { color: #fff; transform: translate(2px, 0); mix-blend-mode: difference; }

/* ---------- form ---------- */
form label { display: block; margin: 14px 0 4px; font-size: 15px; color: var(--dim); }
form input, form select {
  width: 100%; padding: 14px; font-size: 17px; margin-top: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: var(--fg);
}
.photo-box { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 8px; }
.photo-preview {
  width: 140px; height: 140px; border-radius: 50%;
  background: var(--card); border: 2px dashed var(--line);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; color: var(--dim); font-size: 14px;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
#cam-video { width: 220px; border-radius: 16px; background: #000; }

/* ---------- brain ---------- */
.brain { font-size: 120px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); filter: drop-shadow(0 0 4px var(--accent)); } 50% { transform: scale(1.12); filter: drop-shadow(0 0 24px var(--accent)); } }

/* ---------- roulette ---------- */
.roulette-word {
  font-size: clamp(30px, 9vw, 64px); font-weight: 800; letter-spacing: 2px;
  min-height: 1.2em; color: var(--accent); text-shadow: 0 0 20px var(--accent);
}

/* ---------- quiz ---------- */
#screen-quiz { flex-direction: column; justify-content: flex-start; }
.quiz-top { display: flex; gap: 8px; width: 100%; max-width: 720px; margin-bottom: auto; flex-wrap: wrap; }
.pill { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; font-size: 14px; color: var(--dim); }
.quiz-body { width: 100%; max-width: 720px; margin: auto 0; text-align: center; }
.q-text { font-size: clamp(24px, 5vw, 40px); font-weight: 700; line-height: 1.25; margin: 0 0 28px; }
.q-options { display: flex; flex-direction: column; gap: 12px; }
.q-options .btn { width: 100%; font-size: 20px; }
.quiz-foot { width: 100%; max-width: 720px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; }
.mod-note { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 10px; }
.mod-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.mod-actions .btn { flex: 1; min-width: 130px; }
.q-hint { width: 100%; color: var(--dim); font-size: 16px; margin: 0 0 8px; }
.q-hint b { color: var(--fg); }

/* ---------- result ---------- */
.big-score { font-size: 40px; font-weight: 800; margin: 8px 0; }
.big-score span { color: var(--accent); }

/* ---------- admin ---------- */
.admin-stats { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; font-size: 15px; line-height: 1.6; }
.admin-buttons { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.admin-list { display: flex; flex-direction: column; gap: 8px; }
.admin-row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.admin-row img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: #000; }
.admin-row .who { font-size: 15px; }
.admin-row .who small { color: var(--dim); display: block; }
.admin-row .sc { margin-left: auto; color: var(--accent); font-weight: 700; }

.hint-line { color: var(--dim); font-size: 13px; text-align: center; margin-top: 10px; }
