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

body {
    font-family: 'Arial', sans-serif;
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
    position: relative;
    background: #0a0520;
}

.container {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Background */
.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.background-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(10, 5, 32, 0.3) 0%, rgba(10, 5, 32, 0.5) 100%);
}

/* Floating decorative elements */
.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.floating-gem {
    position: absolute;
    width: 60px;
    height: 60px;
    opacity: 0.7;
    animation: floatGem 8s infinite ease-in-out;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

.gem-1 {
    top: 15%;
    left: 5%;
    animation-delay: 0s;
    clip-path: inset(0 75% 75% 0);
}

.gem-2 {
    top: 50%;
    right: 8%;
    animation-delay: 2s;
    clip-path: inset(0 50% 75% 25%);
}

.gem-3 {
    bottom: 20%;
    left: 10%;
    animation-delay: 4s;
    clip-path: inset(75% 75% 0 0);
}

@keyframes floatGem {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
        opacity: 0.5;
    }
    50% { 
        transform: translateY(-30px) rotate(10deg); 
        opacity: 0.8;
    }
}

/* Header */
.header {
    position: relative;
    text-align: center;
    margin-bottom: 30px;
    z-index: 2;
}

.badge {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #1a0f3a;
    padding: 10px 24px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 14px;
    display: inline-block;
    box-shadow: 
        0 4px 15px rgba(255, 215, 0, 0.4),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
}

/* Main Content */
.main-content {
    flex: 1;
    text-align: center;
    z-index: 2;
}

.title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 
        0 0 20px rgba(255, 215, 0, 0.8),
        0 0 40px rgba(255, 215, 0, 0.5),
        0 4px 8px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 16px;
    margin-bottom: 50px;
    opacity: 0.95;
    line-height: 1.5;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    padding: 0 10px;
}

.game-section {
    margin-bottom: 40px;
}

.choose-text {
    font-size: 20px;
    margin-bottom: 35px;
    color: #ffd700;
    font-weight: bold;
    text-shadow: 
        0 0 10px rgba(255, 215, 0, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.portals-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    padding: 0 10px;
}

.portal {
    width: 110px;
    height: 110px;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
    position: relative;
}

.portal:hover {
    transform: scale(1.08);
    filter: brightness(1.2) drop-shadow(0 0 25px rgba(255, 215, 0, 0.8));
}

.portal-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.5));
}

.portal.selected {
    animation: selectedPortal 0.8s ease-in-out;
}

@keyframes selectedPortal {
    0% { transform: scale(1); }
    25% { transform: scale(1.15) rotate(5deg); }
    50% { transform: scale(1.2) rotate(-5deg); }
    75% { transform: scale(1.15) rotate(3deg); }
    100% { transform: scale(1); }
}

/* Footer */
.footer {
    text-align: center;
    font-size: 12px;
    opacity: 0.7;
    z-index: 2;
    margin-top: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    text-align: center;
    max-width: 400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.popup-image {
    width: 100%;
    max-width: 380px;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.7));
}

.popup-image.clickable {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.popup-image.clickable:hover {
    transform: scale(1.02);
}

.win-modal {
    animation: winModalAppear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes winModalAppear {
    0% { 
        transform: scale(0.3) rotate(-15deg);
        opacity: 0;
    }
    70% {
        transform: scale(1.05) rotate(5deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.lose-modal {
    animation: loseModalAppear 0.6s ease-out;
}

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

/* Buttons */
.cta-button, .continue-button {
    background: linear-gradient(135deg, #ff5757 0%, #ff8282 100%);
    border: none;
    color: white;
    font-size: 24px;
    font-weight: bold;
    padding: 16px 50px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 6px 20px rgba(255, 87, 87, 0.5),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
}

.continue-button {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #1a0f3a;
    box-shadow: 
        0 6px 20px rgba(255, 215, 0, 0.5),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
}

.cta-button:hover, .continue-button:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 10px 30px rgba(255, 87, 87, 0.7),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
}

.continue-button:hover {
    box-shadow: 
        0 10px 30px rgba(255, 215, 0, 0.7),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
}

.cta-button:active, .continue-button:active {
    transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 380px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 26px;
    }
    
    .subtitle {
        font-size: 14px;
    }
    
    .portals-container {
        gap: 10px;
    }
    
    .portal {
        width: 95px;
        height: 95px;
    }
    
    .popup-image {
        max-width: 320px;
    }
    
    .cta-button, .continue-button {
        font-size: 20px;
        padding: 14px 40px;
    }
}

@media (min-width: 431px) {
    .container {
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    }
}
