.robot-room { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.robot-intro .section-title { font-size: clamp(36px, 4.5vw, 64px); line-height: 1.25; }
.robot-intro .section-desc { max-width: 440px; line-height: 1.9; }
.robot-instruction { display: block; font-size: 10px; color: var(--cyan); margin-top: 28px; }
.robot-station { width: 100%; max-width: 510px; justify-self: center; border: 0; border-radius: 0; padding: 18px; background: none; box-shadow: none; }
.robot-station:focus-visible { outline: 2px solid #75cfff; outline-offset: 5px; border-radius: 12px; }
.robot-art { display: block; width: 100%; }
.robot-station:hover .robot-face { filter: drop-shadow(0 0 4px #75cfff); }
.robot-eye { animation: robot-blink 6s infinite; transform-origin: center 150px; }
.robot-led { animation: robot-led-pulse 3s ease-in-out infinite; }
.robot-head { transform-origin: 210px 245px; animation: robot-head-idle 4.8s ease-in-out infinite; }
.robot-left-arm { transform-origin: 98px 146px; animation: robot-arm-left 4.8s ease-in-out infinite; }
.robot-right-arm { transform-origin: 321px 146px; animation: robot-arm-right 4.8s ease-in-out infinite; }
.robot-face { animation: robot-look 6s ease-in-out infinite; }
@keyframes robot-head-idle { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-3px) rotate(1.5deg); } }
@keyframes robot-arm-left { 0%,100% { transform: rotate(2deg); } 50% { transform: rotate(-5deg); } }
@keyframes robot-arm-right { 0%,100% { transform: rotate(-2deg); } 50% { transform: rotate(6deg); } }
@keyframes robot-look { 0%,20%,100% { transform: translateX(0); } 40%,60% { transform: translateX(4px); } 80% { transform: translateX(-3px); } }
@keyframes robot-blink { 0%,44%,49%,100% { opacity: 1; } 46%,47% { opacity: .05; } }
@keyframes robot-led-pulse { 50% { opacity: .4; } }
.robot-dialog { width: 680px; max-width: calc(100% - 32px); max-height: calc(100dvh - 120px - var(--toy-safe-top) - var(--toy-safe-bottom)); margin: auto; padding: 0; overflow: auto; border: 7px solid #373f49; border-radius: 20px; background: #080f1c; color: #c1dcff; box-shadow: 0 0 0 2px #929ba8, 8px 10px 0 #111720, 0 20px 70px #000b; overscroll-behavior: contain; }
.robot-dialog:focus-visible { outline: 2px solid #75cfff; outline-offset: 3px; }
.robot-dialog::backdrop { background: #020811d4; backdrop-filter: blur(8px); }
.robot-terminal { padding: 22px 28px; background: repeating-linear-gradient(transparent 0 3px, #00000018 3px 4px), radial-gradient(ellipse at 50% 0%, #172f52, #080f1c 70%); }
.robot-terminal header { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #6e9fcf; font-size: 9px; }
.robot-terminal header button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; line-height: 1; color: #b6c8df; border: 1px solid #354967; border-radius: 6px; flex-shrink: 0; }
.robot-terminal header button svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.terminal-face { display: grid; place-items: center; height: 106px; color: #75cfff; }
.terminal-face > svg { display: block; width: 180px; height: 100px; overflow: visible; filter: drop-shadow(0 0 7px #75cfff55); }
.terminal-face-eyes { fill: currentColor; transform-origin: 90px 32px; animation: terminal-blink 3.2s ease-in-out infinite; }
.terminal-face-mouth { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: square; transform-origin: 90px 72px; animation: terminal-speak 2.4s ease-in-out infinite; }
.terminal-face-gaze { transform-origin: 90px 50px; animation: terminal-gaze 4.8s ease-in-out infinite; }
@keyframes terminal-blink { 0%,32%,42%,73%,83%,100% { transform: scaleY(1); } 36%,38%,77%,79% { transform: scaleY(.12); } }
@keyframes terminal-speak { 0%,100% { transform: scaleX(1); } 20% { transform: scaleX(.55) translateY(-1px); } 45% { transform: scaleX(1.18); } 70% { transform: scaleX(.8) translateY(1px); } }
@keyframes terminal-gaze { 0%,100% { transform: translate(0,0); } 25% { transform: translate(6px,-2px); } 55% { transform: translate(-5px,1px); } 80% { transform: translate(2px,0); } }
.terminal-kicker { color: #76ade0; font-size: 10px; margin: 20px 0 14px; }
.robot-terminal h2 { font-size: 25px; font-weight: 700; line-height: 1.7; margin-bottom: 14px; }
.terminal-dialogue { color: #8ca8c9; font-size: 13px; line-height: 1.8; margin-bottom: 24px; }
.robot-terminal label { display: block; color: #87b1df; font-size: 12px; margin-bottom: 9px; }
.terminal-input-row { display: flex; gap: 10px; }
.terminal-input-row input { flex: 1; min-width: 0; border: 1px solid #47618a; border-radius: 4px; background: #060d19; padding: 12px; font-size: 16px; color: #d3e6ff; caret-color: #75cfff; }
.terminal-input-row input::placeholder { color: #6885ad; }
.terminal-input-row input:focus { outline: 2px solid #75cfff; outline-offset: 2px; }
.terminal-input-row button { border: 1px solid #87b1df; background: #75cfff; color: #08182e; padding: 12px 16px; border-radius: 4px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.robot-feedback { min-height: 44px; margin-top: 15px; color: #91b7e1; font-size: 13px; line-height: 1.8; }
.terminal-next { display: block; margin: 0 0 18px auto; border: 1px solid #47618a; border-radius: 4px; padding: 10px 16px; color: #a8dbff; background: #142641; font-size: 13px; }
.terminal-next[hidden], .terminal-dialogue[hidden] { display: none; }
.robot-terminal footer { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid #253c5d; padding-top: 14px; color: #7698c3; font-size: 10px; }
.robot-terminal[data-state="error"] .robot-feedback { color: #ff997b; }
.robot-terminal[data-state="error"] .terminal-face { color: #ff997b; }
.robot-terminal[data-state="correct"] .robot-feedback { color: #a8dbff; }
.robot-terminal[data-state="correct"] .terminal-face { color: #75cfff; }
.robot-terminal button:focus-visible { outline: 2px solid #75cfff; outline-offset: 3px; }
[data-theme="light"] .robot-instruction { color: #175d9f; }
@media (max-width: 860px) {
    .robot-room { grid-template-columns: 1fr; gap: 28px; }
    .robot-intro .section-title { font-size: 40px; }
}
@media (max-width: 640px) {
    .robot-intro .section-title { font-size: 32px; }
}
@media (max-width: 640px), (max-height: 520px) and (pointer: coarse) {
    .robot-station { -webkit-tap-highlight-color: transparent; }
    .robot-dialog {
        position: fixed;
        -webkit-tap-highlight-color: transparent;
        inset: calc(var(--quiz-viewport-top, 0px) + var(--toy-safe-top) + 8px)
            var(--toy-safe-right) calc(var(--quiz-viewport-bottom, 0px) + var(--toy-safe-bottom) + 8px)
            var(--toy-safe-left);
        max-width: calc(100% - 28px - var(--toy-safe-left) - var(--toy-safe-right));
        max-height: calc(var(--quiz-viewport-height, 100dvh) - var(--toy-safe-top) - var(--toy-safe-bottom) - 16px);
        border-width: 5px;
    }
    .robot-terminal { position: relative; padding: 14px; }
    .robot-terminal header { font-size: 8px; }
    .robot-terminal header button { width: 44px; height: 44px; }
    .terminal-face { height: 66px; }
    .terminal-face > svg { width: 118px; height: 66px; }
    .terminal-kicker { margin: 10px 0 6px; }
    .robot-terminal h2 { font-size: 19px; line-height: 1.45; margin-bottom: 10px; }
    .terminal-dialogue { margin-bottom: 10px; }
    .robot-terminal label { margin-bottom: 5px; }
    .terminal-input-row { gap: 8px; }
    .terminal-input-row input, .terminal-input-row button { min-height: 44px; padding: 8px 10px; }
    .robot-feedback { min-height: 24px; margin-top: 7px; line-height: 1.55; }
    .robot-terminal footer { padding-top: 7px; }
    .terminal-next { margin-bottom: 8px; }

    .robot-dialog[data-compact] .robot-terminal { padding: 8px 10px; }
    .robot-dialog[data-compact] .terminal-face {
        position: absolute;
        inset: 11px 64px auto auto;
        height: 38px;
    }
    .robot-dialog[data-compact] .terminal-face > svg { width: 68px; height: 38px; }
    .robot-dialog[data-compact] .robot-terminal header > span {
        max-width: calc(100% - 116px);
        white-space: nowrap;
        overflow: hidden;
    }
    .robot-dialog[data-compact] .terminal-kicker { margin: 2px 0 5px; }
    .robot-dialog[data-compact] .robot-terminal h2 { font-size: 17px; line-height: 1.42; margin-bottom: 6px; }
    .robot-dialog[data-compact] .terminal-dialogue { margin-bottom: 5px; }
    .robot-dialog[data-compact] .robot-feedback { min-height: 18px; margin-top: 5px; }
}
@media (prefers-reduced-motion: reduce) {
    .robot-eye, .robot-led, .robot-head, .robot-left-arm, .robot-right-arm, .robot-face { animation: none; }
    .terminal-face-eyes, .terminal-face-mouth, .terminal-face-gaze { animation: none; }
}
