/* Keep Japanese action labels together; never let controls size the viewport. */
html,body{width:100%;height:100%;overscroll-behavior:none}button,.card,.count,.materialCard{min-width:0}button{line-height:1.4}p,label,.card{line-break:strict;overflow-wrap:anywhere}.controlIcon{display:block;font-style:normal;font-size:24px;line-height:1.1}#hotbar .controlLabel{display:block;white-space:nowrap;margin:4px 0 0;line-height:1.3}#hotbar kbd{display:block;line-height:1.2}.editorTitle{gap:5px}.editorTitle b{margin-right:auto}#editorSettings{padding:3px 6px!important}.materialCard b{line-height:1.5;overflow-wrap:anywhere}.materialCard small{display:block}.count{gap:10px}.count>*{min-width:0}dialog{max-height:calc(100dvh - 32px);overflow:auto}#materialPick>span:nth-child(2){min-width:0}#blockSwatch{flex-shrink:0}
.phoneControls input{font-size:16px}.phoneControls header{left:10px!important;right:10px!important;top:max(8px,env(safe-area-inset-top))!important}.phoneControls.playing .brand{display:none}.phoneControls #clock{font-size:10px;padding:8px 10px}.phoneControls header button{padding:8px 10px}.phoneControls #vitals{top:49px;left:10px;width:133px;padding:8px 10px;font-size:9px;border-radius:15px}.phoneControls #vitals b{font-size:10px;margin-bottom:5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.phoneControls #vitals div{gap:4px;margin:3px 0}.phoneControls meter{width:76px;height:10px}.phoneControls #mapWrap{top:49px;right:10px;padding:5px;border-radius:15px}.phoneControls #map{width:76px;height:76px}.phoneControls #coords{margin:2px;font-size:8px}.phoneControls #quest{top:150px;left:10px;width:160px;padding:8px 10px;border-radius:14px}.phoneControls #quest small{font-size:8px}.phoneControls #quest h3{font-size:11px;margin:4px 0}.phoneControls #quest p{display:none}.phoneControls #questProgress{font-size:9px;margin:0}
.phoneControls #hotbar{left:auto;right:max(10px,env(safe-area-inset-right));bottom:calc(16px + env(safe-area-inset-bottom));transform:none;display:grid;grid-template-columns:repeat(3,clamp(48px,15vw,62px));gap:6px;padding:7px;border-radius:23px;background:#ffffff57}.phoneControls #hotbar button{width:100%;height:58px;padding:5px 2px;border-radius:16px;background:#fffef4ed;box-shadow:0 2px 3px #14392425;touch-action:manipulation}.phoneControls #hotbar button:hover{transform:none}.phoneControls #hotbar .controlIcon{font-size:22px}.phoneControls #hotbar .controlLabel{font-size:10px;letter-spacing:0;white-space:nowrap}.phoneControls kbd{display:none}
.phoneControls #touchMove{display:block;pointer-events:auto;position:absolute;left:max(17px,env(safe-area-inset-left));bottom:calc(38px + env(safe-area-inset-bottom));width:clamp(94px,27vw,116px);height:clamp(94px,27vw,116px);border-radius:50%;border:3px solid #ffffffc9;background:#ffffff45;box-shadow:inset 0 2px 10px #fff4,0 3px 15px #21472425;touch-action:none;user-select:none}.stickKnob{position:absolute;width:43px;height:43px;left:calc(50% - 21.5px);top:calc(50% - 21.5px);border-radius:50%;background:#fffffff0;box-shadow:0 3px 8px #163c3a44;pointer-events:none}.stickDirections{position:absolute;inset:0;display:grid;place-items:center;font-size:70px;font-weight:300;color:#fff9;pointer-events:none}.stickLabel{position:absolute;top:calc(100% + 6px);left:0;right:0;color:#fff;font-size:11px;text-shadow:0 1px 3px #193b30;pointer-events:none}.phoneControls #cameraBtns{top:153px;right:10px;bottom:auto;display:grid;grid-template-columns:repeat(2,32px);gap:5px}.phoneControls #cameraBtns button{width:32px;height:32px;border-radius:11px;font-size:17px;background:#fffef2dd}
.phoneControls #editor{top:auto;bottom:calc(165px + env(safe-area-inset-bottom));left:10px;right:10px;width:auto;padding:8px;display:grid;grid-template-columns:minmax(0,1fr) 62px 82px;gap:6px;border-radius:17px}.phoneControls #editor>small,.phoneControls .editorTitle b,.phoneControls #editConfirm,.phoneControls #editCoords,.phoneControls .editTools,.phoneControls .creativeSwitch{display:none}.phoneControls .editorTitle{grid-column:3;grid-row:1;margin:0;gap:3px}.phoneControls #editorToggle,.phoneControls #editorSettings{padding:5px!important;font-size:10px!important}.phoneControls #materialPick{grid-column:1/3;grid-row:1;padding:5px!important;gap:8px}.phoneControls #blockName{font-size:11px}.phoneControls #blockStock{font-size:8px;margin-top:0}.phoneControls .editModes{grid-column:1/3;grid-row:2;margin:0;gap:6px}.phoneControls #editor button{font-size:10px;padding:7px;min-height:30px}.phoneControls #paletteOpen{grid-column:3;grid-row:2;font-size:0!important;padding:4px!important}.phoneControls #paletteOpen:before{content:'素材えらび';font-size:10px}.phoneControls #editor.detailsOpen .editTools{display:flex;grid-column:1/-1;margin:0}.phoneControls #editor.detailsOpen .creativeSwitch{display:flex;grid-column:1/-1;margin:0;font-size:10px}.phoneControls .creativeSwitch input{width:18px;height:18px}.phoneControls #interact{bottom:calc(264px + env(safe-area-inset-bottom));width:max-content;max-width:calc(100% - 24px);padding:6px 10px;font-size:10px;line-height:1.6}.phoneControls #saveStatus{bottom:0;right:6px;font-size:8px;padding:2px 7px;max-width:80vw}.phoneControls #toast{top:235px;max-width:calc(100% - 24px);padding:9px 14px;font-size:11px}.phoneControls dialog{width:calc(100% - 24px);padding:22px 16px;max-height:calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}.phoneControls dialog h2{font-size:20px;padding-right:20px}.phoneControls .grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.phoneControls .card{padding:10px}.phoneControls .card h3{font-size:12px}.phoneControls .card button{max-width:100%;padding:8px 9px}.phoneControls #paletteGrid{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.phoneControls .materialCard{min-height:103px}.phoneControls .materialCard b{font-size:10px}.phoneControls .materialCard canvas{width:70px;height:60px}.phoneControls #welcome{inset:70px 12px 12px}.phoneControls .login{width:min(355px,100%);padding:18px 22px}.phoneControls .login h2{font-size:20px}
@media(max-width:350px){.phoneControls #editor{grid-template-columns:minmax(0,1fr) 40px 76px}.phoneControls #hotbar{gap:5px;padding:5px}.phoneControls #paletteGrid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-height:500px) and (orientation:landscape){.phoneControls #quest,.phoneControls #mapWrap{display:none}.phoneControls #vitals{top:47px}.phoneControls #hotbar button{height:48px}.phoneControls #hotbar{bottom:12px;grid-template-columns:repeat(3,60px)}.phoneControls #hotbar .controlIcon{font-size:18px}.phoneControls #touchMove{width:90px;height:90px;bottom:28px}.phoneControls #editor{bottom:auto;top:48px;left:153px;right:100px;max-width:400px}.phoneControls #interact{bottom:135px}.phoneControls #cameraBtns{top:48px}.phoneControls #toast{top:150px}}
.phoneControls #hotbar kbd{display:none}
/* Exploration keeps the center clear; edit and camera tools open on demand. */
body.playing #appearanceBtn,body.playing #languageControl{display:none!important}body.playing #quest{display:none}body.playing #mapWrap{display:none}body.playing.showMap #mapWrap{display:block}body.playing #editor{display:none!important}body.playing.editingWorld #editor{display:block!important}body.playing #cameraBtns{display:none}body.playing.cameraOpen #cameraBtns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;right:20px;top:84px;bottom:auto;background:#fffdf2ed;padding:9px;border-radius:18px;pointer-events:auto;width:142px}body.playing #cameraBtns button{width:100%;height:35px;font-size:12px}body.playing #cameraReset,body.playing #mapToggle{font-size:10px}body.playing #saveStatus{opacity:0;pointer-events:none}body.playing #saveStatus:has(+.none){opacity:0}body.playing #toast{top:80px}body.playing #interact{background:#fffdf0c9;font-size:10px;max-width:70vw;line-height:1.5}#buildToggle,#cameraToggle{display:none}body.playing #buildToggle,body.playing #cameraToggle{display:block}#buildToggle[aria-pressed=true],#cameraToggle[aria-expanded=true]{background:#3c7759;color:white}.menuPreferences{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:24px}.menuPreferences #languageControl{position:static!important;display:flex!important;max-width:100%;padding:8px;margin:0}.menuPreferences #languageControl select{max-width:180px}body.playing .menuPreferences #languageControl{display:flex!important}
.phoneControls.playing header{gap:5px}.phoneControls.playing #clock{font-size:9px;max-width:calc(100% - 198px);padding:7px 8px}.phoneControls.playing header button{font-size:9px;padding:8px;min-height:32px}.phoneControls.playing #vitals{width:112px;top:49px;padding:7px 9px;background:#fffdf0cc;border-radius:13px}.phoneControls.playing #vitals b,.phoneControls.playing #vitals div>span{display:none}.phoneControls.playing #vitals div{margin:2px 0;font-size:9px}.phoneControls.playing meter{height:8px;width:75px}.phoneControls.playing #mapWrap{top:49px;right:10px}.phoneControls.playing.cameraOpen #cameraBtns{top:139px;right:10px;width:132px;padding:7px}.phoneControls.playing #touchMove{width:96px;height:96px;bottom:calc(31px + env(safe-area-inset-bottom));opacity:.8}.phoneControls.playing #hotbar{grid-template-columns:repeat(3,52px);bottom:calc(12px + env(safe-area-inset-bottom));gap:5px;padding:6px;background:#ffffff40}.phoneControls.playing #hotbar button{height:51px;border-radius:15px}.phoneControls.playing #hotbar .controlIcon{font-size:20px}.phoneControls.playing #hotbar .controlLabel{font-size:9px}.phoneControls.playing #interact{bottom:calc(139px + env(safe-area-inset-bottom));padding:5px 9px;font-size:9px;max-width:calc(100% - 30px)}.phoneControls.playing.editingWorld #editor{display:grid!important;bottom:calc(143px + env(safe-area-inset-bottom))}.phoneControls.playing.editingWorld #interact{display:none}.phoneControls.playing #toast{top:112px;max-width:calc(100% - 30px)}.phoneControls.playing .brand{display:none}body.playing #cameraBtns button{touch-action:manipulation}
#languageControl{position:fixed;right:40px;top:82px;z-index:5;display:flex;align-items:center;gap:4px;background:#fffdf2f2;border:1px solid #fff;border-radius:12px;padding:5px 8px;margin:0;font-size:12px}#languageControl select{border:0;background:transparent;color:#284b3e;max-width:135px;font:inherit;padding:2px}body.playing #languageControl{top:80px;right:30px}.phoneControls #languageControl{top:58px;right:18px;font-size:12px}.phoneControls.playing #languageControl{top:49px;right:103px;max-width:135px;padding:5px}.phoneControls #languageControl select{max-width:108px}.phoneControls #paletteOpen:before{content:var(--palette-label,'素材えらび')!important;font-size:9px}ruby{ruby-align:center}rt{font-size:.55em;line-height:1.2;letter-spacing:0}body[data-language=ruby] #hotbar .controlLabel{line-height:1.8}body[data-language=ruby] .materialCard b{line-height:2}body[data-language=ruby] .card h3{line-height:2}body[data-language=ruby] .primary{padding-top:17px}body[data-language=en] .brand span,body[data-language=es] .brand span{letter-spacing:0;font-size:17px}.phoneControls[data-language=en] #hotbar .controlLabel,.phoneControls[data-language=es] #hotbar .controlLabel{font-size:9px;letter-spacing:-.2px}.phoneControls .materialCard b{white-space:normal;overflow-wrap:anywhere}.phoneControls #quest h3{overflow-wrap:anywhere}.phoneControls #materialPick strong{display:none}.phoneControls #blockName{line-height:1.4}.phoneControls #blockStock{white-space:normal}.phoneControls #editor button{overflow-wrap:anywhere}.phoneControls #clock{max-width:calc(100% - 148px);white-space:normal}.phoneControls #appearanceBtn,.phoneControls #menuBtn{white-space:nowrap}.phoneControls #editor.detailsOpen .creativeSwitch{line-height:1.8}.phoneControls[data-language=ruby] #vitals{padding-top:11px}.phoneControls #panel .hairStyles span{white-space:normal;font-size:10px}.phoneControls #panel .lookRotate span{text-align:center;max-width:190px}
#appearanceBtn{display:none}body.playing #appearanceBtn{display:block;margin-left:auto}.phoneControls header{gap:6px}.phoneControls #appearanceBtn{font-size:10px;padding:8px}.lookPreview{display:grid;place-items:center;background:radial-gradient(ellipse at center,#fffdf3,#e3ecd5);border-radius:20px;min-height:285px}.lookPreview canvas{display:block;width:min(280px,100%)!important;height:auto!important}.lookRotate{display:flex;align-items:center;justify-content:center;gap:12px;margin:8px 0}.lookRotate button{border:1px solid #c7d7b6;background:#f3f6e9;color:#315541;border-radius:10px;width:40px;height:36px;font-size:20px}.lookRotate span{font-size:10px}.hairStyles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.hairStyles button{padding:5px;background:#f1f5e6;border:2px solid transparent;border-radius:13px;color:#315541}.hairStyles canvas{width:100%;max-width:112px;height:auto;display:block;margin:auto}.hairStyles span{display:block;font-size:11px;white-space:nowrap;line-height:1.8}.hairStyles button[aria-pressed=true]{border-color:#3d8d69;background:#e3efce;box-shadow:0 0 0 1px #fff inset}.hairColors{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:9px}.hairColors button{height:40px;border-radius:50%;max-width:40px;width:100%;margin:auto;background:var(--hair-color);border:3px solid #fff;box-shadow:0 0 0 1px #d0d9c3}.hairColors button[aria-pressed=true]{box-shadow:0 0 0 3px #368962;position:relative}.hairColors button[aria-pressed=true]:after{content:'✓';color:white;text-shadow:0 1px 3px #000;font-weight:900}.lookNotice{min-height:2em}.lookSave{margin-bottom:6px}.phoneControls #panel:has(.hairStyles){width:min(500px,calc(100% - 24px))}.phoneControls .hairStyles span{font-size:10px}
body.playing #cameraReset,body.playing #mapToggle{grid-column:1/-1;white-space:nowrap;min-height:35px;line-height:1.8}body.playing #saveStatus{display:none}

body.playing #cameraBtns #cameraReset{height:auto;min-height:48px;padding:10px 5px;line-height:2}

#waterControls{position:fixed;right:20px;top:145px;display:flex;gap:6px;align-items:center;background:#fffdf0ed;border-radius:16px;padding:7px;pointer-events:auto;color:#285958;font-size:11px}#waterControls[hidden]{display:none}#waterControls button{padding:9px 12px}.phoneControls #waterControls{top:128px;right:10px;flex-wrap:wrap;max-width:180px;font-size:10px}.phoneControls #waterControls button{padding:8px 10px;font-size:11px}.journeys{margin:20px 0}.journeys button{margin:4px;padding:10px 14px}.underwater #clock{background:#e5fbffeb}

#waterControls button{appearance:none;border:1px solid #b8d6bf;border-radius:12px;background:#eef8e3;color:#285958;font:inherit;font-weight:600;cursor:pointer}#waterControls button:active{background:#a9d7ba}#waterDepth{min-width:65px}

#titleScreen{position:fixed;inset:0;z-index:1000;overflow:hidden;background:#40c7ee;font-family:ui-rounded,'Hiragino Maru Gothic ProN','Yu Gothic',sans-serif}#titleScreen[hidden]{display:none}.titleArt{width:100%;height:100%;object-fit:cover;object-position:center 58%;display:block}.titleVignette{position:absolute;inset:0;background:linear-gradient(180deg,#06395710 10%,transparent 43%,#15392d08 70%,#113f29b8)}.titleLogo{position:absolute;top:max(6vh,env(safe-area-inset-top));left:5%;right:5%;text-align:center;color:#fff9da}.titleLogo>p{font-size:clamp(11px,1.3vw,19px);font-weight:900;letter-spacing:.4em;margin:0 0 9px;text-shadow:0 2px 4px #124b68}.titleLogo h1{font-weight:950;font-size:clamp(46px,7.2vw,108px);line-height:1.13;letter-spacing:-.05em;margin:0;color:#fff7c7;-webkit-text-stroke:2px #275c49;paint-order:stroke fill;text-shadow:0 3px 0 #e7bd70,0 7px 0 #245e46,0 12px 0 #1a493c,0 16px 18px #063a554d}.titleLogo h1>span{display:inline-block}.titleLogo .titleSecond{color:#fff8dc}.titleTagline{margin-top:23px;font-weight:800;font-size:clamp(12px,1.3vw,18px);letter-spacing:.13em;color:white;text-shadow:0 2px 5px #124e56}.titleAction{position:absolute;bottom:max(5vh,calc(env(safe-area-inset-bottom) + 16px));left:20px;right:20px;text-align:center}.titleAction button{appearance:none;display:inline-flex;align-items:center;gap:30px;padding:17px 38px;min-height:58px;border:2px solid #fffbde;border-radius:99px;background:linear-gradient(#fff7ce,#f5df92);color:#285844;box-shadow:0 5px 0 #8a9a57,0 12px 35px #103e2955;font:inherit;font-size:17px;font-weight:850;cursor:pointer}.titleAction button:hover{filter:brightness(1.06)}.titleAction button:active{transform:translateY(3px);box-shadow:0 2px 0 #8a9a57}.titleAction small{display:block;margin-top:20px;letter-spacing:.2em;font-size:9px;color:#fff8dfcc}.titleOpen header,.titleOpen #welcome,.titleOpen #hud,.titleOpen #languageControl,.titleOpen #loading{visibility:hidden!important}@media(max-width:600px){.titleArt{object-position:50% 62%}.titleLogo{top:max(7vh,env(safe-area-inset-top));left:12px;right:12px}.titleLogo h1{font-size:clamp(40px,11vw,64px)}.titleLogo h1>span{display:block}.titleLogo .titleSecond{margin-top:4px}.titleLogo>p{letter-spacing:.24em;font-size:10px}.titleTagline{font-size:11px;margin-top:21px}.titleAction button{font-size:15px;padding:15px 27px;gap:20px}}
/* Keep the map readable while camera controls are expanded. */
body.playing.cameraOpen.showMap #mapWrap{right:174px}
.phoneControls.playing.cameraOpen.showMap #mapWrap{right:10px;top:49px}
.phoneControls.playing.cameraOpen.showMap #cameraBtns{top:159px}

#livestockControls{position:absolute;left:50%;transform:translateX(-50%);bottom:190px;max-width:90vw;background:#f7fae8ed;border-radius:18px;padding:10px;display:flex;gap:8px;align-items:center;flex-wrap:wrap;color:#345c4c;font-size:13px}#livestockControls[hidden]{display:none}#livestockControls button{padding:8px 12px}#waterControls{max-width:300px}#waterControls button{font-size:14px}

#livestockControls{pointer-events:auto}body.playing.cameraOpen #waterControls{right:180px;top:84px;flex-wrap:wrap}.phoneControls.playing.cameraOpen #waterControls{right:10px;top:280px;max-width:180px}#waterControls button{white-space:nowrap;flex-shrink:0}

#shopSearch{width:100%;margin:12px 0}#coinBalance{font-weight:700;font-size:18px}#panelContent section>button{margin:4px}#livestockControls button{border:1px solid #b8d6bf;border-radius:12px;background:#eef8e3;color:#285958;font:inherit;font-weight:600;cursor:pointer}

/* Animal actions stay above the mobile movement and main action controls. */
#livestockControls{width:max-content;max-width:min(580px,calc(100vw - 24px));justify-content:center}#livestockStatus{flex-basis:100%;text-align:center;font-weight:700}#livestockControls button{min-height:40px}#livestockControls button:disabled{opacity:.55;cursor:default}.phoneControls #livestockControls{bottom:calc(190px + env(safe-area-inset-bottom));gap:6px;padding:8px;max-width:calc(100vw - 24px);font-size:11px}.phoneControls #livestockControls button{padding:8px;min-height:40px}@media(max-height:520px){#livestockControls{bottom:110px!important;max-width:65vw}}

#farmControls{position:absolute;left:50%;transform:translateX(-50%);bottom:118px;width:max-content;max-width:calc(100vw - 24px);padding:9px 14px;border-radius:16px;background:#f7fae8ed;color:#345c4c;font-size:12px;display:flex;align-items:center;gap:12px;pointer-events:auto}#farmControls[hidden]{display:none}#farmControls button{min-height:42px;padding:8px 14px;border:1px solid #a8c8b4;border-radius:12px;background:#d9f2ee;color:#285958;font:inherit;font-weight:700}#farmControls button:disabled{opacity:.6}.nearFarm #livestockControls{bottom:202px}.phoneControls #farmControls{bottom:calc(190px + env(safe-area-inset-bottom));font-size:11px;width:calc(100vw - 32px);justify-content:space-between}.phoneControls.nearFarm #livestockControls{bottom:calc(280px + env(safe-area-inset-bottom))}@media(max-height:520px){#farmControls{bottom:110px;left:10px;transform:none;max-width:38vw}.nearFarm #livestockControls{bottom:180px!important}}

/* New systems use the existing cream cards and green controls. */
#recipeSearch{width:100%;margin:8px 0;padding:12px;border:1px solid #cbd8bd;border-radius:12px;font:inherit}.recipeFilters{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin:12px 0}.recipeFilters select{padding:9px;border:1px solid #cbd8bd;border-radius:12px;background:#f3f5e6;color:#345c4c;font:inherit}.recipeFilters label{display:flex;align-items:center;gap:8px}.recipeFilters input{width:18px;height:18px}.recipeGoal{padding:12px;border:1px solid #c3d5b5;border-radius:14px;background:#eaf1dd;margin-bottom:14px}.recipeGoal[hidden]{display:none}.recipeCard button{margin:3px 4px 3px 0;min-height:40px}.materialsReady{color:#3f7956!important}.materialsMissing{color:#8b6741!important}.recipeCard p{overflow-wrap:anywhere}#editorFavorite{grid-column:1/-1}#assignAnimalHome,#returnAnimalHome{min-height:44px;margin:6px 8px 6px 0}.phoneControls #livestockControls{max-width:calc(100vw - 20px)}

.saveSlots{display:grid;gap:10px;margin:18px 0}.saveSlot{background:#f5f5e8;border:1px solid #d8dfc6;border-radius:18px;padding:14px}.saveSlot h3,.saveSlot p{margin:0 0 8px}.saveSlot button{min-height:44px;width:100%}.saveSlot p{font-size:13px}.login:has(.saveSlots){max-height:80dvh;overflow-y:auto}.saveSlots~button{min-height:44px}

.heightTools{display:flex;gap:6px}.heightTools button{flex:1;min-height:44px}#furnitureControls{position:fixed;bottom:calc(27% + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:15}#furnitureControls button{min-height:44px;padding:10px 22px;border-radius:22px;background:#fbf9e9;border:1px solid #b8c9a6;color:#315845;box-shadow:0 3px 12px #23452a30}#furnitureControls[hidden]{display:none}

.worldOverview #hotbar,.worldOverview #touchMove,.worldOverview #vitals,.worldOverview #quest,.worldOverview #livestockControls,.worldOverview #farmControls,.worldOverview #waterControls,.worldOverview #furnitureControls,.worldOverview #editor,.worldOverview #mapWrap{display:none!important}#cameraOverview{grid-column:1/-1;min-height:44px}.worldOverview #interact{bottom:25px}

#runToggle{position:absolute;left:30px;bottom:24px;pointer-events:auto;min-height:44px;padding:8px 18px;border:2px solid #fffbd8;border-radius:20px;background:#fffce9e8;color:#345d46;font:inherit;cursor:pointer}#runToggle[aria-pressed="true"]{background:#497e50;color:white}.phoneControls.playing #touchMove{bottom:calc(64px + env(safe-area-inset-bottom))}.phoneControls.playing .stickLabel{display:none}.phoneControls #runToggle{left:max(17px,env(safe-area-inset-left));bottom:calc(10px + env(safe-area-inset-bottom));width:96px;font-size:12px}.editingWorld #runToggle,.worldOverview #runToggle{display:none}.soundSettings{padding:14px;border:1px solid #c9d8bd;border-radius:16px;background:#eef5df}.soundSettings label{display:flex;gap:10px;align-items:center;margin:12px 0}.soundSettings input[type=checkbox]{width:18px;height:18px;flex:0 0 18px;margin:0}.soundSettings input[type=range]{width:min(180px,45vw)}.soundSettings button{margin:4px 0}.soundSettings small{line-height:1.8}.soundSettings p{min-height:1.5em}

#friendHud{position:absolute;top:103px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:5px;padding:5px 9px;border-radius:16px;background:#fffbeddd;pointer-events:auto;font-size:12px}#friendHud[hidden],.worldOverview #friendHud{display:none}#friendHud button{padding:7px;min-height:34px}.friendsPanel article{padding:12px 0;border-top:1px solid #c4d4b8}.friendsPanel article b{display:block;margin-bottom:8px}.friendsPanel button{margin:4px}.friendsPanel input[type=checkbox]{width:18px;height:18px;flex:0 0 18px}.roomControls label{display:flex;align-items:center;gap:10px}.roomControls small{display:block;line-height:1.8}.friendMessage{color:#3b7550;min-height:1.5em}.phoneControls #friendHud{top:94px;max-width:calc(100% - 20px);font-size:10px;width:max-content}.phoneControls #friendHud button{font-size:11px;padding:5px}

#furnitureControls{display:flex;gap:8px;max-width:calc(100% - 24px)}#furnitureControls button{white-space:nowrap;font-size:13px;padding:10px 14px}.phoneControls #rotatePlaced{flex:1.6;font-size:9px!important}#rotatePlaced{flex:1.5}

.editModes{flex-wrap:wrap}.editModes>button{width:auto;flex:1 1 40%;white-space:nowrap}.editModes>#rotatePlaced{flex:1 1 100%}


/* Building gestures select cells; deliberate camera controls remain available. */
body.playing{touch-action:none}button{touch-action:manipulation}.placementTools,.targetTools{display:flex;gap:5px;margin-top:7px}.placementTools>button,.targetTools>button{flex:1;min-height:40px}.targetTools[hidden]{display:none}#editor button[aria-pressed="true"]{background:#5c8259;color:white}#editCoords{line-height:1.5}.phoneControls .placementTools,.phoneControls .targetTools,.phoneControls .heightTools{grid-column:1/-1;margin:0}.phoneControls #editor .heightTools button,.phoneControls #editor .targetTools button{min-height:40px;font-size:11px}.phoneControls #editor #editCoords{display:block;grid-column:1/-1;margin:0;font-size:10px;color:#355b40}.phoneControls #editor{max-height:55dvh;overflow-y:auto}.phoneControls #editor .placementTools button{font-size:10px;min-height:36px}body.playing #world{touch-action:none}
#panelContent .menuActions,#panelContent .menuDestinations{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:16px 0}#panelContent .menuActions button,#panelContent .menuDestinations button{margin:0;min-height:48px;padding:12px}.menuSummary{font-size:12px;color:#63765d}.menuOptions{border:1px solid #d6dfc7;border-radius:14px;margin:12px 0;padding:12px 15px}.menuOptions summary{cursor:pointer;font-weight:700;min-height:24px}.menuOptions p{font-size:14px;line-height:1.8}.menuSettings #languageControl{position:static!important;max-width:none!important;width:max-content;margin:14px 0!important}.menuSettings .soundSettings{margin:12px 0;padding:12px}.menuSettings .soundSettings label{display:flex;align-items:center;gap:10px}.menuSettings input[type=checkbox]{width:22px;height:22px}.menuSettings input[type=range]{min-width:0;flex:1}.audioCredits{font-size:12px;line-height:2}.menuAccount{margin-top:24px}.shortHelp h3{margin-bottom:4px}.shortHelp p{margin-top:4px}#livestockControls:not(.expanded){background:transparent;padding:0;border:0;box-shadow:none;bottom:190px;width:auto;max-width:180px}#livestockControls #animalExpand{border-radius:22px;min-height:42px;background:#fffdf0ed;font-size:12px;padding:8px 14px;box-shadow:0 2px 5px #23492a22}#livestockControls .animalDetails{display:flex;flex-wrap:wrap;gap:7px;justify-content:center;padding-top:22px}#livestockControls .animalDetails[hidden]{display:none}#livestockControls #animalClose{position:absolute;right:6px;top:3px;border:0;background:transparent;font-size:24px;padding:0 8px;min-height:30px}#livestockControls.expanded{max-width:min(440px,calc(100vw - 24px))}.phoneControls #livestockControls:not(.expanded){bottom:calc(190px + env(safe-area-inset-bottom));left:14px;transform:none;max-width:180px}.phoneControls.nearFarm #livestockControls:not(.expanded){bottom:calc(246px + env(safe-area-inset-bottom))}.worldOverview #livestockControls{display:none!important}

.rankingTabs{display:flex;gap:8px;flex-wrap:wrap;margin:16px 0}.rankingTabs button{margin:0;padding:10px 14px}.rankingTabs [aria-pressed=true]{background:#315c45;box-shadow:0 0 0 2px #b9d5a0}.rankingRow{display:grid;grid-template-columns:48px minmax(0,1fr) auto;gap:10px;align-items:center;padding:14px 8px;border-bottom:1px solid #dce2d0;font-size:14px}.rankingRow span{overflow-wrap:anywhere}.rankingRow strong{font-size:13px}.rankingRow.self,.rankingMe{background:#e6f0d9;border-radius:10px}.rankingMe{padding:12px;font-size:13px;margin:12px 0}.rankingPrivacy{margin-top:24px;border-top:1px solid #cedbc1;padding-top:12px}.rankingPrivacy p,.rankingStatus{font-size:13px;line-height:1.8}.rankingPrivacy button{width:100%;min-height:46px}.phoneControls .rankingRow{gap:6px;grid-template-columns:36px minmax(0,1fr) auto;font-size:12px}

.customBlockSlots{display:flex;gap:6px;flex-wrap:wrap}.customBlockSlots button{min-width:40px;padding:10px}.customBlockSlots [aria-pressed="true"]{outline:3px solid #d2a755}.customBlockFields{display:grid;gap:14px;margin-top:20px}.customBlockFields label{display:grid;gap:6px}.customBlockFields input{width:100%;box-sizing:border-box}.customBlockFields input[type=color]{height:48px}.customBlockFields canvas{width:128px;height:128px;border-radius:10px;border:2px solid #d6dfc5;image-rendering:auto}

/* Short controls are indivisible. Longer content wraps at its own layout boundaries. */
header>button{flex:0 0 auto;white-space:nowrap;overflow-wrap:normal;word-break:normal}header .brand{flex-shrink:0}header .brand span{white-space:nowrap}body.playing #clock{display:flex;flex:1 1 auto;min-width:0;flex-wrap:wrap;align-items:center;gap:2px 8px;line-height:1.6}#clock #clockArea,#clock #clockTime{display:block;white-space:nowrap;margin:0;overflow-wrap:normal}#clockArea{overflow:hidden;text-overflow:ellipsis;max-width:100%}#clockTime{font-variant-numeric:tabular-nums}#vitals #playerName{display:flex;flex-wrap:wrap;gap:3px 8px;line-height:1.6}#playerName .heroLabel{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#playerName .saveLabel{white-space:nowrap;font-size:.9em;opacity:.85}#panelContent p,#panelContent label,.login p{overflow-wrap:normal;word-break:normal;line-break:strict}#panelContent a,.audioCredits{overflow-wrap:anywhere}#panelContent h2,#panelContent h3,.materialCard b,.saveSlot p{word-break:normal;overflow-wrap:normal;line-break:strict;text-wrap:pretty}.materialCard b{text-wrap:balance}#cameraBtns button,.heightTools button,.placementTools button,.targetTools button,.categoryChip,#animalExpand,#furnitureControls button,#runToggle{white-space:nowrap;overflow-wrap:normal}#editor{max-height:calc(100dvh - 115px);overflow-y:auto;overscroll-behavior:contain}.heroSetup{display:grid;gap:14px}.heroSetup label{display:grid;gap:10px}.heroSetup input{width:100%;min-width:0;padding:13px;font-size:16px;border:1px solid #cbd8bd;border-radius:12px}.heroSetup+button{margin-top:14px}.customBlockFields p,.heroSetup p{margin:0;line-height:1.7}
@media(max-width:1150px){body.playing .brand{display:none}body.playing #clock{flex:0 1 auto;margin-right:auto}body.playing header{gap:10px}body.playing header>button{padding:12px 16px}}
.phoneControls.playing header{gap:5px}.phoneControls.playing header>button{padding:8px;font-size:9px}.phoneControls.playing #clock{flex:1 1 auto;margin-right:0;max-width:none;padding:7px 8px}.phoneControls.playing #vitals #playerName{display:none}.phoneControls.playing #clock span{font-size:inherit}.phoneControls #editor button{overflow-wrap:normal;word-break:normal}.phoneControls #blockName{overflow-wrap:normal;word-break:normal;line-break:strict}.phoneControls .materialCard b{overflow-wrap:normal;line-break:strict;text-wrap:balance}

.textPhrase{display:inline-block;max-width:100%;word-break:normal}.heroSetupIntro .textPhrase:last-child{display:block;margin-top:.3em}@supports(word-break:auto-phrase){#panelContent p,#panelContent label,.login p,.saveSlot p,.materialCard b{word-break:auto-phrase}}

/* Language selection stays available on the title and in in-game settings. */
.titleOpen #languageControl{visibility:visible!important;z-index:1100;top:max(12px,env(safe-area-inset-top));right:12px}
body.playing .menuSettings #languageControl{display:flex!important;visibility:visible!important;position:static!important;max-width:100%!important;width:fit-content}
body[data-language=es] .titleLogo h1{font-size:clamp(34px,6vw,86px)}
body[data-language=ruby] .menuOptions p{line-height:2.3}
body[data-language=ruby] button{line-height:2}
@media(max-width:600px){body[data-language=es] .titleLogo h1{font-size:clamp(28px,8.2vw,48px)}.menuSettings #languageControl select{max-width:100%}.menuActions button,.menuDestinations button{overflow-wrap:normal;word-break:normal;hyphens:auto}}

.recentMaterials{display:flex;gap:5px;overflow-x:auto;margin:7px 0;scrollbar-width:thin}.recentMaterials:empty{display:none}.recentMaterial{flex:0 0 66px;min-width:0;padding:5px!important;display:flex;align-items:center;gap:4px}.recentMaterial>span:first-child{width:16px;height:20px;border-radius:4px;flex:0 0 16px}.recentMaterial>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px}.buildShortcuts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin-top:7px}.buildShortcuts>button{min-width:0;min-height:38px;font-size:11px;padding:6px}.quickBuildSwitch{display:none;align-items:center;gap:7px;font-size:11px;margin-top:8px}#editor.detailsOpen .quickBuildSwitch{display:flex}#editor button:disabled{opacity:.48}.phoneControls #editor .recentMaterials,.phoneControls #editor .buildShortcuts,.phoneControls #editor .quickBuildSwitch{grid-column:1/-1;margin:0}.phoneControls #editor .buildShortcuts>button{min-height:38px;white-space:normal;line-height:1.4}.phoneControls .recentMaterial{min-height:30px!important}.phoneControls #editor.detailsOpen .quickBuildSwitch{display:flex}.quickBuildSwitch input{width:18px;height:18px}

body:not(.phoneControls) #editor .buildShortcuts{grid-template-columns:repeat(2,minmax(0,1fr))}body:not(.phoneControls) #editor .buildShortcuts>button{white-space:nowrap;font-size:10px;padding:6px 2px}

#collectLiquid{position:fixed;left:30px;bottom:180px;z-index:12;pointer-events:auto;background:#f7fae8ed;border:1px solid #b8d6bf;border-radius:24px;padding:12px 18px;color:#285958;font:inherit;font-size:13px;font-weight:700}#collectLiquid[hidden]{display:none}.phoneControls #collectLiquid{left:12px;bottom:calc(300px + env(safe-area-inset-bottom));max-width:180px;font-size:11px;padding:10px 12px}.worldOverview #collectLiquid{display:none!important}body:has(#panel[open]) #collectLiquid{display:none}

#stopFollowing{position:fixed;left:14px;bottom:calc(246px + env(safe-area-inset-bottom));z-index:7;padding:10px 14px;min-height:42px;max-width:180px;border-radius:22px;background:#fffdf0ed;color:#31584a;font-size:12px;pointer-events:auto;box-shadow:0 2px 5px #23492a22}#stopFollowing[hidden]{display:none!important}.worldOverview #stopFollowing{display:none!important}

.menuSaveStatus{font-size:13px;line-height:1.7;white-space:normal;overflow-wrap:anywhere;color:#31584a}.menuSaveStatus:empty{display:none}

/* Primary build controls stay visible without opening settings. */
.rotationTools,.aimTools{display:flex;align-items:center;gap:6px;margin-top:7px}.rotationTools button,.aimTools button{min-height:44px;flex:1}.rotationTools output{min-width:36px;text-align:center;font-variant-numeric:tabular-nums;font-size:12px}#materialPreview{width:56px;height:46px;object-fit:contain;flex:0 0 56px}#blockSwatch{display:none!important}#editor .buildShortcuts,#editor .placementTools{display:none}#editor.detailsOpen .buildShortcuts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}#editor.detailsOpen .placementTools{display:flex}#editor #blockRotate{background:#dcebc9;color:#285644;font-weight:700}#buildReticle{display:none;position:fixed;left:50%;top:44%;transform:translate(-50%,-50%);font-size:26px;line-height:1;color:#fffbe2;text-shadow:0 1px 3px #153d25,1px 0 3px #153d25;pointer-events:none;z-index:4}.editingWorld.aimBuilding:not(.worldOverview) #buildReticle{display:block}body:has(#panel[open]) #buildReticle{display:none!important}.phoneControls #editor .rotationTools,.phoneControls #editor .aimTools{grid-column:1/-1;margin:0}.phoneControls #editor .rotationTools button,.phoneControls #editor .aimTools button{min-height:42px;font-size:11px;white-space:normal;line-height:1.4}.phoneControls #editor #materialPreview{width:48px;height:39px;flex-basis:48px}.phoneControls #editor .editModes button{min-height:40px}.phoneControls #editor .rotationTools output{font-size:11px}.phoneControls #editor:not(.detailsOpen) .targetTools{display:none}.phoneControls #editor .recentMaterials{max-height:38px}

/* Traveler notebook: quiet, responsive goals; nothing added to the running world. */
.travelerNotebook .notebookLead{font-weight:700;font-size:1.12em}.notebookStory{background:#edf2df;border:1px solid #cbd8b7;border-radius:18px;padding:16px;margin:18px 0}.notebookStory details{padding:10px 0;border-top:1px solid #d4dec6}.notebookStory summary{cursor:pointer;font-weight:700;line-height:1.6}.notebookStory p{line-height:1.85}.notebookFilters,.notebookActions{display:flex;flex-wrap:wrap;gap:8px}.notebookFilters{margin:18px 0}.notebookFilters button{flex:1 1 130px;white-space:normal}.notebookFilters [aria-pressed=true]{background:#456f52;color:#fff}.notebookGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:12px}.notebookCard{border:1px solid #d5dfc3;border-radius:16px;padding:16px;background:#fafbf2;min-width:0;overflow-wrap:anywhere}.notebookCard.complete{border-color:#80aa7c;background:#f0f6e6}.notebookCard h3{margin:8px 0}.notebookCard p{line-height:1.7;margin:10px 0}.notebookCard progress{width:100%;accent-color:#5c8d60}.notebookActions button{flex:1 1 130px;white-space:normal;min-height:44px}.notebookNote{font-size:.88em;line-height:1.7}.notebookNotice{padding:12px;background:#f4e8ce;border-radius:12px}.notebookRecords{margin-top:20px;padding:14px 0;border-top:1px solid #d5dfc3}.notebookRecords summary{cursor:pointer;font-weight:700}

.travelerNotebook .notebookFilters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.travelerNotebook .notebookFilters button{min-width:0}
