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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #87CEEB 0%, #98FB98 100%);
    min-height: 100vh;
    padding: 20px;
}

.game-container {
    max-width: 1800px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.game-header {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-header h1 {
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.stats {
    display: flex;
    gap: 30px;
}

.stat {
    font-size: 1.2em;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.game-content {
    display: grid;
    grid-template-columns: 280px 300px 250px 1fr;
    gap: 15px;
    padding: 20px;
}

.shop {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border: 2px solid #e9ecef;
    max-height: 80vh;
    overflow-y: auto;
}

.shop h2 {
    color: #4CAF50;
    margin-bottom: 15px;
    text-align: center;
}

.seeds {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.seed-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #ddd;
    transition: transform 0.2s;
}

.seed-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.price {
    font-weight: bold;
    color: #4CAF50;
}

.buy-btn, .sell-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.buy-btn:hover, .sell-btn:hover {
    background: #45a049;
}

.buy-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.inventory {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border: 2px solid #e9ecef;
    max-height: 80vh;
    overflow-y: auto;
}

.inventory h3 {
    color: #4CAF50;
    margin-bottom: 15px;
    text-align: center;
}

.seeds-inventory, .harvest-inventory {
    margin-bottom: 15px;
}

.inventory-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background: white;
    margin-bottom: 5px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.sell-btn {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
}

.garden {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border: 2px solid #e9ecef;
}

.garden h2 {
    color: #4CAF50;
    margin-bottom: 15px;
    text-align: center;
}

.garden-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 4px;
    max-width: 100%;
    margin: 0 auto;
}

.plot {
    width: 50px;
    height: 50px;
    border: 2px solid #8B4513;
    background: #D2691E;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

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

.plot.planted {
    background: #654321;
    border-color: #4a3018;
}

.plot.growing {
    background: linear-gradient(45deg, #654321, #8B4513);
}

.plot.ready {
    background: linear-gradient(45deg, #32CD32, #228B22);
    animation: glow 1.5s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px #32CD32;
    }
    to {
        box-shadow: 0 0 20px #32CD32, 0 0 30px #32CD32;
    }
}

.growth-timer {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 10px;
    padding: 1px 3px;
    border-radius: 3px;
}

/* Upgrade System Styles */
.upgrades {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border: 2px solid #e9ecef;
    max-height: 80vh;
    overflow-y: auto;
}

.upgrades h2 {
    color: #4CAF50;
    margin-bottom: 15px;
    text-align: center;
}

.upgrade-tabs {
    display: flex;
    margin-bottom: 15px;
}

.tab-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: #e9ecef;
    cursor: pointer;
    border-radius: 5px 5px 0 0;
    font-size: 0.9em;
    transition: background 0.3s;
}

.tab-btn.active {
    background: #4CAF50;
    color: white;
}

.tab-btn:hover {
    background: #45a049;
    color: white;
}

.upgrade-content {
    min-height: 300px;
}

.upgrade-tab {
    display: none;
}

.upgrade-tab.active {
    display: block;
}

.upgrade-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 8px;
    margin-bottom: 6px;
    border-radius: 6px;
    border: 1px solid #ddd;
    transition: transform 0.2s;
}

.upgrade-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.upgrade-info {
    flex: 1;
}

.upgrade-name {
    display: block;
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 1px;
}

.upgrade-desc {
    display: block;
    font-size: 0.75em;
    color: #666;
    margin-bottom: 1px;
}

.upgrade-level {
    display: block;
    font-size: 0.7em;
    color: #888;
}

.upgrade-btn {
    background: #9C27B0;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
    min-width: 50px;
    font-size: 0.8em;
}

.upgrade-btn:hover {
    background: #7B1FA2;
}

.upgrade-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.rebirth-section {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(45deg, #FF5722, #FF7043);
    border-radius: 10px;
    color: white;
    text-align: center;
}

.rebirth-section h3 {
    margin-bottom: 10px;
}

.rebirth-section p {
    margin-bottom: 8px;
    font-size: 0.9em;
}

.rebirth-btn {
    background: linear-gradient(45deg, #F44336, #E53935);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1em;
    transition: all 0.3s;
    margin-top: 10px;
}

.rebirth-btn:hover {
    background: linear-gradient(45deg, #D32F2F, #C62828);
    transform: scale(1.05);
}

.rebirth-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 768px) {
    .game-content {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "upgrades"
            "shop"
            "inventory"
            "garden";
    }
    
    .upgrades { grid-area: upgrades; }
    .shop { grid-area: shop; }
    .inventory { grid-area: inventory; }
    .garden { grid-area: garden; }
    
    .garden-grid {
        grid-template-columns: repeat(8, 1fr);
    }
    
    .plot {
        width: 45px;
        height: 45px;
        font-size: 1.1em;
    }
}