:root {
  --bg: #0f1220;
  --panel: #171a2e;
  --accent: #6ee7ff;
  --mouth: #f472b6;
  --text: #e8e9ef;
  --muted: #8b90a8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(1200px 800px at 50% 20%, #1a1f3a, var(--bg));
  color: var(--text);
}

.stage {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.stage-voice {
  max-width: 560px;
  gap: 1.25rem;
}

.profile-panel {
  background: var(--panel);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.35rem 1rem 0.85rem;
}

.profile-panel summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.35rem 0;
  color: var(--accent);
}

.profile-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
  margin-top: 0.5rem;
}

.profile-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.profile-form input {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0f111f;
  color: var(--text);
  padding: 0.45rem 0.55rem;
  min-width: 8rem;
}

.profile-form button {
  border: none;
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(167, 139, 250, 0.35);
  color: var(--text);
  border: 1px solid rgba(167, 139, 250, 0.45);
}

.profile-note {
  margin-top: 0.65rem;
  font-size: 0.75rem;
  line-height: 1.35;
}

.robot-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: center;
  gap: 0;
}

.robot-antenna {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: -0.35rem;
  z-index: 4;
}

.robot-antenna::before {
  content: "";
  width: 5px;
  height: 15px;
  background: linear-gradient(180deg, #64748b, #1e293b);
  border-radius: 3px 3px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.antenna-bulb {
  width: 12px;
  height: 12px;
  margin-top: -2px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 32%, #f8fafc, #22d3ee 42%, #0e7490);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.55);
  animation: antenna-pulse 2.6s ease-in-out infinite;
}

.robot-shell {
  filter: drop-shadow(0 22px 48px rgba(0, 0, 0, 0.5));
}

.robot.crt-bot {
  --face-glow: rgba(57, 255, 20, 0.14);
  --pupil-color: #39ff14;
  --mouth-color: #4ade80;
  --eye-w: 54px;
  --eye-h: 58px;
  --brow-angle: 0deg;
  --screen-bg: #030806;
  align-self: center;
  width: min(520px, 96vw);
  max-width: 100%;
  aspect-ratio: 5 / 3.15;
  padding: 1rem 1.15rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  position: relative;
  background: linear-gradient(165deg, #5c6578 0%, #3d4455 22%, #252a33 55%, #15181e 100%);
  border-radius: 44px;
  border: 2px solid rgba(0, 0, 0, 0.5);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 32px 70px rgba(0, 0, 0, 0.55),
    inset 0 -16px 40px rgba(0, 0, 0, 0.35);
  transition: box-shadow 0.4s ease, border-color 0.35s ease;
}

.crt-outer-bezel {
  position: absolute;
  inset: 12px;
  border-radius: 36px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 2;
}

.crt-screen {
  position: relative;
  flex: 1;
  min-height: clamp(220px, 52vw, 300px);
  width: 100%;
  border-radius: 30px;
  background: radial-gradient(ellipse 100% 70% at 50% 20%, rgba(57, 255, 20, 0.04), transparent 55%), var(--screen-bg);
  overflow: hidden;
  border: 1px solid #0f140f;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.92);
  z-index: 1;
}

.crt-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.22) 0px,
    rgba(0, 0, 0, 0.22) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.4;
  pointer-events: none;
  z-index: 8;
  mix-blend-mode: multiply;
}

.crt-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 45%, transparent 40%, rgba(0, 0, 0, 0.65) 100%);
  pointer-events: none;
  z-index: 7;
}

.crt-screen .brows {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  gap: clamp(5.5rem, 24vw, 10rem);
  height: 6px;
  z-index: 10;
}

.crt-screen .brow {
  width: clamp(36px, 12vw, 48px);
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, transparent, rgba(57, 255, 20, 0.4), transparent);
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.35);
}

.linked-eyes-wrap {
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: center;
  padding: clamp(2.5rem, 14vw, 3.75rem) 0 0.25rem;
  animation: linked-gaze 9s ease-in-out infinite;
  transform-origin: 50% 70%;
}

.linked-eyes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(3.5rem, 15vw, 7rem);
}

.screen-eye {
  width: var(--eye-w);
  height: var(--eye-h);
  border-radius: 50% 50% 46% 46%;
  background: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.55), var(--pupil-color) 38%, #063a12 78%, #020805 100%);
  box-shadow:
    0 0 22px var(--pupil-color),
    0 0 48px rgba(57, 255, 20, 0.22),
    inset 0 -10px 18px rgba(0, 0, 0, 0.55);
  transition:
    width 0.35s ease,
    height 0.35s ease,
    border-radius 0.35s ease,
    transform 0.35s ease,
    filter 0.35s ease,
    box-shadow 0.35s ease;
}

.crt-screen .mouth-wrap {
  position: absolute;
  bottom: 12%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 9;
  margin: 0;
}

.screen-mouth {
  width: 76px;
  height: 22px;
  border-radius: 0 0 52px 52px;
  background: radial-gradient(ellipse 80% 120% at 50% 0%, rgba(255, 255, 255, 0.25), var(--mouth-color) 55%, #052e16 100%);
  transform-origin: center top;
  transform: scaleY(0.9);
  box-shadow: 0 0 20px var(--mouth-color), 0 6px 24px rgba(0, 0, 0, 0.45);
  transition: width 0.35s ease, height 0.35s ease, border-radius 0.35s ease, transform 0.35s ease, background 0.35s ease;
}

.robot.thinking .linked-eyes-wrap {
  animation-play-state: paused;
  transform: scaleY(0.48) translateY(10px);
  transition: transform 0.25s ease;
}

.robot.speaking .screen-mouth {
  animation: talk 0.36s ease-in-out infinite alternate;
}

.robot.speaking .linked-eyes-wrap {
  animation-play-state: paused;
}

.robot.listening {
  box-shadow:
    0 0 0 2px rgba(57, 255, 20, 0.45),
    0 32px 70px rgba(0, 0, 0, 0.55),
    inset 0 -16px 40px rgba(0, 0, 0, 0.35);
}

@keyframes linked-gaze {
  0%,
  100% {
    transform: translate(-22px, 16px) rotate(-8deg) scale(1);
  }
  18% {
    transform: translate(26px, -18px) rotate(7deg) scale(1.04);
  }
  36% {
    transform: translate(12px, 20px) rotate(9deg) scale(0.97);
  }
  55% {
    transform: translate(-28px, -10px) rotate(-7deg) scale(1.03);
  }
  74% {
    transform: translate(8px, 12px) rotate(5deg) scale(1);
  }
}

@keyframes blink-pair {
  0%,
  90%,
  100% {
    opacity: 1;
    transform: scaleY(1);
  }
  93%,
  96% {
    opacity: 0.2;
    transform: scaleY(0.12);
  }
}

.robot.thinking .screen-eye {
  animation: blink-pair 1.1s ease-in-out infinite;
}

@keyframes antenna-pulse {
  0%,
  100% {
    opacity: 1;
    filter: brightness(1);
  }
  50% {
    opacity: 0.82;
    filter: brightness(0.92);
  }
}

.emotion-label {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.robot-panel {
  background: var(--panel);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.35rem 1rem 0.85rem;
}

.robot-panel summary {
  cursor: pointer;
  font-weight: 600;
  color: #c4b5fd;
  padding: 0.35rem 0;
}

.robot-panel-hint {
  font-size: 0.78rem;
  line-height: 1.4;
  margin: 0.4rem 0 0.65rem;
}

.robot-preview-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.robot-preview-row select {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0f111f;
  color: var(--text);
  padding: 0.4rem 0.6rem;
  min-width: 11rem;
}

.crt-screen .brow.left {
  transform-origin: 80% 50%;
  transform: rotate(var(--brow-angle));
}

.crt-screen .brow.right {
  transform-origin: 20% 50%;
  transform: rotate(calc(-1 * var(--brow-angle)));
}

/* ——— Duygular (CRT yeşil ekran + ortak göz hareketi) ——— */

.robot.emotion-neutral {
  --face-glow: rgba(57, 255, 20, 0.12);
  --pupil-color: #39ff14;
  --mouth-color: #4ade80;
  --brow-angle: 0deg;
}

.robot.emotion-neutral .brow.left,
.robot.emotion-neutral .brow.right {
  transform: rotate(0deg);
}

.robot.emotion-happy {
  --face-glow: rgba(250, 204, 21, 0.18);
  --pupil-color: #fde047;
  --mouth-color: #fb7185;
  --brow-angle: -6deg;
}

.robot.emotion-happy .brow.left {
  transform: rotate(-10deg) translateY(1px);
}

.robot.emotion-happy .brow.right {
  transform: rotate(10deg) translateY(1px);
}

.robot.emotion-happy .screen-mouth {
  border-radius: 0 0 56px 56px;
  transform: scaleY(1) scaleX(1.05);
  height: 22px;
}

.robot.emotion-happy .crt-screen {
  box-shadow:
    inset 0 0 100px rgba(0, 0, 0, 0.92),
    inset 50px 0 70px -28px rgba(251, 113, 133, 0.12),
    inset -50px 0 70px -28px rgba(251, 113, 133, 0.12);
}

.robot.emotion-sad {
  --face-glow: rgba(96, 165, 250, 0.08);
  --pupil-color: #7dd3fc;
  --mouth-color: #818cf8;
}

.robot.emotion-sad .brow.left {
  transform: rotate(-14deg) translate(2px, 2px);
}

.robot.emotion-sad .brow.right {
  transform: rotate(14deg) translate(-2px, 2px);
}

.robot.emotion-sad .linked-eyes {
  transform: translateY(3px) scaleY(0.92);
}

.robot.emotion-sad .screen-mouth {
  border-radius: 52px 52px 0 0;
  transform: scaleY(0.65) scaleX(0.85);
  height: 16px;
}

.robot.emotion-angry {
  --face-glow: rgba(248, 113, 113, 0.22);
  --pupil-color: #f87171;
  --mouth-color: #dc2626;
  --eye-w: 42px;
  --eye-h: 44px;
}

.robot.emotion-angry .brow.left {
  transform: rotate(28deg) translate(4px, 4px);
}

.robot.emotion-angry .brow.right {
  transform: rotate(-28deg) translate(-4px, 4px);
}

.robot.emotion-angry .screen-mouth {
  width: 64px;
  height: 8px;
  border-radius: 4px;
  transform: scaleY(1.1);
}

.robot.emotion-nervous {
  --face-glow: rgba(167, 139, 250, 0.15);
  --pupil-color: #c4b5fd;
  --mouth-color: #a78bfa;
}

.robot.emotion-nervous .brow.left {
  transform: rotate(-18deg) translate(-2px, 3px);
}

.robot.emotion-nervous .brow.right {
  transform: rotate(6deg) translate(2px, 0);
}

.robot.emotion-nervous:not(.speaking) .screen-mouth {
  animation: mouth-wobble 0.5s ease-in-out infinite alternate;
}

.robot.emotion-surprised {
  --face-glow: rgba(52, 211, 153, 0.2);
  --pupil-color: #34d399;
  --mouth-color: #fcd34d;
  --eye-w: 64px;
  --eye-h: 82px;
}

.robot.emotion-surprised .brow.left,
.robot.emotion-surprised .brow.right {
  transform: translateY(-6px) rotate(0deg);
}

.robot.emotion-surprised .screen-mouth {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transform: scale(1);
}

.robot.emotion-surprised.robot.speaking .screen-mouth {
  width: 34px;
  height: 34px;
}

.robot.emotion-sleepy {
  --face-glow: rgba(148, 163, 184, 0.12);
  --pupil-color: #94a3b8;
  --mouth-color: #64748b;
}

.robot.emotion-sleepy .brow.left,
.robot.emotion-sleepy .brow.right {
  transform: rotate(0deg) translateY(4px);
  opacity: 0.75;
}

.robot.emotion-sleepy .crt-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  top: 0;
  height: 44%;
  background: linear-gradient(180deg, rgba(3, 8, 6, 0.9) 0%, rgba(3, 8, 6, 0.38) 58%, transparent 100%);
  pointer-events: none;
  z-index: 6;
}

.robot.emotion-sleepy .screen-eye {
  animation: blink-slow 6s ease-in-out infinite;
}

.robot.emotion-sleepy .screen-mouth {
  width: 56px;
  height: 10px;
  border-radius: 10px;
  transform: scaleY(0.7);
}

/* ——— Ek duygular ——— */

.robot.emotion-curious {
  --face-glow: rgba(56, 189, 248, 0.18);
  --pupil-color: #38bdf8;
  --mouth-color: #7dd3fc;
}

.robot.emotion-curious .brow.left {
  transform: rotate(-8deg) translateY(-1px);
}

.robot.emotion-curious .brow.right {
  transform: rotate(8deg) translateY(-1px);
}

.robot.emotion-curious .screen-mouth {
  width: 70px;
  height: 18px;
  border-radius: 0 0 48px 48px;
  transform: scaleY(0.95);
}

.robot.emotion-bored {
  --face-glow: rgba(100, 116, 139, 0.12);
  --pupil-color: #94a3b8;
  --mouth-color: #64748b;
}

.robot.emotion-bored .brow.left {
  transform: rotate(-4deg) translate(2px, 3px);
}

.robot.emotion-bored .brow.right {
  transform: rotate(4deg) translate(-2px, 3px);
}

.robot.emotion-bored .linked-eyes-wrap {
  animation-duration: 12s;
}

.robot.emotion-bored .screen-mouth {
  width: 88px;
  height: 9px;
  border-radius: 6px;
  transform: scaleY(0.65);
}

.robot.emotion-affectionate {
  --face-glow: rgba(244, 114, 182, 0.2);
  --pupil-color: #f9a8d4;
  --mouth-color: #fb7185;
}

.robot.emotion-affectionate .brow.left {
  transform: rotate(-12deg) translateY(0);
}

.robot.emotion-affectionate .brow.right {
  transform: rotate(12deg) translateY(0);
}

.robot.emotion-affectionate .crt-screen {
  box-shadow:
    inset 0 0 100px rgba(0, 0, 0, 0.92),
    inset 48px 0 72px -26px rgba(251, 113, 133, 0.16),
    inset -48px 0 72px -26px rgba(251, 113, 133, 0.16);
}

.robot.emotion-affectionate .screen-mouth {
  border-radius: 0 0 58px 58px;
  transform: scaleY(1) scaleX(1.08);
  height: 21px;
}

.robot.emotion-worried {
  --face-glow: rgba(251, 191, 36, 0.12);
  --pupil-color: #fcd34d;
  --mouth-color: #fbbf24;
}

.robot.emotion-worried .brow.left {
  transform: rotate(-16deg) translate(1px, 2px);
}

.robot.emotion-worried .brow.right {
  transform: rotate(10deg) translate(-1px, 3px);
}

.robot.emotion-worried:not(.speaking) .screen-mouth {
  animation: mouth-wobble 0.55s ease-in-out infinite alternate;
}

.robot.emotion-excited {
  --face-glow: rgba(52, 211, 153, 0.22);
  --pupil-color: #6ee7b7;
  --mouth-color: #34d399;
  --eye-w: 58px;
  --eye-h: 74px;
}

.robot.emotion-excited .brow.left,
.robot.emotion-excited .brow.right {
  transform: translateY(-4px) rotate(-4deg);
}

.robot.emotion-excited .screen-mouth {
  width: 92px;
  height: 24px;
  border-radius: 0 0 56px 56px;
  transform: scaleY(1.05);
}

.robot.emotion-thoughtful {
  --face-glow: rgba(129, 140, 248, 0.14);
  --pupil-color: #a5b4fc;
  --mouth-color: #818cf8;
}

.robot.emotion-thoughtful .brow.left {
  transform: rotate(-6deg) translate(2px, 1px);
}

.robot.emotion-thoughtful .brow.right {
  transform: rotate(6deg) translate(-2px, 1px);
}

.robot.emotion-thoughtful .screen-mouth {
  width: 68px;
  height: 14px;
  border-radius: 10px;
  transform: scaleY(0.78) scaleX(0.95);
}

.robot.emotion-playful {
  --face-glow: rgba(192, 132, 252, 0.18);
  --pupil-color: #e879f9;
  --mouth-color: #d946ef;
}

.robot.emotion-playful .brow.left {
  transform: rotate(-18deg) translateY(-2px);
}

.robot.emotion-playful .brow.right {
  transform: rotate(18deg) translateY(-2px);
}

.robot.emotion-playful .screen-mouth {
  width: 84px;
  height: 22px;
  border-radius: 0 0 60px 60px;
  transform: scaleY(1.02) skewX(-3deg);
}

.robot.emotion-embarrassed {
  --face-glow: rgba(251, 113, 133, 0.14);
  --pupil-color: #fda4af;
  --mouth-color: #fb7185;
}

.robot.emotion-embarrassed .crt-screen {
  box-shadow:
    inset 0 0 100px rgba(0, 0, 0, 0.92),
    inset 46px 0 68px -24px rgba(251, 113, 133, 0.14),
    inset -46px 0 68px -24px rgba(251, 113, 133, 0.14);
}

.robot.emotion-embarrassed .brow.left {
  transform: rotate(6deg) translate(0, 2px);
}

.robot.emotion-embarrassed .brow.right {
  transform: rotate(-6deg) translate(0, 2px);
}

.robot.emotion-embarrassed .screen-mouth {
  width: 52px;
  height: 16px;
  border-radius: 0 0 40px 40px;
  transform: scaleY(0.72);
}

.robot.emotion-skeptical {
  --face-glow: rgba(148, 163, 184, 0.16);
  --pupil-color: #cbd5e1;
  --mouth-color: #94a3b8;
}

.robot.emotion-skeptical .brow.left {
  transform: rotate(10deg) translate(3px, 1px);
}

.robot.emotion-skeptical .brow.right {
  transform: rotate(-4deg) translate(-2px, 2px);
}

.robot.emotion-skeptical .screen-mouth {
  width: 72px;
  height: 11px;
  border-radius: 8px;
  transform: scaleY(0.75) scaleX(1.05);
}

@keyframes blink-slow {
  0%,
  88%,
  100% {
    transform: scaleY(1);
  }
  92%,
  96% {
    transform: scaleY(0.12);
  }
}

@keyframes talk {
  from {
    transform: scaleY(0.58) scaleX(1);
  }
  to {
    transform: scaleY(1.08) scaleX(1.06);
  }
}

@keyframes mouth-wobble {
  from {
    transform: translateX(-2px) scaleY(0.85);
  }
  to {
    transform: translateX(2px) scaleY(0.92);
  }
}

.controls-panel {
  background: var(--panel);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.voice-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn-voice-start,
.btn-voice-stop {
  border-radius: 12px;
  padding: 0.55rem 1rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-voice-start {
  border: 1px solid rgba(57, 255, 20, 0.45);
  background: rgba(57, 255, 20, 0.12);
  color: #b6ffb3;
}

.btn-voice-start:hover:not(:disabled) {
  background: rgba(57, 255, 20, 0.22);
}

.btn-voice-stop {
  border: 1px solid rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
}

.btn-voice-stop:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.24);
}

.btn-voice-start:disabled,
.btn-voice-stop:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  min-height: 1.2em;
}

#voiceHint {
  opacity: 0.9;
}
