/* Heistle local additions. The original game owns all global design tokens. */
/* Goudkoorts uses warm brass furniture with dark reading surfaces. Semantic
   green/red/blue feedback tokens remain shared with the normal game. */
body[data-background="gold"] {
  --bg0: #100d07; --bg1: #19140a;
  --panel: #302715; --panel2: #201a0e; --well: #100c05;
  --line: #594721; --line2: #80652d; --line3: #b99349;
  --ink: #fff3d4; --dim: #d2c29b; --faint: #b8a477;
  --amber2: #ffe2a0; --amber4: #8b6825;
}
[hidden] {display: none !important;}
.lab-eyebrow {display: flex; align-items: center; gap: 8px; color: var(--amber2); font: 12px var(--mono); letter-spacing: 1.8px; text-transform: uppercase;}
.lab-brief {padding: 28px 24px; border: 1px dashed #526253; border-radius: 12px; background: radial-gradient(ellipse at top,#c3a3630d,transparent 80%); text-align: center; margin-bottom: 20px;}
.lab-brief h3 {font: 700 29px var(--disp); margin-bottom: 10px;}
.lab-brief p {font-size: 14px; line-height: 1.7; color: var(--dim); max-width: 350px; margin: 0 auto 18px;}
.lab-brief .btn {min-width: 210px;}
.lab-brief small {display: block; font-size: 12px; color: var(--faint); margin-top: 14px;}
.lab-undercover #clueList, .lab-undercover #probesWrap, .lab-undercover #intelLabel {display: none !important;}
.lab-undercover .keypad {opacity: .35; pointer-events: none;}
.lab-undercover .dial {pointer-events: none;}
.lab-text-btn {border: 0; background: none; color: var(--amber2); font-size: 13px; text-decoration: underline; text-underline-offset: 4px; padding: 8px 0;}
.lab-local {font: 11px var(--mono); color: var(--faint); border: 1px solid var(--line); padding: 4px 7px; border-radius: 4px; letter-spacing: 1px; margin-left: 10px;}
.lab-markable {cursor: pointer;}
.lab-markable.marked {text-decoration: line-through; opacity: .42;}
.lab-dialog .sheet {width: min(680px,calc(100vw - 28px)); max-width: 680px; padding: 32px;}
.lab-dialog-title {font: 700 36px/1.05 var(--disp); margin: 12px 0;}
.lab-dialog p {font-size: 15px; line-height: 1.7; color: var(--dim);}
.lab-dialog .x {z-index: 5;}
.lab-dialog .lab-eyebrow {padding-right: 30px;}
.lab-dialog-actions {display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px;}
.lab-dialog-actions .btn {flex: 1;}
.lab-coach-step {display: flex; gap: 7px; margin: 22px 0;}
.lab-coach-step i {height: 3px; flex: 1; border-radius: 2px; background: #26332a;}
.lab-coach-step i.done {background: var(--amber);}
.lab-coach-card {padding: 22px; background: #0a0f0a; border: 1px solid #3f5646; border-radius: 12px; margin: 20px 0;}
.lab-coach-code {display: flex; gap: 10px; justify-content: center; margin-bottom: 14px;}
.lab-coach-code span {display: grid; place-items: center; border: 1px solid #4b5c48; border-radius: 8px; background: #19251b; color: var(--amber2); font: 700 28px var(--mono); width: 58px; height: 62px;}
.lab-coach-choices {display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 20px 0;}
.lab-coach-choices button {height: 47px; min-width: 44px; background: #22382b; border: 1px solid #51634c; border-radius: 8px; font: 700 18px var(--mono);}
.lab-coach-choices button.selected {background: #304630; color: #d8ab91; text-decoration: line-through;}
.lab-coach-status {min-height: 27px; color: var(--amber2) !important; font-size: 14px !important;}
.lab-stats-strip {display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin: 20px 0;}
.lab-stats-strip>div {text-align: center; padding: 15px 8px; background: #0a0f0a; border-radius: 10px; border: 1px solid var(--line);}
.lab-stats-strip b {display: block; font: 700 25px var(--mono); color: var(--amber2); margin-bottom: 6px;}
.lab-stats-strip span {font-size: 12px; color: var(--dim);}
.lab-debrief-card {padding: 15px; border: 1px solid var(--line); border-radius: 8px; margin: 12px 0;}
.lab-debrief-card p {font-size: 13px;}
.lab-debrief-digits {display: flex; gap: 8px; margin-bottom: 10px;}
.lab-debrief-digits span {font: 700 20px var(--mono); width: 37px; height: 39px; display: grid; place-items: center; background: #17251c; border-radius: 5px;}
.lab-debrief-digits .hit {color: #a8e9bb; background: #22462d;}
.lab-debrief-digits .blow {color: var(--amber2); background: #423b21;}
.lab-debrief-digits .absent {color: #a4b5a7; text-decoration: line-through;}
.lab-result-extra {border-top: 1px solid var(--line); margin-top: 20px; padding-top: 16px;}
.lab-result-extra p {font-size: 14px; line-height: 1.7; color: var(--dim);}
.lab-result-extra .lab-dialog-actions {margin-top: 12px;}
.lab-practice-note {font-size: 13px; color: var(--dim); line-height: 1.7;}
.lab-mobile {display: none;}
body.lab-modal-open {overflow: hidden;}
.modal[aria-hidden=true] {display: none;}
.clue {animation: none !important;}
.lab-record-row {display: grid; grid-template-columns: 1fr auto auto; gap: 20px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); font: 13px var(--mono);}
.lab-record-row b {color: var(--good);}
.lab-record-row>span:last-child {color: var(--dim);}
.lab-brief[hidden] {display: none;}
.lab-local {font-size: 9px; opacity: .65; padding: 3px 5px;}
.lab-eyebrow {font-family: var(--body); font-size: 10.5px; letter-spacing: 3px; color: var(--faint);}
.lab-brief {margin: 0; padding: 24px 20px; border: 1px solid var(--line2); border-radius: 15px; background: radial-gradient(ellipse at top,rgba(246,183,60,.045),transparent 75%),linear-gradient(180deg,#172116,#0c130c); box-shadow: inset 0 2px 10px rgba(0,0,0,.4),0 5px 15px rgba(0,0,0,.24);}
.lab-brief h3 {font: 700 27px/1.15 var(--disp); letter-spacing: 1.5px; text-transform: uppercase; color: var(--amber2);}
.lab-brief p {font: 14px/1.7 var(--body);}
.lab-brief small {font-size: 11px; line-height: 1.6;}
.lab-text-btn {font-family: var(--body); font-size: 12px; color: var(--amber2);}
.lab-dialog .sheet {max-width: 580px; width: 100%; padding: 24px;}
.lab-dialog .sheet h2 {font: 700 27px/1.13 var(--disp); letter-spacing: 2.5px; text-transform: uppercase; color: var(--amber2); margin: 12px 0;}
.lab-dialog p {font: 14px/1.7 var(--body); color: var(--dim);}
.lab-dialog-actions .btn {font-family: var(--disp); font-size: 17px; letter-spacing: 1.3px;}
.lab-dialog-actions {margin-top: 20px;}
.lab-coach-card {padding: 18px; background: linear-gradient(180deg,#10190f,#080e08); border: 1px solid var(--line); border-radius: 13px; box-shadow: inset 0 2px 7px #0006;}
.lab-coach-code {gap: 7px; margin-bottom: 12px;}
.lab-coach-code span {width: 42px; height: 45px; font: 700 22px var(--mono); border-radius: 10px; color: var(--amber2); background: linear-gradient(180deg,#172116,#0c120c); border: 1px solid #273325; box-shadow: inset 0 2px 6px #0009,0 1px 0 #ffffff08; text-shadow: 0 0 10px var(--glow);}
.lab-coach-choices button {height: 42px; min-width: 39px; font: 700 16px var(--mono); border: 1px solid var(--line2); border-radius: 9px; color: var(--amber2); background: linear-gradient(180deg,#2a3827,#141e12); box-shadow: 0 3px 0 #080c07,inset 0 1px 0 #ffffff0d;}
.lab-coach-choices button:hover {border-color: var(--amber3);}
.lab-coach-choices button.selected {color: #66745f; background: #0c120c; text-decoration-color: var(--bad); box-shadow: inset 0 2px 5px #0008;}
.lab-success-stamp {display: table; color: var(--good); border: 1px solid var(--gooddeep); background: rgba(13,122,77,.1); padding: 7px 11px; border-radius: 4px; font: 11px var(--mono); letter-spacing: 1px; margin: 16px 0;}
.lab-stats-strip>div {border-color: var(--line); background: linear-gradient(180deg,#172116,#0e160d); box-shadow: inset 0 1px 0 #ffffff05,0 4px 12px #0003;}
.lab-stats-strip b {font-size: 23px;}
.lab-stats-strip span {font-size: 11px;}
.lab-active .loot-banner {margin: 0; height: 112px; min-height: 112px;}
.lab-active .loot-banner.is-special {height: 112px;}
.lab-mobile {display: none;}
@media (max-width:880px) {
  .lab-local {display: none;}
  #app {padding-bottom: 165px;}
  .lab-active .loot-banner, .lab-active .loot-banner.is-special {height: 105px; min-height: 105px;}
  .lab-active .loot-banner .loot-story {display: none;}
  .lab-brief {padding: 22px 18px;}
  .lab-brief h3 {font-size: 25px;}
  .lab-dialog .sheet {padding: 22px 18px;}
  .lab-dialog .sheet h2 {font-size: 25px;}
  .lab-dialog .lab-eyebrow {font-size: 10px; letter-spacing: 2px;}
  .lab-dialog-actions .btn {font-size: 15px; min-height: 43px;}
  .lab-record-row {font-size: 11px; gap: 10px;}
  .lab-mobile {display: block; position: fixed; bottom: 0; left: 0; right: 0; z-index: 12; padding: 9px 13px calc(9px + env(safe-area-inset-bottom)); background: linear-gradient(180deg,#172116f7,#090f09fc); border-top: 1px solid var(--line3); box-shadow: 0 -10px 30px #0008,inset 0 1px 0 #ffffff05; backdrop-filter: blur(14px);}
  .lab-mobile-top {display: flex; gap: 8px; align-items: center; justify-content: space-between;}
  .lab-mobile-code {display: flex; gap: 5px;}
  .lab-mobile-code button {width: 34px; height: 37px; display: grid; place-items: center; border: 1px solid #263324; border-radius: 9px; background: linear-gradient(180deg,#10170e,#080d08); box-shadow: inset 0 2px 7px #000b; color: var(--amber2); font: 700 19px var(--mono);}
  .lab-mobile-code button.current {border-color: var(--amber3); box-shadow: inset 0 2px 7px #000b,0 0 9px var(--glow);}
  .lab-mobile-actions {display: flex; gap: 7px;}
  .lab-mobile-actions button {padding: 8px 12px; border: 1px solid var(--line2); border-radius: 8px; background: linear-gradient(180deg,#2c3c29,#182415); color: var(--dim); box-shadow: 0 3px 0 #080d07; min-height: 36px;}
  .lab-mobile-actions .submit {font: 700 17px var(--disp); text-transform: uppercase; letter-spacing: 1px; color: #302006; background: linear-gradient(180deg,#ffe9aa,#f6b73c 60%,#db921b); border-color: #d79b27; box-shadow: 0 3px 0 #805411,inset 0 1px 0 #fff5;}
  .lab-mobile-keys {display: grid; grid-template-columns: repeat(10,1fr); gap: 4px; margin-top: 10px;}
  .lab-mobile-keys button {height: 35px; border: 1px solid #34462f; border-radius: 7px; background: linear-gradient(180deg,#34472f,#1a2816); color: var(--ink); font: 700 15px var(--mono); box-shadow: 0 3px 0 #070d06,inset 0 1px 0 #ffffff0d;}
  .lab-mobile-keys button:active {transform: translateY(2px); box-shadow: none;}
  .lab-mobile small {display: block; font: 10px var(--body); letter-spacing: .5px; color: var(--faint); text-align: center; margin-top: 8px;}
  .lab-undercover .lab-mobile, .lab-modal-open .lab-mobile, .lab-finished .lab-mobile {display: none;}
  .fab {display: none !important;}
  .sound-toggle {bottom: calc(150px + env(safe-area-inset-bottom)); right: 12px;}
  .news-toggle {position: absolute; top: 14px; bottom: auto; right: 12px;}
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after {animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important;}
}

/* Tutorial feedback uses the same semantic clue chips as the daily game. */
.lab-coach-card { flex-wrap: wrap; }
.lab-coach-card .fb { flex-basis: 220px; }
.lab-coach-card .fbc { white-space: normal; line-height: 1.5; max-width: 100%; }

/* Scenery stays behind the game; the same lasers emerge over selected corners. */
.lab-scenery {position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: #030505; contain: strict;}
.lab-scenery>div {position: absolute; inset: 0;}
.lab-scene-visual>div {position: absolute; inset: 0;}
.lab-scene-image {background-image: var(--scene-image); background-size: cover; background-position: center; background-repeat: no-repeat;}
.lab-scene-image {filter: brightness(.88);}
.lab-scene-shade {background: radial-gradient(ellipse at 50% 40%,#0003 20%,transparent 75%),linear-gradient(180deg,#0002,transparent 40%,#0005);}
.lab-scene-haze, .lab-scene-light, .lab-scene-firelight, .lab-scene-lasers {display: none;}
.lab-scene-gold {display: none;}
body[data-background]:not([data-background="classic"]) #fx,
body[data-background]:not([data-background="classic"])::after {display: none;}
.lab-scenery[data-scene="police"] .lab-scene-image {filter: grayscale(1) brightness(.85);}
/* Small stationary light surfaces can be cached once. Only their opacity changes;
   every gradient fades fully before its bounds, without a mask or blending pass. */
.lab-scenery[data-scene="police"] .lab-scene-light {display: block; inset: auto; width: min(50vw,680px); height: min(82vh,650px); transform: translate(-50%,-38%); --colour-period: 6s; --colour-delay: 0s;}
.lab-scenery[data-scene="police"] .beacon-right {left: 92%; top: 52%;}
.lab-scenery[data-scene="police"] .beacon-left {left: 9%; top: 50%;}
.lab-scene-light::before, .lab-scene-light::after {
  content: ''; position: absolute; inset: 0; --beacon-colour: 255 37 68;
  background: radial-gradient(ellipse 13% 8% at 50% 38%,rgb(var(--beacon-colour) / .92),rgb(var(--beacon-colour) / .22) 42%,transparent 100%),radial-gradient(ellipse 45% 43% at 50% 45%,rgb(var(--beacon-colour) / .38),rgb(var(--beacon-colour) / .12) 45%,transparent 100%),radial-gradient(ellipse 38% 15% at 50% 78%,rgb(var(--beacon-colour) / .2),transparent 100%);
  will-change: opacity;
  animation: lab-siren-red-colour var(--colour-period) ease-in-out var(--colour-delay) infinite;
}
.lab-scene-light::after {--beacon-colour: 28 132 255; animation-name: lab-siren-blue-colour;}
/* Left red / right blue, then left blue / right red on one shared clock. */
.beacon-right::before {animation-name: lab-siren-blue-colour;}
.beacon-right::after {animation-name: lab-siren-red-colour;}
@keyframes lab-siren-red-colour {0%,100% {opacity: .6;} 7% {opacity: .9;} 12% {opacity: .45;} 20% {opacity: .85;} 31% {opacity: .55;} 42% {opacity: .72;} 48%,94% {opacity: 0;}}
@keyframes lab-siren-blue-colour {0%,44%,100% {opacity: 0;} 50% {opacity: .6;} 57% {opacity: .9;} 62% {opacity: .45;} 70% {opacity: .85;} 81% {opacity: .55;} 92% {opacity: .72;} 98% {opacity: 0;}}
.lab-scenery[data-scene="lasers"] .lab-scene-image {filter: brightness(.75);}
.lab-scenery[data-scene="lasers"] .lab-scene-lasers, body[data-background="lasers"] .lab-laser-depth {display: block;}
.lab-scene-lasers {position: absolute; inset: 0; overflow: hidden;}
.lab-scene-lasers i {position: absolute; left: -30%; width: 160%; height: 1px; background: linear-gradient(90deg,transparent,#ef263de6 10%,#ff3547eb 50%,#ef263de6 90%,transparent); box-shadow: 0 0 3px #ef112618; opacity: .18; transform: rotate(var(--angle)); animation: lab-laser-scan 28s ease-in-out -6s infinite alternate;}
.lab-scene-lasers .loot-ray {top: var(--loot-beam-y,26vh); --angle: 13deg; --travel: var(--loot-beam-travel,10px);}
.lab-scene-lasers .hint-ray {top: var(--hint-beam-y,69vh); --angle: -33deg; --travel: var(--hint-beam-travel,8px); animation-duration: 34s; animation-delay: -12s;}
@keyframes lab-laser-scan {from {transform: rotate(var(--angle)) translateY(calc(var(--travel)*-1));} to {transform: rotate(var(--angle)) translateY(var(--travel));}}
/* Two tiny corner clips, not a full-screen compositing mask. Their viewport
   coordinate systems preserve the continuous beam across the panel edge. */
.lab-laser-depth {display: none; position: fixed; inset: 0; z-index: 4; overflow: hidden; pointer-events: none; contain: layout style;}
.lab-laser-window {position: absolute; overflow: hidden;}
.lab-laser-corner {position: absolute; inset: 0;}
.lab-laser-depth .lab-scene-lasers {display: block;}
body[data-background="lasers"] #lootBanner {background-color: #101810;}
body.lab-modal-open .lab-laser-depth {visibility: hidden;}
.lab-scenery[data-scene="smoke"] .lab-scene-image {filter: brightness(.92);}
/* Real transparent smoke drifts independently; the building itself stays still. */
.lab-scenery[data-scene="smoke"] .lab-scene-haze {display: block; inset: auto; bottom: -28%; left: -26%; width: 85%; height: 140%; background-image: var(--smoke-plume); background-size: contain; background-position: center bottom; background-repeat: no-repeat; filter: brightness(.62) sepia(.16); --smoke-opacity: .54; opacity: .3; transform-origin: 50% 85%; animation: lab-smoke-drift 18s linear -4s infinite;}
.lab-scenery[data-scene="smoke"] .smoke-right {left: auto; right: -26%; width: 88%; --smoke-opacity: .44; animation: lab-smoke-roll 22s linear -13s infinite;}
.lab-scenery[data-scene="smoke"] .smoke-left.delayed {bottom: -34%; left: -20%; width: 72%; --smoke-opacity: .32; animation-delay: -13s;}
.lab-scenery[data-scene="smoke"] .smoke-right.delayed {bottom: -32%; right: -18%; width: 70%; --smoke-opacity: .3; animation-delay: -2s;}
.lab-scenery[data-scene="smoke"] .lab-scene-firelight {display: block; background: radial-gradient(ellipse 36% 44% at 2% 77%,#ef721d73,transparent 75%),radial-gradient(ellipse 35% 40% at 97% 78%,#ee4d1c85,transparent 77%),radial-gradient(ellipse 70% 15% at 50% 100%,#b63d2029,transparent 82%); mix-blend-mode: screen; opacity: .5; animation: lab-fire-glow 4.7s ease-in-out infinite;}
@keyframes lab-smoke-drift {0% {transform: translate3d(-3%,18%,0) scale(.88) rotate(-6deg); opacity: 0;} 20% {opacity: var(--smoke-opacity);} 60% {opacity: var(--smoke-opacity);} 100% {transform: translate3d(12%,-35%,0) scale(1.16) rotate(9deg); opacity: 0;}}
@keyframes lab-smoke-roll {0% {transform: translate3d(4%,15%,0) scale(.86) scaleX(-1) rotate(-4deg); opacity: 0;} 20% {opacity: var(--smoke-opacity);} 62% {opacity: var(--smoke-opacity);} 100% {transform: translate3d(-10%,-38%,0) scale(1.2) scaleX(-1) rotate(8deg); opacity: 0;}}
@keyframes lab-fire-glow {0%,100% {opacity: .48;} 19% {opacity: .82;} 37% {opacity: .56;} 53% {opacity: .92;} 73% {opacity: .63;} 86% {opacity: .74;}}
/* The gold itself shines in the photograph. Motion belongs to the air:
   unfocused dust and stationary diffuse light, independent of the image crop. */
.lab-scenery[data-scene="gold"] .lab-scene-image {filter: brightness(1.02);}
.lab-scenery[data-scene="gold"] .lab-scene-visual {animation: lab-gold-camera 48s ease-in-out infinite alternate; transform-origin: 50% 52%;}
.lab-scenery[data-scene="gold"] .lab-scene-gold {display: block;}
.lab-gold-field {position: absolute; inset: 0; --gold-air-width: clamp(30px,calc((100vw - 1040px)/2),360px);}
.lab-gold-ambient {position: absolute; top: -12%; width: min(54%,680px); height: 96%; background: radial-gradient(ellipse at 25% 25%,#ffe7ac20,#e5a53d09 36%,transparent 69%); opacity: .4; animation: lab-gold-ambient 23s ease-in-out -7s infinite;}
.lab-gold-ambient.gold-left {left: -6%;}
.lab-gold-ambient.gold-right {right: -6%; transform: scaleX(-1); animation-duration: 31s; animation-delay: -19s;}
/* Both elliptical gradients reach transparency before the layer's edges,
   including its ends. Only the cached layer's transform and opacity move. */
.lab-gold-beam {position: absolute; top: -28vh; width: clamp(180px,28vw,480px); height: 145vh; max-height: 1600px; transform-origin: 50% 18%; background: radial-gradient(ellipse 9% 44% at 50% 46%,#fff2c924,#ffdf8916 48%,transparent 100%),radial-gradient(ellipse 36% 48% at 50% 46%,#ffe2a52c,#efbc6517 52%,transparent 100%); opacity: .65; animation: lab-gold-beam-left 21s ease-in-out -6s infinite alternate;}
.lab-gold-beam.gold-left {left: -9vw; transform: rotate(-10deg);}
.lab-gold-beam.gold-right {right: -8vw; top: -19vh; transform: rotate(18deg); animation-name: lab-gold-beam-right; animation-duration: 27s; animation-delay: -18s;}
.lab-gold-dust {position: absolute; width: var(--dust-size); height: var(--dust-size); border-radius: 50%; background: radial-gradient(circle,#fff9e1 0 22%,#ffe49cdb 38%,transparent 73%); box-shadow: 0 0 6px #ffdc8359; opacity: 0; animation: lab-gold-dust var(--dust-time) linear var(--dust-delay) infinite;}
.lab-gold-bokeh {position: absolute; width: var(--mote-size); height: var(--mote-size); border-radius: 50%; background: radial-gradient(circle,#fff1bfb3,#f2cb7866 24%,#edc66b18 48%,transparent 70%); opacity: 0; animation: lab-gold-bokeh var(--mote-time) ease-in-out var(--mote-delay) infinite;}
.lab-gold-dust.gold-left, .lab-gold-bokeh.gold-left {left: calc(6px + (var(--gold-air-width) - 18px)*var(--air-position));}
.lab-gold-dust.gold-right, .lab-gold-bokeh.gold-right {right: calc(6px + (var(--gold-air-width) - 18px)*var(--air-position));}
.lab-gold-reveal {display: none; position: absolute; inset: 0; background: radial-gradient(ellipse 38% 95% at 0 38%,#050703f5,transparent 100%),radial-gradient(ellipse 38% 95% at 100% 38%,#050703f5,transparent 100%); pointer-events: none;}
.gold-arrive .lab-gold-reveal {display: block; animation: lab-gold-reveal 1.8s cubic-bezier(.16,1,.3,1) both;}
@keyframes lab-gold-camera {from {transform: scale(1.008) translateY(0);} to {transform: scale(1.035) translateY(-.3%);}}
@keyframes lab-gold-ambient {0%,100% {opacity: .3;} 34% {opacity: .7;} 61% {opacity: .42;} 79% {opacity: .6;}}
@keyframes lab-gold-beam-left {0% {transform: rotate(-16deg); opacity: .5;} 55% {opacity: .85;} 100% {transform: rotate(-5deg); opacity: .65;}}
@keyframes lab-gold-beam-right {0% {transform: rotate(12deg); opacity: .8;} 50% {opacity: .55;} 100% {transform: rotate(24deg); opacity: .75;}}
@keyframes lab-gold-dust {0%,100% {opacity: 0;} 10% {opacity: .7;} 35% {opacity: 1;} 58% {opacity: .6;} 82% {opacity: .9;} from {transform: translate3d(0,calc(var(--dust-travel)*-.5),0);} to {transform: translate3d(var(--dust-drift),calc(var(--dust-travel)*.5),0);}}
@keyframes lab-gold-bokeh {0%,100% {opacity: 0;} 17% {opacity: .55;} 45% {opacity: .85;} 78% {opacity: .4;} from {transform: translate3d(0,-60px,0) scale(.8);} to {transform: translate3d(var(--mote-drift),120px,0) scale(1.15);}}
@keyframes lab-gold-reveal {from {opacity: 1;} to {opacity: 0;}}
.lab-modal-open .lab-scene-gold *, .lab-modal-open .lab-scenery[data-scene="gold"] .lab-scene-visual {animation-play-state: paused !important;}
.lab-scenery.still *, .lab-scenery.paused *, .lab-background-still #fx *, .lab-background-still::after {animation-play-state: paused !important;}
.lab-background-still .lab-laser-depth *, .lab-background-paused .lab-laser-depth *,
.lab-scenery.still .lab-scene-light::before, .lab-scenery.still .lab-scene-light::after,
.lab-scenery.paused .lab-scene-light::before, .lab-scenery.paused .lab-scene-light::after {animation-play-state: paused !important;}

.lab-background-dialog .sheet {max-width: 720px;}
.lab-scene-list {display: grid; gap: 14px;}
.lab-scene-card {display: grid; grid-template-columns: 42% 1fr; border: 1px solid var(--line2); background: #0d140d; border-radius: 12px; overflow: hidden;}
.lab-scene-card.selected {border-color: var(--amber3);}
.lab-scene-art {position: relative; min-height: 185px; border: 0; border-right: 1px solid var(--line); background: #050707; overflow: hidden; text-align: left;}
.lab-scene-art img {position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease;}
.lab-scene-art:hover img {transform: scale(1.045);}
.lab-scene-art::after {content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 50%,#000a); pointer-events: none;}
.lab-scene-card[data-scene="police"] .lab-scene-art img {object-position: 12% center;}
.lab-scene-card[data-scene="smoke"] .lab-scene-art img {object-position: 24% center;}
.lab-scene-badge {position: absolute; left: 12px; bottom: 12px; z-index: 1; padding: 5px 7px; background: #080d0ddd; border: 1px solid #566052; border-radius: 4px; color: #d9e3d6; font: 10px var(--mono);}
.selected .lab-scene-badge {color: var(--amber2); border-color: var(--amber4);}
.lab-scene-copy {padding: 17px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start;}
.lab-scene-copy h3 {font: 700 22px/1.1 var(--disp); letter-spacing: 1px; color: var(--amber2); text-transform: uppercase;}
.lab-scene-copy p {font-size: 12px; line-height: 1.6; margin: 7px 0 12px;}
.lab-scene-progress {display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 13px; font: 10px var(--mono); color: var(--dim);}
.lab-scene-progress progress {width: 100%; min-width: 35px; flex: 1; height: 3px; border: none; appearance: none; background: var(--line); color: var(--amber3);}
.lab-scene-progress progress::-webkit-progress-bar {background: var(--line);}
.lab-scene-progress progress::-webkit-progress-value {background: var(--amber3);}
.lab-scene-progress progress::-moz-progress-bar {background: var(--amber3);}
.lab-scene-progress span {white-space: nowrap;}
.lab-scene-actions {display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto;}
.lab-scene-actions .btn {font-size: 13px; min-height: 32px; letter-spacing: .4px;}
.lab-scene-note {margin-top: 15px; font-size: 12px !important;}
@media (max-width:600px) {
  .lab-scenery[data-scene="gold"] .lab-scene-image {background-position: 4% center;}
  .lab-scenery[data-scene="gold"] .lab-scene-visual {animation: none; transform: none;}
  .lab-scene-gold .gold-extra {display: none;}
  .lab-gold-beam {width: 180px; left: auto; opacity: .65;}
  .lab-gold-beam.gold-left {left: -74px;}
  .lab-gold-beam.gold-right {right: -88px;}
  .lab-scenery[data-scene="police"] .lab-scene-image {background-position: 15% center;}
  .lab-scenery[data-scene="police"] .lab-scene-light {width: min(95vw,360px); height: min(65vh,480px);}
  .lab-scenery[data-scene="police"] .beacon-right {left: 96%; top: 59%;}
  .lab-scenery[data-scene="police"] .beacon-left {left: 8%; top: 50%;}
  .lab-scenery[data-scene="smoke"] .lab-scene-image {background-position: 12% center;}
  .lab-scenery[data-scene="smoke"] .lab-scene-haze {width: 170%; left: -80%; bottom: -15%; height: 115%;}
  .lab-scenery[data-scene="smoke"] .smoke-right {left: auto; right: -80%;}
  .lab-scenery[data-scene="smoke"] .lab-scene-haze.delayed {display: none;}
  .lab-scene-card {grid-template-columns: 1fr;}
  .lab-scene-art {min-height: 135px; aspect-ratio: 2.4; border-right: 0; border-bottom: 1px solid var(--line);}
  .lab-scene-art img {object-position: center !important;}
  .lab-scene-copy {padding: 14px;}
  .lab-scene-copy h3 {font-size: 21px;}
}
@media (prefers-reduced-motion:reduce) {
  .lab-scenery *, .lab-laser-depth *, .lab-scene-light::before, .lab-scene-light::after, .lab-scene-art img {animation: none !important; transition: none !important;}
  .lab-scene-light::before, .lab-scene-light::after {will-change: auto;}
  .lab-scene-light::after, .beacon-right::before {opacity: 0;}
  .beacon-right::after {opacity: 1;}
}

/* Safehouse: persistent funds and three clear destinations, in Heistle's
   existing metal/amber type system. Gold's thumbnail has a small accent. */
#mLoot .sheet {max-width: 860px; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; padding: 24px;}
#mLoot h2 {flex: none; padding-right: 40px; animation: none;}
#lootBody {overflow-y: auto; min-height: 0; padding-right: 5px; overscroll-behavior: contain; scrollbar-width: thin;}
.sh-chrome {position: relative; padding-top: 2px; background: none;}
.sh-overview {display: grid; grid-template-columns: 1fr 1.12fr; gap: 12px; align-items: stretch; margin-bottom: 14px;}
#mLoot .sh-overview .lvl-card {margin: 0; padding: 12px 14px;}
#mLoot .sh-overview .loot-sum {margin: 0; gap: 8px;}
#mLoot .sh-overview .ls-box {border-radius: 10px; display: flex; flex-direction: column; justify-content: center;}
#mLoot .sh-overview .ls-v {font-size: 18px; text-shadow: none;}
.sh-tabs {display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; padding: 4px; margin-bottom: 18px; border: 1px solid var(--line2); border-radius: 12px; background: linear-gradient(180deg,#182219,#10170f); box-shadow: inset 0 1px 0 #ffffff08,0 3px 8px #0004;}
.sh-tab {display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 40px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--dim); font: 700 16px var(--disp); letter-spacing: 1.2px; text-transform: uppercase;}
.sh-tab svg {width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;}
.sh-tab[aria-selected="true"] {background: linear-gradient(180deg,#343822,#23291b); border-color: var(--amber4); color: var(--amber2); box-shadow: inset 0 1px 0 #ffe1a015,0 2px 4px #0005;}
.sh-tab:hover, .sh-subtab:hover {color: var(--amber2);}
.sh-panel[hidden], .sh-shelf[hidden] {display: none !important;}
.sh-panel {min-height: 230px; padding: 0 1px 8px;}
.sh-section-label {margin: 0 0 12px; font: 11px var(--mono); letter-spacing: 2px; text-transform: uppercase; color: var(--dim);}
.sh-section-heading {margin: 0 0 16px;}
.sh-section-heading h3 {font: 700 26px/1.15 var(--disp); color: var(--amber2); letter-spacing: .8px; margin: 0 0 5px;}
.sh-section-heading p {font: 13px/1.65 var(--body); color: var(--dim); margin: 0; max-width: 620px;}
.sh-subtabs {display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); width: 330px; max-width: 100%; gap: 4px; padding: 4px; margin-bottom: 16px; border: 1px solid var(--line2); border-radius: 12px; background: #10170f; box-shadow: inset 0 1px 0 #ffffff08,0 3px 8px #0004;}
.sh-subtab {min-height: 38px; padding: 8px 14px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--dim); font: 700 16px/1 var(--disp); letter-spacing: 1.2px; text-transform: uppercase;}
.sh-subtab[aria-selected="true"] {color: #241703; border-color: #b98418; background: linear-gradient(180deg,#ffe1a0,var(--amber) 46%,#c98d1b); box-shadow: inset 0 1px 0 #fff2,0 2px 4px #0005;}
#mLoot .lab-scene-list, .sh-music-grid {display: grid; grid-template-columns: 1fr; gap: 10px;}
#mLoot .lab-scene-card, #mLoot .sh-music-card {display: grid; grid-template-columns: 104px minmax(0,1fr) auto; align-items: center; gap: 16px; padding: 13px 15px; border: 1px solid var(--line2); border-radius: 14px; overflow: hidden; background: linear-gradient(155deg,#1f2b20,#141d14 65%,#111a12); box-shadow: 0 4px 10px #0005,inset 0 1px 0 #ffffff0a;}
#mLoot .lab-scene-card.selected, #mLoot .sh-music-card.selected {border-color: var(--amber4); box-shadow: inset 3px 0 0 var(--amber3),inset 0 1px 0 #ffffff0a,0 4px 10px #0005;}
#mLoot .lab-scene-art {width: 104px; height: 66px; min-height: 0; aspect-ratio: auto; border: 1px solid var(--line2); border-radius: 7px; box-shadow: 0 2px 5px #0008;}
#mLoot button.lab-scene-art:hover {border-color: var(--amber3);}
#mLoot .lab-scene-classic {background: linear-gradient(165deg,transparent 38%,#da4c4c30 38.5%,transparent 39%),linear-gradient(12deg,transparent 58%,#da4c4c25 58.5%,transparent 59%),linear-gradient(110deg,transparent 22%,#ffe4a610 33%,transparent 44%),radial-gradient(ellipse at 90% 100%,#264b3026,transparent 65%),repeating-linear-gradient(0deg,#96c49c09 0 1px,transparent 1px 12px),repeating-linear-gradient(90deg,#96c49c09 0 1px,transparent 1px 12px),linear-gradient(#10180f,#080e09);}
#mLoot .lab-scene-art img {transition: none;}
#mLoot .lab-scene-card[data-scene="gold"] .lab-scene-art img {object-position: 16% center;}
#mLoot .lab-scene-art:hover img {transform: none;}
#mLoot .lab-scene-copy, .sh-music-copy {min-width: 0; padding: 0; display: flex; flex-direction: column; align-items: flex-start;}
#mLoot .lab-scene-copy h3, .sh-music-title {font: 700 22px/1.1 var(--disp); color: var(--amber2); letter-spacing: .8px; text-transform: uppercase; margin: 0;}
#mLoot .lab-scene-copy p, .sh-music-description {font: 12px/1.6 var(--body); color: var(--dim); margin: 6px 0 0;}
#mLoot .lab-scene-actions, .sh-item-actions {display: flex; align-items: center; align-self: center; margin: 0; min-width: 204px;}
.sh-item-offer {display: flex; align-items: center; justify-content: flex-end; gap: 12px; width: 100%;}
#mLoot .sh-item-offer .btn {min-height: 34px; white-space: nowrap;}
.sh-item-price {color: var(--good); font: 700 18px/1.1 var(--mono); letter-spacing: -.5px; white-space: nowrap; font-variant-numeric: tabular-nums; text-shadow: 0 0 12px var(--goodglow);}
#mLoot .sh-item-offer .btn:disabled {opacity: .52;}
.sh-music-art {position: relative; width: 104px; height: 66px; display: flex; align-items: center; justify-content: center; color: #b5a86b; border: 1px solid var(--line2); border-radius: 7px; background: radial-gradient(ellipse at 50% 90%,#ad8b301c,transparent 70%),#10170f; box-shadow: 0 2px 5px #0008;}
.sh-music-art svg {width: 80px; height: 51px; margin-bottom: 6px;}
.sh-music-siren {color: #bdb5a0; background: radial-gradient(ellipse at 0 80%,#db394025,transparent 70%),radial-gradient(ellipse at 100% 20%,#2877c529,transparent 70%),#101617;}
.sh-music-track-no {position: absolute; bottom: 4px; right: 6px; font: 7px var(--mono); letter-spacing: 1px; color: var(--dim);}
.sh-item-status {font: 9px var(--mono); letter-spacing: 1.5px; text-transform: uppercase; color: var(--amber2); margin-bottom: 5px;}
.sh-equipped {border-color: var(--amber4); color: var(--amber2);}
.sh-reward-link {display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 0 0; margin-top: 16px; border-top: 1px solid var(--line2); color: var(--dim); font: 12px var(--body);}
@media(max-width:650px) {
  #mLoot .sheet {padding: 18px 14px;}
  .sh-overview {grid-template-columns: 1fr; gap: 8px; margin-bottom: 10px;}
  #mLoot .sh-overview .lvl-card {padding: 9px 12px;}
  #mLoot .sh-overview .ls-box {padding: 8px;}
  .sh-tab {font-size: 15px; letter-spacing: .4px; gap: 5px;}
  .sh-tab svg {width: 14px; height: 14px;}
  #mLoot .lab-scene-card, #mLoot .sh-music-card {grid-template-columns: 80px minmax(0,1fr); gap: 12px; padding: 12px;}
  #mLoot .lab-scene-art, .sh-music-art {width: 80px; height: 56px;}
  #mLoot .lab-scene-art img {object-position: 18% center !important;}
  #mLoot .lab-scene-copy h3, .sh-music-title {font-size: 21px;}
  #mLoot .lab-scene-copy p, .sh-music-description {font-size: 11px;}
  .sh-music-art svg {width: 64px; height: 41px;}
  .sh-music-track-no {right: 5px; font-size: 6px;}
  #mLoot .lab-scene-actions, .sh-item-actions {grid-column: 1 / -1; min-width: 0; padding-top: 10px; border-top: 1px solid var(--line);}
  .sh-item-offer {justify-content: space-between;}
  .sh-item-offer .btn:only-child {margin-left: auto;}
  .sh-section-heading h3 {font-size: 24px;}
}

/* Theme scope has zero specificity so existing hover, win and error states
   keep their precedence, and switching backgrounds restores the original UI. */
:where(body[data-background="gold"]) .logo-dial {background: radial-gradient(circle at 35% 30%,#927434,#49340f 62%,#211807); border-color: #d0a54a;}
:where(body[data-background="gold"]) .logo-dial i {background: linear-gradient(180deg,#ffe4a0,#8b6424 50%,#e2b75b);}
:where(body[data-background="gold"]) :is(.streak-chip,.toolbar,.lang-switch,.icon-btn) {background: linear-gradient(180deg,#3a2e18,#241c0e);}
:where(body[data-background="gold"]) .toolbar .icon-btn {background: transparent;}
:where(body[data-background="gold"]) .toolbar .icon-btn:hover {background: #f6b73c1a;}
:where(body[data-background="gold"]) .toolbar .icon-btn.active {background: #f6b73c29;}
:where(body[data-background="gold"]) .lab-local {opacity: 1; color: var(--dim); background: #151007d9;}
:where(body[data-background="gold"]) .btn:where(:not(.primary):not(.ghost):not(.danger)) {background: linear-gradient(180deg,#49381c,#2a200e); box-shadow: 0 4px 0 #100c05,0 7px 14px #0006,inset 0 1px 0 #ffedbe18;}
:where(body[data-background="gold"]) .btn:where(:not(.primary):not(.ghost):not(.danger)):active {box-shadow: 0 1px 0 #100c05,inset 0 2px 5px #0006;}
:where(body[data-background="gold"]) .loot-banner {background: radial-gradient(ellipse at 0 0,#d8a54316,transparent 60%),linear-gradient(112deg,#352914,#231c0e 56%,#1a150b); border-color: #8c6a2b; border-left-color: #ddb55b;}
:where(body[data-background="gold"]) .clue {background: linear-gradient(180deg,#342a17,#251e10 70%,#211b0e); border-color: #79602c; border-top-color: #a0803e; box-shadow: 0 8px 20px -12px #000b,inset 0 1px 0 #ffe6ab12;}
:where(body[data-background="gold"]) .card-tag {background: linear-gradient(180deg,#332712,#22190b); color: #edd094; border-color: #80632e;}
:where(body[data-background="gold"]) .dchip {background: linear-gradient(180deg,#1a1308,#0e0a04); border-color: #655026; color: #ffe9b5;}
:where(body[data-background="gold"]) .lab-markable.marked {opacity: .6; text-decoration-color: var(--bad2);}
:where(body[data-background="gold"]) .fbc.hit {background: #133528; border-color: #357e60;}
:where(body[data-background="gold"]) .fbc.blow {background: #48330f; border-color: #a47b2f;}
:where(body[data-background="gold"]) .fbc.none {background: #3e1d1a; border-color: #a34a43;}
:where(body[data-background="gold"]) .lab-brief {background: radial-gradient(ellipse at top,#d6aa4a12,transparent 75%),linear-gradient(180deg,#302514,#1b150a);}
:where(body[data-background="gold"]) .sheet {background: radial-gradient(ellipse at top,#d6aa4a12,transparent 65%),linear-gradient(180deg,#302716,#1c170c); border-color: var(--line2); border-top-color: var(--line3);}
:where(body[data-background="gold"]) :is(.lab-coach-card,.lab-stats-strip>div,.lab-debrief-digits span) {background: linear-gradient(180deg,#302514,#1b150a);}
:where(body[data-background="gold"]) .lab-coach-code span {background: linear-gradient(180deg,#20190b,#120d05); border-color: var(--line2);}
:where(body[data-background="gold"]) .lab-coach-choices button {background: linear-gradient(180deg,#544120,#2b200c);}
:where(body[data-background="gold"]) .lab-coach-choices button.selected {background: #160f06; color: var(--dim);}
:where(body[data-background="gold"]) #mLoot :is(.inv-slot,.tool-card,.wb-lock,.lvl-card),
:where(body[data-background="gold"]) #mLoot .loot-sum .ls-box {background: linear-gradient(180deg,#3b3019,#241c0e); border-color: #8a6f37;}
:where(body[data-background="gold"]) #mLoot .inv-slot.empty {background: #1d160cd9; border-color: #655027; opacity: .72; filter: none;}
:where(body[data-background="gold"]) .sh-tabs {background: linear-gradient(180deg,#362b17,#221a0d);}
:where(body[data-background="gold"]) .sh-tab[aria-selected="true"] {background: linear-gradient(180deg,#5a4520,#38290f); border-color: #b18a3e;}
:where(body[data-background="gold"]) .sh-subtabs {background: #20180b;}
:where(body[data-background="gold"]) #mLoot :is(.lab-scene-card,.sh-music-card) {background: linear-gradient(155deg,#3c301a,#2a210f 65%,#241c0d);}
@media(max-width:880px) {
  :where(body[data-background="gold"]) .lab-mobile {background: linear-gradient(180deg,#322712fa,#171107fc); border-top-color: #b28b3f;}
  :where(body[data-background="gold"]) .lab-mobile-code button {background: linear-gradient(180deg,#201809,#100b03); border-color: #79602c;}
  :where(body[data-background="gold"]) .lab-mobile-code button.current {border-color: #efc770; box-shadow: inset 0 2px 7px #000b,0 0 9px var(--glow);}
  :where(body[data-background="gold"]) .lab-mobile-actions button:where(:not(.submit)) {background: linear-gradient(180deg,#584321,#30220c); border-color: #8b6d31; color: var(--ink);}
  :where(body[data-background="gold"]) .lab-mobile-keys button {background: linear-gradient(180deg,#695026,#3c2b0e); border-color: #9a7837; color: var(--ink); box-shadow: 0 3px 0 #100b03,inset 0 1px 0 #fff0c51c;}
  :where(body[data-background="gold"]) .lab-mobile-keys button:active {box-shadow: none;}
}

/* A restrained collector's finish for the final background, in every theme.
   Sparse, non-interactive sparkles cover the complete responsive card. */
#mLoot .lab-scene-card[data-scene="gold"] {position: relative; isolation: isolate; border-color: #9d7934; background: radial-gradient(ellipse at 0 50%,#d6a33c1c,transparent 42%),linear-gradient(155deg,#302817,#1e1a10 68%,#19160d); box-shadow: inset 0 1px 0 #ffe6ab20,0 4px 10px #0005;}
#mLoot .lab-scene-card[data-scene="gold"].selected {border-color: #d7ae56; box-shadow: inset 3px 0 0 #d7ae56,inset 0 1px 0 #ffe6ab20,0 4px 10px #0005;}
#mLoot .lab-scene-card[data-scene="gold"] .lab-scene-art {border-color: #b18a43; box-shadow: 0 2px 5px #0008,0 0 12px #e1b44d1c;}
.sh-gold-fx {position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2;}
.sh-gold-fx>i {position: absolute; pointer-events: none; animation-play-state: paused !important;}
.sh-gold-glint {width: 9px; height: 9px; opacity: .18; background: radial-gradient(circle,#fff5ce,transparent 66%); animation: sh-gold-twinkle 7s ease-in-out var(--spark-delay) infinite;}
.sh-gold-glint::before,.sh-gold-glint::after {content: ''; position: absolute; background: linear-gradient(90deg,transparent,#fff3c7,transparent); inset: 4px 0;}
.sh-gold-glint::after {transform: rotate(90deg);}
.sh-gold-particle {width: 3px; height: 3px; border-radius: 50%; background: #ffe5a0; box-shadow: 0 0 4px #f3cb6b80; opacity: .15; animation: sh-gold-float var(--spark-time) linear var(--spark-delay) infinite;}
body:where(:not(.lab-background-paused):not(.lab-background-still)) #mLoot.show .sh-panel:not([hidden]) .sh-shelf:not([hidden]) .sh-gold-fx>i {animation-play-state: running !important;}
@keyframes sh-gold-twinkle {0%,31%,62%,100% {opacity: .08; transform: scale(.55) rotate(-8deg);} 42% {opacity: .95; transform: scale(1) rotate(5deg);} 51% {opacity: .3; transform: scale(.7) rotate(8deg);}}
@keyframes sh-gold-float {0%,100% {opacity: 0;} 20%,70% {opacity: .7;} from {transform: translate3d(-3px,13px,0);} to {transform: translate3d(5px,-15px,0);}}
@media(max-width:650px) {.sh-gold-extra {display: none;}}
@media(prefers-reduced-motion:reduce) {.sh-gold-fx>i {animation: none; opacity: .25;}}
