/* ============================================
   블랙카드 시뮬레이터 - 모던 스타일 
   ============================================ */

.blackcard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 120px);
}

.header-section {
    text-align: center;
    margin-bottom: 3rem;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(99, 102, 241, 0.1);
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* 로그인 필요 카드 */
.login-required {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.login-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.login-icon {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.login-icon svg {
    width: 3rem;
    height: 3rem;
}

.login-card h2 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #667eea;
}

.login-card p {
    font-size: 16px;
    color: #b8c5d6;
    margin-bottom: 30px;
    line-height: 1.6;
}

.login-btn {
    background: #667eea;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

/* 확률 정보 버튼 */
.probability-info-button {
    text-align: center;
    margin-bottom: 2rem;
}

.info-btn {
    background: transparent;
    color: var(--primary-color);
    border: none;
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: underline;
    transition: var(--transition-base);
    padding: 0.5rem 0;
}

.info-btn:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

.skin-probability-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.skin-probability-info strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* 모달 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--surface);
    margin: 5% auto;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-xl);
    animation: slideIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition-base);
}

.modal-close:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem 2rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 확률 정보 그리드 */

.probability-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.prob-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    background: var(--background);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition-base);
}

.prob-item:hover {
    background: var(--surface-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* 아이템 타입별 색상 구분 */
.prob-item-highlight {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 165, 0, 0.1));
    border-color: rgba(255, 215, 0, 0.3);
    border-left: 4px solid #ffd700;
}

.prob-item-material {
    background: rgba(139, 92, 246, 0.05);
    border-left: 3px solid rgba(139, 92, 246, 0.5);
}

.prob-item-card {
    background: rgba(59, 130, 246, 0.05);
    border-left: 3px solid rgba(59, 130, 246, 0.5);
}

.prob-item-bag {
    background: rgba(16, 185, 129, 0.05);
    border-left: 3px solid rgba(16, 185, 129, 0.5);
}

.prob-item-postcard {
    background: rgba(236, 72, 153, 0.05);
    border-left: 3px solid rgba(236, 72, 153, 0.5);
}

.prob-item-ticket {
    background: rgba(245, 158, 11, 0.05);
    border-left: 3px solid rgba(245, 158, 11, 0.5);
}

/* 장비 세부 정보 */
.prob-item-root {
    margin-bottom: 2rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.prob-parent {
    margin-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.equipment-details {
    margin: 0;
    padding: 1.5rem;
    background: rgba(255, 215, 0, 0.03);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-left: 1.5rem;
    border-left: 3px solid rgba(255, 215, 0, 0.5);
}

.equipment-note {
    padding: 0.875rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid rgba(59, 130, 246, 0.6);
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.equipment-note strong {
    color: var(--text-primary);
    font-weight: 600;
}

.equipment-section {
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.equipment-section:last-child {
    margin-bottom: 0;
}

.equipment-category {
    margin: 0 0 0.75rem 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.equipment-items {
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.section-title {
    margin: 1.5rem 0 0.75rem 0;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    background: #d6d7ff;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary-color);
}

.item-name {
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.item-amount {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0 0.5rem;
}

.item-rate {
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

/* 뽑기 버튼 */
.draw-section {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.draw-btn {
    padding: 1rem 2.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    min-width: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.draw-btn:not(.ten) {
    background: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

.draw-btn:not(.ten):hover:not(:disabled) {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.draw-btn.ten {
    background: var(--secondary-color);
    color: white;
    border: 1px solid var(--secondary-color);
}

.draw-btn.ten:hover:not(:disabled) {
    background: #db2777;
    border-color: #db2777;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.draw-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.draw-btn:active {
    transform: translateY(0);
}

.btn-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.btn-text {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.btn-sub {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* 결과 섹션 */
.result-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.result-section h2 {
    margin-bottom: 25px;
    text-align: center;
    font-size: 24px;
    color: #6366f1;
}

.result-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.result-item {
    width: calc(20% - 12px);
    min-width: 100px;
    max-width: 150px;
}

.result-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.result-item.equipment {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.result-item.rare {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.result-item.common {
    border-color: #74b9ff;
    background: rgba(116, 185, 255, 0.1);
}

.result-item-image {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    overflow: hidden;
}

.result-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* 명패 아이템은 전체 이미지가 보이도록 contain 사용 */
.result-item.nametag .result-item-image img {
    object-fit: contain;
    padding: 5px;
}

/* 테두리 아이템도 전체가 보이도록 */
.result-item.frame .result-item-image img {
    object-fit: contain;
    padding: 3px;
}

.result-item-name {
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 14px;
    line-height: 1.3;
    word-break: keep-all;
}

.result-item-type {
    color: #b8c5d6;
    font-size: 12px;
}

.result-item-count {
    color: #4fc3f7;
    font-weight: bold;
    margin-top: 8px;
    font-size: 14px;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.clear-btn, .draw-again-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.clear-btn {
    background: #008cff;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.clear-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.draw-again-btn {
    background: linear-gradient(45deg, #00b894, #00a085);
    color: white;
}

.draw-again-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 184, 148, 0.4);
}

/* 통계 */
.statistics {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);    
    border-radius: 15px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.statistics h2 {
    margin-bottom: 25px;
    text-align: center;
    font-size: 24px;
    color: #6366f1;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-item {
    background: #6366f1;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-label {
    display: block;
    color: #ffffff;
    font-weight: 400;
    font-size: 14px;
    margin-bottom: 10px;
}

.stat-value {
    display: block;
    color: #ffffff;
    font-size: 28px;
    font-weight: bold;
}

/* 반응형 */
@media (max-width: 768px) {
    .blackcard-container {
        margin: 20px 10px;
        padding: 15px;
    }
    
    .main-title {
        font-size: 24px;
    }
    
    .subtitle {
        font-size: 14px;
    }
    
    .draw-section {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .draw-btn {
        width: 100%;
        max-width: 300px;
        padding: 0.875rem 2rem;
        min-width: auto;
    }
    
    .btn-icon {
        width: 48px;
        height: 48px;
    }

    .btn-text {
        font-size: 1rem;
    }

    .btn-sub {
        font-size: 0.8125rem;
    }
    
    .skin-probability-info {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .probability-grid {
        grid-template-columns: 1fr;
    }
    
    .result-section {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .result-section h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .result-items {
        gap: 8px;
    }

    .result-item {
        width: calc(20% - 6.4px);
        min-width: 60px;
        max-width: 100px;
    }
    
    .result-item {
        padding: 10px 6px;
    }
    
    .result-item-image {
        width: 48px;
        height: 48px;
        margin: 0 auto 8px;
    }
    
    .result-item-name {
        font-size: 11px;
        line-height: 1.2;
    }
    
    .result-item-type {
        font-size: 10px;
    }
    
    .result-item-count {
        font-size: 12px;
        margin-top: 5px;
    }
    
    .result-actions {
        flex-direction: row;
        gap: 10px;
    }
    
    .clear-btn, .draw-again-btn {
        flex: 1;
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .statistics {
        padding: 20px 15px;
    }
    
    .statistics h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .stat-item {
        padding: 15px 10px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    /* 모달 모바일 대응 */
    .modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 1rem 1.25rem;
    }
    
    .modal-header h3 {
        font-size: 1.125rem;
    }
    
    .modal-body {
        padding: 1rem 1.25rem;
    }
    
    .equipment-details {
        margin-left: 0.75rem;
        padding: 1rem;
    }
    
    .equipment-section {
        padding: 0.75rem;
    }
    
    .equipment-category {
        font-size: 0.875rem;
    }
    
    .equipment-items {
        font-size: 0.75rem;
        line-height: 1.6;
    }
}