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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: #fff;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.container {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

.header {
    text-align: center;
    margin-bottom: 40px;
    z-index: 1;
}

.title {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cyber-text {
    font-size: 3.5rem;
    font-weight: bold;
    background: linear-gradient(45deg, #00ffff, #ff00ff, #ffff00, #00ffff);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
    text-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
    letter-spacing: 3px;
}

.subtitle {
    font-size: 1rem;
    color: #00ffff;
    letter-spacing: 5px;
    opacity: 0.7;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.merit-display {
    text-align: center;
    margin-bottom: 50px;
    z-index: 1;
}

.merit-label {
    font-size: 1.2rem;
    color: #00ffff;
    margin-bottom: 10px;
    letter-spacing: 3px;
}

.merit-counter {
    font-size: 5rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 
        0 0 10px #ffd700,
        0 0 20px #ffd700,
        0 0 30px #ffd700,
        0 0 40px #ff8c00;
    transition: all 0.3s ease;
}

.merit-counter.pulse {
    animation: counterPulse 0.5s ease;
}

@keyframes counterPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
        text-shadow: 
            0 0 20px #ffd700,
            0 0 40px #ffd700,
            0 0 60px #ffd700,
            0 0 80px #ff8c00;
    }
}

.merit-unit {
    font-size: 0.9rem;
    color: #00ffff;
    opacity: 0.6;
    letter-spacing: 2px;
    margin-top: 5px;
}

.merit-box-container {
    position: relative;
    margin-bottom: 60px;
    z-index: 1;
}

.glow-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.glow-effect.active {
    animation: glowPulse 0.6s ease;
}

@keyframes glowPulse {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

.merit-box {
    width: 200px;
    height: 200px;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.merit-box:hover {
    transform: scale(1.05);
}

.merit-box:active {
    transform: scale(0.95);
}

.box-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
}

.box-top {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 40px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
    border-radius: 10px 10px 0 0;
    box-shadow: 
        0 0 20px rgba(255, 215, 0, 0.6),
        inset 0 2px 10px rgba(255, 255, 255, 0.3);
}

.box-front {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 160px;
    background: linear-gradient(180deg, #ff8c00 0%, #ff6b00 100%);
    border-radius: 0 0 10px 10px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(255, 140, 0, 0.4),
        inset 0 2px 10px rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.slot {
    width: 120px;
    height: 8px;
    background: linear-gradient(180deg, #000 0%, #333 100%);
    border-radius: 4px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.8);
    margin-bottom: 10px;
}

.box-text {
    font-size: 1.3rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.box-subtext {
    font-size: 0.7rem;
    color: #ffe4b5;
    letter-spacing: 2px;
    opacity: 0.8;
}

.box-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.6);
    animation: boxGlow 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes boxGlow {
    0%, 100% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.6);
    }
    50% {
        box-shadow: 0 0 60px rgba(255, 215, 0, 0.9);
    }
}

.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #ffd700 0%, #ffed4e 50%, transparent 100%);
    border-radius: 50%;
    pointer-events: none;
    animation: particleFloat 1.5s ease-out forwards;
    box-shadow: 0 0 10px #ffd700;
}

@keyframes particleFloat {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

.stats {
    display: flex;
    gap: 40px;
    margin-top: 40px;
    z-index: 1;
}

.stat-item {
    text-align: center;
    padding: 20px 30px;
    background: rgba(0, 255, 255, 0.1);
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

.stat-label {
    font-size: 0.9rem;
    color: #00ffff;
    opacity: 0.7;
    margin-top: 5px;
    letter-spacing: 1px;
}

.blessing-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: bold;
    background: linear-gradient(45deg, #00ffff, #ff00ff, #00ffff);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(0, 255, 255, 0.8)) drop-shadow(0 0 40px rgba(255, 0, 255, 0.6));
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
}

.blessing-text.show {
    animation: blessingFade 2s ease-out forwards;
}

@keyframes blessingFade {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -60%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -70%) scale(0.8);
    }
}

@media (max-width: 768px) {
    .cyber-text {
        font-size: 2.5rem;
    }
    
    .merit-counter {
        font-size: 3.5rem;
    }
    
    .merit-box {
        width: 160px;
        height: 160px;
    }
    
    .box-top {
        width: 140px;
        height: 30px;
    }
    
    .box-front {
        width: 140px;
        height: 130px;
        top: 30px;
    }
    
    .stats {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stat-item {
        padding: 15px 20px;
        flex: 0 1 auto;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
}