@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    background-color: #1a1a1a;
}

.game-wrapper {
    display: flex;
    height: 100vh;
    position: relative;
}

#tower-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #87CEEB 0%, #E0F6FF 100%);
    transition: background 1s ease-in-out;
}

.tower {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 300px;
    height: 560px;
    display: flex;
    flex-direction: column;
    transition: transform 1s ease-in-out;
}

.tower-structure {
    width: 100%;
    height: 80px;
    margin: 0;
    padding: 0;
}

.wall-left,
.wall-right {
    position: absolute;
    top: -2000px;
    /* Extend up beyond viewport */
    bottom: 0;
    width: 20px;
    background: #000000;
}

.wall-left {
    left: 0;
    border-right: 2px solid #FFFFFF;
}

.wall-right {
    right: 0;
    border-left: 2px solid #FFFFFF;
}

.floor {
    width: 100%;
    height: 80px !important;
    min-height: 80px;
    background: #000000;
    border-bottom: 2px solid #FFFFFF;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.tower .floor:first-child {
    border-top: 2px solid #FFFFFF;
}

.current-floor {
    background: linear-gradient(90deg, #DAA520, #FFD700);
    color: black;
    animation: pulse 2s infinite;
    transition: background 0.5s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

#game-container {
    width: 400px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    position: relative;
}

#problem {
    font-size: 28px;
    margin: 20px 0;
    font-weight: bold;
    color: #000;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 5px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#level {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin: 10px 0;
}

#answer {
    padding: 10px;
    font-size: 18px;
    width: 150px;
    margin: 10px 0;
}

#submit {
    padding: 10px 20px;
    font-size: 18px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s;
}

#submit:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

#submit:hover:not(:disabled) {
    background-color: #45a049;
}

.character {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 40px;
    background-color: #FFFFFF;
    transition: transform 1s ease-in-out;
    z-index: 2;
}

#feedback {
    height: 20px;
    margin: 10px 0;
    color: #333;
}

/* Cloud Container */
.clouds {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    opacity: 1;
    transition: opacity 1s ease-in-out;
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.star {
    position: absolute;
    background-color: white;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    animation: twinkle 1s infinite alternate;
}

@keyframes twinkle {
    0% {
        opacity: 0.3;
    }

    100% {
        opacity: 1;
    }
}

/* Different star sizes */
.star.small {
    width: 1px;
    height: 1px;
}

.star.medium {
    width: 2px;
    height: 2px;
}

.star.large {
    width: 3px;
    height: 3px;
}

/* Base Cloud Style */
.cloud {
    position: absolute;
    background: white;
    border-radius: 100px;
    opacity: 0.8;
}

.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 50%;
}

/* Cloud 1 */
.cloud1 {
    width: 100px;
    height: 40px;
    left: -100px;
    top: 20%;
    animation: moveCloud 25s linear infinite;
}

.cloud1::before {
    width: 50px;
    height: 50px;
    top: -20px;
    left: 15px;
}

.cloud1::after {
    width: 40px;
    height: 40px;
    top: -15px;
    left: 45px;
}

/* Cloud 2 */
.cloud2 {
    width: 120px;
    height: 45px;
    left: -120px;
    top: 45%;
    animation: moveCloud 30s linear infinite;
    animation-delay: -8s;
}

.cloud2::before {
    width: 55px;
    height: 55px;
    top: -22px;
    left: 18px;
}

.cloud2::after {
    width: 45px;
    height: 45px;
    top: -17px;
    left: 50px;
}

/* Cloud 3 */
.cloud3 {
    width: 80px;
    height: 35px;
    left: -80px;
    top: 70%;
    animation: moveCloud 20s linear infinite;
    animation-delay: -15s;
}

.cloud3::before {
    width: 45px;
    height: 45px;
    top: -18px;
    left: 12px;
}

.cloud3::after {
    width: 35px;
    height: 35px;
    top: -13px;
    left: 35px;
}

/* Cloud 4 */
.cloud4 {
    width: 90px;
    height: 38px;
    left: -90px;
    top: 85%;
    animation: moveCloud 22s linear infinite;
    animation-delay: -5s;
}

.cloud4::before {
    width: 48px;
    height: 48px;
    top: -19px;
    left: 14px;
}

.cloud4::after {
    width: 38px;
    height: 38px;
    top: -14px;
    left: 40px;
}

/* Cloud Animation */
@keyframes moveCloud {
    from {
        left: -150px;
    }

    to {
        left: 100%;
    }
}

/* Update the tower-container background to have a nicer sky gradient */
#tower-container {
    background: linear-gradient(180deg,
            #4A90E2 0%,
            #87CEEB 40%,
            #E0F6FF 100%);
}

.win-screen {
    text-align: center;
    padding: 20px;
    animation: fadeIn 1s ease-in;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.win-screen h1 {
    color: #4CAF50;
    font-size: 32px;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.win-screen h2 {
    color: #333;
    font-size: 24px;
    margin-bottom: 15px;
}

.win-screen p {
    color: #666;
    font-size: 18px;
    margin-bottom: 30px;
}

.win-button {
    padding: 15px 30px;
    font-size: 18px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.win-button:hover {
    background-color: #45a049;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stats {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.stats p {
    font-size: 18px;
    color: #333;
    margin: 10px 0;
}

/* Confetti Styles */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    top: -20px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: confetti-fall linear infinite;
}

@keyframes confetti-fall {
    0% {
        transform:
            translateY(0) rotate(0deg) translateX(0);
        opacity: 1;
    }

    25% {
        transform:
            translateY(25vh) rotate(90deg) translateX(50px);
    }

    50% {
        transform:
            translateY(50vh) rotate(180deg) translateX(-50px);
    }

    75% {
        transform:
            translateY(75vh) rotate(270deg) translateX(50px);
        opacity: 1;
    }

    100% {
        transform:
            translateY(100vh) rotate(360deg) translateX(-50px);
        opacity: 0;
    }
}

@keyframes warpEffect {
    0% {
        transform: translateX(-50%) scale(1);
    }

    50% {
        transform: translateX(-50%) scale(1.5);
    }

    100% {
        transform: translateX(-50%) scale(1);
    }
}

.sparkle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #FFD700;
    border-radius: 50%;
    animation: sparkleAnimation 1s ease-in-out forwards;
}

@keyframes sparkleAnimation {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateY(-20vh) scale(1);
        opacity: 0;
    }
}

/* Additional Cloud Styles */
.cloud5 {
    width: 140px;
    height: 50px;
    left: -140px;
    top: 15%;
    animation: moveCloud 28s linear infinite;
    animation-delay: -12s;
}

.cloud5::before {
    width: 60px;
    height: 60px;
    top: -25px;
    left: 20px;
}

.cloud5::after {
    width: 50px;
    height: 50px;
    top: -20px;
    left: 55px;
}

.cloud6 {
    width: 110px;
    height: 42px;
    left: -110px;
    top: 65%;
    animation: moveCloud 23s linear infinite;
    animation-delay: -3s;
}

.cloud6::before {
    width: 52px;
    height: 52px;
    top: -21px;
    left: 16px;
}

.cloud6::after {
    width: 42px;
    height: 42px;
    top: -16px;
    left: 43px;
}

.cloud7 {
    width: 95px;
    height: 38px;
    left: -95px;
    top: 35%;
    animation: moveCloud 26s linear infinite;
    animation-delay: -18s;
}

.cloud7::before {
    width: 48px;
    height: 48px;
    top: -19px;
    left: 14px;
}

.cloud7::after {
    width: 38px;
    height: 38px;
    top: -14px;
    left: 40px;
}

.cloud8 {
    width: 130px;
    height: 48px;
    left: -130px;
    top: 75%;
    animation: moveCloud 32s linear infinite;
    animation-delay: -9s;
}

.cloud8::before {
    width: 58px;
    height: 58px;
    top: -24px;
    left: 18px;
}

.cloud8::after {
    width: 48px;
    height: 48px;
    top: -19px;
    left: 50px;
}

.mega-sparkle {
    width: 6px !important;
    height: 6px !important;
    background: linear-gradient(45deg, #FFD700, #FFA500) !important;
    box-shadow: 0 0 10px #FFD700;
}

@keyframes sparkleAnimation {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateY(-20vh) scale(1);
        opacity: 0;
    }
}

#menu-screen {
    position: fixed;
    box-sizing: border-box;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #e6f3ff;
    z-index: 1000;
}

.game-title {
    font-family: 'Press Start 2P', cursive;
    font-size: 3.5rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    text-shadow: 4px 4px 0px rgba(0, 0, 0, 0.2);
    letter-spacing: 2px;
    line-height: 1.4;
    text-align: center;
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
    white-space: nowrap;
}

.menu-button {
    padding: 15px 60px;
    font-size: 1.5em;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    display: block;
    margin: 0 auto;
}

.menu-button:hover {
    transform: scale(1.1);
    background-color: #45a049;
}

.win-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

#game-screen {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

#tower-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#game-interface {
    position: fixed;
    right: 20px;
    /* Position on right side */
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    z-index: 100;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

#problem {
    font-size: 28px;
    margin-bottom: 15px;
    font-weight: bold;
}

#answer {
    padding: 12px;
    font-size: 20px;
    width: 220px;
    text-align: center;
    margin-bottom: 15px;
    border: 2px solid #4CAF50;
    border-radius: 5px;
}

#submit {
    padding: 12px 25px;
    font-size: 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-bottom: 15px;
}

#feedback {
    min-height: 28px;
    text-align: center;
    margin-bottom: 15px;
    font-size: 18px;
}

.super-rare-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(139, 0, 0, 0.3);
    /* Dark red with transparency */
    z-index: 9998;
    animation: fadeIn 2s ease-in-out;
    transition: opacity 1s ease-in-out;
}

.super-rare-text {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    color: #FFD700;
    /* Gold text */
    font-size: 48px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    animation: fadeInAndFloat 2s ease-in-out;
    transition: opacity 1s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInAndFloat {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}


.beta-label {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #FFD700;
    /* Gold color */
    font-size: 16px;
    font-weight: bold;
    padding: 4px 8px;
    border: 1px solid #FFD700;
    border-radius: 4px;
    opacity: 0.8;
    transform: rotate(0deg);
    animation: floatBeta 2s ease-in-out infinite;
}

@keyframes floatBeta {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-3px);
    }
}

.hidden {
    display: none !important;
}

.active {
    display: block;
}

.menu-content {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-title {
    font-size: 3.5rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.tower-icon {
    font-size: 5rem;
    margin: 1rem 0;
    animation: float 3s ease-in-out infinite;
}

.game-description {
    font-size: 1.2rem;
    color: #34495e;
    margin: 1.5rem 0;
    line-height: 1.6;
}

.menu-button {
    font-size: 1.3rem;
    padding: 1rem 2rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.menu-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.menu-decorations {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.floating-emoji {
    position: absolute;
    font-size: 2rem;
    animation: floatAround 8s linear infinite;
    opacity: 0.5;
}

.floating-emoji:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
.floating-emoji:nth-child(2) { top: 20%; right: 10%; animation-delay: -1s; }
.floating-emoji:nth-child(3) { bottom: 20%; left: 15%; animation-delay: -2s; }
.floating-emoji:nth-child(4) { bottom: 15%; right: 15%; animation-delay: -3s; }
.floating-emoji:nth-child(5) { top: 50%; left: 5%; animation-delay: -4s; }
.floating-emoji:nth-child(6) { top: 40%; right: 5%; animation-delay: -5s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes floatAround {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(10px, 10px) rotate(90deg);
    }
    50% {
        transform: translate(0, 20px) rotate(180deg);
    }
    75% {
        transform: translate(-10px, 10px) rotate(270deg);
    }
    100% {
        transform: translate(0, 0) rotate(360deg);
    }
}

/* Make sure the menu screen has a nice background */
#menu-screen {
    /* background: linear-gradient(135deg, #a8e6cf 0%, #dcedc1 100%); */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}

.version-number {
    font-size: 0.9rem;
    color: #666;
    margin-top: -10px;
    margin-bottom: 15px;
    opacity: 0.8;
    font-style: italic;
}

@keyframes pixelPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.game-title {
    animation: pixelPulse 2s infinite;
}

.game-controls {
    margin: 20px;
    text-align: center;
}

#difficulty {
    padding: 8px;
    margin-right: 10px;
    border-radius: 4px;
}

#playButton {
    padding: 8px 20px;
    border-radius: 4px;
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
}

#playButton:hover {
    background-color: #45a049;
}

#maze-container {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    background-color: #1a1a1a;
    position: relative;
    overflow: hidden;
}

#maze-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: grid;
    grid-template-columns: repeat(18, 1fr);
    grid-template-rows: repeat(18, 1fr);
    gap: 2px;
    background-color: #2a2a2a;
    padding: 2px;
}

.maze-cell {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: white;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

.maze-cell.wall {
    background-color: black;
    border-color: black;
}

.maze-cell.current {
    background-color: #4CAF50;
    border-color: #45a049;
    box-shadow: 0 0 10px rgba(74, 175, 79, 0.5);
}

.maze-cell.adjacent {
    background-color: #2d2d2d;
    border-color: #3a3a3a;
}

#maze-controls {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.9);
    padding: 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 200px;
    z-index: 1000;
    border: 1px solid #4CAF50;
}

#maze-problem {
    font-size: 24px;
    color: white;
    text-align: center;
    margin: 10px 0;
    font-weight: bold;
}

#maze-answer {
    padding: 10px;
    font-size: 18px;
    border: 2px solid #4CAF50;
    border-radius: 4px;
    text-align: center;
    width: 80%;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.9);
}

#maze-submit {
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#maze-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.horizontal-buttons {
    display: flex;
    gap: 5px;
}

#maze-buttons button {
    width: 40px;
    height: 40px;
    font-size: 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#maze-buttons button:hover {
    background-color: #45a049;
}

#maze-status {
    color: white;
    text-align: center;
}

.maze-cell.current {
    background-color: #4CAF50;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(74, 175, 79, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(74, 175, 79, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 175, 79, 0); }
}

.maze-cell.end-point {
    background-color: #ff3333;
    border-color: #ff3333;
    box-shadow: 0 0 10px rgba(255, 51, 51, 0.5);
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(255, 51, 51, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 51, 51, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 51, 51, 0); }
}

.math-symbols {
    position: absolute;
    top: 80%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    opacity: 0.2;
    animation: rotate 10s linear infinite;
    z-index: -1;
}

/* If you have multiple symbols, you can adjust them individually */
.math-symbol {
    position: absolute;
    top: 80%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.coin-box {
    position: relative;
    margin: 0 auto 20px auto;
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border: 2px solid gold;
    border-radius: 10px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    width: fit-content;
}

.coin-icon {
    font-size: 1.2rem;
    color: gold;
}

.coin-display {
    font-family: 'Press Start 2P', cursive;
    color: gold;
    font-size: 1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.small-button {
    font-size: 0.8em;
    padding: 8px 16px;
    margin: 5px;
}

#shop-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
}

.shop-content {
    text-align: center;
    padding: 20px;
    max-height: 90vh;  /* Limit height to 90% of viewport */
    display: flex;
    flex-direction: column;
}

.shop-items {
    display: flex;
    flex-direction: column;
    gap: 10px;  /* Reduced gap */
    margin: 20px 0;
    overflow-y: auto;  /* Make items scrollable */
    padding: 10px;
    max-height: 70vh;  /* Limit height to allow for header and close button */
}

.shop-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;  /* Reduced padding */
    border: 1px solid #ccc;
    border-radius: 8px;
    width: 300px;
    margin: 0 auto;
}

.item-name {
    font-size: 1.2em;
    font-weight: bold;
}

.price-tag {
    display: flex;
    align-items: center;
    gap: 5px;
    color: gold;
    font-weight: bold;
}

.buy-button {
    padding: 5px 15px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.buy-button:hover {
    background-color: #45a049;
}

.equip-button {
    padding: 5px 15px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.equip-button:hover {
    background-color: #1976D2;
}

.equipped-button {
    padding: 5px 15px;
    background-color: #9E9E9E;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: not-allowed;
    opacity: 0.7;
}

.shop-item.equipped {
    background-color: #E8F5E8;
    border-color: #4CAF50;
}

.shop-item.equipped .item-name {
    color: #2E7D32;
    font-weight: bold;
}

@keyframes shine {
    0% {
        text-shadow: 0 0 5px #40A6FF, 0 0 10px #40A6FF;
    }
    50% {
        text-shadow: 0 0 20px #40A6FF, 0 0 30px #40A6FF;
    }
    100% {
        text-shadow: 0 0 5px #40A6FF, 0 0 10px #40A6FF;
    }
}

@keyframes shineGreen {
    0% {
        text-shadow: 0 0 5px #50FF50, 0 0 10px #50FF50;
    }
    50% {
        text-shadow: 0 0 20px #50FF50, 0 0 30px #50FF50;
    }
    100% {
        text-shadow: 0 0 5px #50FF50, 0 0 10px #50FF50;
    }
}

@keyframes shineRed {
    0% {
        text-shadow: 0 0 5px #FF5050, 0 0 10px #FF5050;
    }
    50% {
        text-shadow: 0 0 20px #FF5050, 0 0 30px #FF5050;
    }
    100% {
        text-shadow: 0 0 5px #FF5050, 0 0 10px #FF5050;
    }
}

@keyframes shineOrange {
    0% {
        text-shadow: 0 0 5px #FFA550, 0 0 10px #FFA550;
    }
    50% {
        text-shadow: 0 0 20px #FFA550, 0 0 30px #FFA550;
    }
    100% {
        text-shadow: 0 0 5px #FFA550, 0 0 10px #FFA550;
    }
}

@keyframes shinePurple {
    0% {
        text-shadow: 0 0 5px #B050FF, 0 0 10px #B050FF;
    }
    50% {
        text-shadow: 0 0 20px #B050FF, 0 0 30px #B050FF;
    }
    100% {
        text-shadow: 0 0 5px #B050FF, 0 0 10px #B050FF;
    }
}

@keyframes shinePink {
    0% {
        text-shadow: 0 0 5px #FF69B4, 0 0 10px #FF69B4;
    }
    50% {
        text-shadow: 0 0 20px #FF69B4, 0 0 30px #FF69B4;
    }
    100% {
        text-shadow: 0 0 5px #FF69B4, 0 0 10px #FF69B4;
    }
}

@keyframes rainbowShine {
    0% {
        color: #ff0000;
        text-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000;
    }
    16.666% {
        color: #ff8800;
        text-shadow: 0 0 10px #ff8800, 0 0 20px #ff8800;
    }
    33.333% {
        color: #ffff00;
        text-shadow: 0 0 10px #ffff00, 0 0 20px #ffff00;
    }
    50% {
        color: #00ff00;
        text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00;
    }
    66.666% {
        color: #0088ff;
        text-shadow: 0 0 10px #0088ff, 0 0 20px #0088ff;
    }
    83.333% {
        color: #8800ff;
        text-shadow: 0 0 10px #8800ff, 0 0 20px #8800ff;
    }
    100% {
        color: #ff0000;
        text-shadow: 0 0 10px #ff0000, 0 0 20px #ff0000;
    }
}

@keyframes shineGold {
    0% {
        color: #FFD700;
        text-shadow: 0 0 5px #FFD700, 0 0 10px #FFD700;
    }
    50% {
        color: #FFC125;
        text-shadow: 0 0 20px #FFD700, 0 0 30px #FFD700, 0 0 40px #FFA500;
    }
    100% {
        color: #FFD700;
        text-shadow: 0 0 5px #FFD700, 0 0 10px #FFD700;
    }
}

@keyframes shineBronze {
    0% {
        color: #CD7F32;
        text-shadow: 0 0 5px #CD7F32, 0 0 10px #CD7F32;
    }
    50% {
        color: #B8860B;
        text-shadow: 0 0 20px #CD7F32, 0 0 30px #CD7F32, 0 0 40px #8B4513;
    }
    100% {
        color: #CD7F32;
        text-shadow: 0 0 5px #CD7F32, 0 0 10px #CD7F32;
    }
}

@keyframes shineSilver {
    0% {
        color: #C0C0C0;
        text-shadow: 0 0 5px #C0C0C0, 0 0 10px #C0C0C0;
    }
    50% {
        color: #E8E8E8;
        text-shadow: 0 0 20px #C0C0C0, 0 0 30px #C0C0C0, 0 0 40px #A9A9A9;
    }
    100% {
        color: #C0C0C0;
        text-shadow: 0 0 5px #C0C0C0, 0 0 10px #C0C0C0;
    }
}

@keyframes coinReward {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

.coin-reward-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border: 3px solid gold;
    border-radius: 15px;
    padding: 20px 30px;
    color: gold;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    z-index: 10000;
    animation: coinReward 1s ease-out;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.coin-reward-notification .coin-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
    animation: shineGold 2s infinite;
}

.opponent-progress {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 5px;
    color: white;
}

.opponent-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.opponent-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 8px;
    color: white;
    min-width: 200px;
}

.opponent-status {
    text-align: center;
    font-style: italic;
}

.opponent-progress {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.opponent-name {
    font-weight: bold;
    font-size: 1.1em;
}

.opponent-tower {
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    position: relative;
}

.opponent-level {
    text-align: center;
}

.hidden {
    display: none;
}

.game-over-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 20px 40px;
    border-radius: 8px;
    font-size: 24px;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.multiplayer-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.connection-status {
    text-align: center;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #666;
}

.waiting-message {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.game-over-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
}

.play-again-button {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 1.1em;
    cursor: pointer;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
}

.play-again-button:hover {
    background: #45a049;
}

.hidden {
    display: none !important;
}

#multiplayer-status {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.opponent-panel {
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 8px;
    color: white;
    min-width: 200px;
}

.connection-status {
    font-size: 0.9em;
    text-align: center;
    margin-bottom: 10px;
    color: #4CAF50;
}

.waiting-message {
    text-align: center;
    font-style: italic;
    margin-bottom: 10px;
}

.opponent-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.opponent-name {
    font-weight: bold;
    text-align: center;
}

.opponent-level {
    text-align: center;
}

.game-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.game-controls button {
    min-width: 200px;
}

.multiplayer-modal,
.multiplayer-wait-screen,
.join-game-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content,
.wait-content,
.dialog-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
}

.game-code-display {
    margin: 2rem 0;
}

.code-box {
    font-size: 2rem;
    font-family: monospace;
    padding: 1rem;
    background: #f0f0f0;
    border-radius: 5px;
    margin: 1rem 0;
    letter-spacing: 3px;
}

#game-code-input {
    font-size: 1.5rem;
    padding: 0.5rem;
    text-align: center;
    letter-spacing: 3px;
    margin: 1rem 0;
    width: 200px;
    text-transform: uppercase;
}

.dialog-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.menu-button {
    margin: 0.5rem;
    min-width: 120px;
}


.hidden {
    display: none !important;
}

.youtube-link {
    display: block;
    margin-top: 10px;
    color: #ff0000;
    text-decoration: none;
    font-size: 14px;
}

.youtube-link:hover {
    text-decoration: underline;
}

.coin-shower {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.falling-coin {
    position: absolute;
    top: -50px;
    font-size: 24px;
    animation: fallCoin 3s linear infinite;
    color: gold;
    text-shadow: 0 0 5px gold;
}

@keyframes fallCoin {
    0% {
        transform: translateY(-50px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}