:root {
    --primary-color: #69B8D6;
    --secondary-color: #78C953;
    --accent-red: #F24C4C;
    --accent-yellow: #FFCF55;
    --bg-dark: #2a2a2a;
    --text-light: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --building-glow: rgba(255, 207, 85, 0.6);
}

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

body {
    font-family: 'Silkscreen', monospace;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Header */
.game-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-dark);
    color: var(--text-light);
    padding: 10px 20px;
    z-index: 1000;
    border-bottom: 3px solid var(--accent-yellow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 8px var(--shadow-color);
}

.game-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-yellow);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
}

.game-controls {
    display: flex;
    gap: 15px;
}

.pixel-button {
    background: var(--accent-red);
    color: white;
    border: none;
    padding: 8px 16px;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
    transition: all 0.1s;
    border-radius: 2px;
}

.pixel-button:hover {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.3);
    background: #ff5a5a;
}

.pixel-button:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

/* Game World Container */
.game-world {
    margin-top: 60px;
    min-height: calc(100vh - 120px);
    position: relative;
    overflow: hidden;
    margin-bottom: 60px;
}

/* Pixel Character */
.pixel-character {
    position: absolute;
    width: 32px;
    height: 32px;
    background: var(--accent-red);
    z-index: 100;
    transition: all 0.2s ease;
    image-rendering: pixelated;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 8px var(--shadow-color);
    border: 2px solid #000;
}

.pixel-character::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: white;
    top: 8px;
    left: 6px;
    border-radius: 50%;
    border: 1px solid #000;
}

.pixel-character::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: white;
    top: 8px;
    right: 6px;
    border-radius: 50%;
    border: 1px solid #000;
}

/* Character Movement States */
.character-moving-left {
    transform: translate(-50%, -50%) scaleX(-1);
}

.character-moving-right {
    transform: translate(-50%, -50%) scaleX(1);
}

.character-moving-up {
    transform: translate(-50%, -50%) rotate(-5deg);
}

.character-moving-down {
    transform: translate(-50%, -50%) rotate(5deg);
}

/* Game Buildings */
.game-building {
    position: absolute;
    cursor: pointer;
    transition: all 0.3s ease;
    image-rendering: pixelated;
    border: 2px solid rgba(0, 0, 0, 0.2);
}

.game-building:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

.game-building.near-player {
    filter: brightness(1.3) drop-shadow(0 0 15px var(--building-glow));
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        filter: brightness(1.3) drop-shadow(0 0 15px var(--building-glow));
    }

    50% {
        filter: brightness(1.5) drop-shadow(0 0 25px var(--building-glow));
    }

    100% {
        filter: brightness(1.3) drop-shadow(0 0 15px var(--building-glow));
    }
}

.starlight-building {
    width: 120px;
    height: 80px;
    background: linear-gradient(45deg, #4a4a4a, #6a6a6a);
    top: 20%;
    left: 70%;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 4px 8px var(--shadow-color);
}

.starlight-building::before {
    content: '⭐';
    position: absolute;
    font-size: 24px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.dungeon-building {
    width: 100px;
    height: 120px;
    background: linear-gradient(180deg, #8B4513, #A0522D);
    top: 60%;
    left: 20%;
    border-radius: 50% 50% 0 0;
    box-shadow: 0 4px 8px var(--shadow-color);
}

.dungeon-building::before {
    content: '🏰';
    position: absolute;
    font-size: 32px;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.puzzle-building {
    width: 80px;
    height: 140px;
    background: linear-gradient(0deg, var(--accent-red), var(--accent-yellow), var(--primary-color));
    top: 30%;
    left: 40%;
    box-shadow: 0 4px 8px var(--shadow-color);
}

.puzzle-building::before {
    content: '🧩';
    position: absolute;
    font-size: 28px;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.crane-game-building {
    width: 100px;
    height: 110px;
    background: linear-gradient(135deg, #87CEEB, #4169E1);
    top: 75%;
    left: 45%;
    border-radius: 10px;
    box-shadow: 0 4px 8px var(--shadow-color);
}

.crane-game-building::before {
    content: '🏗️';
    position: absolute;
    font-size: 28px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.candy-world-building {
    width: 90px;
    height: 90px;
    background: radial-gradient(circle, #FFC0CB, #FF69B4);
    top: 15%;
    left: 15%;
    border-radius: 50%;
    box-shadow: 0 4px 8px var(--shadow-color);
}

.candy-world-building::before {
    content: '🍬';
    position: absolute;
    font-size: 32px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.fruit-puzzle-building {
    width: 110px;
    height: 100px;
    background: linear-gradient(45deg, #98FB98, #FFD700, #FF6347);
    top: 70%;
    left: 80%;
    border-radius: 20px 0 20px 0;
    box-shadow: 0 4px 8px var(--shadow-color);
}

.fruit-puzzle-building::before {
    content: '🍎';
    position: absolute;
    font-size: 32px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.magical-reflect-building {
    width: 120px;
    height: 120px;
    background: linear-gradient(45deg, #E6E6FA, #DDA0DD, #9370DB);
    top: 10%;
    left: 55%;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.magical-reflect-building::before {
    content: '🔮';
    position: absolute;
    font-size: 28px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.tower-defense-building {
    width: 80px;
    height: 150px;
    background: linear-gradient(0deg, #A9A9A9, #C0C0C0);
    top: 40%;
    left: 90%;
    border: 4px solid #696969;
    box-shadow: 0 4px 8px var(--shadow-color);
}

.tower-defense-building::before {
    content: '🗼';
    position: absolute;
    font-size: 24px;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Interactive Trees */
.tree {
    position: absolute;
    width: 40px;
    height: 60px;
    background: #8B4513;
    cursor: pointer;
    transition: transform 0.3s ease;
    border-radius: 0 0 20px 20px;
    border: 2px solid #654321;
}

.tree::before {
    content: '🌳';
    position: absolute;
    font-size: 32px;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.tree:hover {
    transform: rotate(5deg);
}

.tree1 {
    top: 40%;
    left: 10%;
}

.tree2 {
    top: 70%;
    left: 60%;
}

.tree3 {
    top: 20%;
    left: 85%;
}

/* Clouds Animation */
.cloud {
    position: absolute;
    background: white;
    border-radius: 50px;
    opacity: 0.7;
    animation: float 20s infinite linear;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cloud1 {
    width: 80px;
    height: 40px;
    top: 10%;
    left: -100px;
    animation-delay: 0s;
}

.cloud2 {
    width: 60px;
    height: 30px;
    top: 15%;
    left: -80px;
    animation-delay: 7s;
}

@keyframes float {
    from {
        transform: translateX(-100px);
    }

    to {
        transform: translateX(calc(100vw + 100px));
    }
}

/* Game Modal */
.game-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--bg-dark);
    border: 4px solid var(--accent-yellow);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    color: var(--text-light);
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.5);
    position: relative;
    border-radius: 8px;
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--accent-yellow);
    padding-bottom: 10px;
}

.modal-title {
    font-size: 20px;
    color: var(--accent-yellow);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
}

.close-button {
    background: var(--accent-red);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-family: inherit;
    font-size: 18px;
    font-weight: bold;
    border-radius: 2px;
    transition: all 0.1s;
}

.close-button:hover {
    background: #ff5a5a;
}

.game-screenshot {
    width: 100%;
    height: 200px;
    background: #333;
    margin: 20px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    border: 2px solid #555;
    border-radius: 4px;
    overflow: hidden;
}

.game-screenshot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
}

.game-description {
    line-height: 1.6;
    margin: 20px 0;
    font-size: 14px;
}

.play-button {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 15px 30px;
    font-family: inherit;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    margin-top: 20px;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.3);
    transition: all 0.1s;
    border-radius: 4px;
    font-weight: bold;
}

.play-button:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.3);
    background: #89d65c;
}

/* Instructions */
.instructions {
    position: fixed;
    bottom: 80px;
    left: 20px;
    background: rgba(42, 42, 42, 0.9);
    color: var(--text-light);
    padding: 15px;
    border: 2px solid var(--accent-yellow);
    font-size: 12px;
    z-index: 500;
    border-radius: 4px;
    box-shadow: 4px 4px 8px var(--shadow-color);
}

/* Footer */
.game-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-dark);
    color: var(--text-light);
    padding: 10px 20px;
    z-index: 1000;
    border-top: 3px solid var(--accent-yellow);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    box-shadow: 0 -4px 8px var(--shadow-color);
}

.game-footer .social-links a {
    color: var(--accent-yellow);
    text-decoration: none;
    margin: 0 5px;
    transition: color 0.2s;
}

.game-footer .social-links a:hover {
    text-decoration: underline;
    color: #fff;
}

.game-footer .copyright {
    margin-top: 5px;
    font-size: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-building {
        transform: scale(0.7);
    }

    .game-building:hover,
    .game-building.near-player {
        transform: scale(0.75);
    }

    .pixel-character {
        width: 24px;
        height: 24px;
    }

    .tree {
        width: 30px;
        height: 45px;
        transform: scale(0.8);
    }

    .instructions {
        position: relative;
        bottom: auto;
        left: auto;
        margin: 20px;
    }

    .modal-content {
        padding: 20px;
        width: 95%;
    }

    .game-title {
        font-size: 16px;
    }

    .game-controls {
        gap: 10px;
    }

    .pixel-button {
        padding: 6px 12px;
        font-size: 10px;
    }
}

/* Loading State */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

    .cloud,
    .pixel-character,
    .game-building,
    .tree {
        animation: none;
        transition: none;
    }
}