/* Phone play controls. Keep this after feature styles so all phone modes agree. */
@media(max-width:700px),(max-width:1400px) and (any-pointer:coarse){
 .camera-controls,.mobile-tools-collapsed .camera-controls{display:flex;inset:auto var(--ui-right) calc(var(--ui-bottom) + var(--dock-height) + 20px) auto;flex-direction:row;gap:6px;padding:4px;border:1px solid #b2dfce66;border-radius:17px;background:#113f47ed;z-index:29}
 .camera-controls button,.camera-controls #recenter{width:44px;height:44px;min-width:44px;min-height:44px;border-radius:12px;background:#d3f2da14}
 .shop-open .camera-controls{visibility:hidden;pointer-events:none}
 .placing :is(.toolbar,.left-actions,.island-quick){visibility:hidden;pointer-events:none}
 .placing .camera-controls{display:flex;inset:calc(var(--hud-bottom) + 4px) auto auto var(--ui-left);visibility:visible;pointer-events:auto}
 body:has(.selected-panel:not([hidden])) :is(.dhikr-dock,.camera-controls,#open-shop,.toolbar,.mobile-tools-toggle){visibility:hidden;pointer-events:none}
 .selected-panel{bottom:calc(var(--ui-bottom) + 8px);max-height:min(46%,calc(var(--screen-h) - var(--safe-top) - var(--safe-bottom) - 190px));padding:10px 12px;scroll-padding-bottom:72px}
 .selected-panel .selected-heading{position:sticky;top:-10px;z-index:2;background:#c9e8e4;margin:-2px -4px 4px;padding:2px 4px;border-radius:12px}
 .selected-panel .selected-image{width:64px;height:78px}.selected-panel .item-description{margin:4px 0;font-size:14px}
 .selected-panel .selected-actions{position:sticky;bottom:-10px;z-index:2;margin:8px -4px -2px;padding:8px 4px 2px;background:#c9e8e4;border-radius:12px}
 .selected-panel .selected-actions button{background:#ffffff70;border-radius:10px;border:1px solid #7eafa580}
 #placement-bar{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;padding:10px;min-width:0;max-height:calc(var(--screen-h) - var(--safe-top) - var(--safe-bottom) - 190px);overscroll-behavior:contain;scroll-padding:10px;isolation:isolate}
 #placement-bar[hidden]{display:none}
 #placement-bar>div:first-child{grid-column:1/-1;min-width:0;text-align:center}
 #placement-title{font:700 15px/1.5 Tahoma,sans-serif;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 #placement-hint{font:12px/1.5 Tahoma,sans-serif;margin:2px 0 0;color:#e0f2dc}
 #placement-bar .placement-nudges{display:grid;grid-column:1/-1;grid-template-columns:repeat(4,minmax(44px,1fr));gap:6px;direction:ltr}
 #placement-bar .placement-nudges button{width:100%;height:44px;min-height:44px;border-radius:11px;font:26px/1 Tahoma,sans-serif;background:#d7f7e01a;color:#efffe6;border:1px solid #93c9b899}
 #placement-bar .placement-option{grid-column:span 2;min-height:44px;padding:3px 6px;font:14px/1.4 Tahoma,sans-serif;background:#e1f6df10;border-radius:10px;white-space:normal}
 #placement-bar #rotate-place{grid-column:span 2;min-height:44px;margin:0;font:14px Tahoma,sans-serif;border:1px solid #93c9b899;border-radius:10px;background:#d7f7e01a;color:#efffe6}
 #placement-bar #confirm-place{grid-column:span 3;min-width:0;width:100%;min-height:48px;padding:6px 10px;flex-direction:row;justify-content:center;gap:6px;border:1px solid #e0f4b7;border-radius:12px;background:#d5eda7;color:#184d45}
 #placement-bar #confirm-place img{width:30px;height:28px}#placement-bar #confirm-place span{font:700 14px/1.5 Tahoma,sans-serif;white-space:normal}
 #placement-bar #confirm-place:disabled{opacity:.45}
 #placement-bar:has(#brush-option:not([hidden]) #decoration-brush:checked) :is(.placement-nudges,#rotate-place){display:none}
 #placement-bar #cancel-place{grid-column:span 1;width:100%;min-width:44px;height:48px;margin:0;padding:8px;border:1px solid #d8ebe0aa;border-radius:12px;background:#fff1e214}
 #placement-bar #cancel-place img{width:30px;height:30px;object-fit:contain}
 .shop .category-tabs{scroll-padding-inline:8px;scroll-snap-type:x proximity}
 .shop .category-tabs button{scroll-snap-align:center;flex-basis:64px;min-width:64px}
 .shop .shop-card button{justify-content:center;text-align:center}
 .shop .shop-card>img{cursor:pointer}
 .garden-detail-dialog .detail-build{width:100%;min-height:48px;background:#1d665f;border:1px solid #b9e7c9;bottom:-12px;padding:10px;white-space:normal}
 .garden-detail-dialog{scroll-padding-bottom:76px}
 .toolbar{scroll-padding:8px}
 .toolbar .tool:not(#open-shop)>span:not(.inventory-art){font-size:13px;line-height:18px}
 .editing-garden .camera-controls{inset:auto var(--ui-right) calc(var(--ui-bottom) + 8px) auto;visibility:visible;pointer-events:auto}
}
@media(max-width:700px) and (max-height:650px) and (orientation:landscape),(max-width:1400px) and (any-pointer:coarse) and (max-height:650px) and (orientation:landscape){
 .camera-controls,.mobile-tools-collapsed .camera-controls{inset:auto var(--ui-right) calc(var(--ui-bottom) + 10px) auto}
 .placing .camera-controls{inset:calc(var(--hud-bottom) + 4px) auto auto var(--ui-left)}
 .selected-panel{inset:calc(var(--hud-bottom) + 4px) var(--ui-right) calc(var(--ui-bottom) + 8px) auto;width:min(300px,42vw);max-height:none;max-width:none}
 .selected-panel .selected-content{gap:6px}.selected-panel .selected-image{width:48px;height:64px}.selected-panel .selected-actions{position:static;grid-template-columns:repeat(2,minmax(0,1fr));margin-top:6px}
 #placement-bar{inset:auto var(--ui-right) calc(var(--ui-bottom) + 6px) var(--ui-left);width:auto;max-width:none;max-height:calc(var(--screen-h) - var(--safe-top) - var(--safe-bottom) - 122px);grid-template-columns:repeat(4,44px) repeat(7,minmax(0,1fr)) 44px;direction:ltr;padding:8px;gap:6px}
 #placement-bar>div:first-child{grid-column:1/7;grid-row:1;display:block;direction:rtl;text-align:right}
 #placement-bar .placement-option{grid-column:span 3;grid-row:1;direction:rtl;padding:2px;font-size:13px}
 #placement-bar .placement-nudges{grid-column:1/5;grid-row:2;gap:4px;grid-template-columns:repeat(4,minmax(0,1fr))}
 #placement-bar #rotate-place{grid-column:5/7;grid-row:2;font-size:13px}
 #placement-bar #confirm-place{grid-column:7/12;grid-row:2;direction:rtl;min-height:44px}
 #placement-bar:has(#rotate-place[hidden]) #confirm-place{grid-column:5/12}
 #placement-bar:has(#brush-option:not([hidden]) #decoration-brush:checked) #confirm-place{grid-column:1/12}
 #placement-bar #cancel-place{grid-column:12;grid-row:2;min-width:0;height:44px;padding:6px}
 .shop .category-tabs{scroll-snap-type:y proximity}.shop .category-tabs button{min-width:0;flex-basis:52px}
 .editing-garden .camera-controls{inset:auto auto calc(var(--ui-bottom) + 8px) var(--ui-left)}
}
@media(max-height:350px) and (orientation:landscape) and (max-width:1400px){
 #placement-hint{display:none}#placement-bar>div:first-child{align-self:center}#placement-bar .placement-option{min-height:36px}
 .garden-guide{max-height:calc(var(--screen-h) - 190px)}
}
