/* General Styles */
.main {
    text-align: center;
    font-family: Arial, sans-serif;
    background-color: #74ff03d3; /* Empty field */
}

#game-board {
    margin-top: 0px;
    background-color: #74ff03d3; /* Empty field */
    max-width: 100%;
}

#kingdom-trees {
    margin-top: 0px;
    display: grid;
    grid-template-columns: repeat(3, 100px);
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.kingdom-tree {
    width: 100px;
    height: 100px;
    background-color: #74ff03d3; /* Empty field */
    border-radius: 0px;
    position: relative;
}

/* New styles for buildings */
.kingdom-tree.empty {
    background-color: #74ff03d3;
}

/* Growing Tree State */
.kingdom-tree.planting {
    background-color: black;
    border-radius: 50%;
}

.kingdom-tree.planting::after {
    content: '🌱'; /* Planting tree emoticon */
    font-size: 40px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.9;
}

.kingdom-tree.planting:hover::after {
    opacity: 1;
}

/* Planted Tree State */
.kingdom-tree.planted {
    background-color: green;
    border-radius: 50%;
}

.kingdom-tree.planted::after {
    content: '🌳'; /* Tree emoticon */
    font-size: 40px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.3;
    transition: opacity 0.3s;
}

.kingdom-tree.planted:hover::after {
    opacity: 1;
}

/* Harvesting State */
.kingdom-tree.harvesting {
    background-color: brown;
    border-radius: 50%;
}

.kingdom-tree.harvesting::after {
    content: '🪵'; /* Log emoticon */
    font-size: 40px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.3;
    transition: opacity 0.3s;
}

.kingdom-tree.harvesting:hover::after {
    opacity: 1;
}

/* Hammer during building phase */
.kingdom-tree.building {
    background-color: rgb(0, 26, 255);
}

.kingdom-tree.building::before {
    content: '🔨'; /* Hammer icon */
    font-size: 30px;
    position: absolute;
    top: 50%;
    left: 50%;
    opacity: 1;
}

/* Shed Style */
.kingdom-tree.shed {
    background-color: turquoise;
}

.kingdom-tree.shed::after {
    content: '🛖'; /* Shed emoticon */
    font-size: 40px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.5;
    transition: opacity 0.3s;
}

.kingdom-tree.shed:hover::after {
    opacity: 1;
}

/* Castle Style */
.kingdom-tree.castle {
    background-color: gray;
}

.kingdom-tree.castle::after {
    content: '🏰'; /* Castle emoticon */
    font-size: 40px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.6;
    transition: opacity 0.3s;
}

.kingdom-tree.castle:hover::after {
    opacity: 1;
}

/* Church Style */
.kingdom-tree.church {
    background-color: gold;
}

.kingdom-tree.church::after {
    content: '⛪'; /* Church emoticon */
    font-size: 40px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.7;
    transition: opacity 0.3s;
}

.kingdom-tree.church:hover::after {
    opacity: 1;
}

/* Ensure hammer icon disappears after building is done */
.kingdom-tree.building.shed::before,
.kingdom-tree.building.castle::before,
.kingdom-tree.building.church::before {
    opacity: 0; /* Hidden when building is complete */
}

/* Stats Section */
#kingdom-stats {
    margin-bottom: 0px;
    font-size: 22px;
    background: linear-gradient(145deg, #f4c542, #d0a73b); /* Gold to brown gradient */
    width: 100%;
    height: auto;
    transition: all 0.3s ease;
}

/* Timer Styles */
.tree-timer {
    font-size: 16px;
    margin-top: 10px;
    position: absolute;
    bottom: 5px;
    width: 100%;
    text-align: center;
    color: white; /* Text color */
}

/* Medieval Notifications */
.realistic-scroll-banner {
    width: 88%;
    height: auto;
    background: #f8ecc2; /* Light parchment color */
    border: 4px solid #8b5a2b; /* Dark brown border for the scroll */
    padding: 3px 7px;
    text-align: center;
    font-family: 'Georgia', serif;
    font-size: 20px;
    font-weight: bold;
    color: #4b2e14; /* Dark text color to match the medieval theme */
    box-shadow: 0px 10px 15px rgba(0, 0, 0, 0.3); /* More shadow for depth */
    position: relative;
    margin: 50px auto;
    border-radius: 10px;
    background: linear-gradient(to bottom, #fdf5e6 0%, #f5deb3 100%); /* Light parchment gradient */
    background-size: 100% 100%;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.2); /* Inner shadow for parchment texture */
    border-top: 1px solid #8b4513; 
    border-bottom: 1px solid #8b4513;
    border-left: 3px solid #8b4513;
    border-right: 3px solid #8b4513;
}

.kingdom-message {
    max-width: 100%;
    font-size: 22px;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    transition: background-color 0.3s;
}

/* Responsive Design for Mobile */
@media only screen and (max-width:500px) {
    #kingdom-trees {
        grid-template-columns: repeat(3, 50px); /* Half the size */
    }
    .kingdom-tree {
        width: 50px; /* Half the size */
        height: 50px; /* Half the size */
    }
}

/* Main Pond Button - Plant Tree */
#plant-tree-btn {
    background: linear-gradient(145deg, #6ec6ff, #2196f3);
    color: #ffffff;
    font-size: 18px;
    padding: 15px 30px;
    border-radius: 40% 60% 60% 40% / 50% 40% 60% 50%;
    border: 3px solid #2196f3;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), inset 0 1px 3px rgba(255, 255, 255, 0.4);
    transition: background 0.4s ease, transform 0.3s ease;
    text-transform: capitalize;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    width: 160px;
    height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.2);
}

#plant-tree-btn:hover {
    background: linear-gradient(145deg, #2196f3, #6ec6ff);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4), inset 0 2px 6px rgba(255, 255, 255, 0.5);
    transform: scale(1.07);
}

/* Bottom Buttons - Build Options */
#kingdom-build {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    justify-items: center;
    width: 100%;
    padding: 8px;
}

#kingdom-build button {
    background: linear-gradient(145deg, #ffeb99, #f1c40f);
    color: #3b2a1b;
    border: 2px solid #8db346;
    font-size: 16px;
    padding: 12px;
    border-radius: 15px;
    box-shadow: 0 4px 7px rgba(0, 0, 0, 0.2), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    position: relative;
    width: 100%;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    text-transform: capitalize;
    transition: background 0.4s ease, box-shadow 0.4s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

#kingdom-build button:hover {
    background: linear-gradient(145deg, #00e676, #004d40);
    border-color: #fff;
    color: #fff;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3), inset 0 3px 6px rgba(0, 0, 0, 0.2);
    transform: scale(1.03);
}

#kingdom-build button::before, #kingdom-build button::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: #e57373;
    transition: all 0.4s ease;
}

#kingdom-build button::before {
    top: -10px;
    left: -10px;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #e57373 30%, transparent 70%);
}

#kingdom-build button::after {
    bottom: -10px;
    right: -10px;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #e57373 30%, transparent 70%);
}

#kingdom-build button:hover::before, #kingdom-build button:hover::after {
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, #4caf50 40%, transparent 60%);
}

#kingdom-build button:hover::before {
    content: '🌹';
    font-size: 24px;
    color: #e57373;
    width: 24px;
    height: 24px;
    top: calc(-10px + (40px - 24px) / 2);
    left: calc(-10px + (40px - 24px) / 2);
    background: none;
}

#kingdom-build button:hover::after {
    content: '';
}

/* Disabled State for Buttons */
button:disabled {
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.5;
    transition: none;
}

button:disabled:hover {
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.3;
}
