/* Fixed floating elements for viewport */
.fixed-whackamole {
    position: fixed;
    right: 24px;
    top: 24px;
    z-index: 1100;
    box-shadow: 0 2px 8px rgba(30,136,229,0.18);
}
.fixed-chest {
    position: fixed;
    left: 8px;
    bottom: 45px;
    width: 170px;
    max-width: 32vw;
    min-width: 200px;
    z-index: 1100;
    box-shadow: 0 2px 8px rgba(30,136,229,0.18);
    transition: width 0.2s;
}
.fixed-bubbles {
    position: fixed;
    left: 56px;
    bottom: 140px;
    z-index: 1101;
    pointer-events: none;
}
@media (max-width: 600px) {
    .fixed-whackamole {
        right: 8px;
        top: 8px;
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
    .fixed-chest {
        left: 4px;
        bottom: 8px;
        width: 70px;
        min-width: 40px;
    }
    .fixed-bubbles {
        left: 24px;
        bottom: 70px;
    }
}
@media (max-width: 600px) {
    .nautical-title {
        font-size: 1.8rem;
        margin-top: 0.6rem;
        line-height: 1.1;
        padding: 0 1rem;
        text-align: center;
    }
    .fixed-whackamole {
        right: 8px;
        top: 8px;
        font-size: 1rem;
        padding: 0.5rem 1rem;
    }
    .fixed-chest {
        left: 4px;
        bottom: 8px;
        width: 70px;
        min-width: 40px;
    }
    .fixed-bubbles {
        left: 24px;
        bottom: 70px;
    }
}

/* Responsive title sizing for medium screens */
@media (min-width: 601px) and (max-width: 1000px) {
    .nautical-title {
        font-size: 2.4rem;
        margin-bottom: 1.5rem;
    }
    .nautical-bg {
        padding-top: 80px;
    }
}

/* Mobile / small-screen layout improvements */
@media (max-width: 800px) {
    /* make background padding smaller so content is visible */
    .nautical-bg { padding-top: 56px; background-position: center top; }

    /* stack the abstract layout vertically and remove inline offsets */
    .abstract-layout { min-height: auto; min-width: auto; gap: 1.2rem; padding: 1rem; }
    .button-link-pair {
        position: static !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        margin: 0.6rem auto !important;
        width: calc(100% - 2rem) !important;
        max-width: 420px;
        align-items: center;
    }

    /* smaller buttons for mobile */
    .sillyButton {
        font-size: 1.6rem;
        padding: 1rem 1.6rem;
        border-radius: 1.2rem;
    }

    .sound-label { font-size: 1rem; margin-bottom: 0.3rem; }
    .button-link { font-size: 0.95rem; padding: 0.4rem 0.8rem; }

    /* treasure and controls spacing on mobile */
    .fixed-whackamole { right: 10px; top: 8px; }
    .fixed-chest { left: 8px; bottom: 8px; width: 86px; }
    .fixed-bubbles { left: 40px; bottom: 88px; }

    /* hide large decorative anchors on the sides to save space */
    .nautical-bg { background-position: center top; }

    /* whackamole popup full width on mobile */
    .whackamole-container { left: 50%; transform: translate(-50%, -50%); width: calc(100% - 32px); max-width: 420px; }
}

/* Extra small screens tweak */
@media (max-width: 600px) {
    .fixed-chest {
        left: 2px;
        bottom: 4px;
        width: 120px;
        min-width: 60px;
        max-width: 60vw;
    }
}
/* Whack-a-Sea-Creature game styles */
.open-whackamole {
    position: absolute;
    right: 40px;
    top: 60px;
    background: #1e88e5;
    color: #fff;
    font-size: 1.3rem;
    border: none;
    border-radius: 1.2rem;
    padding: 0.7rem 2rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(30,136,229,0.12);
    z-index: 1002;
    transition: background 0.2s;
}
.open-whackamole:hover {
    background: #1565c0;
}

.whackamole-container {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #e3f2fd;
    border: 4px solid #1e88e5;
    border-radius: 2rem;
    box-shadow: 0 8px 32px rgba(30,136,229,0.18);
    padding: 2.5rem 3rem 2rem 3rem;
    z-index: 3000;
    min-width: 350px;
    text-align: center;
    cursor: url('images/hammer.png'), pointer;
}
.whackamole-container h2 {
    margin-top: 0;
    color: #1e88e5;
    font-size: 2rem;
}
.scoreboard {
    font-size: 1.3rem;
    margin-bottom: 1.2rem;
    color: #1565c0;
}
.wm-grid {
    display: grid;
    grid-template-columns: repeat(3, 80px);
    grid-gap: 18px;
    justify-content: center;
    margin-bottom: 1.5rem;
}
.wm-hole {
    width: 80px;
    height: 80px;
    background: #fffbe7;
    border: 3px solid #ffb347;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(30,136,229,0.08);
    transition: background 0.2s;
}
.wm-hole.active {
    background: #b3e5fc;
}
.wm-creature {
    position: absolute;
    left: 50%;
    top: 60%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: url('images/swhead.png') center/contain no-repeat;
    animation: pop-up 0.3s;
    cursor: pointer;
    z-index: 1;
}
@keyframes pop-up {
    0% { transform: translate(-50%, 100%); }
    100% { transform: translate(-50%, -50%); }
}
#wm-start, #wm-close {
    background: #ffb347;
    border: none;
    border-radius: 1rem;
    padding: 0.5rem 1.5rem;
    font-size: 1.1rem;
    color: #1e88e5;
    font-weight: bold;
    cursor: pointer;
    margin: 0 0.5rem;
    box-shadow: 0 2px 8px rgba(30,136,229,0.08);
    transition: background 0.2s;
}
#wm-start:hover, #wm-close:hover {
    background: #ffe082;
}
/* Treasure chest styling */

.treasure-chest {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 240px;
    height: auto;
    cursor: pointer;
    z-index: 1001;
    filter: drop-shadow(0 4px 12px #1e88e5aa);
    transition: transform 0.2s;
}
.treasure-chest:active, .treasure-chest:focus {
    transform: translateY(-50%) scale(1.12) rotate(-8deg);
}

/* Bubbles animation */
.bubbles {
    position: absolute;
    left: 70px;
    top: 30%;
    pointer-events: none;
    z-index: 1002;
}
.bubble {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 22px;
    height: 22px;
    background: rgba(173, 216, 230, 0.7);
    border-radius: 50%;
    animation: bubble-rise 3s linear infinite;
    opacity: 0.7;
    border: 2px solid #b3e5fc;
}
.bubble:nth-child(2) {
    left: 30px;
    width: 16px;
    height: 16px;
    animation-delay: 1s;
    opacity: 0.5;
}
.bubble:nth-child(3) {
    left: 60px;
    width: 12px;
    height: 12px;
    animation-delay: 2s;
    opacity: 0.4;
}
.bubble:nth-child(4) {
    left: 90px;
    width: 18px;
    height: 18px;
    animation-delay: 1.5s;
    opacity: 0.6;
}
.bubble:nth-child(5) {
    left: 120px;
    width: 10px;
    height: 10px;
    animation-delay: 2.5s;
    opacity: 0.3;
}
@keyframes bubble-rise {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.7;
    }
    80% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-120px) scale(1.2);
        opacity: 0;
    }
}

.treasure-popup {
    display: none;
    position: fixed;
    left: 120px;
    top: 50%;
    transform: translateY(-50%);
    background: #fffbe7;
    border: 4px solid #ffb347;
    border-radius: 1.5rem;
    box-shadow: 0 8px 32px rgba(30,136,229,0.18);
    padding: 2rem 2.5rem 1.5rem 2.5rem;
    z-index: 2000;
    min-width: 260px;
    text-align: center;
}
.treasure-popup h2 {
    margin-top: 0;
    color: #e67e22;
    font-size: 2rem;
}
.treasure-popup ul {
    list-style: none;
    padding: 0;
    margin: 1rem 0 1.5rem 0;
}
.treasure-popup li {
    margin: 0.7rem 0;
    font-size: 1.2rem;
}
.treasure-popup a {
    color: #1e88e5;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}
.treasure-popup a:hover {
    color: #e67e22;
    text-decoration: underline;
}
#closeTreasure {
    background: #ffb347;
    border: none;
    border-radius: 1rem;
    padding: 0.5rem 1.5rem;
    font-size: 1.1rem;
    color: #1e88e5;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(30,136,229,0.08);
    transition: background 0.2s;
}
#closeTreasure:hover {
    background: #ffe082;
}
.abstract-layout {
    position: relative;
    min-height: 600px;
    min-width: 500px;
    align-items: flex-start;
    gap: 0;
}

.button-link-pair {
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 300px;
}

.button-link {
    margin-top: 0.7rem;
    font-size: 1.1rem;
    color: #1e88e5;
    background: rgba(255,255,255,0.7);
    border-radius: 1rem;
    padding: 0.3rem 1rem;
    box-shadow: 0 2px 8px rgba(30,136,229,0.08);
    word-break: break-all;
}
/* Glitter explosion effect */
.glitter-explosion {
    position: fixed;
    width: 80px;
    height: 80px;
    pointer-events: none;
    z-index: 9999;
    animation: glitter-pop 1.2s ease-out forwards;
    background: radial-gradient(circle at 40% 40%, #fff 0%, #f9f871 30%, #1e88e5 60%, #ffb347 100%);
    border-radius: 50%;
    box-shadow:
        0 0 16px 8px #fff,
        0 0 32px 16px #f9f871,
        0 0 24px 12px #1e88e5,
        0 0 12px 6px #ffb347;
    opacity: 0.85;
}

@keyframes glitter-pop {
    0% { transform: scale(0.2) rotate(0deg); opacity: 1; }
    60% { transform: scale(1.2) rotate(180deg); opacity: 1; }
    100% { transform: scale(0.8) rotate(360deg); opacity: 0; }
}

body {
    background: linear-gradient(135deg, #6ec6f7 0%, #f9f871 100%);
    min-height: 100vh;
    margin: 0;
    font-family: 'Comic Sans MS', 'Comic Sans', cursive, sans-serif;
}

.nautical-bg {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background:
        url('images/1357556.jpg') center center/cover no-repeat,
        url('https://pngimg.com/d/anchor_PNG72.png') repeat-y left center,
        url('https://pngimg.com/d/anchor_PNG72.png') repeat-y right center;
    background-size:
        cover,
        80px auto,
        80px auto;
    padding-top: 100px; /* prevent fixed header overlap */
}

.nautical-title {
    color: #1e88e5;
    text-shadow: 2px 2px 0 #fff, 4px 4px 0 #1e88e5;
    margin-bottom: 2rem;
    font-size: 3rem;
    letter-spacing: 2px;
}

.container {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    background: rgba(255,255,255,0.7);
    border-radius: 2rem;
    padding: 2rem 3rem;
    box-shadow: 0 8px 32px rgba(30,136,229,0.15);
}


.sillyButton {
    font-size: 2.2rem;
    padding: 1.5rem 3rem;
    background: #ffb347;
    border: 4px solid #1e88e5;
    border-radius: 2rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, border 0.2s;
    animation: bounce 2s infinite;
    color: #1e88e5;
    font-weight: bold;
    outline: none;
}


.sillyButton:hover {
    background: #ffcc80;
    border: 4px solid #f9f871;
    transform: scale(1.1) rotate(-3deg);
    animation: shake 0.4s;
}
/* Strobe effect for nautical fun */
.strobe {
    animation: strobe-bg 0.1s alternate 10;
}

@keyframes strobe-bg {
    0% { background: #fff700; }
    100% { background: #1e88e5; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    50% { transform: translateX(8px); }
    75% { transform: translateX(-8px); }
    100% { transform: translateX(0); }
}

/* Ensure fixed variants override non-fixed rules that appear later in the file */
.open-whackamole.fixed-whackamole {
    position: fixed !important;
    right: 24px !important;
    top: 24px !important;
    z-index: 1100 !important;
}
.treasure-chest.fixed-chest {
    position: fixed !important;
    left: 16px !important;
    bottom: 24px !important;
    top: auto !important;
    transform: none !important;
    width: 200px !important;
    max-width: 32vw !important;
    min-width: 120px !important;
    z-index: 1100 !important;
}
.bubbles.fixed-bubbles {
    position: fixed !important;
    left: 56px !important;
    bottom: 140px !important;
    top: auto !important;
    z-index: 1101 !important;
    pointer-events: none !important;
}