/* =========================================================
   Ρομποτική — RobLab (διαδραστικά σενάρια) & μπλοκ τύπου Mind+
   ========================================================= */

/* ---- αρχική οθόνη ρομπότ: κεφάλαια & σενάρια ---- */
.rl-home { height: 100%; box-sizing: border-box; overflow-y: auto; padding: 10px 18px 20px; }
.rl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.rl-title { display: flex; align-items: center; gap: 12px; }
.rl-title .e { font-size: 54px; line-height: 1; }
.rl-title h2 { margin: 0; font-size: 34px; color: #37474f; }
.rl-title p { margin: 0; font-weight: 700; color: #607d8b; }
.rl-total { font-size: 20px; font-weight: 900; color: #f57f17; background: rgba(255,255,255,.85); border-radius: 18px; padding: 8px 16px; }
.rl-chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.rl-chapter { background: rgba(255,255,255,.88); border: 4px solid var(--c); border-radius: 22px; padding: 10px 12px; box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.rl-ch-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.rl-ch-head .e { font-size: 34px; line-height: 1; }
.rl-ch-head h3 { margin: 0; font-size: 19px; color: var(--c); }
.rl-ch-head small { color: #78909c; font-weight: 700; }
.rl-ch-n { margin-left: auto; font-weight: 900; color: #fff; background: var(--c); border-radius: 12px; padding: 3px 10px; }
.rl-scen { display: flex; flex-direction: column; gap: 6px; }
.rl-sc { display: flex; align-items: center; gap: 8px; text-align: left; font-family: inherit; font-size: 16px; font-weight: 800; color: #37474f; background: #fff; border: 3px solid #e3e8f0; border-radius: 14px; padding: 6px 10px; cursor: pointer; transition: transform .1s, border-color .15s; }
.rl-sc:hover { transform: translateX(4px); border-color: var(--c); }
.rl-sc.done { background: #f1f8e9; border-color: #aed581; }
.rl-sc .num { width: 26px; height: 26px; border-radius: 50%; background: var(--c); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; flex: none; }
.rl-sc .e { font-size: 20px; }
.rl-sc .t { flex: 1; }
.rl-sc .st { color: #ffb300; font-size: 15px; letter-spacing: 1px; }

/* ---- οθόνη σεναρίου: ενιαία σελίδα που ξετυλίγεται σε τμήματα ---- */
.rl-play { height: 100%; box-sizing: border-box; display: flex; flex-direction: column; overflow-y: auto; padding: 8px 16px 40px; scroll-behavior: smooth; }
.rl-bar { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; padding: 6px 10px; background: rgba(255,255,255,.85); backdrop-filter: blur(4px); border-radius: 16px; box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.rl-crumb { font-weight: 800; color: #546e7a; font-size: 17px; }
.rl-crumb b { color: var(--c); }
.rl-dots { margin-left: auto; display: flex; gap: 4px; }
.rl-dots span { width: 34px; height: 34px; border-radius: 50%; background: #eceff1; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; opacity: .55; cursor: pointer; }
.rl-dots span.ok { background: #c8e6c9; opacity: 1; }
.rl-dots span.cur { background: var(--c); opacity: 1; box-shadow: 0 0 0 4px rgba(0,0,0,.08); transform: scale(1.12); }
.rl-flow { display: flex; flex-direction: column; gap: 14px; max-width: 1400px; }
/* πλοήγηση βημάτων: ◀ ▶ + «όλα τα βήματα» (κολλάει στο κάτω μέρος) */
.rl-nav { position: sticky; bottom: 0; z-index: 3; margin-top: auto; padding: 14px 0 6px; background: linear-gradient(rgba(255,255,255,0), rgba(255,255,255,.92) 45%); border-radius: 16px 16px 0 0; display: flex; align-items: center; gap: 10px; max-width: 1400px; }
.rl-nav .tool-btn:disabled { opacity: .35; cursor: default; }
.rl-nav-pos { flex: 1; text-align: center; font-weight: 900; color: #546e7a; background: rgba(255,255,255,.85); border-radius: 14px; padding: 6px 12px; }
.rl-nav-all { margin-left: auto; }
.rl-play.one .rl-nav { position: static; background: none; padding-top: 6px; }   /* ένα βήμα: η μπάρα ακολουθεί το τμήμα, δεν το κρύβει */
.rl-play:not(.one) #rl-prev, .rl-play:not(.one) #rl-next, .rl-play:not(.one) .rl-nav-pos { display: none; }
.rl-play.one #rl-next:not(:disabled) { /* εμφάνιση «επόμενο βήμα» από το .tool-btn.go (theme.css) */ }
.rl-sec { background: rgba(255,255,255,.92); border-radius: 22px; box-shadow: 0 6px 18px rgba(0,0,0,.08); border-left: 8px solid var(--c); animation: rl-in .4s ease-out; scroll-margin-top: 70px; }
@keyframes rl-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.rl-sec-head { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 2px dashed #eceff1; flex-wrap: wrap; }
.rl-sec-head .num { width: 32px; height: 32px; border-radius: 50%; background: var(--c); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 900; font-size: 17px; flex: none; }
.rl-sec-head .ico { font-size: 24px; }
.rl-sec-head h3 { margin: 0; font-size: 23px; color: var(--c); flex: 1; }
.rl-sec-head .chk { opacity: 0; color: #43a047; font-size: 24px; font-weight: 900; transition: opacity .2s; }
.rl-sec.done .rl-sec-head .chk { opacity: 1; }
.rl-sec.done { border-left-color: #66bb6a; }
.rl-sec-body { padding: 14px 18px 16px; }
.rl-hint { font-weight: 800; color: #e65100; }
.rl-note { background: #fff8e1; border-left: 5px solid #ffca28; border-radius: 10px; padding: 8px 12px; font-weight: 700; color: #5d4037; margin-top: 10px; }
.rl-intro { display: flex; gap: 18px; align-items: flex-start; }
.rl-intro .big { font-size: 64px; line-height: 1; flex: none; }
.rl-intro p { font-size: 20px; font-weight: 700; color: var(--ink); margin: 4px 0 6px; }
.rl-intro ul { font-size: 17px; font-weight: 700; color: #455a64; margin: 4px 0 8px; padding-left: 22px; }
/* σύνδεσμοι: αρχικό project του Mind+ + λήψη Mind+ */
.rl-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.rl-link { display: flex; align-items: center; gap: 10px; flex: 1 1 320px; max-width: 560px; text-decoration: none; color: #0d47a1; background: #e3f2fd; border: 3px solid #90caf9; border-radius: 16px; padding: 8px 14px; transition: transform .1s, box-shadow .15s; }
.rl-link:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(13,71,161,.18); }
.rl-link .ico { font-size: 30px; flex: none; }
.rl-link b { display: block; font-size: 17px; }
.rl-link small { display: block; font-size: 13px; font-weight: 700; color: #37474f; line-height: 1.3; }
.rl-link.alt { flex: 0 1 260px; color: #1b5e20; background: #e8f5e9; border-color: #a5d6a7; }

/* εξαρτήματα (με φωτογραφίες) — όσα δεν πατήθηκαν «χοροπηδούν» με το χεράκι 👆 */
.rl-parts { display: flex; flex-wrap: wrap; gap: 10px; }
.rl-part { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 170px; font-family: inherit; font-size: 15px; font-weight: 800; color: #37474f; background: #fff; border: 3px solid #e3e8f0; border-radius: 16px; padding: 10px 10px 8px; cursor: pointer; transition: transform .1s; position: relative; text-align: center; }
.rl-part img { width: 140px; height: 90px; object-fit: contain; border-radius: 8px; background: #fff; }
.rl-part .e { font-size: 44px; line-height: 90px; }
.rl-part .t { line-height: 1.15; }
.rl-part .chk { position: absolute; top: 6px; right: 8px; opacity: 0; color: #fff; background: #43a047; border-radius: 50%; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; transition: opacity .15s; }
.rl-part.on { border-color: #66bb6a; background: #f1f8e9; }
.rl-part.on .chk { opacity: 1; }
.rl-part:hover { transform: scale(1.03); }
.rl-part .tap { position: absolute; top: 58px; right: 14px; font-size: 30px; pointer-events: none; opacity: 0; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.rl-part:not(.on) { animation: rl-nudge 1.8s ease-in-out infinite; animation-delay: var(--d, 0s); border-color: #ffd54f; }
.rl-part:not(.on) .tap { opacity: 1; animation: rl-tap 1.8s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes rl-nudge { 0%, 60%, 100% { transform: none; box-shadow: none; } 70% { transform: scale(1.05) rotate(-1.5deg); box-shadow: 0 0 0 6px rgba(255,213,79,.45); } 85% { transform: scale(1.04) rotate(1.5deg); } }
@keyframes rl-tap { 0%, 60%, 100% { transform: translate(0, 0); } 75% { transform: translate(-6px, -12px) scale(.85); } }

/* καλωδίωση */
.rl-wire { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.rl-wire-parts { display: flex; flex-direction: column; gap: 8px; flex: 1 1 260px; min-width: 240px; }
.rl-wpart { display: flex; align-items: center; gap: 10px; background: #fff; border: 3px solid #e3e8f0; border-radius: 14px; padding: 6px 12px; font-weight: 700; color: #37474f; position: relative; }
.rl-wpart img { width: 84px; height: 54px; object-fit: contain; flex: none; }
.rl-wpart .e { font-size: 28px; }
.rl-wpart small { display: block; color: #78909c; }
.rl-wpart.cur { border-color: #ffb300; box-shadow: 0 0 0 4px rgba(255,179,0,.25); }
.rl-wpart.ok { border-color: #66bb6a; background: #f1f8e9; }
.rl-wport { margin-left: auto; font-weight: 900; color: #2e7d32; font-size: 18px; }
.rl-wire-board { flex: 1 1 380px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rl-wire-hint { font-size: 13px; font-weight: 700; color: #90a4ae; }
.rl-board { width: min(460px, 100%); flex: none; }
.rl-board .brand { font: 900 22px sans-serif; fill: #fff; text-anchor: middle; }
.rl-board .brand2 { font: 800 13px sans-serif; fill: #bbdefb; text-anchor: middle; }
.rl-board .brand3 { font: 700 13px sans-serif; fill: #fff; text-anchor: middle; }
.rl-board .usb { font: 700 8px sans-serif; fill: #37474f; text-anchor: middle; }
.rl-port { cursor: pointer; }
.rl-port rect { fill: #fff; stroke: #90a4ae; stroke-width: 2; transition: fill .15s; }
.rl-port text { font: 900 14px sans-serif; fill: #1e3a8a; text-anchor: middle; pointer-events: none; }
.rl-port:hover rect { fill: #fff59d; }
.rl-port.on rect { fill: #29b6f6; stroke: #0277bd; }
.rl-port.on text { fill: #fff; }
.rl-port.dim { cursor: default; opacity: .55; }
.rl-port.dim:hover rect { fill: #fff; }
.rl-port.shake { animation: shake .4s; }
.rl-ref { margin: 0; flex: 1 1 320px; max-width: 480px; text-align: center; }
.rl-ref.wide { max-width: 560px; }
.rl-confirm { flex: 1 1 260px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; justify-content: center; font-size: 17px; font-weight: 700; color: #37474f; }
.rl-confirm p { margin: 0; }
/* αφίσα στην εισαγωγή */
.rl-poster { margin: 0; flex: 0 1 380px; max-width: 380px; text-align: center; }
.rl-poster img { width: 100%; max-height: 460px; object-fit: contain; border-radius: 14px; border: 3px solid #e3e8f0; background: #fff; }
.rl-poster figcaption { font-size: 13px; font-weight: 700; color: #78909c; margin-top: 4px; }
.rl-intro { flex-wrap: wrap; }
.rl-intro > div:not(.big) { flex: 1 1 380px; min-width: 0; }
.rl-ref img { width: 100%; border-radius: 14px; border: 3px solid #e3e8f0; background: #000; }
.rl-ref figcaption { font-size: 13px; font-weight: 700; color: #78909c; margin-top: 4px; }

/* Mind+: πραγματικές οθόνες με καυτά σημεία */
.rl-mp { display: flex; justify-content: center; }
.rl-shot { position: relative; width: 100%; max-width: 980px; border: 3px solid #e3e8f0; border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 6px 16px rgba(0,0,0,.1); }
.rl-shot.narrow { max-width: 360px; }
.rl-shot img { display: block; width: 100%; height: auto; image-rendering: auto; }
.rl-hot { position: absolute; background: transparent; border: 0; border-radius: 8px; cursor: pointer; padding: 0; }
.rl-hot:hover { background: rgba(255,213,79,.18); }
.rl-hot.show { outline: 4px solid #ff5252; outline-offset: 2px; animation: rl-blink .8s infinite alternate; background: rgba(255,82,82,.12); }
@keyframes rl-blink { to { outline-color: #ffd54f; } }
.rl-hot.hit, .rl-hot-item.hit { background: rgba(102,187,106,.35); outline: 4px solid #43a047; }
.rl-drop { position: absolute; background: #fff; border: 1px solid #ccc; border-radius: 6px; box-shadow: 0 8px 20px rgba(0,0,0,.25); display: flex; flex-direction: column; min-width: 190px; z-index: 2; }
.rl-hot-item { font-family: inherit; font-size: 15px; font-weight: 700; text-align: left; background: #fff; border: 0; padding: 10px 16px; cursor: pointer; color: #333; }
.rl-hot-item:hover { background: #fff3e0; }
.rl-hot-item.show { outline: 3px solid #ff5252; outline-offset: -3px; }
/* παράθυρο «Νέα μεταβλητή» (όπως στο Mind+) */
.rl-vardlg { width: 420px; max-width: 100%; background: #fff; border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.25); border: 1px solid #ddd; overflow: hidden; }
.rl-vardlg .ttl { background: #f6a21c; color: #fff; font-weight: 900; padding: 8px 14px; text-align: center; font-size: 17px; }
.rl-vardlg label { display: block; padding: 14px 16px 4px; font-weight: 700; color: #444; font-size: 15px; }
.rl-vardlg input { display: block; width: 100%; margin-top: 6px; font-family: inherit; font-size: 18px; padding: 8px 10px; border: 2px solid #ccc; border-radius: 8px; user-select: text; -webkit-user-select: text; box-sizing: border-box; }
.rl-vardlg input.shake { animation: shake .4s; border-color: #e53935; }
.rl-vardlg .opts { display: flex; gap: 18px; padding: 6px 16px; font-size: 13px; color: #555; }
.rl-vardlg .btns { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px 14px; }
.rl-vardlg .btns .big-btn { font-size: 17px; padding: 8px 22px; }
.rl-vardlg.hit { outline: 4px solid #43a047; }

/* ---- μπλοκ τύπου Scratch / Mind+ ---- */
.sb, .sb-c { --bg: #4c97ff; --bd: #3373cc; }
.sb-motion { --bg: #4c97ff; --bd: #3373cc; }
.sb-looks { --bg: #9966ff; --bd: #774dcb; }
.sb-sound { --bg: #cf63cf; --bd: #a63fa6; }
.sb-event { --bg: #ffbf00; --bd: #cc9900; }
.sb-control { --bg: #ffab19; --bd: #cf8b17; }
.sb-sensing { --bg: #5cb1d6; --bd: #2e8eb8; }
.sb-operators { --bg: #59c059; --bd: #389438; }
.sb-variables { --bg: #ff8c1a; --bd: #db6e00; }
.sb-pen { --bg: #0fbd8c; --bd: #0b8e69; }
.sb-arduino { --bg: #2e8b57; --bd: #1f6b41; }
.sb-servo { --bg: #8e44ad; --bd: #6c3483; }
.sb-dht { --bg: #16a085; --bd: #117864; }
.sb-r2 { --bg: #1b5e20; --bd: #0d3d12; }
.sb-s1u { --bg: #283593; --bd: #1a237e; }
.sb { display: flex; width: max-content; align-items: center; flex-wrap: wrap; gap: 5px; background: var(--bg); border: 2px solid var(--bd); color: #fff; font-weight: 700; font-size: 14px; padding: 5px 10px; border-radius: 6px; min-height: 34px; box-sizing: border-box; white-space: nowrap; margin: 2px 0; max-width: 100%; }
.sb-hat { border-radius: 20px 20px 6px 6px; padding-top: 8px; }
.sb-ico { font-style: normal; font-size: 10px; font-weight: 900; background: rgba(255,255,255,.9); color: var(--bd); border-radius: 4px; padding: 1px 4px; }
.sb-menu { background: rgba(0,0,0,.2); border-radius: 12px; padding: 2px 8px; font-size: 13px; }
.sb-num { background: #fff; color: #333; border-radius: 12px; padding: 2px 8px; font-size: 13px; min-width: 22px; text-align: center; }
.sb-txt { border-radius: 4px; }
.sb-rep { display: inline-flex; align-items: center; gap: 4px; background: var(--bg); border: 2px solid var(--bd); border-radius: 16px; padding: 2px 8px; font-size: 13px; color: #fff; }
.sb-bool { display: inline-flex; align-items: center; gap: 4px; background: var(--bg); border: 2px solid var(--bd); padding: 2px 12px; font-size: 13px; color: #fff; clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%); border-radius: 0; }
.sb-c { display: block; margin: 2px 0; width: max-content; max-width: 100%; }   /* πλάτος = το πλατύτερο μέλος, ώστε το κάτω «χείλος» να μην είναι μια λωρίδα 4 px */
.sb-c > .sb-top { border-radius: 6px 6px 0 0; margin-bottom: 0; display: flex; }
.sb-c > .sb-mid { border-radius: 0; margin: 0; display: flex; }
.sb-c > .sb-bottom { border-radius: 0 0 6px 6px; min-height: 14px; padding: 0 10px; margin-top: 0; display: block; }   /* πλάτος = του πάνω μέρους (αόρατο αντίγραφο του κειμένου) */
.sb-ghost { display: flex; gap: 5px; white-space: nowrap; visibility: hidden; height: 0; overflow: hidden; }
.sb-mouth { border-left: 14px solid var(--bg); padding-left: 6px; min-height: 20px; box-shadow: inset 2px 0 0 var(--bd); }
.sb-slot { background: #fff; border: 3px dashed #ff9800; color: #ff9800; font-size: 20px; font-weight: 900; justify-content: center; min-width: 120px; animation: pulse-btn 1s infinite alternate; }

/* παζλ μπλοκ */
.rl-build-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.rl-script-box { flex: 1 1 380px; min-width: 0; background: #fafafa; background-image: radial-gradient(#ddd 1px, transparent 1px); background-size: 16px 16px; border: 3px solid #e3e8f0; border-radius: 14px; padding: 10px 12px; overflow-x: auto; }
.rl-sprite-tag { font-weight: 800; color: #607d8b; margin-bottom: 6px; }
.rl-script-one { margin-bottom: 14px; }
.rl-script-one.done { opacity: .85; }
.rl-choices-box { flex: 1 1 320px; min-width: 0; }
.rl-q { font-size: 19px; font-weight: 900; color: #37474f; margin-bottom: 8px; }
.rl-choices { display: flex; flex-direction: column; gap: 8px; }
.rl-choice { text-align: left; background: #fff; border: 3px solid #e3e8f0; border-radius: 14px; padding: 6px 10px; cursor: pointer; font-family: inherit; transition: transform .1s, border-color .15s; overflow-x: auto; }
.rl-choice:hover { transform: scale(1.02); border-color: #ffd54f; }
.rl-choice.shake { animation: shake .4s; border-color: #e53935; }

/* χτίσε το πρόγραμμα (Blockly) */
.rl-goal { background: #e8f5e9; border-left: 5px solid #43a047; border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; color: #1b5e20; }
.rl-goal b { font-size: 17px; }
.rl-goal p { margin: 6px 0 0; font-size: 17px; font-weight: 700; color: #2e4a2f; line-height: 1.4; }
.rl-goal ul { margin: 6px 0 0; padding-left: 22px; font-weight: 700; color: #33691e; font-size: 15px; }
/* 💡 «Κάνε το επόμενο βήμα»: διακριτό, με παλμό, αμέσως μετά τον στόχο */
.rl-help-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 10px; padding: 8px 12px; background: linear-gradient(90deg, #fff8e1, #ffecb3); border: 3px dashed #ffb300; border-radius: 16px; }
.rl-help-btn { font-family: inherit; font-size: 20px; font-weight: 900; color: #4e342e; background: #ffd54f; border: 0; border-radius: 30px; padding: 10px 24px; cursor: pointer; box-shadow: 0 6px 0 #f9a825; animation: rl-glow 1.4s ease-in-out infinite; position: relative; }
.rl-help-btn:hover { filter: brightness(1.06); }
.rl-help-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #f9a825; animation: none; }
.rl-help-cap { font-weight: 800; color: #6d4c41; font-size: 15px; }
@keyframes rl-glow { 0%, 100% { transform: scale(1); box-shadow: 0 6px 0 #f9a825, 0 0 0 0 rgba(255,193,7,.7); } 50% { transform: scale(1.05); box-shadow: 0 6px 0 #f9a825, 0 0 0 14px rgba(255,193,7,0); } }
.rl-bl-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.rl-bl-progress { margin-left: auto; font-weight: 900; color: #78909c; }
.rl-bl-wrap { position: relative; height: 520px; border: 3px solid #e3e8f0; border-radius: 14px; overflow: hidden; background: #fff; }
.rl-bl-host { position: absolute; inset: 0; }
.rl-bl-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.rl-bl-tools .big-btn { font-size: 20px; padding: 10px 22px; }
.rl-bl-msg { font-weight: 800; color: #37474f; flex: 1 1 200px; }
/* το highlight του Blockly για λάθος μπλοκ */
.blocklyHighlighted > .blocklyPath { stroke: #ff1744 !important; stroke-width: 4px !important; }

/* κουίζ */
.rl-q-text { font-size: 21px; font-weight: 800; color: var(--ink); margin: 0 0 10px; }
.rl-answers { display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.rl-ans { font-family: inherit; font-size: 18px; font-weight: 800; text-align: left; color: #37474f; background: #fff; border: 3px solid #e3e8f0; border-radius: 14px; padding: 10px 14px; cursor: pointer; transition: transform .1s; }
.rl-ans:hover:not(:disabled) { transform: scale(1.02); border-color: #ffd54f; }
.rl-ans.ok { border-color: #66bb6a; background: #e8f5e9; }
.rl-ans.bad { border-color: #e53935; background: #ffebee; }

/* προσομοίωση */
.rl-sim-row { display: grid; grid-template-columns: 230px 1fr 170px; gap: 14px; align-items: start; }
.rl-finish { display: flex; justify-content: flex-end; margin-top: 12px; }
.rl-finish .big-btn:disabled { opacity: .45; filter: grayscale(.4); animation: none; transform: none; cursor: default; }
.rl-finish .big-btn.pulse:not(:disabled) { animation: pulse-btn .8s infinite alternate; }
.rl-sim-in, .rl-sim-out { display: flex; flex-direction: column; gap: 10px; }
.rl-in { background: #fff; border: 3px solid #e3e8f0; border-radius: 14px; padding: 8px 10px; font-weight: 700; color: #37474f; display: flex; flex-direction: column; gap: 6px; }
.rl-in input[type=range] { width: 100%; }
.rl-val { font-weight: 900; color: #1565c0; }
.rl-keys { display: flex; flex-wrap: wrap; gap: 6px; }
.rl-key, .rl-push { font-family: inherit; font-weight: 900; font-size: 15px; background: #fff; border: 3px solid #90a4ae; border-bottom-width: 6px; border-radius: 10px; padding: 6px 10px; cursor: pointer; color: #37474f; user-select: none; touch-action: none; }
.rl-key.on, .rl-push.on { background: #ffd54f; border-color: #f9a825; border-bottom-width: 3px; transform: translateY(3px); }
.rl-push { background: #ffcdd2; border-color: #e57373; }
.rl-askrow { display: flex; gap: 6px; }
.rl-askrow input { flex: 1; min-width: 0; width: 100%; font-family: inherit; font-size: 16px; padding: 6px 10px; border-radius: 10px; border: 3px solid #e3e8f0; user-select: text; -webkit-user-select: text; }
.rl-sim-stage { position: relative; min-height: 270px; background: linear-gradient(#e3f2fd, #fff); border: 3px solid #e3e8f0; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.rl-backdrop { position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: center; padding-top: 10px; font-size: 22px; font-weight: 900; color: #455a64; pointer-events: none; }
.rl-sprite { position: relative; z-index: 1; font-weight: 800; color: #37474f; }
.rl-sprite small { display: block; font-size: 15px; }
.rl-lamp { font-size: 64px; line-height: 1.1; transition: filter .2s, text-shadow .2s; }
.rl-lamp.off { filter: grayscale(1) opacity(.5); }
.rl-lamp.on { filter: none; text-shadow: 0 0 22px #ffd54f, 0 0 40px #ffb300; }
.rl-lamp.red { filter: none; text-shadow: 0 0 26px #f44336; }
.rl-lamp.blue { filter: none; text-shadow: 0 0 26px #2196f3; }
.rl-say { position: absolute; top: 44px; left: 50%; transform: translateX(-50%); z-index: 2; background: #fff; border: 3px solid #90a4ae; border-radius: 16px; padding: 6px 14px; font-weight: 800; color: #37474f; max-width: 90%; }
.rl-canvas { display: block; max-width: 100%; }
.rl-canvas-wrap { position: relative; width: 360px; max-width: 100%; }
.rl-canvas-wrap .rl-sprite { position: absolute; inset: 0; pointer-events: none; }
.rl-score:empty { display: none; }
.rl-score { position: absolute; right: 8px; top: 8px; z-index: 2; font-weight: 900; color: #fff; background: rgba(0,0,0,.45); border-radius: 10px; padding: 3px 10px; }
.rl-arrow { position: absolute; font-size: 28px; color: #e53935; pointer-events: none; z-index: 2; }
.rl-corner { position: absolute; left: 8px; bottom: 6px; font-weight: 800; color: #546e7a; z-index: 2; }
.rl-answers-arc { display: flex; gap: 40px; margin-top: 4px; font-size: 18px; color: #7b1fa2; }
.rl-out { background: #fff; border: 3px solid #e3e8f0; border-radius: 14px; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 800; color: #546e7a; }
.rl-led { --led: #ff1744; width: 34px; height: 34px; border-radius: 50%; background: var(--led); opacity: .3; border: 3px solid rgba(0,0,0,.35); transition: opacity .1s, box-shadow .1s; }
.rl-led.on { opacity: 1; box-shadow: 0 0 18px 6px var(--led); }
.rl-buzz { font-size: 34px; opacity: .45; transition: transform .1s, opacity .1s; }
.rl-buzz.on { opacity: 1; transform: scale(1.25); }
.rl-servo { width: 120px; height: 84px; }
.rl-servo g { transition: transform .35s; }
.rl-fan { font-size: 40px; display: inline-block; opacity: .5; }
.rl-fan.on { opacity: 1; animation: rl-spin .5s linear infinite; }
@keyframes rl-spin { to { transform: rotate(360deg); } }
.rl-laser { font-size: 34px; position: relative; opacity: .5; }
.rl-laser i { display: none; position: absolute; left: 100%; top: 50%; width: 60px; height: 3px; background: #ff1744; box-shadow: 0 0 8px #ff1744; }
.rl-laser.on { opacity: 1; }
.rl-laser.on i { display: block; }
/* R2 */
.rl-rgb { display: flex; gap: 6px; padding: 6px 8px; background: #263238; border-radius: 10px; }
.rl-rgb span { --c: #000; --k: .5; width: 22px; height: 22px; border-radius: 50%; background: var(--c); opacity: .25; border: 2px solid rgba(255,255,255,.25); transition: background .15s, opacity .15s, box-shadow .15s; }
.rl-rgb span.on { box-shadow: 0 0 calc(18px * var(--k)) calc(5px * var(--k)) var(--c); }
.rl-out-serial { align-items: stretch; }
.rl-serial { margin: 0; width: 150px; height: 120px; overflow: hidden; background: #111; color: #9cff9c; font: 700 12px/1.35 Consolas, monospace; border-radius: 8px; padding: 6px 8px; text-align: left; white-space: pre; }
.rl-motors { display: flex; gap: 8px; font-size: 30px; }
.rl-motors span { display: inline-block; opacity: .4; }
.rl-motors span.fw { opacity: 1; animation: rl-spin .6s linear infinite; }
.rl-motors span.bw { opacity: 1; animation: rl-spin .6s linear infinite reverse; }
.rl-remote { display: grid; grid-template-columns: repeat(3, 44px); gap: 4px; justify-content: center; background: #37474f; padding: 8px; border-radius: 12px; }
.rl-rkey { width: 44px; height: 40px; padding: 0; font-size: 16px; }
.rl-run { background: #c8e6c9; border-color: #66bb6a; }

/* οθόνη-θέση των υπόλοιπων ρομπότ */
@media (max-width: 1100px) { .rl-sim-row { grid-template-columns: 1fr; } .rl-sim-in, .rl-sim-out { flex-direction: row; flex-wrap: wrap; } }

/* ---- Βήμα «💻 Το πρόγραμμα» (step_code): έτοιμος κώδικας με εξήγηση ανά εντολή ---- */
.rl-code { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.rl-script-one.code { background: #fafafa; border: 2px solid #e0e0e0; border-radius: 14px; padding: 10px 12px; flex: 1 1 320px; min-width: 0; }
.rl-code-scripts { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-start; }
.rl-code-one { min-width: 0; }
.rl-code-num { font-size: 13px; font-weight: 800; color: #8d6e63; background: #efebe9; border-radius: 8px; padding: 2px 8px; display: inline-block; margin-bottom: 4px; }
.sb-note { font-size: 13px; font-weight: 600; color: #546e7a; line-height: 1.35; margin: 1px 0 7px 14px; padding-left: 8px; border-left: 3px solid #cfd8dc; max-width: 340px; }
.sb-mouth .sb-note { margin-left: 8px; }
.rl-code-go { margin-top: 12px; text-align: center; }
.rl-code-go.hidden { display: none; }
