:root {
    --farm-ink: #214b39;
    --farm-muted: #668374;
    --farm-green: #27a95f;
    --farm-green-dark: #147644;
    --farm-lime: #9edb39;
    --farm-yellow: #ffc93f;
    --farm-orange: #f7932f;
    --farm-sky: #8be0ec;
    --farm-card: rgba(255, 255, 255, 0.94);
    --farm-shadow: 0 10px 24px rgba(32, 97, 67, 0.16);
}

body.ui-v3.farm-game-home,
body.farm-game-home,
body.farm-game-home.dark {
    min-width: 0;
    overflow-x: hidden;
    padding-bottom: 0;
    background: #e8f7e1;
    color: var(--farm-ink);
    color-scheme: light;
}

.farm-game-home *,
.farm-game-home *::before,
.farm-game-home *::after {
    box-sizing: border-box;
}

.farm-game-home a {
    color: inherit;
    text-decoration: none;
}

.farm-game-home button,
.farm-game-home a {
    -webkit-tap-highlight-color: transparent;
}

.farm-game-home button:focus-visible,
.farm-game-home a:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.92);
    outline-offset: 3px;
}

.farm-shell {
    position: relative;
    width: min(100%, 480px);
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    overflow: hidden;
    background: #15904e;
}

.farm-hero {
    position: relative;
    min-height: 780px;
    padding: max(14px, env(safe-area-inset-top)) 14px 18px;
    overflow: hidden;
    isolation: isolate;
    background: #15904e url('../images/farm/orchard-world-bg-v3.webp') center top / cover no-repeat;
}

.farm-hero::before,
.farm-hero::after {
    position: absolute;
    z-index: -1;
    content: "";
    pointer-events: none;
}

.farm-game-home .farm-hero::before,
.farm-game-home .farm-hero::after,
.farm-game-home .farm-sky-decor {
    display: none;
}

.farm-hero::before {
    left: -15%;
    right: -15%;
    top: 40%;
    height: 160px;
    border-radius: 50% 50% 0 0 / 55% 55% 0 0;
    background: #70cf72;
    transform: rotate(-2deg);
}

.farm-hero::after {
    left: -20%;
    right: -20%;
    top: 46%;
    bottom: 0;
    border-radius: 50% 50% 0 0 / 18% 18% 0 0;
    background:
        radial-gradient(ellipse at 10% 80%, rgba(255, 255, 255, 0.18) 0 3px, transparent 4px),
        radial-gradient(ellipse at 70% 24%, rgba(255, 236, 125, 0.4) 0 3px, transparent 4px),
        linear-gradient(180deg, #48be61, #15904e);
}

.farm-sky-decor,
.farm-sky-decor span {
    position: absolute;
    pointer-events: none;
}

.farm-sky-decor {
    inset: 0;
    z-index: -1;
}

.farm-sun {
    top: 82px;
    right: 35px;
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background: rgba(255, 236, 124, 0.9);
    box-shadow: 0 0 0 13px rgba(255, 242, 148, 0.19);
}

.farm-cloud {
    width: 82px;
    height: 24px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    animation: farmCloudDrift 18s ease-in-out infinite alternate;
    will-change: transform;
}

.farm-cloud::before,
.farm-cloud::after {
    position: absolute;
    bottom: 7px;
    border-radius: 50%;
    background: inherit;
    content: "";
}

.farm-cloud::before {
    left: 15px;
    width: 34px;
    height: 34px;
}

.farm-cloud::after {
    right: 13px;
    width: 25px;
    height: 25px;
}

.farm-cloud-one {
    top: 150px;
    left: -28px;
}

.farm-cloud-two {
    top: 222px;
    right: -42px;
    opacity: 0.65;
    animation-duration: 23s;
}

.farm-spark {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.84);
    animation: farmSpark 2.8s ease-in-out infinite;
}

.farm-spark-one { top: 248px; left: 25%; }
.farm-spark-two { top: 310px; right: 20%; animation-delay: 1.2s; }

.farm-butterfly {
    z-index: 2;
    color: #fff06f;
    font-size: 13px;
    line-height: 1;
    text-shadow: 7px 0 #ff8e54;
    animation: farmButterfly 5.4s ease-in-out infinite;
    will-change: transform;
}

.farm-butterfly-one { top: 352px; left: 24%; }
.farm-butterfly-two { top: 438px; right: 24%; animation-delay: 1.8s; }

.farm-player-bar {
    position: relative;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
}

.farm-player {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
}

.farm-avatar {
    display: grid;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    place-items: center;
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    background: linear-gradient(145deg, #fff9d7, #d2f49c);
    box-shadow: 0 5px 12px rgba(37, 101, 71, 0.2);
}

.farm-avatar img {
    width: 34px;
    height: 34px;
}

.farm-player-copy {
    display: grid;
    min-width: 0;
    color: #184e4d;
}

.farm-player-copy small {
    font-size: 10px;
    font-weight: 700;
    opacity: 0.78;
}

.farm-player-copy strong {
    max-width: 150px;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.18;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.farm-player-copy span {
    width: max-content;
    margin-top: 2px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.62);
    font-size: 9px;
    font-weight: 800;
}

.farm-header-actions {
    display: none;
    gap: 8px;
}

.farm-round-link {
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 6px 14px rgba(36, 97, 83, 0.14);
    color: #197556;
}

.farm-round-link svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.farm-wallet {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 9px;
    min-height: 62px;
    margin-top: 10px;
    padding: 8px 10px 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--farm-shadow);
    backdrop-filter: blur(7px);
}

.farm-wallet > a:not(.farm-wallet-add),
.farm-wallet > div {
    display: grid;
    min-width: 0;
}

.farm-wallet span {
    color: var(--farm-muted);
    font-size: 10px;
    font-weight: 700;
}

.farm-wallet strong {
    overflow: hidden;
    color: var(--farm-ink);
    font-size: clamp(13px, 4vw, 17px);
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.farm-wallet-divider {
    width: 1px;
    height: 30px;
    background: rgba(33, 75, 57, 0.13);
}

.farm-wallet-add,
.farm-login-link {
    display: grid;
    min-width: 34px;
    min-height: 34px;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--farm-yellow), var(--farm-orange));
    box-shadow: 0 5px 10px rgba(221, 125, 25, 0.24);
    color: #71430d !important;
    font-size: 23px;
    font-weight: 900;
}

.farm-wallet.is-guest {
    grid-template-columns: minmax(0, 1fr) auto;
}

.farm-wallet.is-guest .farm-login-link {
    min-width: 78px;
    padding: 0 14px;
    font-size: 12px;
}

.farm-title-block {
    position: relative;
    z-index: 3;
    margin-top: 12px;
    text-align: center;
    color: #15584c;
    text-shadow: 0 1px rgba(255, 255, 255, 0.65);
}

.farm-title-block span {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.farm-title-block h1 {
    margin: 3px 0 0;
    color: #135745;
    font-size: clamp(24px, 7vw, 31px);
    font-weight: 950;
    letter-spacing: -0.04em;
}

.farm-stage {
    position: relative;
    z-index: 2;
    height: 528px;
    margin-top: -4px;
}

.farm-tree-wrap {
    position: absolute;
    z-index: 1;
    left: 50%;
    bottom: 170px;
    width: min(76vw, 340px);
    aspect-ratio: 1;
    transform: translateX(-50%);
    transform-origin: 50% 92%;
    pointer-events: none;
}

.farm-tree-wrap * { pointer-events: none; }

.farm-tree-wrap img {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 14px 12px rgba(23, 83, 42, 0.2));
    transform-origin: 50% 92%;
    animation: farmTreeBreathe 5.2s ease-in-out infinite;
    will-change: transform;
}

.farm-tree-halo {
    position: absolute;
    z-index: 0;
    left: 50%;
    bottom: 4%;
    width: 88%;
    height: 24%;
    border-radius: 50%;
    background: rgba(9, 102, 48, 0.16);
    transform: translateX(-50%);
}

.farm-side-actions {
    position: absolute;
    z-index: 4;
    top: 34px;
    display: grid;
    gap: 12px;
    width: 60px;
}

.farm-side-left { left: 0; }
.farm-side-right { right: 0; gap: 8px; }

.farm-side-action {
    display: grid;
    min-height: 62px;
    justify-items: center;
    align-content: start;
    gap: 3px;
    color: #174c3c;
    text-align: center;
    border: 0;
    padding: 0;
    background: transparent;
    font: inherit;
}

.farm-side-action > span {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 2px solid rgba(255, 255, 255, 0.88);
    border-radius: 17px;
    background: linear-gradient(145deg, #fff7b2, #ffc44c);
    box-shadow: 0 7px 12px rgba(34, 98, 60, 0.18);
    color: #8b580c;
}

.farm-side-action svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.farm-side-action small {
    max-width: 60px;
    overflow: hidden;
    font-size: 9px;
    font-weight: 900;
    line-height: 1.05;
    text-overflow: ellipsis;
    text-shadow: 0 1px rgba(255, 255, 255, 0.55);
}

.farm-side-action.is-task > span,
.farm-side-action.is-friend > span { background: linear-gradient(145deg, #b8f2ff, #65caec); color: #176b8c; }
.farm-side-action.is-news > span,
.farm-side-action.is-post > span { background: linear-gradient(145deg, #ffd1de, #ff8fad); color: #a72e56; }
.farm-side-action.is-harvest > span { background: linear-gradient(145deg, #ffd384, #ff9840); color: #8b4314; }
.farm-side-action.is-team > span { background: linear-gradient(145deg, #d8c9ff, #9d84e9); color: #503593; }

.farm-growth-card {
    position: absolute;
    z-index: 5;
    left: 50%;
    bottom: 80px;
    width: min(78%, 310px);
    min-height: 72px;
    padding: 9px 13px 8px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 8px 18px rgba(30, 90, 50, 0.2);
    transform: translateX(-50%);
    backdrop-filter: blur(6px);
}

.farm-growth-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.farm-growth-heading strong { font-size: 12px; }
.farm-growth-heading span { color: var(--farm-green-dark); font-size: 10px; font-weight: 900; }

.farm-progress {
    height: 10px;
    margin-top: 6px;
    overflow: hidden;
    border: 2px solid rgba(20, 118, 68, 0.12);
    border-radius: 999px;
    background: #dcebd7;
}

.farm-progress span {
    display: block;
    width: var(--farm-progress);
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #73c835, #d6e93b);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.58);
}

.farm-growth-card > small {
    display: block;
    margin-top: 4px;
    color: var(--farm-muted);
    font-size: 9px;
    font-weight: 700;
    text-align: center;
}

.farm-primary-actions {
    position: absolute;
    z-index: 6;
    right: 8px;
    bottom: 0;
    left: 8px;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 10px;
}

.farm-action-button {
    display: flex;
    min-height: 62px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: 20px;
    box-shadow: 0 8px 0 rgba(130, 79, 8, 0.19), 0 12px 20px rgba(35, 94, 50, 0.2);
    color: #6a460b;
    cursor: pointer;
    touch-action: manipulation;
}

.farm-action-button:active {
    box-shadow: 0 3px 0 rgba(130, 79, 8, 0.18), 0 7px 14px rgba(35, 94, 50, 0.16);
    transform: translateY(4px);
}

.farm-action-button.is-water { background: linear-gradient(180deg, #9ae9ff, #45bde9); color: #0c6481; }
.farm-action-button.is-fertilize { background: linear-gradient(180deg, #fff06d, #ffb52f); }

.farm-action-button span {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.48);
}

.farm-action-button svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.farm-action-button strong { font-size: 16px; font-weight: 950; }

.farm-demo-note {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 18px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 4px -4px -2px;
    color: var(--farm-muted);
    font-size: 8px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
}

.farm-demo-note span {
    display: grid;
    flex: 0 0 15px;
    width: 15px;
    height: 15px;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-family: Georgia, serif;
    font-weight: 900;
}

.farm-demo-note.is-feedback {
    color: var(--farm-green-dark);
}

.farm-water-drop {
    position: absolute;
    z-index: 5;
    top: 20%;
    width: 13px;
    height: 18px;
    border-radius: 50% 50% 55% 55%;
    background: #6bd7fa;
    opacity: 0;
    transform: rotate(45deg);
}

.farm-drop-one { left: 36%; }
.farm-drop-two { left: 49%; top: 14%; }
.farm-drop-three { right: 31%; top: 23%; }

.farm-tree-wrap.is-watered .farm-water-drop { animation: farmWaterDrop 0.72s ease-in forwards; }
.farm-tree-wrap.is-watered .farm-drop-two { animation-delay: 0.08s; }
.farm-tree-wrap.is-watered .farm-drop-three { animation-delay: 0.16s; }
.farm-tree-wrap.is-watered img { animation: farmTreeWatered 0.72s ease; }
.farm-tree-wrap.is-fertilized img { animation: farmTreeFed 0.72s ease; }
.farm-growth-card.is-pulsing { animation: farmGrowthPulse 0.72s ease; }

.farm-content-section,
.farm-quick-cards,
.farm-carousel {
    position: relative;
    z-index: 2;
    margin: 14px;
}

.farm-content-section {
    margin-top: 18px;
    padding: 17px 14px 14px;
    border: 1px solid rgba(31, 113, 67, 0.09);
    border-radius: 24px;
    background: var(--farm-card);
    box-shadow: var(--farm-shadow);
}

.farm-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 11px;
}

.farm-section-heading > div { display: grid; gap: 1px; }
.farm-section-heading > div > span { color: #66a171; font-size: 9px; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.farm-section-heading h2 { margin: 0; color: var(--farm-ink); font-size: 20px; }
.farm-section-heading > a { display: flex; min-height: 44px; align-items: center; gap: 5px; color: var(--farm-green-dark); font-size: 11px; font-weight: 900; }
.farm-section-heading > a span { font-size: 22px; }

.farm-product-list { display: grid; gap: 9px; }

.farm-product-card {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) 26px;
    min-height: 82px;
    align-items: center;
    gap: 10px;
    padding: 7px 8px 7px 7px;
    border: 1px solid rgba(27, 116, 65, 0.08);
    border-radius: 17px;
    background: #f4faed;
}

.farm-product-media {
    display: block;
    width: 70px;
    height: 68px;
    overflow: hidden;
    border-radius: 14px;
    background: #e6f3d5;
}

.farm-product-media img { width: 100%; height: 100%; object-fit: cover; }
.farm-product-copy { display: grid; min-width: 0; gap: 3px; }
.farm-product-copy strong { overflow: hidden; color: var(--farm-ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.farm-product-copy small { display: -webkit-box; overflow: hidden; color: var(--farm-muted); font-size: 9px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.farm-product-copy > span { color: #3b8b50; font-size: 9px; font-weight: 800; }
.farm-product-copy b { color: #e17e1b; }
.farm-product-go { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; background: #dcedc8; color: #3a8550; font-size: 20px; }

.farm-empty-state {
    display: grid;
    min-height: 130px;
    place-items: center;
    align-content: center;
    color: var(--farm-muted);
}
.farm-empty-state span { font-size: 38px; }
.farm-empty-state p { margin: 5px 0 0; font-size: 12px; }

.farm-quick-cards { display: grid; gap: 10px; }
.farm-quick-cards > a {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 20px;
    min-height: 72px;
    align-items: center;
    gap: 10px;
    padding: 10px 13px;
    border: 1px solid rgba(31, 113, 67, 0.08);
    border-radius: 19px;
    background: rgba(255, 255, 255, 0.93);
    box-shadow: 0 7px 18px rgba(33, 88, 54, 0.1);
}
.farm-quick-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 15px; background: #ddf3bf; color: #3a8a49; font-size: 28px; font-weight: 900; }
.farm-quick-icon.is-ledger { background: #d8ecff; color: #3775a1; }
.farm-quick-cards > a > span:nth-child(2) { display: grid; min-width: 0; }
.farm-quick-cards strong { color: var(--farm-ink); font-size: 13px; }
.farm-quick-cards small { overflow: hidden; color: var(--farm-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.farm-quick-cards b { color: #79a381; font-size: 24px; }

.farm-carousel {
    overflow: hidden;
    border-radius: 22px;
    background: #d7efd0;
    box-shadow: var(--farm-shadow);
}
.farm-carousel-item[hidden] { display: none; }
.farm-carousel-item img { display: block; width: 100%; aspect-ratio: 12 / 5; object-fit: cover; }
.farm-carousel-dots { position: absolute; right: 0; bottom: 9px; left: 0; display: flex; justify-content: center; gap: 5px; }
.farm-carousel-dots span { width: 6px; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.58); }
.farm-carousel-dots span.active { width: 16px; background: #fff; }

.farm-bottom-nav {
    position: fixed;
    z-index: 60;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: min(100%, 480px);
    min-height: calc(66px + env(safe-area-inset-bottom));
    margin: 0 auto;
    padding: 6px 7px max(6px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(27, 92, 52, 0.1);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -8px 24px rgba(30, 86, 50, 0.12);
    backdrop-filter: blur(12px);
}

.farm-bottom-nav a {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 52px;
    place-items: center;
    align-content: center;
    gap: 2px;
    color: #7b9587;
}

.farm-bottom-nav a > span { display: grid; width: 32px; height: 28px; place-items: center; border-radius: 12px; }
.farm-bottom-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.farm-bottom-nav small { max-width: 100%; overflow: hidden; font-size: 9px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.farm-bottom-nav a.active { color: var(--farm-green-dark); }
.farm-bottom-nav a.active > span { background: #e2f2bf; }

body.farm-game-home.ui-v3 .dark-toggle,
body.farm-game-home.ui-v3 .install-app-btn,
body.farm-game-home.ui-v3 .cs-float-btn {
    border-color: rgba(255, 255, 255, 0.86);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 6px 14px rgba(36, 97, 83, 0.14);
    color: #197556;
}

body.farm-game-home.ui-v3 .cs-float-btn {
    top: auto;
    right: 14px;
    bottom: calc(82px + env(safe-area-inset-bottom));
}

@keyframes farmCloudDrift {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(45px, 5px, 0); }
}

@keyframes farmSpark {
    0%, 100% { opacity: 0.25; transform: scale(0.75); }
    50% { opacity: 1; transform: scale(1.25); }
}

@keyframes farmButterfly {
    0%, 100% { transform: translate3d(0, 0, 0) rotate(-8deg); }
    50% { transform: translate3d(12px, -13px, 0) rotate(10deg); }
}

@keyframes farmTreeBreathe {
    0%, 100% { transform: rotate(-0.6deg) scale(1); }
    50% { transform: rotate(0.7deg) scale(1.018); }
}

@keyframes farmWaterDrop {
    0% { opacity: 0; transform: translate3d(0, -22px, 0) rotate(45deg) scale(0.7); }
    24% { opacity: 1; }
    100% { opacity: 0; transform: translate3d(0, 150px, 0) rotate(45deg) scale(1); }
}

@keyframes farmTreeWatered {
    0%, 100% { transform: scale(1) rotate(0); }
    38% { transform: scale(0.985) rotate(-1deg); }
    66% { transform: scale(1.018) rotate(1deg); }
}

@keyframes farmTreeFed {
    0%, 100% { transform: scale(1); }
    45% { transform: scale(1.045); }
    70% { transform: scale(0.995); }
}

@keyframes farmGrowthPulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    45% { transform: translateX(-50%) scale(1.025); }
}

.farm-animations-paused .farm-cloud,
.farm-animations-paused .farm-spark,
.farm-animations-paused .farm-butterfly,
.farm-animations-paused .farm-empty-butterfly,
.farm-animations-paused .farm-empty-orchard-sign,
.farm-animations-paused .farm-action-button.is-plant::before,
.farm-animations-paused .farm-tree-wrap img {
    animation-play-state: paused !important;
}

@media (max-width: 350px) {
    .farm-hero { padding-right: 10px; padding-left: 10px; }
    .farm-stage { height: 515px; }
    .farm-tree-wrap { bottom: 174px; width: 78vw; }
    .farm-side-actions { width: 52px; }
    .farm-side-action > span { width: 43px; height: 43px; border-radius: 15px; }
    .farm-side-action small { max-width: 52px; font-size: 8px; }
    .farm-primary-actions { right: 2px; left: 2px; }
    .farm-action-button { min-height: 58px; }
    .farm-action-button strong { font-size: 14px; }
    .farm-growth-card { width: 76%; }
    .farm-player-copy strong { max-width: 112px; }
}

/* Real orchard state replaces the former water/fertilizer visual demo. */
.farm-game-home .farm-action-button { text-decoration:none; }
.farm-game-home .farm-action-button:disabled { cursor:default; filter:saturate(.65); opacity:.78; }
.farm-game-home .farm-action-button.is-water.is-harvest span { background-image:url('../images/farm/actions/harvest.webp'); }
.farm-game-home .farm-action-button.is-fertilize span { background-image:url('../images/farm/actions/harvest.webp'); }
.farm-game-home .farm-tree-wrap > img { object-fit:contain; image-rendering:auto; }
.farm-game-home .farm-tree-wrap.is-empty-land > img { width:72%; margin:14% auto 0; }
.farm-game-home .farm-tree-wrap.is-empty-land { pointer-events: auto; }

.farm-game-home .farm-empty-orchard-scene {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.farm-game-home .farm-empty-orchard-scene img {
    animation: none;
}

.farm-game-home .farm-empty-orchard-base {
    position: absolute;
    z-index: 2;
    bottom: 0;
    left: 50%;
    width: 96%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 8px rgba(25, 81, 38, 0.2));
    transform: translateX(-50%);
}

.farm-game-home .farm-empty-orchard-sign {
    position: absolute;
    z-index: 1;
    top: 49%;
    left: 50%;
    display: block;
    width: 55%;
    aspect-ratio: 3 / 2;
    color: #fff3bc;
    text-decoration: none;
    transform: translateX(-50%) rotate(-0.8deg);
    transform-origin: 50% 88%;
    animation: farmEmptySignSway 4.8s ease-in-out infinite;
    pointer-events: auto !important;
    touch-action: manipulation;
    will-change: transform;
}

.farm-game-home .farm-empty-orchard-sign img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 5px 3px rgba(76, 49, 15, 0.28));
}

.farm-game-home .farm-empty-orchard-sign strong {
    position: absolute;
    z-index: 3;
    top: 30%;
    right: 14%;
    left: 14%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    overflow: hidden;
    color: #6f310f;
    font: 950 11px/1.1 Georgia, serif;
    text-align: center;
    text-shadow: 0 1px 0 rgba(255, 231, 154, 0.88);
    white-space: nowrap;
}

.farm-game-home .farm-empty-orchard-sign strong span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.farm-game-home .farm-empty-orchard-sign strong i {
    flex: 0 0 auto;
    color: #67280a;
    font: 950 17px/0.75 "Arial Black", Arial, sans-serif;
    -webkit-text-stroke: 0.35px #67280a;
    text-shadow: 0 1px 0 rgba(255, 231, 154, 0.9);
    transform: translateY(-1px);
}

.farm-game-home .farm-empty-orchard-sign:active {
    animation: none;
    transform: translateX(-50%) scale(0.96);
}

.farm-game-home .farm-empty-butterfly {
    position: absolute;
    z-index: 5;
    top: 29%;
    left: 18%;
    width: 18px;
    height: 14px;
    animation: farmEmptyButterflyFlight 9.5s ease-in-out infinite;
    will-change: transform;
}

.farm-game-home .farm-empty-butterfly::before,
.farm-game-home .farm-empty-butterfly::after {
    position: absolute;
    top: 1px;
    width: 9px;
    height: 11px;
    border: 1px solid rgba(137, 77, 13, 0.38);
    background: linear-gradient(145deg, #fff17b, #ff9f27 72%);
    content: "";
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.66), 0 2px 2px rgba(66, 76, 27, 0.16);
}

.farm-game-home .farm-empty-butterfly::before {
    right: 50%;
    border-radius: 85% 32% 74% 36%;
    transform-origin: 100% 70%;
    animation: farmEmptyButterflyWingLeft 0.72s ease-in-out infinite;
}

.farm-game-home .farm-empty-butterfly::after {
    left: 50%;
    border-radius: 32% 85% 36% 74%;
    transform-origin: 0 70%;
    animation: farmEmptyButterflyWingRight 0.72s ease-in-out infinite;
}

.farm-game-home .farm-empty-butterfly i {
    position: absolute;
    z-index: 2;
    top: 3px;
    left: 8px;
    width: 3px;
    height: 8px;
    border-radius: 50%;
    background: #704420;
}

.farm-game-home .farm-action-button.is-plant::before {
    position: absolute;
    z-index: 2;
    top: -30%;
    left: -44%;
    width: 28%;
    height: 160%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 221, 0.58), transparent);
    content: "";
    opacity: 0;
    pointer-events: none;
    transform: skewX(-18deg);
    animation: farmPlantButtonGlow 6.2s ease-in-out infinite;
}

@keyframes farmEmptySignSway {
    0%, 100% { transform: translateX(-50%) rotate(-0.8deg); }
    50% { transform: translateX(-50%) rotate(0.9deg); }
}

@keyframes farmEmptyButterflyFlight {
    0%, 100% { transform: translate3d(0, 2px, 0) rotate(-4deg); }
    28% { transform: translate3d(16px, -10px, 0) rotate(5deg); }
    55% { transform: translate3d(30px, 1px, 0) rotate(-2deg); }
    78% { transform: translate3d(12px, 10px, 0) rotate(4deg); }
}

@keyframes farmEmptyButterflyWingLeft {
    0%, 100% { transform: rotate(-18deg) scaleX(1); }
    50% { transform: rotate(18deg) scaleX(0.42); }
}

@keyframes farmEmptyButterflyWingRight {
    0%, 100% { transform: rotate(18deg) scaleX(1); }
    50% { transform: rotate(-18deg) scaleX(0.42); }
}

@keyframes farmPlantButtonGlow {
    0%, 72%, 100% { left: -44%; opacity: 0; }
    76% { opacity: 0.56; }
    89% { left: 118%; opacity: 0; }
}

.farm-game-home .farm-growth-card.is-harvestable { box-shadow:inset 0 2px 0 #fffdf2,0 5px 0 #7c481f,0 0 0 4px rgba(255,213,64,.24); }
.farm-game-home #farm-stage-countdown { color:#167648; font-weight:950; letter-spacing:.2px; }

@media (min-width: 431px) {
    .farm-shell { border-right: 1px solid rgba(29, 105, 61, 0.09); border-left: 1px solid rgba(29, 105, 61, 0.09); }
}

@media (prefers-reduced-motion: reduce) {
    .farm-game-home *,
    .farm-game-home *::before,
    .farm-game-home *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* Home hub: all account and orchard destinations live in one compact dock. */
.farm-game-home .farm-tool-dock{position:relative;margin:16px 14px 0;padding:10px;border:3px solid #694119;border-radius:22px;background:linear-gradient(180deg,#fff6c9,#efd686);box-shadow:inset 0 2px 0 #fff,0 6px 0 rgba(70,55,19,.4),0 12px 20px rgba(24,89,47,.12)}
.farm-game-home .farm-tool-dock>header{display:flex;align-items:center;min-height:55px;padding:2px 4px 9px}.farm-game-home .farm-tool-dock>header>span{display:grid;place-items:center;width:46px;height:38px;margin-right:9px;border:2px solid #dcb244;border-radius:12px;color:#fff5ad;background:linear-gradient(180deg,#49bb69,#23834b);box-shadow:0 3px 0 #315f31;font-size:8px;font-weight:900;letter-spacing:.7px}.farm-game-home .farm-tool-dock>header>div{min-width:0}.farm-game-home .farm-tool-dock h2{margin:0;color:#603918;font:900 18px/1 Georgia,serif}.farm-game-home .farm-tool-dock header p{margin:3px 0 0;color:#846b47;font-size:8px;font-weight:700}
.farm-game-home .farm-tool-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}.farm-game-home .farm-tool-grid>a,.farm-game-home .farm-tool-grid>button{display:grid;grid-template-columns:60px minmax(0,1fr);align-items:center;min-height:92px;overflow:hidden;padding:7px;border:2px solid #704319;border-radius:17px;color:#5c3718;background:linear-gradient(180deg,#fff8d5,#f4dfa0);box-shadow:inset 0 2px 0 #fff,0 4px 0 rgba(74,55,18,.35);text-align:left}.farm-game-home .farm-tool-grid>a>img{width:64px;height:64px;object-fit:contain;filter:drop-shadow(0 4px 2px rgba(54,65,22,.18))}.farm-game-home .farm-tool-grid>a>span:last-child,.farm-game-home .farm-tool-grid>button>span:last-child{display:flex;min-width:0;flex-direction:column;padding-left:3px}.farm-game-home .farm-tool-grid strong{color:#5b3517;font:900 12px/1.05 Georgia,serif}.farm-game-home .farm-tool-grid small{display:-webkit-box;overflow:hidden;margin-top:4px;color:#8a704d;font-size:7px;font-weight:700;line-height:1.25;-webkit-box-orient:vertical;-webkit-line-clamp:2}.farm-game-home .farm-tool-symbol{display:grid;place-items:center;width:52px;height:52px;border:2px solid #e0b74b;border-radius:15px;color:#fff4aa;background:linear-gradient(180deg,#48b969,#23864d);box-shadow:0 3px 0 #306332}.farm-game-home .farm-tool-symbol.is-exit{color:#fff0bd;background:linear-gradient(180deg,#e38955,#b95538);box-shadow:0 3px 0 #77392c}.farm-game-home .farm-tool-symbol svg{width:27px;height:27px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}.farm-game-home .farm-tool-grid>button:disabled{opacity:.68}
.farm-game-home .farm-tool-grid>:last-child:nth-child(odd){grid-column:1/-1}
.farm-game-home .farm-tool-grid>.is-news-compact{grid-column:1/-1;grid-template-columns:minmax(0,1fr) 18px;min-height:58px;padding:9px 12px}.farm-game-home .farm-tool-grid>.is-news-compact>span{display:flex;min-width:0;flex-direction:column;padding:0}.farm-game-home .farm-tool-grid>.is-news-compact>b{color:#8c6a35;font-size:20px;text-align:right}
.farm-game-home .farm-tool-grid>.is-moments-tool,.farm-game-home .farm-tool-grid>#home-logout-button{grid-column:1/-1;min-height:68px}
.farm-game-home .farm-install-link{display:grid;grid-template-columns:36px minmax(0,1fr) 18px;align-items:center;gap:8px;width:100%;min-height:50px;margin-top:10px;padding:6px 10px;border:1px solid #c8a44e;border-radius:14px;color:#5f4427;background:rgba(255,252,224,.58);box-shadow:inset 0 1px rgba(255,255,255,.82);text-align:left}.farm-game-home .farm-install-link[hidden]{display:none!important}.farm-game-home .farm-install-link>svg{width:25px;height:25px;justify-self:center;fill:none;stroke:#2b8150;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}.farm-game-home .farm-install-link>span{display:flex;min-width:0;flex-direction:column}.farm-game-home .farm-install-link strong{color:#65401d;font-size:10px;font-weight:900}.farm-game-home .farm-install-link small{overflow:hidden;margin-top:2px;color:#8a704d;font-size:7px;font-weight:700;text-overflow:ellipsis;white-space:nowrap}.farm-game-home .farm-install-link>b{color:#8c6a35;font-size:20px;text-align:right}
@media(max-width:340px){.farm-game-home .farm-tool-dock{margin-right:9px;margin-left:9px;padding:8px}.farm-game-home .farm-tool-grid{gap:7px}.farm-game-home .farm-tool-grid>a,.farm-game-home .farm-tool-grid>button{grid-template-columns:53px minmax(0,1fr);min-height:88px;padding:5px}.farm-game-home .farm-tool-grid>a>img{width:57px;height:57px}.farm-game-home .farm-tool-symbol{width:47px;height:47px}.farm-game-home .farm-tool-grid strong{font-size:11px}}

/* Premium farm-game HUD: the controls use one lightweight shared sprite sheet. */
.farm-game-home .farm-avatar {
    width: 52px;
    height: 52px;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.farm-game-home .farm-avatar img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 4px 3px rgba(24, 87, 47, 0.28));
}

.farm-game-home .farm-player-copy small {
    color: #245846;
    font-size: 9px;
    font-weight: 900;
    text-shadow: 0 1px rgba(255, 255, 255, 0.4);
}

.farm-game-home .farm-player-copy strong {
    width: max-content;
    max-width: 145px;
    margin-top: 1px;
    padding: 2px 10px 3px;
    border: 1px solid rgba(255, 239, 170, 0.78);
    border-radius: 9px 9px 9px 3px;
    background: linear-gradient(180deg, #287a4e, #155e3b);
    box-shadow: 0 3px 0 rgba(70, 48, 19, 0.18);
    color: #fff8d8;
    font-size: 14px;
    text-shadow: 0 1px 1px rgba(39, 44, 15, 0.55);
}

.farm-game-home .farm-player-copy > span {
    margin-top: 3px;
    border: 1px solid rgba(130, 80, 18, 0.28);
    background: linear-gradient(180deg, #fff0a7, #e6b94d);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.7);
    color: #6d4510;
    font-size: 8px;
    text-shadow: none;
}

.farm-game-home .farm-wallet {
    min-height: 66px;
    padding: 8px 9px 8px 10px;
    border: 2px solid #f5d16b;
    border-radius: 19px;
    background:
        linear-gradient(180deg, rgba(43, 130, 79, 0.97), rgba(19, 91, 55, 0.97));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.34),
        inset 0 -3px 0 rgba(7, 62, 37, 0.28),
        0 7px 0 rgba(91, 61, 20, 0.18),
        0 11px 22px rgba(23, 83, 48, 0.17);
    backdrop-filter: none;
}

.farm-game-home .farm-wallet > a:not(.farm-wallet-add),
.farm-game-home .farm-wallet > div {
    min-height: 46px;
    justify-content: center;
    padding: 5px 8px;
    border: 1px solid rgba(255, 239, 166, 0.24);
    border-radius: 12px;
    background: rgba(5, 63, 37, 0.25);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
}

.farm-game-home .farm-wallet span {
    color: #d6f1c5;
    font-size: 9px;
    text-shadow: 0 1px rgba(0, 41, 23, 0.45);
}

.farm-game-home .farm-wallet strong {
    color: #fff2a0;
    font-size: clamp(14px, 4.2vw, 18px);
    text-shadow: 0 2px rgba(5, 55, 30, 0.68);
}

.farm-game-home .farm-wallet-divider {
    height: 35px;
    background: rgba(255, 226, 128, 0.34);
}

.farm-game-home .farm-wallet-add,
.farm-game-home .farm-login-link {
    border: 2px solid #fff0a3;
    border-radius: 50%;
    background: linear-gradient(180deg, #ffc84d, #e9871b);
    box-shadow:
        inset 0 2px rgba(255, 255, 255, 0.5),
        0 4px 0 #9b581a,
        0 7px 12px rgba(55, 46, 17, 0.28);
    color: #69370b !important;
    text-shadow: 0 1px rgba(255, 236, 146, 0.7);
}

.farm-game-home .farm-wallet.is-guest .farm-login-link {
    border-radius: 13px;
}

.farm-game-home .farm-title-block {
    margin-top: 14px;
}

.farm-game-home .farm-title-block > span {
    position: relative;
    z-index: 2;
    margin-bottom: -3px;
    padding: 4px 13px;
    border: 1px solid #e5b74d;
    background: linear-gradient(180deg, #fff7c7, #efd677);
    box-shadow: 0 2px 0 rgba(105, 67, 16, 0.23);
    color: #48702d;
    font-size: 8px;
    letter-spacing: 0.12em;
    text-shadow: none;
}

.farm-game-home .farm-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.farm-game-home .farm-title-spacer {
    height: 44px;
    margin-top: 82px;
}

.farm-game-home .farm-title-tool-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.farm-game-home .farm-utility-actions {
    position: absolute;
    z-index: 6;
    right: 22px;
    bottom: 86px;
    left: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.farm-game-home .farm-utility-actions > .farm-title-tool-group {
    display: contents;
}

.farm-game-home .farm-title-tool {
    position: relative;
    z-index: 3;
    display: grid;
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    min-height: 44px;
    flex: 0 0 44px;
    padding: 0;
    appearance: none;
    place-items: center;
    border: 2px solid #f0cb64;
    border-radius: 14px;
    color: #fff4ae;
    background: linear-gradient(180deg, #48b96a, #247f49);
    box-shadow: inset 0 2px rgba(255,255,255,.3), 0 4px 0 rgba(67,49,20,.34), 0 8px 14px rgba(28,79,46,.16);
}

.farm-game-home .farm-title-tool.is-settings {
    color: #6d430f;
    background: linear-gradient(180deg, #ffe576, #f3b52d);
}

.farm-game-home .farm-title-tool.is-install {
    color: #efffc4;
    background: linear-gradient(180deg, #69d69a, #249a63);
}

.farm-game-home .farm-title-tool.is-logout {
    color: #fff3c2;
    background: linear-gradient(180deg, #f6b360, #dc713f);
}

.farm-game-home .farm-title-tool.is-shop-shortcut {
    color: #6d430f;
    background: linear-gradient(180deg, #ffe47a, #efad2d);
}

.farm-game-home .farm-title-tool.is-task-shortcut {
    color: #efffc4;
    background: linear-gradient(180deg, #5ed5ac, #249364);
}

.farm-game-home .farm-title-tool svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.farm-game-home .farm-title-block h1 {
    position: relative;
    display: inline-block;
    width: min(56vw, 200px);
    min-width: 0;
    margin: 0;
    padding: 7px 24px 9px;
    border: 2px solid #f6d776;
    border-radius: 9px 9px 15px 15px;
    background:
        linear-gradient(90deg, rgba(255,255,255,0.1), transparent 18%, transparent 82%, rgba(255,255,255,0.1)),
        linear-gradient(180deg, #a86428, #74401e);
    box-shadow:
        inset 0 2px rgba(255, 235, 164, 0.22),
        inset 0 -4px rgba(66, 33, 13, 0.25),
        0 5px 0 rgba(76, 48, 17, 0.25),
        0 9px 18px rgba(22, 80, 47, 0.18);
    color: #fff3b3;
    font-size: clamp(20px, 6vw, 27px);
    letter-spacing: -0.03em;
    text-shadow: 0 2px 1px #4f2c18;
}

.farm-game-home .farm-title-block h1::before,
.farm-game-home .farm-title-block h1::after {
    position: absolute;
    top: 50%;
    width: 16px;
    height: 26px;
    border: 2px solid #e0ad42;
    background: #75411e;
    content: "";
    transform: translateY(-50%);
}

.farm-game-home .farm-title-block h1::before {
    left: -12px;
    border-radius: 9px 2px 2px 9px;
}

.farm-game-home .farm-title-block h1::after {
    right: -12px;
    border-radius: 2px 9px 9px 2px;
}

.farm-game-home .farm-stage {
    height: 606px;
    margin-top: -2px;
}

.farm-game-home .farm-tree-wrap {
    bottom: 234px;
    width: min(73vw, 330px);
}

.farm-game-home .farm-side-actions {
    top: 15px;
    width: 76px;
    gap: 1px;
}

.farm-game-home .farm-side-left { left: -2px; }
.farm-game-home .farm-side-right { right: -2px; }

/* Preserve the lower slots after moving shop and tasks so the background farmhouse stays visible. */
.farm-game-home .farm-side-left.is-reduced {
    padding-top: 166px;
}

.farm-game-home .farm-side-action {
    position: relative;
    min-height: 82px;
    gap: 0;
    transition: transform 0.16s ease;
}

.farm-game-home .farm-side-action:active {
    transform: scale(0.93) translateY(2px);
}

.farm-game-home .farm-side-action > span {
    width: 70px;
    height: 70px;
    border: 0;
    border-radius: 0;
    background-color: transparent;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    box-shadow: none;
    filter: drop-shadow(0 5px 2px rgba(45, 65, 24, 0.3));
}

.farm-game-home .farm-side-action > span svg {
    display: none;
}

.farm-game-home .farm-side-action small {
    position: relative;
    z-index: 2;
    display: block;
    max-width: 75px;
    min-width: 55px;
    margin-top: -7px;
    padding: 3px 6px 4px;
    overflow: hidden;
    border: 1px solid #f2c85e;
    border-radius: 8px;
    background: linear-gradient(180deg, #8d5426, #5d3219);
    box-shadow:
        inset 0 1px rgba(255, 238, 170, 0.18),
        0 3px 0 rgba(58, 35, 15, 0.26);
    color: #fff3bd;
    font-size: 8px;
    line-height: 1.05;
    text-overflow: ellipsis;
    text-shadow: 0 1px #3e2415;
    white-space: nowrap;
}

.farm-game-home .farm-side-action.is-shop > span { background-image: url('../images/farm/actions/shop.webp'); }
.farm-game-home .farm-side-action.is-task > span { background-image: url('../images/farm/actions/tasks.webp'); }
.farm-game-home .farm-side-action.is-news > span,
.farm-game-home .farm-side-action.is-support > span { background-image: url('../images/farm/actions/news.webp'); }
.farm-game-home .farm-side-action.is-harvest > span { background-image: url('../images/farm/actions/harvest.webp'); }
.farm-game-home .farm-side-action.is-withdraw > span { background-image: url('../images/farm/actions/fertilize.webp'); background-position: calc(50% + 3px) center; }
.farm-game-home .farm-side-action.is-friend > span { background-image: url('../images/farm/actions/friends.webp'); }
.farm-game-home .farm-side-action.is-ledger > span { background-image: url('../images/farm/actions/tasks.webp'); }
.farm-game-home .farm-side-action.is-team > span { background-image: url('../images/farm/actions/team.webp'); }
.farm-game-home .farm-side-action.is-post > span { background-image: url('../images/farm/actions/posts.webp'); }
.farm-game-home .farm-side-action.is-plan > span { background-image: url('../images/farm/orchard-tree.webp'); }
.farm-game-home .farm-side-action.is-route > span { background-image: url('../images/farm/actions/harvest.webp'); }

.farm-game-home .farm-side-action.is-harvest::after,
.farm-game-home .farm-side-action.is-post::after {
    position: absolute;
    z-index: 3;
    top: 5px;
    right: 5px;
    width: 10px;
    height: 10px;
    border: 2px solid #fff5ca;
    border-radius: 50%;
    background: #f0523b;
    box-shadow: 0 2px 0 rgba(111, 38, 24, 0.35);
    content: "";
}

.farm-game-home .farm-growth-card {
    bottom: 142px;
    width: min(79%, 320px);
    min-height: 86px;
    padding: 10px 14px 8px;
    border: 3px solid #8a5528;
    border-radius: 16px;
    background:
        linear-gradient(90deg, rgba(133, 84, 36, 0.08), transparent 12%, transparent 88%, rgba(133, 84, 36, 0.08)),
        linear-gradient(180deg, #fff4c9, #ead99f);
    box-shadow:
        inset 0 0 0 2px #ffefb5,
        inset 0 -4px rgba(132, 83, 34, 0.13),
        0 5px 0 #5b3b20,
        0 10px 18px rgba(26, 76, 43, 0.2);
    backdrop-filter: none;
}

.farm-game-home .farm-growth-heading strong {
    color: #65401d;
    font-size: 12px;
    text-shadow: 0 1px #fff5c8;
}

.farm-game-home .farm-growth-heading span {
    padding: 2px 7px;
    border: 1px solid #b68731;
    border-radius: 999px;
    background: #f7df80;
    color: #49691f;
    text-shadow: 0 1px #fff5bd;
}

.farm-game-home .farm-progress {
    height: 13px;
    border: 3px solid #7b4c25;
    background: #594027;
    box-shadow: inset 0 2px 2px rgba(42, 25, 10, 0.45);
}

.farm-game-home .farm-progress span {
    position: relative;
    background: linear-gradient(180deg, #e7f75a, #86c934 55%, #5da425);
    box-shadow: inset 0 2px rgba(255, 255, 255, 0.58);
}

.farm-game-home .farm-progress span::after {
    position: absolute;
    top: 1px;
    right: 2px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff19a;
    content: "";
    opacity: 0.8;
}

.farm-game-home .farm-growth-card > small,
.farm-game-home .farm-demo-note {
    color: #795f3c;
    text-shadow: 0 1px rgba(255, 249, 213, 0.8);
}

.farm-game-home .farm-primary-actions {
    right: 5px;
    left: 5px;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.farm-game-home .farm-action-button {
    position: relative;
    min-height: 72px;
    gap: 2px;
    overflow: hidden;
    border: 3px solid #fff0a4;
    border-radius: 19px;
    box-shadow:
        inset 0 2px rgba(255, 255, 255, 0.42),
        inset 0 -5px rgba(58, 52, 17, 0.2),
        0 6px 0 rgba(88, 58, 20, 0.52),
        0 11px 17px rgba(28, 82, 46, 0.22);
}

.farm-game-home .farm-action-button::after {
    position: absolute;
    top: 5px;
    right: 12%;
    left: 12%;
    height: 17px;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.25), transparent);
    content: "";
    pointer-events: none;
}

.farm-game-home .farm-action-button.is-water {
    background: linear-gradient(180deg, #25bcea, #137faf 72%, #0b668e);
    color: #fff8d5;
}

.farm-game-home .farm-action-button.is-fertilize {
    background: linear-gradient(180deg, #ffc941, #e9881e 72%, #c46615);
    color: #fff8d5;
}

.farm-game-home .farm-action-button span {
    z-index: 1;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    border-radius: 0;
    background-color: transparent;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    filter: drop-shadow(0 3px 1px rgba(63, 44, 15, 0.25));
}

.farm-game-home .farm-action-button.is-water span { background-image: url('../images/farm/actions/water.webp'); }
.farm-game-home .farm-action-button.is-fertilize span { background-image: url('../images/farm/actions/fertilize.webp'); }
.farm-game-home .farm-action-button span svg { display: none; }

.farm-game-home .farm-action-button strong {
    position: relative;
    z-index: 1;
    color: #fff8d5;
    font-size: 15px;
    text-shadow: 0 2px 1px rgba(73, 48, 14, 0.62);
}

.farm-game-home .farm-content-section {
    border: 2px solid #d9b55b;
    background: linear-gradient(180deg, #fff9df, #f1e5b9);
    box-shadow:
        inset 0 0 0 2px rgba(255,255,255,0.55),
        0 7px 0 rgba(105, 75, 30, 0.16),
        0 13px 22px rgba(32, 88, 52, 0.12);
}

.farm-game-home .farm-product-card,
.farm-game-home .farm-quick-cards > a {
    border: 1px solid #d6b96d;
    background: linear-gradient(180deg, #fff9df, #eee1b2);
    box-shadow: inset 0 1px rgba(255,255,255,0.7), 0 3px 0 rgba(111, 79, 28, 0.12);
}

body.farm-game-home.ui-v3 .dark-toggle,
body.farm-game-home.ui-v3 .install-app-btn,
body.farm-game-home.ui-v3 .cs-float-btn {
    border: 2px solid #f3cc66;
    border-radius: 50%;
    background: linear-gradient(180deg, #31875b, #175f3d);
    box-shadow:
        inset 0 2px rgba(255, 255, 255, 0.22),
        0 4px 0 rgba(70, 47, 18, 0.28),
        0 7px 14px rgba(30, 77, 49, 0.2);
    color: #fff1a4;
}

.farm-game-home .farm-bottom-nav {
    min-height: calc(70px + env(safe-area-inset-bottom));
    padding-top: 5px;
    border-top: 3px solid #edc45d;
    background: linear-gradient(180deg, rgba(39, 132, 77, 0.98), rgba(15, 92, 53, 0.99));
    box-shadow:
        inset 0 2px rgba(255,255,255,0.14),
        0 -7px 20px rgba(20, 75, 42, 0.2);
    backdrop-filter: none;
}

.farm-game-home .farm-bottom-nav a {
    color: #d9f0c3;
    text-shadow: 0 1px rgba(0, 50, 28, 0.7);
}

.farm-game-home .farm-bottom-nav a > span {
    width: 40px;
    height: 36px;
    border: 1px solid rgba(255, 232, 151, 0.28);
    background: rgba(4, 64, 36, 0.25);
    box-shadow: inset 0 1px rgba(255,255,255,0.08);
}

.farm-game-home .farm-bottom-nav a.active {
    color: #fff2a0;
}

.farm-game-home .farm-bottom-nav a.active > span {
    border-color: #fff0a4;
    background: linear-gradient(180deg, #f6d76c, #d99b2f);
    box-shadow: 0 3px 0 rgba(85, 52, 14, 0.34);
    color: #2d6f3c;
}

.farm-game-home .farm-bottom-nav small {
    font-size: 8px;
    font-weight: 900;
}

@media (max-width: 350px) {
    .farm-game-home .farm-title-block h1 {
        width: min(56vw, 180px);
        padding-right: 12px;
        padding-left: 12px;
        font-size: 17px;
    }

    .farm-game-home .farm-title-row { gap: 8px; }
    .farm-game-home .farm-title-tool-group { gap: 4px; }
    .farm-game-home .farm-utility-actions { right: 4px; left: 4px; }
    .farm-game-home .farm-title-tool { width: 44px; height: 44px; flex-basis: 44px; }

    .farm-game-home .farm-stage { height: 538px; }
    .farm-game-home .farm-tree-wrap { bottom: 180px; width: 71vw; }
    .farm-game-home .farm-side-actions { width: 68px; }
    .farm-game-home .farm-side-action { min-height: 77px; }
    .farm-game-home .farm-side-action > span { width: 64px; height: 64px; }
    .farm-game-home .farm-side-action small { max-width: 67px; min-width: 49px; font-size: 7px; }
    .farm-game-home .farm-side-left.is-reduced { padding-top: 156px; }
    .farm-game-home .farm-action-button span { width: 52px; height: 52px; flex-basis: 52px; }
    .farm-game-home .farm-action-button strong { font-size: 13px; }
    .farm-game-home .farm-growth-card { width: 77%; }
}

/* Keep the two primary game actions fully clear of the fixed dock on phones. */
@media (max-width: 390px) {
    .farm-game-home .farm-stage {
        height: 546px;
    }

    .farm-game-home .farm-tree-wrap {
        bottom: 234px;
        width: min(71vw, 268px);
    }

    .farm-game-home .farm-side-actions {
        width: 64px;
    }

    .farm-game-home .farm-side-action {
        min-height: 68px;
    }

    .farm-game-home .farm-side-action > span {
        width: 58px;
        height: 58px;
    }

    .farm-game-home .farm-side-action small {
        max-width: 63px;
        min-width: 47px;
        font-size: 7px;
    }

    .farm-game-home .farm-growth-card {
        bottom: 124px;
        width: 78%;
        min-height: 82px;
        padding-top: 8px;
    }

    .farm-game-home .farm-action-button {
        min-height: 60px;
    }

    .farm-game-home .farm-action-button span {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
    }

    .farm-game-home .farm-utility-actions {
        bottom: 70px;
    }
}

@media (max-width: 350px) {
    .farm-game-home .farm-stage { height: 542px; }
    .farm-game-home .farm-tree-wrap { bottom: 234px; width: 69vw; }
    .farm-game-home .farm-side-actions { width: 60px; }
    .farm-game-home .farm-side-action { min-height: 66px; }
    .farm-game-home .farm-side-action > span { width: 56px; height: 56px; }
    .farm-game-home .farm-side-action small { max-width: 59px; min-width: 45px; }
    .farm-game-home .farm-side-left.is-reduced { padding-top: 134px; }
    .farm-game-home .farm-growth-card { width: 76%; }
    .farm-game-home .farm-action-button strong { font-size: 12px; }
}

@media (max-width: 330px) {
    .farm-game-home .farm-utility-actions { right: 0; left: 0; }
    .farm-game-home .farm-title-tool { width: 40px; flex-basis: 40px; }
}

/* Compact top HUD: light balances sit in the unused header space. */
body.farm-game-home.ui-v3 .install-app-btn,
body.farm-game-home.ui-v3 .dark-toggle {
    display: none !important;
}

.farm-game-home .farm-wallet {
    position: absolute;
    z-index: 7;
    top: max(14px, env(safe-area-inset-top));
    right: 12px;
    left: 136px;
    grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr) 32px;
    gap: 5px;
    min-height: 54px;
    margin-top: 0;
    padding: 5px 6px;
    border: 2px solid #dcae42;
    border-radius: 17px;
    background: linear-gradient(180deg, rgba(255, 249, 211, 0.98), rgba(239, 224, 154, 0.98));
    box-shadow:
        inset 0 2px rgba(255, 255, 255, 0.72),
        inset 0 -3px rgba(155, 109, 33, 0.12),
        0 4px 0 rgba(101, 70, 25, 0.2),
        0 8px 16px rgba(37, 89, 52, 0.14);
}

.farm-game-home .farm-wallet > a:not(.farm-wallet-add),
.farm-game-home .farm-wallet > div {
    min-height: 40px;
    padding: 3px 5px;
    border: 1px solid rgba(157, 116, 39, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 241, 0.62);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.86);
}

.farm-game-home .farm-wallet span {
    color: #61734a;
    font-size: 8px;
    text-shadow: none;
}

.farm-game-home .farm-wallet strong {
    color: #216b42;
    font-size: clamp(13px, 3.8vw, 17px);
    text-shadow: 0 1px rgba(255, 255, 255, 0.85);
}

.farm-game-home .farm-wallet-divider {
    height: 30px;
    background: rgba(126, 96, 37, 0.25);
}

.farm-game-home .farm-wallet-add {
    min-width: 32px;
    min-height: 32px;
    font-size: 20px;
}

.farm-game-home .farm-wallet.is-guest {
    grid-template-columns: minmax(0, 1fr) auto;
}

.farm-game-home .farm-shell {
    padding-bottom: max(22px, env(safe-area-inset-bottom));
}

@media (max-width: 390px) {
    .farm-game-home .farm-player {
        gap: 5px;
    }

    .farm-game-home .farm-player-copy small,
    .farm-game-home .farm-player-copy > span {
        display: none;
    }

    .farm-game-home .farm-player-copy strong {
        max-width: 48px;
        padding-right: 6px;
        padding-left: 6px;
        font-size: 12px;
    }

    .farm-game-home .farm-wallet {
        right: 10px;
        left: 110px;
    }

    .farm-game-home .farm-wallet > a:not(.farm-wallet-add),
    .farm-game-home .farm-wallet > div {
        padding-right: 4px;
        padding-left: 4px;
    }
}

@media (max-width: 350px) {
    .farm-game-home .farm-avatar {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
    }

    .farm-game-home .farm-wallet {
        left: 100px;
        grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr) 29px;
        gap: 3px;
        padding-right: 4px;
        padding-left: 4px;
    }

    .farm-game-home .farm-wallet-add {
        min-width: 29px;
        min-height: 29px;
    }
}

/* Final orchard action icons: no watering/fertilizer affordance remains. */
.farm-game-home .farm-action-button.is-harvest span {
    background-image: url('../images/farm/actions/harvest.webp') !important;
}

.farm-game-home .farm-action-button.is-orchard span {
    background-image: url('../images/farm/crops/generic/icon.webp') !important;
}

.farm-game-home .farm-action-button.is-waiting span,
.farm-game-home .farm-action-button.is-plant span {
    display: grid;
    place-items: center;
    background-image: none !important;
}

.farm-game-home .farm-action-button.is-waiting span svg,
.farm-game-home .farm-action-button.is-plant span svg {
    display: block !important;
    width: 44px;
    height: 44px;
    padding: 8px;
    border: 2px solid rgba(255, 248, 204, 0.88);
    border-radius: 50%;
    background: rgba(13, 105, 107, 0.28);
    stroke: #fff6bd;
    stroke-width: 2;
    fill: none;
}

/* Customer service dialog: match the orchard's wooden game UI. */
body.ui-v3.farm-game-home .cs-overlay {
    background: rgba(18, 57, 38, 0.66);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

body.ui-v3.farm-game-home .cs-popup {
    width: min(330px, calc(100vw - 24px));
    max-height: min(82dvh, 640px);
    overflow-x: hidden;
    color: #68401f;
    background: linear-gradient(180deg, #fff6c8 0%, #f8e7a8 100%);
    border: 3px solid #714018;
    border-radius: 23px;
    box-shadow:
        0 8px 0 #4d2e18,
        0 22px 45px rgba(24, 61, 37, 0.35),
        inset 0 0 0 2px rgba(255, 255, 255, 0.72);
}

.farm-game-home .cs-popup-hero {
    height: 96px;
    overflow: visible;
    background:
        linear-gradient(90deg, transparent 0 6%, rgba(255, 215, 91, 0.22) 6% 7%, transparent 7% 93%, rgba(255, 215, 91, 0.22) 93% 94%, transparent 94%),
        linear-gradient(180deg, #a85d24 0%, #874217 48%, #6d3212 100%);
    border-bottom: 3px solid #5b2e15;
    box-shadow: inset 0 3px 0 rgba(255, 226, 135, 0.5), inset 0 -3px 0 rgba(65, 28, 12, 0.3);
}

.farm-game-home .cs-popup-hero::before {
    background:
        linear-gradient(180deg, transparent 31%, rgba(83, 37, 14, 0.32) 32% 34%, transparent 35% 65%, rgba(255, 202, 95, 0.12) 66% 68%, transparent 69%),
        linear-gradient(105deg, rgba(255, 226, 144, 0.16), transparent 42%);
}

.farm-game-home .cs-hero-orbit {
    top: -78px;
    right: -42px;
    width: 150px;
    height: 150px;
    border-color: rgba(255, 215, 91, 0.22);
    box-shadow: 0 0 0 18px rgba(255, 215, 91, 0.05), 0 0 0 36px rgba(255, 215, 91, 0.025);
}

body.ui-v3.farm-game-home .cs-close {
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    color: #fffbea;
    background: linear-gradient(180deg, #ffb43b, #e87c13);
    border: 2px solid #ffe994;
    border-radius: 13px;
    box-shadow: 0 4px 0 #84410e, inset 0 2px 0 rgba(255, 255, 255, 0.48);
}

body.ui-v3.farm-game-home .cs-close svg {
    stroke-width: 2.6;
}

body.ui-v3.farm-game-home .cs-close:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #84410e, inset 0 2px 0 rgba(255, 255, 255, 0.38);
}

.farm-game-home .cs-support-mark {
    bottom: -23px;
    left: 22px;
    width: 62px;
    height: 62px;
    color: #fff8ca;
    background: linear-gradient(180deg, #43bd68, #168844);
    border: 3px solid #ffe68d;
    border-radius: 18px;
    box-shadow: 0 5px 0 #315f2c, 0 10px 18px rgba(46, 79, 39, 0.26), inset 0 2px 0 rgba(255, 255, 255, 0.3);
}

.farm-game-home .cs-support-mark::after {
    right: -3px;
    bottom: 3px;
    width: 13px;
    height: 13px;
    background: #d8ef49;
    border-color: #fff1b5;
}

.farm-game-home .cs-greeting {
    top: 25px;
    left: 98px;
    padding: 6px 13px;
    color: #68401f;
    background: linear-gradient(180deg, #fff7c9, #f4d878);
    border: 2px solid #6f3e19;
    border-radius: 12px 12px 12px 4px;
    box-shadow: 2px 3px 0 rgba(62, 31, 13, 0.35);
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 15px;
    transform: rotate(-2deg);
}

.farm-game-home .cs-signal {
    display: none;
}

.farm-game-home .cs-popup-copy {
    padding: 32px 18px 14px;
    background: transparent;
}

.farm-game-home .cs-status {
    gap: 7px;
    color: #22814b;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0.09em;
}

.farm-game-home .cs-status i {
    width: 8px;
    height: 8px;
    background: #49be62;
    box-shadow: 0 0 0 3px rgba(73, 190, 98, 0.18);
}

body.ui-v3.farm-game-home .cs-popup-copy h5 {
    margin: 7px 0 4px;
    color: #613819;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 23px;
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -0.025em;
}

body.ui-v3.farm-game-home .cs-popup-copy p {
    color: #856744;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
}

.farm-game-home .cs-link-list {
    gap: 9px;
    padding: 0 16px 18px;
}

body.ui-v3.farm-game-home .cs-link-item {
    grid-template-columns: 43px minmax(0, 1fr) 32px;
    min-height: 64px;
    color: #633a1d;
    background: linear-gradient(180deg, #fff9d9, #f5e2a3);
    border: 2px solid #b4772c;
    border-radius: 15px;
    box-shadow: 0 4px 0 #7d481d, inset 0 2px 0 rgba(255, 255, 255, 0.74);
}

.farm-game-home .cs-link-item:hover {
    color: #633a1d;
    border-color: #9a5d20;
    box-shadow: 0 4px 0 #7d481d, inset 0 2px 0 rgba(255, 255, 255, 0.74);
}

.farm-game-home .cs-link-item:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #7d481d, inset 0 2px 0 rgba(255, 255, 255, 0.68);
}

.farm-game-home .cs-link-item .cs-icon,
.farm-game-home .cs-link-item:nth-child(2n) .cs-icon {
    color: #fff7bd;
    background: linear-gradient(180deg, #44bd69, #178645);
    border: 2px solid #ddef73;
    border-radius: 13px;
    box-shadow: 0 3px 0 #2e642f, inset 0 2px 0 rgba(255, 255, 255, 0.28);
}

.farm-game-home .cs-link-item .cs-name strong {
    color: #633a1d;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 15px;
}

.farm-game-home .cs-link-item .cs-name small {
    color: #8d6e45;
    font-size: 11px;
}

.farm-game-home .cs-link-arrow {
    color: #fff7bd;
    background: linear-gradient(180deg, #f4a12e, #dc7415);
    border: 1px solid #ffc95b;
    border-radius: 10px;
    box-shadow: 0 2px 0 #8c450e;
}
