/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
    overflow-x: hidden;
}

.container {
    max-width: 500px;
    margin: 0 auto;
}

/* Заголовок */
.header {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease-out;
}

.title {
    font-size: 32px;
    font-weight: 800;
    color: white;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Статус бар */
.status-bar {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 15px 20px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-around;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.6s ease-out 0.2s both;
}

.status-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.status-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.status-value {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
}

/* Игровое поле */
.game-area {
    animation: fadeIn 0.6s ease-out 0.4s both;
}

.cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}

.card {
    aspect-ratio: 2/3;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: cardAppear 0.6s ease-out backwards;
}

.card:nth-child(1) { animation-delay: 0.5s; }
.card:nth-child(2) { animation-delay: 0.6s; }
.card:nth-child(3) { animation-delay: 0.7s; }
.card:nth-child(4) { animation-delay: 0.8s; }
.card:nth-child(5) { animation-delay: 0.9s; }

.card:hover:not(.flipped):not(.disabled) {
    transform: translateY(-10px) rotateZ(2deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

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

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

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.card-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.card-back {
    background: white;
    transform: rotateY(180deg);
}

.card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.card.win .card-back {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    animation: pulse 0.6s ease-in-out;
}

.card.lose .card-back {
    background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
    color: white;
}

/* Результат */
.result {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: scaleIn 0.5s ease-out;
}

.result-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: bounce 0.6s ease-out;
}

.result-title {
    font-size: 28px;
    font-weight: 800;
    color: #333;
    margin-bottom: 10px;
}

.result-message {
    font-size: 18px;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.promo-code {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.promo-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.promo-value {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    letter-spacing: 2px;
    margin-bottom: 15px;
    word-break: break-all;
}

/* Кнопки */
.btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-copy {
    background: #667eea;
    color: white;
}

.btn-copy:hover {
    background: #5568d3;
}

/* Загрузка */
.loader {
    text-align: center;
    padding: 40px;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Ошибка */
.error {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.error-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.error-title {
    font-size: 24px;
    font-weight: 800;
    color: #333;
    margin-bottom: 10px;
}

.error-message {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

/* Утилиты */
.hidden {
    display: none !important;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(30px) rotateZ(-5deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotateZ(0deg);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Адаптивность */
@media (max-width: 400px) {
    .cards {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }
    
    .title {
        font-size: 28px;
    }
    
    .card-front,
    .card-back {
        font-size: 24px;
    }
}

