.robot-game {
  --robot-mint: #7df4db;
  --robot-lilac: #d8bbff;
  --robot-metal-light: #e7d6ff;
  --robot-metal: #a288f1;
  --robot-metal-dark: #6653ac;
  display: grid;
  gap: 1rem;
  color: #f7f3ff;
}

.robot-game [hidden] { display: none; }

.robot-game[data-robot="2"], .robot-game[data-robot="5"] {
  --robot-metal-light: #bdfff1;
  --robot-metal: #55d9c8;
  --robot-metal-dark: #297c8c;
}

.robot-game[data-robot="3"], .robot-game[data-robot="6"] {
  --robot-metal-light: #f8d5fe;
  --robot-metal: #cf8eea;
  --robot-metal-dark: #8d59b4;
}

.robot-game[data-robot="4"] {
  --robot-metal-light: #d2e7ff;
  --robot-metal: #85a8fa;
  --robot-metal-dark: #466ca9;
}

.robot-scene {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
  min-width: 0;
  border: 1px solid #a892f067;
  border-radius: 1.4rem;
  background:
    radial-gradient(ellipse at 18% 48%, #4c93ad39, transparent 57%),
    linear-gradient(130deg, #183651, #19203e 55%, #261f4d);
  box-shadow: 0 .8rem 2rem #070d294d;
}

.robot-bay {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 13.2em;
  font-size: clamp(14px, 2.2vw, 22px);
  background-image: radial-gradient(circle, #adccf135 1px, transparent 1px);
  background-size: .6em .6em;
}

.robot-bay::before,
.robot-bay::after {
  content: '';
  position: absolute;
  bottom: 7%;
  left: 50%;
  width: 12em;
  height: 2.5em;
  transform: translateX(-50%);
  border: .15em solid #6deddb81;
  border-radius: 50%;
  background: #193d62;
  box-shadow: 0 0 1.2em #53e0dc34, inset 0 0 1em #49c9e03c;
}

.robot-bay::after {
  bottom: 10%;
  width: 8.9em;
  height: 1.55em;
  border-style: dashed;
  background: none;
  box-shadow: none;
}

.robot-body,
.robot-head {
  position: absolute;
  left: 50%;
  z-index: 1;
  transform: translateX(-50%);
  border: .14em solid #0b1633;
  background: linear-gradient(150deg, var(--robot-metal-light), var(--robot-metal));
  box-shadow: 0 .3em 0 var(--robot-metal-dark), 0 .49em 0 #0b1633;
}

.robot-body {
  bottom: 17%;
  display: grid;
  width: 7.9em;
  height: 3.6em;
  place-items: center;
  border-radius: 2.1em 2.1em 1.25em 1.25em;
}

.robot-charge {
  position: relative;
  display: block;
  width: 3.2em;
  height: 1.02em;
  margin-top: .57em;
  border: .14em solid #14243d;
  border-radius: .28em;
  background: repeating-linear-gradient(90deg, #58efd1 0 .49em, #194557 .49em .68em);
  box-shadow: .25em 0 0 -.04em #172d4a;
}

.robot-head {
  bottom: 40%;
  display: grid;
  width: 8.75em;
  height: 5.25em;
  padding: .51em;
  border-radius: 1.38em;
}

.robot-head::before,
.robot-head::after {
  content: '';
  position: absolute;
  top: 33%;
  left: -1.05em;
  width: .87em;
  height: 2.02em;
  border: .13em solid #0c1632;
  border-radius: .42em .14em .14em .42em;
  background: repeating-linear-gradient(0deg, var(--robot-metal-dark) 0 .26em, var(--robot-metal) .26em .52em);
}

.robot-head::after {
  right: -1.05em;
  left: auto;
  border-radius: .14em .42em .42em .14em;
}

.robot-antenna {
  position: absolute;
  top: -1.69em;
  left: 59%;
  width: .2em;
  height: 1.55em;
  transform: rotate(12deg);
  border-radius: 1em;
  background: var(--robot-metal);
}

.robot-antenna::after {
  content: '';
  position: absolute;
  top: -.34em;
  left: -.25em;
  width: .7em;
  height: .7em;
  border-radius: 50%;
  background: var(--robot-mint);
  box-shadow: 0 0 .65em #84ffeea6;
}

.robot-visor {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25em;
  padding-bottom: .65em;
  border-radius: .85em;
  background: linear-gradient(145deg, #263563, #0c1429 76%);
  box-shadow: inset 0 0 0 .13em #192647, inset 0 0 0 .22em #c5d1ff44;
}

.robot-eye {
  width: .93em;
  height: 1.02em;
  border-radius: 50%;
  background: var(--robot-mint);
  box-shadow: 0 0 .9em #58e8d293;
}

.robot-mouth {
  position: absolute;
  bottom: .68em;
  left: 50%;
  width: 1.3em;
  height: .2em;
  transform: translateX(-50%);
  border-radius: 2em;
  background: var(--robot-mint);
}

.robot-listening .robot-antenna::after { animation: robot-flash .6s ease-in-out infinite alternate; }
.robot-listening .robot-mouth { animation: robot-sound .22s ease-in-out infinite alternate; }
.robot-listening .robot-bay::before { border-color: #72fff1; }
.robot-solved .robot-mouth { height: .46em; border-radius: .1em .1em 1em 1em; }

@keyframes robot-flash {
  to { box-shadow: 0 0 .1em .34em #8dfbe333, 0 0 1em #82ffdf; }
}

@keyframes robot-sound {
  to { height: .56em; }
}

.robot-console {
  display: grid;
  justify-items: start;
  min-width: 0;
  padding: clamp(.8rem, 3.2vw, 2.6rem) clamp(.7rem, 3.2vw, 2.6rem) clamp(.8rem, 3.2vw, 2.6rem) clamp(.6rem, 2vw, 1.8rem);
}

.robot-stage {
  margin: 0 0 .36rem;
  color: var(--robot-mint);
  font-size: clamp(.74rem, 2vw, .92rem);
  font-weight: 800;
  letter-spacing: .055em;
}

.robot-progress {
  margin: 0;
  color: #fff7ff;
  font-size: clamp(1.4rem, 4.2vw, 2.6rem);
  font-weight: 800;
  line-height: 1.03;
}

.robot-progress-lights {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .22rem;
  width: min(100%, 10rem);
  margin: .75rem 0 1rem;
}

.robot-light {
  height: .4rem;
  border-radius: .4rem;
  background: #596687;
}

.robot-light-current { background: var(--robot-lilac); }
.robot-light-done { background: var(--robot-mint); }

.robot-game button { min-height: 44px; }
.robot-game button:focus-visible { outline: 3px solid var(--robot-mint); outline-offset: 4px; }

.robot-game .robot-listen,
.robot-game .robot-next,
.robot-game .robot-restart {
  padding: .62rem .9rem;
  border: 1px solid #6bffe2;
  border-radius: .68rem;
  color: #071d31;
  background: #74f0da;
  font-weight: 800;
}

.robot-game .robot-listen[aria-disabled="true"] {
  cursor: progress;
  color: #effeff;
  background: #2b5f72;
}

.robot-controls {
  display: grid;
  justify-items: center;
  gap: .62rem;
  padding: .1rem 0 .3rem;
  text-align: center;
}

.robot-answer {
  display: block;
  width: min(100%, 24rem);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.robot-question {
  max-width: 100%;
  margin: 0 auto .56rem;
  padding: 0;
  color: #f7f3ff;
  font-weight: 800;
}

.robot-answer-buttons {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(.4rem, 2vw, .7rem);
}

.robot-game .robot-choice {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  padding: .55rem .4rem;
  border: 1px solid #9b91db;
  border-radius: .7rem;
  color: #fff5ff;
  background: #29294b;
}

.robot-game .robot-choice:not(:disabled):hover { border-color: var(--robot-lilac); background: #42376b; }
.robot-game .robot-choice:disabled { cursor: default; opacity: .68; }

.robot-arrow {
  color: var(--robot-lilac);
  font-size: 1.3em;
  line-height: 1;
}

.robot-feedback {
  min-height: 1.4em;
  margin: .12rem 0;
  padding-inline: .32rem;
  color: #dbe3f6;
}

.robot-retry .robot-feedback { color: #ffdfb9; }
.robot-solved .robot-feedback { color: var(--robot-mint); }

@media (max-width: 440px) {
  .robot-scene { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); }
  .robot-bay { font-size: clamp(10px, 3.3vw, 14px); }
  .robot-console { padding-left: .24rem; }
  .robot-game .robot-listen { padding-inline: .55rem; }
}

@media (prefers-reduced-motion: reduce) {
  .robot-listening .robot-antenna::after, .robot-listening .robot-mouth { animation: none; }
}
