:root {
  --bg: #070710;
  --bg-glow: #0d0f1e;
  --eye-color: #4A9EFF;
  --btn-bg: rgba(255, 255, 255, 0.06);
  --btn-border: rgba(74, 158, 255, 0.25);
  --btn-bg-active: rgba(74, 158, 255, 0.18);
  --text: #8899b4;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  /* Deep space gradient with subtle blue glow */
  background:
    radial-gradient(ellipse 60% 40% at 50% 30%, rgba(74, 158, 255, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse at 50% 100%, #0a0c16 0%, var(--bg) 60%);
}

/* ─── EVE Face ─────────────────────────────────────────── */
#eve-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px;
  position: relative;
}

#eve-face {
  width: min(72vw, 340px);
  height: auto;
  max-height: 62vh;
  cursor: pointer;
  /* Gentle float */
  animation: float 6s ease-in-out infinite;
  transition: transform 0.15s ease;
}

#eve-face:active {
  transform: scale(0.97);
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

/* Body breathing */
#eve-body {
  animation: breathe 5s ease-in-out infinite;
  transform-origin: 150px 200px;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.015); }
}

/* ─── Eyes ─────────────────────────────────────────────── */
.eye {
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.eye-halo {
  transition: opacity 0.35s ease, r 0.35s ease;
}

/* Blink */
.blink .eye {
  ry: 2 !important;
}
.blink .eye-halo {
  opacity: 0.15 !important;
}

/* ─── Emotion colors ───────────────────────────────────── */
.eve-idle      { --eye-color: #4A9EFF; }
.eve-listening { --eye-color: #5BB0FF; }
.eve-thinking  { --eye-color: #7FE0FF; }
.eve-happy     { --eye-color: #5BE8C4; }
.eve-surprised { --eye-color: #FFD55B; }
.eve-sad       { --eye-color: #7B8FFF; }
.eve-sleeping  { --eye-color: #3A5078; }

/* Thinking: subtle pulse */
.eve-thinking #eye-group {
  animation: thinkPulse 1.2s ease-in-out infinite;
}
@keyframes thinkPulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

/* Listening: eyes slightly bigger, halo brighter */
.eve-listening .eye-halo {
  opacity: 0.7;
}

/* Sleeping: everything dimmer */
.eve-sleeping #eve-body {
  opacity: 0.75;
}
.eve-sleeping .eye-halo {
  opacity: 0.2;
}

/* ─── Controls ─────────────────────────────────────────── */
#controls {
  display: flex;
  justify-content: center;
  padding: 0 20px 50px;
  width: 100%;
}

#talk-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--btn-bg);
  border: 2px solid var(--btn-border);
  color: var(--eye-color);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
}

/* Pulsing ring to invite interaction */
#talk-btn::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--btn-border);
  opacity: 0;
  animation: invitePulse 2.5s ease-out infinite;
}

@keyframes invitePulse {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.15); opacity: 0; }
}

#talk-btn:hover {
  background: rgba(74, 158, 255, 0.12);
  transform: scale(1.04);
  border-color: rgba(74, 158, 255, 0.4);
}

#talk-btn:active {
  transform: scale(0.92);
}

#talk-btn.recording {
  background: rgba(255, 90, 110, 0.15);
  border-color: rgba(255, 90, 110, 0.5);
  color: #FF6E7F;
  animation: recordingPulse 1s ease-in-out infinite;
}

#talk-btn.recording::before {
  border-color: rgba(255, 90, 110, 0.4);
  animation-duration: 1s;
}

@keyframes recordingPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 90, 110, 0.2), 0 8px 32px rgba(0,0,0,0.3); }
  50% { box-shadow: 0 0 0 24px rgba(255, 90, 110, 0), 0 8px 32px rgba(0,0,0,0.3); }
}

#talk-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  animation: none;
}
#talk-btn:disabled::before {
  display: none;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-label {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

/* ─── Status bar ───────────────────────────────────────── */
#status-bar {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  color: rgba(100, 120, 150, 0.35);
  pointer-events: none;
}
