@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@400;500;600;700&family=Inter:wght@400;500;600;700;800&display=swap');
:root{--bg:#0b1020;--panel:#121a30;--panel2:#18233d;--line:#283652;--text:#f4f7ff;--muted:#a8b4cf;--teal:#5eead4;--purple:#a78bfa;--yellow:#facc15;--red:#fb7185;--green:#86efac;--radius:22px;--shadow:0 18px 50px #02061755}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:radial-gradient(ellipse at 85% 0%,#26335d 0,transparent 35%),var(--bg);color:var(--text);font-family:Inter,"Hind Siliguri",system-ui,sans-serif;line-height:1.5;min-height:100vh}button,select{font:inherit}button{cursor:pointer}button:focus-visible,select:focus-visible{outline:3px solid var(--teal);outline-offset:3px}.app-shell{max-width:1120px;margin:auto;padding:0 22px}.topbar{height:82px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #ffffff10}.brand{display:flex;align-items:center;gap:11px;text-decoration:none;color:var(--text)}.brand-mark{display:grid;place-items:center;width:42px;height:42px;border-radius:14px;background:linear-gradient(135deg,#5eead4,#818cf8);color:#10172a;font-size:27px;font-weight:800}.brand strong{display:block;font-size:17px;letter-spacing:-.4px}.brand small{display:block;color:var(--muted);font-size:9px;letter-spacing:2px}.top-actions{display:flex;align-items:center;gap:10px}.xp-pill{background:#facc1518;border:1px solid #facc1540;color:#fde68a;border-radius:99px;padding:8px 12px;font-size:12px;font-weight:700}select{background:var(--panel2);color:var(--text);border:1px solid var(--line);border-radius:12px;padding:9px 10px;max-width:125px}.hero{margin-top:25px;min-height:280px;display:flex;overflow:hidden;position:relative;align-items:center;justify-content:space-between;background:linear-gradient(110deg,#172440,#182344 55%,#262657);border:1px solid #52638a55;border-radius:28px;padding:34px 36px;box-shadow:var(--shadow)}.hero-copy{max-width:590px;position:relative;z-index:1}.eyebrow{text-transform:uppercase;letter-spacing:1.6px;color:var(--teal);font-size:10px;font-weight:800}.hero h1{font-size:clamp(28px,5vw,46px);line-height:1.16;letter-spacing:-1.3px;margin:12px 0}.hero p{color:#c0cbe3;max-width:520px;font-size:14px;margin:0 0 22px}.hero-buttons{display:flex;gap:10px;flex-wrap:wrap}.btn{border:1px solid transparent;border-radius:12px;padding:11px 16px;font-weight:700;font-size:13px;transition:transform .15s,filter .15s}.btn:active{transform:scale(.98)}.btn.primary{background:var(--teal);color:#10202b}.btn.ghost{background:#ffffff08;color:var(--text);border-color:#ffffff28}.btn.compact{padding:10px 12px;white-space:nowrap}.hero-art{width:245px;height:220px;position:relative;flex-shrink:0;margin-left:12px}.python-bubble{position:absolute;left:65px;top:40px;width:126px;height:126px;border-radius:40px;display:grid;place-items:center;font-size:75px;background:linear-gradient(135deg,#5eead422,#a78bfa22);border:1px solid #ffffff25;box-shadow:0 0 55px #5eead422}.orbit{position:absolute;border:1px dashed #8fa1d855;border-radius:50%;left:20px;top:10px;width:210px;height:190px;transform:rotate(-20deg)}.orbit-two{left:43px;top:25px;width:170px;height:170px;transform:rotate(42deg)}.float-card{position:absolute;display:grid;place-items:center;border:1px solid #ffffff2a;background:#1a2946;border-radius:13px;box-shadow:0 10px 28px #0004}.card-code{right:5px;top:28px;width:58px;height:45px;color:var(--teal);font-weight:800}.card-puzzle{left:8px;bottom:35px;width:52px;height:52px;font-size:25px}.card-star{right:13px;bottom:22px;width:43px;height:43px;font-size:21px}.stats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:13px;margin-top:17px}.stat-card{background:var(--panel);border:1px solid var(--line);border-radius:17px;padding:17px;display:flex;align-items:center;gap:12px}.stat-icon{display:grid;place-items:center;width:43px;height:43px;border-radius:14px;background:#ffffff0a;font-size:21px}.stat-card strong{display:block;font-size:23px;line-height:1.2}.stat-card span:last-child{font-size:11px;color:var(--muted)}.section-block{margin-top:35px}.section-heading{display:flex;justify-content:space-between;align-items:end;gap:12px;margin-bottom:15px}.section-heading h2{margin:5px 0 0;font-size:23px;letter-spacing:-.5px}.tiny-note,.progress-label{font-size:11px;color:var(--muted)}.mode-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:13px}.mode-card{position:relative;text-align:left;display:flex;flex-direction:column;align-items:flex-start;min-height:180px;padding:20px;background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:18px;transition:.2s}.mode-card:hover,.mode-card.selected{border-color:#5eead488;background:linear-gradient(145deg,#172a3e,#151d35);transform:translateY(-2px)}.mode-emoji{font-size:27px;margin-bottom:13px}.mode-title{font-weight:800;font-size:15px}.mode-desc{font-size:12px;color:var(--muted);margin-top:7px;max-width:230px}.mode-arrow{position:absolute;right:17px;top:17px;color:var(--teal)}.level-list{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.level-card{display:flex;align-items:center;gap:13px;padding:14px;background:var(--panel);border:1px solid var(--line);border-radius:16px;color:var(--text);text-align:left;min-width:0}.level-card:disabled{opacity:.62;cursor:not-allowed}.level-num{display:grid;place-items:center;width:43px;height:43px;flex-shrink:0;border-radius:14px;background:#263451;font-size:14px;font-weight:800;color:var(--teal)}.level-card.done .level-num{background:#123c39;color:var(--green)}.level-text{min-width:0;flex:1}.level-text strong{display:block;font-size:13px}.level-text small{display:block;color:var(--muted);font-size:11px;margin-top:3px}.level-status{font-size:17px}.project-card{display:flex;align-items:center;gap:16px;padding:19px;background:linear-gradient(110deg,#182744,#171b34);border:1px solid #3b4c70;border-radius:20px}.project-icon{width:62px;height:62px;display:grid;place-items:center;background:#5eead41c;border-radius:18px;font-size:31px;flex-shrink:0}.project-info{flex:1;min-width:0}.project-info h3{margin:0;font-size:15px}.project-info p{margin:5px 0 10px;color:var(--muted);font-size:12px}.progress-track{height:6px;border-radius:9px;background:#ffffff12;overflow:hidden}.progress-track span{display:block;width:0;height:100%;background:linear-gradient(90deg,var(--teal),var(--purple));transition:width .3s}.project-info small{display:block;color:var(--muted);font-size:10px;margin-top:6px}.panel{border:1px solid var(--line)}.code-note{display:flex;gap:15px;align-items:flex-start;background:#151d33;border-radius:17px;padding:18px;margin-top:25px}.code-note-icon:before{content:"</>";display:grid;place-items:center;width:45px;height:45px;border-radius:14px;background:#5eead41a;color:var(--teal);font-weight:800}.code-note h3{font-size:14px;margin:0 0 4px}.code-note p{font-size:12px;color:var(--muted);margin:0}footer{display:flex;justify-content:space-between;gap:12px;padding:28px 0 35px;color:#74819e;font-size:10px}
.modal-backdrop{position:fixed;inset:0;z-index:20;background:#050816d9;backdrop-filter:blur(9px);display:flex;align-items:center;justify-content:center;padding:16px;overflow-y:auto}.hidden{display:none!important}.modal-card{width:min(650px,100%);max-height:94vh;overflow-y:auto;background:#111a30;border:1px solid #344461;border-radius:24px;padding:24px;box-shadow:var(--shadow)}.modal-top{display:flex;justify-content:space-between;gap:14px;align-items:flex-start}.modal-top h2{font-size:24px;margin:5px 0 0}.icon-button{width:38px;height:38px;border-radius:12px;border:1px solid var(--line);background:#ffffff08;color:var(--text);font-size:17px}.game-meta{display:flex;justify-content:space-between;margin:17px 0 12px;color:var(--muted);font-size:11px}.challenge-card{background:#182641;border:1px solid #2b3c5e;border-radius:18px;padding:18px}.challenge-title{font-size:15px;font-weight:800;margin:0 0 7px}.challenge-desc{font-size:13px;color:#c2cde3;margin:0 0 15px}.visual-target{display:flex;align-items:center;gap:13px;background:#0e172b;border:1px solid #344461;padding:13px;border-radius:14px;margin:12px 0}.visual-emoji{font-size:35px}.visual-target strong{display:block;font-size:13px}.visual-target small{display:block;color:var(--muted);font-size:11px}.choice-list{display:grid;gap:9px;margin-top:13px}.choice{display:flex;align-items:center;gap:10px;text-align:left;width:100%;padding:12px;border:1px solid #344461;background:#101a2e;border-radius:13px;color:var(--text);font-size:12px;line-height:1.5}.choice.selected{border-color:var(--teal);background:#5eead411}.choice.correct{border-color:#86efac;background:#86efac10}.choice-code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;color:#a7f3d0;white-space:pre-wrap;overflow-wrap:anywhere}.choice-num{display:grid;place-items:center;flex-shrink:0;width:26px;height:26px;border-radius:8px;background:#ffffff0b;color:var(--muted);font-weight:800}.order-area{display:grid;gap:8px;margin:12px 0}.order-slot{min-height:42px;border:1px dashed #526384;border-radius:11px;display:flex;align-items:center;gap:8px;padding:7px;color:var(--muted);font-size:11px}.order-slot.filled{border-style:solid;background:#5eead409;color:var(--text)}.order-pieces{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.piece{border:1px solid #526384;background:#202e49;color:#c9f7ef;padding:9px 11px;border-radius:10px;font-family:ui-monospace,monospace;font-size:11px}.piece:disabled{opacity:.3}.game-feedback{margin-top:12px;font-size:12px;min-height:20px;color:var(--muted)}.game-feedback.success{color:var(--green)}.game-feedback.error{color:#fda4af}.game-actions{display:flex;justify-content:space-between;gap:10px;margin-top:17px}.game-actions .btn{flex:1}.code-preview{overflow:auto;white-space:pre-wrap;background:#08101e;border:1px solid #263653;border-radius:14px;padding:15px;color:#a7f3d0;font-size:12px;line-height:1.65}.project-parts{display:grid;gap:8px;margin:16px 0}.project-part{display:flex;align-items:center;gap:10px;background:#182641;border:1px solid #2b3c5e;border-radius:12px;padding:11px;font-size:12px}.part-status{margin-left:auto;color:var(--muted)}.small-muted{font-size:11px;color:var(--muted)}.toast{position:fixed;z-index:40;bottom:20px;left:50%;transform:translateX(-50%);background:#d1fae5;color:#064e3b;padding:12px 18px;border-radius:13px;font-weight:800;font-size:12px;box-shadow:var(--shadow);max-width:calc(100% - 30px)}
@media(max-width:760px){.app-shell{padding:0 14px}.topbar{height:72px}.hero{padding:25px 22px;min-height:255px}.hero-art{width:140px;height:165px;margin-left:-10px;opacity:.75}.python-bubble{left:25px;top:34px;width:95px;height:95px;font-size:55px;border-radius:30px}.orbit{left:0;top:18px;width:145px;height:135px}.orbit-two{left:10px;top:22px;width:125px;height:125px}.card-code{right:-2px;top:14px}.card-puzzle{left:-2px;bottom:17px}.card-star{right:0;bottom:13px}.hero-copy{max-width:72%}.hero h1{font-size:30px}.hero p{font-size:12px}.hero-buttons .btn{font-size:11px;padding:10px 12px}.stats-grid{gap:8px}.stat-card{padding:12px 10px;gap:8px}.stat-icon{width:34px;height:34px;font-size:17px}.stat-card strong{font-size:19px}.stat-card span:last-child{font-size:9px}.mode-grid{grid-template-columns:1fr;gap:9px}.mode-card{min-height:112px;padding:15px 16px 15px 65px;justify-content:center}.mode-emoji{position:absolute;left:17px;top:24px;font-size:27px}.mode-title{font-size:14px}.mode-desc{margin-top:4px}.level-list{grid-template-columns:1fr}.section-heading h2{font-size:20px}.project-card{flex-wrap:wrap;gap:12px}.project-icon{width:50px;height:50px;font-size:25px}.project-info{width:calc(100% - 70px)}.project-card .btn{width:100%}.modal-card{padding:18px;border-radius:20px}.modal-top h2{font-size:21px}footer{font-size:9px}}
@media(max-width:420px){.hero-art{position:absolute;right:0;opacity:.24}.hero-copy{max-width:100%}.hero{min-height:270px}.xp-pill{font-size:10px;padding:7px 9px}.top-actions{gap:6px}.brand strong{font-size:15px}.brand-mark{width:37px;height:37px}.hero h1{font-size:29px}.tiny-note{max-width:110px;text-align:right}}
.world-heading{grid-column:1/-1;display:flex;align-items:baseline;gap:10px;padding:13px 15px 3px;margin-top:7px;border-bottom:1px solid var(--line)}.world-heading span{font-size:9px;letter-spacing:1.4px;color:var(--teal);font-weight:800}.world-heading strong{font-size:14px}.world-heading small{margin-left:auto;color:var(--muted);font-size:10px}

/* CodeQuest v0.3 learning puzzle engine */
.puzzle-style-switch{display:flex;gap:8px;margin:12px 0}.puzzle-style{flex:1;padding:10px 8px;border:1px solid #526384;border-radius:12px;background:#101a2e;color:var(--text);font-weight:800;font-size:12px}.puzzle-style.active{border-color:var(--teal);background:#5eead41b;color:var(--teal)}.tile-puzzle{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;max-width:390px;margin:12px auto;background:#0a1221;padding:5px;border-radius:13px}.puzzle-tile{position:relative;display:flex;align-items:center;justify-content:center;aspect-ratio:1/1;min-width:0;overflow:hidden;border:1px solid #93c5fd;border-radius:7px;background:linear-gradient(135deg,#0891b2,#0f766e 45%,#164e63);color:white;padding:2px;box-shadow:inset 0 0 18px #0003}.puzzle-tile:before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 25% 20%,#a5f3fc 0 7%,transparent 8%),radial-gradient(circle at 80% 75%,#22d3ee55 0 20%,transparent 21%),linear-gradient(135deg,transparent 30%,#a7f3d033 31% 38%,transparent 39%)}.tile-art{position:relative;z-index:1;font-size:clamp(20px,7vw,37px);filter:drop-shadow(0 2px 2px #0006)}.tile-code{position:absolute;z-index:2;left:2px;right:2px;bottom:3px;padding:4px 2px;background:#07111ee8;border:1px solid #a7f3d066;border-radius:5px;color:#a7f3d0;font-size:clamp(8px,2.4vw,11px);line-height:1.2;overflow-wrap:anywhere}.puzzle-tile.tile-selected{outline:3px solid #fbbf24;outline-offset:-3px;transform:scale(.96)}.tile-locked{cursor:default}.puzzle-help{font-size:11px;color:var(--muted);text-align:center}.assembled-learning,.learning-explanation{margin-top:14px;padding:15px;border:1px solid #2b806f;border-radius:14px;background:#0b2929}.assembled-learning h3,.learning-explanation h3{margin:0 0 10px;font-size:15px}.assembled-learning pre,.explanation-code{white-space:pre-wrap;overflow-wrap:anywhere;background:#07111e;color:#a7f3d0;border-radius:10px;padding:12px;font-size:12px;line-height:1.6}.learning-explanation p{font-size:12px;line-height:1.7;color:#d5e4ef;white-space:pre-line;margin:8px 0}.learning-explanation strong{color:#99f6e4}

.puzzle-tile{background-image:url("parrot-puzzle.svg");background-size:300% 300%;background-repeat:no-repeat}
.puzzle-tile:before{opacity:.13}

/* CodeQuest v0.4: dedicated large Slide Fun mode */

#game-modal .modal-card{width:min(900px,100%)}


/* Celebration directly over the puzzle */
.cq-puzzle-main-card {
  position: relative;
}

.cq-puzzle-celebration.is-active {
  position: absolute;
  inset: 85px 10px 45px;
  z-index: 20;
  min-height: 0;
  margin: 0;
  border: 2px solid #5eead4;
  border-radius: 20px;
  background: #101d35eF;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 35px #2dd4bf88;
}

/* Separate completed puzzle card */
.cq-puzzle-success {
  max-width: 680px;
  margin: 22px auto;
  padding: 22px;
  border: 1px solid #829cff;
  border-radius: 24px;
  background:
    radial-gradient(circle at top, #51458a88, transparent 55%),
    linear-gradient(145deg, #172d55, #202047 65%, #123b50);
  box-shadow: 0 18px 45px #0008;
  text-align: center;
  animation: cq-success-enter .45s ease-out both;
}

.cq-success-heading h3 {
  margin: 5px 0;
  color: #d8ccff;
  font-size: 25px;
  font-weight: 900;
}

.cq-success-heading p {
  color: #dbeafe;
}

.cq-success-trophy {
  display: block;
  font-size: 42px;
}

.cq-success-board {
  margin: 20px auto;
  padding: 12px;
  border: 1px solid #829cff88;
  border-radius: 18px;
  background: #09152b;
}

.cq-success-board .cq-code-puzzle-board {
  max-width: 560px;
  margin: auto;
}

.cq-success-board .cq-code-puzzle-tile {
  cursor: default;
}

.cq-success-stats {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 18px 0;
}

.cq-success-stats > div {
  flex: 1;
  padding: 13px 8px;
  border: 1px solid #7185ff77;
  border-radius: 14px;
  background: #101d38;
}

.cq-success-stats span {
  display: block;
  color: #b9c8e8;
  font-size: 10px;
  letter-spacing: 1px;
}

.cq-success-stats strong {
  display: block;
  margin-top: 5px;
  color: #a7f3d0;
  font-size: 22px;
}

.cq-success-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 20px;
}

.cq-success-actions .cq-btn {
  flex: 1;
  max-width: 220px;
  min-height: 48px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  background: linear-gradient(135deg, #344f91, #51418a);
  border: 1px solid #9aafff;
}

.cq-success-actions .cq-btn.primary {
  background: linear-gradient(135deg, #0d9f83, #08766e);
  border-color: #5eead4;
}

@media(max-width:480px) {
  .cq-puzzle-success {
    padding: 15px 10px;
  }

  .cq-success-stats {
    gap: 8px;
  }

  .cq-success-actions {
    gap: 9px;
  }
}








@media(min-width:700px){}
@media(max-width:480px){#game-modal.modal-backdrop{padding:5px}#game-modal .modal-card{padding:12px;border-radius:15px;max-height:97vh}.game-actions{position:sticky;bottom:-12px;background:#111a30;padding:8px 0 2px}}


/* CodeQuest v1.0 Learning Hub — additive styles; v0.4 theme retained */
.cq-platform{margin-top:30px}.cq-feature-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}
.cq-feature{min-height:145px;padding:17px 14px;border:1px solid #344461;border-radius:18px;background:linear-gradient(145deg,#192a48,#111b30);color:var(--text);text-align:left;display:flex;flex-direction:column;gap:8px;cursor:pointer;transition:.18s}
.cq-feature:hover{transform:translateY(-3px);border-color:#5eead4;box-shadow:0 12px 28px #0003}.cq-feature>span{font-size:29px}.cq-feature strong{font-size:14px}.cq-feature small{font-size:11px;line-height:1.5;color:var(--muted)}.feature-slide{background:linear-gradient(145deg,#1d3d65,#14213a);border-color:#3b82f6}
.cq-progress-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:14px}.cq-progress-strip>div{background:#101a2e;border:1px solid var(--line);border-radius:14px;padding:12px}.cq-progress-strip strong,.cq-progress-strip small{display:block}.cq-progress-strip strong{font-size:18px;color:#a7f3d0}.cq-progress-strip small{font-size:10px;color:var(--muted);margin-top:4px}
.cq-modal-backdrop{position:fixed;inset:0;z-index:60;background:#050816eF;backdrop-filter:blur(8px);display:flex;align-items:flex-start;justify-content:center;padding:12px;overflow:auto}.cq-modal-card{width:min(1000px,100%);max-height:none;margin:auto;background:#111a30;border:1px solid #344461;border-radius:22px;padding:22px;box-shadow:var(--shadow)}.cq-modal-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:16px}.cq-modal-head h2{margin:4px 0 0;font-size:23px}.cq-toolbar{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.cq-toolbar select,.cq-toolbar input,.cq-editor,.cq-modal-card textarea{background:#081426;border:1px solid #405575;color:#e8f1ff;border-radius:10px;padding:10px;font:inherit}.cq-btn{border:1px solid #496184;border-radius:11px;padding:10px 14px;background:#203653;color:#f5fbff;font-weight:800;cursor:pointer}.cq-btn.primary{background:linear-gradient(120deg,#0f9f82,#087e70);border-color:#34d3b1}.cq-btn:disabled{opacity:.45;cursor:not-allowed}.cq-card{background:#182641;border:1px solid #2b3c5e;border-radius:16px;padding:15px;margin:12px 0}.cq-question{font-size:16px;font-weight:800;line-height:1.6}.cq-options{display:grid;gap:9px;margin-top:12px}.cq-option{width:100%;text-align:left;background:#101a2e;color:#e8f1ff;border:1px solid #405575;border-radius:12px;padding:12px;font-size:13px}.cq-option.selected{border-color:#5eead4;background:#0c3939}.cq-result{margin-top:12px;border-radius:12px;padding:13px;background:#0b2929;border:1px solid #2b806f;line-height:1.7;font-size:13px}.cq-code{display:block;white-space:pre-wrap;overflow-wrap:anywhere;background:#07111e;color:#a7f3d0;border-radius:11px;padding:13px;font:13px/1.65 ui-monospace,monospace;overflow:auto}.cq-puzzle-board{display:grid;gap:4px;width:min(100%,650px);margin:14px auto;padding:5px;border-radius:15px;background:#07111e}.cq-puzzle-tile,.cq-puzzle-empty{aspect-ratio:1;min-width:0;position:relative;border:1px solid #d1f3ff;border-radius:7px;overflow:hidden;background-repeat:no-repeat;padding:0}.cq-puzzle-tile{cursor:pointer;box-shadow:inset 0 0 0 1px #0003}.cq-puzzle-tile:after{content:attr(data-piece);position:absolute;left:2px;right:2px;bottom:2px;background:#06101eea;color:#e8fff8;border-radius:5px;padding:3px;font:700 clamp(9px,2vw,14px)/1.25 ui-monospace,monospace;text-align:center;white-space:nowrap;overflow:hidden;letter-spacing:normal;word-break:normal}.cq-puzzle-board.picture-only .cq-puzzle-tile:after{display:none}.cq-puzzle-empty{background:#17243b;border:2px dashed #64748b}.cq-scene-picker{display:flex;gap:8px;overflow-x:auto;padding:5px 0}.cq-scene{flex:0 0 82px;border:2px solid transparent;border-radius:12px;background:#243a57;color:white;padding:4px;font-size:10px}.cq-scene.active{border-color:#fbbf24}.cq-scene img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:8px}.cq-editor{width:100%;min-height:170px;resize:vertical;font:13px/1.6 ui-monospace,monospace;tab-size:4}.cq-output{min-height:52px;white-space:pre-wrap;background:#07111e;color:#bbf7d0;border:1px solid #31516b;border-radius:11px;padding:12px;font:13px/1.6 ui-monospace,monospace}.cq-flow{display:flex;flex-direction:column;align-items:center;gap:8px;padding:12px}.cq-flow-node{padding:12px 18px;background:#183d54;border:2px solid #5eead4;border-radius:13px;text-align:center;min-width:160px;font-weight:800}.cq-flow-node.decision{border-radius:3px 18px 3px 18px;background:#4b3265;border-color:#c4b5fd}.cq-flow-arrow{color:#fbbf24;font-size:23px}.cq-tabs{display:flex;gap:7px;overflow:auto;padding:4px 0}.cq-tab{white-space:nowrap;border:1px solid #405575;background:#101a2e;color:#dbeafe;padding:9px 12px;border-radius:10px}.cq-tab.active{background:#0c4a50;border-color:#5eead4}.cq-project-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.cq-project{background:#172640;border:1px solid #344461;border-radius:13px;padding:13px}.cq-project h3{font-size:14px;margin:0 0 6px}.cq-project p{font-size:11px;color:#c1cde0;line-height:1.5}.cq-muted{color:var(--muted);font-size:12px;line-height:1.65}.cq-achievement{display:inline-flex;gap:6px;align-items:center;background:#382e54;border:1px solid #7863a4;border-radius:30px;padding:7px 10px;margin:4px;font-size:11px}.cq-setting-row{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:12px 0;border-bottom:1px solid var(--line)}.cq-setting-row label{font-size:13px}.cq-setting-row input{accent-color:#5eead4;transform:scale(1.2)}
body.cq-light{--bg:#eef4ff;--panel:#fff;--text:#14213a;--muted:#52627a;--line:#d6e0ef;background:#eef4ff;color:#14213a}body.cq-light .cq-modal-card{background:#fff;color:#14213a}body.cq-light .cq-card,body.cq-light .cq-project{background:#f3f7ff;color:#14213a}body.cq-large{font-size:18px}body.cq-large .cq-modal-card{font-size:1.12em}
@media(max-width:800px){.cq-feature-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.cq-modal-card{padding:15px;border-radius:17px}.cq-modal-head h2{font-size:20px}.cq-project-grid{grid-template-columns:1fr}}
@media(max-width:380px){.cq-feature{min-height:132px;padding:13px 11px}.cq-feature strong{font-size:12px}.cq-feature small{font-size:10px}.cq-progress-strip{gap:5px}.cq-progress-strip>div{padding:8px}.cq-progress-strip strong{font-size:15px}}

.cq-achievement-list{display:flex;flex-wrap:wrap;gap:5px;margin-top:10px}


/* Fun Slide separate puzzle modes */

.cq-puzzle-board.code-only {
  background: #101b30;
  padding: 8px;
}

.cq-puzzle-board.code-only .cq-code-tile {
  background: #203653;
  color: #e8f1ff;
  border: 1px solid #5eead4;
  padding: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cq-puzzle-board.code-only .cq-code-tile span {
  display: block;
  width: 100%;
  max-height: 100%;
  overflow: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  text-align: center;
  font: 700 clamp(10px, 2.5vw, 15px)/1.35
        ui-monospace, monospace;
}

.cq-puzzle-board.code-only .cq-code-tile:after {
  display: none;
}

.cq-mode-toolbar .cq-btn.primary {
  border-color: #5eead4;
  background: #087e70;
}


/* New isolated Code Puzzle */
.cq-code-puzzle-board {
  display: grid;
  gap: 7px;
  width: min(100%, 650px);
  margin: 14px auto;
  padding: 8px;
  border-radius: 15px;
  background: #07111e;
}

.cq-code-puzzle-tile,
.cq-code-puzzle-empty {
  aspect-ratio: 1;
  min-width: 0;
  min-height: 65px;
  border-radius: 9px;
  overflow: hidden;
}

.cq-code-puzzle-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px;
  border: 1px solid #5eead4;
  background: #203653;
  color: #e8f1ff;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px #0003;
}

.cq-code-puzzle-tile span {
  display: block;
  width: 100%;
  max-height: 100%;
  overflow: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  text-align: left;
  font: 700 clamp(10px, 2.5vw, 15px)/1.4 ui-monospace, monospace;
  tab-size: 4;
}

.cq-code-puzzle-empty {
  border: 2px dashed #64748b;
  background: #17243b;
}

@media (max-width: 420px) {
  .cq-code-puzzle-board { gap: 4px; padding: 5px; }
  .cq-code-puzzle-tile,
  .cq-code-puzzle-empty { min-height: 55px; }
  .cq-code-puzzle-tile { padding: 4px; }
}


/* Code Puzzle completion celebration */
.cq-puzzle-celebration {
  display: none;
  position: relative;
  min-height: 112px;
  margin: 12px auto 8px;
  padding: 14px 10px;
  overflow: hidden;
  text-align: center;
  border: 1px solid #5eead4;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 45%, #174b59, #101d35 72%);
}
.cq-puzzle-celebration.is-active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: cq-celebration-glow 1s ease-in-out infinite alternate;
}
.cq-celebration-title {
  position: relative;
  z-index: 2;
  color: #a7f3d0;
  font-size: clamp(19px, 4vw, 25px);
  font-weight: 800;
  text-shadow: 0 0 14px #5eead4;
}
.cq-celebration-caption {
  position: relative;
  z-index: 2;
  margin-top: 5px;
  color: #e8f1ff;
  font-size: 13px;
}
.cq-celebration-sparks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.cq-celebration-sparks span {
  position: absolute;
  left: calc(5% + (var(--spark) * 8%));
  top: 55%;
  font-size: 21px;
  animation: cq-spark-burst 1.35s ease-out infinite;
  animation-delay: calc(var(--spark) * -0.11s);
}
@keyframes cq-spark-burst {
  0% { transform: translateY(28px) scale(.35) rotate(0deg); opacity: 0; }
  35% { opacity: 1; }
  100% { transform: translateY(-48px) scale(1.25) rotate(150deg); opacity: 0; }
}
@keyframes cq-celebration-glow {
  from { box-shadow: 0 0 8px #2dd4bf55; }
  to { box-shadow: 0 0 24px #2dd4bfaa; }
}
.cq-puzzle-success .cq-toolbar {
  justify-content: center;
  margin-top: 12px;
}
@media (prefers-reduced-motion: reduce) {
  .cq-puzzle-celebration.is-active,
  .cq-celebration-sparks span { animation: none; }
}



/* CodeQuest Code Puzzle Full Screen Upgrade */
#cq-modal.cq-codepuzzle-fullscreen .cq-modal-card {
  width:100%; max-width:none; height:100dvh; max-height:100dvh;
  margin:0; border:0; border-radius:0;
  padding:clamp(10px,2vw,22px);
  overflow-y:auto;
  background:
    radial-gradient(ellipse at 15% 10%,#493b91 0,transparent 38%),
    radial-gradient(ellipse at 90% 20%,#075b78 0,transparent 35%),
    linear-gradient(145deg,#080f2b,#15143d 52%,#071e35);
}
#cq-modal.cq-codepuzzle-fullscreen .cq-modal-head {
  position:sticky; top:0; z-index:20;
  background:#101638ee;
  backdrop-filter:blur(12px);
}
#cq-modal.cq-codepuzzle-fullscreen #cq-content {
  max-width:1100px; margin:auto;
}
.cq-level-screen {
  min-height:75dvh;
  display:flex; flex-direction:column;
  justify-content:center; gap:25px;
}
.cq-level-hero { text-align:center; padding:20px 8px; }
.cq-level-icon { font-size:65px; }
.cq-level-hero h2 {
  font-size:clamp(24px,5vw,38px);
  color:white; margin:10px 0;
}
.cq-level-hero p { color:#c6d7ff; }
.cq-level-options {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}
.cq-level-card {
  min-width:0; min-height:180px;
  padding:18px 10px;
  border-radius:22px;
  border:1px solid #ffffff55;
  color:white;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  gap:9px; cursor:pointer;
  box-shadow:0 12px 30px #0005;
  transition:transform .2s;
}
.cq-level-card:active { transform:scale(.96); }
.cq-level-card.beginner {
  background:linear-gradient(145deg,#087d70,#164d73);
}
.cq-level-card.intermediate {
  background:linear-gradient(145deg,#7650c8,#344b9b);
}
.cq-level-card.advanced {
  background:linear-gradient(145deg,#b64e77,#593c8e);
}
.cq-level-emoji { font-size:35px; }
.cq-level-card strong { font-size:20px; }
.cq-level-card small { color:#f0edff; text-align:center; }
.cq-level-stars { color:#ffe28a; letter-spacing:4px; }
.cq-puzzle-top-tools {
  display:flex; flex-wrap:wrap;
  justify-content:center; gap:8px;
  margin:10px auto 14px;
}
.cq-puzzle-top-tools .cq-btn {
  border-radius:30px; padding:10px 14px;
  background:linear-gradient(135deg,#253d71,#513d83);
  border-color:#8299e8;
}
.cq-learning-float:empty { display:none; }
.cq-learning-float:not(:empty) {
  position:sticky; top:65px; z-index:15;
  margin:8px auto; max-width:850px;
}
.cq-puzzle-main-card {
  background:linear-gradient(145deg,#172c50dd,#24224ddd);
  border:1px solid #7897d866;
  border-radius:20px;
  padding:clamp(12px,2vw,22px);
}
.cq-puzzle-main-card h3 {
  color:white;
  font-size:clamp(18px,3vw,25px);
}
.cq-puzzle-board {
  width:min(100%,780px);
  gap:7px; padding:8px;
  border-radius:20px;
  background:linear-gradient(145deg,#253d72,#10172e);
  box-shadow:0 15px 35px #0007;
}
.cq-puzzle-tile {
  border-radius:12px;
  border:2px solid #a9d9ff;
  box-shadow:0 5px 12px #0005,inset 0 0 0 1px #fff4;
  transition:transform .15s,filter .15s;
}
.cq-puzzle-tile:active {
  transform:scale(.96);
  filter:brightness(1.25);
}
.cq-puzzle-tile:after {
  border-radius:8px;
  padding:6px 3px;
  background:#07142bea;
  color:#e8f7ff;
}
.cq-puzzle-empty {
  border-radius:12px;
  background:#ffffff0c;
  border:2px dashed #91a9d9;
}
@media(max-width:600px) {
  .cq-level-options { grid-template-columns:1fr; gap:10px; }
  .cq-level-card {
    min-height:105px;
    flex-direction:row;
    flex-wrap:wrap;
    justify-content:flex-start;
    padding:12px 18px;
  }
  .cq-level-card small {
    flex-basis:100%; text-align:left;
  }
  .cq-level-emoji { font-size:27px; }
  .cq-puzzle-top-tools .cq-btn {
    flex:1 1 42%; font-size:11px; padding:9px 5px;
  }
  .cq-puzzle-board { gap:4px; padding:5px; }
}



/* CodeQuest Success Card Upgrade */
.cq-puzzle-success {
  position: relative;
  max-width: 680px;
  margin: 22px auto 18px;
  padding: clamp(20px, 4vw, 32px);
  overflow: hidden;
  text-align: center;
  border: 1px solid #8b9cff;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, #6653a855, transparent 55%),
    linear-gradient(145deg, #172d55, #202047 65%, #123b50);
  box-shadow:
    0 18px 45px #0008,
    inset 0 1px 0 #ffffff24,
    0 0 25px #7185ff33;
  animation: cq-success-enter .45s ease-out both;
}

.cq-puzzle-success h3 {
  margin: 0 0 12px;
  color: #c4b5fd;
  font-size: clamp(21px, 4vw, 28px);
  font-weight: 900;
  text-shadow: 0 0 16px #a78bfa66;
}

.cq-puzzle-success p {
  color: #e0eaff;
  font-size: 14px;
  line-height: 1.7;
}

.cq-puzzle-success p:nth-of-type(2) {
  display: inline-block;
  margin: 12px auto;
  padding: 10px 20px;
  border: 1px solid #5eead4aa;
  border-radius: 14px;
  background: #0b6b6250;
  color: #a7f3d0;
  font-size: 17px;
  font-weight: 900;
}

.cq-puzzle-success .cq-toolbar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

.cq-puzzle-success .cq-btn {
  min-width: 125px;
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 14px;
  transition: transform .18s, box-shadow .18s;
}

.cq-puzzle-success .cq-btn:active {
  transform: scale(.96);
}

.cq-puzzle-success .cq-btn.primary {
  background: linear-gradient(120deg, #0f9f82, #087e70);
  box-shadow: 0 5px 18px #0f9f8255;
}

@keyframes cq-success-enter {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media(max-width:480px) {
  .cq-puzzle-success {
    margin: 16px 0;
    padding: 20px 14px;
    border-radius: 19px;
  }

  .cq-puzzle-success .cq-toolbar {
    gap: 8px;
  }

  .cq-puzzle-success .cq-btn {
    min-width: 0;
    flex: 1;
    padding: 12px 8px;
  }
}

/* CodeQuest: transparent celebration overlay */
.cq-puzzle-main-card {
  position: relative;
}

.cq-puzzle-celebration.is-active {
  position: absolute;
  inset: 85px 10px 45px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  margin: 0;
  padding: 10px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  pointer-events: none;
}

.cq-puzzle-celebration .cq-celebration-title,
.cq-puzzle-celebration .cq-celebration-caption,
.cq-puzzle-celebration .cq-celebration-sparks {
  position: relative;
  z-index: 21;
  text-shadow: 0 2px 12px #000;
}

/* CodeQuest: Dedicated Full-screen Puzzle Success */
#cq-modal.cq-puzzle-success-screen .cq-modal-card {
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: clamp(16px, 4vw, 36px);
  border: 0;
  border-radius: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#cq-modal.cq-puzzle-success-screen .cq-modal-head {
  display: none;
}

#cq-modal.cq-puzzle-success-screen #cq-content {
  width: 100%;
  max-width: 850px;
  margin: auto;
}

.cq-puzzle-success {
  width: 100%;
  max-width: 850px;
  margin: auto;
  padding: clamp(20px, 5vw, 42px);
  text-align: center;
  border: 1px solid #8b9cff;
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 0%, #6653a855, transparent 55%),
    linear-gradient(145deg, #172d55, #202047 65%, #123b50);
  box-shadow: 0 18px 55px #0008, 0 0 30px #7185ff33;
  animation: cq-success-enter .45s ease-out both;
}

.cq-success-trophy {
  font-size: clamp(48px, 9vw, 76px);
  margin-bottom: 8px;
}

.cq-success-heading h3 {
  color: #c4b5fd;
  font-size: clamp(25px, 5vw, 36px);
  margin: 8px 0;
}

.cq-success-heading p {
  color: #e0eaff;
  font-size: 15px;
}

.cq-success-board {
  width: 100%;
  max-width: 530px;
  margin: 24px auto;
}

.cq-success-board .cq-code-puzzle-board {
  width: 100%;
  margin: auto;
}

.cq-success-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 530px;
  margin: 22px auto;
}

.cq-success-stats > div {
  padding: 17px 10px;
  border: 1px solid #7185ff66;
  border-radius: 16px;
  background: #101d3b99;
}

.cq-success-stats span {
  display: block;
  color: #c4d2f5;
  font-size: 11px;
  letter-spacing: 1px;
}

.cq-success-stats strong {
  display: block;
  margin-top: 7px;
  color: #fff;
  font-size: clamp(22px, 5vw, 30px);
}

.cq-success-xp strong {
  color: #6ee7b7;
}

.cq-success-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 24px auto 0;
  max-width: 530px;
}

.cq-success-actions .cq-btn {
  flex: 1;
  min-height: 50px;
  font-size: 16px;
  border-radius: 14px;
}

@media(max-width:480px) {
  #cq-modal.cq-puzzle-success-screen .cq-modal-card {
    padding: 14px;
  }

  .cq-puzzle-success {
    padding: 22px 13px;
    border-radius: 20px;
  }

  .cq-success-actions {
    gap: 9px;
  }
}

/* ===== CodeQuest Premium Code Puzzle Layout ===== */

#cq-modal.cq-codepuzzle-fullscreen {
  padding: 0;
  overflow: hidden;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-modal-card {
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 8px clamp(8px, 2vw, 20px);
}

#cq-modal.cq-codepuzzle-fullscreen .cq-modal-head {
  flex: 0 0 auto;
  margin-bottom: 5px;
  padding: 4px 0;
}

#cq-modal.cq-codepuzzle-fullscreen #cq-content {
  width: 100%;
  max-width: 1100px;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  overflow: hidden;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 3px 0 6px;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-toolbar label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-toolbar select {
  padding: 5px 7px;
  font-size: 12px;
  border-radius: 8px;
}

#cq-modal.cq-codepuzzle-fullscreen #cq-lesson-count {
  font-size: 11px;
  color: #b9c8e8;
  margin-right: auto;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-toolbar .cq-btn,
.cq-puzzle-top-tools .cq-btn {
  padding: 6px 9px;
  border-radius: 9px;
  font-size: 11px;
  line-height: 1.25;
}

.cq-puzzle-top-tools {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin: 0 0 6px;
}

.cq-puzzle-top-tools .cq-btn {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cq-learning-float:not(:empty) {
  position: fixed;
  inset: 0;
  z-index: 100;
  margin: 0;
  max-width: none;
}

.cq-info-backdrop {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: #020617d9;
  backdrop-filter: blur(9px);
}

.cq-info-dialog {
  width: min(100%, 620px);
  max-height: min(75dvh, 600px);
  overflow: auto;
  padding: 16px;
  border: 1px solid #7185b9;
  border-radius: 18px;
  background: linear-gradient(145deg, #172744, #10172f);
  box-shadow: 0 22px 70px #0009;
  color: #f1f5ff;
}

.cq-info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 16px;
}

.cq-info-close {
  flex: 0 0 auto;
  padding: 6px 10px;
}

.cq-info-body {
  font-size: 13px;
  line-height: 1.7;
}

.cq-info-body .cq-code {
  max-height: 55dvh;
  overflow: auto;
  margin: 0;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-puzzle-main-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  margin: 0;
  padding: 7px;
  border-radius: 14px;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-puzzle-main-card h3 {
  flex: 0 0 auto;
  margin: 2px 0 3px;
  font-size: clamp(15px, 2.5vw, 20px);
}

#cq-modal.cq-codepuzzle-fullscreen .cq-puzzle-main-card > .cq-muted {
  flex: 0 0 auto;
  margin: 0 0 4px;
  text-align: center;
  font-size: 10px;
  line-height: 1.35;
}

#cq-modal.cq-codepuzzle-fullscreen #cq-code-board {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: grid;
  place-items: center;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-board {
  width: min(100%, 55dvh, 650px);
  max-height: 100%;
  aspect-ratio: 1;
  margin: 0 auto;
  gap: clamp(3px, 1vw, 7px);
  padding: clamp(4px, 1vw, 8px);
  overflow: hidden;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-tile,
#cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-empty {
  min-height: 0;
  aspect-ratio: 1;
  border-radius: 9px;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-tile {
  padding: 4px;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-tile span {
  font-size: clamp(9px, 2.2vw, 14px);
  line-height: 1.3;
}

#cq-modal.cq-codepuzzle-fullscreen #cq-moves {
  flex: 0 0 auto;
  margin: 4px 0 0;
  font-size: 11px;
}

#cq-modal.cq-codepuzzle-fullscreen #cq-puzzle-result {
  flex: 0 0 auto;
}

@media (max-width: 480px) {
  #cq-modal.cq-codepuzzle-fullscreen .cq-modal-card {
    padding: 5px;
  }

  #cq-modal.cq-codepuzzle-fullscreen .cq-modal-head {
    padding: 2px 0;
  }

  #cq-modal.cq-codepuzzle-fullscreen .cq-modal-head h2 {
    font-size: 16px;
  }

  #cq-modal.cq-codepuzzle-fullscreen .cq-toolbar {
    gap: 4px;
  }

  #cq-modal.cq-codepuzzle-fullscreen .cq-toolbar .cq-btn {
    padding: 5px 6px;
    font-size: 10px;
  }

  .cq-puzzle-top-tools {
    gap: 4px;
  }

  .cq-puzzle-top-tools .cq-btn {
    padding: 6px 3px;
    font-size: 9px;
  }

  #cq-modal.cq-codepuzzle-fullscreen .cq-puzzle-main-card {
    padding: 5px;
  }

  #cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-board {
    width: min(100%, 48dvh, 500px);
  }
}


/* ===== CodeQuest Premium Code Puzzle - Blue Violet ===== */

#cq-modal.cq-codepuzzle-fullscreen {
  background: #080d1c;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-modal-card {
  background:
    radial-gradient(ellipse at 50% -15%, #24376d 0%, transparent 48%),
    linear-gradient(145deg, #0b1226, #080d1b 75%);
}

#cq-modal.cq-codepuzzle-fullscreen .cq-modal-head {
  border-bottom: 1px solid #5269b844;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-modal-head h2 {
  color: #e8edff;
  letter-spacing: .3px;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-toolbar {
  justify-content: center;
  padding: 5px 7px;
  border: 1px solid #5368a544;
  border-radius: 12px;
  background: #111b35cc;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-toolbar select,
#cq-modal.cq-codepuzzle-fullscreen .cq-toolbar .cq-btn {
  border: 1px solid #6078c477;
  background: linear-gradient(145deg, #202f58, #17213e);
  color: #edf2ff;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-puzzle-top-tools .cq-btn {
  min-height: 34px;
  border: 1px solid #7185d988;
  border-radius: 10px;
  background: linear-gradient(135deg, #263e79, #483477);
  color: #f4f5ff;
  font-weight: 700;
  box-shadow: 0 3px 10px #02061766;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-puzzle-top-tools .cq-btn:active,
#cq-modal.cq-codepuzzle-fullscreen .cq-toolbar .cq-btn:active {
  transform: scale(.97);
  filter: brightness(1.2);
}

#cq-modal.cq-codepuzzle-fullscreen .cq-puzzle-main-card {
  border: 1px solid #6279c477;
  border-radius: 17px;
  background:
    radial-gradient(ellipse at 50% 0%, #26376a66, transparent 65%),
    linear-gradient(145deg, #121e3b, #0d152b);
  box-shadow: 0 12px 35px #02061788;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-puzzle-main-card h3 {
  color: #dce6ff;
  letter-spacing: .2px;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-board {
  border: 1px solid #6278c477;
  border-radius: 15px;
  background: linear-gradient(145deg, #1b2b50, #101a32);
  box-shadow: 0 10px 30px #02061799, inset 0 0 18px #7185d911;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-tile {
  border: 1px solid #8ba5ff;
  border-radius: 10px;
  background: linear-gradient(145deg, #354d87, #202f59 75%);
  color: #f4f6ff;
  box-shadow:
    0 4px 9px #02061788,
    inset 0 1px 0 #ffffff25;
  transition: transform .14s ease, filter .14s ease, border-color .14s ease;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-tile:active {
  transform: scale(.96);
  filter: brightness(1.25);
  border-color: #c4b5fd;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-tile span {
  color: #f4f6ff;
  font-weight: 700;
  text-shadow: 0 1px 2px #0008;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-empty {
  border: 2px dashed #8296d988;
  border-radius: 10px;
  background: #080f20aa;
  box-shadow: inset 0 0 15px #0005;
}

#cq-modal.cq-codepuzzle-fullscreen #cq-moves {
  color: #bdcafa;
  font-weight: 700;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-info-backdrop {
  background: #020617e8;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-info-dialog {
  border-color: #8295e5;
  background: linear-gradient(145deg, #1b2b50, #10172f);
  box-shadow: 0 22px 70px #000c;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-info-head {
  color: #e5eaff;
}

@media (max-width: 480px) {
  #cq-modal.cq-codepuzzle-fullscreen .cq-puzzle-main-card {
    border-radius: 12px;
  }

  #cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-tile {
    border-radius: 8px;
  }

  #cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-tile span {
    font-size: clamp(9px, 2.5vw, 13px);
  }
}

/* ===== End Premium Code Puzzle ===== */

/* ===== CodeQuest Premium Home Design v1 ===== */

:root{
  --cq-blue:#60a5fa;
  --cq-violet:#a78bfa;
  --cq-cyan:#67e8f9;
  --cq-glass:rgba(24,35,61,.78);
}

body{
  background:
    radial-gradient(ellipse at 10% 0%,#243b7066,transparent 36%),
    radial-gradient(ellipse at 95% 15%,#552c8560,transparent 32%),
    #090e1c;
}

.app-shell{
  max-width:1180px;
}

.topbar{
  position:sticky;
  top:0;
  z-index:15;
  background:#0b1123eF;
  backdrop-filter:blur(18px);
  border-bottom:1px solid #8195ca25;
}

.brand-mark{
  background:linear-gradient(135deg,#67e8f9,#818cf8 55%,#c084fc);
  box-shadow:0 0 24px #818cf855;
}

.brand strong{
  letter-spacing:.2px;
}

.xp-pill{
  background:linear-gradient(120deg,#facc1520,#f59e0b12);
  border-color:#facc1555;
  box-shadow:0 0 20px #facc1510;
}

.hero{
  min-height:310px;
  margin-top:28px;
  padding:42px;
  border:1px solid #8b9cff40;
  border-radius:30px;
  background:
    radial-gradient(circle at 85% 45%,#8b5cf633,transparent 32%),
    linear-gradient(115deg,#142747,#20234b 58%,#302052);
  box-shadow:0 22px 65px #02061788, inset 0 1px #ffffff12;
}

.hero h1{
  font-size:clamp(32px,5vw,49px);
  background:linear-gradient(100deg,#fff,#bfdbfe 55%,#c4b5fd);
  background-clip:text;
  -webkit-background-clip:text;
  color:transparent;
}

.hero p{
  line-height:1.85;
}

.hero .eyebrow{
  color:#8be9f9;
}

.btn{
  border-radius:13px;
  transition:transform .2s,box-shadow .2s,filter .2s;
}

.btn.primary{
  background:linear-gradient(115deg,#67e8f9,#818cf8 65%,#a78bfa);
  color:#10172a;
  box-shadow:0 8px 25px #6366f144;
}

.btn.primary:hover{
  transform:translateY(-2px);
  box-shadow:0 12px 30px #818cf866;
}

.btn.ghost{
  border-color:#9caedb55;
  background:#ffffff0b;
}

.python-bubble{
  background:linear-gradient(135deg,#67e8f91e,#a78bfa30);
  border-color:#c4b5fd55;
  box-shadow:0 0 65px #818cf844;
}

.float-card{
  background:linear-gradient(145deg,#27395c,#222044);
  border-color:#b5c5ff55;
  box-shadow:0 12px 35px #02061788;
}

.stats-grid{
  gap:15px;
  margin-top:20px;
}

.stat-card{
  min-height:92px;
  background:linear-gradient(145deg,#182844,#111a30);
  border:1px solid #7186b536;
  border-radius:19px;
  box-shadow:0 12px 30px #02061744;
  transition:transform .2s,border-color .2s;
}

.stat-card:hover{
  transform:translateY(-3px);
  border-color:#818cf877;
}

.stat-icon{
  background:linear-gradient(145deg,#60a5fa25,#a78bfa25);
  border:1px solid #93c5fd25;
}

.section-block{
  margin-top:42px;
}

.section-heading{
  margin-bottom:18px;
}

.section-heading h2{
  font-size:25px;
  letter-spacing:-.6px;
}

.section-heading .eyebrow{
  color:#a5b4fc;
}

.mode-grid{
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
}

.mode-card{
  min-height:190px;
  padding:20px;
  overflow:hidden;
  background:linear-gradient(145deg,#192b49,#111a30 75%);
  border:1px solid #667da844;
  border-radius:21px;
  box-shadow:0 12px 30px #02061744;
  transition:transform .22s,border-color .22s,box-shadow .22s;
}

.mode-card:before{
  content:"";
  position:absolute;
  width:120px;
  height:120px;
  right:-45px;
  bottom:-55px;
  border-radius:50%;
  background:radial-gradient(circle,#818cf833,transparent 70%);
  pointer-events:none;
}

.mode-card:hover,
.mode-card.selected{
  transform:translateY(-5px);
  border-color:#818cf899;
  background:linear-gradient(145deg,#20385f,#191b3b);
  box-shadow:0 18px 38px #02061777;
}

.mode-emoji{
  display:grid;
  place-items:center;
  width:48px;
  height:48px;
  margin-bottom:15px;
  border-radius:15px;
  background:linear-gradient(135deg,#60a5fa25,#a78bfa35);
  border:1px solid #93c5fd35;
  font-size:25px;
}

.mode-title{
  font-size:15px;
}

.mode-desc{
  line-height:1.65;
}

.mode-arrow{
  color:#a5b4fc;
}

.cq-platform{
  padding:23px;
  border:1px solid #7186b533;
  border-radius:25px;
  background:linear-gradient(145deg,#121e36dd,#11172bdd);
  box-shadow:0 18px 45px #02061755;
}

.cq-feature-grid{
  gap:13px;
}

.cq-feature{
  min-height:150px;
  padding:19px;
  border:1px solid #7186b544;
  border-radius:19px;
  background:linear-gradient(145deg,#1b2c4b,#131c32);
  box-shadow:0 10px 25px #02061733;
  transition:transform .2s,border-color .2s,box-shadow .2s;
}

.cq-feature:hover{
  transform:translateY(-4px);
  border-color:#8b9cffaa;
  box-shadow:0 15px 32px #02061766;
}

.cq-feature>span{
  display:grid;
  place-items:center;
  width:46px;
  height:46px;
  border-radius:14px;
  background:linear-gradient(135deg,#60a5fa28,#a78bfa35);
  border:1px solid #93c5fd33;
}

.cq-feature strong{
  font-size:14px;
}

.cq-feature small{
  line-height:1.6;
}

.cq-progress-strip>div{
  background:linear-gradient(145deg,#1a2a48,#101a30);
  border-color:#7186b544;
}

.level-card{
  background:linear-gradient(145deg,#192a46,#111a30);
  border-color:#7186b544;
  transition:.2s;
}

.level-card:not(:disabled):hover{
  transform:translateY(-2px);
  border-color:#818cf899;
}

.project-card{
  background:
    radial-gradient(circle at 90% 50%,#8b5cf622,transparent 30%),
    linear-gradient(110deg,#1a2d4d,#171b37);
  border-color:#818cf855;
  box-shadow:0 14px 35px #02061755;
}

.project-icon{
  background:linear-gradient(135deg,#60a5fa30,#a78bfa35);
  border:1px solid #93c5fd33;
}

.code-note{
  background:linear-gradient(110deg,#162a43,#211e40);
  border-color:#818cf844;
}

footer{
  border-top:1px solid #ffffff12;
  margin-top:30px;
}

@media(max-width:900px){
  .mode-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .hero{
    padding:30px;
  }
}

@media(max-width:600px){
  .app-shell{
    padding:0 12px;
  }
  .hero{
    padding:25px 20px;
    border-radius:23px;
  }
  .stats-grid{
    gap:7px;
  }
  .stat-card{
    min-height:83px;
    border-radius:14px;
  }
  .section-block{
    margin-top:31px;
  }
  .section-heading h2{
    font-size:20px;
  }
  .mode-grid{
    gap:10px;
  }
  .mode-card{
    min-height:145px;
    padding:14px;
    border-radius:16px;
  }
  .mode-emoji{
    width:40px;
    height:40px;
    font-size:21px;
    margin-bottom:9px;
  }
  .mode-title{
    font-size:13px;
  }
  .mode-desc{
    font-size:10px;
  }
  .cq-platform{
    padding:13px;
    border-radius:19px;
  }
  .cq-feature{
    min-height:135px;
    padding:13px;
  }
  .cq-feature>span{
    width:39px;
    height:39px;
    font-size:23px;
  }
}

@media(prefers-reduced-motion:reduce){
  .stat-card,.mode-card,.cq-feature,.level-card,.btn{
    transition:none!important;
  }
}

/* ===== End Premium Home Design ===== */

/* ===== Vivid Game Mode Cards ===== */

.mode-card{
  --mode-accent:#67e8f9;
  --mode-glow:#67e8f922;
  position:relative;
  isolation:isolate;
  background:
    radial-gradient(ellipse at 100% 0%,var(--mode-glow),transparent 58%),
    linear-gradient(145deg,#1d3152,#111a30 78%);
  border-color:color-mix(in srgb,var(--mode-accent) 42%,transparent);
  box-shadow:
    inset 0 1px #ffffff12,
    0 12px 30px #02061755;
}

.mode-card:nth-child(1){
  --mode-accent:#5eead4;
  --mode-glow:#2dd4bf44;
}

.mode-card:nth-child(2){
  --mode-accent:#60a5fa;
  --mode-glow:#6366f155;
}

.mode-card:nth-child(3){
  --mode-accent:#fb7185;
  --mode-glow:#f43f5e44;
}

.mode-card:nth-child(4){
  --mode-accent:#c084fc;
  --mode-glow:#a855f744;
}

.mode-card:after{
  content:"";
  position:absolute;
  top:0;
  left:16px;
  right:16px;
  height:3px;
  border-radius:0 0 8px 8px;
  background:linear-gradient(90deg,transparent,var(--mode-accent),transparent);
  opacity:.9;
  pointer-events:none;
}

.mode-card .mode-emoji{
  color:var(--mode-accent);
  background:linear-gradient(135deg,var(--mode-glow),#ffffff0d);
  border:1px solid color-mix(in srgb,var(--mode-accent) 55%,transparent);
  box-shadow:0 0 24px var(--mode-glow);
  transition:transform .25s,box-shadow .25s;
}

.mode-card .mode-title{
  color:#f4f7ff;
}

.mode-card .mode-arrow{
  color:var(--mode-accent);
  transition:transform .2s;
}

.mode-card:hover,
.mode-card.selected{
  border-color:var(--mode-accent);
  background:
    radial-gradient(ellipse at 100% 0%,var(--mode-glow),transparent 65%),
    linear-gradient(145deg,#263d63,#171d3b);
  box-shadow:
    inset 0 1px #ffffff20,
    0 15px 38px var(--mode-glow),
    0 12px 30px #02061766;
}

.mode-card:hover .mode-emoji{
  transform:translateY(-3px) scale(1.06);
  box-shadow:0 0 30px var(--mode-glow);
}

.mode-card:hover .mode-arrow{
  transform:translateX(4px);
}

@media(prefers-reduced-motion:reduce){
  .mode-card .mode-emoji,
  .mode-card .mode-arrow{
    transition:none!important;
  }
}

/* ===== End Vivid Game Mode Cards ===== */

/* ===== CodeQuest Vivid Learning Hub Cards ===== */

.cq-feature{
  --hub-accent:#67e8f9;
  --hub-glow:#67e8f922;
  position:relative;
  overflow:hidden;
  background:
    radial-gradient(ellipse at 100% 0%,var(--hub-glow),transparent 65%),
    linear-gradient(145deg,#1b2c4b,#131c32);
  border-color:color-mix(in srgb,var(--hub-accent) 42%,transparent);
  box-shadow:inset 0 1px #ffffff12,0 10px 25px #02061744;
}

.cq-feature:nth-child(1){--hub-accent:#5eead4;--hub-glow:#2dd4bf44}
.cq-feature:nth-child(2){--hub-accent:#60a5fa;--hub-glow:#3b82f644}
.cq-feature:nth-child(3){--hub-accent:#fb7185;--hub-glow:#f43f5e44}
.cq-feature:nth-child(4){--hub-accent:#c084fc;--hub-glow:#a855f744}
.cq-feature:nth-child(5){--hub-accent:#fbbf24;--hub-glow:#f59e0b44}
.cq-feature:nth-child(6){--hub-accent:#34d399;--hub-glow:#10b98144}
.cq-feature:nth-child(7){--hub-accent:#f472b6;--hub-glow:#ec489944}
.cq-feature:nth-child(8){--hub-accent:#a5b4fc;--hub-glow:#818cf844}
.cq-feature:nth-child(9){--hub-accent:#22d3ee;--hub-glow:#06b6d444}

.cq-feature>span{
  color:var(--hub-accent);
  background:linear-gradient(135deg,var(--hub-glow),#ffffff0d);
  border-color:color-mix(in srgb,var(--hub-accent) 55%,transparent);
  box-shadow:0 0 22px var(--hub-glow);
  transition:transform .25s,box-shadow .25s;
}

.cq-feature strong{
  color:#f4f7ff;
}

.cq-feature:hover{
  transform:translateY(-4px);
  border-color:var(--hub-accent);
  background:
    radial-gradient(ellipse at 100% 0%,var(--hub-glow),transparent 70%),
    linear-gradient(145deg,#24385b,#191d3b);
  box-shadow:0 15px 32px var(--hub-glow),0 10px 25px #02061755;
}

.cq-feature:hover>span{
  transform:scale(1.07);
  box-shadow:0 0 30px var(--hub-glow);
}

@media(prefers-reduced-motion:reduce){
  .cq-feature,.cq-feature>span{
    transition:none!important;
  }
}

/* ===== End Vivid Learning Hub Cards ===== */

/* ===== CodeQuest Realistic Code Puzzle Buttons v1 ===== */

#cq-modal.cq-codepuzzle-fullscreen .cq-toolbar .cq-btn,
#cq-modal.cq-codepuzzle-fullscreen .cq-puzzle-top-tools .cq-btn {
  min-height: 38px;
  padding: 8px 11px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: .15px;
  border: 1px solid #91a7f0aa;
  border-radius: 11px;
  background: linear-gradient(145deg, #354f91 0%, #293c70 48%, #202d55 100%);
  color: #f7f8ff;
  box-shadow:
    0 4px 0 #111b38,
    0 6px 13px #02061788,
    inset 0 1px 0 #ffffff35,
    inset 0 -1px 0 #101a38aa;
  text-shadow: 0 1px 2px #080d20aa;
  transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-toolbar .cq-btn:hover,
#cq-modal.cq-codepuzzle-fullscreen .cq-puzzle-top-tools .cq-btn:hover {
  filter: brightness(1.18);
  border-color: #b8c8ff;
  box-shadow:
    0 4px 0 #111b38,
    0 8px 18px #536fe855,
    inset 0 1px 0 #ffffff55;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-toolbar .cq-btn:active,
#cq-modal.cq-codepuzzle-fullscreen .cq-puzzle-top-tools .cq-btn:active {
  transform: translateY(3px);
  box-shadow:
    0 1px 0 #111b38,
    0 2px 5px #02061788,
    inset 0 2px 5px #080d2044;
  filter: brightness(1.12);
}

#cq-modal.cq-codepuzzle-fullscreen .cq-toolbar .cq-btn:disabled,
#cq-modal.cq-codepuzzle-fullscreen .cq-puzzle-top-tools .cq-btn:disabled {
  opacity: .48;
  box-shadow: none;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  #cq-modal.cq-codepuzzle-fullscreen .cq-toolbar .cq-btn {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 12px;
  }

  #cq-modal.cq-codepuzzle-fullscreen .cq-puzzle-top-tools .cq-btn {
    min-height: 38px;
    padding: 7px 4px;
    font-size: 11px;
    letter-spacing: 0;
  }
}

/* ===== End Realistic Button Upgrade ===== */


/* ===== Code Puzzle Top Buttons - Mobile Width Fix ===== */
@media (max-width: 480px) {
  #cq-modal.cq-codepuzzle-fullscreen .cq-puzzle-top-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  #cq-modal.cq-codepuzzle-fullscreen .cq-puzzle-top-tools .cq-btn {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 8px 6px;
    font-size: 12px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.35;
  }
}
/* ===== End Mobile Width Fix ===== */


/* ===== Code Puzzle: Remove Delayed Press Effect ===== */
#cq-modal.cq-codepuzzle-fullscreen .cq-toolbar .cq-btn:active,
#cq-modal.cq-codepuzzle-fullscreen .cq-puzzle-top-tools .cq-btn:active {
  transform: none !important;
  box-shadow:
    0 4px 0 #111b38,
    0 6px 13px #02061788,
    inset 0 1px 0 #ffffff35,
    inset 0 -1px 0 #101a38aa !important;
}
/* ===== End Press Effect Removal ===== */


/* ===== Fully Disable Code Puzzle Button Press Animation ===== */
#cq-modal.cq-codepuzzle-fullscreen .cq-toolbar .cq-btn,
#cq-modal.cq-codepuzzle-fullscreen .cq-puzzle-top-tools .cq-btn {
  transition: none !important;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-toolbar .cq-btn:active,
#cq-modal.cq-codepuzzle-fullscreen .cq-puzzle-top-tools .cq-btn:active {
  transform: none !important;
  filter: none !important;
  box-shadow:
    0 4px 0 #111b38,
    0 6px 13px #02061788,
    inset 0 1px 0 #ffffff35,
    inset 0 -1px 0 #101a38aa !important;
}
/* ===== End Press Animation Removal ===== */


/* ===== Code Puzzle: Static 3D Buttons Only ===== */
#cq-modal.cq-codepuzzle-fullscreen .cq-toolbar .cq-btn,
#cq-modal.cq-codepuzzle-fullscreen .cq-puzzle-top-tools .cq-btn {
  transform: none !important;
  transition: none !important;
  -webkit-tap-highlight-color: transparent !important;
  touch-action: manipulation;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-toolbar .cq-btn:active,
#cq-modal.cq-codepuzzle-fullscreen .cq-puzzle-top-tools .cq-btn:active,
#cq-modal.cq-codepuzzle-fullscreen .cq-toolbar .cq-btn:focus,
#cq-modal.cq-codepuzzle-fullscreen .cq-puzzle-top-tools .cq-btn:focus {
  transform: none !important;
  filter: none !important;
  box-shadow:
    0 4px 0 #111b38,
    0 6px 13px #02061788,
    inset 0 1px 0 #ffffff35,
    inset 0 -1px 0 #101a38aa !important;
}
/* ===== End Static 3D Buttons ===== */

/* ===== CodeQuest Game Arena Background v1 ===== */

#cq-modal.cq-codepuzzle-fullscreen {
  background:
    radial-gradient(ellipse at 15% 15%, #243c8066 0%, transparent 42%),
    radial-gradient(ellipse at 85% 75%, #542d8060 0%, transparent 43%),
    linear-gradient(145deg, #080d20 0%, #10152d 48%, #0a1023 100%);
}

#cq-modal.cq-codepuzzle-fullscreen .cq-modal-card {
  background:
    radial-gradient(ellipse at 50% 0%, #354d9166 0%, transparent 48%),
    radial-gradient(ellipse at 100% 100%, #492d7650 0%, transparent 42%),
    linear-gradient(145deg, #0d1730 0%, #10152b 55%, #0a1022 100%);
  border-color: #7185d955;
  box-shadow:
    0 0 35px #304b9a22,
    0 18px 55px #020617aa;
}

/* ===== End Game Arena Background ===== */


/* ===== Game Arena Background Force Fix ===== */

#cq-modal.cq-codepuzzle-fullscreen .cq-modal-card {
  background:
    radial-gradient(ellipse at 12% 12%, #344f9c88 0%, transparent 43%),
    radial-gradient(ellipse at 88% 78%, #713e9b66 0%, transparent 45%),
    linear-gradient(145deg, #080d20 0%, #151b3b 50%, #090f24 100%) !important;
  border: 1px solid #7185d955 !important;
  box-shadow: 0 0 45px #526bdb33, 0 18px 55px #020617aa !important;
}

#cq-modal.cq-codepuzzle-fullscreen {
  background: #080d20 !important;
}

/* ===== End Game Arena Background Force Fix ===== */


/* ===== TEMP BACKGROUND VISIBILITY TEST ===== */
#cq-modal.cq-codepuzzle-fullscreen .cq-modal-card {
  background: linear-gradient(135deg, #173fc4 0%, #7028b8 50%, #075985 100%) !important;
}
#cq-modal.cq-codepuzzle-fullscreen #cq-content {
  background: transparent !important;
}
/* ===== END VISIBILITY TEST ===== */


/* ===== CodeQuest Premium Game Arena v2 ===== */

#cq-modal.cq-codepuzzle-fullscreen .cq-modal-card {
  background:
    radial-gradient(ellipse at 12% 8%, #3155a966 0%, transparent 42%),
    radial-gradient(ellipse at 90% 85%, #693c9660 0%, transparent 45%),
    linear-gradient(145deg, #080f25 0%, #121b38 52%, #090e21 100%) !important;
  border: 1px solid #7185d955 !important;
  box-shadow:
    0 0 45px #526bdb33,
    0 18px 55px #020617aa !important;
}

#cq-modal.cq-codepuzzle-fullscreen #cq-content {
  background: transparent !important;
}

/* ===== End Premium Game Arena v2 ===== */


/* ===== CodeQuest Premium Puzzle Tiles v1 ===== */

#cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-board {
  padding: 12px;
  gap: 9px;
  border: 1px solid #718cff88;
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 50% 0%, #354b8066, transparent 70%),
    linear-gradient(145deg, #101b38, #080f23) !important;
  box-shadow:
    0 12px 30px #02061799,
    inset 0 1px 0 #ffffff12,
    inset 0 0 22px #526bdb18;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-tile {
  min-width: 0;
  min-height: 58px;
  padding: 9px 6px;
  border: 1px solid #91aaff;
  border-radius: 13px;
  background:
    linear-gradient(145deg, #526fba 0%, #344b86 48%, #202f5c 100%);
  color: #ffffff;
  box-shadow:
    0 5px 0 #111d40,
    0 8px 14px #02061799,
    inset 0 1px 0 #ffffff55,
    inset 0 -2px 0 #101b3b88;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-tile span {
  display: block;
  width: 100%;
  color: #ffffff;
  font-family: ui-monospace, monospace;
  font-size: clamp(11px, 2.7vw, 17px);
  font-weight: 800;
  line-height: 1.4;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  text-shadow: 0 1px 3px #000a;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-empty {
  min-width: 0;
  min-height: 58px;
  border: 2px dashed #829cff99;
  border-radius: 13px;
  background:
    radial-gradient(circle, #526bdb20, transparent 70%),
    #070d1eaa;
  box-shadow: inset 0 3px 15px #020617aa;
}

/* Mobile tile adjustment */
@media (max-width: 480px) {
  #cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-board {
    padding: 8px;
    gap: 6px;
    border-radius: 14px;
  }

  #cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-tile {
    min-height: 52px;
    padding: 7px 3px;
    border-radius: 9px;
  }

  #cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-tile span {
    font-size: clamp(10px, 2.8vw, 15px);
    line-height: 1.3;
  }

  #cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-empty {
    min-height: 52px;
    border-radius: 9px;
  }
}

/* ===== End Premium Puzzle Tiles v1 ===== */


/* ===== Smart Code Tile Text Sizing ===== */

#cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-tile.cq-text-short span {
  font-size: clamp(14px, 3.5vw, 19px);
  letter-spacing: .15px;
}

#cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-tile.cq-text-medium span {
  font-size: clamp(11px, 2.8vw, 15px);
}

#cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-tile.cq-text-long span {
  font-size: clamp(9px, 2.2vw, 12px);
  line-height: 1.2;
  letter-spacing: -.2px;
  overflow-wrap: anywhere;
}

@media (max-width: 480px) {
  #cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-tile.cq-text-short span {
    font-size: clamp(12px, 3.5vw, 16px);
  }

  #cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-tile.cq-text-medium span {
    font-size: clamp(10px, 2.8vw, 13px);
  }

  #cq-modal.cq-codepuzzle-fullscreen .cq-code-puzzle-tile.cq-text-long span {
    font-size: clamp(8px, 2.1vw, 10px);
  }
}

/* ===== End Smart Code Tile Text Sizing ===== */


/* ===== Mobile Success Card Scroll Fix v1 ===== */
@media (max-width: 480px) {
  #cq-modal.cq-codepuzzle-fullscreen.cq-puzzle-success-screen {
    overflow-y: auto !important;
    overflow-x: hidden;
    align-items: flex-start;
    justify-content: flex-start;
  }

  #cq-modal.cq-codepuzzle-fullscreen.cq-puzzle-success-screen .cq-modal-card {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: hidden;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }

  #cq-modal.cq-codepuzzle-fullscreen.cq-puzzle-success-screen #cq-content {
    flex: 0 0 auto;
    width: 100%;
  }

  #cq-modal.cq-codepuzzle-fullscreen.cq-puzzle-success-screen .cq-puzzle-success {
    flex: 0 0 auto;
    margin: 0 auto;
  }

  #cq-modal.cq-codepuzzle-fullscreen.cq-puzzle-success-screen .cq-success-actions {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}
/* ===== End Mobile Success Card Scroll Fix ===== */










/* ===== Mobile Success Actions Fixed Bottom v2 ===== */
@media (max-width: 480px) {
  #cq-modal.cq-codepuzzle-fullscreen.cq-puzzle-success-screen
  .cq-puzzle-success {
    padding-bottom: calc(105px + env(safe-area-inset-bottom)) !important;
  }

  #cq-modal.cq-codepuzzle-fullscreen.cq-puzzle-success-screen
  .cq-success-actions {
    position: fixed !important;
    left: 50%;
    bottom: calc(70px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 9999;
    width: calc(100% - 24px);
    max-width: 530px;
    box-sizing: border-box;
    margin: 0 !important;
    padding: 12px 10px;
    border: 1px solid #7185d977;
    border-radius: 16px;
    background: linear-gradient(
      180deg,
      #17213cf5,
      #080f25
    );
    box-shadow: 0 0 24px #020617bb;
  }
}
/* ===== End Mobile Success Actions Fixed Bottom ===== */


/* ===== CodeQuest Learning Path v2 ===== */
.cq-learning-progress{height:8px;background:var(--cq-border,#334155);border-radius:20px;overflow:hidden;margin:12px 0}
.cq-learning-progress span{display:block;height:100%;background:linear-gradient(90deg,#38bdf8,#818cf8);border-radius:20px}
.cq-learning-lesson{margin-top:18px;display:grid;gap:12px}
.cq-learning-summary{padding:18px;border-radius:16px;background:linear-gradient(135deg,#172554,#17213c);border:1px solid #6475b455}
.cq-learning-summary>span{font-size:.78rem;opacity:.8}
.cq-learning-summary h3{margin:8px 0;font-size:1.25rem}
.cq-learning-summary p{margin:0;line-height:1.6}
.cq-learning-section{padding:15px;border:1px solid var(--cq-border,#334155);border-radius:14px;background:var(--cq-card,rgba(30,41,59,.55));min-width:0}
.cq-learning-section h4{margin:0 0 10px;font-size:1rem}
.cq-learning-section p,.cq-learning-section li{line-height:1.7;overflow-wrap:anywhere}
.cq-learning-section pre{max-width:100%;overflow-x:auto;white-space:pre}
.cq-line-notes{padding-left:24px;display:grid;gap:12px}
.cq-line-notes li code{display:block;white-space:pre-wrap;overflow-wrap:anywhere;margin-bottom:5px}
.cq-line-notes li span{display:block;line-height:1.6;opacity:.9}
.cq-learning-actions,.cq-learning-practice{display:flex;flex-wrap:wrap;gap:9px}
.cq-learning-lesson>h4{margin:8px 0 0}
.cq-learning-practice{padding-bottom:12px}
@media(max-width:600px){
 .cq-learning-section{padding:12px}
 .cq-learning-summary{padding:15px}
 .cq-line-notes{padding-left:20px}
 .cq-learning-practice .cq-btn{flex:1 1 135px}
}
/* ===== End CodeQuest Learning Path v2 ===== */



/* ===== Learning Lesson Dedicated Scroll Fix ===== */
#cq-modal.cq-learning-view {
  overflow: hidden;
  align-items: flex-start;
  justify-content: center;
}
#cq-modal.cq-learning-view .cq-modal-card {
  height: calc(100vh - 24px);
  height: calc(100dvh - 24px);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0 auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
/* ===== End Learning Lesson Dedicated Scroll Fix ===== */

/* ===== MCQ Learning System v2 ===== */
.cq-mcq-dashboard,.cq-mcq-lesson{display:grid;gap:14px}
.cq-mcq-hero{display:flex;gap:14px;align-items:center;padding:17px;border:1px solid #356b78;border-radius:17px;background:linear-gradient(120deg,#123b4c,#18304c)}
.cq-mcq-hero>span{font-size:35px}
.cq-mcq-hero h3{margin:0 0 6px;font-size:17px}
.cq-mcq-hero p,.cq-mcq-stage-head p{margin:0;color:#c5d5e8;font-size:12px;line-height:1.6}
.cq-mcq-overview{display:grid;grid-template-columns:auto 1fr;gap:4px 12px;align-items:center;padding:13px;background:#182641;border:1px solid #344461;border-radius:14px}
.cq-mcq-overview strong{font-size:22px;color:#5eead4}
.cq-mcq-overview span{font-size:12px;color:#c5d5e8}
.cq-mcq-overview .cq-mcq-progress{grid-column:1/-1}
.cq-mcq-stage{padding:14px;border:1px solid #344461;border-radius:16px;background:#111d32}
.cq-mcq-stage-head{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:12px}
.cq-mcq-stage-head h3{margin:4px 0;font-size:17px}
.cq-mcq-stage-head>strong{font-size:17px;color:#5eead4}
.cq-mcq-stage-tag{font-size:9px;letter-spacing:1.4px;color:#5eead4;font-weight:900}
.cq-mcq-chapters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.cq-mcq-chapter{min-width:0;text-align:left;padding:12px;background:#1b2b45;border:1px solid #405575;border-radius:12px;color:#e8f1ff;cursor:pointer}
.cq-mcq-chapter-top{display:flex;justify-content:space-between;gap:8px;align-items:start}
.cq-mcq-chapter-top strong{font-size:13px}
.cq-mcq-chapter-top>span{font-size:11px;color:#5eead4;white-space:nowrap}
.cq-mcq-chapter .cq-muted{display:block;margin:7px 0}
.cq-mcq-chapter small{font-size:10px;color:#9fb2ca}
.cq-mcq-progress{height:7px;background:#081426;border-radius:20px;overflow:hidden}
.cq-mcq-progress i{display:block;height:100%;background:linear-gradient(90deg,#0f9f82,#5eead4);border-radius:20px}
.cq-mcq-breadcrumb{font-size:11px;color:#5eead4;font-weight:800}
.cq-mcq-goals{padding:12px 14px;background:#142a3d;border:1px solid #31516b;border-radius:12px;font-size:12px}
.cq-mcq-goals ul{margin:7px 0 0;padding-left:20px;line-height:1.8}
.cq-mcq-question-head{display:flex;justify-content:space-between;gap:10px;align-items:center;color:#5eead4;font-size:11px;font-weight:800}
.cq-mcq-question{padding:15px;background:#1b2b45;border:1px solid #405575;border-radius:13px;font-size:17px;font-weight:850;line-height:1.65}
.cq-mcq-hint{padding:12px;border:1px dashed #b68b43;background:#352d1e;color:#ffe4a6;border-radius:11px;font-size:12px;line-height:1.7}
.cq-mcq-footer{display:flex;justify-content:flex-start;gap:8px;flex-wrap:wrap}
.cq-mcq-complete{text-align:center;padding:22px}
.cq-mcq-complete h3{margin-top:0}
.cq-mcq-complete .cq-btn{margin:5px}
.cq-mcq-chapter:focus-visible,.cq-option:focus-visible{outline:2px solid #5eead4;outline-offset:2px}
.cq-mcq-chapter:disabled,.cq-option:disabled{opacity:.75;cursor:default}
body.cq-light .cq-mcq-stage,body.cq-light .cq-mcq-overview,body.cq-light .cq-mcq-chapter,body.cq-light .cq-mcq-question{background:#f3f7ff;color:#14213a}
body.cq-light .cq-mcq-hero{background:#e5f4f8}
body.cq-light .cq-mcq-hero p,body.cq-light .cq-mcq-stage-head p{color:#405575}
@media(max-width:600px){
 .cq-mcq-chapters{grid-template-columns:1fr}
 .cq-mcq-hero{align-items:flex-start;padding:13px}
 .cq-mcq-hero>span{font-size:28px}
 .cq-mcq-question{font-size:15px}
 .cq-mcq-stage{padding:11px}
}
/* ===== End MCQ Learning System v2 ===== */


/* ===== MCQ Dedicated Result Page ===== */
.cq-mcq-result-page{display:grid;gap:14px;min-height:45vh;align-content:start}
.cq-mcq-feedback{padding:20px;border-radius:17px}
.cq-mcq-feedback h3{margin:8px 0 14px;font-size:20px}
.cq-mcq-feedback-icon{font-size:38px;text-align:center}
.cq-mcq-success{border:1px solid #238b72;background:#102e32}
.cq-mcq-retry{border:1px solid #b68b43;background:#352d1e}
.cq-mcq-result-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
.cq-mcq-result-actions .cq-btn{flex:1;min-width:125px}
body.cq-light .cq-mcq-success{background:#e8f8f1;color:#173b32}
body.cq-light .cq-mcq-retry{background:#fff7e5;color:#493718}
@media(max-width:600px){
  .cq-mcq-feedback{padding:15px}
  .cq-mcq-result-actions{display:grid;grid-template-columns:1fr}
}
 /* ===== End MCQ Dedicated Result Page ===== */


/* ===== Code Puzzle Full-screen Star Celebration + Success Close ===== */
.cq-puzzle-celebration.is-active {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10000 !important;
  display: block !important;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  pointer-events: none !important;
}

.cq-puzzle-celebration .cq-celebration-sparks {
  position: absolute !important;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.cq-puzzle-celebration .cq-celebration-sparks span {
  position: absolute;
  left: var(--star-x);
  top: var(--star-y);
  color: #fff4a8;
  font-size: var(--star-size);
  line-height: 1;
  text-shadow: 0 0 7px #fff, 0 0 16px #facc15, 0 0 28px #a78bfa;
  animation: cq-fullscreen-star 1.7s ease-in-out var(--star-delay) infinite;
  will-change: transform, opacity, filter;
}

.cq-puzzle-celebration .cq-celebration-title,
.cq-puzzle-celebration .cq-celebration-caption {
  position: absolute !important;
  left: 50%;
  z-index: 2;
  width: min(90%, 520px);
  margin: 0;
  text-align: center;
  transform: translateX(-50%);
  text-shadow: 0 2px 18px #000, 0 0 22px #a78bfa;
}

.cq-puzzle-celebration .cq-celebration-title {
  top: 42%;
  color: #fde68a;
  font-size: clamp(30px, 7vw, 52px);
  font-weight: 900;
  animation: cq-star-title 0.8s ease-in-out infinite alternate;
}

.cq-puzzle-celebration .cq-celebration-caption {
  top: 53%;
  color: #fff;
  font-size: clamp(15px, 3.8vw, 22px);
  font-weight: 800;
}

@keyframes cq-fullscreen-star {
  0%, 100% {
    opacity: .18;
    transform: scale(.45) rotate(0deg);
    filter: brightness(.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.45) rotate(35deg);
    filter: brightness(1.8);
  }
}

@keyframes cq-star-title {
  from { text-shadow: 0 2px 12px #000, 0 0 12px #facc15; }
  to { text-shadow: 0 2px 18px #000, 0 0 30px #facc15, 0 0 42px #a78bfa; }
}

.cq-puzzle-success {
  position: relative;
}

.cq-success-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #a5b4fc88;
  border-radius: 13px;
  background: #101d3bee;
  color: #fff;
  font-size: 29px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 14px #0005;
}

.cq-success-close:active {
  transform: scale(.93);
}

@media (max-width: 480px) {
  .cq-success-close {
    top: 8px;
    right: 8px;
    width: 38px;
    height: 38px;
  }
}
/* ===== End Code Puzzle Celebration + Success Close ===== */

/* Code Builder 2.0 — Common Tray */
.cq-b2{color:var(--text,#202124);display:block;width:100%;font-size:14px}
.cq-b2 button{font:inherit;cursor:pointer}
.cq-b2-hero{display:flex;gap:13px;align-items:center;padding:15px;border-radius:15px;background:var(--card,#f3f4f6);margin:10px 0}
.cq-b2-hero-icon{font-size:34px}
.cq-b2 h3,.cq-b2 h4{margin:5px 0 8px}
.cq-b2 p{line-height:1.55;margin:5px 0}
.cq-b2-progress{padding:12px;border:1px solid var(--border,#ddd);border-radius:13px;margin:12px 0}
.cq-b2-progress strong{font-size:22px;margin-right:8px}
.cq-b2-progress div{height:7px;border-radius:9px;background:var(--border,#ddd);overflow:hidden;margin-top:9px}
.cq-b2-progress i{display:block;height:100%;background:var(--accent,#3978d6);border-radius:9px}
.cq-b2-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.cq-b2-module{display:flex;flex-direction:column;align-items:flex-start;text-align:left;gap:7px;padding:13px;border:1px solid var(--border,#ddd);border-radius:14px;background:var(--card,#fff);color:inherit;min-width:0}
.cq-b2-module:active,.cq-b2-level:active,.cq-b2-block:active{transform:scale(.985)}
.cq-b2-icon{font-size:26px}
.cq-b2-module strong{font-size:14px}
.cq-b2-module small,.cq-b2-level small{opacity:.75;line-height:1.4}
.cq-b2-count{font-size:12px;font-weight:700;color:var(--accent,#3978d6)}
.cq-b2-foot{opacity:.7;font-size:12px;margin-top:13px!important}
.cq-b2-back{border:0;background:transparent;color:var(--accent,#3978d6);padding:8px 2px;margin:0 0 8px}
.cq-b2-module-head{display:flex;gap:12px;align-items:center;padding:12px 0}
.cq-b2-module-head>span{font-size:30px}
.cq-b2-levels{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.cq-b2-level{display:flex;align-items:center;gap:9px;text-align:left;padding:12px;border:1px solid var(--border,#ddd);border-radius:12px;background:var(--card,#fff);color:inherit;min-width:0}
.cq-b2-level>span{display:grid;place-items:center;width:28px;height:28px;flex:0 0 28px;border-radius:50%;background:var(--border,#eee);font-weight:700}
.cq-b2-level strong{font-size:13px;flex:1}
.cq-b2-level small{font-size:10px}
.cq-b2-task{display:flex;gap:10px;padding:12px;border-radius:12px;background:var(--card,#f3f4f6);margin:10px 0 15px}
.cq-b2-task>span{font-size:23px}
.cq-b2-code{min-height:65px;padding:10px;border:1px dashed var(--border,#aaa);border-radius:12px;background:var(--card,#f8f8f8);display:flex;flex-direction:column;gap:6px}
.cq-b2-empty{opacity:.65;font-size:12px}
.cq-b2-chosen,.cq-b2-block{display:flex;align-items:center;gap:9px;width:100%;padding:10px;border:1px solid var(--border,#ddd);border-radius:9px;background:var(--card,#fff);color:inherit;text-align:left}
.cq-b2-chosen b{display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--border,#eee);font-size:11px}
.cq-b2-chosen code,.cq-b2-block code{white-space:pre-wrap;overflow-wrap:anywhere;flex:1;font-size:12px}
.cq-b2-chosen>span,.cq-b2-block>span{opacity:.65}
.cq-b2-blocks{display:grid;gap:7px;margin:8px 0 14px}
.cq-b2-actions,.cq-b2-nav{display:flex;flex-wrap:wrap;gap:7px;margin:12px 0}
.cq-b2-primary,.cq-b2-secondary{padding:10px 13px;border-radius:10px;border:1px solid var(--border,#ccc)}
.cq-b2-primary{background:var(--accent,#3978d6);color:white;border-color:transparent}
.cq-b2-secondary{background:var(--card,#fff);color:inherit}
.cq-b2-notice{white-space:pre-wrap;padding:10px;border-radius:10px;background:var(--card,#f4e8d8);margin:10px 0;font-size:12px}
.cq-b2-success{padding:13px;border:1px solid var(--accent,#3978d6);border-radius:12px;margin:12px 0}
.cq-b2-success pre{white-space:pre-wrap;overflow-wrap:anywhere;padding:10px;border-radius:8px;background:var(--card,#f3f4f6);font-size:12px}
.cq-b2-nav{justify-content:space-between}
@media(max-width:380px){.cq-b2-grid,.cq-b2-levels{grid-template-columns:1fr}.cq-b2-actions button{flex:1}}


/* CODE BUILDER 2.0 FIXES */
.cq-b2 {
  color: #e8f1ff;
  width: 100%;
  line-height: 1.6;
}
.cq-b2 p, .cq-b2 small, .cq-b2 h4 {
  color: #dbeafe;
}
.cq-b2-module, .cq-b2-level,
.cq-b2-block, .cq-b2-chosen,
.cq-b2-secondary {
  color: #f1f5f9;
  background: #182943;
  border-color: #526783;
}
.cq-b2-task, .cq-b2-code,
.cq-b2-success, .cq-b2-notice {
  color: #f1f5f9;
  background: #14243b;
  border-color: #526783;
}
.cq-b2-code, .cq-b2-blocks {
  min-width: 0;
}
.cq-b2 code, .cq-b2 pre {
  color: #a7f3d0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.cq-b2-actions button, .cq-b2-nav button {
  min-height: 42px;
}
#cq-modal:not(.hidden) .cq-modal-card {
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
}
#cq-content {
  min-width: 0;
}
@media (max-width: 520px) {
  .cq-b2-grid, .cq-b2-levels {
    grid-template-columns: 1fr;
  }
  .cq-b2-actions button {
    flex: 1 1 42%;
  }
}


/* Code Builder 2.0 — Completion Page and Output Panel */
.cq-b2-completion {
  padding: 16px 12px;
  text-align: center;
  color: #edf5ff;
}
.cq-b2-completion-icon {font-size:54px;margin:8px 0}
.cq-b2-completion h3 {color:#a7f3d0;font-size:21px;margin:10px 0}
.cq-b2-completion-title {color:#f1f5f9;font-weight:700}
.cq-b2-xp {
  display:inline-block;margin:10px auto 16px;padding:8px 18px;
  border-radius:20px;background:#263d22;color:#d9f99d;font-weight:800;
}
.cq-b2-explanation {
  text-align:left;padding:14px;margin:12px 0;
  border:1px solid #526783;border-radius:12px;background:#172b43;
}
.cq-b2-explanation h4,.cq-b2-output h4 {color:#bfdbfe;margin:0 0 9px}
.cq-b2-explanation p {color:#f1f5f9;margin:0}
.cq-b2-output {
  display:block;width:100%;min-width:0;box-sizing:border-box;
  text-align:left;padding:14px;margin:14px 0;
  border:1px solid #42617d;border-radius:12px;
  background:#071525;color:#f0fdf4;
}
.cq-b2-output pre {
  display:block;width:100%;box-sizing:border-box;margin:0;padding:13px;
  border-radius:9px;background:#020b16 !important;
  color:#a7f3d0 !important;border:1px solid #29445b;
  font-family:monospace;font-size:14px;line-height:1.7;
  white-space:pre-wrap;overflow-wrap:anywhere;overflow-x:auto;
}
.cq-b2-completion-actions {
  display:flex;flex-wrap:wrap;justify-content:center;
  gap:10px;margin-top:18px;
}
.cq-b2-completion-actions button {min-height:44px;flex:1 1 130px}


/* CQ_GUIDED_PROFILE_PROTOTYPE_V1 */
.cq-b2-guided{display:grid;gap:13px;padding-bottom:18px}
.cq-b2-guided-hero{display:flex;gap:12px;align-items:center;padding:14px;border-radius:14px;background:var(--card,#f3f4f6)}
.cq-b2-guided-hero>span{font-size:32px}
.cq-b2-guided-hero p,.cq-b2-guided-section p{margin:6px 0;line-height:1.55}
.cq-b2-guided-section{padding:13px;border:1px solid var(--border,#ddd);border-radius:13px;background:var(--card,#fff);display:grid;gap:10px;min-width:0}
.cq-b2-guided-section h3{margin:0;font-size:16px}
.cq-b2-guided-concept{padding:9px;border-radius:9px;background:var(--bg,#f5f5f5)}
.cq-b2-guided-concept p{margin:4px 0 0;font-size:13px}
.cq-b2-guided-section label{display:grid;gap:5px;font-size:13px;font-weight:600}
.cq-b2-guided-input,.cq-b2-guided-editor{box-sizing:border-box;width:100%;max-width:100%;padding:11px;border:1px solid var(--border,#ccc);border-radius:9px;background:var(--bg,#fff);color:inherit;font:inherit}
.cq-b2-guided-editor{min-height:155px;resize:vertical;font-family:monospace;font-size:13px;line-height:1.6;white-space:pre;tab-size:4}
.cq-b2-guided-primary,.cq-b2-guided-secondary{padding:11px 14px;border:1px solid var(--border,#ccc);border-radius:10px;background:var(--card,#fff);color:inherit;font-weight:700}
.cq-b2-guided-primary{background:var(--accent,#3978d6);border-color:transparent;color:white}
.cq-b2-guided-primary:disabled{opacity:.6}
.cq-b2-guided-feedback{padding:9px;border-radius:9px;font-size:13px}
.cq-b2-guided-feedback.is-good{background:#dcfce7;color:#166534}
.cq-b2-guided-feedback.is-warn{background:#fef3c7;color:#92400e}
.cq-b2-guided-output{padding:11px;border-radius:10px;background:#111827;color:#e5e7eb;min-width:0}
.cq-b2-guided-output pre{white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0 0;font-size:13px}
.cq-b2-guided-explain{margin:0;padding-left:20px;display:grid;gap:9px;font-size:13px;line-height:1.6}
.cq-b2-guided-challenge{display:block;padding:10px;border-radius:8px;background:#111827;color:#e5e7eb;white-space:pre-wrap;overflow-wrap:anywhere}
.cq-b2-guided-foot{font-size:11px;opacity:.7}



/* Independent Python Playground */
.cq-playground{display:flex;flex-direction:column;gap:12px}
.cq-playground .cq-card{margin:0}
.cq-playground-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
.cq-playground .cq-toolbar select,
.cq-playground .cq-library-name,
.cq-playground .cq-editor{
  box-sizing:border-box;width:100%;max-width:100%;min-width:0;
}
.cq-playground .cq-editor{
  display:block;min-height:210px;margin:8px 0;
  resize:vertical;white-space:pre;overflow:auto;
  font:13px/1.65 ui-monospace,SFMono-Regular,Consolas,monospace;
  tab-size:4; -webkit-overflow-scrolling:touch;
}
.cq-playground .cq-input-editor{min-height:76px;white-space:pre-wrap}
.cq-playground .cq-library-name,
.cq-playground select{
  background:#081426;border:1px solid #405575;color:#e8f1ff;
  border-radius:10px;padding:11px;font:inherit;
}
.cq-playground .cq-toolbar{align-items:center}
.cq-playground .cq-toolbar .cq-btn{max-width:100%}
.cq-playground .cq-output{
  min-height:90px;max-height:320px;overflow:auto;
  overflow-wrap:anywhere;white-space:pre-wrap;
}
@media(max-width:480px){
  .cq-playground .cq-editor{min-height:190px;font-size:12px}
  .cq-playground .cq-toolbar>*{flex:1 1 auto}
}


/* Python Playground error console */
.cq-playground .cq-output .cq-console-normal {
  color: #f4f6fb;
}

.cq-playground .cq-output .cq-console-error {
  color: #ff5a64;
}

.cq-playground .cq-output .cq-console-finished {
  color: #f4f6fb;
  font-weight: 600;
}


/* FINAL PYTHON ACADEMY BACK BUTTON FIX */
#cq-modal #cq-learning-back,
#cq-modal #cq-project-back,
#cq-modal #cq-flow-review {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  width: max-content !important;
  max-width: fit-content !important;
  min-width: 0 !important;
  height: 24px !important;
  min-height: 24px !important;
  max-height: 24px !important;
  padding: 0 6px !important;
  margin: 0 0 10px auto !important;
  font-size: 10px !important;
  line-height: 1 !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
  border: 1px solid #496184 !important;
  border-radius: 7px !important;
  background: #203653 !important;
  color: #f5fbff !important;
}


/* Project Lab: independent mobile-friendly project list scrolling */
.cq-project-list {
  max-height: calc(100dvh - 220px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 2px 4px 12px 0;
}

/* Python Academy unified header */
.topbar{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  align-items:center;
  gap:10px;
}
.python-header-back{
  justify-self:start;
  min-height:40px;
  padding:0 13px;
  border:1px solid #8195ca55;
  border-radius:11px;
  background:#ffffff0a;
  color:var(--text);
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}
.topbar > .brand{justify-self:center}
.topbar > .top-actions{justify-self:end}
@media(max-width:420px){
  .topbar{gap:5px}
  .python-header-back{min-height:37px;padding:0 8px;font-size:10px}
  .topbar > .brand{gap:6px}
  .topbar > .brand strong{font-size:13px}
  .topbar > .brand small{font-size:7px;letter-spacing:1px}
  .topbar > .top-actions{gap:4px}
  .topbar .xp-pill{padding:6px 7px;font-size:9px}
  .topbar .top-actions select{max-width:82px;padding:7px 5px;font-size:11px}
}


/* PYTHON ACADEMY IMAGE CARDS v2 */
.mode-grid > .mode-card:nth-child(1){--card-art:url("assets/python-academy/01-python-code-editor.png");}
.mode-grid > .mode-card:nth-child(2){--card-art:url("assets/python-academy/02-code-arrange.png");}
.mode-grid > .mode-card:nth-child(3){--card-art:url("assets/python-academy/03-bug-detective.png");}
.mode-grid > .mode-card:nth-child(4){--card-art:url("assets/python-academy/04-code-puzzle.png");}
.cq-feature-grid > .cq-feature:nth-child(1){--card-art:url("assets/python-academy/05-mcq-quiz.png");}
.cq-feature-grid > .cq-feature:nth-child(2){--card-art:url("assets/python-academy/06-bug-hunter.png");}
.cq-feature-grid > .cq-feature:nth-child(3){--card-art:url("assets/python-academy/07-code-builder.png");}
.cq-feature-grid > .cq-feature:nth-child(4){--card-art:url("assets/python-academy/08-python-playground.png");}
.cq-feature-grid > .cq-feature:nth-child(5){--card-art:url("assets/python-academy/09-flowchart-adventure.png");}
.cq-feature-grid > .cq-feature:nth-child(6){--card-art:url("assets/python-academy/10-learning-path.png");}
.cq-feature-grid > .cq-feature:nth-child(7){--card-art:url("assets/python-academy/11-project-lab.png");}
.cq-feature-grid > .cq-feature:nth-child(8){--card-art:url("assets/python-academy/12-learning-settings.png");}

.mode-grid,.cq-feature-grid{
  grid-template-columns:minmax(0,1fr)!important;
  gap:12px;
}
.mode-grid>.mode-card,.cq-feature-grid>.cq-feature{
  position:relative;
  isolation:isolate;
  width:100%;
  height:clamp(105px,32vw,145px);
  min-height:0;
  padding:0;
  overflow:hidden;
  background:var(--card-art) center/100% 100% no-repeat!important;
  border:0!important;
  border-radius:14px;
  box-shadow:none!important;
  text-shadow:none!important;
}
.mode-grid>.mode-card:before,.mode-grid>.mode-card:after{
  display:none!important;
}
.mode-grid>.mode-card>*,.cq-feature-grid>.cq-feature>*{
  opacity:0!important;
}
.hero{
  background-image:
    linear-gradient(90deg,#081326e8 0%,#0b1730a8 52%,#0b173044 100%),
    url("assets/python-academy/python-hero.png");
  background-size:cover;
  background-position:center;
}

/* PYTHON HERO: IMAGE ONLY, KEEP BUTTONS */
.hero.panel{
  background-color:transparent!important;
  background-image:url("assets/python-academy/python-hero.png")!important;
  background-size:cover!important;
  background-position:center!important;
  border:0!important;
  box-shadow:none!important;
}
.hero.panel:before,.hero.panel:after{display:none!important;}

/* PYTHON HERO: FULL IMAGE, COMPACT, NO BUTTONS */
.hero.panel{
  display:block!important;
  width:100%!important;
  height:clamp(180px,56.3vw,380px)!important;
  min-height:0!important;
  max-height:380px!important;
  padding:0!important;
  margin:0 auto!important;
  aspect-ratio:1672/941;
  background:#081326 url("assets/python-academy/python-hero.png") center/contain no-repeat!important;
  border:0!important;
  box-shadow:none!important;
  overflow:hidden!important;
}
