:root { color-scheme: dark; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: #0a0e22; color: #f7f5ed; font-synthesis: none; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #0a0e22; }
button, select, input, textarea { font: inherit; }
.lab-header { min-height: 74px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; padding: 13px clamp(18px, 3vw, 42px); border-bottom: 1px solid #2a315a; background: rgba(10, 14, 34, .94); }
.brand { color: #f7f5ed; font-size: 1.55rem; font-weight: 900; letter-spacing: -.05em; text-decoration: none; }
.lab-header p { margin: 0; font-size: .92rem; font-weight: 750; }
.lab-header span { color: #8f97c5; font-size: .72rem; }
.quiet-button, .primary-button { border: 0; border-radius: 999px; cursor: pointer; font-weight: 800; }
.quiet-button { padding: 10px 16px; color: #e7e8fb; background: #20284e; }
.primary-button { padding: 15px 24px; color: #10142d; background: #f7c75f; }
.header-actions { display: flex; align-items: center; gap: 10px; }
#pending-badge { padding: 5px 9px; border-radius: 999px; color: #8f97c5; background: #171d3d; font-size: .7rem; }
#pending-badge.has-pending { color: #10142d; background: #f7c75f; }
main { min-height: calc(100vh - 74px); display: grid; grid-template-columns: 270px 1fr; }
.setup-panel { padding: 26px; border-right: 1px solid #2a315a; background: #101632; }
.setup-panel label { display: grid; gap: 8px; margin-bottom: 20px; color: #aab1d8; font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
select { width: 100%; padding: 12px; color: #f7f5ed; border: 1px solid #343e70; border-radius: 10px; background: #181f43; }
.setup-links { display: grid; gap: 11px; margin-top: 32px; }
.setup-links a { color: #aeb8ff; font-size: .88rem; text-decoration: none; }
.source-status { min-height: 54px; padding: 11px; border: 1px solid #303965; border-radius: 10px; color: #939bc7; font-size: .75rem; line-height: 1.4; background: #131936; }
.game-stage { min-width: 0; display: grid; place-items: center; padding: clamp(22px, 4vw, 54px); background: radial-gradient(circle at 70% 20%, rgba(114, 87, 233, .22), transparent 33rem); }
.stage-intro { max-width: 780px; }
.eyebrow { margin: 0 0 18px; color: #65e6a6; font-size: .78rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(3.2rem, 8vw, 7.4rem); line-height: .9; letter-spacing: -.065em; }
#game-description { max-width: 650px; margin: 28px 0; color: #bac0e3; font-size: clamp(1rem, 2.2vw, 1.3rem); line-height: 1.55; }
.play-surface { width: min(1120px, 100%); align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.game-kicker { display: flex; justify-content: space-between; margin-bottom: 15px; color: #8f97c5; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.play-surface h2 { max-width: 1000px; margin: 0 0 24px; font-size: clamp(2rem, 4.5vw, 4rem); line-height: 1.08; letter-spacing: -.04em; }
.round-label, .response-copy { color: #9ea6d0; font-size: .82rem; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice { min-height: 78px; display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 14px; padding: 14px; border: 1px solid #343d70; border-radius: 16px; background: #151c3e; }
.choice b { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: #12162e; background: #8c9aff; }
.choice.correct { border-color: #65e6a6; background: #14382f; }
.choice.correct b { background: #65e6a6; }
.response-meter { height: 8px; margin-top: 20px; overflow: hidden; border-radius: 999px; background: #272f5a; }
.response-meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7257e9, #65e6a6); transition: width .2s ease; }
.teacher-controls { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.teacher-controls button, .sim-presets button, .library-view button, .library-tabs button { padding: 11px 15px; border: 1px solid #3b467b; border-radius: 999px; color: #e6e8fa; background: #1b2349; cursor: pointer; font-weight: 750; }
.teacher-controls .primary, .library-view button.primary { color: #11152c; border-color: #f7c75f; background: #f7c75f; }
.teacher-controls .danger { margin-left: auto; color: #ffb6bf; border-color: #643642; background: #291a28; }
.feedback, .finish-card { display: grid; gap: 6px; margin-top: 18px; padding: 18px; border-radius: 16px; background: #222b55; }
.feedback.good { color: #bff6d8; background: #163a32; }
.finish-card h2 { margin: 0; }
.battle-track { height: 118px; position: relative; display: flex; align-items: center; justify-content: space-between; margin: 30px 0; padding: 0 22px; border-radius: 60px; background: linear-gradient(90deg, #7358e9, #29315c 50%, #f7c75f); }
.goal { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 50%; color: #11152c; font-weight: 950; background: white; }
.bottle { position: absolute; top: 50%; transform: translate(-50%, -50%); font-size: 2.6rem; color: #fff; text-shadow: 0 4px 15px #000; transition: left .45s cubic-bezier(.2,.8,.2,1); }
.team-score { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; border-radius: 16px; background: #171e42; }
.team-score strong { color: #65e6a6; }
.timer { width: 82px; height: 82px; display: grid; place-items: center; margin: 14px 0; border-radius: 50%; color: #11152c; background: #f7c75f; font-size: 1.8rem; font-weight: 950; }
.group-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.group-card { display: grid; gap: 8px; padding: 16px; border: 1px solid #3a4478; border-radius: 14px; background: #171e42; }
.group-card strong { font-size: 1.7rem; }
.group-card.rescued { border-color: #65e6a6; background: #14382f; }
.discussion { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.turn-badge { display: inline-block; width: fit-content; margin-bottom: 12px; padding: 7px 12px; border-radius: 999px; font-weight: 850; text-transform: capitalize; }
.turn-badge.violet { background: #7257e9; } .turn-badge.gold { color: #11152c; background: #f7c75f; }
.tic-board { width: min(440px, 100%); display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 24px; }
.tic-cell { aspect-ratio: 1; display: grid; place-items: center; border: 1px solid #3b467c; border-radius: 16px; color: #8f97c5; background: #151c3e; font-size: 2rem; font-weight: 950; }
.tic-cell.violet { color: white; background: #7257e9; } .tic-cell.gold { color: #11152c; background: #f7c75f; }
.vine-wrap { overflow: hidden; border: 8px solid #243052; border-radius: 20px; box-shadow: 0 22px 70px rgba(0,0,0,.28); }
#vine-canvas { width: 100%; height: auto; display: block; }
.simulator-panel, .camera-preview { margin-top: 28px; padding: 17px; border: 1px solid #303966; border-radius: 16px; background: rgba(16,22,50,.85); }
.live-simulator { margin-top: 18px; border: 1px solid #303966; border-radius: 16px; background: rgba(16,22,50,.72); }
.live-simulator > summary { cursor: pointer; padding: 16px 18px; font-weight: 800; color: #f8c85b; }
.live-simulator .simulator-panel { margin-top: 0; border: 0; border-top: 1px solid #303966; border-radius: 0 0 16px 16px; }
.sim-presets { display: flex; flex-wrap: wrap; gap: 7px; }
.steering-slider { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; margin: 15px 0; color: #aeb5db; font-size: .78rem; }
.player-grid { max-height: 260px; overflow: auto; display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 7px; padding-right: 5px; }
.player-control { display: grid; grid-template-columns: 1fr 48px; align-items: center; gap: 5px; padding: 7px; border-radius: 9px; background: #171e42; }
.player-control label { color: #adb4d8; font-size: .7rem; white-space: nowrap; }
.player-control select { padding: 6px; }
.library-view { width: min(1000px, 100%); align-self: start; padding-bottom: 60px; }
.library-view h1 { max-width: 850px; font-size: clamp(3rem, 7vw, 6.5rem); }
.library-view > p { max-width: 760px; color: #abb2d8; line-height: 1.55; }
.back-link { display: inline-block; margin-bottom: 28px; color: #aeb8ff; text-decoration: none; }
.library-tabs, .library-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 22px 0; }
.library-tabs button.active { color: #11152c; background: #65e6a6; }
.import-panel { display: grid; gap: 12px; margin: 28px 0; padding: 22px; border: 1px solid #343e70; border-radius: 18px; background: #111735; }
.import-panel h2 { margin: 0; font-size: 1.7rem; }
.import-panel textarea, .import-panel input { width: 100%; padding: 12px; color: #f5f2ea; border: 1px solid #3b467b; border-radius: 10px; background: #0c1128; }
.managed-list { display: grid; gap: 8px; }
.managed-list article { display: flex; justify-content: space-between; gap: 14px; padding: 14px; border-radius: 12px; background: #171e42; }
.managed-list span, .empty { color: #949bc5; font-size: .82rem; }
.fatal { max-width: 700px; }
@media (max-width: 760px) { .lab-header { grid-template-columns: auto 1fr; } .lab-header .quiet-button { grid-column: 1 / -1; justify-self: stretch; } main { grid-template-columns: 1fr; } .setup-panel { border-right: 0; border-bottom: 1px solid #2a315a; } .game-stage { min-height: 56vh; } }
@media (max-width: 760px) { .header-actions { grid-column: 1 / -1; } .choice-grid, .player-grid { grid-template-columns: 1fr 1fr; } .teacher-controls .danger { margin-left: 0; } .game-stage { padding: 18px; } }
