body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: url('16274.jpg') repeat;
    background-color: #e0d8c3;
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Loading Screen Styles */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #2e2e2e;
    background-image: url('dirt-texture.jpg');
    background-size: cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

#loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-gif {
    width: 150px;
    height: auto;
    margin-bottom: 20px;
}

#loading-screen p {
    color: #FFD700;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px #000;
}

/* Main Content */
#main-content.hidden {
    display: none;
}

.wrapper {
    flex: 1 0 auto;
    padding-bottom: 60px;
}

header {
    background-color: #1a1a1a;
    color: #FFD700;
    padding: 20px;
}

h1 {
    font-size: 28px;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

h2 {
    color: #2e2e2e;
    font-size: 22px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.game {
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    margin: 20px auto;
    max-width: 500px;
}

#machine-area {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 200px;
    margin: 0 auto;
    background: url('qgom_j1d4_211129.jpg') no-repeat center;
    background-size: cover;
    border: 2px solid #333;
    overflow: hidden;
    border-radius: 5px;
}

#digger {
    position: absolute;
    width: 80px;
    height: auto;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    transition: left 0.3s ease, transform 0.3s ease;
}

.treasure {
    position: absolute;
    max-width: 60px;
    max-height: 60px;
    width: auto;
    height: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.treasure.show {
    opacity: 1;
}

.message {
    margin-top: 10px;
    font-size: 18px;
    color: #2e2e2e;
    min-height: 20px;
}

.controls {
    margin-top: 20px;
}

button {
    padding: 10px 20px;
    font-size: 16px;
    margin: 5px;
    background-color: #000000;
    color: #FFFFFF;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

button:hover {
    background-color: #333333;
}

.pictures {
    padding: 20px;
}

.pictures .gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery img {
    width: auto;
    height: auto;
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease; /* Kept for JS animation */
}

footer {
    background-color: #1a1a1a;
    color: #FFD700;
    padding: 10px;
    width: 100%;
    flex-shrink: 0;
}

/* Desktop optimizations */
@media (min-width: 601px) {
    h1 { font-size: 36px; }
    h2 { font-size: 28px; }
    .game { max-width: 700px; }
    #machine-area { 
        max-width: 600px; 
        height: 300px; 
    }
    #digger { width: 120px; }
    .treasure { 
        max-width: 80px; 
        max-height: 80px; 
    }
    button { 
        font-size: 18px; 
        padding: 12px 24px; 
    }
    .message { font-size: 20px; }
    .loading-gif { width: 200px; }
    #loading-screen p { font-size: 28px; }
}