/*
 * Engineering Geniuses Robot Heads Playground.
 * All selectors are component-scoped. Flat brand colors; no gradients.
 */
.eg-rh,
.eg-rh * {
  box-sizing: border-box;
}
.eg-rh {
  --eg-rh-red: #D62839;
  --eg-rh-purple: #7652DA;
  --eg-rh-yellow: #E0A800;
  --eg-rh-text: #F0F3FA;
  --eg-rh-muted: #9EA8BE;
  --eg-rh-line: #323B4E;
  --eg-rh-surface: #202837;
  --eg-rh-bg: #121821;
  color: var(--eg-rh-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
}
.eg-rh button,
.eg-rh input,
.eg-rh select {
  font: inherit;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
}
.eg-rh button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  cursor: pointer;
  line-height: 1.3;
  border-radius: 10px;
  text-align: center;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.eg-rh button:focus-visible,
.eg-rh input:focus-visible,
.eg-rh a:focus-visible {
  outline: 3px solid var(--eg-rh-yellow);
  outline-offset: 3px;
}
.eg-rh button:hover,
.eg-rh button:focus,
.eg-rh button:active {
  transform: none;
}
.eg-rh h2,
.eg-rh h3,
.eg-rh p {
  padding: 0;
  margin: 0;
  color: inherit;
  font-family: inherit;
  line-height: 1.3;
}
.eg-rh h2 {
  font-size: clamp(23px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.eg-rh h3 {
  font-size: 16px;
  font-weight: 750;
}
.eg-rh strong { font-weight: 700; }
.eg-rh--lab {
  width: 100%;
  max-width: 1440px;
  margin: 16px auto;
  background: var(--eg-rh-bg);
  border: 1px solid var(--eg-rh-line);
  border-radius: 18px;
  overflow: visible;
  color: var(--eg-rh-text);
  isolation: isolate;
}
.eg-rh__app { width: 100%; }
.eg-rh__header {
  padding: 25px clamp(17px, 3vw, 34px) 20px;
  border-bottom: 1px solid var(--eg-rh-line);
}
.eg-rh__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.eg-rh__brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 9px;
  background: var(--eg-rh-red);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}
.eg-rh__brand-label {
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.18em;
  color: #D0D7E5;
}
.eg-rh__headline-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
}
.eg-rh__headline-row p {
  margin-top: 8px;
  font-size: 14px;
  color: var(--eg-rh-muted);
  line-height: 1.5;
}
.eg-rh__version {
  flex: none;
  align-self: end;
  padding: 7px 10px;
  border: 1px solid var(--eg-rh-line);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--eg-rh-muted);
}
.eg-rh__main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.52fr) minmax(285px, 0.9fr);
  align-items: start;
  gap: 24px;
  padding: 27px clamp(17px, 3vw, 34px) 35px;
}
.eg-rh__left,
.eg-rh__right { min-width: 0; }
.eg-rh__left { display: grid; gap: 26px; }
.eg-rh__right {
  display: grid;
  gap: 0;
  background: var(--eg-rh-surface);
  border: 1px solid var(--eg-rh-line);
  border-radius: 15px;
  padding: 0 21px;
}
.eg-rh__stage {
  min-height: 405px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 20px 21px;
  background: #19202D;
  border: 1px solid #384156;
  border-radius: 17px;
  overflow: visible;
  position: relative;
}
.eg-rh__stage-top,
.eg-rh__stage-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 1;
}
.eg-rh__live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #2A3347;
  color: #DDE3EF;
  border-radius: 30px;
  padding: 7px 11px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
}
.eg-rh__live-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 100%;
  background: var(--eg-rh-red);
}
.eg-rh__shape-label {
  color: #ABB5C9;
  font-size: 11px;
}
.eg-rh__robot-area {
  flex: 1 0 290px;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  padding: 25px 0;
}
.eg-rh__stage-bottom { align-items: end; }
.eg-rh__status {
  flex: none;
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  background: var(--eg-rh-red);
  border-radius: 5px;
  color: #FFF;
  font-weight: 800;
  letter-spacing: .1em;
  font-size: 10px;
}
.eg-rh__stage-caption {
  color: #A9B3C5;
  font-size: 11px;
  text-align: right;
}
.eg-rh__section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.eg-rh__section-header > span {
  font-size: 11px;
  color: var(--eg-rh-muted);
}
.eg-rh__states-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.eg-rh .eg-rh__choice {
  background: #252D3E;
  color: #CDD6E7;
  border: 1px solid #3C465C;
  min-height: 43px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: normal;
}
.eg-rh .eg-rh__choice:hover {
  background: #354058;
  border-color: #6E7991;
  color: #fff;
}
.eg-rh .eg-rh__choice.is-selected,
.eg-rh .eg-rh__choice.is-selected:hover {
  background: var(--eg-rh-red);
  border-color: var(--eg-rh-red);
  color: #fff;
}
.eg-rh__tour-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}
.eg-rh__tour-row p {
  flex: 1;
  font-size: 11px;
  color: var(--eg-rh-muted);
  line-height: 1.5;
}
.eg-rh .eg-rh__button {
  min-height: 40px;
  padding: 10px 15px;
  font-weight: 750;
  font-size: 12px;
  border: 1px solid transparent;
  white-space: normal;
}
.eg-rh .eg-rh__button--primary {
  color: #fff;
  background: var(--eg-rh-red);
  border-color: var(--eg-rh-red);
}
.eg-rh .eg-rh__button--primary:hover {
  background: #B91E30;
  border-color: #B91E30;
  color: #fff;
}
.eg-rh .eg-rh__button--secondary {
  color: #D9E0EC;
  background: #2A3447;
  border-color: #45516A;
}
.eg-rh .eg-rh__button--secondary:hover {
  color: #FFF;
  background: #3A465F;
}
.eg-rh__gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}
.eg-rh .eg-rh__gallery-item {
  min-width: 0;
  min-height: 156px;
  padding: 22px 6px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: #1D2634;
  border: 1px solid #344056;
  border-radius: 12px;
  overflow: visible;
  color: #DCE3EF;
}
.eg-rh .eg-rh__gallery-item.is-selected { border-color: var(--eg-rh-red); }
.eg-rh .eg-rh__gallery-item:hover { background: #273146; }
.eg-rh__gallery-item strong { font-size: 11px; }
.eg-rh__controls-block {
  padding: 20px 0 19px;
  border-bottom: 1px solid var(--eg-rh-line);
}
.eg-rh__controls-block:last-of-type { border-bottom: 0; }
.eg-rh__shape-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.eg-rh__slider-control {
  display: block;
  margin-top: 17px;
  color: #CBD3E1;
}
.eg-rh__slider-control:first-of-type { margin-top: 0; }
.eg-rh__control-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
  font-size: 12px;
}
.eg-rh__value {
  padding: 4px 7px;
  background: #313A4D;
  border-radius: 5px;
  color: #F1F4F9;
  font-size: 11px;
}
.eg-rh__slider-control input[type="range"] {
  display: block;
  width: 100%;
  height: 20px;
  padding: 0;
  margin: 0;
  background: none;
  box-shadow: none;
  accent-color: var(--eg-rh-red);
  cursor: pointer;
}
.eg-rh__presets {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 19px;
}
.eg-rh .eg-rh__swatch {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border: 3px solid #323B4E;
  border-radius: 100%;
  padding: 0;
}
.eg-rh .eg-rh__swatch.is-selected {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.eg-rh__color-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.eg-rh__color-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  color: #D8DFED;
}
.eg-rh__color-field input[type="color"] {
  width: 100%;
  height: 36px;
  padding: 3px;
  background: #263247;
  border: 1px solid #4F5A6E;
  border-radius: 7px;
  box-shadow: none;
  cursor: pointer;
}
.eg-rh__color-field span { min-width: 0; }
.eg-rh__color-field strong,
.eg-rh__color-field small { display: block; }
.eg-rh__color-field strong { font-size: 11px; }
.eg-rh__color-field small {
  overflow-wrap: anywhere;
  font-size: 10px;
  color: var(--eg-rh-muted);
  margin-top: 3px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.eg-rh__toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  cursor: pointer;
  color: #DCE3EF;
}
.eg-rh__toggle-text { flex: 1; min-width: 0; }
.eg-rh__toggle-text strong {
  display: block;
  font-size: 12px;
  line-height: 1.35;
}
.eg-rh__micro {
  display: block;
  color: var(--eg-rh-muted);
  font-size: 10px;
  margin-top: 3px;
}
.eg-rh__toggle-row input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.eg-rh__switch {
  position: relative;
  flex: 0 0 38px;
  display: inline-block;
  width: 38px;
  height: 21px;
  border-radius: 14px;
  background: #586277;
  transition: background-color .18s;
}
.eg-rh__switch::before {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  top: 3px;
  left: 3px;
  background: #FFF;
  border-radius: 100%;
  transition: transform .18s;
}
.eg-rh__toggle-row input:checked + .eg-rh__switch { background: var(--eg-rh-red); }
.eg-rh__toggle-row input:checked + .eg-rh__switch::before { transform: translateX(17px); }
.eg-rh__toggle-row input:focus-visible + .eg-rh__switch {
  outline: 3px solid var(--eg-rh-yellow);
  outline-offset: 3px;
}
.eg-rh__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  padding: 20px 0 23px;
}
.eg-rh__actions p {
  grid-column: 1 / -1;
  color: var(--eg-rh-muted);
  font-size: 10px;
  line-height: 1.5;
  margin-top: 4px;
}
.eg-rh__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px clamp(17px, 3vw, 34px);
  color: var(--eg-rh-muted);
  font-size: 10px;
  border-top: 1px solid var(--eg-rh-line);
}
.eg-rh .eg-rh__footer a {
  color: #CDD5E6;
  font-size: inherit;
  text-decoration: none;
}
.eg-rh .eg-rh__footer a:hover { text-decoration: underline; }
.eg-rh__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 36px;
  background: #19202D;
  color: #D3D9E5;
  border: 1px solid #354156;
  border-radius: 12px;
  min-height: 160px;
}
.eg-rh__error {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--eg-rh-red);
  border-radius: 12px;
  background: #2A1E28;
  color: #fff;
  overflow-wrap: anywhere;
}
.eg-rh__error p { color: #E8D6D8; line-height: 1.6; }
.eg-rh__error code { display: block; color: #FFBAC2; background: #17202B; padding: 10px; border-radius: 5px; }
.eg-rh--single {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  overflow: visible;
  vertical-align: middle;
  line-height: 1;
}
.eg-rh__single-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  max-width: 100%;
}
.eg-rh--single .eg-rh__loading { padding: 10px; font-size: 11px; min-height: 100px; }

@media (max-width: 1020px) {
  .eg-rh__main-grid { grid-template-columns: minmax(0, 1fr); }
  .eg-rh__right { display: grid; grid-template-columns: 1fr 1fr; column-gap: 21px; }
  .eg-rh__right .eg-rh__controls-block { border-bottom: 1px solid var(--eg-rh-line); }
  .eg-rh__right .eg-rh__actions { grid-column: 1 / -1; }
  .eg-rh__stage { min-height: 380px; }
}
@media (max-width: 620px) {
  .eg-rh--lab { border-radius: 10px; margin: 9px auto; }
  .eg-rh__header { padding: 19px 15px 16px; }
  .eg-rh__brand { margin-bottom: 13px; }
  .eg-rh__version { margin-top: 4px; }
  .eg-rh__main-grid { padding: 15px 12px 21px; gap: 22px; }
  .eg-rh__left { gap: 21px; }
  .eg-rh__stage { min-height: 385px; padding: 13px 12px 17px; }
  .eg-rh__robot-area { min-height: 278px; flex-basis: 278px; }
  .eg-rh__shape-label { font-size: 10px; }
  .eg-rh__stage-caption { max-width: 60%; }
  .eg-rh__states-grid { gap: 7px; }
  .eg-rh .eg-rh__choice { min-height: 40px; padding: 7px 5px; font-size: 11px; }
  .eg-rh__tour-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .eg-rh__gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .eg-rh__right { display: block; padding: 0 15px; }
  .eg-rh__color-grid { gap: 9px; }
  .eg-rh__footer { padding: 13px 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .eg-rh button,
  .eg-rh .eg-rh__switch,
  .eg-rh .eg-rh__switch::before { transition: none; }
}
