/* אותו מראה כמו רוורס יצירתי (שחור, כפתורים גדולים), בצבע של האפליקציה: צהוב. */
:root {
  --bg: #000000;
  --text: #ffffff;
  --muted: #9a9a9a;
  --border: #2a2a2a;
  --accent: #fdd803;
  --whatsapp: #25d366;
  --red: #ff3b30;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.screen {
  display: none;
  flex-direction: column;
  min-height: 100%;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
}
.screen.active { display: flex; }

.center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}

.hero { width: min(240px, 62vw); aspect-ratio: 1; object-fit: cover; border-radius: 28px; }
h1 { font-size: 34px; margin: 8px 0 0; }
h2 { font-size: 28px; margin: 0 0 12px; }
h2.mt { font-size: 24px; margin: 12px 0 0; }
.subtitle { color: var(--accent); font-size: 20px; font-weight: 700; margin: -6px 0 0; }
.muted { color: var(--muted); font-size: 17px; margin: 0; }
.small { font-size: 15px; margin: -4px 0 12px; }
.icon { font-size: 48px; margin: 0; }
.hint { color: var(--muted); font-size: 14px; margin-top: 12px; }

.steps {
  list-style: none;
  padding: 0;
  margin: 6px 0;
  text-align: right;
  font-size: 17px;
  line-height: 1.45;
  width: 100%;
  max-width: 420px;
}
.center > * { max-width: 100%; }
.steps li { margin: 6px 0; }
.steps b { color: var(--accent); margin-left: 6px; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 64px;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  font-size: 20px;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  margin-top: 12px;
}
.btn:active { opacity: 0.7; }
.btn.primary { background: var(--accent); color: #000; }
.btn.whatsapp { background: var(--whatsapp); color: #fff; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); font-size: 17px; font-weight: 600; }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.done { background: #1f3d2a; color: var(--whatsapp); }
.center .btn { max-width: 420px; }

.player {
  flex: 1;
  min-height: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  display: flex;
}
.player video { width: 100%; height: 100%; max-height: 62vh; object-fit: contain; }
.actions { margin-top: 8px; }

.code-input {
  width: 100%;
  max-width: 260px;
  margin-top: 8px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: #111;
  color: var(--text);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 10px;
  text-align: center;
  font-family: inherit;
}
.code-input:focus { outline: none; border-color: var(--accent); }
.error-text { color: #ff6b6b; font-size: 15px; min-height: 20px; margin: 0; }

.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 15px;
  font-family: inherit;
  text-decoration: underline;
  cursor: pointer;
  padding: 8px;
}
.class-tag {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 8px;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.copyright { color: var(--muted); font-size: 12px; line-height: 18px; text-align: center; margin: 0; }

/* ---------- מסך המצלמה ---------- */
.camera-screen { padding: 0; height: 100%; }
.stage { position: relative; flex: 1; min-height: 0; background: #000; overflow: hidden; }
.stage video, .stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.stage canvas { opacity: 0.4; pointer-events: none; display: none; }
.stage canvas.on { display: block; }
.mirror { transform: scaleX(-1); }

.topbar {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.timer {
  background: rgba(0, 0, 0, 0.6);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  direction: ltr;
}
.timer.paused { color: var(--accent); }
.rec-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--red); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

.bar { position: absolute; top: 0; left: 0; right: 0; height: 5px; background: rgba(255, 255, 255, 0.15); }
.bar-fill { height: 100%; width: 0; background: var(--accent); transition: width 0.2s linear; }

.pause-tip {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  margin: 0;
  background: rgba(0, 0, 0, 0.7);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 12px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 16px 16px max(16px, env(safe-area-inset-bottom));
  background: #000;
}
.round {
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.round:active { opacity: 0.7; }
.round.small { width: 52px; height: 52px; background: #1c1c1c; color: #fff; font-size: 22px; }
.round.rec { width: 80px; height: 80px; background: transparent; border: 5px solid #fff; }
.rec-inner { width: 60px; height: 60px; border-radius: 50%; background: var(--red); }
.round.pause { width: 80px; height: 80px; background: var(--accent); color: #000; font-size: 34px; }
.round.pause.resume { background: var(--red); color: #fff; }
.round.stop { width: 64px; height: 64px; background: #fff; }
.square { width: 24px; height: 24px; background: var(--red); border-radius: 4px; }
.round[hidden] { display: none; }
