/* Game presentation layer */
.screen { isolation: isolate; background-color: #050b0e; }
.screen-bg { animation: background-breathe 16s ease-in-out infinite alternate; }
.page-header, .compact-header, .assessment-header { animation: slide-down 380ms cubic-bezier(.2,.8,.2,1) both; }
.hero, .phase-heading { animation: slide-left 420ms cubic-bezier(.2,.8,.2,1) both; }
.mission-grid, .card-grid, .phase-nav, .learning-shell, .assessment-grid, .results-grid { animation: slide-up 430ms 70ms cubic-bezier(.2,.8,.2,1) both; }
.screen.scene-exit { pointer-events: none; animation: scene-out 180ms ease-in forwards; }
.screen.is-refresh .screen-bg,
.screen.is-refresh .page-header,
.screen.is-refresh .compact-header,
.screen.is-refresh .assessment-header,
.screen.is-refresh .hero,
.screen.is-refresh .phase-heading,
.screen.is-refresh .mission-grid,
.screen.is-refresh .card-grid,
.screen.is-refresh .phase-nav,
.screen.is-refresh .learning-shell,
.screen.is-refresh .assessment-grid,
.screen.is-refresh .results-grid,
.screen.is-refresh .scene-character,
.screen.is-refresh .mentor-strip,
.screen.is-refresh .mentor-strip img { animation: none; }

@keyframes background-breathe { from { transform: scale(1); } to { transform: scale(1.035); } }
@keyframes slide-left { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes slide-right { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }
@keyframes slide-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes slide-down { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }
@keyframes scene-out { to { opacity: 0; transform: scale(.992); filter: blur(2px); } }
@keyframes choice-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes feedback-pop { 0% { opacity: 0; transform: scale(.9); } 70% { transform: scale(1.03); } 100% { opacity: 1; transform: none; } }
@keyframes wrong-shake { 25% { transform: translateX(-5px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
@keyframes reward-pop { 0% { opacity: 0; transform: scale(.5) rotate(-5deg); } 70% { transform: scale(1.08) rotate(1deg); } 100% { opacity: 1; transform: none; } }

.scene-character { position: absolute !important; bottom: 0; z-index: 1 !important; width: min(34vw, 430px); height: min(70vh, 680px); object-fit: contain; object-position: bottom; pointer-events: none; filter: drop-shadow(0 24px 28px rgba(0,0,0,.75)); }
.scene-character--left { left: 1%; animation: slide-right 440ms 80ms cubic-bezier(.2,.8,.2,1) both; }
.scene-character--right { right: 1%; animation: slide-left 440ms 80ms cubic-bezier(.2,.8,.2,1) both; }
.scene-character--assessment { height: min(72vh, 700px); }
.scene-character--results { height: min(75vh, 720px); }
.scene-character--mobile { display: none; }

.mentor-strip { position: relative; min-height: 116px; max-width: 880px; margin-top: 54px; padding: 28px 34px; overflow: visible; border: 1px solid #4b8a76; background: linear-gradient(100deg, rgba(3,10,13,.98), rgba(8,25,26,.95)); box-shadow: 0 22px 55px rgba(0,0,0,.4); animation: slide-up 360ms 160ms cubic-bezier(.2,.8,.2,1) both; }
.mentor-strip::after { content: ""; position: absolute; right: -1px; top: -1px; width: 22px; height: 22px; border-top: 2px solid var(--mint); border-right: 2px solid var(--mint); }
.mentor-strip p { margin: 0; color: #d5e4df; font: 15px/1.55 "Trebuchet MS", sans-serif; }
.mentor-strip p b { position: absolute; top: -14px; left: 24px; padding: 6px 14px; color: #03120b; background: var(--mint); font: 800 11px monospace; letter-spacing: .12em; }
.mentor-strip p span { display: block; }
.mentor-strip img { position: absolute; bottom: -8px; width: 400px; height: min(72vh, 700px); object-fit: contain; object-position: bottom; pointer-events: none; filter: drop-shadow(0 18px 22px rgba(0,0,0,.7)); }
.mentor-strip--right { margin-right: 285px; margin-left: auto; }
.mentor-strip--right img { right: -360px; left: auto; animation: slide-left 440ms 80ms cubic-bezier(.2,.8,.2,1) both; }
.mentor-strip--left { margin-right: auto; margin-left: 285px; }
.mentor-strip--left img { right: auto; left: -360px; animation: slide-right 440ms 80ms cubic-bezier(.2,.8,.2,1) both; }

.screen--home { padding-right: clamp(300px, 31vw, 450px); }
.screen--home .hero, .screen--home .mission-grid { max-width: 930px; }
.mentor-card { right: 0; bottom: 0; width: clamp(290px, 30vw, 430px); max-width: none; height: 78%; align-items: end; justify-content: center; animation: slide-left 440ms 100ms cubic-bezier(.2,.8,.2,1) both; }
.mentor-card img { position: absolute; right: 0; bottom: 0; width: 100%; height: min(68vh, 660px); object-fit: contain; object-position: bottom; }
.mentor-card .mentor { position: absolute; right: 24px; bottom: 24px; width: min(380px, calc(100% - 36px)); margin: 0; padding: 24px 20px 18px; color: #d7e7e1; border: 1px solid #4b8a76; background: rgba(3,10,13,.95); clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 15px, 100% 100%, 0 100%); }
.mentor-card .mentor b { position: absolute; top: -12px; left: 16px; padding: 5px 10px; color: #06140e; background: var(--mint); }
.mentor-card .mentor span { display: block; margin-bottom: 8px; }

.screen--cases .card-grid, .screen--cases > .terminal, .screen--cases > .button--danger { width: calc(100% - 250px); }
.screen--blueprint .page-header, .screen--blueprint .tabs, .screen--blueprint .card-grid { width: calc(100% - 260px); }
.phase--practice .learning-shell { width: 100% !important; }
.assessment-grid--with-character { width: calc(100% - 280px); margin-left: 280px; }
.screen--results .results-grid, .screen--results .result-actions { width: calc(100% - 270px); }

.mission, .case-card, .concept-card, .stage, .choice, .answer-option { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px)); }
.mission, .case-card { background: linear-gradient(135deg, rgba(7,18,22,.96), rgba(9,31,30,.82)); }
.mission:hover, .case-card:hover { transform: translateY(-5px) scale(1.015); box-shadow: 0 18px 32px rgba(0,0,0,.35), inset 0 0 28px rgba(87,242,164,.06); }
.concept-card, .stage, .answer-option, .choice { transition: transform 140ms ease, border-color 140ms ease, background 140ms ease; }
.concept-card:hover, .stage:not(:disabled):hover, .answer-option:hover, .choice:hover { transform: translateX(7px); }

.answer-list .answer-option, .choices .choice { position: relative; padding-left: 22px; animation: choice-in 260ms both; }
.answer-list .answer-option::before, .choices .choice::before { content: ">"; position: absolute; left: 7px; color: var(--cyan); opacity: 0; }
.answer-list .answer-option:hover::before, .answer-list .answer-option.is-selected::before, .choices .choice:hover::before { opacity: 1; }
.answer-list > :nth-child(2), .choices > :nth-child(2) { animation-delay: 55ms; }
.answer-list > :nth-child(3), .choices > :nth-child(3) { animation-delay: 110ms; }
.answer-list > :nth-child(4) { animation-delay: 165ms; }
.answer-option.is-correct, .choice.is-correct { box-shadow: inset 5px 0 0 var(--mint), 0 0 24px rgba(87,242,164,.12); animation: feedback-pop 260ms ease both; }
.answer-option.is-wrong, .choice.is-wrong { box-shadow: inset 5px 0 0 var(--danger); animation: wrong-shake 210ms ease both; }
.compiler-feedback { clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); animation: feedback-pop 260ms ease both; }
.reflection-card > img, .score-card > img { animation: reward-pop 520ms cubic-bezier(.2,.9,.2,1.2) both; }
.reflection-summary span { animation: feedback-pop 260ms 150ms both; }

.concept-detail, .demo-code, .editor-panel, .compiler-panel, .checkpoint-card, .reflection-card, .scenario-card, .answer-card, .analytics-card, .score-card { border-color: rgba(91,167,143,.55); background: linear-gradient(135deg, rgba(3,10,13,.97), rgba(7,24,25,.9)); clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px)); }
.phase-nav { border-color: rgba(91,167,143,.5); background: rgba(2,8,11,.88); clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); }
.terminal { border-left-width: 4px; box-shadow: 0 15px 40px rgba(0,0,0,.3); }

.phase--practice .mentor-strip { margin-top: 240px; }
.phase--practice .mentor-strip img { height: 340px; }

.screen--main-menu { display: block; min-height: 0; padding: clamp(70px, 9vh, 110px) clamp(46px, 7vw, 110px); overflow: hidden; }
.screen--main-menu::before { opacity: .08; }
.main-menu-brand { position: relative; z-index: 3; width: min(690px, 58vw); animation: slide-right 420ms cubic-bezier(.2,.8,.2,1) both; }
.main-menu-brand h1 { margin: 8px 0 12px; font: 900 clamp(66px, 8.5vw, 132px)/.76 Impact, sans-serif; letter-spacing: -.035em; }
.main-menu-brand h1 span { display: block; color: transparent; -webkit-text-stroke: 2px var(--mint); }
.main-menu-brand > p:last-child { color: #c7d8d2; font: clamp(16px, 1.8vw, 23px) Georgia, serif; }
.main-menu-list { position: relative; z-index: 3; display: grid; width: min(480px, 42vw); margin-top: clamp(35px, 6vh, 64px); }
.main-menu-item { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; min-height: 58px; padding: 10px 18px; cursor: pointer; text-align: left; color: #d4b3b0; border: 0; border-left: 2px solid rgba(255,101,79,.65); background: linear-gradient(90deg, rgba(45,8,10,.52), transparent); transition: transform 140ms ease, color 140ms ease, background 140ms ease; animation: choice-in 280ms both; }
.main-menu-item:nth-child(2) { animation-delay: 55ms; }
.main-menu-item:nth-child(3) { animation-delay: 110ms; }
.main-menu-item:nth-child(4) { animation-delay: 165ms; }
.main-menu-item span { font: 500 clamp(18px, 2vw, 26px) "Trebuchet MS", sans-serif; text-transform: uppercase; letter-spacing: .04em; }
.main-menu-item small { color: #9e7774; font: 10px monospace; }
.main-menu-item:hover { z-index: 1; color: white; transform: translateX(10px); background: linear-gradient(90deg, rgba(104,21,25,.65), transparent); }
.main-menu-item.is-primary { min-height: 66px; margin-bottom: 8px; color: var(--cyan); border: 1px solid var(--cyan); border-left-width: 4px; background: linear-gradient(90deg, rgba(10,68,78,.68), rgba(8,25,29,.2)); clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); }
.main-menu-item.is-primary::after { content: ">"; position: absolute; right: 16px; color: var(--cyan); font: 700 20px monospace; }
.main-menu-item.is-primary:hover { color: #061418; background: var(--cyan); }
.main-menu-item.is-primary:hover small, .main-menu-item.is-primary:hover::after { color: #061418; }
.main-menu-character { position: absolute !important; right: 1.5%; bottom: -3%; z-index: 2 !important; width: min(47vw, 650px); height: min(84vh, 820px); object-fit: contain; object-position: bottom right; pointer-events: none; filter: drop-shadow(0 28px 35px rgba(0,0,0,.78)); animation: slide-left 480ms 80ms cubic-bezier(.2,.8,.2,1) both; }
.main-menu-dialog { position: absolute !important; right: 4%; bottom: 4%; z-index: 4 !important; width: min(430px, 35vw); padding: 24px 22px 18px; border: 1px solid #487f70; background: rgba(3,10,13,.94); box-shadow: 0 18px 45px rgba(0,0,0,.5); animation: slide-up 360ms 180ms cubic-bezier(.2,.8,.2,1) both; }
.main-menu-dialog b { position: absolute; top: -13px; left: 18px; padding: 5px 12px; color: #06140e; background: var(--mint); font: 800 10px monospace; letter-spacing: .12em; }
.main-menu-dialog p { margin: 0; color: #d2e0dc; line-height: 1.5; }
.main-menu-status { position: absolute !important; left: clamp(46px, 7vw, 110px); bottom: 26px; z-index: 3 !important; display: flex; gap: 22px; color: #57726a; font: 9px monospace; letter-spacing: .1em; }
.main-menu-status b { color: var(--mint); }

.screen--main-menu { display: grid; place-items: center; padding: 56px; }
.menu-core { position: relative; z-index: 4; width: min(520px, 72vw); text-align: center; transition: opacity 320ms ease, transform 320ms ease; }
.has-intro .menu-core, .has-intro .main-menu-status { opacity: 0; transform: translateY(14px); }
.intro-complete .menu-core, .intro-complete .main-menu-status { opacity: 1; transform: none; }
.menu-core .main-menu-brand { width: 100%; }
.menu-core .main-menu-brand h1 { margin: 0 0 34px; font-size: clamp(58px, 7vw, 104px); line-height: .82; letter-spacing: -.05em; text-transform: lowercase; }
.menu-core .main-menu-brand h1 span { display: inline; color: var(--cyan); -webkit-text-stroke: 0; }
.menu-core .main-menu-brand .eyebrow { margin-bottom: 18px; color: #63847b; font-size: 9px; }
.menu-core .main-menu-list { width: 100%; margin: 0; }
.menu-core .main-menu-item { display: block; min-height: 42px; padding: 7px 16px; text-align: center; color: #edf7f4; border: 0; background: transparent; clip-path: none; }
.menu-core .main-menu-item span { font-size: clamp(18px, 1.8vw, 24px); font-weight: 500; text-transform: lowercase; }
.menu-core .main-menu-item:hover { color: var(--cyan); transform: scale(1.035); background: transparent; }
.menu-core .main-menu-item.is-primary { min-height: 50px; margin-bottom: 2px; color: var(--cyan); border: 1px solid var(--cyan); background: rgba(2,20,26,.42); clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%); }
.menu-core .main-menu-item.is-primary::after { display: none; }
.menu-core .main-menu-item.is-primary:hover { color: #06171b; background: var(--cyan); }
.menu-voice { margin-top: 18px; padding: 7px 12px; cursor: pointer; color: #64877e; border: 0; background: transparent; font-size: 11px; }
.menu-voice::before { content: "▶ "; color: var(--cyan); }
.menu-voice:hover { color: var(--cyan); }
.screen--main-menu .main-menu-status { left: 28px; bottom: 22px; }

.intro-sequence { position: absolute !important; inset: 0; z-index: 80 !important; overflow: hidden; background: rgba(2,8,11,.8); backdrop-filter: blur(2px); transition: opacity 500ms ease; }
body:has(.intro-sequence) .audio-controls { opacity: 0; pointer-events: none; }
body:has(.intro-sequence) .voice-panel { display: none; }
.intro-loader { position: absolute; left: 50%; top: 50%; display: grid; gap: 8px; width: min(360px, 70vw); transform: translate(-50%,-50%); color: #73938a; font: 11px monospace; letter-spacing: .12em; transition: opacity 260ms ease, transform 260ms ease; }
.intro-loader b { color: var(--cyan); font-size: 13px; }
.intro-loader i { position: relative; display: block; height: 2px; overflow: hidden; background: #173239; }
.intro-loader i::after { content: ""; position: absolute; inset: 0; background: var(--cyan); transform-origin: left; animation: loading-line 1s ease-out both; }
.intro-loader button { justify-self: start; margin-top: 12px; padding: 11px 16px; border: 1px solid var(--cyan); color: var(--cyan); background: rgba(4,22,25,.9); font: 700 12px "Funnel Display", sans-serif; letter-spacing: .08em; text-transform: uppercase; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity 220ms ease, transform 220ms ease, background 160ms ease; }
.intro-loader button:hover, .intro-loader button:focus-visible { color: #031316; background: var(--cyan); }
.intro-loader button small { margin-left: 10px; font: 500 9px monospace; opacity: .7; }
.intro-sequence.is-ready .intro-loader button { opacity: 1; pointer-events: auto; transform: none; }
.intro-cast { position: absolute; bottom: calc(20% + 125px); z-index: 1; width: min(18vw, 230px); height: min(37vh, 300px); object-fit: contain; object-position: bottom; opacity: 0; pointer-events: none; }
.intro-player { left: 8%; filter: drop-shadow(0 0 14px rgba(89,217,255,.65)) drop-shadow(0 24px 30px rgba(0,0,0,.8)); }
.intro-enemy { left: calc(8% + min(18vw, 230px)); filter: drop-shadow(0 0 16px rgba(255,101,79,.68)) drop-shadow(0 24px 30px rgba(0,0,0,.8)); }
.intro-sequence.is-cast .intro-player { animation: intro-pop-left 560ms cubic-bezier(.2,.9,.2,1.18) both, intro-float 3.2s 560ms ease-in-out infinite; }
.intro-sequence.is-cast .intro-enemy { animation: intro-pop-right 560ms 140ms cubic-bezier(.2,.9,.2,1.18) both, intro-float 3.5s 700ms ease-in-out infinite reverse; }
.intro-character { position: absolute; right: 5%; bottom: -4%; width: min(46vw, 620px); height: min(82vh, 800px); object-fit: contain; object-position: bottom; transform: translateX(125%); opacity: 0; filter: drop-shadow(0 30px 38px rgba(0,0,0,.8)); transition: transform 520ms cubic-bezier(.2,.8,.2,1), opacity 280ms ease; }
.intro-dialog { position: absolute; left: 8%; bottom: 9%; width: min(610px, 48vw); padding: 30px 28px 24px; transform: translateY(35px); opacity: 0; border: 1px solid #43806d; background: rgba(3,10,13,.96); transition: transform 380ms 260ms ease, opacity 300ms 260ms ease; }
.intro-dialog b { position: absolute; top: -13px; left: 20px; padding: 6px 14px; color: #06140e; background: var(--mint); font-size: 11px; letter-spacing: .1em; }
.intro-dialog p { margin: 0; color: #d7e6e1; font-size: clamp(16px, 1.7vw, 22px); line-height: 1.55; }
.intro-sequence.is-character .intro-loader { opacity: 0; transform: translate(-50%,-58%); }
.intro-sequence.is-character .intro-character { opacity: 1; transform: translateX(0); }
.intro-sequence.is-character .intro-dialog { opacity: 1; transform: none; }
.intro-sequence.is-exiting { opacity: 0; }
.intro-sequence.is-exiting .intro-character { transform: translateX(-175vw); transition-duration: 620ms; }
.intro-sequence.is-exiting .intro-dialog { opacity: 0; transform: translateX(-35px); transition-delay: 0ms; }
@keyframes loading-line { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes intro-pop-left { from { opacity: 0; transform: translateX(-70px) scale(.68); } to { opacity: .86; transform: none; } }
@keyframes intro-pop-right { from { opacity: 0; transform: translateX(70px) scale(.68); } to { opacity: .86; transform: none; } }
@keyframes intro-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-13px); } }

body, button, input, textarea { font-family: "Funnel Display", sans-serif; }
h1, h2, h3,
.cover-content h1, .hero h1, .page-header h1, .lesson-panel h1,
.phase-heading h1, .checkpoint-card h1, .reflection-card h1,
.concept-detail h2, .scenario-card h1, .main-menu-brand h1,
.score-card h1 { font-family: "Funnel Display", sans-serif; font-weight: 800; }
.cover-content > p:not(.eyebrow), .hero__subtitle, .mentor-strip p,
.main-menu-brand > p:last-child, .main-menu-item span,
.reflection-card blockquote { font-family: "Funnel Display", sans-serif; }
.main-menu-item span { font-weight: 500; }

