.test-entry {display:flex;align-items:center;gap:6px;border:0;background:transparent;min-height:44px;font-size:13px;font-weight:600;padding:0 6px;white-space:nowrap;}
.test-entry svg {width:17px;height:17px;}
.home-footer-row {flex-wrap:wrap;gap:0 8px;}
.home-footer-row [data-reset-time] {font-size:10px;margin-left:auto;}
#test-room {width:100%;max-width:520px;height:var(--visible-height,100dvh);margin:auto;overflow-y:auto;overflow-x:hidden;padding:calc(env(safe-area-inset-top) + 12px) max(16px,env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 16px) max(16px,env(safe-area-inset-left));scrollbar-width:thin;--action:var(--lab-color,var(--ink));--action-ink:white;}
.lab-header {display:flex;align-items:center;gap:6px;min-height:48px;margin:0 -6px 12px;}
.lab-header h1 {font-size:20px;line-height:24px;flex:1;min-width:0;overflow-wrap:break-word;}
.lab-header>div {display:flex;flex:none;}
.lab-badge {font-size:12px;color:var(--muted);margin-right:6px;}
.lab-section-title {display:flex;align-items:baseline;justify-content:space-between;gap:8px;padding:10px 0 16px;}
.lab-section-title h2 {font-size:13px;margin:0;}
.lab-section-title>span {font-size:10px;color:var(--muted);}
.lab-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.lab-card {position:relative;background:var(--surface);border:1px solid var(--line);border-radius:8px;overflow:hidden;padding:8px 10px 10px;min-width:0;}
.lab-card>svg {display:block;width:100%;height:90px;}
.lab-preview {height:130px;}
.lab-preview svg {display:block;width:100%;height:100%;}
.lab-card-open:hover {background:color-mix(in srgb,var(--ink) 3%,transparent);}
.lab-card-open:active {background:color-mix(in srgb,var(--ink) 6%,transparent);}
.lab-card-open {position:absolute;inset:0;border:0;background:transparent;}
.lab-card-open:focus-visible {outline-offset:-4px;}
.lab-card h2 {font-size:16px;line-height:21px;margin:6px 0 4px;}
.lab-card p {font-size:11px;line-height:16px;color:var(--muted);margin:0 0 2px;}
.lab-card-packs {display:flex;flex-direction:column;}
.lab-card-packs button {height:44px;text-align:left;padding:0 10px;background:transparent;border:0;border-top:1px solid var(--line);font-size:12px;}
.lab-card-packs button:after {content:'›';float:right;color:var(--muted);font-size:20px;}
.lab-packs {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));padding:3px;border-radius:6px;background:var(--tile);gap:3px;margin-bottom:16px;}
.lab-packs button {height:44px;padding:0 5px;font-size:13px;border:0;border-radius:4px;background:transparent;color:var(--muted);}
.lab-packs button[aria-pressed=true] {background:var(--surface);color:var(--ink);font-weight:650;box-shadow:0 1px 3px #0001;}
.lab-content {min-width:0;}
.lab-content h2 {font-size:21px;line-height:1.35;}
.lab-objective {text-align:center;font-size:14px;font-weight:550;margin:8px 0 16px;line-height:20px;}
.lab-status {font-size:13px;line-height:20px;color:var(--muted);text-align:center;min-height:20px;margin:14px 0 4px;}
.lab-status:empty {display:none;}
.lab-actions {display:flex;justify-content:center;gap:10px;margin:18px 0 10px;}
.lab-actions button {min-width:150px;min-height:48px;}
.lab-content .secondary-button {min-height:44px;}
.lab-save-warning {color:var(--muted);font-size:12px;line-height:18px;text-align:center;}
.prototype-context {display:flex;justify-content:space-between;align-items:center;min-height:44px;border-block:1px solid var(--line);font-size:12px;color:var(--muted);margin-bottom:18px;}
.prototype-context strong {font-weight:600;color:var(--ink);}
.prototype-meta {display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px;color:var(--muted);margin-bottom:16px;min-height:24px;font-variant-numeric:tabular-nums;}
.prototype-controls {display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:60px;margin-top:18px;padding-top:14px;border-top:1px solid var(--line);}
.prototype-controls .primary-button {width:auto;min-width:130px;min-height:46px;padding:10px 16px;flex:none;}
.pipe-board {display:grid;grid-template-columns:repeat(var(--grid-size,5),minmax(0,1fr));width:100%;aspect-ratio:1;border:1px solid var(--line);border-radius:8px;overflow:hidden;touch-action:manipulation;}
.pipe-cell {display:block;aspect-ratio:1;min-width:0;padding:0;border:0;box-shadow:inset 0 0 0 .5px var(--line);background:var(--surface);position:relative;}
.pipe-cell svg {display:block;width:100%;height:100%;}
.pipe-cell:disabled {opacity:1;box-shadow:inset 0 0 0 .5px var(--line)!important;}
.pipe-cell:active:not(:disabled) {background:var(--tile);}
.pipe-cell:focus-visible {outline-offset:-4px;z-index:1;}
.pipe-rim {fill:none;stroke:light-dark(#a2afbc,#617181);stroke-width:23;stroke-linecap:butt;}
.pipe-interior {fill:none;stroke:light-dark(#e5ebf1,#303d4b);stroke-width:14;stroke-linecap:butt;}
.pipe-joint {fill:light-dark(#e5ebf1,#303d4b);}
.pipe-inlet {fill:#268bc0;stroke:light-dark(#fff,#111d28);stroke-width:2;}
.pipe-cell.wet .pipe-interior {stroke:#5dbce4;}
.pipe-cell.wet .pipe-joint {fill:#5dbce4;}
.pipe-cell.leaking::after {content:'';position:absolute;right:6px;top:6px;width:7px;height:7px;border:1px solid var(--surface);background:#d15f55;border-radius:50%;}
.pipe-inlet-key {display:flex;gap:7px;align-items:center;font-size:11px;color:var(--muted);white-space:nowrap;}
.pipe-inlet-key i {width:8px;height:8px;border-radius:50%;background:#268bc0;}
.towers-board {display:grid;grid-template-columns:repeat(var(--grid-size,7),minmax(0,1fr));width:100%;aspect-ratio:1;border:1px solid light-dark(#616d7c,#a9b4c3);border-radius:4px;overflow:hidden;touch-action:manipulation;}
.tower-cell {aspect-ratio:1;position:relative;min-width:0;display:grid;place-items:center;padding:0;background:color-mix(in srgb,var(--territory) 24%,var(--surface));border:0 solid light-dark(#66707e,#b3bdcc);box-shadow:inset 0 0 0 .5px color-mix(in srgb,var(--territory) 40%,var(--surface));}
.tower-cell:active {background:color-mix(in srgb,var(--territory) 45%,var(--surface));}
.tower-cell:focus-visible {z-index:1;outline-offset:-4px;}
.tower-cell svg {display:block;width:80%;height:80%;filter:drop-shadow(0 2px 1px #15203930);}
.territory-label {position:absolute;top:2px;left:3px;font-size:8px;line-height:10px;font-weight:650;color:var(--ink);}
.tower-cell.conflict {background:light-dark(#f1c1b9,#713e3d);}
.tower-cell.conflict::after {content:'';position:absolute;inset:3px;border:2px solid light-dark(#aa322d,#ff9e94);border-radius:2px;}
.tower-cross {width:14px;height:14px;position:relative;opacity:.7;}
.tower-cross::before,.tower-cross::after {content:'';position:absolute;top:6px;left:0;width:14px;height:2px;background:var(--ink);transform:rotate(45deg);}
.tower-cross::after {transform:rotate(-45deg);}
.tower-ledger {display:flex;justify-content:space-between;gap:8px;margin-top:18px;color:var(--muted);font-size:11px;text-align:center;}
.tower-ledger span {flex:1;}
.tower-ledger b {display:block;margin-top:5px;font-size:15px;font-weight:600;color:var(--ink);font-variant-numeric:tabular-nums;}
.tower-modes {display:flex;align-items:center;padding:3px;border-radius:7px;background:var(--tile);gap:3px;}
.tower-modes button {display:grid;place-items:center;width:48px;height:44px;border:0;border-radius:5px;background:transparent;}
.tower-modes button[aria-pressed=true] {background:var(--surface);box-shadow:0 1px 3px #0001;}
.tower-modes svg {width:21px;height:21px;}
.tower-count {font-size:12px;color:var(--muted);min-width:55px;text-align:right;}
.puzzle-complete .lab-status {color:light-dark(#176f5b,#99d5bc);font-weight:600;}
.native-save-warning #test-room {padding-top:calc(env(safe-area-inset-top) + 36px);}
#test-help {width:calc(100% - 32px);max-width:430px;padding:20px;border:1px solid var(--line);border-radius:8px;color:var(--ink);background:var(--surface);}
#test-help header {display:flex;align-items:center;justify-content:space-between;gap:8px;}
#test-help h2 {font-size:21px;margin:0;}
#test-help p {font-size:15px;line-height:1.7;}
#test-help::backdrop {background:#151b2855;}
.trivia-meta,.phrase-meta,.crossword-meta {display:flex;justify-content:space-between;align-items:center;color:var(--muted);font-size:12px;gap:12px;min-height:24px;}
.question-progress {display:grid;grid-template-columns:repeat(10,1fr);gap:5px;margin:12px 0 22px;}
.question-progress i {height:4px;border-radius:2px;background:var(--line);}
.question-progress .current {background:#b77622;}
.question-progress .right {background:#34836a;}
.question-progress .wrong {background:#c87062;}
.trivia-question {margin:0 0 22px;min-height:90px;display:flex;align-items:center;}
.trivia-answers {display:flex;flex-direction:column;gap:10px;}
.trivia-answers button {display:flex;align-items:center;gap:12px;text-align:left;min-height:58px;border:1px solid var(--line);border-radius:8px;background:var(--surface);padding:10px 14px;font-size:15px;line-height:22px;}
.trivia-answers button>span {font-size:12px;color:var(--muted);border:1px solid var(--line);width:27px;height:27px;display:grid;place-items:center;border-radius:4px;flex:none;}
.trivia-answers button>b {margin-left:auto;}
.trivia-answers button:disabled {opacity:.6;}
.trivia-answers button.correct {opacity:1;border-color:#34836a;background:light-dark(#edf7f2,#243c33);}
.trivia-answers button.incorrect {opacity:1;border-color:#c87062;background:light-dark(#fff3f0,#422d2a);}
.trivia-explanation {margin-top:18px;font-size:14px;line-height:21px;}
.trivia-explanation p {color:var(--muted);margin:5px 0;}
.trivia-result {text-align:center;padding:24px 0 10px;}
.result-number {font-size:58px;font-weight:700;line-height:1;}
.result-number small {font-size:22px;color:var(--muted);}
.trivia-review {padding-left:24px;font-size:13px;line-height:19px;}
.trivia-review li {padding:12px 0;border-bottom:1px solid var(--line);}
.trivia-review span,.trivia-review small {display:block;margin-top:4px;}
.trivia-review .right::marker {color:#34836a;}
.trivia-review .wrong::marker {color:#c87062;}
.trivia-review small {color:var(--muted);}
.line-board {width:100%;max-width:430px;margin:auto;}
.line-board svg {width:100%;max-height:46svh;min-height:280px;display:block;touch-action:manipulation;}
.network-base {stroke:var(--line);stroke-width:9;stroke-linecap:round;}
.network-hit {stroke:transparent;stroke-width:32;cursor:crosshair;}
.race-scores {display:flex;align-items:center;justify-content:center;gap:18px;font-size:12px;min-height:44px;}
.race-scores span {display:grid;grid-template-columns:8px 1fr;gap:5px;align-items:center;}
.race-scores i {width:8px;height:8px;border-radius:50%;background:var(--race-color);}
.race-scores b {grid-column:2;font-size:17px;}
.tone-scene svg {display:block;width:100%;max-height:330px;}
.tone-sliders {padding:8px 2px;display:grid;gap:10px;}
.tone-sliders label>span {display:flex;justify-content:space-between;font-size:13px;}
.tone-sliders output {color:var(--muted);font-variant-numeric:tabular-nums;}
.tone-sliders input {width:100%;margin:2px 0;height:40px;accent-color:var(--lab-color);touch-action:pan-y;}
.tone-sliders [data-slider=h]::-webkit-slider-runnable-track {background:linear-gradient(90deg,red,#ff0,#0f0,#0ff,#00f,#f0f,red);height:8px;border-radius:4px;}
.tone-sliders [data-slider=h]::-webkit-slider-thumb {margin-top:-4px;}
.tone-compare {display:flex;justify-content:center;gap:38px;margin-top:22px;}
.tone-compare>div {display:flex;align-items:center;flex-direction:column;gap:8px;font-size:13px;}
.tone-compare i {width:64px;height:64px;border:3px solid var(--surface);border-radius:6px;box-shadow:0 0 0 1px var(--line);}
.phrase-board {display:flex;flex-wrap:wrap;justify-content:center;gap:10px 16px;padding:10px 0;}
.phrase-board>div {display:flex;gap:3px;}
.phrase-board span {display:grid;place-items:center;width:27px;height:36px;border-radius:3px;background:var(--tile);border-bottom:2px solid var(--line);font-size:18px;font-weight:650;}
.phrase-board span.revealed {background:var(--surface);box-shadow:var(--raised-small);}
.phrase-wheel {position:relative;width:150px;height:150px;margin:12px auto;}
.phrase-wheel svg {width:100%;height:100%;}
.wheel-pointer {position:absolute;top:-3px;left:calc(50% - 8px);width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-top:16px solid var(--ink);z-index:1;}
.phrase-controls {display:grid;grid-template-columns:.9fr 1.4fr .9fr;gap:8px;margin:16px 0;}
.phrase-controls button {font-size:13px;padding:8px;min-height:46px;}
.lab-keyboard {display:flex;flex-direction:column;gap:7px;user-select:none;}
.lab-keyboard>div {display:flex;justify-content:center;gap:4px;}
.lab-keyboard button {width:calc((100% - 36px)/10);height:44px;min-width:0;padding:0;background:var(--surface);border:1px solid var(--line);border-radius:5px;font-size:15px;font-weight:600;box-shadow:0 2px 0 var(--line);}
.lab-keyboard button:active {transform:translateY(1px);box-shadow:none;}
.phrase-finish {text-align:center;margin:28px 0;}
.phrase-solve {display:grid;gap:10px;margin:16px 0;padding-top:16px;border-top:1px solid var(--line);}
.phrase-solve label {font-size:13px;}
.phrase-solve input {min-height:48px;width:100%;border:1px solid var(--line);border-radius:5px;background:var(--surface);padding:10px;font-size:16px;}
.phrase-solve>div {display:flex;gap:10px;justify-content:flex-end;}
.crossword-board {display:grid;grid-template-columns:repeat(var(--cols),minmax(0,1fr));grid-template-rows:repeat(var(--rows),minmax(0,1fr));aspect-ratio:var(--cols)/var(--rows);max-width:400px;margin:12px auto 0;gap:2px;background:var(--line);border:2px solid var(--line);}
.crossword-board button {position:relative;border:0;background:var(--surface);padding:0;min-width:0;font-size:21px;line-height:1;}
.crossword-board button small {position:absolute;top:3px;left:3px;font-size:9px;color:var(--muted);}
.crossword-board button.in-word {background:light-dark(#e7eef6,#334351);}
.crossword-board button.selected {background:light-dark(#bcd4ec,#456382);box-shadow:inset 0 0 0 2px var(--action);}
.crossword-board button.error span {color:light-dark(#bc4c41,#ffb4a9);text-decoration:underline;}
.crossword-black {background:light-dark(#657584,#353b44);}
.crossword-clue {display:flex;align-items:center;gap:3px;min-height:82px;margin:8px 0;}
.crossword-clue>span {flex:1;font-size:13px;line-height:19px;}
.crossword-clue strong {display:block;font-size:11px;color:var(--muted);margin-bottom:2px;}
.crossword-clue small {white-space:nowrap;}
.crossword-tools {display:flex;justify-content:space-between;align-items:center;margin:12px 0;}
.crossword-clues {border-top:1px solid var(--line);font-size:13px;}
.crossword-clues summary {padding:14px 0;cursor:pointer;min-height:44px;}
.crossword-clues h3 {font-size:12px;color:var(--muted);}
.crossword-clues button {display:block;text-align:left;min-height:44px;background:transparent;border:0;padding:8px 0;font-size:13px;line-height:20px;}
.lab-celebrate {text-align:center;margin:16px 0;}
.whizz-meta {display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;}
.whizz-mode {display:flex;background:var(--tile);border-radius:5px;padding:2px;}
.whizz-mode button {min-height:44px;min-width:58px;padding:0 10px;background:transparent;border:0;border-radius:4px;font-size:12px;}
.whizz-mode button[aria-pressed=true] {background:var(--surface);}
.whizz-scene {position:relative;width:calc(100% + 32px);margin:0 -16px;height:clamp(300px,48svh,500px);touch-action:none;}
.whizz-scene canvas {display:block;touch-action:none;}
.whizz-camera {position:absolute;right:8px;top:14px;display:flex;flex-direction:column;gap:3px;pointer-events:auto;}
.whizz-camera button {background:color-mix(in srgb,var(--page) 85%,transparent);width:44px;}
.whizz-inventory {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:6px 0 12px;}
.whizz-inventory button {display:grid;grid-template-columns:24px 1fr;align-items:center;gap:4px;text-align:left;min-height:64px;border:1px solid var(--line);border-radius:6px;background:var(--surface);padding:8px;font-size:12px;}
.whizz-inventory svg {width:23px;height:23px;grid-row:span 2;}
.whizz-inventory b {font-size:11px;font-weight:500;color:var(--muted);}
.whizz-inventory [aria-pressed=true] {border-color:var(--lab-color);box-shadow:inset 0 0 0 1px var(--lab-color);}
.whizz-actions {display:flex;justify-content:space-between;gap:8px;align-items:center;}
.whizz-actions>div {display:flex;}
.whizz-actions .primary-button {min-width:150px;min-height:46px;}
@media (max-height:700px) {.lab-packs{margin-bottom:8px}.phrase-wheel{height:118px;width:118px}.tone-scene svg{max-height:240px}.lab-header{margin-bottom:8px}.trivia-question{min-height:66px}.crossword-board{max-width:320px}.lab-card>svg{height:88px}}
@media (prefers-reduced-motion:reduce) {#test-room *{scroll-behavior:auto;transition:none}}
.trivia-credit { margin:18px 0 0; font-size:11px; line-height:17px; text-align:center; color:var(--muted); }
.trivia-credit a { color:inherit; text-underline-offset:3px; }
