:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #20242e;
  --text: #eef2ff;
  --muted: #a5afc2;
  --accent: #5b8cff;
  --danger: #ff6b6b;
  --border: #303749;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100%;
}
body { min-height: 100vh; }
.hidden { display: none !important; }

.screen {
  display: none;
  min-height: 100vh;
  padding: 24px;
  align-items: center;
  justify-content: center;
}
.screen.active { display: flex; }

.card {
  width: min(760px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 14px 36px rgba(0,0,0,0.35);
}
.card.wide { width: min(920px, 100%); }

h1, h2 { margin-top: 0; }
.muted { color: var(--muted); }
.warning {
  background: rgba(255,107,107,0.12);
  color: #ffd4d4;
  border: 1px solid rgba(255,107,107,0.35);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
}
.block {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin: 16px 0;
}
.notice-box p { margin: 10px 0; }
.check-row {
  display: block;
  margin: 10px 0;
}
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.centered-actions { justify-content: center; }
button {
  appearance: none;
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  background: var(--accent);
  color: white;
}
button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.intro-image {
  display: block;
  max-width: 100%;
  max-height: 280px;
  margin-top: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.select-box {
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #10131a;
  color: var(--text);
  border: 1px solid var(--border);
}
.phase-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.demo-wrap { gap: 18px; }
.phase-message {
  min-height: 28px;
  font-size: 18px;
  color: var(--muted);
  text-align: center;
}
.stage {
  position: relative;
  width: min(78vw, 980px);
  height: min(78vw, 980px);
  max-height: 78vh;
  background: #e8ebf2;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
#stimulus-image, #demo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #e8ebf2;
}
.red-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #ff2b2b;
  box-shadow: 0 0 8px rgba(255, 0, 0, 0.65);
  transform: translate(-50%, -50%);
  left: 50%;
  top: 50%;
}
.trial-meta {
  color: var(--muted);
  margin-bottom: 12px;
}
.rating-buttons {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}
.rating-btn {
  padding: 18px 0;
  font-size: 20px;
}
.scale-caption {
  color: var(--muted);
  margin-top: 18px;
}

@media (max-width: 760px) {
  .screen { padding: 12px; }
  .card, .card.wide { padding: 18px; }
  .rating-buttons { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}


.progress-container {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: min(680px, 72vw);
  z-index: 1200;
  text-align: center;
  font-size: 14px;
  color: var(--text);
}
#progress-text {
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 700;
}
#progress-bar-bg {
  width: 100%;
  height: 10px;
  background: rgba(255,255,255,0.12);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
#progress-bar-fill {
  width: 0%;
  height: 100%;
  background: var(--accent);
  transition: width 0.2s ease;
}
