/* One quiet, leafy visual language for the living world and its controls. */
.app-shell {
  --game-ink: #304b40;
  --game-muted: #6b7b6c;
  --game-surface: #fffcf1;
  --game-primary: #407b60;
  --game-primary-deep: #2d5846;
  --game-line: #d8decb;
  --game-shadow-button: 0 3px 0 #294f3e;
  --game-shadow-panel: 0 14px 38px #293e3821;
  color: var(--game-ink);
}
body.grove-visiting { overflow: hidden; }
.app-shell .topbar { height: 70px; min-height: 70px; background: #fffdf3; border-bottom: 1px solid #cdd8c5; box-shadow: 0 3px 14px #304b4010; }
.app-shell .logo-button { color: #355946; text-shadow: none; font-size: 27px; letter-spacing: -.045em; }
.app-shell .logo-button::after { display: none; }
.app-shell .mini-pill, .app-shell .avatar-pill { min-height: 44px; height: 44px; border: 1px solid #c5d0bb; border-radius: 14px; box-shadow: 0 2px 0 #d6deca; background: #fffef8; }
.app-shell .avatar-pill { width: 44px; min-width: 44px; background: #e7eed7; color: #365840; }
.app-shell .mini-pill-copy b { color: #35533e; }
.app-shell .mini-pill-copy small { color: #788475; }
.app-shell .main-nav { top: 80px; min-height: 60px; width: min(700px, calc(100vw - 24px)); background: #fffdf3; border: 1px solid #bdcdb5; border-radius: 19px; box-shadow: 0 4px 0 #ced8bf, 0 8px 20px #314c3e12; }
.app-shell .nav-button { min-height: 46px; color: #6a7a65; border-radius: 13px; font-weight: 800; }
.app-shell .nav-button.active { background: #477b5f; color: #fffdf0; box-shadow: 0 2px 0 #2c5642; }
.app-shell .nav-button:hover:not(.active) { color: #345b45; background: #edf2df; }
.app-shell .button { border-color: #46634c; border-width: 1px; border-radius: 13px; box-shadow: 0 3px 0 #c5d0b8; font-weight: 800; }
.app-shell .button-primary, .app-shell .button-blue { background: #44775b; color: #fffdf3; box-shadow: 0 3px 0 #2a503b; }
.app-shell .button-pink { background: #b76f68; }
.app-shell .button-yellow { background: #f2d88c; color: #665331; }
.app-shell .button-quiet { background: #fffdf3; color: #4e6854; }
.app-shell .button:hover { box-shadow: 0 4px 0 #c5d0b8; transform: translateY(-1px); }
.app-shell .button-primary:hover { background: #38674e; box-shadow: 0 4px 0 #284a37; }
.app-shell :is(.panel-card,.room-sidebar-panel,.world-supplies,.character-sheet,.room-inventory-drawer,.room-item-editor,.account-menu) { border-color: #c4cfb8; border-width: 1px; background: #fffdf3f5; box-shadow: 0 4px 0 #d3dcc3, 0 12px 28px #30452f12; }
.app-shell .room-sidebar { top: 158px; width: 242px; }
.app-shell .room-sidebar-toggle { background: #f0f3e6; color: #426149; font-size: 13px; min-height: 44px; }
.app-shell .room-sidebar-toggle b { background: #dce9cf; color: #537249; }
.app-shell .world-supplies { top: 158px; width: 192px; border-radius: 19px; }
.app-shell .supply-tool { background: #fffef8; border-color: #e1e5d4; min-height: 62px; }
.app-shell .world-supplies-label { color: #687e60; font-size: 10px; letter-spacing: .09em; }
.app-shell .shelf-pet.active { background: #eaf1d9; border-color: #98b082; }
.app-shell :is(.section-heading h1,.character-sheet h2,.owned-chumkin-copy h2,.settings-switch-row strong) { color: #35553e; }
.app-shell :is(.room-settings,.collection-empty,.chumkins-tab-intro,.owned-chumkin-row,.inventory-page-toolbar) { border-color: #d0d9c0; }
.app-shell .view:not(#home-view) { position: relative; z-index: 4; }
.app-shell .boombox, .world-active .app-shell .boombox { background: #e3cd9e; border: 2px solid #887452; border-radius: 22px; box-shadow: 0 6px 0 #a98d65, 0 16px 24px #40523b20; }
.app-shell .boombox-handle { border-color: #836f50; }
.app-shell .boombox-screen { background: #365d50; color: #e3edba; border-color: #2c4b40; }
.app-shell .boombox button { color: #49664b; background: #fff4d4; border-color: #af9873; }
.app-shell .boombox-speaker { background: #ad9470; border-color: #826b4e; }
.app-shell .boombox-speaker i { background: repeating-radial-gradient(circle, #514c39 0 2px, #7c7856 3px 5px); }

/* Both halves move together; the offscreen pets keep their authoritative lease. */
#grove-scene { position: fixed; inset: 0; z-index: 0; }
.app-shell #home-view { background: transparent !important; transition: transform 900ms cubic-bezier(.45,0,.15,1); transform: translateX(0); }
.app-shell[data-grove-location="market"] #home-view { transform: translateX(-100%); pointer-events: none; }
.app-shell #home-view::before,
.app-shell #home-view::after { display: none; }
.grove-sky .room-stars { inset: 0; z-index: 1; }
.app-shell .grass-foreground { opacity: .6; }
html[data-room-phase="night"] .grove-scene :is(.grove-landscape, .grove-tree, .grove-home-details, .grove-undergrowth, .grove-building-art) { filter: brightness(.48) saturate(.72); }
html[data-room-phase="night"] .grove-village-heading :is(h2,p,span) { color: #f2f0d5; text-shadow: 0 2px 12px #162f2b; }
html[data-room-phase="dusk"] .grove-scene :is(.grove-landscape, .grove-tree, .grove-home-details, .grove-undergrowth, .grove-building-art) { filter: sepia(.13) brightness(.84); }
html[data-desktop="companion"] #grove-scene,
html[data-android-overlay="true"] #grove-scene { display: none !important; }
html[data-desktop="companion"] .app-shell #home-view,
html[data-android-overlay="true"] .app-shell #home-view { transform: none; }

/* Shop interiors stay part of the village, framed like a warm wooden counter. */
.app-shell .view#shop-view, .app-shell .view#hatch-view {
  position: fixed; z-index: 15; top: 160px; bottom: 28px; left: 50%;
  width: min(1080px, calc(100vw - 64px)); margin: 0; padding: 0;
  transform: translateX(-50%); overflow-y: auto; overscroll-behavior: contain;
  background: #fffdf4; border: 2px solid #8c9c73; border-radius: 26px;
  box-shadow: 0 6px 0 #798b5a, 0 24px 80px #24422b38;
  scrollbar-color: #bac9a3 transparent; scrollbar-width: thin;
}
.app-shell .view#shop-view .shop-heading {
  position: sticky; top: 0; z-index: 4; min-height: 90px; width: 100%; max-width: none; margin: 0; padding: 20px 27px;
  background: #f6f4e5; border-bottom: 1px solid #dcdcc5; align-items: center; flex-direction: row;
}
.grove-shop-title { display: flex; align-items: center; gap: 13px; }
.grove-shop-title > div { display: grid; gap: 5px; }
.grove-eyebrow { color: #8a916b; font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.app-shell .shop-heading h1 { font-size: 29px; line-height: 1; letter-spacing: -.04em; color: #3c593d; }
.grove-back, .grove-close { display: grid; width: 44px; height: 44px; padding: 0; place-items: center; border: 1px solid #ccd1b6; border-radius: 14px; background: #fffdf2; color: #607450; cursor: pointer; font-size: 23px; }
.grove-back:hover, .grove-close:hover { background: #e5edd7; }
.app-shell .shop-heading-meta { display: flex; align-items: center; gap: 12px; }
.app-shell .shop-currency-note { padding: 10px 14px; color: #786331; background: #f5e9bb; border: 1px solid #e5d49e; font-size: 13px; }
.app-shell .demo-badge { font-size: 9px; padding: 5px; background: #718664; border: 0; }
.app-shell .shop-screen { width: auto; max-width: none; margin: 0; padding: 24px 28px 28px; }
.app-shell .marketplace-shell { width: auto; max-width: none; margin: 0; }
.grove-shop-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.grove-shop-intro h2 { margin: 0 0 7px; font-size: 21px; letter-spacing: -.04em; color: #3e5943; }
.grove-shop-intro p { margin: 0; font-size: 12px; line-height: 1.6; font-weight: 600; color: #849078; }
.grove-search { display: flex; align-items: center; gap: 9px; width: 270px; min-width: 210px; padding: 0 13px; min-height: 46px; border: 1px solid #dce0cb; border-radius: 14px; background: #f6f7ec; }
.grove-search svg { flex: 0 0 18px; width: 18px; fill: none; stroke: #8a997a; stroke-width: 2; stroke-linecap: round; }
.grove-search input { width: 100%; min-width: 0; min-height: 44px; border: 0; outline-offset: 1px; background: none; color: #476047; font-size: 12px; }
.grove-search:focus-within { border-color: #739168; box-shadow: 0 0 0 2px #73916820; }
.app-shell .market-category-tabs { display: flex; gap: 8px; margin: 0; padding: 0 0 14px; overflow-x: auto; }
.app-shell .market-category-tabs button { min-width: auto; width: auto; min-height: 44px; padding: 10px 16px; border: 1px solid #d8dec9; border-radius: 12px; color: #7a896e; background: #fafaf0; box-shadow: none; font-size: 12px; font-weight: 800; white-space: nowrap; }
.app-shell .market-category-tabs button.active { color: #f8fbec; background: #607e4e; border-color: #607e4e; }
.app-shell .market-shelf-head { margin: 2px 0 14px; padding-top: 0; display: flex; align-items: center; justify-content: space-between; color: #8b967a; font-size: 11px; font-weight: 650; }
.app-shell .market-item-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.app-shell .market-item-card { min-height: 236px; padding: 0; border: 1px solid #d9dfc9; border-radius: 17px; background: #fffef8; box-shadow: 0 3px 0 #e2e7d5; overflow: hidden; transition: transform 150ms, box-shadow 150ms; }
.app-shell .market-item-card:hover { transform: translateY(-3px); border-color: #93ac7c; box-shadow: 0 5px 0 #d9e3c8, 0 8px 18px #59764916; }
.app-shell .market-item-thumb { position: relative; display: grid; min-height: 126px; place-items: center; background: #edf2de; border-bottom: 1px solid #e5e8d8; }
.app-shell .market-item-card:nth-child(4n+2) .market-item-thumb { background: #f5edda; }
.app-shell .market-item-card:nth-child(4n+3) .market-item-thumb { background: #e9f0e5; }
.app-shell .market-item-card:nth-child(4n) .market-item-thumb { background: #f4e9df; }
.app-shell .market-item-thumb::before { background: #fffcf0a0; width: 88px; height: 88px; }
.app-shell .market-card-art { transform: scale(1.5); }
.app-shell .market-item-copy { display: grid; padding: 13px 14px 15px; gap: 6px; text-align: left; }
.app-shell .market-item-copy strong { color: #43613f; font-size: 14px; line-height: 1.2; }
.market-item-description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #8a917b; font-size: 10px; font-weight: 550; line-height: 1.5; min-height: 30px; }
.market-item-colours { display: flex; align-items: center; min-height: 17px; gap: 3px; }
.market-item-colours i { width: 9px; height: 9px; border: 1px solid #0001; border-radius: 50%; background: var(--swatch); }
.market-item-colours small { margin-left: 3px; color: #969d87; font-size: 9px; font-weight: 650; }
.app-shell .market-item-price { justify-self: start; padding: 4px 8px; border-radius: 7px; color: #8f7540; background: #faf0d2; font-size: 11px; }
.app-shell .market-detail { border-color: #afbf97; background: #fffdf4; }
.app-shell .market-detail-preview { background: #ebf0dc; }
.app-shell .market-detail-copy { background: #fffdf4; }
.app-shell .market-detail h2 { color: #36573f; }
.app-shell .market-detail-close { color: #4f6547; background: #f4f3e5; border-color: #c6d1b7; }
.app-shell .market-variant-choice.active { border-color: #718d5a; background: #edf2e0; }
.app-shell .market-trait-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
.app-shell .market-trait-stats b { color: #58734d; font-size: 12px; }
.app-shell .market-detail-buy { background: #fffdf4; }
.app-shell .market-detail-buy strong { color: #8c743d; }
.grove-market-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 22px 0 10px; padding: 14px 0; border-top: 1px solid #e1e4d4; color: #88927b; font-size: 11px; }
.grove-text-button { min-height: 44px; border: 0; padding: 8px 0; color: #557b48; background: none; cursor: pointer; font-size: 12px; font-weight: 800; }
.app-shell .marketplace-coin-tools { background: #f3f5e9; border-color: #dce3ce; border-radius: 14px; }
.app-shell .marketplace-coin-tools summary { min-height: 44px; color: #627750; }
.app-shell .marketplace-coin-tools input { min-height: 44px; }
.grove-egg-welcome { display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; gap: 24px; padding: 24px 32px 34px; border: 1px solid #e5ddbd; border-radius: 22px; background: #faf3de; }
.grove-egg-display { display: flex; align-items: center; justify-content: center; min-height: 220px; }
.grove-egg-display .hatchery-egg { width: 88px; flex-shrink: 0; }
.grove-egg-display .hatchery-egg:first-child { transform: rotate(-10deg) translateX(12px); }
.grove-egg-display .hatchery-egg:nth-child(2) { z-index: 1; transform: translateY(-18px) scale(1.15); }
.grove-egg-display .hatchery-egg:last-child { transform: rotate(10deg) translateX(-12px); }
.grove-egg-welcome h2 { margin: 10px 0; color: #6e6546; font-size: clamp(27px,3vw,40px); line-height: 1.07; letter-spacing: -.045em; }
.grove-egg-welcome p { margin: 0 0 18px; max-width: 320px; color: #8e8b71; font-size: 13px; line-height: 1.6; }
.grove-egg-welcome .button { display: block; margin: 12px 0; }
.grove-egg-welcome small { display: block; color: #93937b; font-size: 10px; }
.grove-free-eggs { color: #6e8859; font-size: 13px; }
.grove-egg-price { color: #93804c; font-size: 16px; }
.grove-shop-section { margin-top: 28px; }
.grove-care-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 14px; }
.grove-care-card { display: grid; align-items: center; grid-template-columns: 50px 1fr; gap: 14px; padding: 21px; border: 1px solid #dce2cc; border-radius: 18px; background: #f7f7eb; }
.grove-care-card .envelope-art { width: 48px; height: 34px; border-width: 2px; }
.grove-care-card h3 { margin: 0 0 7px; font-size: 16px; color: #5b724e; }
.grove-care-card p { margin: 0 0 8px; color: #8a937b; font-size: 11px; line-height: 1.5; }
.grove-care-card strong { color: #917d44; font-size: 12px; }
.grove-care-card > .button, .grove-care-card > .shop-price-options, .grove-care-card > .shop-coverage { grid-column: 1 / -1; }
.grove-nanny-mark { color: #7c976c; font-size: 45px; }
.app-shell .grove-care-card .shop-price-option { background: #fffdf2; border-color: #d6dec3; }
.app-shell .grove-care-card .shop-price-option strong { font-size: 19px; }
.grove-token-counter { margin-top: 18px; padding: 0 18px; border: 1px solid #dce2cc; border-radius: 16px; background: #fcfcf2; }
.grove-token-counter summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 76px; cursor: pointer; font-size: 15px; color: #5d7350; }
.grove-token-counter summary small { display: block; margin-top: 5px; color: #97a083; font-size: 11px; font-weight: 500; }
.grove-token-counter summary > span:last-child { font-size: 12px; color: #8a906f; }
.grove-token-counter .shop-pack-grid { padding-bottom: 15px; }
.grove-price-note { color: #90967d; font-size: 11px; text-align: center; }
.app-shell .shop-pack, .app-shell .shop-mega-card { border-color: #dddcc0; box-shadow: none; background: #f7f2df; }
.app-shell .shop-pack-amount strong, .app-shell .shop-mega-copy h3 { color: #796d44; }
.app-shell .view#hatch-view { padding: 22px; }
.app-shell .view#hatch-view .section-heading { margin: 0 0 18px; }
.app-shell .hatchery-main-card { background: #faf3de; border-color: #e2d8b8; }

@media (max-width: 800px) {
  .app-shell .topbar { height: 62px; min-height: 62px; padding: 8px 12px; }
  .app-shell .main-nav { top: 71px; width: calc(100vw - 16px); }
  .app-shell .logo-button { font-size: 22px; }
  .app-shell .mini-pill { min-width: 50px; padding-inline: 8px; }
  .app-shell .room-sidebar { top: 145px; width: min(224px,calc(100vw - 30px)); }
  .app-shell .world-supplies { top: 145px; width: 170px; }
  .app-shell .view#shop-view, .app-shell .view#hatch-view { top: 144px; bottom: max(12px,env(safe-area-inset-bottom)); width: calc(100vw - 24px); padding: 0; border-radius: 20px; }
  .app-shell .view#shop-view .shop-heading { min-height: 78px; padding: 14px 16px; }
  .app-shell .shop-heading h1 { font-size: 24px; }
  .grove-shop-title { gap: 9px; }
  .grove-back { display: none; }
  .app-shell .shop-heading-meta { gap: 6px; }
  .app-shell .shop-currency-note { padding: 8px 10px; font-size: 11px; }
  .app-shell .shop-screen { padding: 18px; }
  .grove-shop-intro { align-items: stretch; flex-direction: column; gap: 14px; margin-bottom: 16px; }
  .grove-shop-intro h2 { font-size: 20px; }
  .grove-search { width: 100%; }
  .grove-search input { font-size: 16px; }
  .app-shell .market-category-tabs { display: flex; gap: 6px; }
  .app-shell .market-category-tabs button { padding-inline: 13px; }
  .app-shell .market-item-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }
  .app-shell .market-item-thumb { min-height: 105px; }
  .app-shell .market-item-card { min-height: 215px; }
  .grove-care-grid { grid-template-columns: 1fr; }
  .grove-egg-welcome { padding: 20px; gap: 10px; }
  .grove-egg-display .hatchery-egg { width: 65px; }
  .app-shell .view#hatch-view { padding: 16px; }
}
@media (max-width: 520px) {
  .app-shell .market-item-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .app-shell .market-item-copy { padding: 11px; }
  .app-shell .market-item-copy strong { font-size: 13px; }
  .app-shell .market-card-art { transform: scale(1.35); }
  .grove-egg-welcome { grid-template-columns: 1fr; text-align: center; }
  .grove-egg-display { min-height: 180px; }
  .grove-egg-welcome h2 br { display: none; }
  .grove-egg-welcome .button { margin-inline: auto; }
  .grove-egg-welcome p { margin-inline: auto; }
  .grove-market-footer { align-items: start; flex-direction: column; gap: 0; }
  .app-shell .market-detail-preview { min-height: 160px; }
  .app-shell .market-trait-stats b { font-size: 11px; }
  .app-shell .demo-badge { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .app-shell #home-view { transition: none; }
  .app-shell .market-item-card { transition: none; }
  .grove-egg-display .hatchery-egg { animation: none; }
  .grove-village-heading,
  .grove-village-heading > * { transition: none; }
}

/* The egg building replaces the separate hatch destination in primary navigation. */
.app-shell .main-nav .hatch-nav-button { display: none !important; }
body.welcome-eggs-ready .app-shell .main-nav .nav-button[data-view="shop"] { display: grid; }
.app-shell .main-nav .nav-button { min-width: 0; }
@media (max-width: 520px) {
  .app-shell .main-nav .nav-button { font-size: 10px; padding-inline: 2px; }
  .grove-return { top: 150px; }
}
.app-shell .grove-market-interior, .app-shell .grove-egg-interior { display: block; }
.app-shell .grove-market-interior .market-shelf-head { margin: 2px 0 14px; }
.app-shell .marketplace-section-title h2 { color: #526b45; font-size: 21px; }
.app-shell .marketplace-section-title { margin-bottom: 16px; }
.app-shell .grove-search input { padding: 0; box-shadow: none; }
.app-shell .grove-search input:focus-visible { outline: none; }
.toast { color: #fffdf2; background: #395b44; border-color: #6c8556; border-radius: 15px; box-shadow: 0 8px 25px #29472f26; }
.grove-owned-note { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; padding: 7px 12px; border: 1px solid #d3dfbd; border-radius: 12px; background: #f0f5e1; color: #657d4f; font-size: 12px; }

@media (max-width: 700px) and (max-height: 630px) { .grove-village-heading { top: 212px; } }
@media (min-width: 701px) and (max-height: 520px) {
  .grove-village-heading { display: none; }
  .grove-buildings { bottom: 10px; }
  .grove-building-art { max-height: calc(100dvh - 235px); }
  .grove-building-caption { padding-block: 5px; }
  .grove-building-caption > span { display: none; }
  .grove-return { top: 154px; left: 12px; }
}
/* Prevent intrinsic grid sizing from widening the counter on narrow screens. */
.app-shell .shop-screen { display: block; min-width: 0; }
.app-shell .marketplace-shell, .grove-shop-intro > div, .grove-search { min-width: 0; }
.app-shell .market-item-grid, .app-shell .market-item-card { min-width: 0; }
