/* v1.7 — mobile-first game scene and touch ergonomics. No save-format changes. */
:root{--domiki-deep:#225b49;--domiki-paper:#f9f7ed;--domiki-gold:#edc270}
button{touch-action:manipulation}button:focus-visible,[role="button"]:focus-visible{outline:3px solid #d59c51;outline-offset:3px}
.project-choice{transition:transform .15s,border-color .15s,box-shadow .15s}.project-choice:active{transform:scale(.98)}
.project-choice.need-2{background:linear-gradient(135deg,#dbf1dc,#f0f5db);border-color:#368e68;box-shadow:inset 0 0 0 1px #65ad80}.project-choice.need-1{background:linear-gradient(135deg,#fff0bb,#fff8e5);border-color:#d5a654}.project-choice.need-0{background:#f5f4ec;border-color:#d7dfcf}
.project-choice strong{font-size:15px}.project-choice .project-reason{background:#fff9e7;border-radius:7px;padding:5px 7px;color:#376e5c}.project-choice .project-priority{font-size:11px;letter-spacing:.02em}
#projectDialog{box-shadow:0 24px 80px #0b302b33}#projectDialog::backdrop{background:#1e3c3d9e}
#goalsHub .goal-group summary{list-style:none;position:relative;padding:15px 50px 15px 16px;font-size:16px;display:flex;align-items:center;gap:8px;background:#edf2e8}
#goalsHub .goal-group summary::-webkit-details-marker{display:none}#goalsHub .goal-group summary::after{content:'⌄';position:absolute;right:18px;font-size:23px;color:#548c73;transition:transform .2s}
#goalsHub .goal-group[open] summary::after{transform:rotate(180deg)}#goalsHub .goal-group summary .group-dot{background:#d65a4c;color:white;padding:1px 7px;border-radius:99px;font-size:12px}
#goalsHub .goal-group-content{padding:10px}.goal-group-content p{line-height:1.45}
#goalsHub .goal-group .craft-quest-row{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:65px;padding:8px}
#goalsHub .goal-group .craft-quest-row button{max-width:145px;flex-shrink:0;min-height:43px;font-size:12px}
#goalsHub .goal-group .craft-quests>.craft-quest-title{margin-bottom:10px}
#compactHud .hud-chip{display:inline-flex;align-items:center;justify-content:center;gap:4px}
#compactHud .hud-chip b{font-variant-numeric:tabular-nums}#compactHud .hud-chip small{display:none}
body.domiki-map-active .city .map-world .plot.locked{background:rgba(62,75,74,.18)!important;border:2px dashed #60756f!important;box-shadow:inset 0 0 0 3px #e7ead4a8!important}
body.domiki-map-active .city .map-world .plot.locked .empty-lot{filter:grayscale(.2);opacity:1!important}
body.domiki-map-active .city .map-world .plot.locked .empty-lot>span{display:flex;align-items:center;justify-content:center;background:#354b44de;color:#fff6d8;border:1px solid #e7c681;min-width:29px;min-height:29px;border-radius:8px;font-size:19px;box-shadow:0 2px 10px #2d423a69}
body.domiki-map-active .city .map-world .plot.locked .plot-type{background:#354d45!important;color:#fff8e6!important;border:1px solid #e4c37b!important}
body.domiki-map-active .city .map-world .plot.locked .plot-name{color:#344f46!important}
/* Gold contour and lit windows remain visible throughout night (day-night.js drives --window-opacity). */
.city .map .map-world .plot.occupied svg{filter:drop-shadow(0 0 calc(var(--window-opacity,0)*8px) rgba(255,202,112,.98)) drop-shadow(calc(var(--window-opacity,0)*1px) 0 0 rgba(255,224,147,.9)) drop-shadow(calc(var(--window-opacity,0)*-1px) 0 0 rgba(255,224,147,.9))!important}
.city .map .map-world .plot.occupied{box-shadow:0 0 calc(var(--window-opacity,0)*17px) rgba(255,200,104,.79),0 2px 0 #a9bca5!important}
@media(max-width:700px){
 html,body{width:100%;height:100%;overflow:hidden!important}body{--hud-height:107px;--nav-height:66px;margin:0!important}
 body[data-mobile-tab="city"] .app,body[data-mobile-tab="build"] .app{display:block!important}
 #compactHud{height:calc(var(--hud-height) + env(safe-area-inset-top));padding:calc(4px + env(safe-area-inset-top)) 7px 6px;display:flex;flex-direction:column;justify-content:space-between}
 #compactHud .hud-world{height:36px;min-height:36px;gap:6px}
 #compactHud .hud-world #hudWorld{flex:1;min-width:0;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;background:#e4efde;border-radius:10px;padding:0 9px}
 #compactHud .hud-world #cloudOpen{flex:0 0 42px;min-width:42px;height:37px}
 #compactHud #hudValues{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;flex-wrap:nowrap;padding:2px 0 0}
 #compactHud #hudValues .hud-chip{min-width:0;display:flex;flex-direction:column;gap:0;border-radius:9px;padding:3px 1px 2px;line-height:1.15;white-space:nowrap}
 #compactHud #hudValues .hud-chip i{font-size:13px}#compactHud #hudValues .hud-chip b{font-size:13px;letter-spacing:-.35px;font-weight:900;max-width:100%;overflow:hidden}
 html[data-world="craft"] body{--hud-height:134px}
 html[data-world="craft"] #compactHud #hudValues{grid-template-columns:repeat(8,minmax(0,1fr))}
 html[data-world="craft"] #compactHud #hudValues .hud-chip b{font-size:11px}
 .game-mobile-nav{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:3px!important;background:#fcfaf1eb!important;box-shadow:0 -4px 18px #273e3421!important}
 .game-mobile-nav button{border-radius:12px!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:0!important;font-size:11px!important;font-weight:800!important}
 .game-mobile-nav button .nav-icon{font-size:21px!important}
 .game-mobile-nav button[data-mobile-go="build"]{display:none!important}
 body[data-mobile-tab="city"] .city.card{position:fixed!important;inset:calc(var(--hud-height) + env(safe-area-inset-top)) 0 calc(var(--nav-height) + env(safe-area-inset-bottom))!important;display:flex!important;flex-direction:column!important;gap:0!important;width:100vw!important;max-width:100vw!important;max-height:none!important;min-height:0!important;overflow:hidden!important;margin:0!important;padding:0!important;box-shadow:none!important;border:none!important;border-radius:0!important}
 body[data-mobile-tab="city"] .city.card>.map{flex:1 1 0!important;min-height:0!important;max-height:none!important;border-radius:0!important;margin:0!important;width:100%!important;overflow:hidden!important;touch-action:none!important}
 body[data-mobile-tab="city"] .city.card>.map-tools{flex:0 0 51px!important;order:1;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:5px!important;overflow-x:auto!important;padding:3px 6px!important;scrollbar-width:none}
 .city .map-tools #zoomOut,.city .map-tools #zoomIn{flex:0 0 44px!important;min-width:44px!important;width:44px!important;font-size:21px!important;font-weight:900}
 .city .map-tools #mapCenter{flex:1 1 70px!important;font-size:12px!important;min-width:55px!important}
 .city .map-tools .guide-v14-help{flex:0 0 42px!important;min-width:42px!important}
 .city .map-tools #towerShortcut,.city .map-tools #worldChallenge{flex:0 1 auto!important;white-space:nowrap!important;max-width:155px!important;min-width:85px!important;overflow:hidden!important;text-overflow:ellipsis!important;font-size:11px!important}
 body[data-mobile-tab="build"] #builder{position:fixed!important;inset:calc(var(--hud-height) + env(safe-area-inset-top)) 0 calc(var(--nav-height) + env(safe-area-inset-bottom))!important;height:auto!important;max-height:none!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;background:#fcf8ee!important;padding:0!important}
 body[data-mobile-tab="build"] #builder .panel-heading{min-height:47px;flex:0 0 auto;padding:5px 12px!important}
 body[data-mobile-tab="build"] #builder .panel-heading h2{font-size:17px!important}
 body[data-mobile-tab="build"] #builder .scene{flex:1 1 0!important;min-height:0!important;height:auto!important;max-height:none!important;width:100%!important;border-radius:0!important;overflow:hidden!important}
 body[data-mobile-tab="build"] #builder .scene canvas{width:100%!important;height:100%!important;object-fit:fill!important}
 body[data-mobile-tab="build"] #builder .controls{flex:0 0 auto!important;padding:7px 9px 10px!important;display:grid!important;grid-template-columns:1.4fr 1fr;gap:6px}
 body[data-mobile-tab="build"] #builder .controls button{min-height:53px!important;font-size:14px!important}
 body[data-mobile-tab="build"] #builder .controls .cancel-construction{grid-column:1/-1}
 body[data-mobile-tab="build"] #builder .swing-option,body[data-mobile-tab="build"] #builder .build-meta{display:none!important}
 body[data-mobile-tab="goals"] #goalsHub{position:fixed;inset:calc(var(--hud-height) + env(safe-area-inset-top)) 0 calc(var(--nav-height) + env(safe-area-inset-bottom));padding:9px 12px 16px;overflow:auto;overscroll-behavior:contain}
 #goalsHub h2{font-size:23px}#goalsHub header p{font-size:13px}#goalsHub .goal-group{margin:8px 0}
 #projectDialog{width:100vw!important;max-width:none!important;height:auto;max-height:calc(100dvh - env(safe-area-inset-top) - 12px)!important;margin:auto 0 0!important;border-radius:22px 22px 0 0!important;padding:14px 12px calc(16px + env(safe-area-inset-bottom))!important;overflow:auto!important}
 #projectChoices{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.project-choice{padding:9px;border-radius:14px}.project-art{height:88px}
 .building-quick-menu{z-index:360!important}
 html[data-world="craft"] dialog.craft-dialog[data-state="building"][open]{height:100dvh!important;max-height:none!important}
 html[data-world="craft"] .craft-dialog[data-state="building"] .craft-view{min-height:0!important;flex:1 1 0!important}
 html[data-world="craft"] .craft-dialog[data-state="building"] #craftScene{flex:1 1 0!important;height:0!important;min-height:0!important;width:100%!important}
}
/* Specificity bridge for old mobile-game!important selectors in style.css (v0.9.x). */
@media(max-width:700px){
 html body.mobile-game[data-mobile-tab="city"] section.city.card{display:flex!important;flex-direction:column!important;justify-content:stretch!important;align-items:stretch!important;margin:0!important;padding:0!important;max-height:none!important;overflow:hidden!important}
 html body.mobile-game[data-mobile-tab="city"] section.city.card>div.map{display:block!important;flex:1 1 0px!important;min-height:0!important;height:0!important;max-height:none!important;margin:0!important;padding:0!important;width:100%!important;border-radius:0!important;overflow:hidden!important}
 html body.mobile-game[data-mobile-tab="city"] section.city.card>div.map-tools{display:flex!important;grid-template-columns:none!important;flex:0 0 51px!important;min-height:51px!important;max-height:51px!important;flex-wrap:nowrap!important;margin:0!important;padding:3px 6px!important;overflow-x:auto!important}
 html body.mobile-game[data-mobile-tab="city"] section.city.card>.map-tools #zoomOut,html body.mobile-game[data-mobile-tab="city"] section.city.card>.map-tools #zoomIn{display:inline-flex!important;grid-column:auto!important;grid-row:auto!important}
 html body.mobile-game[data-mobile-tab="city"] section.city.card>.map-tools #mapCenter{display:inline-flex!important;grid-column:auto!important;grid-row:auto!important}
 html body.mobile-game[data-mobile-tab="city"] section.city.card>.map-tools #mapMoreTools{display:none!important}
 html body.mobile-game[data-mobile-tab="city"] section.city.card>.map-tools #towerShortcut{display:inline-flex!important;grid-column:auto!important;grid-row:auto!important}
 html body.mobile-game[data-mobile-tab="city"] section.city.card>.map-tools .guide-v14-help{display:inline-flex!important;grid-column:auto!important;grid-row:auto!important}
 html body.mobile-game[data-mobile-tab="goals"] #goalsHub{display:block!important}
}
@media(max-width:700px){
 html body.mobile-game[data-mobile-tab="build"] #builder{position:fixed!important;inset:calc(var(--hud-height) + env(safe-area-inset-top)) 0 calc(var(--nav-height) + env(safe-area-inset-bottom)) 0!important;top:calc(var(--hud-height) + env(safe-area-inset-top))!important;bottom:calc(var(--nav-height) + env(safe-area-inset-bottom))!important;left:0!important;right:0!important;width:100vw!important;height:auto!important;min-height:0!important;max-height:none!important;display:flex!important;flex-direction:column!important;z-index:150!important;margin:0!important;padding:0!important;overflow:hidden!important}
 html body.mobile-game[data-mobile-tab="build"] #builder .scene{flex:1 1 0px!important;min-height:0!important;height:0!important;max-height:none!important;margin:0!important;overflow:hidden!important}
 html body.mobile-game[data-mobile-tab="build"] #builder .controls{flex:0 0 auto!important;padding:6px 8px 9px!important;margin:0!important;max-height:145px!important}
 html body.mobile-game[data-mobile-tab="build"] #compactHud{z-index:400!important}
 html body.mobile-game[data-mobile-tab="build"] .game-mobile-nav{z-index:401!important}
}
/* Final full-height construction override: keep HUD and bottom navigation visible. */
@media(max-width:700px){
 html body.mobile-game[data-mobile-tab="build"] #builder.is-active{
  position:fixed!important;
  inset:calc(var(--hud-height) + env(safe-area-inset-top)) 0 calc(var(--nav-height) + env(safe-area-inset-bottom)) 0!important;
  top:calc(var(--hud-height) + env(safe-area-inset-top))!important;
  bottom:calc(var(--nav-height) + env(safe-area-inset-bottom))!important;
  max-height:none!important;min-height:0!important;height:auto!important;
  z-index:150!important;overflow:hidden!important;
 }
 html body.mobile-game[data-mobile-tab="build"] #builder.is-active .scene{
  flex:1 1 0px!important;min-height:0!important;height:0!important;max-height:none!important;
 }
 html body.mobile-game[data-mobile-tab="build"] #builder.is-active .controls{flex:0 0 auto!important;max-height:155px!important}
}
