:root { color-scheme: dark; }
body.clicker-page header.game-header { min-height:60px; padding:8px 24px; gap:10px 20px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body.clicker-page { margin: 0; color: #e9e4d0; background: #101a16; font: 17px/1.5 system-ui, sans-serif; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; color: #eee4c8; background: #293a2e; border: 1px solid #697959; border-radius: 6px; padding: 11px 16px; min-height: 44px; }
button:hover:not(:disabled) { background: #3c5039; border-color: #d6bd7d; }
button:disabled { cursor: default; opacity: .48; }
:focus-visible { outline: 3px solid #ebce86; outline-offset: 4px; }
a { color: #d7bd80; }
.clicker-header { padding: 18px 28px; display: flex; align-items: center; gap: 22px; border-bottom: 1px solid #3b4c3c; }
.clicker-header > a:last-child { margin-left: auto; text-decoration: none; font-size: 15px; }
.clicker-brand { color: #e7c886; font-weight: 800; text-decoration: none; letter-spacing: .09em; line-height: 1.3; }
.clicker-brand span { display: block; font-size: 12px; letter-spacing: .2em; margin-top: 4px; }
.beta-badge { font-size: 11px; letter-spacing: .08em; padding: 6px 10px; border: 1px solid #607153; border-radius: 4px; }
.clicker-shell { max-width: 1840px; margin: 0 auto; padding: 20px 24px; }
.resource-header { display: flex; gap: 20px; justify-content: space-between; align-items: center; padding: 12px 18px; border: 1px solid #46573f; border-radius: 9px; background: #1d2c22; }
.eyebrow { font-size: 11px; letter-spacing: .15em; color: #d2bb86; }
h1, h2 { color: #eee5cb; font-family: Georgia, serif; font-weight: 500; }
h1 { font-size: 23px; line-height: 1.15; margin: 5px 0 0; }
h2 { font-size: 25px; line-height: 1.2; margin: 9px 0 15px; }
.resource-stat > span { display: block; color: #acbea4; font-size: 11px; letter-spacing: .1em; }
.resource-stat strong { display: block; font-size: 25px; line-height: 1.25; font-variant-numeric: tabular-nums; color: #f0dba9; }
.resource-stat small { font-size: 12px; color: #afbea7; }
.clicker-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr) 290px; gap: 16px; margin-top: 16px; }
.clicker-sidebar, .extraction-column { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.panel { background: #1b2a20; border: 1px solid #40513c; border-radius: 9px; padding: 20px; }
.panel p { margin: 0 0 15px; color: #c2cbb6; font-size: 16px; }
.panel p:last-child { margin-bottom: 0; }
.panel .muted { font-size: 14px; color: #9eaf97; }
.quick-guide { padding-left: 21px; margin: 0; color: #c7d0bd; font-size: 16px; }
.quick-guide li + li { margin-top: 10px; }
.ledger dl { margin: 0 0 18px; }
.ledger dl > div { border-bottom: 1px solid #354a35; padding: 10px 0; }
.ledger dt { font-size: 14px; color: #afbea4; }
.ledger dd { margin: 2px 0 0; color: #e2cc95; font-size: 21px; font-variant-numeric: tabular-nums; }
.pit-scene { position: relative; height:clamp(340px,calc(100svh - 345px),560px); flex:none; overflow: hidden; isolation: isolate; border: 1px solid #617151; border-radius: 10px; background: #101813; }
.pit-scene::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 100px #08180b90; z-index: 15; }
.mine-viewport { position: absolute; inset: 62px 0 184px; overflow: hidden; }
.pit-world { position: absolute; width: 4000px; height: 2000px; left: 0; top: 0; transform-origin: 0 0; user-select: none; touch-action: none; cursor: grab; background: repeating-linear-gradient(166deg, transparent 0 140px, #b0ac8838 142px, transparent 145px 320px), linear-gradient(#202c25 0 300px, #34372e 300px, #292c26 70%, #22251f); }
.mine-surface { position: absolute; top: 286px; left: 0; width: 100%; height: 24px; background: #646954; border-top: 5px solid #929273; box-shadow: 0 14px 0 #1b231c; }
.mine-gallery { position: absolute; left: 140px; right: 100px; top: calc(var(--floor) - 240px); height: 240px; background: linear-gradient(#101711, #1d2c21); border-top: 12px solid #444b38; border-bottom: 14px solid #6c7054; border-radius: 38px 65px 0 0; box-shadow: 0 -14px 0 #242a21, 0 12px 0 #171f18; }
.gallery-label { position: absolute; top: 25px; left: 240px; color: #a2ab88; font: 25px monospace; letter-spacing: 4px; }
.gallery-rails { position: absolute; bottom: 0; left: 160px; right: 25px; height: 11px; border-block: 3px solid #8d967b; background: repeating-linear-gradient(90deg, #655c43 0 10px, transparent 10px 40px); }
.gallery-support { position: absolute; inset: 14px 50px 12px 220px; background: repeating-linear-gradient(90deg, transparent 0 927px, #7a705b 927px 940px); border-top: 8px solid #6c624d; opacity: .5; }
.mine-shaft { position: absolute; z-index: 2; left: 150px; top: 180px; bottom: 125px; width: 135px; border-inline: 15px solid #76806a; background: repeating-linear-gradient(0deg, #55604b 0 8px, #111c15 8px 75px); box-shadow: 0 0 0 12px #212a20; }
.mine-lift { position: absolute; top: 320px; left: 4px; right: 4px; height: 125px; border: 8px solid #ada17b; background: repeating-linear-gradient(90deg, transparent 0 24px, #8b8667 24px 29px), #2a3328; box-shadow: 0 -20px 0 -8px #dcc27b; }
.pit-world.is-dragging { cursor: grabbing; }
.pit-world.is-reframing { transition: transform .7s ease; }
.view-sector { position: absolute; top: 31px; left: 12px; color: #b9c89f; font: 11px monospace; letter-spacing: 1px; }
.mine-deposit { position: absolute; left: 1000px; bottom: 1334px; width: 100px; height: 85px; object-fit: contain; z-index: 3; }
.view-controls { position: absolute; top: 12px; right: 12px; display: flex; align-items: center; gap: 5px; padding: 5px; z-index: 25; border: 1px solid #67795a; border-radius: 6px; background: #14241ee8; }
.view-controls button { min-width: 44px; padding: 5px 9px; min-height: 44px; font-size: 16px; }
.view-controls #view-reset[aria-pressed="true"] { background: #b5c28d; border-color: #d8dfb6; color: #17251a; }
.view-controls span { min-width: 40px; text-align: center; color: #cfdbb8; font-size: 13px; }
.scene-building { position: absolute; height: auto; pointer-events: none; filter: brightness(.82); }
.scene-building--works { width: 200px; left: 360px; bottom: 1714px; z-index: 3; }
.scene-building--mine { width: 180px; left: 860px; bottom: 1714px; z-index: 4; }
.scene-crates { position: absolute; width: 60px; left: 650px; bottom: 1714px; z-index: 5; filter: brightness(.85); }
.scene-label { position: absolute; color: #d2d3b0; font: 26px monospace; padding: 4px 7px; background: #15241de0; border-radius: 3px; z-index: 12; }
.scene-label--works { top: 25px; left: 340px; }
.scene-caption { position: absolute; inset: auto 12px 8px; text-align: center; color: #c7cdb2; font-size: 11px; line-height:1.3; z-index: 20; pointer-events: none; }
.mine-actions { position:absolute; left:50%; bottom:44px; transform:translateX(-50%); width:min(214px,calc(100% - 24px)); z-index:20; display:flex; flex-direction:column; gap:6px; }
.mine-actions .deliver-button { width:100%; min-height:36px; padding:7px 9px; font-size:13px; }
.ore-button { position: relative; width: 100%; padding: 5px 10px 7px; z-index: 20; border: 1px solid #b2b784a8; border-radius: 50% 50% 12px 12px; background: #192b1dd9; user-select: none; touch-action: manipulation; box-shadow: 0 10px 36px #09170b80; }
.ore-button > img { display: block; width: 60px; height: 44px; object-fit: contain; margin: -8px auto 0; filter: drop-shadow(0 0 14px #b5c89340); pointer-events: none; }
.ore-button > span { display: block; font-size: 13px; font-weight: 800; letter-spacing: .06em; }
.ore-button > small { display: block; font-size: 12px; color: #c4d3ac; margin-top: 2px; }
.ore-button:active { transform:scale(.97); }
.crew-worker { position: absolute; width: 64px; height: 80px; pointer-events: none; transform: translate(-50%, -100%); z-index: 9; }
.worker-sprite { display: block; width: 64px; height: 80px; background-size: 1024px 80px; background-repeat: no-repeat; }
.crew-worker[data-level="2"] .tier-badge, .industry-building[data-level="2"] .tier-badge { border-color:#9ab6a0; }
.crew-worker[data-level="3"] .tier-badge, .industry-building[data-level="3"] .tier-badge { border-color:#c9a56f; }
.crew-worker[data-level="4"] .tier-badge, .industry-building[data-level="4"] .tier-badge { border-color:#c0d7d1; }
.tier-badge { position: absolute; top: -21px; left: 50%; transform: translateX(-50%); white-space: nowrap; color: #f7e8b6; background: #101e18ed; border: 1px solid #899674; border-radius: 3px; padding: 1px 4px; font: bold 19px/1.2 monospace; }
.tier-badge:empty { display: none; }
.industry-building { position: absolute; width: 130px; pointer-events: none; }
.industry-building img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }
.industry-building--winch { width: 100px; }
.scene-label--tools { left: 1100px; top: 240px; }
.scene-summary, .scene-legend { margin: 0; font-size: 14px; color: #b8c6ab; }
.scene-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.scene-legend span { padding: 2px 6px; border: 1px solid currentColor; border-radius: 3px; white-space: nowrap; }
.tier-two { color: #8bccea; } .tier-three { color: #edb671; } .tier-four { color: #d1a0ed; }
.fragment { position: absolute; left: 50%; top: 50%; z-index: 30; color: #eee6ad; font-weight: 800; text-shadow: 0 2px 4px #142018; pointer-events: none; animation: fragment-rise .8s ease-out forwards; }
#production-numbers { position: absolute; inset: 0; z-index: 14; pointer-events: none; overflow: hidden; }
.production-number { position: absolute; white-space: nowrap; color: #ead69c; background: #122118ce; border: 1px solid #82926b80; border-radius: 5px; padding: 2px 6px; font: 700 15px/1.3 system-ui, sans-serif; font-variant-numeric: tabular-nums; text-shadow: 0 1px 3px #000; pointer-events: none; animation: production-rise 1.6s ease-out forwards; }
.production-number--worker { color: #c0dbab; }
.production-number--winch { color: #b1d1d8; }
@keyframes production-rise { 0% { opacity: 0; transform: translate(-50%, 8px); } 15%, 65% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -30px); } }
@keyframes fragment-rise { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(calc(-50% + var(--drift)), -75px); } }
.game-status { margin: 0; padding: 12px 15px; border: 1px solid #5b7049; background: #20331fe8; border-radius: 6px; color: #d4dec0; font-size: 16px; min-height: 49px; }
 .primary-button { background:#d3ba7c; color:#16251b; border-color:#d3ba7c; font-weight:750; }
.primary-button:hover:not(:disabled) { background:#ebd294; color:#16251b; }
.supply-panel { padding:9px 13px; }
.supply-progress { display:flex; justify-content:space-between; gap:12px; color:#c7d1b6; font-size:12px; line-height:1.3; }
.supply-progress span:last-child { color:#ead59b; font-variant-numeric:tabular-nums; white-space:nowrap; }
.supply-panel progress { display:block; width:100%; height:8px; margin:5px 0 0; accent-color:#aabe80; }
.purchase { width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 8px; text-align: left; margin: 5px 0; background: #243620; }
.purchase > img { width: 36px; height: 44px; object-fit: contain; flex-shrink: 0; }
.purchase > span { min-width:0; flex:1; display:grid; grid-template-columns:minmax(0,1fr) auto; column-gap:6px; }
.purchase strong { display:block; grid-column:1 / -1; font-size:14px; line-height:1.2; }
.purchase small { display:block; grid-column:1 / -1; color:#bbc9aa; font-size:12px; line-height:1.25; margin-top:2px; }
.purchase b { display:block; color:#e9d49d; font-size:12px; margin-top:3px; font-variant-numeric:tabular-nums; }
.purchase em { display:block; font-style:normal; color:#a3b58c; font-size:11px; margin-top:3px; text-align:right; align-self:end; }
.milestone-card { padding:10px; flex:none; background:#16271e; border:1px solid #8a9664; border-radius:7px; }
.milestone-card > strong { display:block; color:#ead59b; margin-top:4px; font-size:14px; }
.milestone-card p { font-size:12px; margin:5px 0; }
.milestone-card progress { width:100%; height:7px; accent-color:#b4c780; }
.milestone-card small { display:block; margin-top:3px; font-size:11px; color:#b7c7a9; }
.purchase.is-locked:disabled { opacity:.85; background:#1a2821; border-style:dashed; }
.purchase.is-locked > img { width:30px; height:36px; opacity:.4; filter:grayscale(1); }
.purchase.is-locked strong { font-size:14px; color:#bdc6b5; }
.purchase.is-locked b, .purchase.is-locked em, .purchase.is-locked small:not(.unlock-requirement) { display:none; }
.purchase .unlock-requirement { color:#c9b991; font-size:12px; }
.industry-label { display:block; text-align:center; background:#13211be6; color:#dfd4ad; border-radius:3px; font-size:14px; padding:2px 3px; white-space:nowrap; }
.industry-building--conveyor::after { content:''; position:absolute; bottom:0; left:-6px; right:-6px; height:7px; border:2px solid #858d72; background:repeating-linear-gradient(90deg,#2b372e 0 8px,#818971 9px 12px); }
.industry-building--crusher { width:110px; }
.industry-building--refinery { width:145px; }
.industry-building--deepmine { width:150px; }
.clicker-sidebar--upgrades { align-self:start; position:sticky; top:16px; }
.upgrades-panel { display:flex; flex-direction:column; height:calc(100svh - 265px); min-height:320px; max-height:740px; padding:14px; }
.upgrades-panel > .eyebrow { flex:none; }
.upgrades-panel h2 { flex:none; font-size:21px; margin:4px 0 10px; }
.upgrades-panel > .muted { flex:none; font-size:11px; line-height:1.3; margin:7px 0 0; }
#clicker-purchases { flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; scrollbar-width:thin; scrollbar-color:#78896a #13231b; margin-top:7px; padding-right:4px; }
#clicker-purchases:focus-visible { outline-offset:0; }
.save-panel > span:last-of-type { display: block; color: #b2c59a; font-size: 14px; }
.text-button { padding: 9px 0; border: 0; text-decoration: underline; background: transparent; color: #c2b17f; font-size: 14px; }
.text-button:hover:not(:disabled) { background: transparent; }
.clicker-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 24px; color: #96ab91; font-size: 13px; }
dialog { max-width: 440px; width: calc(100% - 32px); background: #203124; border: 1px solid #8c9469; border-radius: 10px; padding: 25px; color: #e3dfc7; }
dialog::backdrop { background: #08140dd9; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
@media (max-width: 1000px) { .clicker-layout { grid-template-columns: 210px minmax(0, 1fr); } .clicker-layout > aside:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1.5fr 1fr; align-items: start; } .resource-header { flex-wrap: wrap; } .clicker-title { flex-basis: 100%; } .pit-scene { min-height: 0; } }
@media (max-width: 700px) { .clicker-layout { grid-template-columns: minmax(0, 1fr); } .extraction-column { grid-row: 1; } .clicker-layout > aside:last-child { display: flex; } .clicker-header { padding: 14px 16px; gap: 12px; } .beta-badge { display: none; } .clicker-shell { padding: 14px 12px; } .resource-header { gap: 16px; padding: 18px; } .resource-stat { flex: 1 1 120px; } .resource-stat strong { font-size: 25px; } .panel { padding: 18px; } .pit-scene { min-height: 0; } .ore-button { width: 190px; }   .scene-caption { font-size: 11px; } .supply-progress { flex-wrap: wrap; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width:1000px) { .clicker-sidebar--upgrades { position:static; } .upgrades-panel { height:560px; max-height:none; min-height:0; } }
@media (max-width:700px) { .pit-scene { height:clamp(360px,58svh,480px); } .mine-actions { width:200px; } .ore-button { width:100%; } .upgrades-panel { height:520px; } }

@media (max-width:700px) { body.clicker-page header.game-header { padding:8px 12px; } .resource-header { padding:12px; gap:10px; } .resource-stat strong { font-size:22px; } .resource-stat small { font-size:11px; } }
