* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

body {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    min-height: 100vh;
    padding: 20px;
    color: #2c3e2f;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: rgba(255,255,255,0.95);
    border-radius: 32px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(2px);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
    padding: 1.5rem 2rem;
    color: white;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

header h1 {
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stats-bar {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.stat {
    background: rgba(255,255,255,0.15);
    padding: 0.5rem 1rem;
    border-radius: 40px;
    text-align: center;
    min-width: 100px;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    opacity: 0.9;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffeb3b;
}

.time-control {
    margin-top: 0.5rem;
    width: 100%;
}

.next-day-timer {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0,0,0,0.2);
    padding: 0.5rem 1rem;
    border-radius: 40px;
}

.timer-bar {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    overflow: hidden;
}

.timer-progress {
    height: 100%;
    background: #ffeb3b;
    width: 0%;
    transition: width 1s linear;
}

.game-area {
    display: flex;
    padding: 2rem;
    gap: 2rem;
}

.main-game {
    flex: 3;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.farm-section {
    background: #f9fbe7;
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 8px 16px rgba(0,0,0,0.05);
}

.farm-section h2 {
    color: #2e7d32;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.farm-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.farmland {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
    background: #e8f5e9;
    padding: 1rem;
    border-radius: 20px;
}

.plot {
    background: linear-gradient(145deg, #c5e1a5, #aed581);
    border-radius: 16px;
    padding: 1rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid #81c784;
    position: relative;
    min-height: 110px;
}

.plot:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.plot.empty {
    background: #d7ccc8;
    border: 2px dashed #8d6e63;
}

.plot.owned {
    background: #a5d6a7;
}

.plot.planted {
    background: #c8e6c9;
}

.plot.sick {
    background: #d7ccc8;
    border-color: #d32f2f;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.plot-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.plot-info {
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255,255,255,0.8);
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
}

.crop-stage {
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 0.7rem;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
}

.water-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    color: #2196f3;
    font-size: 1rem;
}

.sick-indicator {
    position: absolute;
    top: 5px;
    left: 5px;
    color: #d32f2f;
    font-size: 1rem;
}

.farm-info {
    background: #f1f8e9;
    padding: 1rem;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.season-display {
    display: flex;
    gap: 1rem;
    font-weight: 500;
}

.events-log {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.05);
    overflow: hidden;
}

.events-log h3 {
    background: #8d6e63;
    color: white;
    padding: 1rem;
    margin: 0;
}

.log-controls {
    padding: 0.5rem 1rem;
    background: #f5f5f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.log-content {
    height: 250px;
    overflow-y: auto;
    padding: 1rem;
    background: #fafafa;
}

.log-entry {
    padding: 0.5rem;
    border-left: 4px solid #8d6e63;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.side-panel {
    flex: 2;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.shop-section, .trade-section, .inventory-section, .action-section {
    background: white;
    border-radius: 24px;
    padding: 1.25rem;
    box-shadow: 0 8px 16px rgba(0,0,0,0.05);
}

.shop-section h2, .trade-section h2, .inventory-section h2, .action-section h2 {
    color: #2e7d32;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

.crop-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filter-btn, .trade-tab {
    background: #e0e0e0;
    border: none;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.filter-btn.active, .trade-tab.active {
    background: #4caf50;
    color: white;
}

.crops-list, .inventory, .market-items, .merchant-items, .auction-items, .listed-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 280px;
    overflow-y: auto;
}

.crop-item, .inventory-item, .market-item, .merchant-item, .auction-item, .listed-item {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #4caf50;
    transition: all 0.2s;
}

.crop-item:hover, .inventory-item:hover {
    transform: translateX(4px);
}

.crop-name, .inventory-name {
    font-weight: 600;
}

.crop-price, .inventory-amount {
    color: #ff9800;
    font-weight: bold;
}

.storage-info {
    background: #f0f0f0;
    padding: 0.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.storage-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.storage-progress {
    height: 100%;
    background: #4caf50;
    width: 0%;
    transition: width 0.3s;
}

.trade-panel {
    display: none;
}

.trade-panel.active {
    display: block;
}

.market-item, .merchant-item {
    justify-content: space-between;
    cursor: pointer;
}

.market-item .item-price, .merchant-item .item-price {
    font-weight: bold;
    color: #ff9800;
}

.auction-control {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.auction-control input, .auction-control select {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    flex: 1;
}

.listed-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff3e0;
    border-left-color: #ff9800;
}

.listed-item .price {
    font-weight: bold;
    color: #ff9800;
}

.listed-item .days-left {
    font-size: 0.8rem;
    color: #666;
}

.btn {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    border: none;
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.btn-small {
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
}

.btn-large {
    width: 100%;
    justify-content: center;
}

.dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.dialog-content {
    background: white;
    border-radius: 32px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 1.5rem;
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
}

.factory-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.factory-tab {
    background: #e0e0e0;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 20px;
    cursor: pointer;
}

.factory-tab.active {
    background: #4caf50;
    color: white;
}

.tab-content {
    display: none;
}

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

.factory-product {
    background: #f9f9f9;
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.product-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.product-name {
    font-weight: bold;
}

.product-price {
    color: #ff9800;
}

.processing-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.processing-progress {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.processing-progress-bar {
    height: 100%;
    background: #4caf50;
    width: 0%;
}

.skin-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px,1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.skin-item {
    background: #f5f5f5;
    border-radius: 16px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
}

.skin-item.unlocked:hover {
    border-color: #4caf50;
    transform: translateY(-2px);
}

.skin-item.selected {
    border-color: #4caf50;
    background: #e8f5e9;
}

.skin-preview {
    height: 80px;
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

.skin-name {
    font-weight: bold;
}

@media (max-width: 1200px) {
    .game-area { flex-direction: column; }
    .farmland { grid-template-columns: repeat(4,1fr); }
}
@media (max-width: 768px) {
    .farmland { grid-template-columns: repeat(3,1fr); }
    .stats-bar { flex-wrap: wrap; justify-content: center; }
}
