/* Font Face Declarations */
@font-face {
    font-family: 'SVN-Gilroy';
    src: url('../fonts/SVN-GILROY REGULAR.OTF') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'SVN-Gilroy';
    src: url('../fonts/SVN-GILROY SEMIBOLD.OTF') format('opentype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'SVN-Gilroy';
    src: url('../fonts/SVN-GILROY BOLD.OTF') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'SVN-Gilroy', 'Arial', sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (max-width: 450px) {
    body {
        background: url('../images/background.png') no-repeat center center;
        background-size: cover;
    }
    .screen {
        width: 100%;
    }
}

/* Screen Management - Mobile First 9:16 Aspect Ratio */
.screen {
    height: 100vh;
    /* width: 100%; */
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    aspect-ratio: 9/16;
}

.screen.active {
    display: flex;
}

/* Screen Background Images */
#screen1 {
    background-image: url('../images/background-1.png');
}

#screen2 {
    background-image: url('../images/background-2.png');
}

#screen3 {
    background-image: url('../images/background-3.png');
}

/* Screen 1 Styles - Form Only */
form#phoneForm {
    margin-top: 16%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.form-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Input Wrapper with Gradient Border */
.input-wrapper {
    width: 64%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    background: linear-gradient(45deg, #4a90e2 0%, #00ff88 100%);
    border-radius: 12px;
}

#phoneInput {
    width: 98%;
    height: 90%;
    border-radius: 8px;
    border: none;
    outline: none;
    text-align: center;
    font-size: 2.2rem;
    font-family: 'SVN-Gilroy', 'Arial', sans-serif;
    font-weight: 700;
    color: #003875;
}

.error-message {
    margin-top: 10px;
    height: 20px;
    color: #e02f2f;
    font-size: 0.9rem;
    text-shadow: 0 0 5px rgba(255, 68, 68, 0.8);
    text-align: center;
    visibility: hidden;
}

.error-message.show {
    visibility: visible;
}

/* Button Styles */
.button-section {
    display: flex;
    justify-content: center;
}

.start-button,
.spin-button {
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.start-button:hover,
.spin-button:hover {
    transform: scale(1.05);
}

.start-button:active,
.spin-button:active {
    transform: scale(0.95);
}

.start-button img,
.spin-button img {
    max-width: 180px;
    height: auto;
}

/* Screen 2 - Wheel Styles - Mobile Optimized */
.wheel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 42px;
    flex-grow: 1;
    justify-content: center;
}

.wheel-wrapper {
    position: relative;
    width: 80%;
    aspect-ratio: 1/1;
}

.wheel {
    width: 100%;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.6), 0 0 40px rgba(0, 255, 136, 0.4),
        0 0 60px rgba(0, 255, 136, 0.2);
    border-radius: 50%;
    transition: transform 4s ease-out;
}

.wheel-pointer {
    position: absolute;
    top: -3%;
    left: 50%;
    transform: translateX(-50%);
    width: 24%;
    z-index: 10;
}

.spin-button-section {
    display: flex;
    justify-content: center;
}

.spin-button img {
    width: 60%;
}

/* Screen 3 - Prize Display - Mobile Optimized */
.prize-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    flex-grow: 1;
    justify-content: center;
}

.prize-text-container {
    text-align: center;
    padding: 20px;
}

.prize-name {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
    text-transform: uppercase;
    background: linear-gradient(#02d15e 0%, #0b66cf 50%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-stroke: 4px transparent;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #00ff88;
    border-top: 5px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-overlay p {
    color: white;
    font-size: 1.2rem;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.8);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Alert Popup Styles */
.alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.alert-overlay.show {
    opacity: 1;
}

.alert-box {
    background: linear-gradient(135deg, #0f3460 0%, #1a365d 50%, #0d4f3c 100%);
    border: 2px solid #00d4ff;
    border-radius: 16px;
    padding: 0;
    max-width: 350px;
    width: 85%;
    box-shadow: 0 20px 40px rgba(0, 212, 255, 0.4), 0 0 30px rgba(0, 212, 255, 0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    backdrop-filter: blur(10px);
}

.alert-overlay.show .alert-box {
    transform: scale(1);
}

.alert-icon {
    background: linear-gradient(135deg, #00d4ff 0%, #00a8cc 100%);
    color: white;
    padding: 20px;
    text-align: center;
    border-radius: 14px 14px 0 0;
    position: relative;
    overflow: hidden;
}

.alert-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.alert-icon i {
    font-size: 2rem;
}

.alert-content {
    padding: 24px;
    text-align: center;
}

.alert-content h3 {
    color: #ffffff;
    margin-bottom: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    text-shadow: 0 0 15px rgba(0, 212, 255, 0.6);
}

.alert-content p {
    color: #b8c5d1;
    margin-bottom: 20px;
    line-height: 1.5;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.alert-btn {
    background: linear-gradient(135deg, #00d4ff 0%, #00a8cc 100%);
    color: white;
    border: 2px solid #00d4ff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
    position: relative;
    overflow: hidden;
}

.alert-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.alert-btn:hover::before {
    left: 100%;
}

.alert-btn:hover {
    background: linear-gradient(135deg, #00a8cc 0%, #0088aa 100%);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
}

.alert-error .alert-icon {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
}

.alert-error .alert-icon::before {
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
}

.alert-error .alert-btn {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    border: 2px solid #4a90e2;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
}

.alert-error .alert-btn:hover {
    background: linear-gradient(135deg, #357abd 0%, #2c5aa0 100%);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.5);
}

/* Responsive Alert */
@media (max-width: 768px) {
    .alert-box {
        width: 95%;
        max-width: 350px;
    }

    .alert-content {
        padding: 20px;
    }

    .alert-content h3 {
        font-size: 1.1rem;
    }

    .alert-content p {
        font-size: 0.9rem;
    }
}

/* Custom for Play Again Button */
#playAgainBtn {
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease;
}

#playAgainBtn img {
    max-width: 180px;
    height: auto;
}

#playAgainBtn:hover {
    transform: scale(1.05);
}