*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#9ebc65;touch-action:none;overscroll-behavior:none}#game{display:block;width:100%;height:100%;outline:none}button{cursor:pointer;color:#fff9e9;background:#2e483675;border:1px solid #fff5dcb0;box-shadow:0 3px 18px #13331c30;backdrop-filter:blur(5px);display:grid;place-items:center;padding:0;touch-action:none}button:hover{background:#2e4836a0}button:focus-visible{outline:3px solid #fff2c7;outline-offset:5px}button svg{width:29px;height:29px}#mapButton{position:fixed;right:max(24px,env(safe-area-inset-right));top:max(24px,env(safe-area-inset-top));width:54px;height:54px;border-radius:50%;z-index:2}#joystick{position:fixed;left:max(36px,env(safe-area-inset-left));bottom:max(34px,env(safe-area-inset-bottom));width:126px;height:126px;border:1px solid #fff9d976;border-radius:50%;background:#2c493039;box-shadow:inset 0 0 28px #1b352012;touch-action:none;z-index:2}#joystick:before,#joystick:after{content:'';position:absolute;background:#fff5dc44;left:50%;top:50%;transform:translate(-50%,-50%)}#joystick:before{width:44px;height:1px}#joystick:after{height:44px;width:1px}#stickKnob{position:absolute;left:40px;top:40px;width:44px;height:44px;border-radius:50%;background:#fffae5a1;border:1px solid #fffce8d0;box-shadow:0 3px 14px #1e3c2836;pointer-events:none}#jumpButton{position:fixed;right:max(36px,env(safe-area-inset-right));bottom:max(45px,env(safe-area-inset-bottom));width:78px;height:78px;border-radius:50%;z-index:2}#jumpButton svg{width:40px;height:40px}body.map-open #joystick,body.map-open #jumpButton{display:none}#diagnostics{display:none}@media(max-width:600px){#joystick{width:112px;height:112px;left:24px;bottom:28px}#stickKnob{left:34px;top:34px}#jumpButton{width:70px;height:70px;right:24px;bottom:38px}#mapButton{right:19px;top:19px;width:48px;height:48px}}
#inventoryButton{position:fixed;left:max(24px,env(safe-area-inset-left));top:max(24px,env(safe-area-inset-top));width:54px;height:54px;border-radius:50%;z-index:2}#flowerCount{position:absolute;right:-3px;bottom:-3px;min-width:20px;height:20px;border-radius:50%;background:#d7c49a;color:#344b35;font:600 12px/20px Georgia,serif}#flowerCount:empty{display:none}
#flowerInventory{position:fixed;inset:0 auto auto 0;margin:90px 0 0 24px;width:min(388px,calc(100vw - 48px));max-height:calc(100dvh - 114px);overflow:auto;padding:24px;color:#eae7d6;background:#243e31f5;border:1px solid #a4ad8477;border-radius:22px;box-shadow:0 18px 80px #11221f70;font-family:Georgia,serif;touch-action:pan-y;scrollbar-width:thin}#flowerInventory::backdrop{background:#0f251d32;backdrop-filter:blur(2px)}#flowerInventory header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}#flowerInventory h1{font-size:25px;line-height:1.1;font-weight:normal;margin:0 0 6px}#flowerInventory header p{margin:0;font:12px/1.5 system-ui,sans-serif;color:#bdc8ac}#closeInventory{width:30px;height:30px;border:0;background:none;box-shadow:none;backdrop-filter:none;border-radius:50%}#closeInventory svg{width:22px;height:22px}.inventory-help{font:13px/1.6 system-ui,sans-serif;color:#c5cfba;margin:19px 0 20px}#flowerGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.flower-card{position:relative;border-radius:13px;background:#4c67463b;border:1px solid #c5ceaa32;padding:8px 4px 12px;gap:3px;font:14px Georgia,serif;box-shadow:none;backdrop-filter:none;min-width:0}.flower-art{width:72px;height:68px;display:block}.flower-art svg{width:100%;height:100%;filter:drop-shadow(0 3px 4px #102d2150)}.flower-card small{min-height:14px;font:10px/1.4 system-ui,sans-serif;color:#bfccad}.flower-card[aria-pressed=true]{border-color:#d3bc80;background:#76835a40}.flower-card[aria-pressed=true]:after{content:'✓';position:absolute;right:7px;top:5px;color:#d8c799;font:12px system-ui,sans-serif}.flower-card:disabled{cursor:default;opacity:.48;border-style:dashed;background:transparent}.flower-art.undiscovered{filter:grayscale(1);opacity:.28}.flower-card:disabled small{font-size:9px}#naturalTack{margin:18px auto 0;border:0;box-shadow:none;background:none;backdrop-filter:none;display:flex;gap:8px;font:12px system-ui,sans-serif;color:#bdc8ac;padding:5px;border-radius:5px}#naturalTack[aria-pressed=true]{color:#f0dfbc}.leather-swatch{width:12px;height:12px;display:inline-block;background:#8c6948;border:1px solid #d6bd8d;border-radius:50%}.flower-pickup{position:fixed;width:76px;height:76px;pointer-events:none;z-index:10;filter:drop-shadow(0 3px 6px #173f3480);transform:translate(-50%,-50%)}.flower-pickup svg{width:100%;height:100%}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
@media(max-width:600px){#inventoryButton{left:19px;top:19px;width:48px;height:48px}#flowerInventory{margin:82px 0 0 16px;width:calc(100vw - 32px);max-height:calc(100dvh - 102px);padding:20px}.flower-art{width:65px;height:62px}}

#performanceHUD{position:fixed;top:8px;left:50%;transform:translateX(-50%);margin:0;padding:8px 12px;z-index:20;pointer-events:none;color:#fff;background:#142b24de;border-radius:8px;font:12px/1.5 monospace}

#lightingButton{position:fixed;right:calc(max(24px,env(safe-area-inset-right)) + 66px);top:max(24px,env(safe-area-inset-top));width:54px;height:54px;border-radius:50%;z-index:4}
#lightingMenu[hidden]{display:none}#lightingMenu{position:fixed;right:max(24px,env(safe-area-inset-right));top:calc(max(24px,env(safe-area-inset-top)) + 66px);width:min(320px,calc(100vw - 32px));max-height:calc(100dvh - 106px);overflow:auto;z-index:5;padding:19px 20px 15px;border:1px solid #a4ad8477;border-radius:18px;box-shadow:0 12px 45px #11221f70;background:#243e31f5;color:#eae7d6;font:13px/1.4 system-ui,sans-serif;touch-action:pan-y;scrollbar-width:thin}
#lightingMenu header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}#lightingTitle{font:normal 23px Georgia,serif;margin:0}#closeLighting{width:28px;height:28px;border:0;border-radius:50%;background:none;box-shadow:none;backdrop-filter:none}#closeLighting svg{width:20px;height:20px}
.lighting-toggle{display:flex;justify-content:space-between;align-items:center;min-height:38px;gap:14px;cursor:pointer}.lighting-toggle input{appearance:none;width:34px;height:20px;border:1px solid #c5ceaa70;border-radius:12px;background:#10291b;margin:0;position:relative;cursor:pointer;flex-shrink:0}.lighting-toggle input:before{content:'';position:absolute;left:3px;top:3px;width:12px;height:12px;border-radius:50%;background:#bfccad;transition:transform .12s}.lighting-toggle input:checked{background:#d3bc80;border-color:#d3bc80}.lighting-toggle input:checked:before{background:#243e31;transform:translateX(14px)}
.lighting-slider{display:block;margin-top:15px}.lighting-slider>span{display:flex;justify-content:space-between;gap:12px}.lighting-slider output{color:#d8c799;font-variant-numeric:tabular-nums}.lighting-slider input{display:block;width:100%;margin:9px 0 0;accent-color:#d3bc80;height:19px;cursor:pointer;touch-action:none}.lighting-toggle input:focus-visible,.lighting-slider input:focus-visible{outline:2px solid #fff2c7;outline-offset:4px}
#lightingMenu footer{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:17px;font-size:10px;color:#aebfa3}#resetLighting{border:0;background:none;box-shadow:none;backdrop-filter:none;padding:4px 0;font:12px system-ui,sans-serif;color:#dfd2b4;text-decoration:underline;text-underline-offset:3px}
@media(max-width:600px){#lightingButton{right:calc(max(19px,env(safe-area-inset-right)) + 58px);top:max(19px,env(safe-area-inset-top));width:48px;height:48px}#lightingMenu{right:max(16px,env(safe-area-inset-right));top:77px;max-height:calc(100dvh - 93px)}}
@media(prefers-reduced-motion:reduce){.lighting-toggle input:before{transition:none}}
@media(max-height:500px){#lightingMenu{padding:13px 16px 12px}#lightingMenu header{margin-bottom:6px}.lighting-toggle{min-height:32px}.lighting-slider{margin-top:10px}#lightingMenu footer{margin-top:12px}}
.lighting-toggle small{display:block;color:#b8c6ad;font-size:10px;line-height:1.2}.lighting-ranges{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px}.lighting-ranges .lighting-slider>span{gap:4px;font-size:12px}.lighting-slider input:disabled{opacity:.4;cursor:default}

#horseControls{position:fixed;right:max(24px,env(safe-area-inset-right));bottom:146px;display:flex;flex-direction:column;align-items:flex-end;gap:10px;z-index:2}#horseControls button{min-width:124px;min-height:44px;padding:10px 16px;border-radius:24px;font:13px system-ui,sans-serif}#horseControls button:disabled{opacity:.55;cursor:default}#horseControls [hidden],#groomProgress[hidden]{display:none}body.map-open #horseControls,body.map-open #groomProgress{display:none}#careNotice,#groomProgress{position:fixed;left:50%;transform:translateX(-50%);bottom:max(36px,env(safe-area-inset-bottom));max-width:calc(100vw - 380px);z-index:3;padding:10px 18px;border-radius:20px;background:#243e31e8;color:#fff5d7;font:13px/1.5 system-ui,sans-serif;text-align:center;pointer-events:none}#careNotice:empty{display:none}#groomProgress{bottom:86px;min-width:200px}#groomProgress progress{display:block;width:100%;height:5px;margin-top:8px;accent-color:#dcc795}@media(max-width:600px){#horseControls{right:20px;bottom:128px}#horseControls button{min-width:112px;padding:9px 12px;font-size:12px}#careNotice,#groomProgress{bottom:16px;max-width:calc(100vw - 32px);font-size:12px}#groomProgress{bottom:60px}}@media(max-height:500px){#horseControls{bottom:138px;gap:6px}#horseControls button{min-height:38px;padding:8px 12px}#groomProgress{bottom:48px}}
.apple-inventory{margin-top:18px;padding:12px 14px;border:1px solid #c5ceaa32;border-radius:13px;background:#4c67463b;color:#f0dfbc}.apple-inventory strong{font-size:16px;font-weight:normal}#appleCount{float:right;font-variant-numeric:tabular-nums}.apple-inventory p{margin:5px 0 0;color:#c5cfba;font:12px/1.45 system-ui,sans-serif}
#trailSign {
  position: fixed;
  z-index: 3;
  top: max(15px, env(safe-area-inset-top));
  left: 50%;
  transform: translate(-50%, 28px) scale(.94);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s, transform .35s, visibility .28s;
  pointer-events: none;
  width: min(330px, calc(100vw - 120px));
  display: grid;
  gap: 4px;
}
#trailSign.is-visible { transform: translate(-50%, 0) scale(1); opacity: 1; visibility: visible; }
#trailSign > div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 14px;
  color: #281b13;
  background: linear-gradient(#fff0c675, #bda17d49), var(--sign-wood) center / 100% auto, #d1ad79;
  border: 1px solid #6c4d36;
  border-radius: 5px 8px 5px 6px;
  box-shadow: inset 0 1px #f5d8a9, 0 2px 5px #24181280;
  font: bold clamp(15px, 3vw, 22px)/1.1 Georgia, serif;
}
.trail-arrow { display: inline-grid; place-items: center; flex: 0 0 1.2em; font: bold 1.35em/1 system-ui; }
#mapParty { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.map-party-member {
  position: absolute;
  transform: translate(-50%, -86%);
  display: grid;
  justify-items: center;
  color: #fff7dc;
  font: bold 11px/1 system-ui, sans-serif;
}
.map-party-member[hidden] { display: none; }
.map-party-member img { width: 65px; height: 65px; object-fit: contain; }
.map-party-member:not(:first-child) img { width: 49px; height: 49px; }
.map-party-member span {
  margin-top: -5px;
  padding: 4px 7px;
  border: 1px solid #d2b67c;
  border-radius: 10px;
  background: #26372c;
}
#cairnDialog {
  width: min(440px, calc(100vw - 40px));
  box-sizing: border-box;
  border: 1px solid #927e58;
  border-radius: 14px;
  padding: 20px;
  color: #372c20;
  background: #faf1db;
  box-shadow: 0 14px 60px #191a1490;
  font: 15px/1.5 system-ui, sans-serif;
}
#cairnDialog::backdrop { background: #161d18a0; }
#cairnDialog h2 { margin: 0 0 12px; font: bold 25px/1.2 Georgia, serif; }
#cairnDialog textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 100px;
  margin-top: 5px;
  padding: 9px;
  border: 1px solid #a38f6d;
  border-radius: 7px;
  background: #fffcf1;
  color: inherit;
  resize: vertical;
  font: 16px/1.5 system-ui, sans-serif;
}
#cairnDialog textarea[readonly] { background: #efe3c9; }
#cairnStatus { min-height: 1.5em; margin: 8px 0; }
.cairn-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.cairn-actions button { position: static; padding: 9px 13px; border-radius: 8px; min-height: 42px; }
.cairn-actions button[hidden] { display: none; }
