/* v16 extension of the approved B blueprint. The stadium remains the main surface. */
:root { color-scheme: dark; }
::selection { background: var(--red); color: white; }
button, a { touch-action: manipulation; }
a.btn, a.icon-btn { text-decoration: none; color: inherit; }
#challengeApp { position: fixed; inset: 0; z-index: 2; display: grid; grid-template-rows: var(--header-h) auto minmax(0,1fr); padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#challengeApp .topbar { gap: 10px; }
.version { color: var(--text-dim); font-size: 16px; flex: 1; }
.mission-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 22px; background: #0b2240f2; border-bottom: 1px solid var(--line-soft); }
.mission-strip strong { font-size: 18px; margin-right: 18px; }
#missionHint { color: var(--text-dim); font-size: 16px; }
#missionTabs { display:flex; gap:6px; }
#missionTabs button { width:auto; padding:0 12px; white-space:nowrap; height:44px; border:1px solid var(--line-soft); background: var(--navy-800); border-radius:8px; font-weight:700; }
#missionTabs button[aria-current=step] { background:var(--red); border-color:var(--red-line); }
#missionTabs button.done::after { content:'✓'; margin-left:2px; color:var(--lime); font-size:16px; }
#battleOpponent { color:var(--gold); font-size:16px; }
.play-layout { position:relative; min-height:0; display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:12px; padding:12px; }
body:not([data-stage=setup]) .play-layout { grid-template-columns:minmax(0,1fr); }
#field { position:relative; min-height:0; overflow:hidden; border:1px solid #dceaff66; border-radius:4px; }
#arenaView { position:absolute; inset:0; }
.setup-panel { padding:14px; overflow:auto; scrollbar-color:var(--line) var(--navy-900); scrollbar-width:thin; display:flex; flex-direction:column; gap:13px; }
.setup-heading { display:flex; align-items:center; justify-content:space-between; }
.setup-heading h2 { font-size:20px; margin:0; }
.selected-equipment { display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid var(--line-soft); padding:0 0 10px; gap:8px; }
.selected-equipment span { display:block; color:var(--text-dim); font-size:16px; margin-bottom:4px; }
.selected-equipment strong { font-size:17px; }
.selected-equipment .text-btn { white-space:nowrap; }
#selectionLayer,#choiceTops { position:absolute; inset:0; pointer-events:none; }
.selection-heading { position:absolute; left:18px; top:18px; padding:12px 18px; }
.selection-heading h2 { margin:3px 0 5px; font-size:27px; }
.selection-heading p { margin:0; font-size:16px; color:var(--text-dim); }
#selectionStep { font-size:16px; color:var(--gold); }
.model-choice { position:absolute; width:130px; height:112px; transform:translate(-50%,-50%); background:transparent; border:2px solid transparent; border-radius:50%; padding:0; cursor:pointer; pointer-events:auto; }
.model-choice:hover,.model-choice:focus-visible { border-color:var(--gold); background:#e4eff610; }
.model-choice:active { border-color:var(--red); }
.model-choice .model-label { position:absolute; left:50%; top:100%; transform:translateX(-50%); min-width:132px; padding:8px 12px; white-space:nowrap; background:#0b2240f2; border:1px solid #a8c2dc; border-radius:4px; }
.model-choice strong,.model-choice small { display:block; }
.model-choice strong { font-size:17px; }
.model-choice small { margin-top:4px; color:#d6e4f1; font-size:16px; }
.model-choice:disabled { opacity:.45; cursor:default; }
.selection-back { position:absolute; bottom:16px; left:16px; pointer-events:auto; }
.setup-panel fieldset { margin:0; padding:0; border:0; min-width:0; }
.setup-panel legend { margin-bottom:7px; font-size:16px; font-weight:700; }
.setup-panel small { color:var(--text-dim); font-size:16px; font-weight:400; margin-left:4px; }
.choices { display:flex; gap:5px; }
.choices button { flex:1; padding:7px 4px; min-height:44px; background:#071a30b3; border:1px solid var(--line-soft); border-radius:5px; font-size:16px; }
.choices button[aria-pressed=true] { background:var(--navy-700); color:white; border:2px solid var(--lime); }
.choices button:disabled { opacity:.52; }
.choices button[aria-pressed=true]:disabled { opacity:1; }
.choices[data-locked=true] button[aria-pressed=false] { display:none; }
.choices[data-locked=true] button[aria-pressed=true] { border:1px solid var(--line-soft); background:#0b224080; text-align:left; padding-left:12px; }
button:focus-visible,a:focus-visible { outline:3px solid var(--gold); outline-offset:2px; }
.rail-hint { margin:0; color:#d1e7fb; font-size:16px; line-height:1.5; }
#readyBtn { width:100%; margin-top:auto; flex-shrink:0; }
#placementSurface { position:absolute; inset:0; touch-action:none; cursor:crosshair; }
.top-drag-target { position:absolute; transform:translate(-50%,-50%); width:84px; height:84px; padding:0; border:2px dashed #d9efff; border-radius:50%; background:transparent; color:#fff; cursor:grab; touch-action:none; box-shadow:0 0 0 4px #193e6560; }
.top-drag-target span { position:absolute; left:50%; top:calc(100% + 7px); transform:translateX(-50%); white-space:nowrap; border:1px solid #c2d8ec80; padding:4px 8px; background:#0b2240ee; font-size:16px; border-radius:4px; pointer-events:none; }
#placementSurface[data-dragging=true],#placementSurface[data-dragging=true] .top-drag-target { cursor:grabbing; }
#placementSurface[data-dragging=true] .top-drag-target { border-style:solid; border-color:var(--lime); }
.top-drag-target[data-invalid=true] { border-color:var(--red); }
#fieldCaption { position:absolute; left:12px; bottom:12px; background:#071a30db; color:#eef5fc; font-size:16px; line-height:1.5; padding:7px 11px; max-width:calc(100% - 24px); border:1px solid #a8c2dc80; pointer-events:none; }
body:not([data-stage=setup]) #fieldCaption { display:none; }
.battle-hud { position:absolute; top:12px; left:12px; right:12px; display:flex; justify-content:space-between; gap:12px; pointer-events:none; }
.clock-block { display:flex; flex-direction:column; gap:3px; padding:10px 16px; min-width:150px; }
.clock-block>span { color:var(--text-dim); font-size:16px; }
.clock-block strong { font-size:44px; line-height:1.05; }
.clock-block #objectiveText { color:white; margin-top:5px; }
.top-status { align-self:start; display:flex; flex-direction:column; gap:5px; padding:10px 14px; font-size:16px; }
#playerStatus { color:#cae4ff; } #cpuStatus { color:#ffdc85; }
#dashCount { color:var(--text-dim); font-size:16px; }
#handRig, #cpuHandRig { position:absolute; inset:0; pointer-events:none; overflow:hidden; }
#handRig img, #cpuHandRig img { position:absolute; left:0; top:0; height:auto; max-width:none; }
#launchControls { position:absolute; right:16px; top:16px; width:230px; display:flex; flex-direction:column; gap:10px; padding:14px 18px; }
#countdownText { text-align:center; font-size:46px; line-height:1.05; }
#launchControls .gauge { height:22px; position:relative; overflow:hidden; background:#061425; border:1px solid var(--line); }
.good-zone { position:absolute; left:63.81%; width:15.24%; top:0; bottom:0; background:#278054; }
.perfect-zone { position:absolute; left:68.57%; width:5.71%; top:0; bottom:0; background:#b9f0ba; }
#needle { position:absolute; top:-2px; bottom:-2px; width:4px; background:white; box-shadow:0 0 1px #000; transform:translateX(-50%); }
.gauge-labels { display:flex; justify-content:space-between; font-size:16px; color:var(--text-dim); }
#editSetup { font-size:16px; min-height:32px; }
.boost-notice { position:absolute; z-index:11; left:50%; top:20%; transform:translateX(-50%); padding:10px 20px; background:#071a30ee; border:2px solid var(--gold); color:#ffe7a2; font-size:22px; font-weight:800; white-space:nowrap; pointer-events:none; }
#pauseLayer { position:absolute; inset:0; display:grid; place-items:center; background:#071a30a6; z-index:12; }
.pause-panel { width:min(440px,90%); text-align:center; }
.pause-panel h2 { margin-top:4px; } .pause-panel p { line-height:1.6; color:var(--text-dim); }
.pause-panel .btn { margin:4px; }
.challenge-results { position:absolute; width:min(470px,calc(100% - 24px)); right:12px; bottom:12px; padding:22px; z-index:10; max-height:90%; overflow:auto; animation:sheet-in .35s cubic-bezier(.16,1,.3,1); }
.challenge-results h2 { margin:0 60px 7px 0; font-size:28px; }
.challenge-results p { line-height:1.55; margin:8px 0; }
#bestTimes p { margin:2px 0; }
#resultSummary.free-time { font-size:30px; }
#resultSummary { color:var(--gold); font-size:17px; font-weight:700; }
.result-collapse { position:absolute; right:15px; top:10px; }
.result-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:15px; }
.result-actions .btn { padding:10px 14px; font-size:16px; flex:1; white-space:nowrap; }
.challenge-results.collapsed { padding:13px 18px; }
.challenge-results.collapsed h2 { font-size:20px; }
.challenge-results.collapsed #resultBody,.challenge-results.collapsed .result-actions { display:none; }
@keyframes sheet-in { from { transform:translateY(45px); } to { transform:translateY(0); } }
@media(max-width:900px) {
 .play-layout { grid-template-columns:minmax(0,1fr) 260px; gap:8px; padding:8px; }
 #launchControls { top:72px; }
 .setup-panel { padding:12px; gap:9px; }
 .mission-strip { padding:7px 12px; }
 #missionHint { display:block; margin-top:4px; }
}
@media (orientation:portrait) and (max-width:900px) and (min-width:621px) {
 .play-layout { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto; }
 body:not([data-stage=setup]) .play-layout { grid-template-rows:minmax(0,1fr); }
 .setup-panel { display:grid; grid-template-columns:1fr 1fr; gap:8px 12px; max-height:40dvh; }
 .setup-heading,.selected-equipment,#helpText,#opponentField,#goalField,.rail-hint,#readyBtn { grid-column:1/-1; }
 #readyBtn { margin-top:0; }
}
@media(max-width:620px) {
 #challengeApp .topbar { padding:5px 8px; gap:6px; }
 #challengeApp .logo { height:32px; padding:3px 6px; }
 #challengeApp .bp-title { padding:5px 8px; gap:8px; }
 #challengeApp .bp-title h1 { font-size:17px; letter-spacing:0; }
 #challengeApp .level-no { display:none; } .version { display:none; }
 #challengeApp .top-actions { margin-left:auto; gap:4px; }
 #challengeApp .icon-btn { width:44px; height:44px; flex:0 0 44px; }
 .mission-strip { min-height:66px; gap:7px; }
 .mission-strip strong { font-size:16px; margin-right:0; }
 #missionHint { font-size:16px; max-width:240px; }
 #missionTabs { gap:3px; } #missionTabs button { width:auto; padding:0 4px; font-size:16px; height:44px; border-radius:5px; }
 #battleOpponent { font-size:16px; max-width:105px; }
 .play-layout { grid-template-columns:1fr; grid-template-rows:minmax(180px,1fr) auto; gap:6px; padding:6px; }
 body:not([data-stage=setup]) .play-layout { grid-template-rows:minmax(0,1fr); }
 .setup-panel { display:grid; grid-template-columns:1fr 1fr; gap:8px 12px; max-height:42dvh; padding:10px 12px; }
 .setup-heading { grid-column:1/-1; } .setup-heading h2 { font-size:16px; }
 .selected-equipment { grid-column:1/-1; padding-bottom:6px; }
 .selected-equipment strong { font-size:16px; }
 .selection-heading { top:10px; left:10px; right:10px; padding:10px 12px; }
 .selection-heading h2 { font-size:22px; }
 .selection-heading p { font-size:16px; }
 .model-choice { width:88px; height:84px; }
 .model-choice .model-label { min-width:108px; padding:6px 8px; }
 .model-choice strong { font-size:16px; }
 .model-choice small { font-size:16px; }
 .setup-heading .text-btn { min-height:44px; }
 .setup-panel legend { font-size:16px; margin-bottom:4px; }
 .setup-panel small { font-size:16px; }
 .choices button { font-size:16px; padding:4px; min-height:44px; }
 #helpText,#opponentField,#goalField,.rail-hint,#readyBtn { grid-column:1/-1; }
 .rail-hint { display:none; }
 #readyBtn { min-height:46px; font-size:16px; position:sticky; bottom:0; z-index:5; box-shadow:0 -8px 12px rgba(7,26,48,.8); }
 #fieldCaption { font-size:16px; bottom:7px; left:7px; padding:4px 7px; }
 .top-drag-target { width:60px; height:60px; }
 .top-drag-target span { font-size:16px; padding:3px 6px; }
 #launchControls { right:8px; top:72px; width:176px; padding:10px; gap:7px; }
 #launchControls .btn { min-height:48px; padding:8px; }
 #countdownText { font-size:34px; }
 .battle-hud { top:7px; left:7px; right:7px; gap:5px; }
 .clock-block { padding:8px 10px; min-width:112px; }
 .clock-block strong { font-size:34px; }
 .clock-block>span { font-size:16px; }
 .top-status { padding:8px 9px; font-size:16px; }
 .boost-notice { top:27%; font-size:18px; }
 .challenge-results { padding:16px; }
 .challenge-results h2 { font-size:23px; }
}
@media (orientation:portrait) and (max-width:900px) {
 body[data-stage=result] #field { display:grid; grid-template-rows:minmax(0,1fr) auto; }
 body[data-stage=result] #arenaView { position:relative; inset:auto; min-height:0; }
 body[data-stage=result] .challenge-results { position:relative; width:auto; right:auto; bottom:auto; max-height:40dvh; animation:none; }
}
@media(prefers-reduced-motion:reduce) { .challenge-results { animation:none; } }
.scoreboard { position:absolute; left:50%; top:12px; transform:translateX(-50%); padding:9px 16px; font-size:18px; font-weight:800; z-index:4; white-space:nowrap; }
.fast-btn { position:absolute; bottom:14px; right:14px; z-index:5; min-height:44px; }
.replay-banner { position:absolute; z-index:8; left:50%; top:12px; transform:translateX(-50%); display:flex; gap:14px; align-items:center; font-size:20px; white-space:nowrap; }
.fast-btn[aria-pressed=true] { border-color:var(--gold); color:var(--gold); }
body[data-stage=lab] .mission-strip { display:none; }
body[data-stage=lab] #challengeApp { grid-template-rows:var(--header-h) minmax(0,1fr); }
body[data-stage=lab] .play-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(320px,400px); grid-template-rows:minmax(0,1fr); }
.lab-panel:not([hidden]) { position:relative; z-index:10; overflow:auto; display:block; padding:16px; min-height:0; }
.lab-head,.lab-tabs,.lab-options { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
.prediction-cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
.prediction-cards .btn { display:flex; flex-direction:column; gap:2px; padding:6px; min-width:0; font-size:16px; }
.prediction-cards img { width:100%; height:65px; object-fit:contain; filter:brightness(1.35); }
.prediction-cards span { white-space:normal; }
.lab-head { justify-content:space-between; font-size:20px; }
.lab-tabs { margin:16px 0; }
.lab-tabs [aria-pressed=true],.lab-options [aria-pressed=true] { border-color:var(--gold); background:var(--navy-700); }
.lab-body { max-width:900px; margin:18px auto; font-size:18px; line-height:1.55; }
.lab-body h2 { font-size:26px; }
.lab-body .btn { min-height:44px; margin:6px 5px 6px 0; }
.lab-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:12px; }
.lab-cards article { padding:16px; border:1px solid var(--line); background:#102a49; }
.lab-bars>div { display:grid; grid-template-columns:145px minmax(50px,1fr) 100px; gap:10px; align-items:center; margin:12px 0; }
.lab-track { height:24px; background:#061425; border:1px solid var(--line); }
.lab-track i { display:block; width:0; height:100%; background:var(--gold); }
.lab-tips>div:nth-child(1)>span,.lab-cards article:nth-child(1) h3 { color:#9bd1ff; }
.lab-tips>div:nth-child(2)>span,.lab-cards article:nth-child(2) h3 { color:#a9edac; }
.lab-tips>div:nth-child(3)>span,.lab-cards article:nth-child(3) h3 { color:#ffb2ad; }
.lab-top { display:block; width:78px; height:65px; object-fit:contain; }
.lab-top.turning { animation:lab-spin .45s linear infinite; }
@keyframes lab-spin { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { .lab-top.turning { animation:none; } }
.lab-timer { display:block; font-size:48px; }
.lab-gauge { width:min(400px,100%); height:28px; position:relative; overflow:hidden; background:#061425; border:1px solid var(--line); }
#labNeedle { position:absolute; top:0; bottom:0; width:4px; background:white; transform:translateX(-50%); }
@media (orientation:portrait) and (max-width:900px) { body[data-stage=lab] .play-layout { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(190px,1fr) minmax(230px,44dvh); } }
@media(max-width:620px) { .lab-panel:not([hidden]) { padding:12px; } .lab-bars>div { grid-template-columns:100px minmax(40px,1fr) 70px; font-size:16px; } }
@media(min-width:901px) {
 #challengeApp { font-size:16px; }
 #challengeApp p,#challengeApp small,#challengeApp span,#challengeApp button,#challengeApp a,#challengeApp td,#challengeApp th,#challengeApp li,#challengeApp .steps b { font-size:max(16px,1em); }
 #missionHint,.selection-heading p,.rail-hint,#fieldCaption,.top-drag-target span,.clock-block>span,.top-status,#dashCount,.tip-stats,.setup-panel legend,.choices button { font-size:16px; }
 #challengeApp small,#selectionStep,.model-choice small,.version,.selected-equipment span,.gauge-labels { font-size:16px; }
 #editSetup,.setup-heading .text-btn { min-height:44px; }
}
.tip-stats { line-height:1.55; }
.setup-heading .text-btn,#editSetup { min-height:44px; }
@media(min-width:901px) { #challengeApp .tray { gap:5px; } #challengeApp .part-group { gap:3px; } #challengeApp .piece { min-height:70px; } #challengeApp .part-group:last-of-type .piece { min-height:88px; } #challengeApp .tip-stats { margin:2px 0; line-height:1.35; } }
#challengeApp .piece[data-part=tip] { background:#365578; }
#challengeApp .piece[data-part=tip] img { filter:brightness(1.55) drop-shadow(0 3px 3px rgba(0,0,0,.45)); }
.team-tabs { display:flex; flex-wrap:wrap; gap:6px; justify-content:center; }
.team-tabs button { min-height:44px; padding:8px 12px; border:1px solid #a6c4e0; background:#f0f6fb; color:#0b2240; font:inherit; }
.team-tabs button[aria-pressed=true] { background:#164d7a; color:white; }
.tournament-panel:not([hidden]) { position:absolute; inset:58px 0 0; z-index:30; overflow:auto; display:grid; place-items:center; padding:20px; background:#061d36eF; }
.tournament-card { width:min(700px,100%); max-height:100%; overflow:auto; padding:24px; color:#102c48; background:#f5f9fc; border:3px solid #87add0; box-shadow:0 12px 36px #0007; }
.tournament-card h2 { margin:0 0 10px; font-size:clamp(24px,4vw,38px); }
.tournament-card p { font-size:18px; line-height:1.45; }
.tournament-card .btn-line { color:#fff; }
.round-top { display:block; width:min(260px,70%); max-height:220px; object-fit:contain; }
.tournament-actions { display:flex; gap:10px; flex-wrap:wrap; margin:16px 0; }
.tournament-actions .btn { min-height:48px; }
.tournament-card table { width:100%; border-collapse:collapse; margin:12px 0; font-size:16px; }
.tournament-card th,.tournament-card td { text-align:left; border-bottom:1px solid #b2c7d7; padding:7px; }
.tournament-card tr.player { background:#d4e9f8; font-weight:800; }
@media(max-width:620px) { .tournament-panel:not([hidden]) { inset:48px 0 0; padding:10px; } .tournament-card { padding:15px; } .tournament-card p { font-size:16px; } }

/* Wider timing control on large screens, while fitting the available field on phones. */
#launchControls { width:min(400px,calc(100% - 32px)); }
#launchControls .gauge { min-height:26px; }
@media(max-width:620px) { #launchControls { width:min(400px,calc(100% - 16px)); } }
/* Battle uses the blueprint floor; the workbench belongs to assembly only. */
body[data-screen=level]:not([data-stage=bench]) #bg { background-color:#071a30; background-image:linear-gradient(#9bc5e01c 1px,transparent 1px),linear-gradient(90deg,#9bc5e01c 1px,transparent 1px); background-size:32px 32px; }
body[data-screen=level]:not([data-stage=bench]) #bg::after { background:radial-gradient(ellipse at center,transparent,#071a30b0); }
body[data-level="2"] .battle-hud { top:65px; align-items:start; }
.spin-side { width:min(27%,230px); padding:7px 10px; color:white; background:#071a30df; border:1px solid #aac6df; font-weight:700; }
.cpu-spin { text-align:right; }
.spin-track { height:16px; background:#07101b; border:1px solid #bbd5e7; overflow:hidden; }
.spin-track i { display:block; height:100%; width:100%; background:#2e8bef; transition:width .1s linear; }
.cpu-spin .spin-track i { margin-left:auto; background:#e94450; }
.scout-cards {display:flex;gap:8px;flex-wrap:wrap;margin:8px 0 16px}.scout-card {flex:1 1 130px;min-width:0;border:1px solid #87add0;padding:8px;display:flex;align-items:center;flex-direction:column;text-align:center;font-size:16px}.scout-card img {width:90px;height:75px;object-fit:contain}.scout-card span{font-size:16px}
.scout-card { background:#0b2240; }
.cord-control span {font-size:16px}.cord-control button {min-height:44px;font-size:16px;font-weight:bold}.cord-control>div {display:flex;align-items:center}.cord-control button {touch-action:none;background:#ffcf54;color:#102c48;border:2px solid white;padding:4px 12px}.cord-control i {display:block;width:35px;height:4px;background:white}.auto-speed {position:absolute;z-index:7;right:16px;bottom:70px;padding:6px 10px;font-size:16px;color:white;background:#092540}
.tournament-card { color:#eef6ff; background:#0b2240; border-color:#86add0; }
.tournament-card tr.player { background:#24577d; color:#fff; }
.order-cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.order-card { display:flex; flex-direction:column; align-items:center; gap:4px; min-width:0; padding:8px 4px; color:#fff; }
.order-card[aria-pressed=true] { border-color:#e7c858; background:#205073; }
.order-card::before { background:#0b2240; }
.order-card[aria-pressed=true]::before { background:#205073; }
.scout-card img,.order-card img { width:90px; max-width:100%; height:75px; object-fit:contain; background:transparent; filter:brightness(2.3) drop-shadow(0 0 3px #a5c8e5); }
.order-card b { color:#ffe087; }
@media (max-width:900px) { .scout-card img,.order-card img { height:65px; } }
body[data-stage=bench] #bg { background:#101922; }
body[data-stage=bench] #bg::after { display:none; }
#challengeApp .bench-viewport { --bench-strip-height:160px; display:none; position:relative; min-width:0; min-height:0; overflow:hidden; grid-row:3; }
body[data-stage=bench] #challengeApp .bench-viewport { display:block; }
body[data-stage=bench] .play-layout { display:none; }
body[data-stage=bench] #challengeApp .bench { display:block; margin:0; padding:0; }
#route[hidden] { display:none; }
#route { position:fixed; inset:0; z-index:30; display:grid; place-items:center; background:#061022ee; padding:16px; }
#route .card { width:min(1120px,100%); max-height:100%; overflow:auto; background:#f7f4ee; color:#17202d; padding:16px 20px; }
#route header { position:static; display:flex; justify-content:space-between; }
#route h2 { margin:0; font-size:26px; color:#17202d; }
#route svg { display:block; width:100%; height:auto; stroke:none; paint-order:normal; -webkit-text-stroke:0; text-shadow:none; }
#route svg text { stroke:none; paint-order:normal; -webkit-text-stroke:0; text-shadow:none; }
#route svg text[font-size="16"],#route svg text[font-size="17"] { font-size:17px; }
@media (min-width:1000px) and (max-width:1119px) { #route svg text[font-size] { font-size:20px; } }
@media (min-width:701px) and (max-width:999px) { #route svg text[font-size] { font-size:clamp(24px,calc(37.4px - 1.34vw),28px); } }
@media (max-width:700px) { #route svg { min-width:1036px; } }
#route p { margin:6px 0 0; text-align:center; font-weight:800; font-size:18px; color:#b0121c; }
#routeClose { min-width:44px; min-height:44px; color:#fff; background:#0b2a5c; }

/* The scene is rendered into the shared canvas; the list stays keyboard accessible. */
body[data-stage=bench] #gl { z-index:1; }
#benchScene { position:absolute; inset:0 0 var(--bench-strip-height); z-index:0; touch-action:manipulation; }
body[data-stage=bench] #challengeApp .bench,
body[data-stage=bench] #challengeApp .bench.portrait { position:absolute; inset:0; width:auto; height:auto; transform:none; background:none; pointer-events:none; }
#partButtons { position:absolute; left:-10000px; bottom:0; width:320px; max-height:var(--bench-strip-height); overflow:auto; background:#0b2240; z-index:4; pointer-events:auto; padding:12px; }
#partButtons:focus-within { left:12px; }
#partButtons h2,#partButtons h3 { margin:6px 0; font-size:16px; }
#partButtons .piece { min-width:44px; min-height:44px; padding:6px 10px; font-size:16px; background:#173c60; border:1px solid #abc; color:white; }
#partButtons .piece[aria-pressed=true] { border:3px solid #e5ce60; }
#challengeApp .bench .station,body[data-level="1"] #challengeApp .bench .station { position:absolute; inset:auto 0 0; width:100%; height:var(--bench-strip-height); display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:44px minmax(0,1fr); gap:6px 12px; padding:8px 12px; background:#0b2240f5; border:0; border-radius:0; pointer-events:none; }
#challengeApp .bench .station button { pointer-events:auto; min-height:44px; font-size:16px; }
#challengeApp .bench .team-tabs { grid-column:1; grid-row:1; display:flex; justify-self:start; gap:4px; }
#challengeApp .bench .steps { grid-column:2; grid-row:1; justify-self:stretch; width:100%; min-width:0; overflow:auto; background:#0b2240e8; margin:0; padding:0; }
body[data-level="1"] #challengeApp .bench .steps { grid-column:1 / -1; }
#challengeApp .bench .steps li { min-width:0; white-space:nowrap; }
#challengeApp .bench .steps li span { overflow:hidden; text-overflow:ellipsis; }
#challengeApp .bench .steps li,#challengeApp .bench .steps li b,#challengeApp .bench .steps li span,#challengeApp .bench .station p { font-size:16px; }
#challengeApp .bench .tip-stats,#challengeApp .bench .ready-hint { grid-column:1; grid-row:2; justify-self:stretch; max-height:100%; overflow:auto; pointer-events:auto; background:transparent; color:#fff; padding:6px 9px; margin:0; text-align:left; }
#challengeApp .bench .station-actions { grid-column:2; grid-row:2; pointer-events:auto; }
@media(max-width:700px) {
 #challengeApp .bench-viewport { --bench-strip-height:224px; }
 #challengeApp .bench .station,body[data-level="1"] #challengeApp .bench .station { grid-template-rows:44px 44px minmax(0,1fr); }
 #challengeApp .bench .team-tabs { grid-column:1 / -1; grid-row:1; }
 #challengeApp .bench .steps { grid-column:1 / -1; grid-row:2; }
 body[data-level="1"] #challengeApp .bench .steps { grid-row:1; }
 #challengeApp .bench .tip-stats,#challengeApp .bench .ready-hint,#challengeApp .bench .station-actions { grid-row:3; }
 #challengeApp .bench .station-actions { gap:4px; }
 #challengeApp .bench .station-actions .btn { min-width:0; padding:8px; }
}
.match-overlay[hidden] { display:none; }
.match-overlay { position:fixed; inset:0; z-index:35; }
#vsOverlay { display:grid; grid-template-columns:1fr 1fr; overflow:hidden; cursor:pointer; }
.vs-side { display:flex; flex-direction:column; justify-content:center; gap:14px; padding:0 6vw; }
.vs-a { background:linear-gradient(120deg,#b0121c,#6d0a12); clip-path:polygon(0 0,108% 0,92% 100%,0 100%); align-items:flex-start; animation:vs-left .32s both; }
.vs-b { background:linear-gradient(240deg,#0b2a5c,#061636); clip-path:polygon(8% 0,100% 0,100% 100%,-8% 100%); align-items:flex-end; animation:vs-right .32s both; }
.vs-side h2 { margin:0; font-size:clamp(30px,5.4vw,68px); }
.vs-tips { display:flex; gap:14px; }
.vs-tips figure { margin:0; text-align:center; font-size:16px; font-weight:800; }
.vs-tips img { display:block; max-width:100%; height:clamp(50px,10vw,130px); margin:0 auto 4px; filter:drop-shadow(0 6px 8px #0008) brightness(1.5); }
.vs-mark { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); font-size:clamp(70px,14vw,190px); font-style:italic; color:#e5ce60; text-shadow:0 8px 0 #0009; }
@keyframes vs-left { from { transform:translateX(-100%); } } @keyframes vs-right { from { transform:translateX(100%); } }
#pocketFinish { display:grid; place-items:center; pointer-events:none; overflow:hidden; }
#pocketFinish::before { content:''; position:absolute; inset:-50%; background:repeating-conic-gradient(#fff5 0 3deg,#fff0 3deg 14deg); animation:pocket-burst 1.5s both; }
#pocketFinish b { position:relative; font-size:clamp(56px,11vw,150px); font-weight:900; color:#fff; -webkit-text-stroke:3px #b0121c; text-shadow:0 10px 0 #0b2a5c; }
@keyframes pocket-burst { from { transform:scale(.4); opacity:1; } to { transform:scale(1.2) rotate(20deg); opacity:0; } }
@media (prefers-reduced-motion:reduce) { .vs-side,#pocketFinish::before { animation:none; } }

/* v16.12: the 3D bench fills the screen; the controls sit in a floating message box from 小軸博士. */
#benchScene { inset:0; touch-action:none; cursor:grab; }
#benchScene:active { cursor:grabbing; }
.bench-view-tools { position:absolute; top:10px; right:12px; z-index:3; display:flex; align-items:center; gap:8px; pointer-events:none; }
.bench-view-tools span { padding:6px 12px; border-radius:999px; background:#0b2240cc; color:#fff; font-size:16px; font-weight:700; }
.bench-view-tools button { pointer-events:auto; min-height:44px; padding:0 16px; border-radius:999px; border:2px solid #0b2240; background:#fffdf7; color:#0b2240; font-size:16px; font-weight:800; cursor:pointer; }
body:not([data-stage=bench]) .bench-view-tools { display:none; }
#challengeApp .bench .station,body[data-level="1"] #challengeApp .bench .station {
  inset:auto auto 12px 50%; transform:translateX(-50%); width:min(980px,calc(100% - 24px)); height:auto; min-height:0;
  grid-template-rows:auto auto; padding:22px 16px 12px; border-radius:18px; background:#fffdf7f7; color:#14181f;
  border:3px solid #0b2240; box-shadow:0 10px 28px #0006; overflow:visible; }
#challengeApp .bench .station::after { content:""; position:absolute; left:42px; bottom:-14px; width:22px; height:22px; background:#fffdf7; border-right:3px solid #0b2240; border-bottom:3px solid #0b2240; transform:rotate(45deg); }
#challengeApp .bench .msg-name { position:absolute; top:-17px; left:18px; padding:4px 14px; border-radius:999px; background:#b0121c; color:#fff; font-size:16px; font-weight:900; letter-spacing:.04em; }
#challengeApp .bench .steps { background:transparent; gap:6px; }
#challengeApp .bench .steps li { background:#eef1f5; color:#3b4656; clip-path:none; border-radius:999px; }
#challengeApp .bench .steps li.next { background:#b0121c; color:#fff; }
#challengeApp .bench .steps li.done { background:#e3f3e6; color:#1d6b3a; }
#challengeApp .bench .tip-stats,#challengeApp .bench .ready-hint { color:#14181f; font-size:18px; font-weight:700; }
#challengeApp .bench .team-tabs button { color:#0b2240; }
@media (max-width:900px), (orientation:portrait) {
  #challengeApp .bench .station,body[data-level="1"] #challengeApp .bench .station { grid-template-rows:auto auto auto; }
  .bench-view-tools span { display:none; }
}

/* Five short lab stations use the same message-card language as the bench. */
#challengeApp .lab-panel:not([hidden]) { background:transparent; color:#0b2240; border:0; border-radius:0; box-shadow:none; }
.lab-doctor { display:inline-block; padding:6px 16px; border-radius:999px; background:#b0121c; color:white; }
.lab-tabs { gap:6px; }
.lab-tabs span { padding:7px 10px; border-radius:999px; background:#e8edf2; color:#0b2240; font-size:16px; }
.lab-tabs span[aria-current=step] { background:#b0121c; color:white; }
#challengeApp .lab-panel button,#challengeApp .lab-panel a.btn { min-height:44px; min-width:44px; font-size:16px; }
#challengeApp .lab-panel .btn-line { background:#fff; color:#0b2240; border:2px solid #0b2240; }
#challengeApp .lab-panel .btn-line[aria-pressed=true] { background:#e4eefb; border-color:#b0121c; }
.contact { max-width:220px; margin:12px auto; }
.contact img { display:block; width:100%; height:100px; object-fit:contain; }
.ground { height:8px; background:#0b2240; position:relative; }
.ground i { display:block; position:absolute; top:-4px; left:50%; transform:translateX(-50%); height:8px; border-radius:50%; background:#d0001b; }
.ground i.large { width:80px; }.ground i.medium { width:36px; }.ground i.point { width:8px; }
.friction-bar { height:14px; background:#d0001b; border-radius:8px; }.friction-bar.large { width:100%; }.friction-bar.medium { width:55%; }.friction-bar.point { width:15%; }
.trail-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.trail-choice svg { display:block; width:100%; max-height:150px; }.trail-choice span { display:block; }
@media(max-width:620px) { .lab-tabs span { padding:5px; } .trail-choice { padding:4px; } }

/* Feedback round 1: readable controls and station-specific layouts. */
body[data-stage=lab] .play-layout.lab-wide { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); padding:12px; justify-items:center; }
body[data-stage=lab] .play-layout.lab-wide #field { display:none; }
body[data-stage=lab] .play-layout.lab-wide .lab-panel:not([hidden]) { width:min(760px,100%); max-height:100%; align-self:center; }
@media (orientation:portrait) { body[data-stage=lab] .play-layout.lab-wide .lab-panel:not([hidden]) { width:100%; } }
#challengeApp .lab-panel::before,#challengeApp .lab-panel .btn::before,#challengeApp .lab-panel .btn-primary::after { content:none; }
#challengeApp .lab-panel .btn-primary:not(:disabled) { background:#b0121c; color:#fff; border:2px solid #b0121c; }
#challengeApp .lab-panel .btn-primary:disabled { background:#c9ced6; color:#3b4656; border:2px solid #c9ced6; opacity:1; }
#challengeApp .lab-panel .btn-line:hover { background:#eef3f9; color:#0b2240; }
#challengeApp .lab-panel .btn:focus-visible { outline:3px solid #0b6b3e; outline-offset:2px; }
.lab-disabled-reason { color:#3b4656; font-weight:700; margin:8px 0; }
.prediction-cards { gap:12px; }
#challengeApp .prediction-cards .prediction-choice { position:relative; display:flex; flex-direction:column; gap:8px; min-height:200px; padding:12px; border-radius:12px; }
.prediction-choice img { height:120px; width:100%; object-fit:contain; }
.prediction-choice .choice-badge { position:absolute; top:8px; left:8px; display:grid; place-items:center; width:30px; height:30px; border-radius:50%; background:#0b2a5c; color:#fff; font-weight:800; }
.contact-cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
#challengeApp .lab-panel .contact-card { display:flex; flex-direction:column; align-items:stretch; justify-content:flex-start; gap:8px; min-width:0; padding:12px; border-radius:12px; white-space:normal; text-align:center; }

.contact-card .contact { display:block; width:100%; margin:4px auto; overflow:visible; }
.contact-card .contact svg { display:block; width:100%; height:100px; transition:transform .2s ease; }

.contact-card .ground { display:block; }
.friction-track { display:block; width:100%; height:14px; background:#e0e5ea; border-radius:8px; }
.friction-track .friction-bar { display:block; }
.quiz-options { display:grid; grid-template-columns:minmax(0,1fr); }
#challengeApp .lab-panel .quiz-options .btn { width:100%; margin:0; justify-content:flex-start; text-align:left; white-space:normal; }
.lab-bars>div { grid-template-columns:60px minmax(50px,1fr) 76px; gap:8px; }
.lab-track { background:#e0e5ea; border-color:#0b2240; }
.lab-track .tip-flat,.lab-bars .tip-flat .lab-track i,.lab-top-tag.tip-flat { background:#b0121c; }
.lab-bars .tip-round .lab-track i,.lab-top-tag.tip-round { background:#0b6b3e; }
.lab-bars .tip-cone .lab-track i,.lab-top-tag.tip-cone { background:#0b2a5c; }
#labTopTags { position:absolute; inset:0; z-index:5; pointer-events:none; }
.lab-top-tag { position:absolute; transform:translate(-50%,-100%); padding:5px 8px; border:2px solid #fff; border-radius:7px; color:#fff; font-size:16px; font-weight:800; line-height:1.2; white-space:nowrap; box-shadow:0 2px 4px #0008; }
.trail-grid { grid-template-columns:repeat(auto-fit,minmax(188px,1fr)); }
#challengeApp .lab-panel .trail-choice { display:flex; flex-direction:column; align-items:center; gap:4px; min-width:188px; margin:0; padding:8px; }
.trail-choice svg { width:168px; height:168px; max-height:none; flex:none; }
@media (max-width:620px) {
  .prediction-cards { gap:6px; }
  #challengeApp .prediction-cards .prediction-choice { min-height:180px; padding:6px; }
  .contact-cards { gap:6px; }
  #challengeApp .lab-panel .contact-card { padding:6px; }
}
@media (prefers-reduced-motion:reduce) { .contact-card .contact svg { transition:none; } }

/* Shared spoken guidance and independent fair-test views. */
.fair-panels { display:grid; grid-template-columns:repeat(3,minmax(220px,1fr)); gap:10px; }
.fair-panel { min-width:220px; text-align:center; color:#0b2240; }
.fair-name { display:block; padding:5px; color:white; background:#0b2a5c; }
.tip-flat .fair-name,.tip-flat .lab-track i { background:#b0121c; }
.tip-round .fair-name,.tip-round .lab-track i { background:#0b6b3e; }
.tip-cone .lab-track i { background:#0b2a5c; }
.fair-bowl { width:100%; height:200px; background:transparent; }
body[data-stage=lab] .play-layout.lab-wide .lab-panel:not([hidden]) { width:min(1000px,100%); }
.scout-card img,.order-card img { filter:none; }
@media (orientation:portrait) { .fair-panels { grid-template-columns:1fr; } }
@media (prefers-reduced-motion:reduce) { .message-box { animation:none; transition:none; } }

/* Message boxes occupy their own rows and never cover controls or the three views. */
body[data-stage=choose-tip] #field { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr); }
body[data-stage=choose-tip] #selectionHeader { grid-column:1; grid-row:1; position:relative; display:flex; align-items:center; gap:12px; padding:8px; background:#0b2240; }
body[data-stage=choose-tip] #arenaView,body[data-stage=choose-tip] #selectionLayer { grid-column:1; grid-row:2; position:relative; inset:auto; min-height:0; }
body[data-stage=choose-tip] .selection-heading { position:static; padding:0 8px; flex:0 0 auto; }
body[data-stage=choose-tip] .selection-message { flex:1; margin:4px 0 12px; }
#challengeApp .selection-message p,#challengeApp .selection-message #missionHint { margin:0; color:#0b2240; }
#challengeApp .bench .station,body[data-level="1"] #challengeApp .bench .station { background:transparent; border:0; box-shadow:none; }
#challengeApp .bench .station::after { content:none; }
#challengeApp .bench .bench-message { grid-column:1; grid-row:2; margin:0 0 12px; padding:8px 12px; pointer-events:auto; }
#challengeApp .bench .bench-message .msg-name { position:static; }
#challengeApp .bench .bench-message .ready-hint,#challengeApp .bench .bench-message .tip-stats { display:block; padding:0; margin:0; max-height:none; }
#challengeApp .bench .bench-message [hidden] { display:none; }
#challengeApp .setup-message { grid-column:1 / -1; margin:0 0 12px; flex:none; }
#challengeApp .setup-message #fieldCaption,#challengeApp .setup-message .rail-hint { position:static; display:block; max-width:none; padding:0; margin:0; border:0; background:transparent; color:#0b2240; }
#challengeApp .setup-message p { margin:0; color:#0b2240; }
#challengeApp .result-message p { color:#0b2240; }
#challengeApp .launch-message { margin:0 0 12px; }
#challengeApp .tournament-message { margin-top:0; }
#challengeApp .lab-message { margin:8px auto 18px; max-width:900px; }
body[data-fair=true] #challengeApp .lab-panel:not([hidden]) { background:transparent; border-color:transparent; }
body[data-fair=true] .lab-head,body[data-fair=true] .lab-tabs,body[data-fair=true] .lab-body h2 { width:fit-content; color:#0b2240; background:#fffdf7; border-radius:8px; padding:5px 10px; }
body[data-fair=true] .fair-panel>strong:last-child { display:block; color:#0b2240; background:#fffdf7; }
body[data-fair=true] .fair-bowl { display:block; min-height:200px; background:transparent; }
@media (max-width:900px), (orientation:portrait) {
  #challengeApp .bench .bench-message { grid-column:1; grid-row:3; }
  body[data-stage=choose-tip] #selectionHeader { align-items:stretch; flex-direction:column; gap:0; }
}

.notice-message { position:absolute; left:12px; top:80px; width:min(360px,calc(100% - 24px)); z-index:11; pointer-events:none; }
.pause-message { text-align:left; }
body[data-paused=true] #challengeApp .message-box:not(.pause-message) { visibility:hidden; }

@media (orientation:portrait) {
  #challengeApp .bench .station,body[data-level="1"] #challengeApp .bench .station { grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto auto auto; }
  #challengeApp .bench .team-tabs { grid-column:1; grid-row:1; }
  #challengeApp .bench .steps,body[data-level="1"] #challengeApp .bench .steps { grid-column:1; grid-row:2; }
  #challengeApp .bench .bench-message { grid-column:1; grid-row:3; }
  #challengeApp .bench .station-actions { grid-column:1; grid-row:4; justify-self:end; }
}

/* A wide portrait viewport can show all bowls together without narrowing them below 220px. */
@media (orientation:portrait) and (min-width:760px) {
  .fair-panels { grid-template-columns:repeat(3,minmax(220px,1fr)); }
}
@media (orientation:portrait) and (max-width:759px) {
  body[data-fair=true] .lab-head { display:inline-flex; vertical-align:middle; padding:0; }
  body[data-fair=true] .lab-tabs { display:inline-flex; vertical-align:middle; flex-wrap:nowrap; overflow-x:auto; width:calc(100% - 76px); margin:4px 0; padding:4px; }
  body[data-fair=true] .lab-tabs span { flex:none; }
  body[data-fair=true] .lab-message { margin:4px 0 12px; padding:6px 10px; }
  body[data-fair=true] .lab-body { margin:6px auto; }
  body[data-fair=true] .lab-body h2 { margin:4px 0; font-size:20px; }
  body[data-fair=true] .fair-bowl { height:clamp(80px,11vh,120px); min-height:80px; }
  body[data-fair=true] .fair-name { padding:3px; }
  body[data-fair=true] .lab-track { height:16px; }
}

#challengeApp .lab-cards article { color:#fff; }

#challengeApp .lab-panel .contact-card { background:#fffdf7; border:2px solid #0b2240; }
#challengeApp .lab-message { margin:14px auto 20px; }

#challengeApp .lab-panel { clip-path:none; }
#challengeApp .lab-panel .contact-card { display:flex; flex-direction:column; align-items:stretch; gap:8px; padding:12px; border-radius:12px; text-align:center; font-size:18px; }
.lab-head,.lab-tabs,.lab-body h2 { width:fit-content; color:#0b2240; background:#fffdf7; border-radius:8px; padding:5px 10px; }
.trail-live .fair-bowl { height:200px; }
.live-trail svg { display:block; width:100%; max-width:168px; height:168px; margin:auto; }

/* 自由實驗室 */
#sandboxResults:not([hidden]) { display:contents; }
#sandboxOpponent .sandbox-note { margin:8px 0 0; color:#c6d7e9; font-size:14px; line-height:1.4; }
#opponentOptions button { flex:1; }
@media (max-width:900px) { #sandboxOpponent { grid-column:1 / -1; } }

/* Assembly controls form a compact, readable footer; the 3D tray and turntable
   keep the free space above it and remain directly clickable. */
body[data-stage=bench] #challengeApp .bench .station,
body[data-stage=bench][data-level="1"] #challengeApp .bench .station {
  inset:auto auto 12px 50%;
  width:min(1020px,calc(100% - 32px));
  grid-template-columns:minmax(0,1fr) auto;
  grid-template-rows:auto auto;
  align-items:center;
  gap:8px 14px;
  padding:10px 12px;
  border:1px solid rgba(208,224,236,.72);
  border-radius:16px;
  background:rgba(11,31,53,.95);
  box-shadow:0 8px 25px rgba(0,0,0,.32);
}
body[data-stage=bench] #challengeApp .bench .steps,
body[data-stage=bench][data-level="1"] #challengeApp .bench .steps {
  grid-column:1 / -1;
  grid-row:1;
  display:flex;
  gap:6px;
  overflow-x:auto;
}
body[data-stage=bench] #challengeApp .bench .steps li {
  flex:1 1 0;
  min-width:0;
  padding:6px 9px;
  background:#243c53;
  color:#e2ebf3;
  border-radius:8px;
  font-size:16px;
}
body[data-stage=bench] #challengeApp .bench .steps li b {
  flex:none;
  width:24px;
  height:24px;
  background:#39536b;
  border:0;
  color:#fff;
}
body[data-stage=bench] #challengeApp .bench .steps li.next { background:#a52f30; color:#fff; }
body[data-stage=bench] #challengeApp .bench .steps li.next b { background:#fff; color:#962d30; }
body[data-stage=bench] #challengeApp .bench .steps li.done { background:#254e48; color:#e9fff5; }
body[data-stage=bench] #challengeApp .bench .steps li.done b { background:#65b69a; color:#102f2a; }
body[data-stage=bench] #challengeApp .bench .bench-message {
  grid-column:1;
  grid-row:2;
  width:100%;
  max-height:100px;
  overflow:auto;
  gap:8px 10px;
  margin:0;
  padding:7px 10px;
  border:0;
  border-radius:9px;
  background:#f9f8f3;
  color:#152a3d;
  box-shadow:none;
}
body[data-stage=bench] #challengeApp .bench .bench-message::after { content:none; }
body[data-stage=bench] #challengeApp .bench .bench-message .msg-name { padding:4px 9px; background:#a63335; white-space:nowrap; }
body[data-stage=bench] #challengeApp .bench .bench-message .message-text { min-width:0; }
body[data-stage=bench] #challengeApp .bench .bench-message .ready-hint,
body[data-stage=bench] #challengeApp .bench .bench-message .tip-stats { font-size:16px; line-height:1.35; color:#152a3d; }
body[data-stage=bench] #challengeApp .bench .bench-message #benchCameraHint { color:#536778; font-size:14px; line-height:1.3; }
body[data-stage=bench] #challengeApp .bench .station-actions { grid-column:2; grid-row:2; gap:8px; align-self:stretch; }
body[data-stage=bench] #challengeApp .bench .station-actions .btn { min-height:44px; padding:8px 16px; }
body[data-stage=bench] #challengeApp .bench .station-actions .btn-primary { min-width:112px; }
@media (max-width:700px), (orientation:portrait) {
  body[data-stage=bench] #challengeApp .bench .station,
  body[data-stage=bench][data-level="1"] #challengeApp .bench .station {
    bottom:8px;
    width:calc(100% - 16px);
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:auto auto auto;
    gap:6px;
    padding:8px;
  }
  body[data-stage=bench] #challengeApp .bench .steps,
  body[data-stage=bench][data-level="1"] #challengeApp .bench .steps { grid-column:1; grid-row:1; }
  body[data-stage=bench] #challengeApp .bench .steps li { flex:1 0 auto; }
  body[data-stage=bench] #challengeApp .bench .bench-message { grid-column:1; grid-row:2; max-height:82px; }
  body[data-stage=bench] #challengeApp .bench .station-actions { grid-column:1; grid-row:3; justify-self:stretch; }
  body[data-stage=bench] #challengeApp .bench .station-actions .btn { flex:1 1 0; min-width:0; }
}
/* Keep the secondary action readable against the dark workbench panel. */
body[data-stage=bench] #challengeApp .bench .station-actions .btn-line {
  color:#f5f8fc;
  background:#30465f;
  border:1px solid #a8bbc9;
}
body[data-stage=bench] #challengeApp .bench .station-actions .btn-line:hover { background:#3e5b78; }
/* The opponent is chosen later, so reserve the assembly view for the student's design. */
body[data-stage=bench] #battleOpponent { display:none; }


/* 簡短的對戰結果分析，與勝負說明一同顯示。 */
.axis-analysis { margin-top:10px; padding:10px 12px; border:1px solid #7997b066; background:#102c4b; }
.axis-analysis h3 { margin:0 0 3px; color:#f4d084; font-size:16px; }
.challenge-results .axis-analysis p { margin:0; color:#eef5fa; font-size:15px; line-height:1.5; }
.challenge-results.collapsed .axis-analysis { display:none; }
