:root{color-scheme:dark;--bg:#141925;--panel:#212b39;--lime:#d2fa69;--muted:#a8b5c7}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:#f7f8fc;font:14px/1.55 system-ui,sans-serif}.farm-app{max-width:1080px;margin:auto;padding:18px}header{display:flex;align-items:center;justify-content:space-between;gap:12px}.eyebrow{font-size:9px;letter-spacing:2px;color:var(--lime);font-weight:750}h1{font-size:26px;letter-spacing:-1px;margin:5px 0 15px}h1 span{color:var(--lime)}button{font:inherit;background:var(--panel);color:#f7f8fc;border:1px solid #3b495c;border-radius:9px;padding:10px 14px;cursor:pointer;touch-action:manipulation;min-height:44px}button:hover{border-color:var(--lime)}button:focus-visible,canvas:focus-visible{outline:3px solid var(--lime);outline-offset:3px}button:disabled{opacity:.5;cursor:default}.primary{background:var(--lime);color:#17201b;border-color:var(--lime);font-weight:750}.hud{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:14px}.hud>div{padding:10px 15px;background:#202a39;border:1px solid #324054;border-radius:12px}.hud small{display:block;font-size:9px;letter-spacing:1.5px;color:var(--muted)}.hud strong{font-size:24px;color:var(--lime)}.stage{position:relative;overflow:hidden;border-radius:16px;border:1px solid #597e57;background:#92b77b;height:520px}canvas{display:block;width:100%;height:100%;touch-action:none}.world-label{position:absolute;top:14px;left:16px;color:#24412d;font-size:9px;font-weight:850;letter-spacing:2px;pointer-events:none}#toast{position:absolute;left:50%;top:40px;transform:translateX(-50%);width:max-content;max-width:90%;background:#172d24e8;color:#f1f6dd;padding:9px 15px;border-radius:20px;font-size:12px;text-align:center;pointer-events:none}.map-hint{position:absolute;bottom:12px;right:16px;font-size:10px;color:#f7fae9;background:#21392da8;padding:4px 10px;border-radius:15px;pointer-events:none}.joystick{position:absolute;bottom:25px;left:22px;width:100px;height:100px;border:2px solid #ffffff80;background:#e4efcd33;border-radius:50%;touch-action:none;display:grid;place-items:center}.joystick span{display:block;width:44px;height:44px;border-radius:50%;background:#ffffffbb;box-shadow:0 3px 10px #0003;pointer-events:none}.actions{display:flex;gap:9px;flex-wrap:wrap;margin:14px 0}.actions button{flex:1}.bottom{display:flex;justify-content:space-between;gap:18px}.quests h2{font-size:15px;margin:5px 0}.quests p{font-size:12px;color:var(--muted);margin:6px 0;white-space:pre-line}.quests #save-note{font-size:10px;color:#93b5a0}.dpad{text-align:center;flex-shrink:0}.dpad button{width:44px;padding:9px}.dpad>div{display:flex;gap:5px;margin-top:5px}.help{color:var(--muted);font-size:12px;margin:14px 0}.quiet{font-size:11px;color:var(--muted);min-height:36px;background:transparent}dialog{width:min(500px,calc(100vw - 28px));border:1px solid #435466;background:#141925;color:#f7f8fc;border-radius:18px;padding:24px;max-height:88vh;overflow:auto}dialog::backdrop{background:#07100bd9}.dialog-head{display:flex;justify-content:space-between;align-items:center}dialog h2{margin:4px 0 12px}.upgrade{border:1px solid #344154;padding:14px;border-radius:12px;margin-top:10px;display:flex;justify-content:space-between;gap:14px;align-items:center}.upgrade strong{display:block}.upgrade small{color:var(--muted)}.upgrade button{flex-shrink:0}#shop-status{color:var(--lime);min-height:24px}.danger{background:#613038;border-color:#b45f6b}@media(max-width:600px){.farm-app{padding:10px}h1{font-size:23px}.hud strong{font-size:21px}.hud>div{padding:9px 12px}.stage{height:480px}.actions{gap:7px}.actions button{padding:10px 9px;font-size:12px;flex-basis:40%}.joystick{width:92px;height:92px}.upgrade{padding:12px;gap:8px}.upgrade button{padding:10px}.map-hint{max-width:52%;text-align:center}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto}}

/* Warm, toy-like farm palette complements the original painted canvas scenery. */
.stage{background:#dbb777;border-color:#b99250;box-shadow:inset 0 0 0 3px #edcf9633,0 12px 36px #0002}.world-label{color:#614920}.hud>div{background:linear-gradient(135deg,#32543e,#23382e);border-color:#56734b;box-shadow:inset 0 1px #b3d18e22}.hud strong{color:#ffe183;text-shadow:0 2px #14251b}.hud small{color:#c8d5b8}#toast{background:#563e24ed;border:1px solid #f3d69555;color:#fff0c8}.joystick{background:#f5e7bf33;border-color:#fff4d6a8}.joystick span{background:linear-gradient(135deg,#fff8df,#e6d3a5);box-shadow:0 4px 12px #52371955}.map-hint{background:#62482cba;color:#fff1d2}

.farm-3d{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}#farm{position:relative;z-index:1;background:transparent}.world-label,#toast,.joystick,.map-hint{z-index:2}.pause-overlay,.graphics-error{position:absolute;inset:0;display:grid;place-items:center;background:#30271988;color:#fff1cc;font-size:24px;pointer-events:none;z-index:3}.pause-overlay[hidden]{display:none}.graphics-error{padding:30px;text-align:center;font-size:17px}#toast{font-size:11px;top:38px;max-width:86%}

.hud{grid-template-columns:repeat(4,minmax(0,1fr))}.coin-icon{display:inline-block;width:17px;height:17px;border-radius:50%;vertical-align:middle;background:radial-gradient(circle at 35% 25%,#fff3a2,#f2b832 65%,#b87914);border:2px solid #ffdc68;box-shadow:0 2px 0 #9c681e,inset 0 0 0 2px #dca02a}.hud small .coin-icon{width:11px;height:11px;border-width:1px;margin-right:3px}.inventory-line{display:flex;justify-content:space-between;gap:12px;color:#dce6c7;background:#293b2c;border:1px solid #455a3b;border-radius:9px;padding:8px 12px;font-size:12px;margin-bottom:12px}.earn-pop{position:absolute;left:50%;top:100px;transform:translateX(-50%);display:flex;gap:8px;align-items:center;border:1px solid #f7db75;border-radius:25px;padding:10px 17px;background:#684b22f2;color:#ffed9a;font-size:21px;z-index:5;pointer-events:none;box-shadow:0 5px 24px #38230766}.earn-pop[hidden]{display:none}.earn-pop .coin-icon{width:25px;height:25px}@media(max-width:700px){.hud{grid-template-columns:repeat(2,minmax(0,1fr))}.hud strong{font-size:22px}.inventory-line{font-size:11px}}
.last-income{display:block;color:#ffed9f;font-size:10px;margin-top:2px}

.hud{grid-template-columns:repeat(3,minmax(0,1fr))}@media(max-width:700px){.hud{grid-template-columns:repeat(3,minmax(0,1fr))}.hud>div{padding:9px}.hud small{font-size:8px;letter-spacing:.8px}.last-income{font-size:9px}}
.worker-status{font-size:11px;line-height:1.5;color:#d7dfc2;margin:0 0 10px;padding:8px 12px;border-left:3px solid #d2fa69;background:#26382a;border-radius:5px}

/* In-scene inventory, readable over the moving world. */
.stage{height:620px;background:#79bc35}.stage .hud{position:absolute;right:12px;top:12px;z-index:4;display:flex;flex-direction:column;width:155px;gap:6px;margin:0;pointer-events:none}.stage .hud>div{padding:5px 12px;background:linear-gradient(180deg,#355820ed,#152d18eb);border:2px solid #a9d75f;border-radius:25px;box-shadow:0 3px 0 #18371b66;display:flex;align-items:center;justify-content:space-between;gap:8px}.stage .hud small{font-size:8px;letter-spacing:0;color:#f2ffcc}.stage .hud strong{font-size:22px;color:#fff;text-shadow:0 2px #14251b;white-space:nowrap}.stage .last-income{display:none}.world-label{max-width:40%;color:#fff9d2;text-shadow:0 1px #385421}#toast{top:auto;bottom:16px;max-width:52%;font-size:10px;left:60%}.earn-pop{top:160px}.inventory-line{display:none}.worker-status{margin-bottom:8px}@media(max-width:600px){.stage{height:570px}.stage .hud{width:144px;right:8px;top:8px}.stage .hud strong{font-size:20px}.stage .hud>div{padding:4px 9px}.world-label{font-size:8px;left:10px}.map-hint{bottom:64px}}
