/* Neon blue-violet interface theme. Layout and world rendering live in style.css and renderer.js. */
:root {
  color-scheme: dark;
  --ink: #eef0ff;
  --muted: #a8afd1;
  --green: #8b85ff;
  --line: #33355e;
  --copper: #b99aff;
  --gold: #c1a2ff;
  --crystal: #68baff;
  --danger: #ffb077;
  --panel: #14172f;
  --inset: #0d1126;
  --neon-button: linear-gradient(110deg, #405ee6, #8149d5);
  --neon-meter: linear-gradient(90deg, #4a9dff, #9b6bff);
  color: var(--ink);
  background: #080b1b;
}
body { min-height: 100vh; isolation: isolate; }
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, #090a1b30 0%, #090a1b83 40%, #090a1bb0 100%), url('assets/backgrounds/industrial-world.png') center top / cover no-repeat;
  image-rendering: pixelated;
}
::selection { background: #665eb6; color: #0d0e26; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
#game:focus-visible { outline: 3px solid var(--gold) !important; outline-offset: -3px; }
button { border-radius: 5px; }
.header {
  max-width: none; padding: 0 max(32px, calc((100vw - 1266px) / 2)); height: 86px;
  background: linear-gradient(100deg, #10162bf5, #231535f5); border-bottom: 1px solid #6151a9; box-shadow: 0 3px 24px #6958ff20;
}
.brand { color: #ecedff; font-size: 19px; letter-spacing: -.5px; text-shadow: 2px 2px #080816; }
.brand-second { color: #b69bff; }
.brand-mark { width: 48px; height: 48px; background: none; border-radius: 0; transform: none; }
.brand-mark::after { display: none; }
.brand-mark canvas.sprite-icon { width: 48px; height: 48px; }
.version { color: #99a6e6; font-size: 9px; letter-spacing: 1.5px; }
.version b { color: #919fe4; background: #16173e; border: 1px solid #35306a; border-radius: 3px; }
#save-status { color: #9ca9e6; }
.icon-button { border: 1px solid #38326f; border-radius: 5px; background: #131435; color: #c6cdf1; box-shadow: 0 2px 0 #080816; width: 37px; height: 37px; }
.icon-button:hover { background: #1c1e50; }
#sound[aria-pressed="true"] { background: linear-gradient(135deg, #33599b, #67439e); border-color: #a68cff; color: #c5ccf1; }
main { padding-top: 34px; }
.intro { min-height: 108px; margin-bottom: 25px; padding: 10px 0; }
h1 { color: #dce1f6; font-weight: 850; font-size: 38px; letter-spacing: -1px; text-shadow: 0 3px 0 #0e0f29, 0 2px 18px #090919; }
.intro p { color: #cfd5f3; font-size: 13px; text-shadow: 0 2px 3px #080816; }
.eyebrow { color: #919fe4; line-height: 1.6; }
.eyebrow>span { border-radius: 1px; background: var(--gold); }
.small-label { color: #9fabe7; }
.wallet { background: linear-gradient(120deg, #182342, #30204c); border: 1px solid #7d68b9; border-radius: 6px; box-shadow: inset 0 1px 0 #d2bbff20, 0 0 18px #8261ff18; padding: 17px 23px; }
.wallet strong { color: #bdc5ef; }
.wallet small { color: #9ca8e6; }
.coin-icon { border-color: #d89a43; background: #f3c96c; color: #80512e; box-shadow: 0 3px 0 #855c36; }
.journey { color: #b8c1ed; background: linear-gradient(100deg, #1b2441f5, #2b1b47f5); border: 1px solid #40397e; border-left: 4px solid var(--gold); border-radius: 4px; padding: 13px 17px; font-size: 12px; box-shadow: 0 3px 0 #08091870; }
.layout { grid-template-columns: minmax(0,1fr) 316px; gap: 22px; }
.expedition, .panel, .relic-panel { background: linear-gradient(145deg, #151b34, #1c1530); border: 1px solid #45416e; border-radius: 7px; box-shadow: inset 0 1px 0 #bca6ff14, 0 5px 20px #05071370; }
.expedition { border: 1px solid #7361b2; }
.scene-header { background: linear-gradient(110deg, #1b2b50, #35204f); border-bottom: 1px solid #6956ab; height: 66px; }
.scene-header strong { color: #d1d7f4; font-size: 13px; }
.scene-header #biome-sub, .depth>span { color: #9aa7e6; }
.depth strong { color: var(--gold); font-size: 25px; }
.live-dot { background: #7eb7ff; box-shadow: 0 0 0 4px #5668ff20, 0 0 12px #739aff; border-radius: 2px; }
.canvas-wrap { background: #0e0f28; border-bottom: 1px solid #6956ab; }
.scene-tip, .scene-return { border-radius: 4px; background: #0f102bed; color: #d2d8f4; border: 1px solid #4c4497; box-shadow: 0 3px 0 #09091980; backdrop-filter: none; }
.scene-return:hover { background: #181944; }
.scene-return.scene-next { background: var(--neon-button); color: #fff; border: 1px solid #b6a2ff; padding: 13px 22px; font-size: 14px; font-weight: 800; max-width: calc(100% - 24px); box-shadow: 0 3px 0 #302569, 0 0 24px #7859ff80; }
.scene-return.scene-next:hover:not(:disabled) { background: linear-gradient(110deg, #5274ff, #985def); }
.completion-title { margin-top: 14px; }
.completion-destination { display: grid; gap: 8px; padding: 16px; border: 1px solid #6554b8; background: linear-gradient(120deg, #202653, #35244c); border-radius: 4px; }
.completion-destination small { font-size: 9px; letter-spacing: 1.4px; color: #b9aff7; }
.completion-destination strong { font-size: 20px; color: #fff; }
.completion-destination span { font-size: 12px; color: #cac9e6; }
.completion-actions { flex-direction: column; gap: 10px; }
.completion-actions .primary, .completion-actions .secondary { margin-top: 0; padding: 13px; }
dialog[data-mode="construction"] { max-width: 760px; }
.construction-view { height: 280px; border: 1px solid #6554b8; border-radius: 4px; margin: 18px 0 14px; }
.construction-status { font-size: 13px; color: #d4caff; font-weight: 700; }
.construction-progress { height: 6px; background: #11152c; margin-top: 12px; overflow: hidden; border-radius: 3px; }
.construction-progress>div { height: 100%; background: var(--neon-meter); width: 0; }
.construction-continue { width: 100%; }
@media (max-width: 500px) { .construction-view { height: 220px; } }
.zone-chip { color: #b4bdec; background: #0c0d22e6; border-color: #3d3679; border-radius: 4px; }
.expedition-controls { background: #10112e; border-color: var(--line); }
.meter-label { color: #c4ccf0; font-size: 11px; }
.meter-label b { color: var(--gold); }
.meter-label strong { color: #aab5ea; font-size: 10px; }
.meter, .goal-progress { height: 8px; border: 1px solid #1e2055; border-radius: 2px; background: #0a0a1c; }
.meter>div, .goal-progress div { background: var(--neon-meter); border-radius: 0; }
.primary { background: var(--neon-button); color: #ffffff; border: 1px solid #a38cff; border-radius: 4px; box-shadow: 0 3px 0 #302569, 0 0 18px #7859ff35; font-weight: 800; font-size: 12px; }
.primary:hover:not(:disabled) { background: linear-gradient(110deg, #4b6af5, #9256e8); }
.primary small { color: #e0dcff; font-size: 9px; font-weight: 550; }
.secondary, .buy, .reward-energy { border: 1px solid #6c65ac; border-radius: 4px; background: linear-gradient(120deg, #263b67, #3c285b); color: #e9e6ff; box-shadow: 0 2px 0 #0a0b1c; }
.secondary:hover:not(:disabled), .buy:hover:not(:disabled), .reward-energy:hover:not(:disabled) { background: linear-gradient(120deg, #324d83, #56387f); border-color: #b4a2ff; }
.buy { font-size: 11px; min-height: 34px; }
.reward-energy { font-size: 10px; }
.energy-reward-note, .ads-status { color: #909ee3; line-height: 1.6; }
.reward-sale { background: #16173f; color: #a6b1e9; border: 1px solid #47408e; border-radius: 4px; }
.reward-sale small { color: #a0ace7; }
.reward-sale:hover:not(:disabled) { background: #1c1e51; }
.primary:disabled, .expedition-next button:disabled, .buy:disabled, .secondary:disabled, .reward-sale:disabled, .reward-energy:disabled {
  color: #8695e1; background: #131436; border-color: #1e2057; box-shadow: none;
}
.reward-sale:disabled small { color: #8695e1; }
.cargo { background: #0e0f28; }
.cargo-title strong { font-size: 13px; }
.cargo-title>span { color: #9aa7e6; }
.resource, .stock-grid>div { background: var(--inset); border: 1px solid #1f2159; border-radius: 4px; }
.resource strong { color: #d3d8f4; font-size: 14px; }
.resource small { color: #9fabe7; font-size: 9px; }
.cargo-total { color: #94a1e4; font-size: 10px; }
.cargo-total strong { color: #92a0e4; font-size: 14px; }
.cargo-total strong span { color: var(--gold); }
.deposit-button { border-style: dashed; box-shadow: none; padding: 12px; }
.expedition-next { background: #111230; border-color: #393270; }
.expedition-next strong { color: #b0baeb; font-size: 14px; }
.expedition-next p { color: #acb6ea; font-size: 11px; }
.expedition-next small { color: #94a1e4; font-size: 10px; }
.expedition-next.ready { background: #171841; }
.expedition-next.ready strong { color: #adb7eb; }
.panel { padding: 20px; }
.section-heading h2 { color: #c9d0f2; font-size: 16px; letter-spacing: -.2px; }
.goal-panel { background: linear-gradient(130deg, #253a64, #382255); border-color: #7869ba; }
.goal-panel h2 { color: #bdc5ef; font-size: 21px; }
.goal-panel p, .panel-subtitle { color: #a3aee8; font-size: 11px; }
.outline-icon { color: #7a8bde; }
.goal-footer { color: #a0ace7; font-size: 10px; }
.goal-footer strong { color: #8695e1; }
.upgrade, .building { border-color: var(--line); }
.upgrade-icon { background: #0b0c20; border: 1px solid #36306b; color: var(--gold); border-radius: 4px; width: 40px; height: 40px; }
.upgrade-copy strong { color: #cfd5f3; font-size: 12px; }
.upgrade-copy small { color: #9da9e7; font-size: 10px; line-height: 1.5; }
.building .upgrade-icon { width: 37px; height: 37px; border-radius: 3px; }
.building .upgrade-copy strong { font-size: 11px; }
.building .upgrade-copy small { color: #96a3e5; font-size: 9px; }
.building .buy { font-size: 10px; }
.relic-panel { padding: 14px 12px; border-color: #453d88; background: #16173f; }
.relic-panel strong { font-size: 12px; color: #bdc5ef; }
.relic-panel div>span { color: #9aa7e6; font-size: 10px; }
.relic-panel button { color: #97a4e5; background: #1d1f52; border: 1px solid #453e89; border-radius: 4px; width: 32px; min-height: 36px; }
.progression-hub { margin-top: 34px; }
.hub-heading { padding: 18px 20px; background: #0c0d23ed; border: 1px solid #36306b; border-left: 4px solid var(--gold); border-radius: 5px; }
.hub-heading h2 { color: #c9d0f2; font-size: 25px; }
.biome-stop { background: #0e0f27f5; border-color: #37316d; border-radius: 5px; opacity: 1; }
.biome-stop strong { color: #c0c8ef; }
.biome-stop small { color: #8c9be2; font-size: 10px; }
.biome-stop>span { border-radius: 4px; border: 1px solid #b3bcec60; text-shadow: 0 1px 2px #000; }
.biome-stop.current { background: linear-gradient(130deg, #203b66, #3d265f); border-color: #6961b8; box-shadow: inset 0 -3px #9a7bfa, 0 0 18px #775bff20; }
.biome-stop.current strong { color: #bdc5ef; }
.module-row p { color: #acb6ea; }
.module-row small { color: #8493e0; }
.module-row .buy[aria-pressed=true] { background: linear-gradient(110deg, #315a96, #664398); border-color: #6b62b8; color: #c6cdf1; }
.contract-row>div:last-child { color: #a0ace7; }
.stock-grid strong { color: #abb5ea; }
.stock-grid small { color: #a6b1e9; }
footer { color: #a9b4ea; padding: 22px 16px; margin: 22px 0 0; border-top: 1px solid #383270; background: #0c0d23e8; border-radius: 5px 5px 0 0; }
kbd { background: #16173f; color: #bec6ef; border-color: #413a81; }
#reset { color: #9eaae7; font-size: 10px; }
.footer-separator { color: #584faf; }
.spark { color: var(--gold); }
#toast { background: #111332; border: 1px solid #6158b4; border-radius: 5px; color: #dce1f6; box-shadow: 0 4px 0 #090918a0; }
.pause-overlay { background: #0b0c20e8; backdrop-filter: blur(3px); }
.pause-overlay h2 { color: #c0c8ef; }
.pause-overlay p { color: #b0baeb; }
.pause-overlay .primary { background: var(--neon-button); color: #ffffff; box-shadow: 0 3px 0 #302569, 0 0 18px #7859ff35; }
dialog { background: linear-gradient(145deg, #18213c, #281a3f); color: var(--ink); border: 2px solid #5249a2; border-radius: 7px; box-shadow: inset 0 0 0 3px #9c7dff15, 0 20px 80px #030511bb; }
dialog::backdrop { background: #080917bb; backdrop-filter: blur(4px); }
.modal-close { color: #9ca8e6; border: 1px solid #413a81; border-radius: 4px; background: #171840; width: 32px; height: 32px; font-size: 24px; line-height: 1; }
dialog h2 { color: #c5ccf1; margin-top: 10px; padding-right: 12px; }
dialog p, dialog li { color: #aeb8eb; }
dialog .eyebrow { padding-right: 20px; }
.collection-item { border-color: var(--line); }
.museum-set { background: #0c0d22; border: 1px solid #3b3475; border-radius: 4px; }
.museum-set h3 { color: #b6bfed; }
.museum-set h3 small { color: #95a2e5; }
.artifact { background: #121333; border: 1px solid #1e2055; border-radius: 4px; color: #a0ace7; }
.artifact.found { background: #181943; color: #bec6ef; border-color: #4d459a; }
.artifact canvas.undiscovered { filter: grayscale(1) brightness(.9); opacity: .4; }
.daily-status { background: #171942; border: 1px solid #4c4396; border-radius: 4px; color: #bec6ef; }
.daily-grid button { border-radius: 2px; }
.daily-grid button.reachable { border-color: #b9c2ee; outline: 1px solid #4f469d; }
.daily-grid button.dug { border-color: #463e8b; }
.mobile-controls { border-color: #48408f; background: #0f102bed; border-radius: 5px; backdrop-filter: none; }
.mobile-controls button { color: #bdc5ef; border-color: #4c4496; background: #1b1c4c; border-radius: 3px; box-shadow: 0 2px 0 #0c0c21; }
@media (max-width: 1050px) {
  .header { padding: 0 24px; }
  .layout { grid-template-columns: minmax(0,1fr) 280px; gap: 16px; }
  .panel { padding: 17px; }
  .resource { padding: 8px 5px; gap: 5px; }
  .resource small { font-size: 8px; }
}
@media (max-width: 760px) {
  body::before { background-position: 64% top; }
  .header { padding: 0 16px; height: 76px; gap: 12px; }
  .brand { font-size: 16px; gap: 8px; }
  .brand-mark, .brand-mark canvas.sprite-icon { width: 38px; height: 38px; }
  .icon-button { width: 34px; height: 34px; }
  main { padding: 18px 12px 20px; }
  .intro { min-height: 105px; margin: 0 4px 20px; align-items: center; }
  .intro h1 { font-size: 27px; line-height: 1.12; max-width: 280px; }
  .intro p { font-size: 11px; line-height: 1.6; max-width: 240px; }
  .intro .eyebrow { font-size: 8px; letter-spacing: 1px; }
  .wallet { padding: 13px 10px; flex-shrink: 0; gap: 6px; }
  .wallet strong { font-size: 20px; }
  .journey { font-size: 11px; padding: 11px 12px; }
  .expedition { border-radius: 5px; }
  .scene-header { height: 57px; padding: 0 13px; }
  .scene-header strong { font-size: 11px; }
  .depth strong { font-size: 22px; }
  .scene-header>div:first-child { gap: 7px; }
  .canvas-wrap { height: 440px; }
  .expedition-controls { gap: 15px; padding: 15px 13px; }
  .primary { font-size: 11px; padding: 11px 12px; }
  .primary small { font-size: 8px; }
  .meter-label { font-size: 10px; }
  .energy-reward-note { font-size: 8px; }
  .resource { padding: 10px 5px; gap: 5px; }
  .resource small { font-size: 8px; }
  .panel { padding: 16px; }
  .base-panel .building { background: #0c0c21; border-color: #352f69; border-radius: 4px; }
  .upgrade-copy small, .building .upgrade-copy small { color: #a4b0e8; }
  .workshop .upgrade-icon { width: 38px; height: 38px; }
  .building .upgrade-icon { width: 35px; height: 35px; }
  .hub-heading { padding: 16px; }
  .hub-heading h2 { font-size: 23px; }
  .biome-stop strong { font-size: 11px; }
  .biome-stop small { font-size: 9px; }
  .section-heading h2 { font-size: 15px; }
  .stock-grid>div { flex-wrap: wrap; }
  .stock-grid small { font-size: 10px; }
  dialog { padding: 26px 18px; }
  dialog h2 { font-size: 24px; }
  .museum-set { padding: 12px; }
  .museum-set h3 { font-size: 14px; }
  footer { margin-top: 18px; }
}
@media (max-width: 370px) {
  .header { padding: 0 12px; }
  .brand { font-size: 14px; }
  .brand-mark, .brand-mark canvas.sprite-icon { width: 32px; height: 32px; }
  .intro h1 { font-size: 24px; }
  .wallet { flex-direction: column; padding: 10px; }
  .resource { flex-direction: column; text-align: center; }
  .depth { gap: 5px; }
}

/* Drill service and expedition boosters. */
.drill-condition { padding: 17px 22px; background: #121334; border-bottom: 1px solid var(--line); }
.drill-condition .meter-label { font-size: 12px; }
#drill-fill { background: linear-gradient(90deg, #8067ff, #d78bff); }
#drill-note { margin: 9px 0 0; color: #a9b4ea; font-size: 11px; line-height: 1.6; }
.drill-condition.broken { background: #4b3028; border-color: #da9a68; }
.drill-condition.broken #drill-note, .drill-condition.broken .meter-label strong { color: #ffcea0; }
.drill-condition.critical #drill-note, .drill-condition.critical .meter-label strong { color: #ffcea0; }
.drill-condition.critical #drill-fill { background: #f6a361; }
.booster-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding: 13px 0; }
.booster-row strong { font-size: 12px; display: block; }
.booster-row small { font-size: 10px; display: block; color: #adb7eb; margin-top: 6px; }
.booster-row .buy { flex-shrink: 0; }
@media(max-width:760px) { .booster-panel { grid-column: 1/-1; } .drill-condition { padding: 15px 13px; } }

/* Compact game header: balance belongs to navigation, mine starts immediately below. */
.header { height: 72px; gap: 20px;  background: linear-gradient(100deg, #10162bf5, #231535f5);  border-bottom: 1px solid #6151a9;  box-shadow: 0 3px 24px #6958ff20; }
.header .wallet { margin-left: auto; padding: 8px 13px; gap: 9px; flex-shrink: 0; }
.header .wallet .small-label { display: none; }
.header .wallet strong { font-size: 22px; white-space: nowrap; }
.header .coin-icon { width: 28px; height: 28px; border-width: 4px; font-size: 16px; }
.header-actions { margin-left: 0; }
.game-main { padding-top: 6px; }
.game-main .journey { margin: 0 0 12px; padding-top: 9px; padding-bottom: 9px; }
@media(max-width:1200px) { .header .version { display: none; } }
@media(max-width:900px) { .header #save-status { display: none; } }
@media(max-width:760px) {
  .header { height: 64px; gap: 10px; padding: 0 12px; }
  .header .wallet { padding: 7px 9px; gap: 6px; }
  .header .wallet strong { font-size: 18px; }
  .header .wallet small { display: none; }
  .header .coin-icon { width: 24px; height: 24px; font-size: 14px; }
  .header-actions { gap: 5px; }
  .game-main { padding-top: 6px; }
  .game-main .journey { margin-bottom: 10px; }
}
@media(max-width:440px) {
  .header { gap: 8px; padding: 0 10px; }
  .header .brand-mark { display: none; }
  .header .brand { font-size: 14px; flex-shrink: 0; }
  .header .icon-button { width: 30px; height: 32px; }
  .header .wallet { flex-direction: row; padding: 7px; }
  .header .wallet strong { font-size: 16px; }
  .header .coin-icon { display: none; }
}

.row-stability { padding: 9px 18px; color: #b0baeb; background: #131537; border-bottom: 1px solid #37316e; font-size: 11px; line-height: 1.6; }
.row-stability.danger { color: #ffe0ad; background: #573b29; border-color: #ba8b4e; }
.collapse-alert { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); z-index: 2; padding: 12px 25px; background: #4e2e20ee; border: 2px solid #d6a468; color: #ffe0aa; letter-spacing: 4px; font-size: 18px; font-weight: 900; pointer-events: none; }
.collapse-alert[hidden] { display: none; }
@media(max-width:760px){.row-stability{padding:9px 13px;font-size:10px}}

/* Accent surfaces and fallback icons share the same UI palette. */
.biome-stop>span { background: linear-gradient(135deg, #376cad, #8352bb); }
.relic-symbol, .collection-item>span { color: var(--gold); }
.daily-grid button.dug { color: #c9bcff; }
#energy-fill { box-shadow: 0 0 10px #6c9cff50; }

.bomb-controls { display: flex; gap: 16px; align-items: center; padding: 14px 22px; background: linear-gradient(110deg,#171b36,#2a1a3e); border-bottom: 1px solid var(--line); }
.bomb-controls .secondary { margin: 0; display: flex; align-items: center; gap: 9px; flex-shrink: 0; text-align: left; }
.bomb-controls small { display: block; color: #bbb5df; font-size: 9px; margin-top: 4px; }
.bomb-controls p { margin: 0; color: #c2c6e5; font-size: 11px; line-height: 1.6; }
.bomb-art { display: inline-flex; align-items: center; justify-content: center; }
.bomb-art canvas.sprite-icon { width: 28px; height: 28px; }
.mobile-controls #mobile-bomb { border-color: #ad87d7; background: linear-gradient(135deg,#3b4179,#6b346d); display: grid; place-items: center; }
.mobile-controls button:disabled { opacity: .45; }
@media(max-width:760px) { .bomb-controls { padding: 13px; gap: 12px; }.bomb-controls p { font-size: 10px; }.mobile-controls #mobile-bomb { width: 40px; }.mobile-controls .bomb-art canvas.sprite-icon { width: 25px; height: 25px; } }

/* One continuous playing area; management lives in dialogs. */
.game-main .layout { display: block; }
.game-main .scene-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px 32px; height: auto; padding: 16px 22px; }
.scene-header .scene-identity { display: flex; justify-content: space-between; gap: 20px; min-width: 0; }
.scene-identity>div:first-child { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.scene-header .goal-panel { grid-column: 1; padding: 0; border: 0; box-shadow: none; background: none; min-width: 0; }
.scene-header .goal-panel .section-heading, .scene-header #goal-description { display: none; }
.scene-header .goal-panel h2 { font-size: 12px; letter-spacing: 0; margin: 0 0 7px; }
.scene-header .goal-progress { height: 6px; }
.scene-header .goal-footer { font-size: 10px; margin-top: 6px; }
.scene-header .goal-footer strong { font-size: 10px; color: #c0b4ff; }
.panel-launchers { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 7px; }
.panel-button { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; padding: 9px; border: 1px solid #7160b0; border-radius: 5px; background: linear-gradient(145deg, #243961, #3c275a); color: #d9d3ff; box-shadow: inset 0 1px 0 #c9baff20, 0 3px 0 #11112a; }
.panel-button:hover:not(:disabled) { background: linear-gradient(145deg, #36568d, #5a3883); border-color: #b7a2ff; }
.panel-button:disabled { opacity: .45; }
.panel-button svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.panel-button .relic-symbol { display: flex; }
.panel-button canvas.sprite-icon { width: 28px; height: 28px; }
.scene-relic-count { grid-column: 2; font-size: 10px; color: #aeb8e9; text-align: center; }
.game-main .canvas-wrap { height: 560px; }
dialog[data-mode="panel"] { max-width: 620px; }
dialog[data-mode="panel"] .panel { border: 0; box-shadow: none; padding: 0; background: none; }
dialog[data-mode="panel"] .section-heading { padding-right: 28px; gap: 14px; margin-bottom: 18px; }
dialog[data-mode="panel"] .section-heading h2 { font-size: 23px; margin: 0; }
dialog[data-mode="panel"] .building { display: flex; padding: 13px 0; }
dialog[data-mode="panel"] .upgrade-copy strong { font-size: 13px; }
dialog[data-mode="panel"] .upgrade-copy small { font-size: 11px; line-height: 1.6; }
dialog[data-mode="panel"] .stock-panel { margin-top: 24px; border-top: 1px solid #514779; padding-top: 20px; }
dialog[data-mode="panel"] .stock-panel h2 { font-size: 17px; }
dialog[data-mode="panel"] .journey { margin: 14px 0; }
.expedition>.biome-route { margin: 0; padding: 18px 22px; border-top: 1px solid var(--line); }
@media(max-width: 1000px) {
  .game-main .scene-header { gap: 12px; }
  .panel-launchers { grid-column: 1 / -1; grid-row: auto; }
  .scene-header .scene-identity, .scene-header .goal-panel { grid-column: 1 / -1; }
  .scene-relic-count { grid-column: 1 / -1; text-align: left; }
}
@media(max-width: 760px) {
  .game-main .scene-header { padding: 12px; gap: 10px; }
  .scene-identity>div:first-child { gap: 6px; }
  .panel-launchers { gap: 7px; justify-content: space-between; }
  .panel-button { width: 38px; height: 38px; flex-basis: 38px; padding: 6px; }
  .panel-button svg { width: 23px; height: 23px; }
  .game-main .canvas-wrap { height: 440px; }
  .scene-relic-count { font-size: 9px; }
  dialog[data-mode="panel"] .section-heading { flex-wrap: wrap; gap: 7px; }
  dialog[data-mode="panel"] .section-heading h2 { font-size: 21px; }
  dialog[data-mode="panel"] .buy { flex-shrink: 0; }
  .expedition>.biome-route { padding: 14px 12px; }
}
@media(max-width: 360px) { .panel-launchers { gap: 4px; }.panel-button { width: 34px; height: 34px; flex-basis: 34px; } }

/* One telemetry row with a shared height; narrow screens scroll the row. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.game-hud { position: absolute; top: 10px; left: 12px; right: 12px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; z-index: 1; }
.game-main .canvas-wrap { touch-action: auto; }
.hud-row { --hud-height: 56px; display: flex; align-items: stretch; gap: 8px; width: 100%; overflow-x: auto; padding-bottom: 4px; pointer-events: auto; touch-action: pan-x; scrollbar-width: thin; scrollbar-color: #8070bc #17152b80; }
.hud-row:focus-visible { outline: 2px solid #b9a0ff; outline-offset: 2px; }
.game-hud .hud-stat { flex: 0 0 120px; height: var(--hud-height); margin: 0; padding: 7px 10px; border: 1px solid #7060a9; border-radius: 5px; background: #10132bed; min-width: 0; }
.hud-stat-heading { display: flex; align-items: center; gap: 5px; color: #b8c4ef; font-size: 10px; line-height: 12px; }
.hud-stat-heading>span:first-child { color: #d3baff; }
.hud-stat>strong { display: block; margin: 3px 0 5px; font-size: 12px; line-height: 14px; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.game-hud .meter { height: 6px; }
.game-hud .drill-condition.critical, .game-hud .drill-condition.broken { border-color: #ecad6f; background: #392535ed; }
.game-hud .drill-condition.critical>strong, .game-hud .drill-condition.broken>strong { color: #ffcf94; }
.hud-cargo { display: contents; }
.hud-resources { display: flex; flex: 0 0 auto; gap: 8px; }
.hud-counter { display: flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 5px; min-width: 50px; height: var(--hud-height); padding: 6px 8px; border: 1px solid #625791; border-radius: 5px; background: #10132bed; color: #eeeaff; }
.hud-counter strong { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hud-counter canvas.sprite-icon, .hud-counter svg { width: 24px; height: 24px; flex-shrink: 0; }
.hud-counter svg { fill: none; stroke: #c6b7ff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hud-cargo-value { color: #ffe1a1; }
.hud-cargo-value>span { font-size: 22px; }
.hud-counter.full { color: #ffce91; border-color: #dfa365; background: #382633ed; }
.hud-actions { display: flex; flex: 0 0 auto; order: 2; gap: 8px; }
.hud-row>.hud-actions { margin-left: auto; }
.hud-actions .panel-button { width: var(--hud-height); height: var(--hud-height); flex: 0 0 var(--hud-height); box-shadow: none; }
#reward-energy, #reward-sale { grid-template-rows: 1fr; align-content: center; padding: 5px; }
#reward-energy>span { font-size: 24px; line-height: 24px; }
#reward-sale>span { font-size: 17px; white-space: nowrap; }
#reward-energy>small, #reward-sale>small { font-size: 7px; line-height: 9px; letter-spacing: .3px; }
.game-hud #drill-note { align-self: flex-start; max-width: 100%; margin: 0; padding: 7px 10px; font-size: 11px; line-height: 1.4; color: #ffd39d; background: #322132f2; border: 1px solid #a87663; border-radius: 4px; }
.game-hud #drill-note[hidden] { display: none; }
.canvas-wrap .scene-tip { max-width: calc(100% - 24px); white-space: normal; text-align: center; }
.canvas-wrap .scene-tip, .canvas-wrap .scene-return, .canvas-wrap .collapse-alert,
.canvas-wrap.hud-warning .scene-tip, .canvas-wrap.hud-warning .scene-return, .canvas-wrap.hud-warning .collapse-alert { top: var(--hud-bottom, 80px); }
@media(max-width: 760px) {
  .game-hud { left: 8px; right: 8px; top: 8px; gap: 6px; }
  .hud-row, .hud-resources, .hud-actions { gap: 6px; }
  .game-hud #drill-note { font-size: 10px; }
}

.bomb-controls #reward-bombs { margin: 0; flex-shrink: 0; padding: 10px 12px; }
#reward-bombs small { display: block; margin-top: 4px; font-size: 9px; color: #b9ace2; }
#mobile-bomb { position: relative; }
#mobile-bomb-count { position: absolute; top: 1px; right: 2px; min-width: 14px; padding: 1px 2px; border-radius: 3px; background: #242045; color: #ffdf9f; font-size: 10px; line-height: 12px; }
@media(max-width:600px) { .bomb-controls { flex-wrap: wrap; }.bomb-controls p { flex-basis: 100%; margin: 0; } }

.panel-button.unavailable, .icon-button.unavailable { color: #9fa8ce; border-color: #625c89; background: #26263edb; cursor: pointer; }
.panel-button.unavailable:hover, .icon-button.unavailable:hover { color: #dfd8ff; border-color: #aa94e5; background: #363052; }
.hud-actions .panel-button svg { width: 29px; height: 29px; }
.action-message { position: absolute; top: var(--hud-bottom,80px); right: 12px; z-index: 5; width: min(340px,calc(100% - 24px)); padding: 14px 34px 14px 15px; border: 1px solid #a58ae3; border-radius: 7px; background: #1a1835f5; box-shadow: 0 8px 28px #08061780; color: #eee8ff; }
.action-message[hidden] { display: none; }
.action-message strong { display: block; font-size: 13px; }
.action-message p { font-size: 12px; line-height: 1.55; color: #c8c8e6; margin: 6px 0 0; }
.action-message button { position: absolute; right: 5px; top: 3px; width: 28px; height: 28px; border: 0; background: none; color: #c9b8fa; font-size: 24px; }

/* Inventory bays: pixel-art equipment, industrial dioramas and reward cards. */
dialog[data-mode="panel"] { max-width: 720px; padding: 22px; border-color: #8070c2; background: #17182e; box-shadow: inset 0 0 0 4px #292640, 0 24px 90px #050615b3; }
dialog[data-mode="panel"] #modal-close { z-index: 3; background: #15162ce8; }
.game-panel .panel-hero { position: relative; min-height: 154px; margin: -2px -2px 16px; padding: 24px 20px 28px; overflow: hidden; border: 1px solid #53547b; border-radius: 5px; background: linear-gradient(90deg,#151d35 30%,#192a3a80), repeating-linear-gradient(0deg,transparent 0 23px,#91b0e215 24px), repeating-linear-gradient(90deg,#202d43 0 23px,#91b0e226 24px); }
.game-panel .panel-hero::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 8px; border-top: 3px solid #5b647c; background: repeating-linear-gradient(125deg,#b79855 0 9px,#2a2b36 9px 18px); opacity: .7; }
.panel-hero-label { position: relative; z-index: 1; display: block; color: #73d7e4; font-size: 8px; letter-spacing: 2px; font-weight: 750; margin-bottom: 13px; }
dialog[data-mode="panel"] .panel-hero .section-heading { position: relative; z-index: 1; width: 58%; display: flex; flex-direction: column; align-items: flex-start; gap: 13px; padding: 0; margin: 0; }
dialog[data-mode="panel"] .panel-hero h2 { font-size: 25px; line-height: 1.12; color: #f0eaff; text-shadow: 0 2px #080e20; }
.panel-hero .small-label { display: inline-block; color: #ddd5ff; background: #333354; border: 1px solid #5f5987; padding: 5px 8px; border-radius: 3px; font-size: 8px; }
.panel-scene { position: absolute; right: 8px; bottom: 6px; width: 42%; height: 140px; pointer-events: none; }
.panel-scene canvas.sprite-icon { position: absolute; image-rendering: pixelated; }
.panel-scene .scene-factory { width: 215px; height: 146px; right: 0; bottom: -6px; opacity: .85; }
.panel-scene .scene-rover { width: 102px; height: 92px; bottom: -4px; right: 85px; }
.panel-scene .scene-helper { width: 60px; height: 68px; bottom: -5px; right: 3px; }
.panel-scene .scene-chest { width: 120px; height: 110px; bottom: 0; right: 64px; }
.panel-scene .scene-crystal { width: 68px; height: 74px; bottom: -6px; right: 12px; }
.panel-scene .scene-relic { width: 60px; height: 60px; bottom: 55px; right: 10px; }
.panel-scene .scene-collar { width: 104px; height: 104px; bottom: 0; right: 108px; }
.panel-scene .scene-carbide { width: 130px; height: 130px; bottom: -1px; right: 0; }
.panel-scene .scene-toolbox { width: 92px; height: 78px; bottom: -5px; right: 72px; }
dialog[data-mode="panel"] .game-panel>.panel-subtitle { margin: 12px 0; padding: 9px 12px; border-left: 2px solid #638fae; background: #20243b; color: #bdc8e7; font-size: 11px; line-height: 1.6; }
.game-panel canvas.item-art { width: 76px; height: 76px; flex-shrink: 0; image-rendering: pixelated; touch-action: auto; }
.game-panel .buy { min-height: 35px; border-radius: 4px; }
#modules { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.game-panel .module-row { position: relative; display: grid; grid-template-columns: 76px minmax(0,1fr); gap: 10px; align-items: start; padding: 14px; border: 1px solid #474365; border-radius: 5px; background: linear-gradient(135deg,#25283e,#1d2035); box-shadow: inset 0 3px #ffffff06,0 3px #0c1020; }
.game-panel .module-row>div { min-width: 0; }
.game-panel .module-row strong { display: block; font-size: 13px; color: #f0eaff; padding-top: 5px; }
.game-panel .module-row p { font-size: 11px; line-height: 1.55; margin: 7px 0; }
.game-panel .module-row small { font-size: 9px; line-height: 1.45; display: block; }
.game-panel .module-row .buy { grid-column: 1/-1; justify-self: stretch; width: 100%; }
.game-panel .module-row.equipped { border-color: #5e9dba; background: linear-gradient(130deg,#233b48,#22233c); }
.game-panel .module-row.equipped::before { content: ''; position: absolute; top: 7px; left: 7px; width: 5px; height: 5px; background: #74ead4; box-shadow: 0 0 0 2px #14292f; }
.game-panel .module-row.locked .item-art { filter: saturate(.45); opacity: .7; }
#contracts { display: grid; gap: 11px; }
.game-panel .contract-row { display: grid; grid-template-columns: 74px minmax(0,1fr); column-gap: 16px; padding: 15px; border: 1px solid #595073; border-left: 4px solid #7774ad; border-radius: 4px; background: #24253d; }
.contract-art { grid-column: 1; grid-row: 1 / span 3; align-self: center; display: grid; place-items: center; background: #13182a; border: 1px solid #474362; border-radius: 4px; height: 80px; }
.game-panel .contract-row>strong { grid-column: 2; font-size: 13px; color: #ece8ff; }
.game-panel .contract-row>.goal-progress { grid-column: 2; height: 7px; margin: 12px 0 8px; }
.game-panel .contract-row>div:last-child { grid-column: 2; font-size: 11px; gap: 8px; }
.game-panel .contract-row[data-state="ready"] { border-color: #a78c56; border-left-color: #e7bc70; background: linear-gradient(110deg,#34313a,#26283f); }
.game-panel .contract-row[data-state="ready"] .goal-progress>div { background: linear-gradient(90deg,#bd8d46,#f1ce83); }
.game-panel .contract-row[data-state="ready"] .buy { color: #ffe5ac; border-color: #b29561; background: #4a3e47; }
.game-panel .contract-row[data-state="claimed"] .contract-art { opacity: .5; }
.booster-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.game-panel .booster-row { display: flex; flex-direction: column; gap: 13px; align-items: stretch; text-align: center; padding: 18px; border: 1px solid #666089; border-radius: 5px; background: radial-gradient(ellipse at 50% 22%,#3a3d5c,#202238 65%); box-shadow: inset 0 3px #ffffff08,0 3px #0c1020; }
.game-panel .booster-row>.item-art { width: 116px; height: 116px; align-self: center; }
.game-panel .booster-row strong { font-size: 14px; color: #f0eaff; }
.game-panel .booster-row small { font-size: 11px; line-height: 1.5; color: #b8c6e8; }
.game-panel .booster-row .buy { width: 100%; margin-top: auto; }
dialog[data-mode="panel"] .game-panel .upgrade { flex-wrap: nowrap; gap: 16px; padding: 13px; margin: 10px 0; border: 1px solid #514a71; border-radius: 5px; background: linear-gradient(100deg,#2b2b45,#1e2338); }
.game-panel #upgrades { display: block; }
.game-panel .upgrade-copy { min-width: 0; flex-basis: auto; }
.game-panel .upgrade-icon { width: 76px; height: 76px; background: #151a2c; border: 1px solid #4c4e70; border-radius: 4px; }
dialog[data-mode="panel"] .game-panel .upgrade-copy strong { font-size: 14px; color: #eee9ff; }
.game-panel .upgrade .buy { width: auto; margin: 0; }
@media(max-width: 540px) {
  dialog[data-mode="panel"] { padding: 15px; width: calc(100% - 20px); max-height: 94dvh; }
  .game-panel .panel-hero { min-height: 148px; padding: 20px 13px 25px; }
  dialog[data-mode="panel"] .panel-hero h2 { font-size: 22px; }
  dialog[data-mode="panel"] .panel-hero .section-heading { width: 60%; }
  .panel-hero-label { font-size: 7px; letter-spacing: 1px; }
  .panel-scene { right: 0; bottom: 3px; transform: scale(.7); transform-origin: bottom right; width: 180px; }
  #modules { grid-template-columns: 1fr; gap: 9px; }
  .game-panel .module-row { grid-template-columns: 70px minmax(0,1fr); padding: 12px; }
  .game-panel .module-row .buy { grid-column: 2; }
  .game-panel .module-row>.item-art { width: 70px; height: 76px; grid-row: 1 / span 2; }
  .booster-options { gap: 9px; }
  .game-panel .booster-row { padding: 12px 8px; }
  .game-panel .booster-row strong { font-size: 12px; }
  .game-panel .booster-row>.item-art { width: 96px; height: 96px; }
  .game-panel .contract-row { grid-template-columns: 52px minmax(0,1fr); padding: 12px 10px; column-gap: 10px; }
  .contract-art { height: 64px; }
  .contract-art canvas.item-art { width: 52px; height: 58px; }
  .game-panel .contract-row>strong { font-size: 12px; }
  .game-panel .contract-row .buy { width: auto; margin: 0; }
  dialog[data-mode="panel"] .game-panel .upgrade { gap: 10px; padding: 10px; }
  .game-panel .upgrade-icon, .game-panel .upgrade-icon canvas.item-art { width: 58px; height: 64px; }
  dialog[data-mode="panel"] .game-panel .upgrade-copy strong { font-size: 12px; }
  dialog[data-mode="panel"] .game-panel .upgrade-copy small { font-size: 10px; }
}

/* Persistent return action, separate from the resource icons. */
.scene-travel { position: absolute; top: var(--hud-bottom,80px); left: 12px; right: 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; pointer-events: none; }
.canvas-wrap .scene-travel .scene-return { position: static; transform: none; pointer-events: auto; min-height: 40px; max-width: 100%; padding: 10px 15px; font-size: 12px; }
.canvas-wrap .scene-travel .scene-return:active:not(:disabled) { transform: translateY(2px); }
.scene-travel #return-base { color: #eee7ff; border-color: #9380d0; background: linear-gradient(110deg,#304674,#503878); }
.scene-travel #return-base:hover { background: linear-gradient(110deg,#40598e,#62488b); }
.canvas-wrap .scene-tip, .canvas-wrap .collapse-alert, .canvas-wrap .action-message,
.canvas-wrap.hud-warning .scene-tip, .canvas-wrap.hud-warning .collapse-alert { top: calc(var(--hud-bottom,80px) + var(--travel-height,50px)); }

/* Localization: allow longer labels and preserve physical game coordinates. */
html[data-localizing] body { visibility: hidden; }
html[data-localizing] { background: #11142b; }
html[data-localizing]:not([data-loading])::after { content: ''; position: fixed; inset: 45% auto auto 48%; width: 28px; height: 28px; border: 3px solid #575477; border-top-color: #f1b54a; border-radius: 50%; animation: locale-loading 1s linear infinite; }
@keyframes locale-loading { to { transform: rotate(360deg); } }
#language-select { max-width: 116px; min-height: 36px; padding: 5px 7px; border: 1px solid #625791; border-radius: 5px; background: #191c35; color: #eeeaff; font: inherit; font-size: 12px; cursor: pointer; }
#language-select:focus-visible { outline: 2px solid #f1b54a; outline-offset: 2px; }
.header-actions { flex-wrap: wrap; }
.brand { flex-shrink: 0; }
.brand-second { white-space: normal; }
.module-row, .upgrade-copy, .scene-identity > div { min-width: 0; }
.module-row strong, .upgrade-copy strong, .artifact strong, .biome-stop strong { overflow-wrap: anywhere; }
.bomb-controls .secondary { text-align: start; }
html[dir="rtl"] body { font-family: Tahoma, Arial, sans-serif; }
html[dir="rtl"] .brand, html[dir="rtl"] .eyebrow, html[dir="rtl"] .small-label { letter-spacing: normal; }
html[dir="rtl"] .panel, html[dir="rtl"] dialog { text-align: start; }
html[dir="rtl"] .museum-set h3 small { float: left; }
html[dir="rtl"] .modal-close { left: 14px; right: auto; }
html[dir="rtl"] dialog h2 { padding-inline-end: 28px; }
html[dir="rtl"] .scene-relic-count { text-align: start; }
/* Do not mirror navigation buttons, daily cell coordinates or progress counters. */
.mobile-controls, .daily-grid, .hud-stat > strong, .hud-counter strong, #goal-count, #module-count, #build-count, .goal-progress, .meter { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .scene-header .scene-identity { gap: 10px; }
@media(max-width:760px) {
  #language-select { max-width: 94px; min-height: 32px; font-size: 11px; }
  .header-actions { gap: 6px; }
  .header .brand { font-size: 15px; }
  .bomb-controls { flex-wrap: wrap; }
  .expedition-next > div { min-width: 0; }
}
@media(max-width:760px) {
  .header { display: grid; grid-template-columns: minmax(0,1fr) auto; height: auto; min-height: 94px; gap: 8px 12px; padding: 10px 14px; }
  .header .brand { grid-column: 1; grid-row: 1; }
  .header .wallet { grid-column: 2; grid-row: 1; }
  .header .header-actions { grid-column: 1 / -1; width: 100%; justify-content: flex-end; flex-wrap: nowrap; }
  #language-select { margin-inline-end: auto; max-width: 135px; }
}
html[dir="rtl"] .panel-scene { left: 8px; right: auto; }
html[dir="rtl"] .panel-hero-label { letter-spacing: normal; }
html[dir="rtl"] .action-message { padding-inline-start: 16px; padding-inline-end: 34px; }
html[dir="rtl"] .action-message button { left: 5px; right: auto; }
html[dir="rtl"] .game-panel > .panel-subtitle, html[dir="rtl"] .journey { border-left: 0; border-right: 2px solid #638fae; }

/* Keep the start screen visible even while language and modules initialize. */
html[data-loading] { overflow: hidden; }
html[data-loading] body > :not(#loading-screen) { visibility: hidden; }
.loading-screen {
  visibility: visible; position: fixed; inset: 0; z-index: 1000;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
  overflow-y: auto; padding: 24px 16px;
  background: radial-gradient(ellipse at center, #293049 0%, #11142b 75%);
  color: #f5f2e9;
}
.loading-screen[hidden] { display: none; }
.loading-ad { width: min(100%, 970px); min-height: 100px; flex-shrink: 0; }
.loading-card { width: min(100%, 440px); margin-block: auto; text-align: center; padding: 24px; }
.loading-mark { display: block; font-size: 56px; color: #f1b54a; }
.loading-card h1 { font-size: clamp(26px, 6vw, 38px); margin: 12px 0; }
.loading-card p { color: #d0cce1; }
.loading-card progress { display: block; width: 100%; height: 10px; margin: 24px 0; accent-color: #f1b54a; }
.loading-card button { width: 100%; min-height: 48px; }
@media (max-width: 600px) {
  .loading-screen { padding: 16px 12px; gap: 16px; }
  .loading-card { padding: 16px; }
}

/* A dedicated left rail keeps advertising outside the playable area. */
.game-layout { min-width: 0; }
.game-ad-sidebar { display: none; }
@media (min-width: 1100px) {
  .game-layout {
    display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px;
    width: min(100%, 1654px); margin: 0 auto; padding: 6px 32px 0;
    align-items: start; direction: ltr;
  }
  .game-layout .game-main { width: 100%; min-width: 0; margin: 0; padding: 0; }
  .game-ad-sidebar {
    display: block; width: 300px; height: 600px; position: sticky; top: 16px;
    box-shadow: inset 0 0 0 1px #6151a955; background: #11142bcc; border-radius: 6px;
  }
  #yandex_rtb_sidebar_R-A-20280488-1 {
    width: 300px; height: 600px; max-width: 300px; max-height: 600px;
  }
}
