/**
 * 랜덤 생성기 전용 스타일
 */

/* ── 결과 카드 공통 ── */
.randomgen-display {
    padding-bottom: var(--space-xl);
}
.randomgen-results {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-lg);
    justify-content: center;
    align-items: center;
    width: 100%;
    overflow: visible;
}

.randomgen-result-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 200px;
    height: 280px;
    flex-shrink: 0;
    container-type: size;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
    perspective: 1000px;
    overflow: visible;
    animation: randomgen-card-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.randomgen-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.randomgen-result-card.randomgen-tilt .randomgen-card-inner {
    transition: transform 0.12s ease-out;
}

.randomgen-result-card.revealed .randomgen-card-inner {
    transform: rotateY(180deg);
}

.randomgen-card-back,
.randomgen-card-front {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
}

.randomgen-card-back {
    background: linear-gradient(160deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border: 2px solid rgba(99, 102, 241, 0.5);
    box-shadow:
        inset 0 0 40px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(99, 102, 241, 0.2);
}

.randomgen-card-question {
    font-size: 54px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.15);
    text-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
    position: relative;
    z-index: 1;
}

/* ── CCG 카드 프론트 ── */
.randomgen-card-front {
    transform: rotateY(180deg);
    background: rgba(0, 0, 0, 0.4);
    border: none;
    box-shadow: none;
    padding: 4px;
}

.randomgen-ccg-frame {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 6px;
    overflow: visible;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(20, 20, 35, 0.98) 0%, rgba(15, 15, 28, 0.98) 100%);
    border: 2px solid;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -1px 0 rgba(0, 0, 0, 0.4),
        0 4px 20px rgba(0, 0, 0, 0.4);
}

.randomgen-ccg-blue .randomgen-ccg-frame { border-color: #3b82f6; box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), inset 0 -1px 0 rgba(0,0,0,0.4), 0 0 20px rgba(59,130,246,0.25), 0 4px 20px rgba(0,0,0,0.4); }
.randomgen-ccg-purple .randomgen-ccg-frame { border-color: #8b5cf6; box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), inset 0 -1px 0 rgba(0,0,0,0.4), 0 0 20px rgba(139,92,246,0.25), 0 4px 20px rgba(0,0,0,0.4); }
.randomgen-ccg-gold .randomgen-ccg-frame { border-color: #eab308; box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), inset 0 -1px 0 rgba(0,0,0,0.4), 0 0 24px rgba(234,179,8,0.35), 0 4px 20px rgba(0,0,0,0.4); }
.randomgen-ccg-green .randomgen-ccg-frame { border-color: #22c55e; box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), inset 0 -1px 0 rgba(0,0,0,0.4), 0 0 20px rgba(34,197,94,0.25), 0 4px 20px rgba(0,0,0,0.4); }
.randomgen-ccg-red .randomgen-ccg-frame { border-color: #ef4444; box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), inset 0 -1px 0 rgba(0,0,0,0.4), 0 0 20px rgba(239,68,68,0.25), 0 4px 20px rgba(0,0,0,0.4); }

.randomgen-ccg-hex .randomgen-ccg-frame {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), inset 0 -1px 0 rgba(0,0,0,0.2), 0 4px 20px rgba(0,0,0,0.2);
}

.randomgen-ccg-title-dark {
    color: #1a1a2e !important;
    text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}

.randomgen-ccg-hex .randomgen-ccg-type {
    color: rgba(0,0,0,0.6);
    border-top-color: rgba(0,0,0,0.15);
}

.randomgen-ccg-title-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 14px 8px;
    min-height: 0;
}

.randomgen-ccg-title {
    width: 100%;
    font-size: 2.1rem;
    font-size: clamp(0.9rem, min(2.1rem, 10vw), 2.1rem);
    font-weight: 800;
    color: #fff;
    text-align: center;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.randomgen-ccg-type {
    flex-shrink: 0;
    padding: 10px 14px 14px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.25);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.randomgen-card-front::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,0.08) 50%, transparent 65%);
    animation: randomgen-shine 0.7s ease-out 0.4s both;
    pointer-events: none;
    border-radius: inherit;
}

@keyframes randomgen-shine {
    from { transform: translateX(-100%); opacity: 0; }
    50% { opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.randomgen-result-card.revealed .randomgen-card-front {
    box-shadow: none;
}

@keyframes randomgen-card-pop {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.randomgen-result-card:hover {
    z-index: 2;
}

.randomgen-result-card.revealed {
    cursor: pointer;
}
