* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: url('/images/Фон.jpg') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    color: #fff;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Делаем контейнер более прозрачным */
.container {
    width: 100%;
    max-width: 500px;
    background: rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(5px);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.subtitle {
    color: #fff;
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 20px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.card {
    aspect-ratio: 2/3;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.card:hover:not(.open) {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.card.selected {
    transform: scale(0.95);
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.8);
    border: 2px solid #8a2be2;
}

.card.open {
    cursor: default;
}

.card-back, .card-front {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-back {
    background: linear-gradient(135deg, #4b0082, #8a2be2);
}

.card-front {
    display: none;
}

.card.open .card-front {
    display: block;
}

.card.open .card-back {
    display: none;
}

.card-number {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

/* Скрываем блок с выбранными картами */
.selected-cards {
    display: none;
}

.controls {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.btn-continue {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 300px;
    background: linear-gradient(135deg, #8a2be2, #4b0082);
    color: white;
}

.btn-continue:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(138, 43, 226, 0.4);
}

.btn-continue:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Адаптация для очень маленьких экранов */
@media (max-width: 400px) {
    .container {
        padding: 15px;
        background: rgba(0, 0, 0, 0.55);
    }
    
    .subtitle {
        font-size: 14px;
    }
    
    .btn-continue {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* Для горизонтальной ориентации на мобильных */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        max-height: 90vh;
        overflow-y: auto;
        background: rgba(0, 0, 0, 0.6);
    }
    
    .cards-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}