:root {
  --bg1: #fafafa;
  --bg2: #f7f7f8;
  --panel: #ffffff;
  --ink: #09090b;
  --muted-ink: #27272a;
  --muted: #71717a;
  --border: #e4e4e7;
  --ring: #d4d4d8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 10% -10%, #ffffff 10%, transparent 58%),
    radial-gradient(800px 600px at 100% 0%, #f4f4f5 5%, transparent 62%),
    linear-gradient(145deg, var(--bg1), var(--bg2));
  display: grid;
  place-items: center;
  padding: 16px;
}

.app {
  width: min(960px, 100%);
  display: grid;
  gap: 18px;
  grid-template-columns: 1.4fr 1fr;
}

body:not(.debug-ui) .app {
  width: min(640px, 100%);
  grid-template-columns: 1fr;
}

.stage-wrap,
.controls {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 6px 20px rgba(9, 9, 11, 0.05);
}

.stage-wrap {
  background: transparent;
  border: 0;
  box-shadow: none;
  display: grid;
  place-items: center;
  min-height: 470px;
  padding: 0;
}

#face {
  width: min(100%, 560px);
  overflow: visible;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.08));
}

.robot-head {
  fill: #fff;
  stroke: #000;
  stroke-width: 4;
}

.eye-white {
  fill: #000;
  stroke: none;
}

.pupil {
  fill: #fff;
}

.sparkle {
  fill: #fff;
  opacity: 0;
}

.eye-glyph {
  fill: none;
  stroke: #fff;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: none;
}

#eyebrows path {
  stroke: #000;
  stroke-width: 8;
}

.lid {
  fill: none;
  stroke: #000;
  stroke-width: 4;
}

.sparkle,
.lid {
  display: none;
}

#mouth-fill {
  fill: #000;
  opacity: 1;
}

#mouth-line {
  fill: none;
  stroke: #000;
  stroke-width: 5;
  stroke-linecap: round;
}

#mouth-teeth {
  fill: #fff;
  stroke: #000;
  stroke-width: 1.5;
  display: none;
}

#mouth-tongue {
  fill: #ff7ea6;
  stroke: #000;
  stroke-width: 1.5;
  display: none;
}

#tear-drop {
  fill: #fff;
  stroke: #000;
  stroke-width: 2;
  display: none;
}

#blush-left,
#blush-right {
  fill: none;
  stroke: #ff7a93;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 3 6;
  opacity: 0;
}

#stress-mark,
#sweat-drop {
  fill: none;
  stroke: #000;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: none;
}

#stress-mark {
  stroke-width: 2.6;
}

#sweat-drop {
  fill: #fff;
  stroke-width: 2;
}

.controls {
  padding: 14px 14px 10px;
}

body:not(.debug-ui) .controls {
  display: none;
}

h1,
h2 {
  margin: 8px 0 10px;
}

h1 {
  font-size: 1.25rem;
}

h2 {
  font-size: 1rem;
  margin-top: 14px;
}

.row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.row-split {
  grid-template-columns: repeat(3, 1fr);
}

label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted-ink);
}

select,
button {
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  padding: 8px 10px;
  outline: none;
}

button {
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(9, 9, 11, 0.08);
  background: #f9f9f9;
}

button:active {
  transform: translateY(0);
}

select:focus,
button:focus-visible {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(212, 212, 216, 0.45);
}

#status {
  margin: 10px 2px 0;
  min-height: 1.4rem;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }

  .stage-wrap {
    min-height: 380px;
  }
}
