body {
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    background-image: url('/1_nbjNPvUi0OAw-6e2VXPwqw.jpg'); /* Use the hive image */
    background-size: cover; /* Cover the entire viewport */
    background-position: center; /* Center the image */
    background-repeat: no-repeat; /* Do not repeat the image */
    display: flex;
    flex-direction: column; /* Allow header and content wrapper to stack */
    justify-content: flex-start; /* Align items to the top */
    align-items: center; /* Center items horizontally */
    font-family: 'Arial', sans-serif;
    color: #F0E68C; /* Khaki - Light text for contrast */
    overflow: hidden; /* Prevent scrollbars from animations */
}

/* Mascot container with animation */
.mascot-container {
    position: fixed;
    left: 5%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 100;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(-50%) translateX(0) rotate(0deg);
    }
    25% {
        transform: translateY(-52%) translateX(5px) rotate(1deg);
    }
    50% {
        transform: translateY(-50%) translateX(0) rotate(0deg);
    }
    75% {
        transform: translateY(-48%) translateX(-5px) rotate(-1deg);
    }
    100% {
        transform: translateY(-50%) translateX(0) rotate(0deg);
    }
}

/* King Bee Bounce Animation */
@keyframes kingBounce {
  0%, 100% { transform: translateY(-50%) rotate(0deg); } /* Base from float */
  25% { transform: translateY(-50%) translateY(-10px) rotate(2deg); }
  50% { transform: translateY(-50%) translateY(0px) rotate(0deg); }
  75% { transform: translateY(-50%) translateY(-5px) rotate(-2deg); }
}

.mascot-container.king-bounce {
  animation-name: float, kingBounce; /* Apply float and kingBounce */
  animation-duration: 4s, 0.5s; /* Durations for float and kingBounce */
  animation-iteration-count: infinite, 1; /* float is infinite, kingBounce is once */
  animation-timing-function: ease-in-out, ease-in-out;
}

.mascot-image {
    width: 150px;
    height: auto;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.5));
    cursor: pointer; /* Add pointer cursor */
    transition: transform 0.1s ease-in-out; /* Add transition for smooth shake */
}

/* Shake animation for the mascot */
.mascot-image.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    backface-visibility: hidden;
    perspective: 1000px;
}

@keyframes shake {
  10%, 90% {
    transform: translate3d(-1px, 0, 0) rotate(1deg);
  }
  
  20%, 80% {
    transform: translate3d(2px, 0, 0) rotate(-1deg);
  }

  30%, 50%, 70% {
    transform: translate3d(-4px, 0, 0) rotate(2deg);
  }

  40%, 60% {
    transform: translate3d(4px, 0, 0) rotate(-2deg);
  }
}

.speech-bubble {
    position: relative;
    background-color: #fff;
    border-radius: 15px;
    padding: 15px;
    margin-top: 20px;
    min-width: 150px;
    text-align: center;
    font-size: 1.2em;
    color: #8B4513; /* Brown text */
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.speech-bubble:after {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    margin-left: -15px;
    border-width: 0 15px 15px;
    border-style: solid;
    border-color: #fff transparent;
}

.page-header {
    text-align: center;
    width: 100%;
    padding-top: 5vh; /* Space from top */
    z-index: 10;
    position: relative; /* To ensure it's part of normal flow before content-wrapper */
}

.content-wrapper {
    background-color: rgba(139, 69, 19, 0.75); /* SaddleBrown with transparency */
    padding: 20px; /* Reduced padding */
    border-radius: 15px;
    text-align: center;
    border: 5px solid #DAA520; /* Goldenrod */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    
    position: relative; /* Crucial for absolute positioning of children */
    display: flex; /* For centering children if needed, though pot and buttons are absolute */
    justify-content: center;
    align-items: center;
    width: 450px; /* Container for the pot and spinning buttons */
    height: 450px;
    margin-top: 2vh; /* Space below header */
}

h1 {
    color: #FFD700; /* Gold */
    margin-top: 0;
    margin-bottom: 20px; /* If it's inside page-header, this applies there */
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
}

p { 
    font-size: 1.2em;
    margin-bottom: 30px;
    color: #FFD700; 
    font-style: italic;
}

.honey-pot-image {
    position: absolute; 
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 120px; /* Smaller honey pot */
    height: auto;
    filter: drop-shadow(3px 3px 5px rgba(0,0,0,0.5));
    z-index: 1; /* Behind button container */
}

.button-container {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%; /* Takes full width of parent content-wrapper */
    height: 100%; /* Takes full height of parent content-wrapper */
    transform: translate(-50%, -50%); /* Center the container itself */
    animation: spin-buttons 60s linear infinite; /* Slower spin */
    z-index: 2; /* Above honey pot */
}

@keyframes spin-buttons {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Keyframes for counter-rotating the game buttons */
@keyframes counter-spin-game-button {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(-360deg); }
}

.game-button {
    display: inline-block;
    background-color: #B8860B; /* DarkGoldenrod */
    color: white;
    padding: 12px 20px; /* Slightly smaller padding for better fit */
    border-radius: 8px;
    text-decoration: none; 
    font-weight: bold;
    font-size: 1em; /* Slightly smaller font */
    border: 2px solid #F0E68C; /* Khaki */
    background-color: 0.3s ease;
    cursor: pointer;
    min-width: 160px; /* Adjust width */
    text-align: center; 
    position: absolute; /* Positioned by JS */
    transform-origin: center center; /* Ensure rotation is around the button's center */
    animation: counter-spin-game-button 60s linear infinite; /* Apply counter-rotation */
}

/* Style for the inner span for hover effects */
.game-button span {
    display: inline-block; /* Allows transform */
    transition: transform 0.2s ease;
}

.game-button:hover {
    background-color: #DAA520; /* Goldenrod */
}

.game-button:hover span {
    transform: scale(1.05);
}

.wip-button {
    background-color: #A0522D; /* Sienna - less prominent */
    cursor: not-allowed;
    opacity: 0.7;
}

.wip-button:hover {
    background-color: #A0522D; /* Keep color on hover */
}

.wip-button:hover span {
    transform: scale(1); /* No scale for WIP button or specific scale if desired */
}

.lobby-music-controls {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(0,0,0,0.5);
    padding: 10px;
    border-radius: 5px;
    z-index: 200;
}

.lobby-music-controls label {
    color: #FFD700;
    margin-right: 5px;
}

#lobby-volume {
    accent-color: #FFD700;
}

/* Page Transition Animation */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: all;
}

.page-transition.hidden {
    display: none;
}

.honeycomb-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.honeycomb {
    position: absolute;
    background-color: #FFD700;
    opacity: 0;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    animation: honeycomb-animate 1.5s forwards;
}

@keyframes honeycomb-animate {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        transform: scale(1.5) rotate(120deg);
        opacity: 0;
    }
}

.transition-bee {
    width: 100px;
    height: auto;
    z-index: 1;
    animation: transition-bee-zoom 1.5s forwards;
}

@keyframes transition-bee-zoom {
    0% {
        transform: scale(0.2) rotate(0deg);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: scale(3) rotate(720deg);
        opacity: 0;
    }
}

/* Media query for smaller screens (e.g., mobile devices) */
@media (max-width: 768px) {
    body {
        justify-content: flex-start; /* Keep for mobile */
        padding-top: 20px; /* Reduced padding */
    }
    
    .mascot-container {
        position: relative; /* Changed from fixed for mobile */
        left: auto; /* Reset fixed positioning */
        top: auto;
        transform: none; /* Reset fixed positioning */
        margin-bottom: 20px; /* Space below mascot */
        animation: float-mobile 4s ease-in-out infinite; /* Keep mobile float */
        order: 1; /* Mascot first */
    }
    
    @keyframes float-mobile { 
        0% { transform: translateY(0) translateX(0) rotate(0deg); }
        25% { transform: translateY(-5px) translateX(5px) rotate(1deg); }
        50% { transform: translateY(0) translateX(0) rotate(0deg); }
        75% { transform: translateY(5px) translateX(-5px) rotate(-1deg); }
        100% { transform: translateY(0) translateX(0) rotate(0deg); }
    }
    
    @keyframes kingBounceMobile {
      0%, 100% { transform: translateY(0) rotate(0deg); }
      25% { transform: translateY(-8px) rotate(1deg); } 
      50% { transform: translateY(0px) rotate(0deg); }
      75% { transform: translateY(-4px) rotate(-1deg); }
    }
    .mascot-container.king-bounce { 
      animation-name: float-mobile, kingBounceMobile;
      animation-duration: 4s, 0.5s;
      animation-iteration-count: infinite, 1;
      animation-timing-function: ease-in-out, ease-in-out;
    }

    
    .mascot-image {
        width: 100px;
    }
    
    .speech-bubble {
        min-width: 120px;
        font-size: 1em;
        padding: 10px;
    }

    .page-header {
        padding-top: 2vh;
        order: 2; /* Header second */
        position: relative; /* ensure it flows */
    }
    
    .content-wrapper {
        width: 90vw; /* Make it responsive */
        height: 90vw; /* Keep it square-ish */
        max-width: 400px; /* Cap size */
        max-height: 400px;
        padding: 10px;
        margin-top: 2vh;
        order: 3; /* Content third */
    }

    h1 {
        font-size: 1.8em; /* Smaller title */
    }

    .button-container {
    }

    .game-button {
        padding: 8px 15px;
        font-size: 0.9em;
        min-width: 120px; /* Smaller buttons */
    }

    .honey-pot-image {
        max-width: 80px; /* Smaller pot */
    }

    .lobby-music-controls {
        bottom: 10px;
        right: 10px;
        padding: 5px;
        order: 4; /* Controls last */
        position: relative; /* No longer fixed for mobile layout */
        margin-top: 10px;
    }
}