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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f4b 50%, #0f1a3f 100%);
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.container {
    width: 100%;
    height: 100vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Screen Management */
.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease-in-out;
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
}

/* Welcome Screen */
#welcomeScreen {
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f4b 50%, #0f1a3f 100%);
}

.welcome-content {
    text-align: center;
    animation: fadeInScale 0.8s ease-out;
}

.title {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00ff88 0%, #00ccff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    text-shadow: 0 0 30px rgba(0, 255, 136, 0.3);
}

.subtitle {
    font-size: 1.5rem;
    color: #00ff88;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
}

.instruction {
    font-size: 1rem;
    color: #b0b0b0;
    margin-bottom: 2rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #00ff88 0%, #00ccff 100%);
    color: #0a0e27;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.6), 0 10px 20px rgba(0, 255, 136, 0.2);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-yes {
    background: linear-gradient(135deg, #00ff88 0%, #00dd77 100%);
    color: #0a0e27;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
    flex: 1;
    margin-right: 0.5rem;
}

.btn-yes:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(0, 255, 136, 0.5);
}

.btn-no {
    background: linear-gradient(135deg, #ff3366 0%, #ff1155 100%);
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 51, 102, 0.3);
    flex: 1;
    margin-left: 0.5rem;
}

.btn-no:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(255, 51, 102, 0.5);
}

/* Card Screen */
#cardScreen {
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f4b 50%, #0f1a3f 100%);
}

.card-container {
    background: rgba(26, 31, 75, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 20px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 255, 136, 0.1), inset 0 0 20px rgba(0, 255, 136, 0.05);
    animation: slideInUp 0.6s ease-out;
}

.card-header {
    text-align: center;
    margin-bottom: 2rem;
}

#cardNumber {
    font-size: 1.5rem;
    color: #00ff88;
    margin-bottom: 0.5rem;
}

#cardQuestion {
    font-size: 1.1rem;
    color: #b0b0b0;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
    animation: fadeIn 0.6s ease-out 0.2s backwards;
}

.card-number {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1) 0%, rgba(0, 204, 255, 0.1) 100%);
    border: 1px solid rgba(0, 255, 136, 0.3);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    color: #00ff88;
    cursor: default;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.2);
}

.card-number:hover {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2) 0%, rgba(0, 204, 255, 0.2) 100%);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
    transform: scale(1.05);
}

.card-actions {
    display: flex;
    gap: 1rem;
    animation: fadeIn 0.6s ease-out 0.4s backwards;
}

/* Analysis Screen */
#analysisScreen {
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f4b 50%, #0f1a3f 100%);
}

.analysis-container {
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

.analysis-title {
    font-size: 2rem;
    color: #00ff88;
    margin-bottom: 2rem;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

.scanner {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 2rem;
}

.scanner-ring {
    width: 100%;
    height: 100%;
    animation: rotatePulse 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(0, 255, 136, 0.4));
}

.scan-line {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 160px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00ff88, transparent);
    transform: translateX(-50%) translateY(-50%);
    animation: scan 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.6);
}

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #00ccff;
    border-radius: 50%;
    animation: drift 4s ease-in-out infinite;
    opacity: 0.6;
}

.particle:nth-child(1) { top: 20%; left: 20%; animation-delay: 0s; }
.particle:nth-child(2) { top: 80%; left: 30%; animation-delay: 0.5s; }
.particle:nth-child(3) { top: 40%; left: 80%; animation-delay: 1s; }
.particle:nth-child(4) { top: 70%; left: 70%; animation-delay: 1.5s; }
.particle:nth-child(5) { top: 30%; left: 60%; animation-delay: 2s; }

.status-message {
    font-size: 1.1rem;
    color: #00ccff;
    margin: 2rem 0;
    height: 1.5rem;
    animation: fadeInOut 2s ease-in-out infinite;
}

.progress-container {
    width: 200px;
    height: 4px;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.2);
}

#progressBar {
    height: 100%;
    background: linear-gradient(90deg, #00ff88 0%, #00ccff 100%);
    width: 0%;
    animation: progress 2s ease-in-out forwards;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.6);
}

/* Result Screen */
#resultScreen {
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f4b 50%, #0f1a3f 100%);
}

.result-container {
    text-align: center;
    animation: fadeIn 0.6s ease-out;
}

.result-number {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00ff88 0%, #00ccff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    text-shadow: 0 0 40px rgba(0, 255, 136, 0.4);
    animation: revealResult 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes scan {
    0% {
        top: 0%;
    }
    50% {
        top: 100%;
    }
    100% {
        top: 0%;
    }
}

@keyframes drift {
    0%, 100% {
        transform: translate(0, 0);
        opacity: 0.6;
    }
    50% {
        transform: translate(20px, -20px);
        opacity: 0.3;
    }
}

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

@keyframes progress {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

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

@keyframes revealResult {
    0% {
        opacity: 0;
        transform: scale(0.5) rotateY(90deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

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

    .subtitle {
        font-size: 1.2rem;
    }

    .card-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
    }

    .card-number {
        font-size: 1.1rem;
        padding: 0.8rem;
    }

    .result-number {
        font-size: 2.5rem;
    }
}
