* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

#game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #4a5568;
    font-size: 2.5em;
    display: flex;
    align-items: center;
    gap: 10px;
}

#titles-display {
    font-size: 0.5em; /* Smaller for titles */
    color: #764ba2;
    background: #e2e8f0;
    padding: 5px 10px;
    border-radius: 10px;
    font-weight: bold;
    white-space: nowrap;
}

#stats {
    display: flex;
    align-items: center;
    gap: 20px;
}

#stats span {
    margin-left: 0; /* Remove extra margin */
    font-weight: bold;
    font-size: 1.2em;
}

#main-area {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

#garden {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

#garden-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.garden-plot {
    aspect-ratio: 1;
    background: #8B4513;
    border: 2px solid #654321;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    position: relative;
}

.garden-plot:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.garden-plot.planted {
    background: #90EE90;
}

.garden-plot.golden-plant {
    /* Style for golden plants */
    background: linear-gradient(45deg, #FFD700, #FFEA00); /* Golden gradient */
    border-color: #DAA520; /* Darker gold border */
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6); /* Golden glow */
}

.plant-growth {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.8em;
}

#side-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#weather-display,
#action-buttons,
#plant-info,
#inventory-container,
#harvested-plants-container,
#active-gears-container,
#active-pets-container,
#crafting-status-container { /* Added new container */
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

#inventory-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

#harvested-plants-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

#active-gear-items { /* New styles for active gear display */
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

#active-pets-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.inventory-item {
    padding: 10px;
    background: #e2e8f0;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    cursor: grab;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 5px;
    user-select: none;
    transition: transform 0.1s ease-in-out;
}

.inventory-item.active-gear-item,
.inventory-item.active-pet-item {
    cursor: default;
    background: #d4edda; /* Lighter green for active gears */
    border-color: #28a745;
    flex-direction: column; /* Stack name and timer */
    align-items: flex-start;
    font-size: 1em;
    gap: 2px;
}

.golden-indicator {
    font-size: 0.8em;
    color: #FFD700;
    text-shadow: 0 0 3px #DAA520;
    margin-left: 5px;
}

.inventory-item:hover {
    transform: translateY(-2px);
}

.inventory-item.dragging {
    opacity: 0.7;
    cursor: grabbing;
}

.action-btn {
    width: 100%;
    margin: 5px 0;
    padding: 15px;
    font-size: 1.1em;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.header-btn { /* New style for header buttons */
    padding: 10px 15px;
    font-size: 1em;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: transform 0.3s ease;
    margin-left: 10px;
}

.header-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border-radius: 15px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

#seed-shop-countdown-container {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: bold;
    color: #4a5568;
}

#seed-shop-countdown-timer {
    color: #764ba2;
}

.shop-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin: 10px 0;
    background: #f7fafc;
    border-radius: 10px;
    transition: background 0.3s ease;
}

.shop-item:hover {
    background: #edf2f7;
}

.buy-btn {
    padding: 8px 16px;
    background: #48bb78;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.buy-btn:hover {
    background: #38a169;
}

.sell-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background: #f7fafc;
    border-radius: 5px;
}

.sell-btn {
    padding: 5px 10px;
    background: #ed8936;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.weather-icon {
    font-size: 2em;
    margin-left: 10px;
}

.garden-plot.drag-over {
    background-color: #c6f6d5;
    border-color: #38a169;
}

.growth-tooltip {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.9em;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    z-index: 1001;
    white-space: nowrap;
}

.growth-tooltip.visible {
    opacity: 1;
}

/* Tutorial Modal Styles: Changed to be a smaller pop-up that doesn't cover the screen */
.tutorial-modal {
    /* Override standard .modal properties for the tutorial pop-up */
    position: fixed; /* Keep fixed to viewport, but not full screen */
    left: unset; /* Remove left: 0 */
    top: unset; /* Remove top: 0 */
    width: auto; /* Let content determine width */
    height: auto; /* Let content determine height */
    background-color: transparent; /* Make the overlay transparent */
    z-index: 999; /* Ensure it's above game elements but possibly below other modals */

    /* Position the pop-up in the bottom right corner */
    bottom: 20px;
    right: 20px;

    /* Allows clicks to pass through the transparent background of this modal */
    pointer-events: none;
    /* Do NOT set display: block/none here, let JS handle it */
}

.tutorial-modal .modal-content {
    /* Styles for the actual content box within the tutorial modal */
    margin: 0; /* Override margin: 5% auto; */
    width: auto; /* Override width: 80% */
    max-width: 350px; /* Smaller pop-up size */
    max-height: 200px; /* Constrain height */
    min-width: 250px; /* Minimum width for readability */
    
    padding: 15px; /* Adjust padding */
    text-align: left; /* Align text to left for better readability in a small box */
    
    border: 3px solid #764ba2;
    background-color: #f0f8ff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);

    /* Re-enable pointer events for the actual content box */
    pointer-events: auto;
}

.tutorial-modal h2 {
    color: #4a5568;
    margin-bottom: 10px; /* Adjust margin */
    font-size: 1.5em; /* Smaller font size */
}

#tutorial-message {
    font-size: 1.1em; /* Smaller font size */
    color: #333;
    line-height: 1.4;
}

/* New: Context Menu for Plot Actions */
.context-menu {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1050; /* Above other modals if needed */
    border-radius: 8px;
    overflow: hidden;
    padding: 5px 0;
}

.context-menu button {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 1em;
}

.context-menu button:hover {
    background-color: #f1f1f1;
}

/* Admin Panel Specific Styles */
#admin-modal .modal-content {
    max-width: 700px; /* Wider for more controls */
}

#admin-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#admin-actions h3 {
    color: #555;
    margin-bottom: 5px;
}

#admin-actions select,
#admin-actions input[type="number"] {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-right: 10px;
}

#admin-actions button {
    padding: 8px 15px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#admin-actions button:hover {
    background: #0056b3;
}

/* Weather Changer Modal Styles */
#weather-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

#weather-options .action-btn {
    width: calc(33% - 10px); /* 3 buttons per row roughly */
    padding: 10px;
    font-size: 1em;
    white-space: nowrap;
}

/* Achievement Modal Styles */
#achievements-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.achievement-item {
    background-color: #e6eef7;
    border: 1px solid #c9dff0;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.achievement-item.unlocked {
    background-color: #d4edda;
    border-color: #28a745;
}

.achievement-item .status-icon {
    font-size: 1.5em;
    margin-left: 10px;
}

/* Exchange Options Styles */
#exchange-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.exchange-option {
    background-color: #f7fafc;
    border: 1px solid #e2e8f0;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

.exchange-option h4 {
    color: #4a5568;
    margin-bottom: 5px;
}

.exchange-option p {
    font-size: 0.9em;
    color: #555;
    flex-grow: 1;
}

.exchange-option button {
    padding: 10px 15px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s;
}

.exchange-option button:hover {
    background-color: #45a049;
}

.exchange-option button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Crafter styles */
#crafting-recipes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.crafting-recipe-item {
    background-color: #f7fafc;
    border: 1px solid #e2e8f0;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.crafting-recipe-item .craft-ingredients {
    font-size: 0.85em;
    color: #666;
}

.crafting-recipe-item button {
    padding: 8px 12px;
    background-color: #008CBA;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s;
}

.crafting-recipe-item button:hover {
    background-color: #007bb5;
}

.crafting-recipe-item button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#current-craft-info {
    margin-top: 10px;
    padding: 10px;
    background-color: #f0f8ff;
    border: 1px solid #d0e0f0;
    border-radius: 8px;
    text-align: center;
    font-size: 1.1em;
}

.craft-progress-bar-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 5px;
    margin-top: 5px;
    height: 20px;
    overflow: hidden;
}

.craft-progress-bar {
    height: 100%;
    background-color: #4CAF50;
    width: 0%;
    border-radius: 5px;
    text-align: center;
    color: white;
    line-height: 20px;
    font-size: 0.9em;
}

/* Pet Shop Styles (reusing shop-item for simplicity) */
#pet-shop-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}