#game-frame{isolation:isolate;overflow:hidden}
#game-frame>.screen-layer{position:absolute!important;inset:0!important;width:auto!important;height:auto!important;z-index:70}
#game-frame #upgrade-screen{background:rgba(1,8,12,.78);backdrop-filter:blur(5px)}
#game-frame #upgrade-screen .upgrade-shell{width:min(1160px,94%);max-height:92%;overflow:auto;padding:30px 34px 26px;background:linear-gradient(145deg,rgba(6,22,28,.98),rgba(2,12,17,.97));border:1px solid rgba(105,229,220,.26);box-shadow:0 24px 90px rgba(0,0,0,.62),inset 0 1px rgba(255,255,255,.04)}
#game-frame #upgrade-screen .upgrade-heading{max-width:880px;margin:0 auto 24px;text-align:left;border-left:3px solid #ffbd69;padding:4px 0 4px 18px}
#game-frame #upgrade-screen .upgrade-heading h2{font-size:clamp(24px,2.2vw,38px);margin:5px 0 8px}
#game-frame #upgrade-screen .upgrade-heading p{max-width:820px;color:#aec5c1;line-height:1.65}
#game-frame #upgrade-screen.active .upgrade-shell{animation:pw-upgrade-enter .38s cubic-bezier(.2,.82,.24,1) both}#game-frame #upgrade-screen.choice-committing .upgrade-shell{animation:pw-upgrade-exit .28s ease-in both}#game-frame #upgrade-screen.choice-committing .upgrade-card.selected{transform:translateY(-6px) scale(1.015);filter:brightness(1.28);box-shadow:0 0 0 2px var(--accent),0 0 70px color-mix(in srgb,var(--accent) 50%,transparent)}
.upgrade-cards.tutorial-forced{gap:16px;max-width:1100px;margin:auto}
.upgrade-cards.tutorial-forced .upgrade-card{position:relative;min-height:250px;text-align:left;transition:none;background:linear-gradient(160deg,rgba(10,31,37,.98),rgba(3,17,22,.98));border:1px solid color-mix(in srgb,var(--accent) 60%,#173b42);box-shadow:inset 0 3px var(--accent)}
.upgrade-cards.tutorial-forced .upgrade-card h3{font-size:22px;line-height:1.25;margin:18px 0 12px}.upgrade-cards.tutorial-forced .upgrade-card p{font-size:13px;line-height:1.7;color:#acc2be}.upgrade-cards.tutorial-forced .upgrade-card strong{position:absolute;left:24px;bottom:20px;color:var(--accent)}
.upgrade-cards.tutorial-forced .tutorial-locked{opacity:.2;filter:saturate(.2);cursor:not-allowed;box-shadow:none}.upgrade-cards.tutorial-forced .tutorial-target{z-index:2;box-shadow:0 0 0 2px var(--accent),0 0 42px color-mix(in srgb,var(--accent) 28%,transparent),inset 0 3px var(--accent);animation:pw-card-breathe 1.8s ease-in-out infinite}
.upgrade-card.rarity-bronze{--tier:#b77b4d}.upgrade-card.rarity-silver{--tier:#c8d4d8}.upgrade-card.rarity-gold{--tier:#ffd16a}.upgrade-card.rarity-link{--tier:#ff5969}.upgrade-card[class*="rarity-"]::after{content:"";position:absolute;inset:8px;border:1px solid color-mix(in srgb,var(--tier) 44%,transparent);pointer-events:none}.upgrade-card.rarity-link{background:linear-gradient(155deg,rgba(61,12,24,.96),rgba(10,13,22,.98))!important}
#pw-scripted-tutorial{position:absolute;inset:0;z-index:62;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .18s ease;overflow:hidden}#pw-scripted-tutorial.active{opacity:1;visibility:visible}#pw-scripted-tutorial.requires-click{pointer-events:auto;cursor:pointer}
#pw-current-objective{position:absolute;z-index:18;left:50%;top:18px;display:flex;align-items:center;gap:12px;min-width:390px;max-width:54%;padding:10px 14px;opacity:0;visibility:hidden;transform:translate(-50%,-8px);background:rgba(3,18,23,.9);border:1px solid rgba(105,229,220,.28);border-bottom:2px solid #ffd16a;box-shadow:0 10px 32px rgba(0,0,0,.28);transition:.22s ease;pointer-events:none}#pw-current-objective.active{opacity:1;visibility:visible;transform:translate(-50%,0)}#pw-current-objective span{font:700 9px monospace;letter-spacing:.14em;color:#ffd16a}#pw-current-objective b{flex:1;font-size:12px;color:#dcebe6}#pw-current-objective em{font:700 10px monospace;font-style:normal;color:#769997}
.pw-focus-hole{position:absolute;z-index:1;background:transparent;box-shadow:0 0 24px 10px rgba(105,229,220,.12),0 0 0 4000px rgba(1,7,11,.34);transition:left .2s ease,top .2s ease,width .2s ease,height .2s ease;border:1px solid rgba(255,209,106,.78)}
.pw-focus-reticle{position:absolute;z-index:2;pointer-events:none;transition:left .2s ease,top .2s ease,width .2s ease,height .2s ease}.pw-focus-reticle i{position:absolute;width:16px;height:16px;border-color:#ffd16a}.pw-focus-reticle i:nth-child(1){left:-4px;top:-4px;border-left:2px solid;border-top:2px solid}.pw-focus-reticle i:nth-child(2){right:-4px;top:-4px;border-right:2px solid;border-top:2px solid}.pw-focus-reticle i:nth-child(3){left:-4px;bottom:-4px;border-left:2px solid;border-bottom:2px solid}.pw-focus-reticle i:nth-child(4){right:-4px;bottom:-4px;border-right:2px solid;border-bottom:2px solid}
.pw-lesson{position:absolute;z-index:3;padding:20px 22px 17px;background:linear-gradient(145deg,rgba(7,24,29,.97),rgba(2,13,18,.98));border:1px solid rgba(157,205,198,.48);border-top:3px solid #ffd16a;box-shadow:0 18px 54px rgba(0,0,0,.48);color:#e8f1ed;cursor:inherit}.active>.pw-lesson{animation:pw-lesson-enter .34s cubic-bezier(.2,.82,.24,1) both}.pw-lesson::before{content:"";position:absolute;top:24px;width:54px;border-top:1px dashed rgba(255,209,106,.7)}.pw-lesson[data-side="right"]::before{right:100%}.pw-lesson[data-side="left"]::before{left:100%}.pw-lesson header,.pw-lesson footer{display:flex;align-items:center;justify-content:space-between;gap:14px}.pw-lesson-step{font:700 10px/1.2 monospace;letter-spacing:.18em;color:#ffd16a}.pw-lesson-term{font-size:11px;color:#75d8ce}.pw-lesson h2{margin:10px 0 8px;font-size:22px;line-height:1.25}.pw-lesson p{margin:0;color:#bdd0cc;font-size:13px;line-height:1.75}.pw-lesson footer{margin-top:14px;padding-top:11px;border-top:1px solid rgba(105,229,220,.14);font-size:11px}.pw-lesson-action{color:#ffd16a}.pw-lesson footer em{font:700 10px monospace;color:#698c89;font-style:normal}
@keyframes pw-card-breathe{50%{box-shadow:0 0 0 2px var(--accent),0 0 60px color-mix(in srgb,var(--accent) 42%,transparent),inset 0 3px var(--accent)}}
@keyframes pw-upgrade-enter{from{opacity:0;transform:translateY(22px) scale(.985)}to{opacity:1;transform:none}}@keyframes pw-upgrade-exit{to{opacity:0;transform:translateY(-12px) scale(.992)}}@keyframes pw-lesson-enter{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
@media(max-width:900px){#pw-current-objective{top:8px;min-width:0;width:calc(100% - 32px);max-width:none}.pw-lesson{width:calc(100% - 32px)!important;left:16px!important;top:auto!important;bottom:18px}.pw-lesson::before{display:none}#game-frame #upgrade-screen .upgrade-shell{padding:20px 16px}.upgrade-cards.tutorial-forced{grid-template-columns:1fr}.upgrade-cards.tutorial-forced .upgrade-card{min-height:165px}.upgrade-cards.tutorial-forced .tutorial-locked{display:none}}
