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

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: #000 url('/static/images/bg.jpg') no-repeat center center fixed;
    background-size: cover;
    color: #fff;
    height: 100vh;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 0;
}

.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/static/images/stars.png') repeat;
    animation: stars 50s linear infinite;
    z-index: 0;
    opacity: 0.3;
    pointer-events: none;
}

@keyframes stars {
    from {
        background-position: 0 0;
    }
    to {
        background-position: -1000px 0;
    }
}

.container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    justify-content: flex-start;
    padding-top: 40px;
}

h1 {
    font-size: 24px;
    margin-bottom: 60px;
    text-align: center;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    transition: opacity 0.5s ease;
}

h1.hide {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    visibility: hidden;
}

.cards-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    perspective: 1000px;
    margin-top: -20px;
}

.top-row, .bottom-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    width: 100%;
}

.bottom-row {
    margin-top: 20px;
}

.card {
    width: 70px;
    height: 120px;
    cursor: pointer;
    position: relative;
    perspective: 1000px;
    transform-style: preserve-3d;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 0;
    background-size: cover;
    background-position: center;
}

.card-front {
    transform: rotateY(180deg);
}

.card-back {
    background-image: url('/static/images/back.jpg');
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.card.selected {
    box-shadow: 
        0 0 20px rgba(128, 128, 255, 0.3),
        0 0 40px rgba(88, 88, 255, 0.2),
        inset 0 0 15px rgba(128, 128, 255, 0.2);
    transform: translateY(-10px);
}

.card.selected::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 2px solid rgba(128, 128, 255, 0.4);
    border-radius: 0;
    box-shadow: 
        0 0 20px rgba(128, 128, 255, 0.3),
        inset 0 0 15px rgba(128, 128, 255, 0.2);
    animation: cardGlow 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes cardGlow {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(128, 128, 255, 0.3),
            inset 0 0 15px rgba(128, 128, 255, 0.2);
    }
    50% {
        box-shadow: 
            0 0 30px rgba(128, 128, 255, 0.4),
            inset 0 0 20px rgba(128, 128, 255, 0.3);
    }
}

#continue-button {
    display: none;
}

.selected-cards {
    text-align: center;
    margin-bottom: 20px;
}

.selected-cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.selected-card {
    width: 50px;
    height: 85px;
    border-radius: 4px;
    overflow: hidden;
}

.selected-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes buttonGlow {
    0% {
        box-shadow: 0 0 15px rgba(128, 128, 255, 0.2),
                    inset 0 0 8px rgba(128, 128, 255, 0.1);
    }
    50% {
        box-shadow: 0 0 20px rgba(128, 128, 255, 0.3),
                    inset 0 0 12px rgba(128, 128, 255, 0.2);
    }
    100% {
        box-shadow: 0 0 15px rgba(128, 128, 255, 0.2),
                    inset 0 0 8px rgba(128, 128, 255, 0.1);
    }
}

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

.continue-btn {
    background: linear-gradient(45deg, 
        rgba(28, 28, 45, 0.9), 
        rgba(35, 35, 55, 0.9),
        rgba(28, 28, 45, 0.9));
    background-size: 200% 200%;
    border: 1px solid rgba(128, 128, 255, 0.2);
    color: #b8b8ff;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 1px;
    border-radius: 30px;
    cursor: pointer;
    position: relative;
    margin-top: 30px;
    transition: all 0.3s ease;
    text-shadow: 0 0 8px rgba(128, 128, 255, 0.3);
    backdrop-filter: blur(10px);
    opacity: 0;
    display: none;
    z-index: 100;
    box-shadow: 
        0 0 15px rgba(128, 128, 255, 0.2),
        inset 0 0 8px rgba(128, 128, 255, 0.1),
        0 0 30px rgba(88, 88, 255, 0.1);
}

.continue-btn:hover {
    background: linear-gradient(45deg,
        rgba(35, 35, 55, 0.95),
        rgba(45, 45, 75, 0.95),
        rgba(35, 35, 55, 0.95));
    background-size: 200% 200%;
    border-color: rgba(128, 128, 255, 0.4);
    color: #d8d8ff;
    transform: translateY(-2px);
    box-shadow: 
        0 0 25px rgba(128, 128, 255, 0.3),
        inset 0 0 15px rgba(128, 128, 255, 0.2),
        0 0 50px rgba(88, 88, 255, 0.2);
    text-shadow: 0 0 12px rgba(128, 128, 255, 0.5);
}

.continue-btn:active {
    transform: translateY(1px);
    box-shadow: 
        0 0 15px rgba(128, 128, 255, 0.2),
        inset 0 0 10px rgba(128, 128, 255, 0.3);
    transition: all 0.1s;
}

.continue-btn.visible {
    display: block;
    opacity: 1;
}

/* Анимации для карт */
@keyframes fadeOut {
    0% { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% { 
        opacity: 0;
        transform: scale(0.8) translateY(30px);
        pointer-events: none;
    }
}

@keyframes moveToCenter {
    0% {
        transform: translate(0, 0) scale(1);
    }
    30% {
        transform: translate(calc(var(--target-x) * 0.5), -60px) scale(1.15);
    }
    50% {
        transform: translate(var(--target-x), -60px) scale(1.15);
    }
    75% {
        transform: translate(var(--target-x), -20px) scale(1.15);
    }
    100% {
        transform: translate(var(--target-x), 0) scale(1.15);
    }
}

.card.fade-out {
    animation: fadeOut 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}

.card.selected.move-to-center {
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -35px;
    margin-top: -60px;
    pointer-events: none;
} 

/* Стили для перевёрнутых карт */
.card-front.reversed {
    transform: rotateY(180deg) rotateZ(180deg);
}

.card.selected .card-front.reversed {
    box-shadow: 
        0 0 20px rgba(255, 0, 0, 0.3),
        0 0 40px rgba(255, 0, 0, 0.2),
        inset 0 0 15px rgba(255, 0, 0, 0.2);
}

.card-front.reversed::after {
    content: '↓';
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    pointer-events: none;
    z-index: 2;
} 