:root {
  --bg: #0e1117;
  --panel: #161b22;
  --panel2: #1c2230;
  --border: #2a3140;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #7c5cff;
  --accent2: #00d4a0;
  --danger: #ff6b6b;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
#root { height: 100vh; }

.wrap { max-width: 860px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 32px) 64px; }
.hero h1 { font-size: clamp(24px, 5vw, 34px); margin: 8px 0 4px; }
.sub { color: var(--muted); margin: 0 0 8px; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px; margin: 16px 0; }
.card h2 { font-size: 15px; margin: 0 0 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.grid.accents { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.opt {
  display: flex; flex-direction: column; gap: 6px; text-align: left;
  background: var(--panel2); border: 1.5px solid var(--border); color: var(--text);
  border-radius: 12px; padding: 14px; cursor: pointer; transition: border-color .12s, transform .06s;
}
.opt:hover { border-color: #3b4557; }
.opt:active { transform: scale(.99); }
.opt.sel { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,255,.18); }
.opt-title { font-weight: 600; font-size: 15px; }
.opt-sub { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.flag { font-size: 30px; }
.accents .opt { align-items: center; text-align: center; }

.pill { align-self: flex-start; font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.pill.easy { background: rgba(0,212,160,.16); color: var(--accent2); }
.pill.medium { background: rgba(255,196,0,.16); color: #ffc400; }
.pill.hard { background: rgba(255,107,107,.16); color: var(--danger); }

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.text {
  flex: 1; min-width: 140px; background: var(--panel2); border: 1.5px solid var(--border);
  color: var(--text); border-radius: 10px; padding: 11px 12px; font-size: 15px;
}
.text:focus { outline: none; border-color: var(--accent); }

.start {
  width: 100%; margin-top: 12px; background: var(--accent); color: white; border: none;
  padding: 15px; border-radius: 12px; font-size: 16px; font-weight: 700; cursor: pointer;
}
.start:hover { filter: brightness(1.08); }
.start:disabled { opacity: .6; cursor: default; }
.fineprint { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 10px; }
.error { background: rgba(255,107,107,.12); border: 1px solid rgba(255,107,107,.4); color: #ffb3b3; padding: 10px 12px; border-radius: 10px; margin: 12px 0; font-size: 14px; }
.muted { color: var(--muted); }

/* Interview room */
.room { display: grid; grid-template-columns: minmax(320px, 1fr) 1.2fr; height: 100vh; }
.left { display: flex; flex-direction: column; border-right: 1px solid var(--border); min-width: 0; padding: 14px; gap: 10px; }
.right { display: flex; flex-direction: column; padding: 14px; min-width: 0; }
.roomhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.finish { background: transparent; border: 1px solid var(--border); color: var(--muted); border-radius: 9px; padding: 8px 10px; cursor: pointer; font-size: 13px; }
.finish:hover { color: var(--text); border-color: #3b4557; }

.stages { display: flex; flex-wrap: wrap; gap: 5px; }
.stg { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: var(--panel2); color: var(--muted); border: 1px solid var(--border); }
.stg.cur { background: var(--accent); color: white; border-color: var(--accent); }
.stg.done { color: var(--accent2); border-color: rgba(0,212,160,.4); }

.transcript { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 6px 2px; }
.msg { max-width: 92%; }
.msg .who { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.msg p { margin: 3px 0 0; padding: 10px 12px; border-radius: 12px; line-height: 1.45; font-size: 14.5px; }
.msg.interviewer { align-self: flex-start; }
.msg.interviewer p { background: var(--panel); border: 1px solid var(--border); border-top-left-radius: 4px; }
.msg.candidate { align-self: flex-end; text-align: right; }
.msg.candidate p { background: var(--accent); color: white; border-top-right-radius: 4px; }

.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.status.listening .dot { background: var(--accent2); animation: pulse 1s infinite; }
.status.thinking .dot { background: #ffc400; animation: pulse 1s infinite; }
.status.speaking .dot { background: var(--accent); animation: pulse 1s infinite; }
.status.recording .dot { background: var(--danger); animation: pulse 1s infinite; }
.talk { margin-left: auto; background: var(--accent); border: none; color: #fff; border-radius: 999px; padding: 11px 18px; cursor: pointer; font-size: 14px; font-weight: 700; }
.talk:hover { filter: brightness(1.08); }
.talk:disabled { opacity: .45; cursor: default; }
.talk.rec { background: var(--danger); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.mic { background: var(--panel2); border: 1.5px solid var(--border); color: var(--text); border-radius: 999px; padding: 9px 14px; cursor: pointer; font-size: 13px; font-weight: 600; }
.mic.on { border-color: var(--accent2); color: var(--accent2); }
.stopbtn { background: var(--accent2); border: none; color: #04231c; border-radius: 999px; padding: 9px 14px; cursor: pointer; font-weight: 700; font-size: 13px; }
.typedrow { display: flex; gap: 8px; }
.send { background: var(--panel2); border: 1.5px solid var(--border); color: var(--text); border-radius: 10px; padding: 0 16px; cursor: pointer; font-weight: 600; }
.send:disabled { opacity: .5; }

.probhead { display: flex; align-items: center; gap: 10px; }
.probstmt { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin: 8px 0 12px; }
.editor { flex: 1; min-height: 200px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }

/* Feedback */
.mdbox { white-space: pre-wrap; word-wrap: break-word; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 18px; line-height: 1.55; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13.5px; }

@media (max-width: 760px) {
  .room { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
  .left { border-right: none; border-bottom: 1px solid var(--border); height: 68vh; }
  .right { height: 60vh; }
  .editor { min-height: 220px; }
}

.microw { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.microw .muted { font-size: 13px; flex: 1; min-width: 180px; }
