/* ===================== Μενού κατηγοριών ===================== */
.groups { display: grid; grid-template-columns: repeat(3, minmax(230px, 330px)); gap: 18px 22px; justify-content: center; width: 100%; }
@media (max-width: 900px) { .groups { grid-template-columns: repeat(2, minmax(230px, 330px)); } }
.group-card {
  background: #fff; border-radius: 30px; padding: 16px 18px 14px; text-align: center;
  border: 6px solid var(--c); box-shadow: 0 10px 0 var(--c), 0 16px 26px rgba(0,0,0,.14); transition: transform .15s;
}
.group-card:hover { transform: translateY(-8px) scale(1.03); }
.group-card:active { transform: translateY(2px); box-shadow: 0 3px 0 var(--c); }
.group-card .big { font-size: 64px; line-height: 1.1; animation: bob 2.4s ease-in-out infinite; }
.group-card h2 { margin: 6px 0 2px; font-size: 26px; color: var(--c); }
.group-card p { margin: 0 0 10px; font-size: 16px; color: #616161; }
.group-card .gbar { height: 16px; border-radius: 10px; background: #eee; border: 2px solid var(--c); overflow: hidden; }
.group-card .gbar i { display: block; height: 100%; background: var(--c); }
.group-card .gcount { font-weight: 700; margin-top: 6px; color: #616161; }
.menu-head { display: flex; align-items: center; gap: 16px; width: 100%; max-width: 1150px; }
.menu-head h2 { margin: 0; font-size: 30px; }

/* ===================== Παιχνίδια πληκτρολογίου: πλαίσιο ===================== */
.kb-wrap { position: absolute; inset: 0; display: grid; grid-template-rows: minmax(120px, 1fr) auto auto; }
.kb-scene { position: relative; overflow: hidden; }
.kb-prompt { padding: 6px 16px; text-align: center; background: rgba(255,255,255,.8); border-top: 3px solid rgba(255,255,255,.9); }
.kb-hint-text { font-size: 17px; color: #616161; font-weight: 600; min-height: 22px; }
/* Διακόπτης 👆 «Δείξε μου το πλήκτρο» (ίδιο σχήμα με το 👣 Ίχνος του προγραμματισμού) */
.kb-prompt { position: relative; }
.kb-light-btn { position: absolute; right: 10px; top: 6px; display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 10px; border-radius: 19px; border: 3px solid #bdbdbd; background: #fff; font-family: inherit; font-weight: 700; font-size: 14px; color: #616161; cursor: pointer; z-index: 2; }
.kb-light-btn .e { font-size: 20px; }
.kb-light-btn .sw { width: 36px; height: 20px; border-radius: 10px; background: #cfd8dc; position: relative; transition: background .2s; }
.kb-light-btn .sw i { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: left .2s; }
.kb-light-btn.on { border-color: #ffb300; color: #e65100; background: #fff8e1; }
.kb-light-btn.on .sw { background: #ffb300; }
.kb-light-btn.on .sw i { left: 19px; }
@media (max-width: 1000px) { .kb-light-btn .t { display: none; } }
/* Επιλογή τάξης (Κείμενα): μπάρα πάνω αριστερά στη σκηνή */
.kb-grades {
  position: absolute; top: 8px; left: 8px; z-index: 4; display: flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,.85); border-radius: 14px; padding: 4px 6px; box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.kb-grades .lbl { font-size: 13px; font-weight: 700; color: #607d8b; padding: 0 4px; text-transform: uppercase; letter-spacing: .5px; }
.kb-grade {
  min-width: 38px; height: 32px; padding: 0 8px; border-radius: 10px; border: 2px solid #cfd8dc; background: #fff;
  font-weight: 800; font-size: 15px; color: #37474f; cursor: pointer; font-family: inherit;
}
.kb-grade:hover { border-color: #ffb74d; }
.kb-grade.sel { background: #8bc34a; border-color: #558b2f; color: #fff; }
.kb-letter-card {
  display: inline-flex; align-items: center; justify-content: center; min-width: 96px; height: 84px; padding: 0 22px;
  background: #fff; border: 5px solid #ffd54f; border-radius: 22px; box-shadow: 0 6px 0 #e0b000;
  font-size: 60px; font-weight: 700; color: #37474f; margin: 4px 0; line-height: 1;
}
.kb-letter-card.popin { animation: popin .35s cubic-bezier(.2, 1.4, .5, 1); }

/* Κείμενο προς πληκτρολόγηση */
.kb-text { font-size: 30px; font-weight: 600; line-height: 1.5; margin: 4px auto; max-width: 1000px; }
.kb-text.big { font-size: 34px; }
.kb-text.para { font-size: 26px; max-height: 24vh; overflow-y: auto; text-align: left; padding: 0 10px; }
.kb-text .w { display: inline-block; white-space: nowrap; }
.kb-text .ch { display: inline-block; min-width: .4em; text-align: center; border-radius: 6px; color: #90a4ae; padding: 0 1px; }
.kb-text .ch.sp { min-width: .5em; }
.kb-text .ch.done { color: #2e7d32; }
.kb-text .ch.cur { background: #fff176; color: #37474f; box-shadow: 0 0 0 3px #ffd54f; animation: caret .8s infinite alternate; }
.kb-text .ch.cur.sp::after { content: "\2423"; font-size: .7em; color: #f57f17; }
.kb-text .ch.err { animation: err .3s; }
.kb-text .ch.blank { background: #ffe082; color: #e65100; border: 3px dashed #ff9800; min-width: 1.2em; animation: caret .8s infinite alternate; }
.kb-text .ch.filled { background: #c8e6c9; color: #1b5e20; min-width: 1.2em; animation: popin .4s; }
.kb-text.punct .ch.done { color: #37474f; }

/* Οθόνη-πληκτρολόγιο */
.kb-keyboard { --k: min(4.6vw, 52px); padding: 6px 10px 10px; background: #cfd8dc; border-top: 4px solid #b0bec5; user-select: none; }
.kb-row { display: flex; justify-content: center; gap: 4px; margin-bottom: 4px; }
.kb-key {
  width: calc(var(--k) * var(--w, 1) + (var(--w, 1) - 1) * 4px); height: calc(var(--k) * .85);
  background: #fff; border-radius: 8px; box-shadow: 0 3px 0 #90a4ae;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 700; color: #37474f; font-size: calc(var(--k) * .42); line-height: 1; position: relative;
  transition: background .1s, transform .1s;
}
.kb-key .kb-sp { font-size: calc(var(--k) * .24); color: #78909c; font-weight: 600; }
.kb-key .kb-up { font-size: calc(var(--k) * .26); color: #78909c; }
.kb-key .kb-lo { font-size: calc(var(--k) * .34); }
.kb-key.need.alt { background: #fff3c4; animation: none; }
.kb-key.need { background: #ffd54f; box-shadow: 0 3px 0 #ff8f00, 0 0 0 3px #fff3c4; animation: key-pulse .6s infinite alternate; z-index: 1; }
.kb-key.step1::after, .kb-key.step2::after {
  content: "1"; position: absolute; top: -8px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  background: #e53935; color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center;
}
.kb-key.step2::after { content: "2"; background: #43a047; }
.kb-key.ok { background: #a5d6a7; transform: translateY(2px); box-shadow: 0 1px 0 #2e7d32; }
.kb-key.bad { background: #ef9a9a; transform: translateY(2px); box-shadow: 0 1px 0 #c62828; }

/* ===================== Σκηνές ===================== */
.kb-scene .sun { position: absolute; right: 3%; top: 4%; font-size: 56px; animation: spin-slow 25s linear infinite; }
.kb-scene .cloud { position: absolute; font-size: 44px; animation: cloud-move linear infinite; }
.kb-scene .c1 { top: 8%; animation-duration: 50s; }
.kb-scene .c2 { top: 22%; animation-duration: 70s; animation-delay: -30s; font-size: 34px; }

/* Αγώνας αυτοκινήτου */
.sc-race { position: absolute; inset: 0; background: url('../img/race_bg.jpg') center/cover no-repeat; }
.sc-race .trees { position: absolute; left: 0; right: 0; top: 22%; font-size: 40px; display: flex; justify-content: space-around; pointer-events: none; }
.sc-race .trees span { display: inline-block; transform-origin: bottom center; animation: d-sway 3.2s ease-in-out infinite alternate; }
.sc-race .trees span:nth-child(2n) { animation-delay: -1.1s; }
.sc-race .trees span:nth-child(3n) { animation-delay: -2.2s; }
.sc-race .road { position: absolute; left: 0; right: 0; bottom: 5%; height: 38%; background: #546e7a; border-top: 6px solid #cfd8dc; border-bottom: 6px solid #cfd8dc; }
.sc-race .lane { position: absolute; left: 0; right: 0; top: 50%; height: 4px; background: repeating-linear-gradient(90deg, #fff59d 0 40px, transparent 40px 80px); }
.sc-race .car { position: absolute; left: 4%; top: 50%; font-size: 64px; transform: translate(-50%, -50%); transition: left .45s ease-out; filter: drop-shadow(0 6px 4px rgba(0,0,0,.3)); z-index: 2; }
.sc-race .car-body { display: inline-block; transform: scaleX(-1); }
.sc-race .car-rider { position: absolute; left: 50%; top: -34px; transform: translateX(-50%); }
.sc-race .car.vroom { animation: vroom .45s; }
.sc-race .car.shake { animation: shake-car .4s; }
.sc-race .flag { position: absolute; right: 3%; top: 50%; font-size: 60px; transform: translateY(-50%); }

/* Λίμνη με βατραχάκι */
.sc-pond { position: absolute; inset: 0; background: url('../img/pond_bg.jpg') center/cover no-repeat; }
.sc-pond .pad { position: absolute; width: 58px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, #81c784, #388e3c); transform: translate(-50%, -50%); box-shadow: 0 3px 8px rgba(0,0,0,.25); border: 2px solid #2e7d32; }
.sc-pond .pad.ripple-pad { animation: bump .4s; }
.sc-pond .frog { position: absolute; font-size: 54px; transform: translate(-50%, -60%); transition: left .5s ease-in-out, top .5s ease-in-out; filter: drop-shadow(0 4px 4px rgba(0,0,0,.3)); z-index: 2; }
.sc-pond .frog.jump { animation: frog-jump .5s ease-in-out; }
.sc-pond .frog.shake { animation: shake-centered .4s; }
.sc-pond .frog-rider { position: absolute; left: 50%; top: -30px; transform: translateX(-50%); }
.sc-pond .reeds { position: absolute; left: 2%; bottom: 4%; font-size: 60px; }
.sc-pond .reeds.r2 { left: auto; right: 3%; }
.sc-pond .dragonfly { position: absolute; top: 10%; font-size: 30px; animation: cloud-move 30s linear infinite; }

/* Βυθός με γοργόνα */
.sc-sea { position: absolute; inset: 0; background: url('../img/sea_bg.jpg') center/cover no-repeat; }
.sc-sea .fish { position: absolute; font-size: 34px; animation: fish-swim linear infinite; }
.sc-sea .f1 { top: 15%; animation-duration: 22s; }
.sc-sea .f2 { top: 60%; animation-duration: 30s; animation-delay: -12s; }
.sc-sea .f3 { top: 40%; animation-duration: 40s; animation-delay: -20s; font-size: 40px; }
.sc-sea .shell { position: absolute; font-size: 32px; transform: translate(-50%, -50%); }
.sc-sea .shell.got { animation: catch .7s forwards; }
.sc-sea .chest { position: absolute; right: 3%; bottom: 14%; font-size: 56px; }
.sc-sea .mermaid { position: absolute; left: 6%; top: 40%; font-size: 60px; transform: translate(-50%, -50%); transition: left .5s ease-in-out, top .5s ease-in-out; z-index: 2; filter: drop-shadow(0 4px 6px rgba(0,0,0,.3)); }
.sc-sea .mermaid.swim { animation: swim .5s; }
.sc-sea .mermaid.shake { animation: shake-centered .4s; }
.sc-sea .diver .hero-prop { right: -30%; top: -20%; bottom: auto; }
.sc-sea .sand { position: absolute; left: 0; right: 0; bottom: 0; height: 12%; background: linear-gradient(#ffe082, #ffca28); display: flex; justify-content: space-around; align-items: flex-end; font-size: 34px; }
.sc-sea .sand > * { transform: translateY(-30%); }

/* Αρένα ιππότη */
.sc-arena { position: absolute; inset: 0; background: url('../img/arena_bg.jpg') center/cover no-repeat; }
.sc-arena .castle { position: absolute; left: 6%; bottom: 30%; font-size: 90px; }
.sc-arena .hero { position: absolute; left: 30%; bottom: 14%; font-size: 84px; filter: drop-shadow(0 6px 6px rgba(0,0,0,.3)); z-index: 2; }
.sc-arena .hero.lunge { animation: lunge .3s; }
.sc-arena .hero.shake { animation: shake-plain .4s; }
.sc-arena .knight .hero-prop { right: -60%; bottom: -5%; transform: rotate(20deg); }
.sc-arena .hero.lunge .knight .hero-prop { animation: sword .3s; }
.sc-arena .monster-box { position: absolute; right: 12%; bottom: 14%; text-align: center; transition: transform .3s, opacity .3s; }
.sc-arena .monster { font-size: 96px; display: block; filter: drop-shadow(0 6px 6px rgba(0,0,0,.3)); animation: bob 1.6s infinite; }
.sc-arena .hp { width: 140px; height: 16px; background: #fff; border: 3px solid #37474f; border-radius: 10px; margin: 0 auto 8px; overflow: hidden; }
.sc-arena .hp i { display: block; height: 100%; background: linear-gradient(90deg, #e53935, #ff7043); transition: width .25s; }
.sc-arena .monster-box.hurt .monster { animation: hurt .3s; }
.sc-arena .monster-box.attack .monster { animation: attack .4s; }
.sc-arena .monster-box.dead { transform: scale(0) rotate(180deg); opacity: 0; }
.sc-arena .monster-box.enter { animation: enter .6s cubic-bezier(.2, 1.4, .5, 1); }

/* Διάστημα */
.sc-space { position: absolute; inset: 0; background: url('../img/space_bg.jpg') center/cover no-repeat; }
.sc-space .stars i { position: absolute; width: 3px; height: 3px; background: #fff; border-radius: 50%; animation: twinkle-dot 1.5s infinite alternate; }
.sc-space .planet { position: absolute; font-size: 54px; transform: translate(-50%, -50%); filter: drop-shadow(0 0 10px rgba(255,255,255,.4)); }
.sc-space .planet.popin { animation: popin .5s; }
.sc-space .rocket { position: absolute; font-size: 56px; transform: translate(-50%, -50%); transition: left .25s linear, top .25s linear; z-index: 2; filter: drop-shadow(0 0 12px #ffab40); }
.sc-space .rocket-body { display: inline-block; transform: rotate(45deg); }
.sc-space .rocket-rider { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); }
.sc-space .rocket.shake { animation: shake-rocket .4s; }

/* Κήπος με μέλισσα */
.sc-garden { position: absolute; inset: 0; background: url('../img/garden_bg.jpg') center/cover no-repeat; }
.sc-garden .flower { position: absolute; bottom: 12%; font-size: 52px; transform: translateX(-50%); animation: bob 2.5s infinite; }
.sc-garden .flower:nth-child(2n) { animation-delay: -1s; }
.sc-garden .bee { position: absolute; bottom: 46%; font-size: 48px; transform: translateX(-50%); transition: left .7s ease-in-out; z-index: 2; animation: bee-hover .6s infinite alternate; }
.sc-garden .bee.fly { animation: bee-fly .7s; }
.sc-garden .bee.shake { animation: shake-plain .4s; }
.sc-garden .grass { position: absolute; left: 0; right: 0; bottom: 0; height: 12%; background: linear-gradient(#7cb342, #558b2f); }

/* Λιβάδι */
.sc-meadow { position: absolute; inset: 0; background: url('../img/garden_bg.jpg') center/cover no-repeat; }
.sc-meadow .bed { position: absolute; left: 13%; right: 4%; bottom: 8%; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; font-size: 40px; }
.sc-meadow .sprout { display: inline-block; }
.sc-meadow .sprout.grow { animation: grow .6s cubic-bezier(.2, 1.4, .5, 1); }
.sc-meadow .butterfly { position: absolute; top: 20%; font-size: 56px; animation: cloud-move 12s linear infinite; }
.sc-meadow .gardener { position: absolute; left: 3%; bottom: 10%; z-index: 2; }
.sc-meadow .gardener.water { animation: bump .5s; }
.sc-meadow .gardener .hero-prop { right: -45%; bottom: 0; }

/* Animations */
.kb-letter-card.shake { animation: shake-plain .4s; }
@keyframes caret { from { box-shadow: 0 0 0 3px #ffd54f; } to { box-shadow: 0 0 0 5px #ffb300; } }
@keyframes err { 0%, 100% { transform: translateX(0); background: transparent; } 50% { transform: translateX(-4px); background: #ffcdd2; } }
@keyframes key-pulse { from { transform: scale(1); } to { transform: scale(1.08); } }
@keyframes shake-plain { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes shake-centered { 0%, 100% { transform: translate(-50%, -50%) translateX(0); } 25% { transform: translate(-50%, -50%) translateX(-8px); } 75% { transform: translate(-50%, -50%) translateX(8px); } }
@keyframes shake-car { 0%, 100% { transform: translate(-50%, -50%); } 25% { transform: translate(-50%, -60%) rotate(-6deg); } 75% { transform: translate(-50%, -40%) rotate(6deg); } }
@keyframes shake-rocket { 0%, 100% { transform: translate(-50%, -50%); } 25% { transform: translate(-60%, -50%) rotate(-10deg); } 75% { transform: translate(-40%, -50%) rotate(10deg); } }
@keyframes sword { 0%, 100% { transform: rotate(20deg); } 50% { transform: rotate(-40deg) translateX(10px); } }
@keyframes vroom { 0% { transform: translate(-50%, -50%) rotate(0); } 30% { transform: translate(-50%, -62%) rotate(-8deg); } 100% { transform: translate(-50%, -50%) rotate(0); } }
@keyframes frog-jump { 0%, 100% { transform: translate(-50%, -60%) scale(1); } 50% { transform: translate(-50%, -160%) scale(1.25); } }
@keyframes swim { 0%, 100% { transform: translate(-50%, -50%) rotate(0); } 50% { transform: translate(-50%, -60%) rotate(-12deg); } }
@keyframes fish-swim { from { left: -60px; } to { left: 105%; } }
@keyframes lunge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(60px) rotate(-10deg); } }
@keyframes hurt { 0%, 100% { transform: translateX(0); filter: none; } 50% { transform: translateX(20px) rotate(10deg); filter: brightness(1.6) sepia(1) hue-rotate(-50deg); } }
@keyframes attack { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-60px) scale(1.15); } }
@keyframes enter { from { transform: translateX(300px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes twinkle-dot { from { opacity: .3; } to { opacity: 1; } }
@keyframes bee-hover { from { margin-bottom: 0; } to { margin-bottom: 10px; } }
@keyframes bee-fly { 0%, 100% { margin-bottom: 0; } 50% { margin-bottom: 60px; } }
@keyframes grow { 0% { transform: scale(.2) rotate(-30deg); } 100% { transform: scale(1) rotate(0); } }

@media (max-height: 700px) {
  .kb-keyboard { --k: min(4.2vw, 40px); }
  .kb-letter-card { height: 64px; font-size: 44px; }
  .kb-text { font-size: 24px; }
  .kb-text.big { font-size: 26px; }
  .kb-text.para { font-size: 20px; max-height: 18vh; }
}

/* ===================== Μορφοποίηση κειμένου (kb-format) ===================== */
.tf-wrap { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: auto minmax(0, 1fr); gap: 10px; padding: 10px; overflow: hidden; }
.tf-bars { grid-column: 1 / -1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tf-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
  background: rgba(255,255,255,.88); border-radius: 14px; padding: 6px 10px; box-shadow: 0 3px 10px rgba(72,96,150,.12), inset 0 0 0 2px #fff;
}
.tf-group { position: relative; display: flex; align-items: center; gap: 3px; padding-right: 8px; border-right: 2px solid #e3e8f0; }
.tf-group:last-child { border-right: 0; padding-right: 0; }
.tf-btn {
  font-family: inherit; font-size: 17px; font-weight: 600; line-height: 1; min-width: 36px; height: 36px; padding: 0 7px; border-radius: 10px;
  border: 2px solid #cfd8dc; background: #fff; color: #37474f; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  transition: transform .1s, background .15s, border-color .15s;
}
.tf-btn small { font-size: 10px; font-weight: 700; color: #78909c; }
.tf-btn.sm { font-size: 14px; height: 32px; }
.tf-btn:hover { transform: scale(1.06); border-color: #ffb74d; }
.tf-btn.on { background: #ffe082; border-color: #ff9800; }
.tf-sel { font-family: inherit; font-size: 15px; font-weight: 600; height: 36px; border: 2px solid #cfd8dc; border-radius: 10px; background: #fff; color: #37474f; padding: 0 6px; }
.tf-sel.tf-size { width: 64px; }
.tf-sel.tf-case { width: 58px; font-size: 16px; }   /* Aa πεζά/ΚΕΦΑΛΑΙΑ (js/textcase.js): το κουτί γράφει πάντα «Aa» */
.tf-zoom { gap: 0; }
.tf-zoomval { font-weight: 700; font-size: 13px; color: #607d8b; width: 44px; text-align: center; }
.tf-color { position: relative; display: inline-flex; }
.tf-color-ico { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 2px solid #cfd8dc; border-radius: 10px; background: #fff; font-weight: 700; font-size: 18px; cursor: pointer; border-bottom: 5px solid #e53935; }
.tf-color-ico.hl { border-bottom-color: #fff59d; }
.tf-swatches { display: none; position: absolute; top: 100%; left: 0; z-index: 20; margin-top: 4px; background: #fff; border: 2px solid #ffd54f; border-radius: 12px; padding: 6px; grid-template-columns: repeat(5, 30px); gap: 5px; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.tf-color.open .tf-swatches { display: grid; }
.tf-color.open .tf-color-ico { background: #ffe082; border-color: #ff9800; }
.tf-swatches i.flash { animation: tf-flash .5s 5; }
.tf-swatches i { width: 30px; height: 30px; border-radius: 8px; border: 2px solid #fff; box-shadow: 0 0 0 1px #bbb; cursor: pointer; display: block; }
.tf-swatches i:hover { transform: scale(1.15); }
.flash { animation: tf-flash .5s 5; }
@keyframes tf-flash { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 6px #ff9800; transform: scale(1.12); } }
.tf-imgmenu {
  position: absolute; top: 40px; left: 0; z-index: 20; background: #fff; border-radius: 14px; padding: 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2); border: 2px solid #ffd54f;
}
.tf-emojimenu { grid-template-columns: repeat(8, 1fr); }
.tf-imgopt { font-size: 26px; width: 44px; height: 44px; border-radius: 10px; border: 2px solid #eee; background: #fff; cursor: pointer; }
.tf-imgopt:hover { border-color: #ff9800; transform: scale(1.1); }
.tf-find { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: #fff8e1; border: 2px solid #ffd54f; border-radius: 12px; padding: 6px 10px; }
.tf-find input { font-family: inherit; font-size: 15px; height: 32px; border: 2px solid #cfd8dc; border-radius: 8px; padding: 0 8px; width: 190px; user-select: text; -webkit-user-select: text; }
.tf-find #tf-find-msg { font-weight: 700; color: #c62828; font-size: 14px; margin-left: 6px; }
.tf-pagebox { min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 6px 6px; }
/* Γραμμή της άσκησης πάνω από τη σελίδα: ◀ «Άσκηση 2 από 4 · τίτλος» ▶ — μένει ορατή όταν κυλά η σελίδα */
.tf-exbar {
  position: sticky; top: 0; z-index: 5; flex: none; width: min(100%, 760px); box-sizing: border-box; display: flex; align-items: center; gap: 10px;
  background: #e0f2f1; border-radius: 0 0 12px 12px; padding: 5px 8px; box-shadow: 0 3px 10px rgba(0,105,92,.15);
}
.tf-exbar .tf-btn { flex: none; min-width: 34px; }
.tf-exbar .tf-btn:disabled { opacity: .3; cursor: default; transform: none; border-color: #cfd8dc; }
.tf-exinfo { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; column-gap: 10px; text-align: center; }
.tf-page {
  flex: 1 0 auto; width: min(100%, 760px); background: #fff; border-radius: 6px; padding: 36px 48px; box-sizing: border-box;
  box-shadow: 0 12px 34px rgba(0,0,0,.16), inset 0 0 0 1px #e0e0e0;
}
.tf-editor { outline: none; font-family: 'Fredoka', Arial, sans-serif; font-size: 20px; line-height: 40px; color: #263238; user-select: text; -webkit-user-select: text; cursor: text; min-height: 260px; }
.tf-editor::selection, .tf-editor *::selection { background: #ffe082; }
.tf-editor .tf-title { font-size: 28px; line-height: 42px; }
.tf-editor .tf-para { min-height: 1lh; }
/* Διάστιχο (1.77): προεπιλογή 2 = 40px (ο τίτλος 1,5 = 42px· σε px ώστε οι μεγάλες λέξεις να μη μεγαλώνουν τη γραμμή)· οι γραμμές του τετραδίου ζωγραφίζονται σε ΚΑΘΕ παράγραφο (πιο εσωτερικό block) με το δικό της
   διάστιχο (1lh), ώστε τα γράμματα να κάθονται πάντα πάνω τους — όχι σε πίνακες */
.tf-editor :is(div, p, li):not(:has(div, p, li, table)):not(td *, th *) { background: linear-gradient(transparent calc(1lh - 1px), #e3f2fd 0) 0 0 / 100% 1lh; }
.tf-sel.tf-spacing { width: auto; }
/* Εκθέτης/δείκτης: το styleWithCSS βάζει μόνο vertical-align — μικραίνουμε και τα γράμματα (H₂O, 10³), όπως οι κανονικοί επεξεργαστές */
.tf-editor sup, .tf-editor sub, .tf-editor [style*="vertical-align: super"], .tf-editor [style*="vertical-align: sub"] { font-size: .7em; line-height: 0; }
.tf-editor ul, .tf-editor ol { margin: 0; padding-left: 34px; }
.tf-editor blockquote { margin: 0 0 0 40px; border: none; padding: 0; }
.tf-editor hr { border: 0; border-top: 3px solid #b0bec5; margin: 10px 0; }
.tf-editor .tf-img { font-size: 30px; line-height: 1; vertical-align: middle; display: inline-block; padding: 0 2px; cursor: default; user-select: all; -webkit-user-select: all; }
.tf-editor font[size="7"], .tf-editor span[style*="font-size: 48px"], .tf-editor span[style*="font-size:48px"] { line-height: 1.15; }
.tf-tasks { background: rgba(255,255,255,.85); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; box-shadow: inset 0 0 0 2px #fff; }
.tf-exno { font-weight: 700; font-size: 18px; color: #00695c; }
.tf-exmeta { font-size: 13px; font-weight: 600; color: #455a64; }
.tf-next { text-align: center; animation: popin .3s; }
.tf-next .big-btn { font-size: 20px; padding: 10px 20px; }
.tf-tasks-title { font-weight: 700; font-size: 20px; color: #26a69a; }
.tf-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.tf-list li { display: flex; gap: 8px; align-items: flex-start; background: #fff; border-radius: 12px; padding: 8px 10px; font-size: 16px; font-weight: 600; border: 2px solid #eceff1; transition: background .2s, border-color .2s; }
.tf-list li .chk { flex: none; width: 24px; height: 24px; border-radius: 50%; background: #eceff1; color: #90a4ae; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.tf-list li.done { background: #e8f5e9; border-color: #a5d6a7; color: #2e7d32; }
.tf-list li.done .chk { background: #43a047; color: #fff; }
.tf-list li.hintflash { animation: tf-li-flash .5s 3; }
@keyframes tf-li-flash { 50% { background: #fff3c4; border-color: #ffb300; } }
.tf-list li.popin { animation: popin .35s; }
.tf-tasks .big-btn { font-size: 18px; padding: 10px 14px; margin: 4px 0 0; }
.tf-tip { font-size: 13px; color: #607d8b; text-align: center; }
@media (max-width: 1000px) { .tf-wrap { grid-template-columns: 1fr 240px; } .tf-btn { min-width: 40px; height: 40px; font-size: 19px; } }

/* ---- Ενθάρρυνση (kbCheer): ο ήρωας μεγαλώνει από τη θέση του (--ox/--oy) στο κέντρο της σκηνής, με συννεφάκι, και επιστρέφει ---- */
.hero-av.cheering { opacity: 0; transition: opacity .25s; }
.kb-cheer { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; animation: kb-cheer-in .45s cubic-bezier(.2, 1.3, .4, 1) both; }
.kb-cheer.out { animation: kb-cheer-out .45s ease-in both; }
@keyframes kb-cheer-in { from { left: var(--ox, 50%); top: var(--oy, 50%); transform: translate(-50%, -50%) scale(.2); opacity: .4; } to { left: 50%; top: 50%; transform: translate(-50%, -50%) scale(1); opacity: 1; } }
@keyframes kb-cheer-out { from { left: 50%; top: 50%; transform: translate(-50%, -50%) scale(1); opacity: 1; } to { left: var(--ox, 50%); top: var(--oy, 50%); transform: translate(-50%, -50%) scale(.2); opacity: 0; } }
.kb-cheer-av { position: relative; animation: kb-cheer-bounce .6s .3s 2 alternate ease-in-out; }
.kb-cheer-av svg { width: var(--av, 150px); height: var(--av, 150px); border-radius: 50%; border: 5px solid #fff; box-shadow: 0 0 0 8px rgba(255,213,79,.6), 0 14px 30px rgba(0,0,0,.35); background: #fff; display: block; }
@keyframes kb-cheer-bounce { to { transform: translateY(-14px) rotate(4deg); } }
.kb-cheer-star { position: absolute; font-size: 34px; line-height: 1; animation: kb-cheer-star 1.2s .2s infinite alternate ease-in-out; }
.kb-cheer-star.s1 { left: -34px; top: 10px; } .kb-cheer-star.s2 { right: -34px; top: 30px; animation-delay: .5s; } .kb-cheer-star.s3 { left: 50%; top: -30px; margin-left: -17px; animation-delay: .8s; }
@keyframes kb-cheer-star { from { transform: scale(.7) rotate(-15deg); opacity: .6; } to { transform: scale(1.25) rotate(15deg); opacity: 1; } }
.kb-cheer-bubble { position: relative; background: #fff; color: #4527a0; font-weight: 800; font-size: 24px; padding: 10px 22px; border-radius: 22px; white-space: nowrap; box-shadow: 0 6px 18px rgba(0,0,0,.25); border: 3px solid #ffd54f; }
.kb-cheer-bubble::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -10px; border: 10px solid transparent; border-top-color: #fff; }
.kb-cheer.small .kb-cheer-bubble { font-size: 19px; padding: 6px 14px; }
.kb-cheer.small .kb-cheer-star { font-size: 26px; }
@media (max-height: 720px) { .kb-cheer-bubble { font-size: 19px; padding: 8px 16px; } }
