/*
 * tarot-cards.css — Стили страницы выбора карт
 * Веер карт, анимации выбора, область выбранных
 */

/* ── Layout ── */
.cards-page {
    width: 100%;
    height: 100vh;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    padding: 12px;
    z-index: 10;
}

/* ── Header ── */
.cards-header {
    text-align: center;
    padding: 8px 0 10px;
    flex-shrink: 0;
}

.cards-header h1 {
    font-family: var(--font-display);
    font-size: clamp(16px, 4.5vw, 20px);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold);
}

.cards-counter {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 300;
    color: var(--text-dim);
    margin-top: 4px;
}

.cards-counter span {
    color: var(--gold);
    font-weight: 500;
}

/* ── Fans Container ── */
.fans-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.card-fan {
    position: relative;
    height: 22%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ── Individual Card ── */
.card {
    position: absolute;
    width: 50px;
    height: 80px;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease;
    transform-style: preserve-3d;
}

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

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

.card-face, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.card-back {
    background: linear-gradient(135deg, var(--bg-deep) 0%, #12121f 100%);
    border: 2px solid var(--gold);
    box-shadow: var(--shadow-card);
}

.card-back svg {
    width: 100%;
    height: 100%;
}

.card-face {
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

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

/* Hover */
.card:hover:not(.disabled):not(.selected) {
    transform: translateY(-15px) scale(1.1);
    z-index: 100;
    filter: drop-shadow(0 8px 16px rgba(var(--gold-rgb), 0.45));
}

/* Glow hint */
.card.glow:not(.disabled):not(.selected) {
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(var(--gold-rgb), 0.4)); }
    50% { filter: drop-shadow(0 0 20px rgba(var(--gold-rgb), 0.7)); }
}

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

.card.selecting {
    pointer-events: none;
    cursor: wait;
}

.card.flying {
    z-index: 1000;
    pointer-events: none;
}

/* ── Selected Cards Area ── */
.selected-area {
    flex-shrink: 0;
    height: 110px;
    background: rgba(10, 10, 20, 0.6);
    border-radius: 0;
    padding: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gold-border);
    margin-bottom: 8px;
    overflow-x: auto;
}

.selected-card {
    width: 50px;
    height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--gold);
    box-shadow: 0 4px 12px rgba(var(--gold-rgb), 0.3);
}

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

.selected-card.reversed img {
    transform: rotate(180deg);
}

.empty-slot {
    width: 50px;
    height: 80px;
    border: 2px dashed var(--gold-border);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

/* ── Submit Button ── */
.submit-button {
    flex-shrink: 0;
    width: 100%;
    padding: 16px;
    background: var(--gold);
    border: none;
    border-radius: 0;
    color: var(--bg-deep);
    font-family: var(--font-display);
    font-size: clamp(13px, 3.1vw, 14px);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-solid);
}

.submit-button:hover {
    box-shadow: var(--shadow-solid-hover);
}

.submit-button:active {
    transform: scale(0.98);
}

.submit-button.btn-hidden {
    display: none;
}

/* ── Loading ── */
.cards-loading {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 300;
}

.cards-loading::after {
    content: '';
    animation: loadDots 1.5s infinite;
}

@keyframes loadDots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .card { width: 40px; height: 64px; }
    .selected-card, .empty-slot { width: 40px; height: 64px; }
    .selected-area { height: 90px; }
}

@media (max-width: 360px) {
    .card { width: 35px; height: 56px; }
    .selected-card, .empty-slot { width: 35px; height: 56px; }
    .selected-area { height: 80px; padding: 8px; gap: 6px; }
}
