*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-dark: #101116;
  --panel-bg: #181a22;
  --face-bg: #ffceb3;
  --text-main: #f4f4f6;
  --text-muted: #9da2b3;
  --accent-blue: #4d7cff;
  --accent-mint: #43d9ad;
  --accent-amber: #f5b041;
  --accent-coral: #ff5c77;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

.bmo-shell {
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
}

.bmo-face-frame {
  width: min(74vmin, 520px);
  height: min(74vmin, 520px);
  background: var(--face-bg);
  border-radius: 28px;
  overflow: hidden;
  box-shadow:
    0 20px 55px rgba(0, 0, 0, 0.55),
    0 0 0 4px rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}

#bmo-face-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.bmo-hud {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 540px;
  width: 100%;
  text-align: center;
}

.bmo-status-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.bmo-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-amber);
  transition: background 0.2s ease, transform 0.2s ease;
}

.bmo-status-dot[data-state='idle'] {
  background: var(--text-muted);
}

.bmo-status-dot[data-state='listening'] {
  background: var(--accent-mint);
  box-shadow: 0 0 10px var(--accent-mint);
}

.bmo-status-dot[data-state='thinking'] {
  background: var(--accent-amber);
  box-shadow: 0 0 10px var(--accent-amber);
}

.bmo-status-dot[data-state='talking'] {
  background: var(--accent-blue);
  box-shadow: 0 0 10px var(--accent-blue);
}

.bmo-status-dot[data-state='error'] {
  background: var(--accent-coral);
}

.bmo-progress-wrap {
  width: min(320px, 82vw);
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  transition: opacity 0.25s ease;
}

.bmo-progress-wrap[hidden] {
  display: none;
}

.bmo-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-mint), var(--accent-blue));
  border-radius: 999px;
  transition: width 0.2s ease;
}

.bmo-caption {
  min-height: 1.5em;
  max-width: 500px;
  font-size: 0.96rem;
  line-height: 1.4;
  color: var(--text-muted);
  padding: 0 10px;
  user-select: text;
}

.bmo-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bmo-mic-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #232634;
  color: var(--text-main);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.bmo-mic-btn:hover {
  background: #2d3142;
}

.bmo-mic-btn:active {
  transform: scale(0.97);
}

.bmo-mic-btn.is-listening {
  background: rgba(67, 217, 173, 0.16);
  border-color: var(--accent-mint);
  color: #eafff8;
}

.mic-ring {
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  border: 2px solid var(--accent-mint);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease, transform 0.1s ease;
}

.bmo-kbd-toggle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #232634;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.bmo-kbd-toggle:hover,
.bmo-kbd-toggle[aria-expanded='true'] {
  background: #2d3142;
  color: var(--text-main);
  border-color: var(--accent-blue);
}

.bmo-keyboard-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(440px, 92vw);
  background: var(--panel-bg);
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.bmo-keyboard-box[hidden] {
  display: none;
}

.bmo-prompt-input {
  flex: 1;
  background: #252834;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
}

.bmo-prompt-input::placeholder {
  color: var(--text-muted);
}

.bmo-send-btn {
  background: var(--accent-blue);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.bmo-send-btn:hover {
  background: #668fff;
}
