:root {
    --font-pixel: 'Press Start 2P', cursive;
    --bg-color-top: #74b9ff;
    --bg-color-bottom: #a29bfe;
    --grid-bg: #6D4C41; /* Darker soil for the container */
    --soil-color: #A1887F; /* Lighter soil for the cell */
    --plant-color-start: #D7CCC8; /* Seedling color */
    --plant-color-end: #66BB6A; /* Default plant green */
    --mature-color: #FFEE58; /* Default mature yellow */
    --border-color: #4E342E;
    --text-color: #2d3436;
    --accent-color: #fd79a8;
    --white: #ffffff;
    --shop-bg: #FAF3E0;
    --shop-header: #E67E22;
    --button-bg: #fff;
    --button-hover: #f1f2f6;
    --button-border: #dfe6e9;
    --panel-width: 350px; /* Define a variable for both shop and inventory width */
    --selected-border: #00cec9; /* Highlight color for selected item */
    --powerup-header: #8e44ad; /* Purple for powers */
    --inventory-bg: #ecf0f1;
    --inventory-border: #bdc3c7;
    --grid-cell-border: #4E342E; /* New variable for grid cell border */
    --grid-hover-shadow: #7FFF00; /* New variable for grid hover shadow */
    --show-more-btn-bg: #3498db; /* Blue for show more button */
    --show-more-btn-hover: #2980b9;
    --coin-bg: #ffeaa7; /* Background for coin display */
    --settings-bg: #D1C4E9; /* Light purple for settings */
    --settings-header: #512DA8; /* Dark purple for settings header */
    --difficulty-easy: #8BC34A;
    --difficulty-normal: #FFEB3B;
    --difficulty-hard: #F44336;
}

body {
    font-family: Arial, sans-serif;
    background-image: linear-gradient(to bottom, var(--bg-color-top), var(--bg-color-bottom));
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

#game-container {
    width: 100%;
    max-width: 1000px;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex; /* Use flexbox for inner layout */
    flex-direction: column;
    align-items: center;
}

header {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px dashed rgba(255,255,255,0.5);
    display: flex; /* Use flex for header elements */
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

header h1 {
    margin: 0;
    color: var(--white);
    font-family: var(--font-pixel);
    font-size: 2.5em;
    text-shadow: 3px 3px 0px var(--border-color);
}

#stats-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px; /* Allow wrapping on smaller screens */
    flex-wrap: wrap; /* Allow wrapping of buttons */
}

#score-container {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--coin-bg); /* Use the new coin-bg variable */
    padding: 10px 20px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    box-shadow: 2px 2px 0px rgba(0,0,0,0.2);
    font-family: var(--font-pixel);
    font-size: 1.5em;
    color: var(--text-color);
    white-space: nowrap; /* Prevent text wrapping */
}

#open-shop-btn,
#harvest-all-btn,
#open-inventory-btn,
#open-settings-btn {
    font-family: var(--font-pixel);
    font-size: 0.8em;
    padding: 10px 15px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    background-color: #ffd700;
    color: var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 3px 3px 0px var(--border-color); /* Added shadow for depth */
}

#open-shop-btn:hover,
#harvest-all-btn:hover,
#open-inventory-btn:hover,
#open-settings-btn:hover {
    background-color: #ffec8b;
    transform: translateY(-2px);
    box-shadow: 5px 5px 0px var(--border-color); /* Larger shadow on hover */
}

#open-shop-btn:active,
#harvest-all-btn:active,
#open-inventory-btn:active,
#open-settings-btn:active {
    transform: translateY(1px);
    box-shadow: 2px 2px 0px var(--border-color); /* Smaller shadow on click */
}

#harvest-all-btn.hidden {
    display: none;
}

#game-body {
    display: flex;
    gap: 20px;
    width: 100%; /* Take full width */
    justify-content: center;
    align-items: flex-start;
    position: relative; /* Needed for shop panel positioning */
    flex-wrap: wrap; /* Allow wrapping for responsiveness */
}

main {
    flex-shrink: 0;
    display: flex; /* Flex container for grid and plot button */
    flex-direction: column;
    align-items: center;
    gap: 15px; /* Space between grid and button */
}

#garden-grid {
    display: grid;
    /* grid-template-columns and grid-template-rows will be set by JS */
    gap: 10px;
    background-color: var(--grid-bg);
    padding: 10px;
    border-radius: 10px;
    border: 5px solid var(--border-color);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    image-rendering: pixelated; /* Ensure pixelated rendering for grid */
}

.cell {
    width: 60px;
    height: 60px;
    background-color: var(--soil-color);
    border: 2px solid var(--grid-cell-border); /* Use new variable */
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.5s ease, transform 0.2s ease, box-shadow 0.2s ease; /* Add box-shadow to transition */
    position: relative;
    overflow: hidden;
    image-rendering: pixelated;
    background-size: 40px 40px;
    background-position: center;
    background-repeat: no-repeat;
    /* Add for plant growth animation */
    background-origin: content-box; /* Ensures background-size behaves relative to padding/border */
    transform-origin: bottom center; /* For vertical growth animation */
}

.cell:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--grid-hover-shadow); /* Use new variable for hover */
}

.cell .weed {
    position: absolute;
    width: 40px;
    height: 40px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-image: url('weed.png');
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    filter: drop-shadow(2px 2px 0px rgba(0,0,0,0.3));
}

/* Add style for the water effect div */
.cell .water-effect {
    position: absolute;
    /* Styles are added inline by JS, but define base class */
    pointer-events: none;
    z-index: 5;
}

.cell.mature {
    /* Mature style is now applied conditionally in JS */
}

.progress-bar {
    position: absolute;
    bottom: 2px;
    left: 5%;
    width: 90%;
    height: 6px;
    background-color: rgba(0,0,0,0.4);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    z-index: 1; /* Ensure progress bar is below bee/weed */
}

.progress-bar-inner {
    height: 100%;
    width: 0;
    background-color: var(--plant-color-end); /* This will be overridden by JS lerpColor */
    border-radius: 2px;
    transition: width 0.3s linear; /* Smoother growth update */
}

.bee {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    background-image: url('bee.png');
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    animation: bee-fly 3s linear infinite; /* Make bee animation loop */
    z-index: 10;
    filter: drop-shadow(2px 2px 0px rgba(0,0,0,0.3));
}

@keyframes bee-fly {
    0% { transform: translate(-50%, -50%) rotate(0deg) translateX(10px) rotate(0deg); } /* Adjusted range slightly */
    100% { transform: translate(-50%, -50%) rotate(360deg) translateX(10px) rotate(-360deg); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 5px var(--mature-color), inset 0 0 5px var(--mature-color); }
    50% { box-shadow: 0 0 20px var(--mature-color), inset 0 0 10px var(--mature-color); }
    100% { box-shadow: 0 0 5px var(--mature-color), inset 0 0 5px var(--mature-color); }
}

/* Shop Panel Styles */
#shop-panel,
#inventory-panel,
#settings-panel {
    position: fixed; /* Changed to fixed for consistent positioning */
    top: 0;
    right: 0;
    height: 100%;
    width: var(--panel-width); /* Fixed width */
    background-color: var(--shop-bg);
    padding: 15px;
    border-radius: 0; /* No border-radius for fixed full-height panels */
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    border-left: 3px solid var(--border-color); /* Only left border */
    box-sizing: border-box;
    transform: translateX(100%); /* Initially hidden */
    transition: transform 0.3s ease-out;
    z-index: 20; /* Ensure it's above the garden */
    overflow-y: auto; /* Allow scrolling if content overflows */
    display: flex; /* Use flex column for internal layout */
    flex-direction: column;
    align-items: center;
}

#shop-panel.visible,
#inventory-panel.visible,
#settings-panel.visible {
    transform: translateX(0); /* Slide in */
}

#shop-container,
#inventory-container,
#settings-container {
    /* This container now just holds the content inside the panel */
    width: 100%;
    position: relative; /* For close button positioning */
     /* Removed display flex column and height 100% */
}

#settings-panel {
    background-color: var(--settings-bg);
}

#shop-container h2, #shop-container h3, #shop-container h4,
#inventory-container h2, #inventory-container h3, #inventory-container h4,
#settings-container h2, #settings-container h3 {
    text-align: center;
    margin-top: 0;
    color: var(--shop-header);
    font-family: var(--font-pixel);
    font-size: 1.5em;
    margin-bottom: 15px;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
}

#shop-container h3,
#inventory-container h3,
#settings-container h3 {
   font-size: 1.2em;
   color: #c0392b; /* Red for upgrades/seeds category? */
   margin-bottom: 10px;
   border-bottom: 2px dashed var(--button-border);
   padding-bottom: 5px;
}

#settings-container h2 {
    color: var(--settings-header);
}
#settings-container h3 {
    color: var(--settings-header);
    border-color: var(--border-color);
}

#shop-container h4,
#inventory-container h4 {
    font-size: 1em;
    color: var(--powerup-header); /* Purple for Inventory */
    margin-top: 20px;
    margin-bottom: 10px;
    text-shadow: none;
    border-bottom: 2px dashed var(--button-border);
    padding-bottom: 5px;
}


.close-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--border-color);
    color: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 5px;
    width: 25px;
    height: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9em;
    transition: background-color 0.2s ease;
    z-index: 21; /* Ensure it's above everything in the panel */
    font-family: sans-serif; /* Ensure 'X' is readable */
}

.close-btn:hover {
    background-color: #e74c3c;
}


.dev-credit {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 2px dashed var(--button-border);
    font-size: 0.8em;
    text-align: center;
    color: var(--text-color);
}

.dev-credit a {
    color: var(--accent-color);
    font-weight: bold;
    text-decoration: none;
    transition: color 0.2s ease;
}

.dev-credit a:hover {
    color: var(--shop-header);
    text-decoration: underline;
}

.shop-category,
.settings-section {
    margin-bottom: 20px;
    width: 100%; /* Ensure categories take full width */
    color: var(--text-color);
}

.settings-section p {
    font-size: 0.9em;
    margin: 5px 0;
    text-align: center;
}

.volume-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 5px;
    border: 1px solid var(--button-border);
    border-radius: 5px;
    background-color: var(--white);
}

.volume-control label {
    font-size: 0.8em;
    font-weight: bold;
}

.volume-control input[type="range"] {
    width: 60%;
    height: 5px;
    background: var(--border-color);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: 2px solid var(--border-color);
}

.volume-control input[type="range"]::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    border: 2px solid var(--border-color);
}

.difficulty-control {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.difficulty-btn {
    font-family: var(--font-pixel);
    font-size: 0.7em;
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    color: var(--white);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 2px 2px 0px var(--border-color);
}

.difficulty-btn[data-difficulty="easy"] {
    background-color: var(--difficulty-easy);
}
.difficulty-btn[data-difficulty="normal"] {
    background-color: var(--difficulty-normal);
    color: var(--text-color); /* Normal text might need darker color */
}
.difficulty-btn[data-difficulty="hard"] {
    background-color: var(--difficulty-hard);
}

.difficulty-btn:hover:not(.selected-difficulty) {
    transform: translateY(-1px);
    box-shadow: 3px 3px 0px var(--border-color);
    opacity: 0.9;
}

.difficulty-btn.selected-difficulty {
    border-color: var(--accent-color);
    box-shadow: 2px 2px 0px var(--accent-color);
    transform: translateY(1px);
    background-color: #f0f0f0; /* Light highlight for selected */
    color: var(--text-color);
}

/* New style for shop item lists (containers for actual items) */
.shop-item-list {
    display: flex;
    flex-direction: column;
    gap: 10px; /* Consistent spacing */
    max-height: 250px; /* Fixed height for initial view */
    overflow: hidden; /* Hide overflow initially */
    transition: max-height 0.3s ease-out; /* Smooth transition */
}

.shop-item-list.expanded {
    max-height: 1000px; /* Large enough to show all items */
}


.shop-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px;
    /* Removed margin-bottom here, using gap on parent */
    border: 2px solid var(--button-border);
    border-radius: 8px;
    background-color: var(--button-bg);
    cursor: pointer;
    font-size: 1em;
    text-transform: none; /* Prevent font-pixel causing uppercase issues */
    text-align: left;
    transition: all 0.2s ease;
    box-shadow: 3px 3px 0px var(--button-border);
    font-family: sans-serif;
}

.shop-item.selected {
    border-color: var(--selected-border);
    box-shadow: 3px 3px 0px var(--selected-border);
    background-color: #e0f7fa; /* Light highlight */
}

.shop-item:hover:not(:disabled):not(.selected) {
    background-color: var(--button-hover);
    transform: translateY(-2px) translateX(-2px);
    box-shadow: 5px 5px 0px var(--button-border);
}

.shop-item.selected:hover:not(:disabled) {
     background-color: #b2ebf2; /* Darker highlight on hover */
     transform: translateY(-2px) translateX(-2px);
     box-shadow: 5px 5px 0px var(--selected-border);
}


.shop-item:active:not(:disabled) {
    transform: translateY(1px) translateX(1px);
    box-shadow: 2px 2px 0px var(--button-border);
}

.shop-item.selected:active:not(:disabled) {
     transform: translateY(1px) translateX(1px);
     box-shadow: 2px 2px 0px var(--selected-border);
}


.shop-item:disabled {
    background-color: #e0e0e0;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
    transform: none;
}

.shop-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.inventory-count {
    color: var(--text-color);
    background-color: var(--button-border);
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.8em;
    margin-left: 5px;
    font-weight: normal;
}

.shop-item-name {
    font-weight: bold;
    font-size: 0.9em;
}

.shop-item-details {
    text-align: right;
    flex-shrink: 0; /* Prevent shrinking */
    margin-left: 10px; /* Add space */
}

.shop-item-details small {
    display: block;
    font-size: 0.8em;
    color: #7f8c8d;
    margin-bottom: 2px;
}

.shop-item-cost {
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
    white-space: nowrap; /* Prevent cost from wrapping */
    background-color: transparent; /* Ensure no background for cost display */
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}


.icon {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
}

.icon.small-coin {
    width: 16px;
    height: 16px;

}
.icon.small-icon {
     width: 24px;
     height: 24px;
}

#selected-seed-container {
    margin-top: 15px;
    padding: 10px;
    border: 2px dashed var(--button-border);
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    background-color: #fff9e6;
}

#selected-seed-name {
    color: var(--accent-color);
    font-family: var(--font-pixel);
    font-size: 0.9em;
}

/* Consumable Inventory Styles (now in inventory-panel) */
#consumable-inventory-container {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 2px dashed var(--button-border);
    width: 100%;
}

#consumable-inventory-list {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 10px;
    background-color: var(--inventory-bg);
    border: 2px solid var(--inventory-border);
    border-radius: 8px;
}

.inventory-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    position: relative;
}

.inventory-item.hidden {
    display: none;
}

.inventory-item .use-item-btn {
     background: none;
     border: none;
     padding: 0;
     cursor: pointer;
     position: relative; /* For count badge */
     display: block; /* To make the button wrap its content correctly */
     transition: transform 0.1s ease;
     filter: drop-shadow(2px 2px 0px rgba(0,0,0,0.2));
}
.inventory-item .use-item-btn:hover:not(:disabled) {
    transform: scale(1.1);
}
.inventory-item .use-item-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.inventory-item .use-item-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
     filter: none;
     transform: none;
}

.inventory-item .item-count {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background-color: var(--powerup-header);
    color: var(--white);
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.7em;
    font-weight: bold;
    border: 1px solid var(--border-color);
    z-index: 5;
    min-width: 15px; /* Ensure minimum width */
    text-align: center;
}


/* Responsive Design */
@media (max-width: 820px) {
    body {
        padding: 10px;
    }
     #game-container {
        padding: 10px;
    }
    #game-body {
        flex-direction: column;
        align-items: center;
        gap: 10px; /* Reduce gap */
    }
     #shop-panel,
     #inventory-panel,
     #settings-panel {
        position: fixed; /* Still fixed on smaller screens */
        top: 0;
        left: 0; /* Cover full width */
        width: 100%;
        height: 100%;
        max-width: none;
        border-radius: 0;
        border: none;
        box-shadow: none;
        transform: translateX(100%);
    }

     #shop-panel.visible,
     #inventory-panel.visible,
     #settings-panel.visible {
         transform: translateX(0);
     }


     #shop-container,
     #inventory-container,
     #settings-container {
         padding: 10px; /* Adjust padding */
     }


    #garden-grid {
        /* grid-template-columns and grid-template-rows will be set by JS */
         gap: 8px; /* Reduce gap */
    }
    .cell {
        width: 50px;
        height: 50px;
    }
     header h1 {
        font-size: 2em;
    }

    #stats-container {
        gap: 10px;
    }

    #score-container {
        font-size: 1.2em;
         padding: 8px 15px;
         gap: 8px;
    }
     #open-shop-btn,
     #harvest-all-btn,
     #open-inventory-btn,
     #open-settings-btn,
     #buy-plot-btn { /* Add plot button here */
         font-size: 0.7em;
         padding: 8px 12px;
         gap: 6px;
     }
     .icon {
         width: 24px;
         height: 24px;
     }
      .icon.small-coin {
        width: 14px;
        height: 14px;
      }
       .icon.small-icon {
         width: 20px;
         height: 20px;
     }
    .shop-item {
        padding: 8px;
        font-size: 0.9em;
    }
     .shop-item-name {
        font-size: 0.8em;
     }
     .shop-item-details small {
        font-size: 0.7em;
     }
      #shop-container h2, #inventory-container h2, #settings-container h2 {
        font-size: 1.2em;
      }
      #shop-container h3, #inventory-container h3, #settings-container h3 {
         font-size: 1em;
      }
      #shop-container h4, #inventory-container h4 {
          font-size: 0.9em;
      }

      #consumable-inventory-list {
        gap: 10px;
      }
       .inventory-item .item-count {
           font-size: 0.6em;
           padding: 1px 4px;
       }

       .volume-control {
           flex-direction: column;
           align-items: flex-start;
           gap: 5px;
       }
       .volume-control input[type="range"] {
           width: 100%;
       }


}

@media (max-width: 420px) {
    #garden-grid {
        width: calc(100vw - 40px);
        height: calc(100vw - 40px);
        /* Grid template will be dynamically set, so remove fixed values */
        /* grid-template-columns: repeat(5, 1fr); */
        /* grid-template-rows: repeat(5, 1fr); */
        gap: 5px;
    }
    .cell {
        width: auto;
        height: auto;
    }
     header h1 {
        font-size: 1.8em;
    }
     #stats-container {
         flex-direction: column; /* Stack buttons/score */
     }
      #score-container {
          font-size: 1em;
      }
      #open-shop-btn, #harvest-all-btn, #open-inventory-btn, #open-settings-btn, #buy-plot-btn { /* Add plot button here */
          font-size: 0.6em;
      }
       .icon {
         width: 20px;
         height: 20px;
     }
      .icon.small-coin {
        width: 12px;
        height: 12px;
      }
      .icon.small-icon {
         width: 18px;
         height: 18px;
     }
      .shop-item {
        flex-direction: column; /* Stack info and details */
        align-items: flex-start;
        gap: 5px;
      }
      .shop-item-info {
        width: 100%;
         justify-content: space-between;
      }
      .shop-item-details {
        width: 100%;
        text-align: left;
        margin-left: 0;
        padding-left: calc(24px + 10px); /* Align with icon + gap */
        box-sizing: border-box;
      }
       .shop-item-cost {
           justify-content: flex-start;
       }

       #consumable-inventory-list {
        gap: 8px;
         padding: 8px;
       }
}

/* Seed Inventory specific styles */
#seed-inventory-container {
    margin-top: 20px;
    padding-top: 10px;
    border-top: 2px dashed var(--button-border);
    width: 100%;
}

#seed-inventory-list {
    display: flex;
    flex-wrap: wrap; /* Allow items to wrap */
    justify-content: center;
    gap: 10px; /* Smaller gap for more items */
    padding: 10px;
    background-color: var(--inventory-bg);
    border: 2px solid var(--inventory-border);
    border-radius: 8px;
}

.inventory-seed-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 60px; /* Fixed width for seed items */
    height: 60px; /* Fixed height for seed items */
    background-color: var(--button-bg);
    border: 2px solid var(--button-border);
    border-radius: 8px;
    box-shadow: 2px 2px 0px var(--button-border);
    transition: all 0.1s ease;
}

.inventory-seed-item.hidden {
    display: none;
}

.inventory-seed-item .select-seed-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

/* New class for selected seed button (active state) */
.inventory-seed-item .select-seed-btn.selected-seed-btn-active {
    border: 2px solid var(--selected-border); /* Apply selected border to the button itself */
    box-shadow: 2px 2px 0px var(--selected-border);
    background-color: #e0f7fa; /* Light highlight */
}

.inventory-seed-item .select-seed-btn:hover:not(:disabled) {
    transform: scale(1.05);
    filter: drop-shadow(3px 3px 0px rgba(0,0,0,0.2));
}
.inventory-seed-item .select-seed-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.inventory-seed-item .select-seed-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.inventory-seed-item .seed-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--accent-color);
    color: var(--white);
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.7em;
    font-weight: bold;
    border: 1px solid var(--border-color);
    z-index: 5;
    min-width: 15px;
    text-align: center;
}

/* Plot Purchase Button */
#plot-purchase-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

#buy-plot-btn {
    font-family: var(--font-pixel);
    font-size: 0.8em;
    padding: 10px 15px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    background-color: #4CAF50; /* Green button */
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 3px 3px 0px var(--border-color);
}

#buy-plot-btn:hover:not(:disabled) {
    background-color: #66BB6A;
    transform: translateY(-2px);
    box-shadow: 5px 5px 0px var(--border-color);
}

#buy-plot-btn:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 2px 2px 0px var(--border-color);
}

#buy-plot-btn:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    opacity: 0.8;
    box-shadow: none;
    transform: none;
}

#buy-plot-btn.hidden {
    display: none;
}

/* Show More Button */
.show-more-btn {
    font-family: var(--font-pixel);
    font-size: 0.7em;
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    background-color: var(--show-more-btn-bg);
    color: var(--white);
    cursor: pointer;
    width: 100%;
    margin-top: 10px; /* Space above button */
    transition: all 0.2s ease;
    box-shadow: 2px 2px 0px var(--border-color);
}

.show-more-btn:hover {
    background-color: var(--show-more-btn-hover);
    transform: translateY(-1px);
    box-shadow: 3px 3px 0px var(--border-color);
}

.show-more-btn:active {
    transform: translateY(1px);
    box-shadow: 1px 1px 0px var(--border-color);
}

/* This class will be applied by JS to mature plants, overriding the growing animation */
.cell.plant-icon {
    animation: none; /* Remove growing animation once icon is set */
    background-size: 40px 40px; /* Reset to normal icon size */
    background-position: center; /* Reset to normal icon position */
    transform: scaleY(1); /* Ensure it's fully scaled */
    opacity: 1; /* Ensure full opacity */
}

/* Style for newly planted seed visual */
.cell.newly-planted {
    background-size: 16px 16px; /* Smaller initial size for seed packet */
    background-position: center;
    background-repeat: no-repeat;
    animation: none; /* No grow animation for the seed packet itself */
}