* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Ensure proper rendering on all devices */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    font-size: 16px;
}

body {
    font-family: 'Cairo', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #000000 0%, #1a1a2e 50%, #16213e 100%);
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #000000 0%, #1a1a2e 50%, #16213e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.ff-logo {
    animation: fadeInOut 5s ease-in-out;
}

.ff-logo-img {
    width: 200px;
    height: auto;
    filter: drop-shadow(0 0 30px #ffd700);
}

/* Fallback Free Fire logo */
.ff-logo::before {
    content: "🔥";
    font-size: 150px;
    display: block;
    text-shadow: 0 0 30px #ffd700;
}

/* Screen Base Styles */
.screen {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screen-title {
    font-size: 2.2rem;
    color: #ffd700;
    margin-bottom: 40px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Game Selection */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    width: 100%;
    max-width: 500px;
}

.game-option {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-option:hover {
    border-color: #ffd700;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.2);
}

.game-option img {
    width: 80px;
    height: 80px;
    margin-bottom: 15px;
}

.game-option h3 {
    color: #ffffff;
    font-size: 1.2rem;
}

/* Server Setup */
.server-animation {
    margin-bottom: 30px;
}

.diamonds-moving {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.diamonds-moving .diamond {
    font-size: 2rem;
    animation: bounce 1s infinite alternate;
}

.diamonds-moving .diamond:nth-child(2) { animation-delay: 0.2s; }
.diamonds-moving .diamond:nth-child(3) { animation-delay: 0.4s; }
.diamonds-moving .diamond:nth-child(4) { animation-delay: 0.6s; }
.diamonds-moving .diamond:nth-child(5) { animation-delay: 0.8s; }

.timer {
    font-size: 4rem;
    color: #ffd700;
    font-weight: 700;
    margin: 20px 0;
}

.success-message {
    animation: fadeIn 0.5s ease-in;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: scaleIn 0.5s ease-out;
}

/* Account Input */
.input-container {
    width: 100%;
    max-width: 400px;
    margin-bottom: 30px;
}

#account-id {
    width: 100%;
    padding: 20px;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    color: #ffffff;
    text-align: center;
    outline: none;
    transition: border-color 0.3s ease;
}

#account-id:focus {
    border-color: #ffd700;
}

#account-id::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-hint {
    color: #cccccc;
    font-size: 0.9rem;
    margin-top: 10px;
}

.next-btn {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #000000;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.5;
}

.next-btn:not(:disabled) {
    opacity: 1;
}

.next-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 215, 0, 0.3);
}

/* Account Verification */
.verification-steps {
    width: 100%;
    max-width: 500px;
}

.step {
    background: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #ffd700;
}

.step-text {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    background: #ffd700;
    border-radius: 50%;
    animation: loadingDots 1.5s infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

.step.success {
    border-left-color: #00ff00;
}

/* Diamond Selection */
.boxes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 600px;
}

.mystery-box {
    position: relative;
    height: 180px;
    cursor: pointer;
    perspective: 1000px;
}

.box-front,
.box-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.6s;
}

.box-front {
    background: rgba(139, 69, 19, 0.8);
    border: 2px solid #8B4513;
}

.box-back {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #000000;
    transform: rotateY(180deg);
}

.mystery-box.flipped .box-front {
    transform: rotateY(-180deg);
}

.mystery-box.flipped .box-back {
    transform: rotateY(0deg);
}

.box-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.box-text {
    font-size: 1rem;
    color: #ffffff;
}

.diamond-count {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.diamond-icon {
    font-size: 2rem;
}

/* Diamond Charging */
.charging-animation {
    width: 100%;
    max-width: 500px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 30px;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 15px;
}

.diamond-counter {
    font-size: 4rem;
    color: #ffd700;
    font-weight: 700;
    margin: 20px 0;
}

.diamonds-flow {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.diamonds-flow .diamond {
    font-size: 2rem;
    animation: flow 2s infinite linear;
}

.diamonds-flow .diamond:nth-child(2) { animation-delay: 0.4s; }
.diamonds-flow .diamond:nth-child(3) { animation-delay: 0.8s; }
.diamonds-flow .diamond:nth-child(4) { animation-delay: 1.2s; }
.diamonds-flow .diamond:nth-child(5) { animation-delay: 1.6s; }

.charging-complete {
    animation: fadeIn 0.5s ease-in;
}

.final-diamond {
    font-size: 6rem;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

.final-count {
    font-size: 3rem;
    color: #ffd700;
    font-weight: 700;
    margin-bottom: 30px;
}

.receive-btn {
    background: linear-gradient(45deg, #00ff00, #32cd32);
    color: #000000;
    border: none;
    padding: 20px 50px;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 255, 0, 0.3);
}

.receive-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 255, 0, 0.4);
}

/* Sending Process */
.sending-step,
.error-step,
.failed-step {
    width: 100%;
    max-width: 500px;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: shake 0.5s ease-in-out;
}

.error-description {
    font-size: 1.1rem;
    color: #cccccc;
    margin-bottom: 30px;
    line-height: 1.6;
}

.verification-cta {
    position: relative;
}

.verify-btn {
    background: linear-gradient(45deg, #ff4444, #ff6666);
    color: #ffffff;
    border: none;
    padding: 20px 50px;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(255, 68, 68, 0.3);
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 15px;
}

.verify-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(255, 68, 68, 0.4);
}

.countdown {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 1rem;
    animation: urgentPulse 1s infinite;
}

/* Animations */
@keyframes fadeInOut {
    0% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.8); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes loadingDots {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

@keyframes flow {
    0% { transform: translateX(-50px) scale(0.5); opacity: 0; }
    50% { transform: translateX(0) scale(1); opacity: 1; }
    100% { transform: translateX(50px) scale(0.5); opacity: 0; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@keyframes urgentPulse {
    0%, 100% { background: rgba(255, 255, 255, 0.2); }
    50% { background: rgba(255, 255, 255, 0.4); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .screen-title {
        font-size: 1.8rem;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
        max-width: 300px;
    }
    
    .boxes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .mystery-box {
        height: 150px;
    }
    
    .diamond-count {
        font-size: 2rem;
    }
    
    .final-diamond {
        font-size: 4rem;
    }
    
    .verify-btn {
        padding: 15px 30px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .screen-title {
        font-size: 1.5rem;
    }
    
    .ff-logo-img {
        width: 150px;
    }
    
    .timer {
        font-size: 3rem;
    }
    
    .diamond-counter {
        font-size: 3rem;
    }
    
    .boxes-grid {
        grid-template-columns: 1fr;
        max-width: 200px;
    }
    
    .mystery-box {
        height: 120px;
    }
    
    .box-icon {
        font-size: 2rem;
    }
    
    .diamond-count {
        font-size: 1.8rem;
    }
}