.robot-main { padding: 8px 0 72px; }
.robot-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 28px; align-items: start; }
.robot-view { position: relative; border-radius: 14px; overflow: hidden; background: var(--bg-alt); border: 1px solid var(--border); aspect-ratio: 4 / 3; }
.robot-view img, .robot-view canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.robot-off { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px; text-align: center; color: var(--text-dim); }
.robot-off[hidden] { display: none; }
.robot-side h2 { margin: 0 0 4px; font-size: 22px; }
.robot-side .dim { margin: 0 0 14px; color: var(--text-dim); font-size: 15px; }
.robot-colors { display: flex; flex-wrap: wrap; gap: 10px; min-height: 48px; }
.robot-colors button { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px 10px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); font: 600 16px Inter, system-ui, sans-serif; cursor: pointer; text-transform: capitalize; }
.robot-colors button i { width: 22px; height: 22px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.robot-colors button:hover:not(:disabled) { border-color: var(--accent); }
.robot-colors button:disabled { opacity: .45; cursor: default; }
.robot-colors .none { color: var(--text-dim); font-size: 15px; align-self: center; }
.robot-code { display: flex; gap: 8px; align-items: center; margin-top: 14px; font-size: 14px; color: var(--text-dim); }
.robot-code[hidden] { display: none; }
.robot-code input { flex: 1; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.robot-status { min-height: 24px; margin: 16px 0 0; font-weight: 600; }
.robot-steps { list-style: none; counter-reset: s; margin: 22px 0 0; padding: 0; display: grid; gap: 10px; }
.robot-steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; column-gap: 10px; font-size: 14.5px; color: var(--text-dim); }
.robot-steps li::before { content: counter(s); grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font: 600 13px "JetBrains Mono", monospace; }
.robot-steps b { color: var(--text); }
@media (max-width: 820px) { .robot-grid { grid-template-columns: 1fr; } }
.robot-turn { margin: 0 0 20px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-alt); }
.robot-turn p { margin: 0 0 10px; font-size: 15px; color: var(--text-dim); }
.robot-turn p b { color: var(--text); }
.robot-turn .btn { border: 0; cursor: pointer; font: 600 15px Inter, system-ui, sans-serif; }
.robot-turn .btn[hidden] { display: none; }
.robot-turn .btn:disabled { opacity: .5; cursor: default; }
.robot-turn.on { border-color: var(--accent); }
.robot-turn.warn { border-color: #d97706; background: color-mix(in srgb, #d97706 10%, var(--bg-alt)); }
.robot-turn.over { border-color: #b42318; }
.robot-clock { font: 600 26px "JetBrains Mono", monospace; color: var(--text); margin: 0 0 4px; }
.robot-finders { display: grid; gap: 8px; margin: 0 0 22px; }
.robot-finders label { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer; background: var(--bg); }
.robot-finders label:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.robot-finders input { margin: 3px 0 0; accent-color: var(--accent); }
.robot-finders b { display: block; font-size: 15px; }
.robot-finders small { display: block; color: var(--text-dim); font-size: 13px; }
.robot-finders .chip { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font: 600 11px "JetBrains Mono", monospace;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); vertical-align: 1px; }
.robot-timing { margin: 6px 0 0; font-size: 14px; color: var(--text-dim); min-height: 20px; }
.robot-timing b { color: var(--text); }
.robot-setup { padding: 0 0 72px; }
.robot-setup h2 { margin: 0 0 4px; font-size: 22px; }
.robot-setup .dim { margin: 0 0 18px; color: var(--text-dim); font-size: 15px; }
.setup-grid { display: grid; grid-template-columns: minmax(0, .62fr) minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.setup-grid figure { margin: 0; }
.setup-grid img, .setup-grid video { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--border); background: var(--bg-alt); }
.setup-grid figcaption { margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--text-dim); }
.setup-grid figcaption b { color: var(--text); }
@media (max-width: 820px) {
  .setup-grid { grid-template-columns: 1fr; }
  .setup-clip video { width: auto; max-width: 100%; max-height: 70vh; margin: 0 auto; }
}
.robot-live { position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 6px;
  background: rgba(0,0,0,.62); color: #fff; font: 700 12px/1.4 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .08em; }
.robot-live[hidden] { display: none; }
.robot-view.robot-grip { aspect-ratio: 16 / 9; margin-top: 14px; }
.robot-view.robot-grip[hidden] { display: none; }
.robot-live i { width: 8px; height: 8px; border-radius: 50%; background: #ff3b30; animation: robot-pulse 1.4s ease-in-out infinite; }
@keyframes robot-pulse { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .robot-live i { animation: none; } }
.robot-caption { margin: 10px 2px 0; font-size: 14px; line-height: 1.55; color: var(--text-dim); }
.robot-caption b { color: var(--text); }
.robot-caption .key { display: inline-block; width: 18px; height: 11px; margin: 0 3px -1px 0; border-radius: 2px; vertical-align: baseline; }
.robot-caption .key.solid { border: 2px solid #5cbf4a; }
.robot-caption .key.dash { border: 2px dashed currentColor; }

/* Redesign: a page that asks to be played with */
.robot-hero h1 { max-width: 900px; }
.robot-cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 22px 0 18px; }
.robot-cta { display: inline-flex; align-items: center; gap: 12px; padding: 14px 26px; font-size: 18px; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #fff !important; box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--accent) 70%, transparent); }
.robot-cta.off { opacity: .75; }
.robot-cta-note { color: var(--text-dim); font-size: 15px; }
.tri { width: 0; height: 0; border-style: solid; border-width: 8px 0 8px 13px; border-color: transparent transparent transparent currentColor; flex: none; }
.robot-main { scroll-margin-top: 80px; }

/* the view: teaser under the live picture, a big Play button over it */
.robot-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.robot-view video[hidden], .robot-view img[hidden] { display: none; }
.robot-view canvas.live { cursor: crosshair; }
.robot-play { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 20px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.55)); }
.robot-play[hidden] { display: none; }
.robot-play-btn { display: inline-flex; align-items: center; gap: 16px; padding: 18px 30px 18px 26px; border: 0; border-radius: 999px; cursor: pointer; text-align: left;
  background: #fff; color: #0b0f14; font: 600 15px Inter, system-ui, sans-serif; box-shadow: 0 14px 40px -8px rgba(0,0,0,.55);
  transition: transform .15s ease, box-shadow .15s ease; animation: robot-breathe 2.4s ease-in-out infinite; }
.robot-play-btn .tri { border-width: 11px 0 11px 18px; color: var(--accent); }
.robot-play-btn b { display: block; font-size: 22px; line-height: 1.2; }
.robot-play-btn small { display: block; color: #4b5563; font-size: 13.5px; }
.robot-play-btn:hover:not(:disabled) { transform: scale(1.04); }
.robot-play-btn:disabled { cursor: default; animation: none; background: rgba(255,255,255,.88); }
.robot-play-btn:disabled .tri { color: #9ca3af; }
.robot-play-note { margin: 0; max-width: 420px; text-align: center; color: #fff; font-size: 14px; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
@keyframes robot-breathe { 50% { box-shadow: 0 14px 40px -8px rgba(0,0,0,.55), 0 0 0 10px color-mix(in srgb, var(--accent) 35%, transparent); } }
.robot-hint { position: absolute; top: 12px; right: 12px; padding: 4px 10px; border-radius: 6px; background: rgba(0,0,0,.62); color: #fff; font-size: 13px; font-weight: 600; pointer-events: none; }
.robot-hint[hidden] { display: none; }

/* the blocks: chunky foam cubes with a pressable edge */
.robot-ask { font-size: 26px !important; letter-spacing: -.01em; }
.robot-blocks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0 0 20px; min-height: 92px; }
.robot-blocks button { position: relative; aspect-ratio: 1.15; border: 0; padding: 0; border-radius: 16px; cursor: pointer; background: transparent;
  --edge: color-mix(in srgb, var(--c) 62%, #000); }
.robot-blocks .face { position: absolute; inset: 0 0 8px 0; display: grid; place-items: end start; padding: 10px 12px; border-radius: 16px;
  background: radial-gradient(120% 90% at 25% 15%, color-mix(in srgb, var(--c) 70%, #fff) 0%, var(--c) 55%, color-mix(in srgb, var(--c) 85%, #000) 100%);
  box-shadow: 0 8px 0 var(--edge), 0 14px 22px -8px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.18);
  color: var(--ink); font: 700 17px Inter, system-ui, sans-serif; text-transform: capitalize; transition: transform .12s ease, box-shadow .12s ease; }
.robot-blocks button:hover:not(:disabled) .face { transform: translateY(-3px); box-shadow: 0 11px 0 var(--edge), 0 18px 26px -8px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,255,255,.25); }
.robot-blocks button:active:not(:disabled) .face { transform: translateY(6px); box-shadow: 0 2px 0 var(--edge), 0 4px 10px -6px rgba(0,0,0,.4); }
.robot-blocks button:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.robot-blocks button:disabled { cursor: default; }
.robot-blocks button:disabled .face { filter: saturate(.35) brightness(.9); opacity: .6; }
.robot-blocks button[data-n]::after { content: attr(data-n); position: absolute; top: -8px; right: -8px; z-index: 1; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: #14181f; color: #fff; font: 800 16px Inter, system-ui, sans-serif; box-shadow: 0 0 0 3px #fff; }
.robot-blocks button[data-n] .face { outline: 3px solid #fff; outline-offset: -3px; }
.robot-action { display: inline-flex; margin: 0 0 16px; padding: 4px; border: 1px solid var(--border); border-radius: 999px; gap: 4px; }
.robot-action button { padding: 8px 16px; border: 0; border-radius: 999px; background: transparent; color: inherit; font: 600 15px Inter, system-ui, sans-serif; cursor: pointer; }
.robot-action button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.robot-order { margin: -6px 0 20px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; }
.robot-order[hidden] { display: none; }
.robot-order p { margin: 0 0 10px; font-size: 15px; }
.robot-order-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.robot-go, .robot-clear { padding: 10px 18px; border-radius: 999px; font: 700 15px Inter, system-ui, sans-serif; cursor: pointer; }
.robot-go { border: 0; background: var(--accent); color: #fff; }
.robot-go:disabled { opacity: .45; cursor: default; }
.robot-clear { border: 1px solid var(--border); background: transparent; color: inherit; }
.robot-blocks .none { grid-column: 1 / -1; margin: 0; padding: 22px 16px; border: 2px dashed var(--border); border-radius: 16px; color: var(--text-dim); text-align: center; }
@media (prefers-reduced-motion: reduce) { .robot-play-btn { animation: none; } .robot-blocks .face { transition: none; } }

/* the eyes: every choice on show, compact */
.robot-picker { margin: 16px 0 0; }
.robot-picker-title { margin: 0 0 8px; font-size: 16px; }
.robot-picker-title span { font-weight: 400; font-size: 13.5px; color: var(--text-dim); margin-left: 6px; }
.robot-picker .robot-finders { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.robot-picker .robot-finders label { grid-template-columns: 16px 1fr; gap: 8px; padding: 8px 10px; }
.robot-picker .robot-finders b { font-size: 14px; line-height: 1.3; }
.robot-picker .robot-finders .chip { margin: 2px 0 0; display: table; }
.robot-picker .robot-finders small { font-size: 12px; margin-top: 2px; }
/* the load card */
.robot-load { margin: 16px 0 0; padding: 16px 18px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  background: radial-gradient(380px 180px at 100% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%), var(--bg-alt); }
.robot-load[hidden] { display: none; }
.load-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 0 0 12px; }
.load-head h3 { margin: 0; font-size: 18px; }
.load-who { color: var(--text-dim); font-size: 13px; }
.load-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin: 0 0 14px; }
.load-stat { padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); }
.load-stat b { display: block; font: 600 20px "JetBrains Mono", monospace; color: var(--text); white-space: nowrap; }
.load-stat span { display: block; font-size: 12.5px; color: var(--text-dim); line-height: 1.3; }
.load-meter, .load-bar { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 13.5px; }
.load-k { color: var(--text); }
.load-v { color: var(--text-dim); font-family: "JetBrains Mono", monospace; font-size: 12.5px; white-space: nowrap; }
.load-track { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--text-dim) 18%, transparent); overflow: hidden; }
.load-fill { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.load-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 14px 0 0; font-size: 13.5px; line-height: 1.5; }
.load-list dt { color: var(--text); font-weight: 600; }
.load-list dd { margin: 0; color: var(--text-dim); }
.robot-load h4 { margin: 16px 0 8px; font-size: 14px; }
.load-note { margin: 12px 0 0; font-size: 12.5px; color: var(--text-dim); }
@media (max-width: 820px) {
  .robot-blocks { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .robot-blocks .face { font-size: 15px; }
  .robot-play-btn { padding: 14px 22px 14px 20px; }
  .robot-play-btn b { font-size: 19px; }
  .load-list { grid-template-columns: 1fr; }
  .load-list dd { margin-bottom: 6px; }
}
.robot-play-note { padding: 6px 12px; border-radius: 8px; background: rgba(0,0,0,.62); text-shadow: none; }
.robot-play-note:empty { display: none; }
.robot-status:empty, .robot-timing:empty { min-height: 0; margin: 0; }
.robot-turn { margin-bottom: 4px; }
.robot-left .robot-steps { margin-top: 26px; }
@media (max-width: 820px) {
  .robot-left { display: contents; }
  #view-box { order: 1; }
  .robot-side { order: 2; }
  .robot-caption { order: 3; margin-top: -14px; }
  .robot-left .robot-steps { order: 4; margin-top: 0; }
}
@media (max-width: 820px) { .robot-blocks button { aspect-ratio: 1.45; } }

/* the owner's switch for visitor use */
.robot-owner { margin: 8px 0 0; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--border); background: var(--bg); }
.robot-owner[hidden] { display: none; }
.robot-owner.on { border-style: solid; border-color: color-mix(in srgb, #16a34a 45%, var(--border)); }
.robot-switch { display: grid; grid-template-columns: 46px 1fr; align-items: center; gap: 12px; cursor: pointer; }
.robot-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.robot-switch-ui { position: relative; width: 46px; height: 26px; border-radius: 13px; background: color-mix(in srgb, var(--text-dim) 35%, transparent); transition: background .15s ease; }
.robot-switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s ease; }
.robot-switch input:checked + .robot-switch-ui { background: #16a34a; }
.robot-switch input:checked + .robot-switch-ui::after { transform: translateX(20px); }
.robot-switch input:focus-visible + .robot-switch-ui { outline: 3px solid var(--accent); outline-offset: 2px; }
.robot-switch input:disabled + .robot-switch-ui { opacity: .6; }
.robot-switch b { display: block; font-size: 15px; }
.robot-switch small { display: block; color: var(--text-dim); font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .robot-switch-ui, .robot-switch-ui::after { transition: none; } }
