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

body {
    background-color: #f0f5e9;
    color: #333;
    line-height: 1.6;
}

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

#game-header {
    text-align: center;
    margin-bottom: 20px;
}

#game-header h1 {
    display: none;
    color: #3e6b35;
    margin-bottom: 10px;
}

#resource-display {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 18px;
    margin-bottom: 15px;
}

#resource-display span {
    background-color: #e8f3d6;
    padding: 8px 15px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#next-day-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#next-day-btn:hover {
    background-color: #3e8e41;
}

#game-content {
    display: flex;
    gap: 20px;
}

#farm-grid-container {
    flex: 6;
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#farm-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 4px;
    height: 600px;
}

.grid-cell {
    background-color: #dbd5a4;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.grid-cell:hover {
    transform: scale(1.02);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

.grid-cell.selected {
    box-shadow: 0 0 0 3px #ffcc00;
}

.grid-cell .crop-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.grid-cell .crop-name {
    font-size: 12px;
    font-weight: bold;
    text-align: center;
}

.grid-cell .fertility-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.grid-cell .fertility-text {
    position: absolute;
    bottom: 2px;
    left: 2px;
    font-size: 10px;
    font-weight: bold;
    color: #333;
    text-shadow: 0px 0px 2px white;
}

.grid-cell .growth-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background-color: #4CAF50;
}

.grid-cell .effect-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 14px;
}

#game-panel {
    flex: 4;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#info-panel, #action-panel, #help-panel {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#info-panel h3, #action-panel h3, #help-panel h3 {
    color: #3e6b35;
    margin-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 5px;
}

#tile-info {
    min-height: 100px;
}

#crop-selection, #fertilizer-selection {
    margin-bottom: 15px;
}

#crop-selection h4, #fertilizer-selection h4 {
    margin-bottom: 8px;
    color: #555;
}

#crop-buttons, #fertilizer-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.crop-btn, .fertilizer-btn {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.crop-btn:hover, .fertilizer-btn:hover {
    background-color: #e3e3e3;
}

.crop-btn.selected {
    background-color: #d1e7dd;
    border-color: #9ecba8;
}

#action-buttons {
    display: flex;
    gap: 10px;
}

#action-buttons button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

#harvest-btn {
    background-color: #ffc107;
    color: #333;
}

#harvest-btn:hover {
    background-color: #e0a800;
}

#clear-btn {
    background-color: #dc3545;
    color: white;
}

#clear-btn:hover {
    background-color: #c82333;
}

#help-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

#help-btn:hover {
    background-color: #5a6268;
}

.harvest-all-btn {
    background-color: #ff9800;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 15px;
    transition: background-color 0.3s;
}

.harvest-all-btn:hover {
    background-color: #e68a00;
}

.tooltip {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px;
    max-width: 250px;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    font-size: 14px;
    color: #333;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.tooltip.visible {
    visibility: visible;
    opacity: 1;
}

.tooltip h4 {
    margin: 0 0 5px 0;
    color: #3e6b35;
}

.tooltip p {
    margin: 3px 0;
}

.tooltip .effect {
    font-style: italic;
    margin-top: 5px;
}

.tooltip .positive {
    color: #28a745;
}

.tooltip .negative {
    color: #dc3545;
}

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

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
}

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

.close:hover {
    color: #333;
}

.help-content {
    margin-top: 15px;
}

.help-content h3 {
    color: #3e6b35;
    margin: 15px 0 8px;
}

#crop-encyclopedia {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.crop-entry {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
}

.crop-entry h4 {
    color: #3e6b35;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.crop-entry h4 span {
    margin-right: 8px;
}

.crop-entry p {
    font-size: 14px;
    margin: 5px 0;
}

.crop-effect {
    font-style: italic;
    color: #555;
}

.positive-effect {
    color: #28a745;
}

.negative-effect {
    color: #dc3545;
}

.fertility-high {
    background-color: #28a745;
}

.fertility-medium {
    background-color: #ffc107;
}

.fertility-low {
    background-color: #dc3545;
}

button:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
}

@media (max-width: 1000px) {
    #game-content {
        flex-direction: column;
    }
    
    #farm-grid {
        height: 400px;
    }
    
    #crop-encyclopedia {
        grid-template-columns: 1fr;
    }
}