* { box-sizing: border-box; }
:root { --accent: #ff8a3d; --ink: #233d33; --paper: #fff7e1; color: var(--ink); font-family: system-ui, "PingFang SC", sans-serif; }
html, body { margin: 0; min-height: 100%; background: #234a41; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 3px solid #3547ab; outline-offset: 2px; }
button:disabled { opacity: .58; cursor: default; }
[hidden] { display: none !important; }
.game { width: min(100%, 560px); min-height: 100vh; min-height: 100dvh; margin: auto; display: flex; flex-direction: column; }
.scene { position: relative; isolation: isolate; display: flex; flex: 1; flex-direction: column; min-height: 420px; background: #3f8062; overflow: hidden; }
.art { position: absolute; z-index: -1; inset: 0; height: 100%; width: 100%; object-fit: cover; }
.hud { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; padding: calc(12px + env(safe-area-inset-top)) 14px 10px; pointer-events: none; }
.hud span { padding: 6px 10px; border-radius: 8px; font-weight: 800; font-size: 13px; color: #fff8e7; background: #233d33; text-align: center; }
.hud .urgent { background: #8b2c22; }
.board { position: relative; flex: 1; width: min(calc(100% - 24px), 390px); margin: 0 auto 14px; min-height: 350px; display: grid; grid-template: repeat(7, minmax(0, 1fr)) / repeat(5, minmax(0, 1fr)); gap: 3px; padding: 5px; border-radius: 8px; background: #104e578c; box-shadow: 0 0 0 1px #dcffee84; }
.cell { position: relative; min-width: 0; min-height: 0; padding: 0; border: 0; display: grid; place-items: center; border-radius: 6px; background: #337e92c9; color: #f1fffc; font-size: 10px; font-weight: 800; }
.cell:disabled { opacity: 1; }
.cell.bank { background: #50773cd9; }
.cell.deep { background: #143e58ba; }
.cell.slot { background: #226075b0; border: 1px dashed #cfefedbc; }
.cell.rapid { border-color: #ffcb8f; color: #fff0c9; background: #18465fe0; }
.cell.aim { outline: 2px solid #fff1a9; background: #b27332; z-index: 1; }
.cell.lost { background: #9d3a2be8; }
.cell .hint { position: absolute; bottom: 2px; line-height: 1; pointer-events: none; }
.cell .mp-icon { width: 22px; height: 22px; pointer-events: none; }
.rock { display: block; width: 34px; height: 23px; border: 2px solid #4a594f; border-radius: 57% 43% 37% 30% / 65% 54% 43% 36%; background: #b1b7a8; box-shadow: inset 0 3px #e1e3cb, inset 0 -4px #838d7c, 0 2px #243d37; pointer-events: none; }
.cell .rock { width: min(65%, 39px); height: min(48%, 25px); }
.cell .rock.fixed { background: #aaa480; }
.cell .rock.float { background: #91d4bd; box-shadow: inset 0 3px #caffdc, inset 0 -4px #5ba798, 0 2px #243d37; }
.animal { position: absolute; z-index: 2; width: 40px; height: 40px; display: grid; place-items: center; color: #472b21; background: #ffb666; border: 2px solid #543826; border-radius: 50%; box-shadow: 0 2px 0 #2534379e; pointer-events: none; transform: translate(-50%, -50%); transition: top .17s ease, left .17s ease; }
.animal .mp-icon { width: 28px; height: 28px; }
.animal.fell { background: #d7f4ff; color: #125369; }
.animal.snap { transition: none; }
.controls { background: var(--paper); padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); border-top: 3px solid var(--accent); }
.readout { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 12px; margin-bottom: 9px; min-height: 40px; }
#stock { font-size: 21px; white-space: nowrap; }
#stock.low { color: #9b3525; }
#status { font-size: 13px; font-weight: 650; }
.actions { display: grid; grid-template-columns: 62px minmax(0, 1fr) 57px; gap: 8px; }
.actions button, .rewards button { border: 1px solid #ac946d; border-radius: 8px; min-height: 52px; background: #ffedca; font-weight: 750; }
.actions .primary { background: var(--accent); border-color: #994b21; color: #361b10; }
.supply, .retry { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; }
.supply { touch-action: none; user-select: none; }
.supply[aria-pressed="true"] { outline: 2px solid #a24319; background: #ffd49e; }
.rewards { display: flex; gap: 8px; margin-top: 8px; }
.rewards button { flex: 1; min-height: 44px; font-size: 13px; }
.drag-rock { position: fixed; z-index: 5; transform: translate(-50%, -65%); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .animal { transition: none; } }
