
:root{
  --navy:#022B63;--cyan:#14C7D1;--cyan2:#0daab5;--ink:#13233a;--soft:#f4f8fc;
  --line:#dbe7f2;--green:#20b26b;--orange:#ff9f43;--red:#ea5455;--purple:#7259d6;
  --white:#fff;--shadow:0 16px 40px rgba(2,43,99,.12)
}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;font-family:Inter,Segoe UI,Arial,sans-serif;color:var(--ink);min-height:100vh}
button,input,select,textarea{font:inherit}button{cursor:pointer}a{text-decoration:none;color:inherit}
.topbar{height:74px;background:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 5%;position:sticky;top:0;z-index:50;border-bottom:3px solid var(--cyan);box-shadow:0 4px 18px rgba(2,43,99,.08)}
.brand{display:flex;align-items:center;gap:12px}.brand img{height:47px;max-width:175px;object-fit:contain}
.brand-title{font-weight:900;color:var(--navy);font-size:1.22rem}.brand-title span{color:var(--cyan2)}
.top-actions{display:flex;align-items:center;gap:10px}.pill,.icon-btn{border:1px solid var(--line);background:#fff;color:var(--navy);border-radius:999px;padding:10px 15px;font-weight:800}
.profile{display:flex;align-items:center;gap:8px;background:var(--navy);color:#fff;border:0;border-radius:999px;padding:8px 14px 8px 8px;font-weight:800}
.avatar{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:var(--cyan);font-size:18px}
.page{min-height:100vh;background:linear-gradient(180deg,#eefaff 0,#f8fbff 45%,#fff 100%)}
.hero{padding:24px 5% 18px;display:flex;justify-content:space-between;gap:20px;align-items:center}
.hero h1{margin:0;color:var(--navy);font-size:clamp(1.55rem,3vw,2.45rem);line-height:1.05}.hero p{margin:8px 0 0;color:#56677d;font-weight:600}
.stats{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}.stat{background:#fff;border:1px solid var(--line);border-radius:16px;padding:11px 15px;min-width:108px;box-shadow:0 7px 18px rgba(2,43,99,.06)}
.stat b{display:block;color:var(--navy);font-size:1.15rem}.stat small{color:#6d7d91;font-weight:700}
.app{display:grid;grid-template-columns:250px minmax(340px,1fr) minmax(360px,1.15fr);gap:16px;padding:0 5% 30px;max-width:1650px;margin:auto}
.panel{background:#fff;border:1px solid var(--line);border-radius:22px;box-shadow:var(--shadow);overflow:hidden}
.panel-head{padding:16px 18px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:8px}.panel-head h2{font-size:1rem;margin:0;color:var(--navy)}
.level-list{padding:12px;display:grid;gap:8px;max-height:680px;overflow:auto}
.level-btn{border:1px solid transparent;background:#f5f8fc;border-radius:14px;padding:11px;text-align:left;display:grid;grid-template-columns:38px 1fr auto;align-items:center;gap:9px;color:var(--ink)}
.level-btn:hover{border-color:var(--cyan)}.level-btn.active{background:#e8fbfd;border-color:var(--cyan);box-shadow:inset 4px 0 var(--cyan)}.level-btn.locked{opacity:.5;cursor:not-allowed}
.level-num{width:36px;height:36px;border-radius:12px;background:var(--navy);color:#fff;display:grid;place-items:center;font-weight:900}.level-btn.active .level-num{background:var(--cyan2)}
.level-name{font-weight:850;font-size:.9rem}.level-skill{font-size:.72rem;color:#74849a;margin-top:2px}.stars{color:#ffb800;letter-spacing:-2px;white-space:nowrap}
.lesson-body{padding:18px}.mission{background:linear-gradient(135deg,var(--navy),#064690);color:#fff;border-radius:18px;padding:18px;margin-bottom:14px;position:relative;overflow:hidden}
.mission:after{content:"✦";position:absolute;right:15px;bottom:-18px;font-size:86px;font-weight:900;opacity:.09}.mission-label{color:#7ceaf0;text-transform:uppercase;letter-spacing:.12em;font-size:.72rem;font-weight:900}
.mission h3{margin:6px 0;font-size:1.18rem}.mission p{margin:0;color:#dbeaff;line-height:1.5;font-size:.91rem}
.hint{margin-top:12px;background:#fff7df;border:1px solid #ffe080;border-radius:14px;padding:11px 13px;color:#6e5410;font-size:.86rem;display:none}.hint.show{display:block}
.section-title{display:flex;justify-content:space-between;align-items:center;margin:16px 0 9px}.section-title h3{margin:0;font-size:.91rem;color:var(--navy)}
.tiny-btn{border:0;background:transparent;color:var(--cyan2);font-weight:850;font-size:.8rem}
.controls{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:13px}.primary,.secondary,.danger{border:0;border-radius:13px;padding:12px;font-weight:900}.primary{background:var(--green);color:#fff}.secondary{background:#e7f4ff;color:var(--navy)}.danger{background:#fff0f0;color:var(--red)}
.game-wrap{padding:18px}.game-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;gap:12px}.game-top strong{color:var(--navy)}
.status{font-size:.82rem;font-weight:850;background:#edf4fb;border-radius:999px;padding:7px 12px;color:#52677e}
.footer{text-align:center;padding:15px 5% 30px;color:#718197;font-size:.82rem;font-weight:650}
.toast{position:fixed;left:50%;bottom:25px;transform:translate(-50%,140px);background:#10243d;color:#fff;border-radius:14px;padding:13px 18px;font-weight:850;z-index:100;transition:.3s;box-shadow:0 12px 30px rgba(0,0,0,.25);text-align:center}.toast.show{transform:translate(-50%,0)}
.modal{position:fixed;inset:0;background:rgba(4,20,40,.65);z-index:90;display:none;align-items:center;justify-content:center;padding:20px}.modal.show{display:flex}
.modal-card{background:#fff;width:min(680px,100%);max-height:90vh;overflow:auto;border-radius:24px;padding:24px;box-shadow:0 25px 80px rgba(0,0,0,.3)}
.close{border:0;background:#eef3f8;width:36px;height:36px;border-radius:50%;font-size:20px}
.ad-slot{margin:16px 5%;min-height:90px;border:2px dashed #bfd1e2;border-radius:18px;background:#f5f9fc;color:#738399;display:grid;place-items:center;text-align:center;font-weight:800}
.back-home{position:fixed;right:16px;bottom:16px;z-index:40;background:var(--navy);color:#fff;border-radius:999px;padding:11px 15px;font-weight:900;box-shadow:var(--shadow)}
/* Landing */
.landing{background:radial-gradient(circle at top,#e9fbff,#f7fbff 42%,#fff);min-height:100vh}
.landing-hero{max-width:1250px;margin:auto;padding:55px 5% 35px;display:grid;grid-template-columns:1.1fr .9fr;gap:35px;align-items:center}.landing h1{font-size:clamp(2.6rem,5vw,5rem);line-height:.97;margin:0;color:var(--navy);letter-spacing:-.05em}.landing h1 span{color:var(--cyan2)}
.landing p{font-size:1.08rem;line-height:1.7;color:#5b6d82;font-weight:600}.hero-art{min-height:410px;border-radius:34px;background:linear-gradient(135deg,#022B63,#0752a8);position:relative;overflow:hidden;display:grid;place-items:center;box-shadow:var(--shadow)}
.hero-art .main{font-size:120px;animation:float 3s ease-in-out infinite}.float-card{position:absolute;width:78px;height:78px;background:#fff;border-radius:22px;display:grid;place-items:center;font-size:38px;box-shadow:0 12px 28px rgba(0,0,0,.22);animation:float 3s ease-in-out infinite}.fc1{left:30px;top:40px}.fc2{right:35px;top:65px;animation-delay:.5s}.fc3{left:60px;bottom:42px;animation-delay:1s}.fc4{right:60px;bottom:48px;animation-delay:1.4s}
@keyframes float{50%{transform:translateY(-10px) rotate(2deg)}}.age-grid{max-width:1250px;margin:auto;padding:15px 5% 55px;display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
.age-card{background:#fff;border:1px solid var(--line);border-radius:25px;padding:22px;box-shadow:var(--shadow);transition:.2s;position:relative;overflow:hidden}.age-card:hover{transform:translateY(-5px)}.age-card:before{content:"";position:absolute;left:0;top:0;width:100%;height:6px;background:var(--accent)}
.age-card .big{font-size:55px}.age-card h2{color:var(--navy);margin:8px 0}.age-card p{font-size:.9rem;line-height:1.55}.age-card .go{display:inline-flex;margin-top:12px;padding:11px 14px;border-radius:13px;background:var(--navy);color:#fff;font-weight:900}
/* Discovery */
.discovery{background:linear-gradient(180deg,#eafbe9,#f8fff3 45%,#fff)}.discovery .mission{background:linear-gradient(135deg,#2c9c55,#13743a)}
.world-map{padding:14px;display:grid;gap:10px}.world-node{border:0;background:#f3fff2;border-radius:16px;padding:12px;display:grid;grid-template-columns:44px 1fr auto;align-items:center;gap:10px;text-align:left}.world-node.active{background:#dcf8da;border:1px solid #6edb83}.node-icon{font-size:30px}.world-scene{min-height:500px;border-radius:22px;background:linear-gradient(#7ed7ff 0 38%,#a7df76 38% 100%);position:relative;overflow:hidden;border:5px solid #fff;box-shadow:0 12px 25px rgba(2,43,99,.11)}
.cloud{position:absolute;font-size:58px;animation:cloud 16s linear infinite}.c1{top:40px;left:-80px}.c2{top:100px;left:-140px;animation-delay:7s}@keyframes cloud{to{transform:translateX(900px)}}
.tree{position:absolute;font-size:95px;bottom:50px}.t1{left:25px}.t2{right:25px}.bunny{position:absolute;bottom:60px;left:45%;font-size:76px;animation:hop 1.4s ease-in-out infinite}@keyframes hop{50%{transform:translateY(-12px)}}.butterfly{position:absolute;font-size:30px;animation:fly 5s ease-in-out infinite}.b1{top:140px;left:20%}.b2{top:190px;right:20%;animation-delay:1s}@keyframes fly{50%{transform:translate(80px,-30px) rotate(8deg)}}
.choice-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.choice{border:2px solid var(--line);background:#fff;border-radius:14px;padding:14px;font-size:1.1rem;font-weight:900;color:var(--navy)}.choice.selected{border-color:#38b66b;background:#effff2}
/* Coding shared */
.block-bank{display:flex;flex-wrap:wrap;gap:8px}.code-block{border:0;border-radius:11px;color:#fff;padding:10px 12px;font-weight:850;font-size:.83rem;box-shadow:0 4px 0 rgba(0,0,0,.14)}.move{background:#368be6}.turn{background:var(--purple)}.loop{background:var(--orange)}.action{background:var(--green)}.condition{background:#df477f}
.workspace{min-height:190px;border:2px dashed #bad0e4;background:#f7fbff;border-radius:16px;padding:10px;display:flex;flex-direction:column;gap:8px}.workspace.empty:after{content:"Click a block to add it";color:#91a2b6;text-align:center;margin:auto;font-weight:750;font-size:.88rem}
.program-block{border:0;border-radius:11px;color:#fff;padding:10px 12px;font-weight:850;display:flex;align-items:center;justify-content:space-between;gap:10px;box-shadow:0 3px 0 rgba(0,0,0,.13)}
.program-controls{display:flex;gap:5px}.program-controls button{width:27px;height:27px;border:0;border-radius:8px;background:rgba(255,255,255,.22);color:#fff;font-weight:900;padding:0}
.game-board{width:100%;aspect-ratio:1/1;max-height:610px;display:grid;gap:4px;background:#c9e5ef;border:5px solid #fff;border-radius:20px;padding:5px;box-shadow:inset 0 0 0 1px #a9ccd9,0 12px 25px rgba(2,43,99,.11)}
.cell{position:relative;border-radius:9px;background:linear-gradient(135deg,#eefcff,#dcf5fa);display:grid;place-items:center;overflow:hidden}.cell.wall{background:repeating-linear-gradient(45deg,#5b7188,#5b7188 7px,#506579 7px,#506579 14px)}.cell.goal{background:radial-gradient(circle,#fff7b1,#ffd766)}.cell.goal:after{content:"🏁";font-size:clamp(20px,3vw,34px)}.cell.star:before{content:"⭐";font-size:clamp(18px,2.6vw,30px);animation:pulse 1.2s infinite}.robot{position:absolute;inset:12%;display:grid;place-items:center;font-size:clamp(24px,4vw,46px);z-index:3;transition:transform .25s ease}.dir-1{transform:rotate(90deg)}.dir-2{transform:rotate(180deg)}.dir-3{transform:rotate(270deg)}@keyframes pulse{50%{transform:scale(1.15)}}
.code-preview{margin-top:12px;border:1px solid var(--line);background:#10243d;color:#d7f7fa;border-radius:14px;overflow:hidden}.code-preview-head{display:flex;justify-content:space-between;padding:9px 12px;background:#19334f;font-size:.75rem;font-weight:850;color:#8ee8ee}pre{margin:0;padding:12px;min-height:77px;white-space:pre-wrap;font:13px/1.55 Consolas,monospace}
/* Space */
.space{background:radial-gradient(circle at top,#17244d,#090d25 65%,#050715);color:#dce7ff}.space .topbar{background:#0c1430;border-bottom-color:#7de3ff}.space .brand-title,.space .hero h1,.space .panel-head h2,.space .game-top strong{color:#eaf6ff}.space .hero p{color:#aebfe0}.space .panel{background:#101935;border-color:#27375e}.space .level-btn{background:#182344;color:#e8f4ff}.space .level-btn.active{background:#163d63}.space .lesson-body{color:#eaf6ff}.space .mission{background:linear-gradient(135deg,#32116c,#0c5a98)}.space .workspace{background:#0d1832;border-color:#405579}.space .cell{background:radial-gradient(circle,#18264f,#0b1129)}.space .cell.wall{background:repeating-linear-gradient(45deg,#623f72,#623f72 7px,#492e58 7px,#492e58 14px)}.space .game-board{background:#121b3a}.space .code-preview{border-color:#31466f}.space .status{background:#172545;color:#a9c9ff}
/* Developer */
.developer{background:#0d1117;color:#d8e1ea}.developer .topbar{background:#161b22;border-color:#2f81f7}.developer .brand-title,.developer .hero h1,.developer .panel-head h2,.developer .game-top strong{color:#f0f6fc}.developer .hero p{color:#9da7b2}.developer .panel{background:#161b22;border-color:#30363d}.developer .level-btn{background:#21262d;color:#d8e1ea}.developer .level-btn.active{background:#1f3b5e;border-color:#2f81f7}.developer .mission{background:linear-gradient(135deg,#1f6feb,#0d419d)}.dev-editor{display:grid;grid-template-rows:auto 1fr;height:100%}.tabs{display:flex;gap:6px;padding:10px;border-bottom:1px solid #30363d}.tab{border:0;background:#21262d;color:#c9d1d9;padding:9px 13px;border-radius:8px;font-weight:800}.tab.active{background:#1f6feb;color:#fff}.codearea{width:100%;min-height:390px;border:0;background:#0d1117;color:#dbeafe;padding:15px;resize:vertical;font:14px/1.6 Consolas,monospace}.preview-pane{min-height:490px;background:#fff;border-radius:16px;padding:20px;color:#222}.console{background:#010409;color:#9be9a8;border-radius:14px;padding:13px;min-height:100px;margin-top:12px;font:13px/1.5 Consolas,monospace;white-space:pre-wrap}
@media(max-width:1120px){.app{grid-template-columns:210px 1fr}.game-panel{grid-column:1/-1}.game-board{max-width:680px;margin:auto}.landing-hero{grid-template-columns:1fr}.age-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:760px){.topbar{padding:0 14px;height:66px}.brand img{height:39px;max-width:130px}.brand-title{display:none}.profile span:last-child{display:none}.hero{padding:18px 14px 12px;display:block}.stats{justify-content:flex-start;margin-top:14px}.app{display:block;padding:0 12px 20px}.panel{margin-bottom:14px}.level-list{display:flex;overflow-x:auto;max-height:none}.level-btn{min-width:185px}.lesson-body,.game-wrap{padding:14px}.age-grid{grid-template-columns:1fr}.landing-hero{padding-top:30px}.hero-art{min-height:310px}.choice-grid{grid-template-columns:1fr}}

/* 400-level edition */
.world-map,.level-list{scrollbar-width:thin}
.level-skill{line-height:1.35}
.chapter-note{padding:10px 14px;border-radius:12px;background:#eef8fb;color:#022B63;font-weight:700}
@media(max-width:700px){
  .world-map,.level-list{max-height:430px;overflow:auto}
}

/* Multilingual edition */
@media(max-width:700px){
 }

/* ===== CodeKids AdSense Layout ===== */
.adsense-zone{
  width:min(100%,1100px);
  min-height:90px;
  margin:18px auto;
  border:1px dashed #a9bfd5;
  border-radius:14px;
  background:linear-gradient(135deg,#f8fbff,#eef7fb);
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  color:#58718c;
  font:700 13px/1.4 Arial,sans-serif;
  padding:10px;
  box-sizing:border-box;
}
.adsense-bottom{margin-top:28px;margin-bottom:24px}
.adsense-side{
  position:fixed;
  top:120px;
  width:160px;
  height:600px;
  border:1px dashed #a9bfd5;
  border-radius:14px;
  background:linear-gradient(180deg,#f8fbff,#eef7fb);
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  color:#58718c;
  font:700 13px/1.5 Arial,sans-serif;
  z-index:15;
  overflow:hidden;
}
.adsense-left{left:10px}
.adsense-right{right:10px}
body{padding-left:180px;padding-right:180px}

/* Discovery fixed work area */
.discovery-fixed-layout{
  align-items:start;
}
.discovery-level-scroll{
  max-height:calc(100vh - 210px) !important;
  overflow-y:auto !important;
  overscroll-behavior:contain;
  scrollbar-width:thin;
  position:relative;
}
.discovery-fixed-panel{
  position:sticky !important;
  top:100px !important;
  max-height:calc(100vh - 125px);
  overflow:auto;
  align-self:start;
}

/* fallback for the existing Discovery two-column structure */
body:has(.discovery-level-scroll) .game-layout,
body:has(.discovery-level-scroll) .game-grid{
  align-items:start;
}
body:has(.discovery-level-scroll) .activity,
body:has(.discovery-level-scroll) .lesson,
body:has(.discovery-level-scroll) .workspace{
  position:sticky;
  top:100px;
  max-height:calc(100vh - 125px);
  overflow:auto;
}

@media (max-width:1450px){
  body{padding-left:0;padding-right:0}
  .adsense-side{display:none}
}
@media (max-width:800px){
  .adsense-zone{
    min-height:70px;
    margin:12px auto;
    border-radius:10px;
  }
  .discovery-level-scroll{
    max-height:420px !important;
  }
  .discovery-fixed-panel,
  body:has(.discovery-level-scroll) .activity,
  body:has(.discovery-level-scroll) .lesson,
  body:has(.discovery-level-scroll) .workspace{
    position:relative !important;
    top:auto !important;
    max-height:none !important;
    overflow:visible !important;
  }
}

/* RTL ad placement remains visually correct */
/* ===== Final sticky AdSense and floating control fixes ===== */

/* Keep vertical ads fully inside the viewport at both top and bottom */
.adsense-side{
  top:110px !important;
  height:auto !important;
  min-height:0 !important;
  max-height:calc(100vh - 130px) !important;
  bottom:20px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  box-sizing:border-box !important;
}

/* Allow actual ad code to fit without being cut at the lower edge */
.adsense-side > ins,
.adsense-side iframe,
.adsense-side .adsbygoogle{
  max-width:100% !important;
  max-height:100% !important;
}

/* Prevent floating age-group / navigation controls from covering the right ad */
.age-group,
.age-group-button,
.age-badge,
.floating-age,
.back-home,
.home-fab,
.world-age,
.age-label{
  z-index:30;
}

/* Desktop: keep floating controls inside the central content area */
@media (min-width:1451px){
  .age-group,
  .age-group-button,
  .age-badge,
  .floating-age,
  .home-fab,
  .world-age,
  .age-label{
    right:190px !important;
    left:auto !important;
  }

  .back-home{
    right:auto !important;
    left:190px !important;
  }
}

/* On smaller screens the side ads are hidden, so controls can return to edge */
@media (max-width:1450px){
  .age-group,
  .age-group-button,
  .age-badge,
  .floating-age,
  .home-fab,
  .world-age,
  .age-label{
    right:16px !important;
    left:auto !important;
  }

  .back-home{
    left:16px !important;
    right:auto !important;
  }
}

/* RTL keeps controls clear of the side ad columns too */
@media (min-width:1451px){
  }

.ad-safe-floating{z-index:30!important}
@media(min-width:1451px){
  .ad-safe-floating{right:190px!important;left:auto!important}
  }
@media(max-width:1450px){
  .ad-safe-floating{right:16px!important;left:auto!important}
}

/* FINAL ALIGNMENT AND SEO */

.age-grid{align-items:stretch}.age-card{display:flex;flex-direction:column;min-height:430px}
.age-card .big,.age-card h2{flex:0 0 auto}.age-card p{flex:1 1 auto;margin-bottom:18px}
.age-card .go{display:flex;align-items:center;justify-content:center;width:100%;min-height:58px;margin-top:auto;padding:12px 16px;box-sizing:border-box;text-align:center;line-height:1.25}
body.developer{padding-left:0!important;padding-right:0!important}
.developer .app,.developer .hero,.developer .adsense-zone,.developer .seo-content{width:min(calc(100% - 32px),1540px);max-width:1540px;margin-left:auto;margin-right:auto}
.seo-content{width:min(calc(100% - 32px),1180px);margin:28px auto;padding:28px;box-sizing:border-box;background:#fff;border:1px solid #dbe7f2;border-radius:22px;box-shadow:0 16px 40px rgba(2,43,99,.12);color:#304961}
.seo-content>h2,.seo-faq>h2{color:#022B63;margin-top:0}.seo-content>p{font-size:1rem;line-height:1.75}
.seo-features{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin:22px 0}.seo-features article{padding:18px;background:#f5f9fd;border:1px solid #dce8f3;border-radius:15px}
.seo-features h3{color:#022B63;margin:0 0 8px}.seo-features p{margin:0;line-height:1.55}
.seo-faq details{margin:10px 0;padding:14px 16px;background:#f7fafc;border:1px solid #dce8f3;border-radius:12px}.seo-faq summary{cursor:pointer;color:#022B63;font-weight:800}.seo-faq details p{margin:10px 0 0;line-height:1.6}
.developer .seo-content{background:#161b22;border-color:#30363d;color:#c9d1d9}.developer .seo-content>h2,.developer .seo-faq>h2,.developer .seo-features h3,.developer .seo-faq summary{color:#f0f6fc}
.developer .seo-features article,.developer .seo-faq details{background:#0d1117;border-color:#30363d}
@media(max-width:760px){.age-card{min-height:auto}.seo-content{padding:20px}.seo-features{grid-template-columns:1fr}}


/* ==========================================================
   REPORTIX ORIGINAL THEME
   Dark blue: #022B63 | Cyan: #14C7D1
   ========================================================== */

:root{
  --reportix-navy:#022B63;
  --reportix-cyan:#14C7D1;
  --reportix-deep:#011E46;
  --reportix-soft:#EAF8FA;
  --reportix-line:#CFE8EC;
  --reportix-white:#FFFFFF;
  --reportix-text:#173A5E;
}

html{scroll-behavior:smooth}

body.reportix-themed{
  margin:0;
  background:#f5f9fc;
  color:var(--reportix-text);
}

/* Main Reportix header */
.reportix-main-header{
  position:sticky;
  top:0;
  z-index:9999;
  width:100%;
  background:linear-gradient(90deg,var(--reportix-deep),var(--reportix-navy));
  border-bottom:3px solid var(--reportix-cyan);
  box-shadow:0 6px 20px rgba(1,30,70,.18);
}

.reportix-header-inner{
  width:min(calc(100% - 32px),1500px);
  min-height:72px;
  margin:0 auto;
  display:flex;
  align-items:center;
  gap:22px;
}

.reportix-brand{
  display:flex;
  align-items:center;
  gap:12px;
  color:#fff;
  text-decoration:none;
  flex:0 0 auto;
}

.reportix-brand img{
  width:78px;
  height:54px;
  object-fit:contain;
  background:#fff;
  border-radius:6px;
  padding:3px;
  box-sizing:border-box;
}

.reportix-brand-text{
  font-size:1.35rem;
  font-weight:800;
  letter-spacing:.2px;
  white-space:nowrap;
}

.reportix-brand-text strong{
  color:var(--reportix-cyan);
}

.reportix-main-nav{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  flex:1 1 auto;
}

.reportix-main-nav a{
  color:#fff;
  text-decoration:none;
  font-weight:700;
  font-size:.95rem;
  padding:12px 11px;
  border-radius:9px;
  transition:.2s ease;
  white-space:nowrap;
}

.reportix-main-nav a:hover,
.reportix-main-nav a:focus{
  color:var(--reportix-cyan);
  background:rgba(255,255,255,.08);
}

.reportix-codekids-controls{
  display:flex;
  align-items:center;
  gap:10px;
  flex:0 0 auto;
}

.language-slot{
  display:flex;
  align-items:center;
}

.language-slot select,
.reportix-main-header select{
  min-height:42px;
  border:1px solid rgba(255,255,255,.35);
  border-radius:22px;
  background:#fff;
  color:var(--reportix-navy);
  font-weight:700;
  padding:0 38px 0 14px;
  outline:none;
}

.age-groups-link{
  min-height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 17px;
  border-radius:22px;
  background:var(--reportix-cyan);
  color:var(--reportix-navy);
  text-decoration:none;
  font-weight:800;
  box-shadow:0 5px 14px rgba(20,199,209,.25);
  white-space:nowrap;
}

.age-groups-link:hover{
  background:#35D5DD;
}

.reportix-menu-toggle{
  display:none;
  border:0;
  background:var(--reportix-cyan);
  color:var(--reportix-navy);
  width:42px;
  height:42px;
  border-radius:10px;
  font-size:1.35rem;
  font-weight:900;
  cursor:pointer;
}

/* Hide previous page-specific header after its controls are transferred */
.legacy-codekids-header{
  display:none !important;
}

/* Common Reportix page styling */
.reportix-themed .hero,
.reportix-themed .landing-hero{
  border-top:0;
}

.reportix-themed .hero h1,
.reportix-themed .landing-hero h1,
.reportix-themed h1,
.reportix-themed h2,
.reportix-themed h3{
  color:var(--reportix-navy);
}

.reportix-themed .primary,
.reportix-themed .go,
.reportix-themed button.primary,
.reportix-themed .cta,
.reportix-themed .age-groups-link{
  background:var(--reportix-navy);
  color:#fff;
  border-color:var(--reportix-navy);
}

.reportix-themed .primary:hover,
.reportix-themed .go:hover,
.reportix-themed button.primary:hover,
.reportix-themed .cta:hover{
  background:var(--reportix-cyan);
  color:var(--reportix-navy);
  border-color:var(--reportix-cyan);
}

.reportix-themed .age-card{
  border-top:5px solid var(--reportix-cyan);
}

.reportix-themed .age-card:nth-child(1),
.reportix-themed .age-card:nth-child(2),
.reportix-themed .age-card:nth-child(3),
.reportix-themed .age-card:nth-child(4){
  border-top-color:var(--reportix-cyan);
}

.reportix-themed .age-card .go{
  background:var(--reportix-navy);
}

.reportix-themed .age-card .go:hover{
  background:var(--reportix-cyan);
  color:var(--reportix-navy);
}

.reportix-themed .adsense-zone,
.reportix-themed .adsense-side{
  border-color:#9EDAE0;
  background:linear-gradient(135deg,#F8FEFF,#EAF8FA);
  color:#466B82;
}

.reportix-themed .seo-content{
  border-top:4px solid var(--reportix-cyan);
}

/* Discovery, Robot and Space panels */
.reportix-themed .level-item.active,
.reportix-themed .project-item.active,
.reportix-themed .mission-item.active{
  border-color:var(--reportix-cyan) !important;
  background:rgba(20,199,209,.12) !important;
}

.reportix-themed .progress-fill,
.reportix-themed .meter-fill{
  background:linear-gradient(90deg,var(--reportix-navy),var(--reportix-cyan));
}

/* Developer World keeps its dark IDE appearance but follows Reportix branding */
body.developer.reportix-themed{
  background:#08111f;
}

.developer.reportix-themed .reportix-main-header h1,
.developer.reportix-themed .reportix-main-header h2,
.developer.reportix-themed .reportix-main-header h3{
  color:inherit;
}

.developer.reportix-themed .hero h1,
.developer.reportix-themed .hero h2,
.developer.reportix-themed .hero h3{
  color:#fff;
}

.developer.reportix-themed .panel-title,
.developer.reportix-themed .project-brief,
.developer.reportix-themed .tab.active{
  border-color:var(--reportix-cyan);
}

.developer.reportix-themed .tab.active,
.developer.reportix-themed .project-brief{
  background:linear-gradient(135deg,var(--reportix-navy),#0755B5);
}

.developer.reportix-themed .project-item.active{
  border-color:var(--reportix-cyan);
  background:rgba(20,199,209,.14);
}

/* Responsive header */
@media(max-width:1180px){
  .reportix-header-inner{
    flex-wrap:wrap;
    padding:10px 0;
    gap:12px;
  }

  .reportix-menu-toggle{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    margin-left:auto;
  }

  .reportix-main-nav{
    display:none;
    width:100%;
    order:4;
    flex-direction:column;
    align-items:stretch;
    padding:8px 0 4px;
  }

  .reportix-main-nav.is-open{
    display:flex;
  }

  .reportix-main-nav a{
    width:100%;
    box-sizing:border-box;
    text-align:left;
    padding:12px 14px;
  }

  .reportix-codekids-controls{
    margin-left:auto;
  }
}

@media(max-width:760px){
  .reportix-header-inner{
    width:min(calc(100% - 20px),1500px);
  }

  .reportix-brand img{
    width:62px;
    height:44px;
  }

  .reportix-brand-text{
    font-size:1.05rem;
  }

  .reportix-codekids-controls{
    width:100%;
    justify-content:space-between;
    order:3;
  }

  .language-slot,
  .language-slot select{
    flex:1 1 auto;
    width:100%;
  }

  .age-groups-link{
    flex:0 0 auto;
  }
}

/* ===== Final robot and rocket cell-fit correction ===== */
.game-cell,.grid-cell,.board-cell,.space-cell,.robot-cell,.tile,.galaxy-cell,.cell{
  position:relative;
  overflow:hidden;
}
.robot,.robot-piece,.player-robot,.robot-sprite,
.rocket,.rocket-piece,.player-rocket,.spacecraft,.spacecraft-piece,.ship,.ship-piece,
.cell-fitted-piece{
  position:absolute!important;
  left:50%!important;
  top:50%!important;
  right:auto!important;
  bottom:auto!important;
  transform:translate(-50%,-50%)!important;
  width:auto!important;
  height:auto!important;
  max-width:66%!important;
  max-height:66%!important;
  object-fit:contain!important;
  line-height:1!important;
  margin:0!important;
  padding:0!important;
  box-sizing:border-box!important;
  pointer-events:none!important;
}
.robot img,.robot-piece img,.player-robot img,.robot-sprite img,
.rocket img,.rocket-piece img,.player-rocket img,.spacecraft img,.spacecraft-piece img,.ship img,.ship-piece img,
.robot svg,.rocket svg,.spacecraft svg,.ship svg{
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  max-height:100%!important;
  object-fit:contain!important;
}
.robot,.robot-piece,.player-robot,.robot-sprite{
  font-size:clamp(24px,4vw,42px)!important;
}
.rocket,.rocket-piece,.player-rocket,.spacecraft,.spacecraft-piece,.ship,.ship-piece{
  font-size:clamp(24px,4vw,40px)!important;
}
@media(max-width:760px){
  .robot,.robot-piece,.player-robot,.robot-sprite,
  .rocket,.rocket-piece,.player-rocket,.spacecraft,.spacecraft-piece,.ship,.ship-piece,
  .cell-fitted-piece{
    max-width:60%!important;
    max-height:60%!important;
  }
}


/* ===== FINAL DIRECTION AND MOVEMENT VISUAL FIX ===== */

/* Robot emoji is treated as facing upward at direction 0 */
.robot-page-ready .robot.dir-0,
.robot-page-ready .cell-fitted-piece.dir-0{
  transform:translate(-50%,-50%) rotate(0deg)!important;
}
.robot-page-ready .robot.dir-1,
.robot-page-ready .cell-fitted-piece.dir-1{
  transform:translate(-50%,-50%) rotate(90deg)!important;
}
.robot-page-ready .robot.dir-2,
.robot-page-ready .cell-fitted-piece.dir-2{
  transform:translate(-50%,-50%) rotate(180deg)!important;
}
.robot-page-ready .robot.dir-3,
.robot-page-ready .cell-fitted-piece.dir-3{
  transform:translate(-50%,-50%) rotate(270deg)!important;
}

/* The rocket emoji naturally points diagonally up-right, so offset it by -45° */
.page.space .robot.dir-0,
.page.space .cell-fitted-piece.dir-0{
  transform:translate(-50%,-50%) rotate(-45deg)!important;
}
.page.space .robot.dir-1,
.page.space .cell-fitted-piece.dir-1{
  transform:translate(-50%,-50%) rotate(45deg)!important;
}
.page.space .robot.dir-2,
.page.space .cell-fitted-piece.dir-2{
  transform:translate(-50%,-50%) rotate(135deg)!important;
}
.page.space .robot.dir-3,
.page.space .cell-fitted-piece.dir-3{
  transform:translate(-50%,-50%) rotate(225deg)!important;
}

/* Smoothly show each turn and movement */
.robot-page-ready .robot,
.page.space .robot{
  transition:transform .22s ease, left .22s ease, top .22s ease!important;
  transform-origin:center center!important;
}


/* ===== ENGLISH-ONLY PRODUCTION HEADER ===== */
.reportix-codekids-controls{margin-left:auto}
.reportix-main-header .age-groups-link{min-width:128px}
html,body{direction:ltr}


/* ===== FINAL INACTIVE ADSENSE STATE ===== */
[hidden],
.ads-inactive .adsense-side,
.ads-inactive .adsense-zone,
.ads-inactive .ad-slot,
.adsense-side[hidden],
.adsense-zone[hidden],
.ad-slot[hidden]{
  display:none !important;
  width:0 !important;
  height:0 !important;
  min-width:0 !important;
  min-height:0 !important;
  max-width:0 !important;
  max-height:0 !important;
  margin:0 !important;
  padding:0 !important;
  border:0 !important;
  overflow:hidden !important;
}

/* Hidden side ads must not reserve desktop page width. */
body{
  padding-left:0 !important;
  padding-right:0 !important;
}

/* ===== CODEKIDS SEARCH CONTENT / INTERNAL LINKS ===== */
.codekids-search-content,
.related-reportix-tools{
  width:min(calc(100% - 32px),1180px);
  margin:26px auto;
  padding:26px;
  box-sizing:border-box;
  background:#fff;
  border:1px solid #dbe7f2;
  border-top:4px solid #14C7D1;
  border-radius:20px;
  box-shadow:0 12px 32px rgba(2,43,99,.09);
  color:#304961;
}
.codekids-search-content h2,
.codekids-search-content h3,
.related-reportix-tools h2{
  color:#022B63;
}
.codekids-search-content > p,
.related-reportix-tools > p{
  line-height:1.7;
}
.codekids-search-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin:18px 0;
}
.codekids-search-grid article{
  background:#f6fafc;
  border:1px solid #dce8f3;
  border-radius:14px;
  padding:17px;
}
.codekids-search-grid ul{
  margin:8px 0 0;
  padding-left:20px;
  line-height:1.65;
}
.codekids-seo-faq details{
  margin:9px 0;
  padding:12px 14px;
  background:#f7fafc;
  border:1px solid #dce8f3;
  border-radius:12px;
}
.codekids-seo-faq summary{
  cursor:pointer;
  color:#022B63;
  font-weight:800;
}
.codekids-seo-faq details p{
  margin:9px 0 0;
  line-height:1.6;
}
.related-tools-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
  margin-top:16px;
}
.related-tools-grid a{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:17px;
  border:1px solid #cfe8ec;
  border-radius:14px;
  background:#f8fdfe;
  text-decoration:none;
  color:#173a5e;
  transition:.2s ease;
}
.related-tools-grid a:hover{
  transform:translateY(-2px);
  border-color:#14C7D1;
  box-shadow:0 8px 18px rgba(2,43,99,.08);
}
.related-tools-grid strong{
  color:#022B63;
}
.related-tools-grid span{
  font-size:.9rem;
  line-height:1.5;
}
.developer .codekids-search-content,
.developer .related-reportix-tools{
  background:#161b22;
  border-color:#30363d;
  border-top-color:#14C7D1;
  color:#c9d1d9;
}
.developer .codekids-search-content h2,
.developer .codekids-search-content h3,
.developer .related-reportix-tools h2,
.developer .related-tools-grid strong,
.developer .codekids-seo-faq summary{
  color:#f0f6fc;
}
.developer .codekids-search-grid article,
.developer .codekids-seo-faq details,
.developer .related-tools-grid a{
  background:#0d1117;
  border-color:#30363d;
  color:#c9d1d9;
}
@media(max-width:800px){
  .codekids-search-content,
  .related-reportix-tools{
    padding:20px;
  }
  .codekids-search-grid,
  .related-tools-grid{
    grid-template-columns:1fr;
  }
}


/* ===== MAIN PAGE TITLE ALIGNMENT FIX =====
   Align page hero/title content with the main CodeKids workspace below.
   No game, level, logic, panel or component styling is changed.
*/
.hero .hero-copy,
.discovery .hero .hero-copy,
.robot .hero .hero-copy,
.space .hero .hero-copy,
.developer .hero .hero-copy{
  width:min(1180px, calc(100% - 32px));
  margin-left:auto !important;
  margin-right:auto !important;
  box-sizing:border-box;
}

@media (max-width: 800px){
  .hero .hero-copy,
  .discovery .hero .hero-copy,
  .robot .hero .hero-copy,
  .space .hero .hero-copy,
  .developer .hero .hero-copy{
    width:calc(100% - 24px);
  }
}
