/* The home occupies the space of the board, never space above the board. */
.game-shell>.merge-screen[hidden],#home-screen[hidden]{display:none!important}
.game-shell[data-screen="home"]{display:flex;flex-direction:column;background:linear-gradient(#d8e2bd,#a5b689);padding-bottom:max(7px,env(safe-area-inset-bottom))}
#home-screen{--home-accent:#899e68;--home-soft:#e8edd4;--home-tint:#899e6800;display:flex;flex:1;min-height:0;flex-direction:column;gap:8px;padding:6px 5px 0;color:#795c3f}
#home-screen[data-theme="sage"]{--home-accent:#7e9569;--home-soft:#e0e8cf;--home-tint:#86a96924}
#home-screen[data-theme="rose"]{--home-accent:#b58785;--home-soft:#f2ddda;--home-tint:#d48c9429}
#home-screen[data-theme="blue"]{--home-accent:#7e9ba9;--home-soft:#dfebed;--home-tint:#71a1b729}
#home-screen[data-theme="gold"]{--home-accent:#b59a5c;--home-soft:#f4e7c3;--home-tint:#deb4532e}
.home-living{flex:1;min-height:220px;display:flex;flex-direction:column;gap:6px}
.home-heading{display:flex;align-items:center;gap:6px;height:34px;flex-shrink:0;padding:0 3px}
.home-heading>div{flex:1}.home-heading small{display:block;font-size:8px;letter-spacing:1px;color:#768455}.home-heading h1{font-size:19px;line-height:21px;margin:0;color:#fff8df;text-shadow:0 1px 2px #5c734550}
.home-room-name{font-size:9px;color:#697e50}.home-sound{border:1px solid #f1e6c7;border-radius:50%;width:36px;height:36px;flex-shrink:0;color:#f9f0d5;background:#8fa470;font-size:22px}
.home-room{position:relative;flex:1;min-height:135px;border:3px solid #b59163;border-radius:22px;overflow:hidden;background:#f5e5bb;box-shadow:0 4px 0 #7d674840,inset 0 0 0 3px #fff1d2;isolation:isolate}
.home-room-art{width:100%;height:100%;position:absolute;inset:0;display:block}
.home-room-tint{position:absolute;inset:0;background:var(--home-tint);pointer-events:none;mix-blend-mode:multiply}
.home-room-badge{position:absolute;left:10px;top:10px;z-index:1;background:#fff7dfed;border:1px solid #cfb784;border-radius:12px;padding:4px 8px;font-size:9px;color:#9a7b50;box-shadow:0 2px 3px #6c502519}
.home-memory{position:absolute;top:23%;right:9%;padding:4px;width:50px;height:54px;border:4px solid #c39b65;border-radius:7px;background:#fff6dc;box-shadow:0 2px 3px #70533750;transform:rotate(3deg)}.home-memory svg{width:100%;height:100%;display:block;pointer-events:none}
.home-preview-tag{position:absolute;left:8px;right:8px;bottom:5px;display:flex;align-items:center;justify-content:space-between;gap:6px;border-radius:13px;background:#fff8e8ef;color:#977346;padding:3px 5px 3px 9px;font-size:10px;z-index:2;box-shadow:0 2px 4px #64523125}.home-preview-tag button{width:36px;height:36px;min-height:36px;border:0;border-radius:50%;background:#e6dcc2;color:#8f7756;font-size:20px}
.home-goal{flex-shrink:0;display:flex;align-items:center;gap:9px;min-height:49px;padding:5px 11px;border:1px solid #cebb92;border-radius:15px;background:linear-gradient(#fff9e5,#f1e5c9);box-shadow:0 2px 0 #95835d26;text-align:left}
.home-goal-icon{font-size:26px;color:#bf9b5e}.home-goal>span:nth-child(2){min-width:0;flex:1}.home-goal small{display:block;font-size:8px;line-height:13px;color:#ae9470}.home-goal strong{font-size:12px;line-height:17px;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.home-goal b{font-size:10px;font-weight:700;white-space:nowrap;color:#a88b57}.home-goal i{font-style:normal;font-size:22px;margin-left:8px}.home-goal.goal-ready{border-color:#b8c283;background:linear-gradient(#f4f5de,#dde9bd)}.goal-ready .home-goal-icon,.goal-ready b{color:#819458}
.home-shortcuts{height:49px;flex-shrink:0;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px}
.home-shortcuts button{min-width:0;min-height:44px;padding:3px 2px;border:1px solid #bdca9b;border-radius:13px;background:linear-gradient(#e7edcf,#d2deb7);color:#738851;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;box-shadow:0 2px 0 #73894c20}.home-shortcuts button>span{width:28px;height:27px;display:grid;place-items:center}.home-shortcuts svg,.home-shortcuts .illustration,.home-shortcuts .machine-art{display:block;width:100%;height:100%}.home-shortcuts small{font-size:9px;line-height:11px;font-weight:700}.home-shortcuts .home-coin-symbol{font-size:29px;line-height:28px;color:#c6a355;text-shadow:0 1px #fff3ac}
.home-studio{flex-shrink:0;padding:7px 7px 6px;background:linear-gradient(#fff8e6,#f3e7d0);border:2px solid #c5af82;border-radius:19px;box-shadow:0 3px 0 #8a75512b;min-width:0}
.home-studio-heading{display:flex;align-items:center;justify-content:space-between;gap:5px;margin-bottom:5px}.home-studio h2{font-size:12px;margin:0 0 0 4px;white-space:nowrap;color:#977547}
.home-categories{display:flex;gap:3px}.home-categories button{padding:4px 7px;min-height:34px;border:1px solid #d9c7a4;border-radius:10px;background:#f1e4ca;color:#ab9270;font-size:10px;font-weight:700}.home-categories button[aria-pressed="true"]{color:#fff8e6;background:var(--home-accent);border-color:var(--home-accent);box-shadow:0 2px 0 #7d755133}
.home-collection{display:flex;gap:7px;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#ccba96 transparent;scroll-snap-type:x proximity;min-height:118px;padding:1px 2px 4px;touch-action:pan-x}
.home-decor-card{flex:0 0 112px;min-width:0;border:1px solid #dcc9a4;border-radius:13px;padding:4px;background:#efe5ce;scroll-snap-align:start;display:flex;flex-direction:column;justify-content:space-between;gap:3px}
.home-decor-card.equipped{border-color:var(--home-accent);background:var(--home-soft)}.home-decor-card.previewing{box-shadow:inset 0 0 0 2px #d4af6a}
.home-decor-preview{padding:0 1px;background:none;border:0;width:100%;display:flex;flex-direction:column;align-items:center;color:#8b7050;text-align:center}.home-decor-art{height:44px;width:62px;display:grid;place-items:center;margin:0 0 3px}.home-decor-art svg{width:100%;height:100%;display:block}.home-decor-preview strong,.home-photo-card>strong{font-size:9px;line-height:13px;font-weight:800;white-space:nowrap;display:block}.home-decor-preview small{font-size:7px;line-height:11px;color:#ab997d}.home-decor-apply{width:100%;min-height:36px;padding:4px 2px;background:linear-gradient(#f8e9bd,#e7cf9b);border:1px solid #c3a773;border-radius:9px;font-size:10px;line-height:12px;font-weight:800;color:#947140}.home-decor-apply:disabled{opacity:.65;background:#e0dfcd;border-color:#c8c6ad;color:#9b9b7f}
.home-theme-swatch{width:47px;height:38px;display:grid;place-items:center;border:3px solid #fff3d4;border-radius:12px;box-shadow:0 1px 0 1px #bdab85;background:#aabb8c;color:#fff4cf}.home-theme-swatch.theme-rose{background:#d5a8a8}.home-theme-swatch.theme-blue{background:#a0bece}.home-theme-swatch.theme-gold{background:#d8bb75}.home-theme-swatch i{font-size:23px;font-style:normal;opacity:.8}
.home-photo-card{align-items:center}.home-photo-art{display:grid;place-items:center;width:60px;height:59px;padding:3px;border:3px solid #caab7f;background:#fff7e1;border-radius:5px;box-shadow:0 2px #9b795824}.home-photo-art svg{width:100%;height:100%;display:block}.home-photo-card .home-decor-apply{min-height:36px}
.home-memory-empty{display:flex;align-items:center;gap:8px;flex:1;min-width:280px;padding:10px}.home-memory-empty>span{font-size:34px;color:#baa37e}.home-memory-empty>div{flex:1;min-width:0}.home-memory-empty strong{display:block;font-size:12px;color:#987a52}.home-memory-empty small{display:block;font-size:9px;line-height:1.6;margin-top:5px;color:#ad997b}.home-memory-empty button{min-height:44px;padding:6px 8px;background:#dce6c4;border:1px solid #aebd8e;border-radius:12px;color:#7a8f55;font-size:10px;white-space:nowrap}
.home-play{display:flex;align-items:center;justify-content:center;gap:12px;flex-shrink:0;min-height:55px;width:100%;padding:4px 12px;border:2px solid #fff1c7;border-radius:18px;background:linear-gradient(#a6b778,#879e5f);color:#fff7dc;box-shadow:0 4px 0 #5d77424a,inset 0 1px #d2dfa7;margin-bottom:4px;text-shadow:0 1px #678044}
.home-play-food{position:relative;display:block;width:58px;height:41px}.home-play-food>svg{position:absolute;left:0;top:2px;width:36px;height:36px;transform:rotate(-10deg);filter:drop-shadow(0 2px 1px #62774640)}.home-play-food>svg:last-child{left:27px;transform:rotate(12deg)}.home-play>span:nth-child(2){text-align:left}.home-play strong{display:block;font-size:18px;line-height:22px;letter-spacing:.5px}.home-play small{display:block;font-size:8px;line-height:12px;opacity:.8}.home-play>i{font-style:normal;font-size:21px;margin-left:5px;color:#fff1ba}.home-play:active{transform:translateY(1px);box-shadow:0 2px 0 #5d77424a}
@media(max-width:350px){#home-screen{padding:3px 1px 0;gap:6px}.home-heading h1{font-size:17px}.home-room-name{font-size:8px}.home-studio h2{font-size:10px}.home-categories button{padding:3px 5px;font-size:9px}.home-shortcuts{gap:3px}.home-decor-card{flex-basis:106px}.home-room{border-radius:17px}}
@media(max-height:650px) and (orientation:portrait){#home-screen{gap:5px;padding-top:2px}.home-living{gap:4px;min-height:209px}.home-heading{height:28px}.home-heading small{display:none}.home-heading h1{font-size:17px}.home-sound{height:30px;width:30px}.home-room{min-height:125px}.home-goal{min-height:45px}.home-shortcuts{height:44px}.home-studio{padding-top:4px;padding-bottom:3px}.home-play{min-height:49px}.home-studio-heading{margin-bottom:3px}}
@media(max-height:570px) and (orientation:portrait){.home-living{min-height:170px}.home-heading{height:24px}.home-room{min-height:91px}.home-goal{min-height:42px}.home-decor-art{height:34px}.home-studio-heading{margin-bottom:1px}.home-studio h2{font-size:10px}.home-categories button{min-height:30px}.home-collection{min-height:106px}.home-shortcuts{height:42px}.home-play{min-height:47px}.home-goal strong{font-size:11px}}
@media(orientation:landscape) and (max-height:600px) and (min-width:520px){.game-shell[data-screen="home"]{max-width:900px;height:var(--app-height);padding-bottom:8px}#home-screen{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr) 55px;gap:8px 12px;padding:1px 8px 0}.home-living{grid-column:1;grid-row:1/3;min-height:0;gap:5px}.home-heading{height:26px}.home-heading small{display:none}.home-heading h1{font-size:18px}.home-sound{width:30px;height:30px}.home-room{min-height:75px}.home-goal{min-height:44px}.home-shortcuts{height:45px}.home-studio{grid-column:2;grid-row:1;display:flex;flex-direction:column;min-height:0;padding:8px}.home-studio-heading{height:35px;flex-shrink:0}.home-collection{flex:1;align-items:center;padding-bottom:3px}.home-decor-card{flex-basis:112px;min-height:162px}.home-decor-art{height:73px}.home-decor-preview strong{font-size:9px}.home-decor-preview small{font-size:8px;line-height:12px}.home-decor-apply{min-height:42px}.home-play{grid-column:2;grid-row:2;min-height:0;height:51px}.home-memory-empty{min-width:260px}.home-preview-tag button{min-height:30px;height:30px;width:30px}}
/* A separate home has enough space for comfortable tap targets. */
.home-heading{min-height:44px}.home-sound{min-width:44px;min-height:44px}
.home-categories button{min-height:44px}.home-decor-apply{min-height:44px}
.home-preview-tag button{min-width:44px;min-height:44px}
.home-categories button{min-width:44px}

.treasure-summary{scroll-snap-align:start;flex:0 0 130px;display:flex;flex-direction:column;justify-content:center;gap:7px;padding:12px;border:1px solid #c2cba9;border-radius:14px;background:#eaf0d7;color:#52643e;font-size:11px}.treasure-summary strong{font-size:14px}.treasure-summary small{color:#746449}
.treasure-card{align-items:center;justify-content:center;text-align:center;gap:5px}.treasure-icon{font-size:34px;line-height:1.3}.treasure-card strong{font-size:12px;line-height:1.4;color:#5f5139}.treasure-card small{font-size:10px;color:#7b6b51}.treasure-card b{font-size:10px;color:#55723b}
.collection-card{justify-content:flex-start;gap:4px;min-height:172px;flex-basis:118px;padding:7px 4px}.collection-card .treasure-icon{display:block;width:76px;height:76px}.collection-card .treasure-icon svg{width:100%;height:100%;display:block}.collection-card strong{font-size:11px;white-space:nowrap}.collection-card b{font-size:9px;white-space:nowrap}.collection-card.unowned .treasure-icon{filter:grayscale(.8);opacity:.4}.collection-card.unowned b{color:#94866e}.collection-progress{display:flex;align-items:center;gap:4px;width:100%;margin-top:auto;padding:0 4px}.collection-progress progress{width:100%;min-width:0;height:6px;accent-color:#829d5d}.collection-progress small{font-size:8px;white-space:nowrap}.collection-summary{font-size:10px;gap:6px;padding:9px;flex-basis:131px}.collection-summary small{font-size:9px}
.treasure-card strong{word-break:keep-all}.collection-card .treasure-icon{flex-shrink:0}.collection-progress progress{appearance:none;border:0;border-radius:4px;overflow:hidden;background:#d4dbbb}.collection-progress progress::-webkit-progress-bar{background:#d4dbbb}.collection-progress progress::-webkit-progress-value{background:#829d5d;border-radius:4px}.collection-progress progress::-moz-progress-bar{background:#829d5d;border-radius:4px}
.collection-order-progress{display:grid;gap:4px;width:100%;margin-top:auto}.collection-order-progress progress{width:100%;height:6px;accent-color:#829d5d}.collection-order-progress small{font-size:9px;white-space:nowrap}.collection-set-card{flex-basis:205px;min-height:172px;padding:8px;gap:5px;justify-content:center}.collection-set-card>strong{font-size:13px}.collection-set-card>b{font-size:11px;color:#617948}.collection-set-card>small{font-size:9px}.collection-set-items{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;width:100%;margin:2px 0}.collection-set-items>span{display:flex;flex-direction:column;align-items:center;min-width:0;gap:2px}.collection-set-items i{display:block;width:48px;height:48px}.collection-set-items svg{display:block;width:100%;height:100%}.collection-set-items small{font-size:9px;line-height:12px;white-space:nowrap}.collection-set-items b{font-size:8px;font-weight:400;color:#7d765f}.collection-set-items .missing i{filter:grayscale(.8);opacity:.4}.collection-set-card.owned{background:#eaf0d9;border-color:#a7b787}.collection-set-card.unowned>b{color:#97886c}
/* Every tab reserves the same collection space, including the scrollbar. */
.collection-set-items b.lowest-level{font-weight:800;color:#5e7044;}
.home-collection{height:186px;min-height:186px;max-height:186px;align-items:flex-start}
.home-collection>.home-decor-card,.home-collection>.treasure-summary,.home-collection>.home-memory-empty{height:172px;min-height:172px;max-height:172px}
.keepsake-card{flex-basis:118px;padding:7px 4px;gap:4px;justify-content:flex-start}
.keepsake-card .treasure-icon{display:block;flex:0 0 76px;width:76px;height:76px}
.keepsake-card .treasure-icon svg{display:block;width:100%;height:100%}
.keepsake-card strong{display:flex;align-items:center;justify-content:center;min-height:28px;font-size:11px;line-height:14px}
.keepsake-card small{font-size:9px;line-height:13px}
.keepsake-card b{margin-top:auto;font-size:9px;line-height:13px;white-space:nowrap}
.home-categories button{white-space:nowrap}
.collection-overview{flex-basis:100%;padding:12px;background:#eaf0d7;border-color:#c2cba9;color:#52643e;gap:8px;justify-content:flex-start}
.collection-overview>strong{font-size:13px}
.collection-overview dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 14px;margin:0;width:100%}
.collection-overview dl>div{min-width:0;padding:4px 0}
.collection-overview dt{font-size:10px;line-height:16px;color:#778362}
.collection-overview dd{margin:2px 0 0;font-size:19px;line-height:24px;font-weight:800;font-variant-numeric:tabular-nums}
@media(max-width:899px){.collection-overview{padding:8px;gap:4px}.collection-overview dl{gap:3px 14px}.collection-overview dl>div{padding:1px 0}.collection-overview dt{font-size:9px;line-height:13px}.collection-overview dd{margin-top:1px;font-size:16px;line-height:19px}}
/* Menu mastery tab: two foods of the set overlap like a plated pair. */
.mastery-card .mastery-art{position:relative;display:block;width:76px;height:76px}
.mastery-card .mastery-art>svg{position:absolute;width:54px;height:54px;left:2px;top:4px}
.mastery-card .mastery-art>svg+svg{width:44px;height:44px;left:30px;top:30px}
.mastery-card strong{max-width:100%;overflow:hidden;text-overflow:ellipsis}
.mastery-stars{font-size:12px!important;line-height:14px;letter-spacing:1px;color:#c49a3f!important}
.mastery-card.mastered{background:#f3ead0;border-color:#cfae6b}
.mastery-card.mastered .collection-progress small{color:#a8843d;font-weight:800}
.mastery-summary span{white-space:nowrap}
.mastery-more{flex-basis:150px;align-items:center;justify-content:center;text-align:center;gap:8px;padding:10px}
.mastery-more strong{font-size:12px;color:#7a5f3d}
.mastery-more button{min-height:44px;padding:6px 10px;background:#dce6c4;border:1px solid #aebd8e;border-radius:12px;color:#6e844b;font-size:10px;font-weight:800}
/* Five tabs: on very narrow phones the row scrolls instead of clipping the last tab. */
.home-studio-heading>h2{flex-shrink:0}
.home-categories{min-width:0;overflow-x:auto;scrollbar-width:none}
.home-categories::-webkit-scrollbar{display:none}
.home-categories button{flex-shrink:0}
.home-categories{gap:2px}.home-categories button{padding-left:5px;padding-right:5px}

/* Paid collection research fits the existing collection shelf. */
.game-shell[data-screen="home"] .collection-card.research-card{flex-basis:142px;padding:5px;gap:2px}
.research-card .treasure-icon{width:44px;height:44px}
.research-card>strong{line-height:14px}.research-card>small{font-size:9px;line-height:11px}
.research-card>b{line-height:12px}.research-card .collection-progress{margin-top:0;padding:0 2px}
.collection-research-button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:100%;min-height:44px;margin-top:auto;padding:3px;border:1px solid #b1bd8f;border-radius:9px;background:linear-gradient(#e8edce,#d6e1b8);color:#58743d;font-size:11px;font-weight:800}
.collection-research-button small{font-size:9px;color:#7c704b;line-height:11px}.collection-research-button:disabled{background:#ece2c9;border-color:#cfb57f;color:#9b7b41;opacity:.8}
.collection-research-effects{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0}
.collection-research-effects section{display:flex;flex-direction:column;gap:7px;min-width:0;padding:12px 10px;border:1px solid #d9c6a1;border-radius:13px;background:#f3ead6}
.collection-research-effects section+section{background:#e8efd6;border-color:#b6c797}
.collection-research-effects small{color:#907957;font-size:11px}.collection-research-effects span{color:#55703d;font-size:12px;font-weight:700;line-height:1.5;word-break:keep-all}
.collection-research-cost{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:16px 0;color:#93713f;font-size:17px}
.collection-research-cost small{font-size:11px;color:#907e60}.collection-research-shortage{font-size:12px;color:#a2644c}
