:root{font-family:"Segoe UI",Arial,sans-serif;color:#35483d;background:#e7dcc5;font-synthesis:none}*{box-sizing:border-box}body{margin:0;overflow:hidden}button,a{font:inherit;-webkit-tap-highlight-color:transparent}button{cursor:pointer;border:1px solid #9c8c66;border-radius:5px;background:#f2e7cb;color:#354b3a;padding:9px 14px;font-weight:650;min-height:40px}button:disabled{cursor:default;background:#e3ddcd;color:#6f7367;border-color:#bfb69f}button:focus-visible,a:focus-visible{outline:3px solid #98743c;outline-offset:2px}[hidden]{display:none!important}.cave-map{height:100dvh;display:grid;grid-template-rows:auto minmax(0,1fr) auto;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}.cave-header{display:flex;align-items:center;gap:12px;padding:8px 16px;background:#263f36;color:#f4e8c7;border-bottom:2px solid #a8976d;z-index:5}.back{text-decoration:none;color:#f7e9bf;border:1px solid #8a987a;border-radius:4px;padding:10px;font-size:12px;white-space:nowrap}.cave-heading{margin-right:auto}.cave-heading small{font-size:9px;letter-spacing:1.3px;color:#c3ceb8}.cave-heading h1{font:700 24px "Times New Roman",serif;margin:2px 0}.cave-header button{min-width:40px;padding:7px;background:#375448;color:#f2e5bc;border-color:#72856c}.cave-wallet{display:flex;gap:16px;font-size:11px}.cave-wallet span{display:flex;flex-direction:column;gap:3px}.cave-wallet b{font-size:16px;color:#ffedbf;font-variant-numeric:tabular-nums}
#cave-viewport{position:relative;overflow:hidden;touch-action:none;outline:none;background:#ded2b7;isolation:isolate}#cave-world{position:absolute;left:0;top:0;width:1280px;height:800px;transform-origin:0 0;background:#d9cfb8 url('assets/dong-phu-thuy-mac-v1/nen-san.png') center/cover;will-change:transform}#cave-scenery img{position:absolute;pointer-events:none;user-select:none;object-fit:contain}#cave-scenery .bamboo-left{left:-15px;top:10px;width:200px;height:320px;z-index:300}#cave-scenery .bamboo-top{right:30px;top:-65px;width:210px;height:370px;z-index:100}#cave-scenery .bamboo-front{left:-55px;bottom:-40px;width:180px;height:310px;z-index:850;transform:scaleX(-1)}#cave-scenery .stone-front{right:10px;bottom:15px;width:420px;height:140px;z-index:780}#cave-scenery .stone-back{left:430px;top:65px;width:330px;height:110px;z-index:140}
.world-object{position:absolute;padding:0;background:transparent;border:0;box-shadow:none;touch-action:manipulation}.world-object img{width:100%;height:100%;object-fit:contain;pointer-events:none}.world-object span{position:absolute;bottom:0;left:50%;transform:translateX(-50%);white-space:nowrap;color:#fff2c8;background:#354f41ed;border:1px solid #c9b582;border-radius:3px;padding:5px 9px;font-size:13px;pointer-events:none}#cave-home{left:55px;top:15px;width:410px;height:285px;z-index:265}#cave-spring{left:950px;top:145px;width:225px;height:165px;z-index:300}
.map-plot{position:absolute;width:240px;height:150px;transform:translate(-50%,-50%);pointer-events:none}.plot-earth{position:absolute;inset:0;width:100%;height:100%;object-fit:fill;pointer-events:none}.map-plot.locked .plot-earth{opacity:.32;filter:grayscale(.7)}.map-plot.selected .plot-earth{filter:drop-shadow(0 0 3px #ffedac) drop-shadow(0 0 4px #6e6d44);opacity:1}.map-plot.selected.locked .plot-earth{opacity:.7}.plot-crop{position:absolute;left:76px;bottom:65px;width:88px;height:100px;object-fit:contain;object-position:center bottom;pointer-events:none}.plot-crop.young{width:70px;height:65px;left:85px}.plot-hit{position:absolute;inset:0;border:0;border-radius:0;padding:0;background:transparent;clip-path:polygon(50% 2%,100% 50%,50% 98%,0 50%);pointer-events:auto;touch-action:manipulation}.plot-hit:hover{background:#f7edbb33}.plot-label{position:absolute;left:50%;top:100px;transform:translateX(-50%);white-space:nowrap;background:#f9f0dce8;color:#4b513e;border:1px solid #a79a79;border-radius:4px;padding:4px 8px;font-size:12px;pointer-events:none;font-variant-numeric:tabular-nums}.map-plot.selected .plot-label{background:#35533f;color:#fff2cd}.map-plot.ripe:not(.selected) .plot-label{background:#e6d69d;color:#31563d}.map-plot.watered .plot-earth{filter:brightness(.84)}.map-plot.selected.watered .plot-earth{filter:brightness(.88) drop-shadow(0 0 4px #ead99e)}
#cave-hero{position:absolute;width:115px;height:134px;transform:translate(-50%,-100%);pointer-events:none;--face:1}#cave-hero-visual{width:100%;height:100%;position:relative;transform:scaleX(var(--face));transform-origin:center bottom}#cave-hero-art{width:100%;height:100%;object-fit:contain;object-position:center bottom;position:relative;z-index:1}#cave-hero-name{position:absolute;bottom:139px;left:50%;transform:translateX(-50%);white-space:nowrap;font-size:12px;font-weight:700;color:#fff3d0;text-shadow:1px 1px 2px #24362d,-1px -1px 2px #24362d}.hero-shadow{position:absolute;bottom:-3px;left:30%;width:40%;height:10px;background:#3f423448;filter:blur(3px);border-radius:50%;z-index:-1}#cave-hero[data-pose="sow"],#cave-hero[data-pose="harvest"]{width:150px;height:115px}#cave-hero[data-pose="fill"],#cave-hero[data-pose="water"]{width:150px;height:134px}#cave-hero[data-pose="sow"] #cave-hero-visual,#cave-hero[data-pose="harvest"] #cave-hero-visual,#cave-hero[data-pose="fill"] #cave-hero-visual,#cave-hero[data-pose="water"] #cave-hero-visual{animation:working .7s ease-in-out infinite alternate}#cave-hero.walking-carry #cave-hero-art{animation:carry-step .3s ease-in-out infinite alternate}#cave-hero-run{position:absolute;inset:0;width:134px;height:134px;left:-10px}#cave-hero-run canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}#cave-hero-run canvas[hidden]{display:none!important}@keyframes working{to{translate:1px 3px;rotate:1deg}}@keyframes carry-step{to{translate:0 -3px;rotate:.8deg}}#cave-destination{position:absolute;width:26px;height:14px;border:2px solid #667f56;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none;z-index:800}
#cave-toast{position:absolute;left:50%;top:16px;transform:translateX(-50%);max-width:min(92%,560px);background:#fff4dbf5;color:#3d503c;border:1px solid #b49a69;border-radius:5px;padding:10px 17px;font-size:13px;line-height:1.5;z-index:1100;pointer-events:none;text-align:center;box-shadow:0 4px 15px #40392722}#cave-toast:empty{display:none}.cave-controls{position:absolute;left:18px;bottom:16px;display:flex;align-items:flex-end;gap:8px;z-index:1000;touch-action:none}#cave-stick{width:84px;height:84px;position:relative;border:2px solid #f1e7c2aa;border-radius:50%;background:#36594355;box-shadow:0 0 0 1px #5b72574d;touch-action:none}#cave-stick i{position:absolute;left:24px;top:24px;width:32px;height:32px;border-radius:50%;border:1px solid #e7e4c3;background:#59765fab;pointer-events:none}#cave-stick span{position:absolute;top:8px;left:0;right:0;text-align:center;font-size:8px;letter-spacing:.4px;color:#f6efd6;pointer-events:none}.cave-dpad{display:grid;grid-template-columns:repeat(3,32px);gap:2px}.cave-dpad button{padding:0;min-height:30px;font-size:17px;background:#ede6cfb5;border-color:#87927599}.cave-dpad button:first-child{grid-column:2}.cave-dpad button:nth-child(2){grid-column:1;grid-row:2}.cave-dpad button:nth-child(3){grid-column:2;grid-row:2}.cave-dpad button:nth-child(4){grid-column:3;grid-row:2}.cave-controls-note{position:absolute;bottom:10px;right:14px;color:#495a43;font-size:11px;background:#eee4cba8;padding:4px 8px;border-radius:3px}
.cave-footer{background:#eee5ce;border-top:2px solid #a6936a;padding:9px 18px 12px;z-index:5;display:flex;gap:22px;align-items:center}.cave-waypoints{display:flex;gap:6px;align-items:center}.cave-waypoints button{position:relative;font-size:12px;min-height:45px;white-space:nowrap;padding:7px 10px}.cave-waypoints b{font-size:10px;display:block;font-weight:500;margin-top:3px}.cave-waypoints img{width:22px;height:25px;object-fit:contain;vertical-align:middle;margin-right:4px}#cave-interaction{flex:1;display:flex;justify-content:space-between;align-items:center;gap:14px;min-height:84px;border-left:1px solid #b9aa83;padding-left:18px}#interaction-kicker{font-size:9px;letter-spacing:1px;color:#6d654c}#interaction-title{font-size:18px;color:#34513e;margin:4px 0}#interaction-info{font-size:12px;line-height:1.5;margin:0;color:#59604b;max-width:530px}#interaction-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}#interaction-actions button{font-size:12px;min-width:110px;background:#355d45;color:#fff0c8;border-color:#4f7351}#interaction-actions button:disabled{background:#d8d7c6;color:#65715c;border-color:#b5bba2}#interaction-actions .secondary{background:#ece1c5;color:#3d523d;border-color:#ab9b72}#cave-guide{max-width:430px;width:calc(100% - 24px);border:1px solid #a18d62;border-radius:8px;color:#354c3b;background:#f5edda;padding:24px}#cave-guide::backdrop{background:#122d25a8}#cave-guide h2{font-size:21px}#cave-guide p{font-size:14px;line-height:1.6}#cave-guide button{width:100%}
@media(max-width:850px){.cave-header{padding:7px 8px;gap:7px}.cave-heading small{display:none}.cave-heading h1{font-size:20px}.cave-wallet{gap:8px;font-size:9px}.cave-wallet b{font-size:13px}.back{font-size:11px;padding:8px}.cave-header button{padding:4px;min-width:34px;min-height:34px}.cave-footer{display:block;padding:7px 10px}.cave-waypoints{justify-content:center;margin-bottom:6px}.cave-waypoints button{flex:1;font-size:11px;min-height:36px;padding:5px}.cave-waypoints b{display:inline;margin-left:3px}.cave-waypoints img{width:18px;height:20px}#cave-interaction{border-left:0;border-top:1px solid #c3b696;padding:7px 0 0;min-height:88px;gap:8px}#interaction-title{font-size:15px;margin:3px 0}#interaction-info{font-size:11px}#interaction-actions{max-width:45%;flex-shrink:0}#interaction-actions button{font-size:11px;min-width:92px;padding:8px}.cave-controls-note{display:none}.cave-controls{left:10px;bottom:10px}.cave-dpad{display:none}}
@media(max-width:450px){.cave-header{flex-wrap:wrap}.cave-wallet{order:5;width:100%;flex-direction:row;justify-content:space-around;border-top:1px solid #62745c;padding-top:5px}.cave-wallet span{flex-direction:row;align-items:baseline;gap:5px}.cave-heading{margin-right:auto}#interaction-actions{max-width:42%}#interaction-info{max-height:56px;overflow:auto}.cave-footer{padding-bottom:8px}.cave-waypoints button{font-size:10px}}
@media(orientation:landscape) and (max-height:500px){.cave-header{padding:4px 8px}.cave-heading h1{font-size:17px}.cave-header button{min-height:30px}.cave-footer{display:flex;gap:10px;padding:5px 10px}.cave-waypoints{max-width:210px;margin:0}.cave-waypoints button{white-space:normal;font-size:9px;min-width:60px}#cave-interaction{border-top:0;border-left:1px solid #b9aa83;padding:0 0 0 10px;min-height:65px}#interaction-title{font-size:14px}#interaction-info{font-size:10px}#interaction-actions{max-width:48%}#interaction-actions button{padding:7px;min-height:36px}.cave-controls{bottom:7px}#cave-stick{width:65px;height:65px}#cave-stick i{left:15px;top:15px}.cave-wallet{gap:10px}}
@media(prefers-reduced-motion:reduce){#cave-hero *{animation:none!important}}

#house-upgrade-dialog>form{position:sticky;top:0;height:0;z-index:3}#house-upgrade-dialog .house-close{right:-10px;top:-10px;background:#f8efd8;border:1px solid #d6c6a0;border-radius:50%}

.house-material small{display:block;margin-top:3px;color:#4e6249}.house-material.missing small,.house-requirement.missing{color:#913b27}.house-requirement{padding:9px 10px;margin:8px 0;background:#fffaf0;border:1px solid #c7bd9e;border-radius:4px;font-size:13px;line-height:1.5;color:#344e38}.house-roadmap{margin-top:16px;border-top:1px solid #c7b997;padding-top:12px}.house-roadmap summary{font-weight:700;font-size:14px;cursor:pointer;min-height:34px}.house-roadmap p{font-size:12px;line-height:1.5;color:#60553f}.house-roadmap ol{padding:0;list-style:none;margin:8px 0}.house-roadmap li{padding:10px;border:1px solid #d5c8a9;background:#fffaf0;margin:6px 0;border-radius:4px}.house-roadmap li.current{border-color:#758b58;background:#e8edd8}.house-roadmap strong,.house-roadmap span,.house-roadmap small{display:block;line-height:1.5}.house-roadmap strong{font-size:13px}.house-roadmap span{font-size:12px;color:#61543d}.house-roadmap small{font-size:11px;color:#4f6548}

#house-upgrade-dialog{position:relative;width:min(480px,calc(100% - 24px));max-height:92dvh;overflow:auto;border:2px solid #ad8e58;border-radius:10px;padding:22px;background:#f8efd8;color:#384c38;box-shadow:0 15px 50px #0b261c80}#house-upgrade-dialog::backdrop{background:#132e267d}#house-upgrade-dialog h2{font:700 24px "Times New Roman",serif;margin:6px 28px 0 0}.house-close{position:absolute;right:8px;top:8px;padding:0;width:36px;min-height:36px;font-size:25px;background:transparent;border:0}.house-eyebrow{color:#79633d;letter-spacing:1px;font-size:10px}.house-preview{display:block;width:100%;height:210px;object-fit:contain;margin:8px 0}.house-benefit{padding:10px;background:#e2e9cc;border:1px solid #b4bf91;font-size:14px;font-weight:700;border-radius:5px}#house-materials{display:flex;gap:10px}.house-material{flex:1;display:flex;align-items:center;gap:8px;padding:8px;background:#fffaf0;border:1px solid #b4b696;border-radius:5px;font-size:12px}.house-material img{width:52px;height:48px;object-fit:contain}.house-material strong{display:block;margin-top:4px;font-size:16px;color:#35583b}.house-material.missing strong{color:#9c3626}.house-source{font-size:12px;line-height:1.6;color:#635943}.house-progress strong{font-size:15px;color:#3f5335}.house-progress progress{display:block;width:100%;height:12px;margin:10px 0;accent-color:#507452}.house-progress p{font-size:12px;line-height:1.5}#house-upgrade-start{width:100%;background:#355d45;color:#fff4d6;border-color:#53744b}#house-upgrade-start:disabled{background:#ddd8c6;color:#6c6d5d;border-color:#b9b49f}@media(max-width:450px){#house-upgrade-dialog{padding:17px}.house-preview{height:170px}#house-upgrade-dialog h2{font-size:22px}.house-material{gap:5px}.house-material img{width:42px}}

.pet-roster{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));gap:12px;margin:14px 0}
.pet-species{display:flex;flex-direction:column;align-items:stretch;padding:12px;border:1px solid #ab8960;border-radius:10px;background:#fbefd6;color:#30281f}
.pet-species .pet-window{overflow:hidden;align-self:stretch;background:radial-gradient(ellipse,#fffbeb,#f3dfbd);border-radius:6px}
.pet-species img{width:100%;height:clamp(110px,16vw,180px);object-fit:contain}
#pet-dialog[open].pets-roaming [data-portrait]{animation:pet-walk-across 3.2s linear infinite}
#pet-dialog[open].pets-roaming [data-portrait="ho-son-quy"]{animation-duration:6.8s}
#pet-dialog[open].pets-roaming [data-portrait="kiem-ung"]{animation:pet-fly-around 3.8s ease-in-out infinite}
@keyframes pet-walk-across{
  0%,100%{transform:translateX(22%)}
  49.99%{transform:translateX(-22%)}
  50%{transform:translateX(-22%) scaleX(-1)}
  99.99%{transform:translateX(22%) scaleX(-1)}
}
@keyframes pet-fly-around{
  0%,100%{transform:translate(22%,0)}
  25%{transform:translate(0,-10%)}
  49.99%{transform:translate(-22%,0)}
  50%{transform:translate(-22%,0) scaleX(-1)}
  75%{transform:translate(0,8%) scaleX(-1)}
  99.99%{transform:translate(22%,0) scaleX(-1)}
}
.pet-species h3{margin:10px 0 4px;color:#243d37}
.pet-species p{margin:0 0 10px;line-height:1.45;color:#4e4130}
.pet-species button{margin-top:auto}
.pet-species button:disabled{opacity:1;background:#214c41;color:#fff3d6}
#cave-pets{left:840px;top:492px;width:150px;height:32px;z-index:525}
.garden-pet{position:absolute;left:0;top:0;width:108px;height:108px;padding:0;border:0;background:transparent;box-shadow:none;cursor:pointer;touch-action:manipulation;user-select:none;transform-origin:center}
.garden-pet[hidden]{display:none}
.garden-pet img{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none}
.garden-pet:focus-visible{outline:2px solid #174e44}
#pet-care .pet-shortfall{color:#77360f;font-weight:600}
#pet-dialog h2{margin:0 34px 8px 0}
#pet-dialog>p,#pet-care p{margin:6px 0;line-height:1.35}
#pet-care h3{margin:10px 0 4px}
#pet-notice:empty{display:none}
@media(max-width:600px){#pet-dialog .pet-species{display:grid;grid-template-columns:78px 1fr;gap:4px 10px}#pet-dialog .pet-species .pet-window{grid-row:span 3}#pet-dialog .pet-species img{height:78px}#pet-dialog .pet-species h3,#pet-dialog .pet-species p{margin:0}}
#pet-dialog{width:min(760px,calc(100% - 24px))}#pet-care button{margin-right:8px}#pet-notice{color:#245443}#pet-dialog a{color:#285745}
.cave-waypoints{flex-wrap:wrap}

#cave-companion{position:absolute;width:80px;height:76px;padding:0;border:0;background:transparent;box-shadow:none;touch-action:manipulation;user-select:none}
#cave-companion img{position:absolute;left:50%;bottom:0;width:96px;height:96px;transform:translateX(-50%);object-fit:contain;pointer-events:none}
#pet-visit-garden{display:block;margin-top:10px}
.pet-species .pet-window{display:block}.pet-species .pet-window img{display:block}

#pet-dialog [data-portrait]{display:block;width:min(68%,150px);aspect-ratio:1;margin:auto}
#pet-dialog [data-portrait] img{display:block;width:100%;height:100%;object-fit:contain}
#pet-care-preview{width:min(100%,260px);margin:8px auto;overflow:hidden;background:radial-gradient(ellipse,#fffbeb,#f3dfbd);border-radius:8px}
#pet-dialog img[data-stride]:not([data-stride=""]),#cave-world img[data-stride]:not([data-stride=""]){object-fit:cover}
#pet-dialog img[data-stride]:not([data-stride=""]),#cave-world img[data-stride="kiem-ung"]{animation:pet-stride var(--stride-time) step-end infinite}
#cave-world img:is([data-stride="ho-son-quy"],[data-stride="linh-ho"]){object-position:var(--foot-position,0%) center;translate:0 26%}
img[data-stride="linh-ho"]{--stride-time:460ms}
img[data-stride="kiem-ung"]{--stride-time:620ms}
img[data-stride="ho-son-quy"]{--stride-time:940ms}
@keyframes pet-stride{
  0%,100%{object-position:0% center}
  25%{object-position:33.333333% center}
  50%{object-position:66.666667% center}
  75%{object-position:100% center}
}
#interaction-actions select[data-crop]{max-width:100%;min-height:32px;border:1px solid #ab9b72;border-radius:6px;background:#f3ecd9;color:#334b36;font:inherit}
.forge-gate{position:absolute;z-index:751;transform:translate(-50%,-50%);width:92px;height:42px;background:transparent;border:0;padding:0;touch-action:manipulation}
.forge-gate i{display:block;width:100%;height:100%;border:3px solid #ffe8a6;border-radius:50%;box-shadow:0 0 13px #ffca71,inset 0 0 10px #ffcf80}
.forge-gate span{position:absolute;bottom:100%;left:50%;transform:translateX(-50%);white-space:nowrap;color:#fff2c9;background:#3a3026;border-radius:4px;padding:3px 7px}
#cave-smithy{position:absolute;left:783px;top:712px;transform:translate(-50%,-100%);width:190px;height:151px;background:none;border:0;box-shadow:none;padding:0;z-index:711}
#cave-smithy img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(2px 5px 3px #33271d50)}
