:root {
  --bg: #05070d;
  --bg2: #0b1020;
  --card: rgba(18, 24, 42, 0.72);
  --line: rgba(255, 255, 255, 0.08);
  --text: #e8ecf6;
  --muted: #8a93ab;
  --accent: #6ccfff;
  --warm: #ffb36b;
  --danger: #ff7a7a;
  --radius: 18px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* monitor mode: the browser only watches a session run in the VR app */
body:not(.monitor) .monitor-only { display: none !important; }
body.monitor #doneBtn, body.monitor #keyboardBtn, body.monitor #textForm { display: none !important; }
.log .e { color: var(--warm); font-size: 12px; margin-top: 8px; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Noto Sans JP", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 50% 45%, #0e1630 0%, transparent 60%),
    var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .35; cursor: default; }
input {
  font: inherit; color: var(--text);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; width: 100%; outline: none;
}
input:focus { border-color: rgba(108,207,255,.5); }
code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--accent); word-break: break-all; }

/* ---------- screens ---------- */
.screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .5s ease;
  padding: 16px;
}
.screen.active { opacity: 1; pointer-events: auto; }

.card {
  width: min(520px, 100%);
  max-height: calc(100vh - 32px); overflow: auto;
  background: var(--card); backdrop-filter: blur(18px);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
}
.brand { margin-bottom: 28px; font-size: 13px; letter-spacing: .3em; text-transform: uppercase; color: var(--accent); }
.lead { color: var(--muted); line-height: 1.8; margin: 8px 0 24px; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 8px 0 0; }
h2 { font-weight: 500; margin: 0 0 4px; }
.field { display: block; margin-bottom: 20px; }
.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; letter-spacing: .05em; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmented button {
  background: rgba(255,255,255,0.03); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; font-size: 16px; display: flex; flex-direction: column; gap: 2px; align-items: center;
}
.segmented button small { font-size: 11px; color: var(--muted); }
.segmented button.on { border-color: var(--accent); background: rgba(108,207,255,.1); }

.primary {
  width: 100%; border: 0; border-radius: 999px; padding: 15px;
  background: linear-gradient(90deg, #5fb8ff, #8b7bff); color: #050814; font-weight: 700; letter-spacing: .1em;
  box-shadow: 0 10px 30px rgba(110,140,255,.35);
}
.ghost {
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 16px; font-size: 13px; white-space: nowrap;
}
.ghost.danger { color: var(--danger); border-color: rgba(255,122,122,.3); }

.mic-check { display: flex; gap: 12px; align-items: center; }
.meter { flex: 1; height: 6px; border-radius: 3px; background: rgba(255,255,255,.06); overflow: hidden; }
.meter > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--warm), #ff6f9b); transition: width .08s linear; }

.advanced { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; }
.advanced summary { color: var(--muted); font-size: 12px; cursor: pointer; margin-bottom: 14px; }

/* ---------- likert ---------- */
.likert { width: min(720px, 100%); }
.likert-item { padding: 18px 0; border-bottom: 1px solid var(--line); }
.likert-item p { margin: 0 0 12px; line-height: 1.7; }
.scale { display: grid; gap: 6px; }
.scale button {
  aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(255,255,255,.03); font-size: 14px; min-width: 0;
}
.scale button.on { background: var(--accent); color: #04121c; border-color: var(--accent); font-weight: 700; }
.scale-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.likert .primary { margin-top: 24px; }

/* ---------- interview ---------- */
#screen-interview { flex-direction: column; justify-content: space-between; padding: 0; }
.topbar {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 28px; color: var(--muted); font-size: 13px;
}
.phase { letter-spacing: .15em; min-width: 120px; }
.clock { min-width: 120px; text-align: right; font-variant-numeric: tabular-nums; }
.clock small { margin-left: 4px; opacity: .6; }

.stage { position: relative; flex: 1; width: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; }
#orb { position: absolute; inset: 0; width: 100%; height: 100%; }
.status {
  position: absolute; bottom: 6%; left: 50%; transform: translateX(-50%);
  font-size: 13px; letter-spacing: .3em; color: var(--muted); white-space: nowrap;
}

.caption-wrap { width: min(860px, 100%); padding: 0 24px; min-height: 120px; text-align: center; }
.caption { font-size: clamp(18px, 2.4vw, 24px); line-height: 1.8; margin: 0; font-weight: 400; transition: opacity .4s; }
.caption.hidden { opacity: 0; }
.heard { color: var(--muted); font-size: 14px; margin: 10px 0 0; min-height: 1.6em; transition: opacity .6s; }

.controls { display: flex; align-items: center; justify-content: center; gap: 24px; padding: 18px 0 36px; }
.done-btn {
  min-width: 200px; padding: 16px 28px; border-radius: 999px;
  border: 1px solid rgba(255,179,107,.5); background: rgba(255,179,107,.12); color: #ffd7b0;
  font-size: 16px; letter-spacing: .15em; transition: all .3s;
}
.done-btn:not(:disabled):hover { background: rgba(255,179,107,.22); }
.icon {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); padding: 0;
}
.icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.on { border-color: var(--accent); color: var(--accent); }
.icon.small { width: 28px; height: 28px; font-size: 16px; }
.gear { position: fixed; right: 20px; bottom: 20px; opacity: .35; }
.gear:hover { opacity: 1; }

.textbox { display: flex; gap: 8px; width: min(640px, calc(100% - 32px)); margin: -18px auto 28px; }

.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%);
  background: rgba(10,14,26,.94); backdrop-filter: blur(16px);
  border-left: 1px solid var(--line); padding: 20px; display: flex; flex-direction: column; gap: 12px;
  z-index: 10;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); }
.log { flex: 1; overflow: auto; border-top: 1px solid var(--line); padding-top: 12px; font-size: 13px; line-height: 1.7; }
.log .q { color: var(--accent); margin-top: 10px; }
.log .a { color: var(--text); }
.log .meta { color: var(--muted); font-size: 11px; }

/* ---------- done ---------- */
.done { text-align: center; }
.done-mark {
  width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, #8fd8ff 35%, rgba(139,123,255,.2) 70%, transparent 72%);
  box-shadow: 0 0 60px rgba(108,207,255,.5);
}

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: rgba(20,26,44,.95); border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 18px; font-size: 13px; opacity: 0; transition: all .3s; pointer-events: none; z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .card { padding: 22px; }
  .topbar { padding: 14px 16px; flex-wrap: wrap; }
    .controls { gap: 14px; }
  .done-btn { min-width: 150px; }
  .gear { top: 52px; right: 12px; bottom: auto; width: 36px; height: 36px; }
}
