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

body {
    font-family: 'Georgia', serif;
    background: linear-gradient(135deg, #1a0000 0%, #4a0000 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
}

/* Red Curtains */
.curtain {
    position: fixed;
    top: 0;
    width: 12%;
    height: 100vh;
    background: linear-gradient(90deg,
        #8b0000 0%,
        #dc143c 20%,
        #8b0000 40%,
        #dc143c 60%,
        #8b0000 80%,
        #dc143c 100%
    );
    box-shadow: inset -20px 0 50px rgba(0, 0, 0, 0.5);
    z-index: 10;
    pointer-events: none;
}

.curtain-left {
    left: 0;
    border-right: 3px solid #ffd700;
}

.curtain-right {
    right: 0;
    border-left: 3px solid #ffd700;
    box-shadow: inset 20px 0 50px rgba(0, 0, 0, 0.5);
}

/* Theater Container */
.theater-container {
    max-width: 1200px;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 1;
    padding-left: 13%;
    padding-right: 13%;
    box-sizing: border-box;
}

/* Marquee Sign */
.marquee {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 8px solid #ffd700;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    position: relative;
    box-shadow:
        0 0 30px rgba(255, 215, 0, 0.5),
        inset 0 0 20px rgba(255, 215, 0, 0.1);
}

/* Lights all around the border */
.marquee::before,
.marquee::after {
    content: '';
    position: absolute;
    pointer-events: none;
    border-radius: 20px;
}

/* Top and bottom lights */
.marquee::before {
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background-image:
        /* Top */
        repeating-linear-gradient(
            90deg,
            #ffd700 0px,
            #ffd700 15px,
            transparent 15px,
            transparent 30px,
            #ff69b4 30px,
            #ff69b4 45px,
            transparent 45px,
            transparent 60px,
            #00ffff 60px,
            #00ffff 75px,
            transparent 75px,
            transparent 90px
        ),
        /* Bottom */
        repeating-linear-gradient(
            90deg,
            #00ffff 0px,
            #00ffff 15px,
            transparent 15px,
            transparent 30px,
            #ffd700 30px,
            #ffd700 45px,
            transparent 45px,
            transparent 60px,
            #ff69b4 60px,
            #ff69b4 75px,
            transparent 75px,
            transparent 90px
        );
    background-position: 0 0, 0 100%;
    background-size: 100% 20px, 100% 20px;
    background-repeat: no-repeat;
    animation: lightsHorizontal 1.5s infinite;
}

/* Left and right lights */
.marquee::after {
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background-image:
        /* Left */
        repeating-linear-gradient(
            0deg,
            #ff69b4 0px,
            #ff69b4 15px,
            transparent 15px,
            transparent 30px,
            #00ffff 30px,
            #00ffff 45px,
            transparent 45px,
            transparent 60px,
            #ffd700 60px,
            #ffd700 75px,
            transparent 75px,
            transparent 90px
        ),
        /* Right */
        repeating-linear-gradient(
            0deg,
            #ffd700 0px,
            #ffd700 15px,
            transparent 15px,
            transparent 30px,
            #ff69b4 30px,
            #ff69b4 45px,
            transparent 45px,
            transparent 60px,
            #00ffff 60px,
            #00ffff 75px,
            transparent 75px,
            transparent 90px
        );
    background-position: 0 0, 100% 0;
    background-size: 20px 100%, 20px 100%;
    background-repeat: no-repeat;
    animation: lightsVertical 1.5s infinite reverse;
}

.marquee-lights {
    display: none;
}

@keyframes lightsHorizontal {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes lightsVertical {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.theater-title {
    font-size: 3.5em;
    color: #ffd700;
    text-transform: uppercase;
    letter-spacing: 8px;
    text-shadow:
        0 0 10px #ffd700,
        0 0 20px #ffd700,
        0 0 30px #ff69b4,
        3px 3px 0 rgba(0, 0, 0, 0.8);
    margin: 0;
    font-weight: bold;
}

.subtitle {
    color: #fff;
    font-size: 1.3em;
    margin-bottom: 40px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
    line-height: 1.6;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* Windows Grid */
.windows-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 40px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* Individual Window */
.window {
    position: relative;
    aspect-ratio: 1;
    cursor: pointer;
    perspective: 1000px;
}

.window-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.window.opened .window-inner {
    transform: rotateY(180deg);
}

.window-front,
.window-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.window-front {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 3px solid #ffd700;
    font-size: 2.5em;
    color: #ffd700;
    font-weight: bold;
    text-shadow: 0 0 10px #ffd700;
    transition: all 0.3s;
}

.window:hover .window-front {
    border-color: #ff69b4;
    color: #ff69b4;
    text-shadow: 0 0 15px #ff69b4;
    transform: scale(1.05);
}

.window-back {
    transform: rotateY(180deg);
    color: white;
    font-size: 1.3em;
    font-weight: bold;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.window-back.has-image {
    padding: 10px;
}

.prize-image {
    max-width: 80%;
    max-height: 60%;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 10px;
}

.prize-text {
    font-size: 0.9em;
}

/* Footer Message */
.footer-message {
    color: #ffd700;
    font-size: 1.8em;
    font-style: italic;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-top: 30px;
}

/* Responsive */
/* Large screens - reduce to 4 columns for bigger cells */
@media (max-width: 1100px) {
    .curtain {
        width: 10%;
    }

    .theater-container {
        padding-left: 11%;
        padding-right: 11%;
    }

    .windows-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
}

/* Medium screens - 3 columns */
@media (max-width: 850px) {
    .curtain {
        width: 10%;
    }

    .theater-container {
        padding-left: 11%;
        padding-right: 11%;
    }

    .windows-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }

    .theater-title {
        font-size: 2.5em;
        letter-spacing: 6px;
    }

    .subtitle {
        font-size: 1.1em;
        letter-spacing: 0.5px;
    }
}

/* Tablets - 3 columns */
@media (max-width: 768px) {
    .curtain {
        width: 8%;
    }

    .theater-container {
        padding-left: 9%;
        padding-right: 9%;
    }

    .theater-title {
        font-size: 2em;
        letter-spacing: 4px;
    }

    .subtitle {
        font-size: 1em;
        letter-spacing: 0.5px;
    }

    .windows-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .window-back {
        font-size: 1em;
    }

    .footer-message {
        font-size: 1.3em;
    }
}

/* Small tablets/large phones - 3 columns */
@media (max-width: 600px) {
    .curtain {
        width: 8%;
    }

    .theater-container {
        padding-left: 9%;
        padding-right: 9%;
    }

    .windows-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
}

/* Phones - 2 columns, visible curtains */
@media (max-width: 480px) {
    .curtain {
        width: 6%;
    }

    .theater-container {
        padding-left: 7%;
        padding-right: 7%;
    }

    .windows-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .window-front {
        font-size: 2em;
    }
}

/* Color variations for different prizes */
.color-1 { background: linear-gradient(135deg, #ff6b6b, #ee5a6f); }
.color-2 { background: linear-gradient(135deg, #4ecdc4, #44a08d); }
.color-3 { background: linear-gradient(135deg, #f7b731, #f79f1f); }
.color-4 { background: linear-gradient(135deg, #a29bfe, #6c5ce7); }
.color-5 { background: linear-gradient(135deg, #fd79a8, #e84393); }
.color-6 { background: linear-gradient(135deg, #00b894, #00cec9); }
.color-7 { background: linear-gradient(135deg, #ff7675, #d63031); }
.color-8 { background: linear-gradient(135deg, #74b9ff, #0984e3); }
.color-9 { background: linear-gradient(135deg, #ffeaa7, #fdcb6e); }
.color-10 { background: linear-gradient(135deg, #fab1a0, #e17055); }
.color-11 { background: linear-gradient(135deg, #81ecec, #00b894); }
.color-12 { background: linear-gradient(135deg, #a29bfe, #6c5ce7); }
.color-13 { background: linear-gradient(135deg, #fd79a8, #e84393); }
.color-14 { background: linear-gradient(135deg, #55efc4, #00b894); }
.color-15 { background: linear-gradient(135deg, #ff7675, #d63031); }
.color-16 { background: linear-gradient(135deg, #74b9ff, #0984e3); }
.color-17 { background: linear-gradient(135deg, #a29bfe, #6c5ce7); }
.color-18 { background: linear-gradient(135deg, #ffeaa7, #fdcb6e); }
.color-19 { background: linear-gradient(135deg, #ff6b6b, #ee5a6f); }
.color-20 { background: linear-gradient(135deg, #4ecdc4, #44a08d); }
.color-21 { background: linear-gradient(135deg, #e056fd, #b721ff); }
.color-22 { background: linear-gradient(135deg, #f093fb, #f5576c); }
.color-23 { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.color-24 { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.color-25 { background: linear-gradient(135deg, #fa709a, #fee140); }

/* Podium Section */
.podium-section {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 1s ease-in-out, max-height 1s ease-in-out;
    margin-top: 60px;
}

.podium-section.visible {
    opacity: 1;
    max-height: 1000px;
}

.podium-header {
    text-align: center;
    margin-bottom: 50px;
}

.podium-title {
    font-size: 2.5em;
    color: #ffd700;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow:
        0 0 10px #ffd700,
        0 0 20px #ffd700,
        2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 20px;
}

.podium-instructions {
    color: #fff;
    font-size: 1.2em;
    line-height: 1.6;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    margin: 40px 0;
    perspective: 1000px;
}

.podium-spot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.podium-medal {
    font-size: 3em;
    animation: float 3s ease-in-out infinite;
}

.podium-first .podium-medal {
    animation-delay: 0s;
}

.podium-second .podium-medal {
    animation-delay: 0.3s;
}

.podium-third .podium-medal {
    animation-delay: 0.6s;
}

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

.podium-label {
    color: #ffd700;
    font-size: 1.3em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.podium-choice {
    width: 220px;
    min-height: 180px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 4px solid #ffd700;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    box-shadow:
        0 8px 16px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.podium-first .podium-choice {
    min-height: 200px;
    border-width: 5px;
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(255, 215, 0, 0.5);
}

.podium-placeholder {
    color: #666;
    font-style: italic;
    font-size: 1.1em;
}

.podium-choice.filled {
    background: linear-gradient(135deg, #ffd700 0%, #f7b731 100%);
    border-color: #fff;
    cursor: pointer;
}

.podium-choice.filled:hover {
    transform: scale(1.05);
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(255, 215, 0, 0.6);
}

.podium-choice-text {
    color: #1a1a1a;
    font-size: 1.2em;
    font-weight: bold;
    line-height: 1.3;
}

.podium-hint {
    text-align: center;
    color: #ffd700;
    font-size: 1.1em;
    font-style: italic;
    margin-top: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Make musical windows clickable when podium is visible */
.window.musical.selectable .window-back {
    cursor: pointer;
    position: relative;
}

.window.musical.selectable:hover .window-back::after {
    content: '👆 Clicca per scegliere';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #ffd700;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.7em;
    white-space: nowrap;
    animation: bounce 0.5s ease-in-out infinite alternate;
}

@keyframes bounce {
    from { transform: translateX(-50%) translateY(0); }
    to { transform: translateX(-50%) translateY(-5px); }
}

.window.musical.selected .window-back {
    opacity: 0.5;
    border: 3px solid #ffd700;
}

/* Responsive podium */
@media (max-width: 768px) {
    .podium-title {
        font-size: 1.8em;
    }

    .podium-instructions {
        font-size: 1em;
    }

    .podium-container {
        gap: 15px;
    }

    .podium-choice {
        width: 160px;
        min-height: 140px;
        padding: 15px;
    }

    .podium-first .podium-choice {
        min-height: 160px;
    }

    .podium-medal {
        font-size: 2.5em;
    }

    .podium-label {
        font-size: 1em;
    }

    .podium-choice-text {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .podium-container {
        flex-direction: column;
        align-items: center;
    }

    .podium-spot {
        width: 100%;
        max-width: 280px;
    }

    .podium-choice {
        width: 100%;
    }

    .podium-instructions br {
        display: none;
    }
}

/* Celebration Overlay */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.celebration-overlay.active {
    display: flex;
    opacity: 1;
}

.celebration-content {
    text-align: center;
    position: relative;
    z-index: 10001;
}

.celebration-title {
    font-size: 8em;
    color: #ffd700;
    text-transform: uppercase;
    letter-spacing: 20px;
    text-shadow:
        0 0 20px #ffd700,
        0 0 40px #ffd700,
        0 0 60px #ff69b4,
        0 0 80px #ff69b4,
        5px 5px 10px rgba(0, 0, 0, 0.8);
    animation: flash 1s ease-in-out infinite, rainbow 3s linear infinite;
    font-weight: bold;
    font-family: 'Georgia', serif;
}

@keyframes flash {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

@keyframes rainbow {
    0% {
        text-shadow:
            0 0 20px #ffd700,
            0 0 40px #ffd700,
            0 0 60px #ff69b4,
            0 0 80px #ff69b4,
            5px 5px 10px rgba(0, 0, 0, 0.8);
    }
    25% {
        text-shadow:
            0 0 20px #ff69b4,
            0 0 40px #ff69b4,
            0 0 60px #00ffff,
            0 0 80px #00ffff,
            5px 5px 10px rgba(0, 0, 0, 0.8);
    }
    50% {
        text-shadow:
            0 0 20px #00ffff,
            0 0 40px #00ffff,
            0 0 60px #4ecdc4,
            0 0 80px #4ecdc4,
            5px 5px 10px rgba(0, 0, 0, 0.8);
    }
    75% {
        text-shadow:
            0 0 20px #4ecdc4,
            0 0 40px #4ecdc4,
            0 0 60px #ffd700,
            0 0 80px #ffd700,
            5px 5px 10px rgba(0, 0, 0, 0.8);
    }
    100% {
        text-shadow:
            0 0 20px #ffd700,
            0 0 40px #ffd700,
            0 0 60px #ff69b4,
            0 0 80px #ff69b4,
            5px 5px 10px rgba(0, 0, 0, 0.8);
    }
}

/* Celebration confetti */
.celebration-confetti {
    position: fixed;
    width: 15px;
    height: 15px;
    z-index: 10000;
    pointer-events: none;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) translateX(var(--drift, 0px)) rotate(720deg);
        opacity: 0;
    }
}

/* Responsive celebration */
@media (max-width: 768px) {
    .celebration-title {
        font-size: 4em;
        letter-spacing: 10px;
    }
}

@media (max-width: 480px) {
    .celebration-title {
        font-size: 2.5em;
        letter-spacing: 5px;
    }
}
