/* 뽑기 화면 스타일 */
.gacha-screen {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    padding: 0;
}

/* 헤더 */
.gacha-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.back-btn {
    background: none;
    border: none;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color var(--transition-fast);
}

.back-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.gacha-title {
    color: var(--white);
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.gacha-cost {
    font-size: 14px;
    font-weight: 500;
}

.cost-free {
    color: #90EE90;
}

.cost-paid {
    color: #FFD700;
}

.cost-multi {
    color: #FF69B4;
}

.cost-mileage {
    color: #87CEEB;
}

/* 메인 영역 */
.gacha-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 40px 20px;
}

/* 뽑기 박스 */
.gacha-box-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gacha-box {
    width: 100%;
    height: 100%;
    position: relative;
    cursor: pointer;
    transition: transform var(--transition-normal);
    transform-style: preserve-3d;
}

.gacha-box:hover {
    transform: scale(1.05);
}

.box-front {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 50px rgba(255, 215, 0, 0.3);
    border: 3px solid rgba(255, 255, 255, 0.5);
}

.box-icon {
    font-size: 80px;
    animation: float 3s ease-in-out infinite;
}

.box-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    font-size: 20px;
    animation: sparkle 2s infinite;
}

.sparkle:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.sparkle:nth-child(2) {
    top: 20%;
    right: 15%;
    animation-delay: 0.7s;
}

.sparkle:nth-child(3) {
    bottom: 15%;
    left: 20%;
    animation-delay: 1.4s;
}

.box-shine {
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    height: 30%;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.6) 0%, 
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

/* 상품 표시 */
.prize-display {
    width: 100%;
    max-width: 300px;
    animation: zoomIn 1s ease-out;
}

.prize-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 30px 20px;
    text-align: center;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.prize-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent);
    animation: shine 2s infinite;
}

.prize-header {
    margin-bottom: 20px;
}

.prize-grade-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    color: var(--white);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.prize-icon-large {
    font-size: 100px;
    margin: 20px 0;
    animation: bounce 2s infinite;
}

.prize-info {
    margin-bottom: 20px;
}

.prize-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 8px;
}

.prize-value {
    font-size: 18px;
    color: var(--primary-gradient-end);
    font-weight: 600;
}

.prize-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.prize-sparkles .sparkle {
    position: absolute;
    animation: sparkle 1.5s infinite;
}

.prize-sparkles .sparkle:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.prize-sparkles .sparkle:nth-child(2) {
    top: 20%;
    right: 10%;
    animation-delay: 0.5s;
}

.prize-sparkles .sparkle:nth-child(3) {
    bottom: 20%;
    left: 15%;
    animation-delay: 1s;
}

/* 등급별 스타일 */
.prize-grade-1 {
    border: 3px solid #ff6b6b;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(255, 107, 107, 0.05));
}

.prize-grade-2 {
    border: 3px solid #ffd93d;
    background: linear-gradient(135deg, rgba(255, 217, 61, 0.1), rgba(255, 217, 61, 0.05));
}

.prize-grade-3 {
    border: 3px solid #6bcf7f;
    background: linear-gradient(135deg, rgba(107, 207, 127, 0.1), rgba(107, 207, 127, 0.05));
}

.prize-grade-4 {
    border: 3px solid #4ecdc4;
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.1), rgba(78, 205, 196, 0.05));
}

.prize-grade-5 {
    border: 3px solid #95a5a6;
    background: linear-gradient(135deg, rgba(149, 165, 166, 0.1), rgba(149, 165, 166, 0.05));
}

/* 상태 표시 */
.gacha-status {
    text-align: center;
    margin-bottom: 30px;
    min-height: 60px;
}

.status-text {
    color: var(--white);
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 16px;
}

.status-progress {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #90EE90, #FFD700);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

/* 컨트롤 */
.gacha-controls {
    width: 100%;
    max-width: 300px;
}

.gacha-btn {
    position: relative;
    overflow: hidden;
}

.gacha-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 정보 섹션 */
.gacha-info {
    background: var(--white);
    margin-top: auto;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    overflow: hidden;
}

.info-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
}

.info-tab {
    flex: 1;
    padding: 16px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.info-tab.active {
    color: var(--primary-gradient-end);
    border-bottom: 2px solid var(--primary-gradient-end);
    background: rgba(102, 126, 234, 0.05);
}

.info-content {
    padding: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 확률 정보 */
.rate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.rate-item:last-child {
    border-bottom: none;
}

.rate-grade {
    display: flex;
    align-items: center;
    gap: 8px;
}

.grade-icon {
    font-size: 20px;
}

.grade-name {
    font-weight: 600;
}

.rate-probability {
    font-weight: 700;
    color: var(--dark-color);
}

/* 규칙 정보 */
.rules-list {
    line-height: 1.6;
}

.rule-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.rule-icon {
    color: var(--primary-gradient-end);
    font-weight: 700;
    margin-top: 2px;
}

.rule-text {
    flex: 1;
    font-size: 14px;
    color: #666;
}

/* 애니메이션 */
@keyframes shine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* 뽑기 애니메이션 상태 */
.gacha-box.gacha-animation {
    animation: gachaBoxShake 1s ease-in-out;
}

.gacha-box.gacha-opening {
    animation: gachaBoxOpen 0.8s ease-in-out forwards;
}

.prize-display.prize-revealing {
    animation: prizeReveal 1s ease-out forwards;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .gacha-header {
        padding: 16px;
    }
    
    .gacha-title {
        font-size: 18px;
    }
    
    .gacha-main {
        padding: 30px 16px;
        min-height: 50vh;
    }
    
    .gacha-box-container {
        width: 160px;
        height: 160px;
        margin-bottom: 30px;
    }
    
    .box-icon {
        font-size: 60px;
    }
    
    .prize-card {
        padding: 20px 16px;
    }
    
    .prize-icon-large {
        font-size: 70px;
        margin: 16px 0;
    }
    
    .prize-name {
        font-size: 20px;
    }
    
    .prize-value {
        font-size: 16px;
    }
    
    .status-text {
        font-size: 14px;
    }
    
    .info-content {
        padding: 16px;
        max-height: 180px;
    }
    
    .info-tab {
        padding: 12px;
        font-size: 13px;
    }
}

@media (max-width: 375px) {
    .gacha-main {
        padding: 20px 12px;
    }
    
    .gacha-box-container {
        width: 140px;
        height: 140px;
        margin-bottom: 20px;
    }
    
    .box-icon {
        font-size: 50px;
    }
    
    .prize-icon-large {
        font-size: 60px;
    }
    
    .prize-name {
        font-size: 18px;
    }
}

/* 접근성 */
@media (prefers-reduced-motion: reduce) {
    .gacha-box,
    .box-icon,
    .sparkle,
    .prize-card,
    .prize-icon-large {
        animation: none !important;
    }
    
    .gacha-box.gacha-animation,
    .gacha-box.gacha-opening,
    .prize-display.prize-revealing {
        animation: none !important;
    }
}

/* 다크 모드 */
@media (prefers-color-scheme: dark) {
    .gacha-info {
        background: #2c3e50;
        color: var(--white);
    }
    
    .info-tab {
        color: #adb5bd;
    }
    
    .info-tab.active {
        background: rgba(102, 126, 234, 0.2);
    }
    
    .rate-item {
        border-bottom-color: #495057;
    }
    
    .rate-probability {
        color: var(--white);
    }
    
    .rule-text {
        color: #adb5bd;
    }
    
    .prize-card {
        background: #34495e;
        color: var(--white);
    }
    
    .prize-name {
        color: var(--white);
    }
}