/* Carved sandstone controls; parchment is reserved for readable content panels. */
:root{--carved-stone:url('/assets/ui/carved-stone-v37.avif');--stone-rim:clamp(6px,.85vw,13px)}
button{touch-action:manipulation;-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none}
#world{touch-action:none;user-select:none;-webkit-user-select:none}
#hud .profile,#hud .resource,#hud .clock,#hud .rail button,#bottom-nav button,#bottom-nav button.active,.gold-button,#owned-roster button{
 background:var(--carved-stone) center/100% 100% no-repeat!important;border:0;border-image:none;border-radius:0;box-shadow:none;filter:drop-shadow(0 3px 0 #5c391b) drop-shadow(0 7px 2px #241a0bb0)
}
#hud .profile{padding:calc(10*var(--u)) calc(25*var(--u)) calc(17*var(--u)) calc(10*var(--u));gap:calc(9*var(--u))}
#hud .profile .avatar{height:100%;width:auto;max-width:44%;border:clamp(3px,.5vw,8px) ridge #d8b775;box-shadow:0 3px 2px #38200c,inset 0 0 9px #2d170c}
#hud .profile .identity{width:54%}#hud .profile .identity b{color:#30200f;text-shadow:0 1px #e8be75}
#hud .resource{padding:calc(12*var(--u)) calc(11*var(--u)) calc(16*var(--u));grid-template-columns:58% 42%}
#hud .resource small{color:#fff0d1;font-weight:900;text-shadow:0 2px 1px #432c15;letter-spacing:.2px}
#hud .clock{padding:0 calc(17*var(--u));height:80%}
#hud .rail button{padding:calc(11*var(--u)) calc(6*var(--u)) calc(16*var(--u));gap:0;height:100%}
#hud .rail .stone-icon{width:100%;height:auto;aspect-ratio:1}
#hud .rail button>span:last-child{color:#fff2d8;text-shadow:0 2px 1px #36210e;font-weight:900}
/* The reference has five top controls and four bottom controls. Quests remain
   available through Missions, without adding a second row to the HUD. */
#hud .rail button[data-panel="quests"],#bottom-nav button[data-bottom="quests"]{display:none}
#bottom-nav button{padding:calc(8*var(--u)) calc(12*var(--u)) calc(15*var(--u))}
#bottom-nav button .stone-icon{height:70%}
#bottom-nav button>span:last-child{color:#fff2d6;text-shadow:0 2px 1px #3c2512}
.gold-button{padding:calc(12*var(--u)) calc(25*var(--u));color:#35220e;text-shadow:0 1px #ebc789}
#owned-roster button{padding:calc(10*var(--u)) calc(10*var(--u)) calc(14*var(--u));border-width:0}
#hud .clock button{border-radius:50%;border:3px ridge #c49b5c}
#hud .clock button.active{box-shadow:0 0 6px #ffe692,inset 0 1px 2px #f5f18c;border-color:#ffe09b}
#hud .clock button[data-speed="0"]{border:0}
#cave-entrance{position:absolute;z-index:2;display:flex;align-items:flex-end;justify-content:center;min-height:0;padding:0;background:transparent;border:0;box-shadow:none;border-radius:45% 45% 10% 10%;transform:none}
#cave-entrance>span{padding:3px 8px;margin-bottom:7px;border:1px solid #d8b97688;border-radius:12px;background:#4a3019b8;color:#ffeac0;font-size:clamp(10px,1vw,14px);text-shadow:0 1px 1px #2a1b0c}
#cave-entrance:focus-visible,#cave-door:focus-visible{outline:2px solid #f2d480;outline-offset:3px}
#cave-entrance:active,#cave-door:active{transform:none}
.map-open #cave-entrance,.cinematic #cave-entrance,.door-transition #cave-entrance{visibility:hidden}
#game[data-travel] #world,#game[data-travel] #cave-entrance,#game[data-travel] #cave-door{pointer-events:none}
@media(hover:none){button:hover{filter:inherit}#cave-door:hover{outline:none;box-shadow:none}#hud button:hover,#bottom-nav button:hover,.gold-button:hover{filter:drop-shadow(0 4px 2px #27190bc4)}}
@media(max-width:700px){:root{--stone-rim:5px}#hud .profile{padding-right:calc(20*var(--u))}#hud .resource{padding:calc(10*var(--u)) calc(8*var(--u)) calc(13*var(--u))}#hud .clock button{border-width:2px}}

#edit-furniture{position:absolute;right:var(--safe-right);bottom:calc(var(--footer-height) + var(--safe-bottom) + 12px);z-index:7;background:var(--carved-stone) center/100% 100%;padding:14px 23px;color:#382714;text-shadow:0 1px #fbe1ad;font-size:clamp(12px,1.2vw,18px)}
#edit-furniture[aria-pressed=true]{color:#25491c;filter:drop-shadow(0 0 6px #d2ff8a)}
#game[data-scene="house"] #village-life{bottom:calc(var(--footer-height) + var(--safe-bottom) + 66px);max-height:calc(100dvh - var(--hud-height) - var(--footer-height) - 130px)}
.placing-object #bottom-dock,.placing-object .gold-button,.placing-object #village-life,.placing-object #cave-door{visibility:hidden}
.placing-object #placement{bottom:calc(var(--safe-bottom) + 12px);width:min(680px,94vw);max-width:94vw;display:flex;flex-wrap:wrap;justify-content:center;gap:8px;padding:12px 16px;background:#e8ca96;border:3px ridge #aa8050;z-index:15}
#placement>span{flex:1 0 100%;text-align:center}#placement>button{min-height:40px;padding:6px 16px;border-radius:12px}
.map-open #edit-furniture,.cinematic #edit-furniture{visibility:hidden}

/* The fixed cave view keeps its own controls and a clear exit. */
#game[data-scene="house"] #resources,
#game[data-scene="house"] #clan,
#game[data-scene="house"] .shop-button,
#game[data-scene="house"] .missions-button,
#game[data-scene="house"] .rail [data-panel]:not([data-panel="settings"]),
#game[data-scene="house"] #bottom-nav [data-bottom="build"],
#game[data-scene="house"] #village-life [data-quick="explore"]{display:none!important}
#game[data-scene="house"] #hud .rail{width:clamp(44px,5vw,80px);justify-self:end;grid-template-columns:1fr}
#game[data-scene="house"] #village-life{font-size:clamp(11px,1vw,15px);line-height:1.4}
#game[data-scene="house"] #village-life .life-actions button,
#game[data-scene="house"] #village-life .life-more{font-size:inherit;line-height:1.4}
#game[data-scene="house"] #village-life .need-row output{font-size:clamp(10px,.9vw,13px)}
#game[data-scene="house"] #village-life h2{font-size:clamp(12px,1.2vw,18px);line-height:1.3}
