/* Adapted from m2sv's human_eval/static/style.css: same colours and controls; text panels instead of images. */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0f1115;
  --panel: #1a1d24;
  --line: #2a2f3a;
  --fg: #e6e8ec;
  --muted: #8b93a1;
  --accent: #4f8cff;
  --accent-dim: #25406e;
}
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: #ff6b6b; min-height: 1.2em; margin-top: 8px; }

/* ---- Overlays (welcome / done) ---- */
.overlay {
  position: fixed; inset: 0; overflow-y: auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); z-index: 10; padding: 20px;
}
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 32px; max-width: 640px; width: 100%;
}
.card h1 { font-size: 22px; margin-bottom: 14px; }
.card p { margin-bottom: 12px; line-height: 1.5; }
.instructions {
  margin: 14px 0; padding: 14px 16px;
  background: #0c0e12; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; line-height: 1.5;
}
.instructions ul { margin: 0 0 8px 18px; display: grid; gap: 6px; }
.legend { list-style: none; margin: 14px 0; display: grid; gap: 8px; }
.legend li { color: var(--muted); }
.email-row { display: flex; gap: 10px; }
#email-form { margin-top: 18px; }
#email {
  flex: 1; padding: 12px 14px; border-radius: 9px;
  border: 1px solid var(--line); background: #0c0e12; color: var(--fg); font-size: 16px;
}
button {
  padding: 12px 20px; border: none; border-radius: 9px; cursor: pointer;
  background: var(--accent); color: white; font-size: 15px; font-weight: 600;
}
button:disabled { background: var(--accent-dim); color: #9fb3d6; cursor: not-allowed; }
kbd {
  background: #0c0e12; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 7px; font-family: ui-monospace, monospace; font-size: 12px;
}

/* ---- App layout ---- */
#app { display: flex; flex-direction: column; height: 100vh; height: 100svh; }
#topbar {
  display: flex; align-items: center; gap: 22px;
  padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--panel);
  flex: 0 0 auto; font-size: 14px;
}
.stat { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.stat.timer { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 16px; }
.hints { margin-left: auto; }
.bar { width: 140px; height: 7px; background: #0c0e12; border-radius: 4px; overflow: hidden; }
#progress-fill { height: 100%; width: 0%; background: var(--accent); transition: width .2s; }

#stage {
  flex: 1 1 auto; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 12px; padding: 12px 18px;
}
.panel {
  min-height: 0; min-width: 0; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px;
}
.panel-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px;
}
#project { font-size: 13px; margin-bottom: 12px; line-height: 1.4; }
#request {
  font-size: 17px; line-height: 1.6; border-left: 3px solid var(--accent); padding-left: 14px;
}
#comments { margin-left: 22px; display: grid; gap: 10px; font-size: 15px; line-height: 1.5; }

/* ---- Note ---- */
#note-row { flex: 0 0 auto; padding: 8px 18px 0; }
#note {
  width: 100%; resize: vertical; min-height: 38px;
  padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: #0c0e12; color: var(--fg);
  font-family: inherit; font-size: 16px; line-height: 1.4;
}
#note:focus { outline: none; border-color: var(--accent); }
#note-toggle.active { color: #7aa9ff; }
.linkbtn {
  background: none; border: none; padding: 0; margin: 0;
  color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: underline; cursor: pointer;
}

/* ---- Controls ---- */
#controls {
  flex: 0 0 auto; padding: 12px 18px 16px;
  border-top: 1px solid var(--line); background: var(--panel);
  display: flex; align-items: center; gap: 14px;
}
#note-toggle { flex: 0 0 auto; white-space: nowrap; }
#options { display: flex; gap: 10px; flex: 1; flex-wrap: wrap; }
.option {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 16px; border: 1px solid var(--line); border-radius: 10px;
  background: #0c0e12; cursor: pointer; font-size: 15px; user-select: none;
}
.option .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 5px; background: var(--line);
  font-size: 12px; font-family: ui-monospace, monospace;
}
.option.selected { border-color: var(--accent); background: var(--accent-dim); }
.option.selected .num { background: var(--accent); color: white; }
#next-btn { flex: 0 0 auto; }

/* ---- Small screens: stack the panels, options full width ---- */
@media (max-width: 820px) {
  #topbar { flex-wrap: wrap; gap: 8px 12px; padding: 7px 11px; font-size: 12px; }
  .hints { display: none; }
  .bar { width: 60px; }
  #stage { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); padding: 8px; gap: 8px; }
  #request-panel { max-height: 38vh; }
  #request { font-size: 15px; }
  #comments { font-size: 14px; }
  #controls { flex-wrap: wrap; padding: 8px; gap: 8px; }
  #options { flex: 1 1 100%; order: 1; gap: 6px; }
  .option { flex: 1 1 45%; justify-content: center; padding: 11px 6px; }
  .option .num { display: none; }
  #note-row { padding: 4px 8px 0; }
  #note-toggle { order: 2; }
  #next-btn { order: 3; margin-left: auto; }
  .overlay { align-items: flex-start; padding: 14px; }
  .card { padding: 20px; }
}
