/* ==============================================================
   FARMBARN: 2D PIXEL ART SOCIAL FARMING RPG STYLESHEET
   100% Faithful Replica of the Uploaded Mobile Game Design
   ============================================================== */

:root {
    --primary-green: #67ac36;
    --dark-green: #4d8825;
    --light-green: #8fd04f;
    --sky-blue: #60a5fa;
    --soil-base: #5c381e;
    --soil-border: #442611;
    --soil-highlight: #754827;
    --coin-brown: #6d4524;
    --gold-accent: #f59e0b;
    --harvest-gold: #c9893d;
    --panel-bg: #ede4ce;
    --card-bg: #fbf8f1;
    --text-dark: #3e2714;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    font-family: 'Fredoka', 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #2b3a1a url('assets/images/wood_pattern.png');
    background-color: #1e2912;
    color: var(--text-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==============================================================
   DESKTOP / MOBILE RESPONSIVE WRAPPER (Auto-fit PC & Mobile)
   ============================================================== */
.game-viewport {
    position: relative;
    width: 100%;
    max-width: 440px;
    height: 100vh;
    max-height: 940px;
    background: #73b843;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    border-radius: 0;
}

@media (min-width: 500px) {
    .game-viewport {
        height: 95vh;
        border-radius: 36px;
        border: 8px solid #1a1a1a;
        box-shadow: 0 25px 60px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.1);
    }
}

/* ==============================================================
   1. TOP HUD / HEADER BAR (Exact Match to Screenshot)
   ============================================================== */
.top-header {
    background: var(--primary-green);
    padding: 12px 14px 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 50;
    position: relative;
}

.header-main-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.music-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: 1.5px solid rgba(255, 255, 255, 0.45);
    color: #ffffff;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.1s, background 0.2s;
}

.music-btn:active {
    transform: scale(0.92);
}

.farm-identity,
.farm-identity-balanced {
    display: flex;
    align-items: center;
    gap: 9px;
}

.user-avatar-wheat-wrap {
    position: relative;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
}

.header-user-avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.22);
    display: block;
}

.header-user-avatar-fallback {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fef08a 0%, #f59e0b 100%);
    color: #78350f;
    font-weight: 900;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.22);
    text-transform: uppercase;
}

.avatar-wheat-pin {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 17px;
    height: 17px;
    background: #ffffff;
    border-radius: 50%;
    font-size: 11px;
    line-height: 17px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    border: 1px solid #fef08a;
    pointer-events: none;
}

.farm-texts,
.farm-texts-balanced {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.15;
}

.farm-header-name-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.header-username-label {
    font-size: 0.95rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
    max-width: 105px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-dot-sep {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 800;
}

.farm-wheat-badge {
    width: 34px;
    height: 34px;
    background: #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.farm-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fef08a;
    letter-spacing: -0.2px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    max-width: 95px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.1;
}

.farm-subtitle {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.coin-pill {
    background: var(--coin-brown);
    border: 2px solid #8e5b32;
    padding: 4px 12px 4px 8px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.95rem;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.15);
}

.coin-icon-img {
    font-size: 1.1rem;
}

.close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    color: #4b5563;
    border: none;
    font-size: 15px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    text-decoration: none;
    transition: transform 0.1s;
}

.close-btn:active {
    transform: scale(0.9);
}

/* Row 2: Round Action Buttons & XP Bar */
.header-actions-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.round-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s, background 0.15s;
}

.round-action-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

.round-action-btn:active {
    transform: scale(0.9);
}

.xp-progress-capsule {
    flex: 1;
    height: 22px;
    background: rgba(0, 0, 0, 0.22);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.xp-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 65%;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    border-radius: 12px;
    transition: width 0.4s ease;
}

.xp-text {
    position: relative;
    font-size: 0.68rem;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    z-index: 2;
}

/* ==============================================================
   2. TOP SCENERY (Barn, Windmill, Rainbow, Pond, Wooden Fence)
   ============================================================== */
.scenery-canvas-box {
    position: relative;
    height: 72px;
    background: linear-gradient(180deg, #60a5fa 0%, #bae6fd 60%, #e0f2fe 100%);
    overflow: hidden;
    border-bottom: 2px solid #558a2e;
}

/* Animated Clouds */
.scenery-cloud {
    position: absolute;
    background: #ffffff;
    border-radius: 20px;
    opacity: 0.85;
    animation: driftClouds 35s linear infinite;
}

@keyframes driftClouds {
    0% { transform: translateX(-120px); }
    100% { transform: translateX(500px); }
}

/* Rainbow Arch */
.scenery-rainbow {
    position: absolute;
    left: 30%;
    bottom: 12px;
    width: 140px;
    height: 70px;
    border-top-left-radius: 70px;
    border-top-right-radius: 70px;
    border: 6px solid transparent;
    border-top-color: rgba(239, 68, 68, 0.65);
    box-shadow: 0 -4px 0 0 rgba(249, 115, 22, 0.6),
                0 -8px 0 0 rgba(234, 179, 8, 0.6),
                0 -12px 0 0 rgba(34, 197, 94, 0.6),
                0 -16px 0 0 rgba(59, 130, 246, 0.6);
    pointer-events: none;
}

/* Pastoral Elements Container */
.scenery-elements {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0 12px;
    font-size: 1.8rem;
}

/* Windmill Blades Spin */
.windmill-blades {
    display: inline-block;
    animation: spinWindmill 8s linear infinite;
    transform-origin: center;
}

@keyframes spinWindmill {
    100% { transform: rotate(360deg); }
}

/* Rustic Split Rail Fence */
.scenery-fence-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 9px;
    background: repeating-linear-gradient(90deg, #8a572a 0px, #8a572a 6px, #caa06d 6px, #caa06d 14px);
    border-top: 2px solid #5a3717;
}

/* ==============================================================
   3. MAIN FARM VIEWPORT (Scrollable Area)
   ============================================================== */
.farm-scrollable-world {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    padding: 8px 8px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #74b841;
}

/* Custom Scrollbar */
.farm-scrollable-world::-webkit-scrollbar {
    width: 4px;
}
.farm-scrollable-world::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 4px;
}

/* Dedicated Crop Field Section: Expanded Big Container for Plants (Swipe up and down) */
.crop-field-section {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 320px;
    max-height: 540px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 2px 2px 6px 2px;
    box-sizing: border-box;
    border-radius: 14px;
}

.crop-field-section::-webkit-scrollbar {
    width: 4px;
}
.crop-field-section::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
}

/* Left Floating Notifications (Exact Match to Screenshot Colors & Position) */
.floating-notif-column {
    position: absolute;
    left: 4px;
    bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    z-index: 25;
    pointer-events: auto;
}

.floating-icon-pill {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #256628;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
    position: relative;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.65);
    transition: transform 0.1s;
}

.floating-icon-pill:active {
    transform: scale(0.9);
}

.notif-badge-bubble {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #ffffff;
}

/* ==============================================================
   4. CROP FIELD: 6-COLUMN GRID (Matching Screenshot)
   ============================================================== */
.crop-grid-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    width: 100%;
}

.crop-plot {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--soil-base);
    border: 2.5px solid var(--soil-border);
    border-radius: 12px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.35), 0 3px 6px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.12s, border-color 0.2s;
}

.crop-plot:active {
    transform: scale(0.94);
}

.crop-plot.growth-locked {
    border-color: #2b1709;
}

.crop-plot.is-watered {
    background: #472b15;
    border-color: #1e1107;
}

.crop-plot.locked {
    background: #8b5a2b;
    border: 2px dashed #caa06d;
    opacity: 0.85;
}

.plot-lock-tag {
    font-size: 0.62rem;
    font-weight: 800;
    color: #fef08a;
    text-align: center;
    padding: 2px;
}

/* Crop Full-Body Visual (Enlarged) */
.crop-sprite {
    font-size: 1.95rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
    animation: gentleSway 3s ease-in-out infinite alternate;
    transform-origin: bottom center;
}

@keyframes gentleSway {
    0% { transform: rotate(-2deg); }
    100% { transform: rotate(2deg); }
}

/* Small Counter / Growth Progress Bar on Each Plant */
.plot-progress-bar {
    position: absolute;
    top: 2px;
    left: 3px;
    right: 3px;
    height: 3.5px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 2px;
    overflow: hidden;
    pointer-events: none;
    z-index: 5;
}

.plot-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e 0%, #f59e0b 100%);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.plot-progress-fill.ripe {
    background: #22c55e;
    width: 100% !important;
}

/* Stage Badge (Stage 1 Seed, Stage 2 Sprout, Stage 3 Plant, Stage 4 Fruit) */
.plot-stage-badge {
    position: absolute;
    top: 6px;
    right: 3px;
    font-size: 0.5rem;
    font-weight: 800;
    color: #fef08a;
    background: rgba(0, 0, 0, 0.65);
    padding: 1px 3px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 5;
    line-height: 1;
}

/* Plot Growth Countdown Timer Overlay (Dark Rounded Pill matching photo) */
.plot-timer-pill {
    position: absolute;
    bottom: 2px;
    left: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.58rem;
    font-weight: 800;
    text-align: center;
    padding: 1.5px 0;
    border-radius: 6px;
    letter-spacing: -0.2px;
}

.plot-timer-pill.ripe {
    background: #16a34a;
    color: #ffffff;
    font-weight: 900;
}

/* Water drop indicator */
.water-sparkle-dot {
    position: absolute;
    top: 6px;
    left: 3px;
    font-size: 8px;
    z-index: 5;
}

/* ==============================================================
   5. ANIMAL PASTURES (Dedicated Containers for Each Animal)
   ============================================================== */
.pastures-master-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.species-bar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.species-tabs-scroll {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 2px;
    flex: 1;
}

.species-tabs-scroll::-webkit-scrollbar {
    height: 3px;
}

.species-tab-pill {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: 800;
    color: #451a03;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 2px;
    transition: all 0.15s ease;
}

.species-tab-pill.active {
    background: #ffffff;
    border-color: #f59e0b;
    color: #b45309;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    transform: scale(1.02);
}

.animal-shop-quick-btn {
    background: #fef3c7;
    border: 1.2px solid #f59e0b;
    color: #92400e;
    font-size: 0.65rem;
    padding: 2px 7px;
    white-space: nowrap;
    border-radius: 10px;
}

.animal-containers-grid,
.animal-containers-swipe-wrap {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}

.animal-containers-swipe-wrap::-webkit-scrollbar,
.animal-containers-grid::-webkit-scrollbar {
    height: 3px;
}
.animal-containers-swipe-wrap::-webkit-scrollbar-thumb,
.animal-containers-grid::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.animal-species-container-card {
    flex: 0 0 100%;
    min-width: 100%;
    max-width: 100%;
    scroll-snap-align: start;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    border: 1.5px dashed rgba(255, 255, 255, 0.28);
    padding: 5px 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-sizing: border-box;
}

/* Pasture Top Action Bar */
.pasture-header-pill {
    background: #fdfbf7;
    border: 1px solid #e2d9c8;
    border-radius: 14px;
    padding: 2px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.pasture-title-info {
    font-size: 0.74rem;
    font-weight: 800;
    color: #451a03;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pasture-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pasture-btn {
    background: #fef3c7;
    border: 1px solid #fde68a;
    color: #78350f;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: transform 0.1s;
}

.pasture-btn:active {
    transform: scale(0.93);
}

.pasture-btn.collect-btn {
    background: #e0f2fe;
    border-color: #bae6fd;
    color: #0369a1;
}

.pasture-safe-badge {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
    font-size: 0.68rem;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Living Pasture Pen Field (Compact 70px) */
.pasture-fence-yard {
    position: relative;
    height: 70px;
    background: #62a737;
    border-radius: 10px;
    border-top: 2.5px solid #4a2e16;
    border-bottom: 2.5px solid #4a2e16;
    overflow: hidden;
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.15);
}

/* Pasture Fence Posts */
.fence-post-decor {
    position: absolute;
    width: 5px;
    top: 0;
    bottom: 0;
    background: #4a2e16;
}

/* Autonomous Moving Animal Sprites (Compact 1.4rem) */
.pasture-animal {
    position: absolute;
    font-size: 1.4rem;
    cursor: pointer;
    transition: left 1.2s cubic-bezier(0.25, 1, 0.5, 1), top 1.2s cubic-bezier(0.25, 1, 0.5, 1);
    filter: drop-shadow(0 4px 5px rgba(0,0,0,0.25));
}

.pasture-animal.hopping {
    animation: animalBounce 0.4s ease alternate 2;
}

@keyframes animalBounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

/* ==============================================================
   6. BOTTOM DOCK / SEED SHELF (Compact Auto-Fit Layout)
   ============================================================== */
.bottom-dock-container {
    background: var(--panel-bg);
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    padding: 6px 10px 8px 10px;
    box-shadow: 0 -4px 14px rgba(0,0,0,0.16);
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 40;
}

/* Horizontal Scrollable Seed Cards Shelf */
.seed-cards-scroll {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.seed-cards-scroll::-webkit-scrollbar {
    height: 3px;
}
.seed-cards-scroll::-webkit-scrollbar-thumb {
    background: #d4c5a9;
    border-radius: 3px;
}

.seed-card {
    min-width: 68px;
    max-width: 68px;
    background: var(--card-bg);
    border: 1.5px solid #e0d5be;
    border-radius: 12px;
    padding: 4px 2px 4px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.1s, border-color 0.15s, box-shadow 0.15s;
}

.seed-card:active {
    transform: scale(0.95);
}

.seed-card.active {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.4), 0 2px 6px rgba(0,0,0,0.1);
    background: #fffdf5;
}

.seed-card-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.seed-card-name {
    font-size: 0.64rem;
    font-weight: 800;
    color: #451a03;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.seed-card-price-pill {
    background: #faeedb;
    border: 1px solid #e5d3ba;
    color: #6d4524;
    font-size: 0.58rem;
    font-weight: 900;
    padding: 0.5px 5px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.seed-card-meta {
    font-size: 0.52rem;
    color: #78716c;
    font-weight: 700;
    text-align: center;
    line-height: 1.1;
    margin-top: 1px;
}

/* Two Bottom Action Buttons: Plant All & Harvest All (Compact) */
.dock-action-buttons-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.dock-action-btn {
    border: none;
    border-radius: 12px;
    padding: 8px 6px;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    transition: transform 0.1s, filter 0.15s;
}

.dock-action-btn:active {
    transform: scale(0.96);
}

.btn-plant-all {
    background: #6e853a;
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.btn-plant-all:active {
    background: #5c6f31;
}

.btn-harvest-all {
    background: #9f886f;
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.btn-harvest-all:active {
    background: #8b745e;
}

/* ==============================================================
   7. MODAL OVERLAYS (Shop, Inventory, Social, Achievements, Themes)
   ============================================================== */
.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 0;
}

.modal-overlay.active {
    display: flex;
    animation: fadeInModal 0.2s ease;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-dialog {
    background: #fcf9f2;
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
    width: 100%;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.3);
    animation: slideUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@keyframes slideUpModal {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    padding: 14px 16px 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e7ded0;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 900;
    color: #451a03;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close-btn {
    background: #f3f4f6;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.1rem;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 14px 16px;
    overflow-y: auto;
    flex: 1;
}

/* Modal Tabs */
.modal-tab-strip {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px 16px;
    background: #f4ede0;
    border-bottom: 1px solid #e2d9c8;
}

.modal-tab-btn {
    padding: 6px 12px;
    background: #ffffff;
    border: 1px solid #dcd3c1;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 800;
    color: #57534e;
    cursor: pointer;
    white-space: nowrap;
}

.modal-tab-btn.active {
    background: #65a30d;
    color: #ffffff;
    border-color: #4d7c0f;
}

/* Floating Toast Messages */
.game-toast {
    position: absolute;
    top: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(24, 24, 27, 0.92);
    color: #ffffff;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 800;
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.15);
    white-space: nowrap;
}

.game-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==============================================================
   8. FARMLAND GENERAL STORE (Seeds, 30 Animals, 10 Equipment)
   ============================================================== */
.shop-tabs-bar {
    display: flex;
    gap: 6px;
    padding: 8px 14px;
    background: #f4ede0;
    border-bottom: 1.5px solid #e2d9c8;
    overflow-x: auto;
}

.shop-tabs-bar::-webkit-scrollbar {
    height: 3px;
}

.shop-tab-btn {
    padding: 6px 12px;
    background: #ffffff;
    border: 1.2px solid #dcd3c1;
    border-radius: 14px;
    font-size: 0.76rem;
    font-weight: 800;
    color: #57534e;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.shop-tab-btn.active {
    background: #16a34a;
    color: #ffffff;
    border-color: #15803d;
    box-shadow: 0 2px 5px rgba(0,0,0,0.12);
}

.shop-modal-body {
    padding: 12px 14px;
    overflow-y: auto;
    flex: 1;
}

.shop-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
    gap: 8px;
    width: 100%;
}

.shop-item-card {
    background: #ffffff;
    border: 1.5px solid #e7ded0;
    border-radius: 14px;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 3px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.1s, border-color 0.15s;
    position: relative;
}

.shop-item-card:hover {
    border-color: #f59e0b;
}

.shop-item-card.locked {
    opacity: 0.7;
    background: #f8fafc;
    border: 1.5px dashed #cbd5e1;
}

.shop-item-icon {
    font-size: 2rem;
    line-height: 1.1;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.15));
}

.shop-item-name {
    font-size: 0.78rem;
    font-weight: 900;
    color: #1e293b;
    line-height: 1.15;
}

.shop-item-meta {
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 700;
}

.shop-stage-preview {
    display: flex;
    align-items: center;
    gap: 2px;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 2px 5px;
    font-size: 0.72rem;
    margin: 2px 0;
}

.shop-item-price {
    font-size: 0.75rem;
    font-weight: 900;
    color: #b45309;
}

.shop-buy-btn {
    background: linear-gradient(135deg, #16a34a, #15803d);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.72rem;
    padding: 5px 8px;
    cursor: pointer;
    width: 100%;
    margin-top: 3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.12);
    transition: transform 0.1s, opacity 0.15s;
}

.shop-buy-btn:active {
    transform: scale(0.95);
}

.shop-buy-btn:disabled {
    background: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
    box-shadow: none;
}

.shop-preview-sound-btn {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    color: #92400e;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    cursor: pointer;
    margin-top: 2px;
}

/* ==============================================================
   INVENTORY MODAL: KEEP / SELL HARVESTED CROPS & ANIMALS
   ============================================================== */
.inv-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    width: 100%;
}

.inv-item-card {
    background: #ffffff;
    border: 1.5px solid #e2d9cc;
    border-radius: 14px;
    padding: 9px 8px 8px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 3px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.06);
    position: relative;
    transition: transform 0.1s, border-color 0.15s;
}

.inv-item-card:hover {
    border-color: #84cc16;
}

.inv-item-icon {
    font-size: 2.1rem;
    line-height: 1.1;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.15));
}

.inv-item-name {
    font-size: 0.8rem;
    font-weight: 900;
    color: #27272a;
    line-height: 1.15;
}

.inv-item-badge {
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    text-transform: uppercase;
}

.inv-item-badge.crop {
    background: #ecfdf5;
    color: #059669;
}

.inv-item-badge.produce {
    background: #fef3c7;
    color: #d97706;
}

.inv-item-badge.animal {
    background: #fdf2f8;
    color: #db2777;
}

.inv-item-qty {
    font-size: 0.76rem;
    font-weight: 900;
    color: #15803d;
}

.inv-item-val {
    font-size: 0.68rem;
    color: #b45309;
    font-weight: 800;
}

.inv-actions-row {
    display: flex;
    gap: 4px;
    width: 100%;
    margin-top: 4px;
}

.inv-keep-btn {
    flex: 1;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #475569;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 2px;
    cursor: pointer;
    transition: background 0.15s;
}

.inv-keep-btn:hover {
    background: #e2e8f0;
}

.inv-sell-btn {
    flex: 1.2;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 4px 4px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform 0.1s;
}

.inv-sell-btn:active {
    transform: scale(0.94);
}

.inv-sell-all-btn {
    width: 100%;
    background: linear-gradient(135deg, #16a34a, #15803d);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.66rem;
    font-weight: 900;
    padding: 4px 6px;
    cursor: pointer;
    margin-top: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform 0.1s;
}

.inv-sell-all-btn:active {
    transform: scale(0.95);
}

.inv-animal-sell-btn {
    width: 100%;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 900;
    padding: 5px 6px;
    cursor: pointer;
    margin-top: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    transition: transform 0.1s;
}

.inv-animal-sell-btn:active {
    transform: scale(0.95);
}

/* ==============================================================
   30 THEMES MODAL CARDS (2-Mix Color Swatches & Scenery Previews)
   ============================================================== */
.themes-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    width: 100%;
}

.theme-picker-card {
    background: #ffffff;
    border: 2px solid #e2d9cc;
    border-radius: 14px;
    padding: 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 3px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: transform 0.1s, border-color 0.15s, box-shadow 0.15s;
    position: relative;
}

.theme-picker-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.theme-picker-card.active {
    border-color: #16a34a;
    background: #f0fdf4;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25);
}

.theme-swatch-box {
    width: 100%;
    height: 30px;
    border-radius: 8px;
    display: flex;
    overflow: hidden;
    margin-bottom: 2px;
    border: 1px solid rgba(0,0,0,0.1);
}

.theme-swatch-half {
    flex: 1;
    height: 100%;
}

.theme-name-title {
    font-size: 0.78rem;
    font-weight: 900;
    color: #1e293b;
    line-height: 1.15;
}

.theme-bonus-badge {
    font-size: 0.62rem;
    font-weight: 800;
    color: #047857;
    background: #ecfdf5;
    padding: 2px 6px;
    border-radius: 6px;
    margin: 2px 0;
}

.theme-status-pill {
    font-size: 0.68rem;
    font-weight: 900;
    margin-top: 3px;
}

/* Scenery Cloud Drift Keyframe Animations */
@keyframes cloudDrift1 {
    0% { transform: translateX(0); }
    50% { transform: translateX(25px); }
    100% { transform: translateX(0); }
}

@keyframes cloudDrift2 {
    0% { transform: translateX(0); }
    50% { transform: translateX(-35px); }
    100% { transform: translateX(0); }
}

@keyframes cloudDrift3 {
    0% { transform: translateX(0); }
    50% { transform: translateX(40px); }
    100% { transform: translateX(0); }
}

.cloud-1 {
    animation: cloudDrift1 14s ease-in-out infinite;
}

.cloud-2 {
    animation: cloudDrift2 18s ease-in-out infinite;
}

.cloud-3 {
    animation: cloudDrift3 22s ease-in-out infinite;
}
