/* ── variables ── */
:root {
  --bg:        #f4f4f2;
  --text:      #1a1a1a;
  --muted:     #888884;
  --red:       #E24B4A;
  --border:    rgba(26, 26, 26, 0.15);
  --font:      'Kode Mono', monospace;
  --reading-bg: #ebebea;
}

/* ── round colour progression ── */
body[data-round="1"] {
  --bg:         #f4f4f2;
  --text:       #1a1a1a;
  --muted:      #888884;
  --border:     rgba(26, 26, 26, 0.15);
  --reading-bg: #e4e4e2;
}

body[data-round="2"] {
  --bg:         #dcdcda;
  --text:       #2e2e2e;
  --muted:      #808080;
  --border:     rgba(46, 46, 46, 0.15);
  --reading-bg: #cecece;
}

body[data-round="3"] {
  --bg:         #c4c4c2;
  --text:       #444442;
  --muted:      #787878;
  --border:     rgba(68, 68, 68, 0.15);
  --reading-bg: #b8b8b6;
}

body[data-round="4"] {
  --bg:         #ababab;
  --text:       #5a5a5a;
  --muted:      #707070;
  --border:     rgba(90, 90, 90, 0.15);
  --reading-bg: #a0a0a0;
}

body[data-round="5"] {
  --bg:         #7a7a7a;
  --text:       #c0c0c0;
  --muted:      #a8a8a8;
  --border:     rgba(192, 192, 192, 0.15);
  --reading-bg: #686868;
}

body[data-round="6"] {
  --bg:         #4a4a4a;
  --text:       #d8d8d8;
  --muted:      #b0b0b0;
  --border:     rgba(216, 216, 216, 0.15);
  --reading-bg: #3a3a3a;
}

body[data-round="7"] {
  --bg:         #1a1a1a;
  --text:       #f4f4f2;
  --muted:      #888884;
  --border:     rgba(244, 244, 242, 0.15);
  --reading-bg: #2a2a2a;
}

/* ── reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── base ── */
html, body {
  height: 100%;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  font-size: 19px;
  line-height: 1.6;
}

/* ── screen layout ── */
/* every page uses this as its root container */
.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px;
  position: relative;
}

/* ── landing page ── */
.landing-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.site-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}

.site-subtitle {
  font-size: 30px;
  font-weight: 400;
  color: var(--muted);
}

/* ── button ── */
.btn {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 28px;
  font-family: var(--font);
  font-size: 19px;
  font-weight: 400;
  color: var(--bg);
  background: var(--text);
  border: 1px solid var(--text);
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.btn:hover {
  background: var(--red);
  color: var(--bg);
  border-color: var(--text);
}

.btn-red {
  color: var(--bg);
  background: var(--text);
  border-color: var(--text);
}

.btn-red:hover {
  background: var(--red);
  color: var(--bg);
  border-color: var(--text);
}

/* ── fine print ── */
.fine-print {
  position: absolute;
  bottom: 28px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding: 0 60px;
  line-height: 1.6;
}

/* ── shout line (failure screens rounds 1–4) ── */
.shout {
  font-size: 30px;
  font-weight: 700;
  color: var(--red);
  text-align: center;
  letter-spacing: 0.02em;
}

/* ── body text (failure screens) ── */
.verdict-body {
  font-size: 19px;
  font-weight: 400;
  color: var(--muted);
  text-align: center;
  max-width: 520px;
  line-height: 1.8;
}

.verdict-body-red {
  font-size: 19px;
  font-weight: 400;
  color: var(--red);
  text-align: center;
  max-width: 520px;
  line-height: 1.8;
}

/* ── camera page ── */
.camera-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  max-width: 480px;
}

.camera-icon {
  color: var(--muted);
  margin-bottom: 8px;
}

.camera-prompt {
  font-size: 30px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.5;
}

.camera-disclaimer {
  font-size: 19px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.6;
}

/* ── round page ── */
.screen-round {
  justify-content: flex-start;
  padding: 36px 56px;
  gap: 0;
}

.round-topbar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.round-counter {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}

.round-status {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}

.round-status .bold-red {
  font-weight: 700;
  color: var(--red);
}

.round-content {
  width: 100%;
  flex: 1;
  display: flex;
  gap: 56px;
  align-items: center;
}

.round-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 40px;
}

.scenario-text {
  font-size: 30px;
  font-weight: 400;
  color: var(--text);
  line-height: 1.6;
}

.round-right {
  width: 38%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.webcam-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  border: 0.5px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: var(--reading-bg);
}

.webcam-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* captured overlay */
.captured-overlay {
  position: absolute;
  inset: 0;
  border: 6px solid var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(226, 75, 74, 0.85);
}

.captured-text {
  font-family: var(--font);
  font-size: 72px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.08em;
}

.rec-indicator {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font);
}

.rec-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  flex-shrink: 0;
}

.emotion-reading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 0.5px solid var(--border);
  border-radius: 4px;
  background: var(--reading-bg);
}

.reading-label {
  font-size: 16px;
  color: var(--muted);
}

.reading-output {
  font-size: 16px;
  color: var(--text);
  font-weight: 400;
}

/* ── confidence box above webcam ── */
.confidence-reading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 0.5px solid var(--border);
  border-radius: 4px;
  background: var(--reading-bg);
  margin-bottom: 8px;
}

/* ── blink animation ── */
@keyframes softblink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.blink {
  animation: softblink 2s ease-in-out infinite;
}

/* ── failure / verdict page ── */
.verdict {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
  max-width: 600px;
}

.hidden {
  display: none;
}

/* ── disabled button state ── */
.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}