:root {
  --fg: rgba(255, 255, 255, 0.92);
  --dim: rgba(255, 255, 255, 0.5);
  --bg: rgba(8, 10, 16, 0.45);
  --accent: #ffcf6e;
  --font: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

#hud { position: fixed; inset: 0; pointer-events: none; color: var(--fg); font-family: var(--font); }
#hud > * { pointer-events: none; }

#topbar { position: absolute; top: 18px; left: 22px; right: 22px; display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
#brand { display: flex; align-items: center; gap: 10px; }
#brand > span:first-of-type { color: var(--fg); letter-spacing: 0.28em; font-weight: 600; }
#brand img { border-radius: 5px; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
#status { display: flex; align-items: center; gap: 8px; margin-left: 14px; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.18); }
#status-dot { width: 9px; height: 9px; border-radius: 50%; background: #666; box-shadow: 0 0 0 0 rgba(255,255,255,0); transition: background .25s; }
#status-dot.idle { background: #7dd87d; }
#status-dot.listening { background: var(--accent); animation: pulse 1s infinite; }
#status-dot.thinking { background: #7fb2ff; animation: pulse .8s infinite; }
#status-dot.applying { background: #c58bff; animation: pulse .5s infinite; }
#status-dot.error { background: #ff6b6b; }
#status-dot.offline { background: #555; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.45); } 100% { box-shadow: 0 0 0 10px rgba(255,255,255,0); } }
#badges { display: flex; gap: 14px; align-items: center; }
#mock-badge { color: #ffb347; border: 1px solid #ffb347; padding: 2px 6px; border-radius: 3px; }
#room { pointer-events: auto; cursor: pointer; color: var(--dim); text-transform: none; letter-spacing: 0; }
#room:hover { color: var(--fg); }

#bottom { position: absolute; left: 0; right: 0; bottom: 26px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 24px; }
.line { max-width: 900px; text-align: center; text-shadow: 0 2px 12px rgba(0,0,0,.7); transition: opacity .4s; }
#transcript { font-size: 22px; font-style: italic; color: var(--fg); min-height: 1.2em; }
#transcript.interim { color: var(--dim); }
#reply { font-size: 30px; color: var(--accent); min-height: 1.2em; }
#hint { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; color: var(--dim); margin-top: 6px; }
#hint kbd { border: 1px solid rgba(255,255,255,.3); border-radius: 3px; padding: 0 5px; font-family: inherit; }

#typed { pointer-events: auto; width: min(720px, 90vw); }
#typed-input { width: 100%; padding: 12px 16px; font: 18px var(--font); color: var(--fg); background: var(--bg); border: 1px solid rgba(255,255,255,.25); border-radius: 8px; outline: none; backdrop-filter: blur(8px); }
#typed-input:focus { border-color: var(--accent); }

#listen-ring { position: absolute; left: 50%; top: 50%; width: 140px; height: 140px; margin: -70px 0 0 -70px; border-radius: 50%; border: 2px solid var(--accent); opacity: .9; animation: ring 1.2s ease-out infinite; }
#listen-ring div { position: absolute; inset: 30px; border-radius: 50%; background: radial-gradient(circle, rgba(255,207,110,.5), transparent 70%); }
@keyframes ring { 0% { transform: scale(.8); opacity: .9; } 100% { transform: scale(1.25); opacity: 0; } }

.fade { opacity: 0; }

/* first-visit welcome */
#welcome[hidden] { display: none; }
#welcome { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(6, 8, 14, 0.55); backdrop-filter: blur(6px); pointer-events: auto; }
#welcome .card { width: min(560px, 88vw); background: rgba(14, 17, 26, 0.92); border: 1px solid rgba(255,255,255,.12); border-radius: 16px; padding: 32px 34px 28px; text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
#welcome img { border-radius: 10px; margin-bottom: 10px; }
#welcome h1 { font: 400 30px/1.15 var(--font); margin: 6px 0 14px; color: var(--fg); }
#welcome p { font-size: 17px; line-height: 1.5; color: rgba(255,255,255,.82); margin: 0 0 12px; }
#welcome p.small { font-family: var(--mono); font-size: 12px; color: var(--dim); }
#welcome kbd { border: 1px solid rgba(255,255,255,.35); border-radius: 4px; padding: 1px 7px; font-family: var(--mono); font-size: 0.85em; }
#welcome button { margin-top: 8px; font: 16px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: #1a1a1a; background: var(--accent); border: 0; border-radius: 8px; padding: 12px 28px; cursor: pointer; }
#welcome button:hover { filter: brightness(1.08); }
