/* 타로카드 시스템 CSS - DIORA 색상 테마 적용 */

:root {
    /* DIORA 색상 팔레트 */
    --tarot-primary: #B8860B;           /* 골드 (메인 악센트) */
    --tarot-secondary: #D4A017;         /* 밝은 골드 */
    --tarot-mystical: #A67C00;          /* 진한 골드 */
    --tarot-sacred: #8B7355;            /* 브라운 골드 */
    --tarot-gold: #B8860B;              /* 메인 골드 */
    --tarot-gold-light: #FFF8DC;        /* 연한 골드 */
    --tarot-dark: #1A1A1A;              /* 검정 텍스트 */
    --tarot-light: #F8F8F8;             /* 밝은 배경 */
    --tarot-white: #FFFFFF;             /* 흰색 */
    --tarot-gray: #666666;              /* 회색 텍스트 */
    --tarot-border: #E0E0E0;            /* 테두리 */
    --tarot-purple: #B8860B;            /* 골드로 대체 */
    --tarot-cosmic: #FFFFFF;            /* 흰색 배경 */
    --tarot-celestial: #F8F8F8;         /* 밝은 배경 */
    --tarot-divine: #B8860B;            /* 골드 */
    
    /* 황금 비율 */
    --golden-ratio: 1.618;
    --golden-small: 0.618;
    
    /* 컴팩트 카드 크기 */
    --mini-card-width: 60px;
    --mini-card-height: 90px;
    
    /* 네비게이션 */
    --nav-width: 200px;
    
    /* 전환 효과 */
    --transition: all 0.3s ease;
    --transition-fast: all 0.2s ease;
    --transition-slow: all 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--tarot-white);
    color: var(--tarot-dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* =========================
   네비게이션 시스템
========================= */

.nav-toggle {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: var(--tarot-white);
    color: var(--tarot-dark);
    border: 1px solid var(--tarot-border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    display: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.nav-toggle:hover {
    background: var(--tarot-gold);
    color: var(--tarot-white);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.3);
}

.tarot-nav {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--nav-width);
    height: 100vh;
    background: var(--tarot-white);
    border-right: 1px solid var(--tarot-border);
    overflow-y: auto;
    z-index: 1000;
    transition: var(--transition);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.nav-header {
    padding: 20px 15px;
    background: var(--tarot-light);
    color: var(--tarot-dark);
    border-bottom: 1px solid var(--tarot-border);
}

.nav-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--tarot-gold);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-controls {
    display: flex;
    gap: 8px;
}

.nav-controls button {
    background: var(--tarot-white);
    border: 1px solid var(--tarot-border);
    color: var(--tarot-gray);
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.nav-controls button:hover {
    background: var(--tarot-gold);
    color: var(--tarot-white);
    border-color: var(--tarot-gold);
}

.nav-categories {
    padding: 10px 0;
}

.nav-category {
    margin-bottom: 5px;
}

.category-header {
    width: 100%;
    padding: 10px 15px;
    background: transparent;
    border: none;
    color: var(--tarot-dark);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.category-header:hover {
    background: var(--tarot-light);
    color: var(--tarot-gold);
}

.category-header.active {
    background: var(--tarot-light);
    color: var(--tarot-gold);
}

.category-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-icon {
    font-size: 16px;
}

.category-arrow {
    font-size: 10px;
    color: var(--tarot-gray);
    transition: var(--transition);
}

.category-header.active .category-arrow {
    transform: rotate(180deg);
}

.category-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--tarot-light);
}

.category-items.active {
    max-height: 500px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 8px 15px 8px 30px;
    background: transparent;
    border: none;
    color: var(--tarot-gray);
    font-size: 12px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: var(--transition);
}

.nav-item:hover {
    background: var(--tarot-white);
    color: var(--tarot-gold);
    padding-left: 35px;
}

.nav-item.active {
    background: var(--tarot-white);
    color: var(--tarot-gold);
    font-weight: 500;
}

.nav-icon {
    margin-right: 8px;
    font-size: 14px;
}

.nav-footer {
    padding: 15px;
    border-top: 1px solid var(--tarot-border);
    background: var(--tarot-light);
}

.nav-special-btn {
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    background: var(--tarot-white);
    border: 1px solid var(--tarot-border);
    color: var(--tarot-dark);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.nav-special-btn:last-child {
    margin-bottom: 0;
}

.nav-special-btn:hover {
    background: var(--tarot-gold);
    color: var(--tarot-white);
    border-color: var(--tarot-gold);
    box-shadow: 0 2px 10px rgba(184, 134, 11, 0.3);
}

/* =========================
   메인 컨테이너
========================= */

.tarot-container {
    margin-left: var(--nav-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    background: var(--tarot-white);
}

/* 컴팩트 헤더 */
.tarot-header {
    background: var(--tarot-white);
    padding: 15px 20px;
    border-bottom: 1px solid var(--tarot-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tarot-header h1 {
    font-size: 20px;
    color: var(--tarot-gold);
    font-weight: 600;
    letter-spacing: 1px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.spread-title {
    font-size: 14px;
    color: var(--tarot-gray);
}

.draw-button {
    background: var(--tarot-gold);
    color: var(--tarot-white);
    border: none;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.draw-button:hover {
    background: var(--tarot-mystical);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.3);
}

.draw-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =========================
   메인 콘텐츠 - 분할 레이아웃
========================= */

.main-content {
    flex: 1;
    display: flex;
    height: calc(100vh - 70px);
}

/* 왼쪽 패널: 카드 시각화 (40%) */
.cards-panel {
    width: 40%;
    background: var(--tarot-light);
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--tarot-border);
    position: relative;
    overflow: hidden;
}

/* 웰컴 메시지 */
.welcome-section {
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.welcome-content {
    max-width: 350px;
}

.welcome-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
    color: var(--tarot-gold);
}

.welcome-content h2 {
    font-size: 24px;
    color: var(--tarot-dark);
    margin-bottom: 10px;
    font-weight: 600;
}

.welcome-content p {
    color: var(--tarot-gray);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.mystical-quote {
    padding: 15px;
    background: var(--tarot-white);
    border-radius: 8px;
    border-left: 3px solid var(--tarot-gold);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.mystical-quote p {
    color: var(--tarot-gray);
    font-style: italic;
    font-size: 13px;
}

/* 스프레드 컨테이너 */
.spread-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.spread-header {
    text-align: center;
    margin-bottom: 20px;
}

.spread-header h3 {
    font-size: 18px;
    color: var(--tarot-dark);
    margin-bottom: 5px;
    font-weight: 600;
}

.spread-header p {
    color: var(--tarot-gray);
    font-size: 12px;
}

.spread-stats {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 8px;
}

.spread-stats span {
    padding: 3px 10px;
    background: var(--tarot-white);
    border: 1px solid var(--tarot-border);
    border-radius: 15px;
    font-size: 11px;
    color: var(--tarot-gray);
}

/* 미니 카드 영역 */
.mini-cards-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
}

.cards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    max-width: 400px;
}

/* 타로 카드 스타일 */
.tarot-card {
    width: var(--mini-card-width);
    height: var(--mini-card-height);
    background: var(--tarot-white);
    border: 1px solid var(--tarot-border);
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    transform-style: preserve-3d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tarot-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(184, 134, 11, 0.2);
}

/* 미니카드 스타일 추가 */
.mini-card {
    width: 80px !important;
    height: 120px !important;
    background: var(--tarot-white);
    border: 1px solid var(--tarot-border);
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    transform-style: preserve-3d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 8px;
}

/* 카드 뒷면 스타일 */
.tarot-card.face-down,
.mini-card.face-down {
    background: linear-gradient(135deg, var(--tarot-primary) 0%, var(--tarot-secondary) 100%);
    border: 1px solid var(--tarot-primary);
    color: var(--tarot-white);
    overflow: hidden;
}

.mini-card.face-down::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.mini-card.face-down::after {
    content: '🔮';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.mini-card.face-down .card-position-label {
    background: rgba(255, 255, 255, 0.95);
    color: var(--tarot-dark);
    font-weight: 500;
    z-index: 3;
    position: relative;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 9px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* 카드 앞면 스타일 */
.tarot-card.face-up,
.mini-card.face-up {
    background: var(--tarot-white);
    border: 1px solid var(--tarot-gold);
}

.mini-card.revealed {
    box-shadow: 0 4px 16px rgba(184, 134, 11, 0.3);
    border: 2px solid var(--tarot-gold);
}

/* 호버 효과 */
.mini-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.mini-card.face-down:hover {
    background: linear-gradient(135deg, var(--tarot-secondary) 0%, var(--tarot-primary) 100%);
    transform: translateY(-2px) scale(1.02);
}

/* 결과보기 버튼 스타일 */
.result-button-container {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    width: 100%;
}

.result-button-wrapper {
    width: 100%;
    max-width: 400px;
}

.show-result-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--tarot-primary) 0%, var(--tarot-secondary) 100%);
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    cursor: pointer;
    color: var(--tarot-white);
    font-family: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(184, 134, 11, 0.3);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.show-result-btn:hover {
    background: linear-gradient(135deg, var(--tarot-secondary) 0%, var(--tarot-primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(184, 134, 11, 0.4);
}

.show-result-btn:active {
    transform: translateY(0px);
    box-shadow: 0 2px 8px rgba(184, 134, 11, 0.3);
}

.btn-icon {
    font-size: 20px;
    margin-bottom: 4px;
    display: block;
}

.btn-text {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
}

.btn-subtitle {
    font-size: 12px;
    opacity: 0.9;
    display: block;
    line-height: 1.3;
}

.tarot-card.flipping {
    animation: cardFlip 0.6s ease;
}

.tarot-card.selected {
    border-color: var(--tarot-gold);
    box-shadow: 0 0 15px rgba(184, 134, 11, 0.3);
}

/* 카드 내용 */
.card-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px;
    color: var(--tarot-dark);
    font-size: 10px;
    text-align: center;
}

.card-back {
    background: linear-gradient(135deg, var(--tarot-gold), var(--tarot-mystical));
    border-radius: 6px;
}

.card-image {
    width: 30px;
    height: 30px;
    margin-bottom: 3px;
}

.card-mini-name {
    font-size: 9px;
    line-height: 1;
    word-break: break-word;
    color: var(--tarot-dark);
}

/* 진행 상태 표시 */
.reading-progress {
    width: 100%;
    max-width: 250px;
    margin-top: 20px;
}

.progress-bar {
    height: 3px;
    background: var(--tarot-border);
    border-radius: 2px;
    margin-bottom: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--tarot-gold);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 12px;
    color: var(--tarot-gray);
}

/* 오른쪽 패널: 해석 영역 (60%) */
.interpretation-panel {
    flex: 1;
    background: var(--tarot-white);
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.interpretation-content {
    flex: 1;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

/* 해석 상태들 */
.interpretation-state {
    animation: fadeIn 0.5s ease;
}

.state-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--tarot-border);
}

.state-header h2 {
    font-size: 22px;
    color: var(--tarot-dark);
    margin-bottom: 5px;
    font-weight: 600;
}

.state-subtitle {
    color: var(--tarot-gray);
    font-size: 13px;
}

/* 가이드 콘텐츠 */
.guide-content {
    padding: 20px 0;
}

.guide-section {
    margin-bottom: 25px;
}

.guide-section h3 {
    font-size: 16px;
    color: var(--tarot-dark);
    margin-bottom: 15px;
    font-weight: 600;
}

.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step-item {
    display: flex;
    gap: 15px;
    padding: 12px;
    background: var(--tarot-light);
    border-radius: 8px;
    border-left: 3px solid var(--tarot-gold);
}

.step-number {
    width: 28px;
    height: 28px;
    background: var(--tarot-gold);
    color: var(--tarot-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content strong {
    display: block;
    color: var(--tarot-dark);
    margin-bottom: 3px;
    font-size: 13px;
}

.step-content p {
    color: var(--tarot-gray);
    font-size: 12px;
    line-height: 1.5;
}

/* 지혜 섹션 */
.mystical-wisdom {
    margin-top: 25px;
    padding: 20px;
    background: var(--tarot-light);
    border-radius: 8px;
}

.wisdom-quote {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 15px;
}

.quote-icon {
    font-size: 20px;
    color: var(--tarot-gold);
}

.wisdom-quote p {
    flex: 1;
    color: var(--tarot-gray);
    font-style: italic;
    line-height: 1.6;
    font-size: 13px;
}

.wisdom-note {
    padding: 10px;
    background: var(--tarot-white);
    border-radius: 6px;
    border-left: 2px solid var(--tarot-gold);
}

.wisdom-note p {
    color: var(--tarot-gray);
    font-size: 12px;
}

/* 준비 상태 콘텐츠 */
.ready-content {
    padding: 20px;
}

.spread-overview {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--tarot-light);
    border-radius: 8px;
    border: 1px solid var(--tarot-border);
}

.next-action {
    text-align: center;
}

.action-guide {
    padding: 20px;
    background: var(--tarot-light);
    border-radius: 8px;
    display: inline-block;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.guide-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
    color: var(--tarot-gold);
}

.action-guide p {
    color: var(--tarot-dark);
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 14px;
}

.action-guide small {
    color: var(--tarot-gray);
    font-size: 11px;
}

/* 카드 리딩 상태 */
.position-meaning {
    padding: 12px;
    background: var(--tarot-light);
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 3px solid var(--tarot-gold);
}

.position-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--tarot-dark);
    margin-bottom: 3px;
}

.position-description {
    color: var(--tarot-gray);
    font-size: 12px;
}

/* 카드 정보 */
.card-info {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--tarot-light);
    border-radius: 8px;
    border: 1px solid var(--tarot-border);
}

.card-identity {
    flex: 1;
}

.card-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--tarot-dark);
    margin-bottom: 5px;
}

.card-orientation {
    display: inline-block;
    padding: 3px 10px;
    background: var(--tarot-gold);
    color: var(--tarot-white);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.card-visual {
    width: 80px;
    height: 110px;
    background: var(--tarot-white);
    border: 1px solid var(--tarot-border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.card-symbol {
    font-size: 32px;
    color: var(--tarot-gold);
}

/* 해석 내용 영역 */
.interpretation-content-area {
    padding: 15px;
    background: var(--tarot-white);
    border: 1px solid var(--tarot-border);
    border-radius: 8px;
    margin-bottom: 15px;
}

.interpretation-text {
    color: var(--tarot-dark);
    line-height: 1.6;
    font-size: 13px;
}

.interpretation-text p {
    margin-bottom: 10px;
}

.interpretation-text p:last-child {
    margin-bottom: 0;
}

/* 카드 네비게이션 */
.card-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.nav-btn {
    padding: 8px 16px;
    background: var(--tarot-white);
    border: 1px solid var(--tarot-border);
    color: var(--tarot-dark);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.nav-btn:hover:not(:disabled) {
    background: var(--tarot-gold);
    color: var(--tarot-white);
    border-color: var(--tarot-gold);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.card-progress {
    color: var(--tarot-gray);
    font-size: 12px;
}

/* 최종 리딩 상태 */
.overall-reading {
    margin-bottom: 25px;
}

.reading-theme {
    padding: 15px;
    background: var(--tarot-light);
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 3px solid var(--tarot-gold);
}

.reading-theme h3 {
    font-size: 16px;
    color: var(--tarot-dark);
    margin-bottom: 5px;
    font-weight: 600;
}

.reading-theme p {
    color: var(--tarot-gray);
    font-size: 12px;
}

.key-message {
    padding: 15px;
    background: var(--tarot-white);
    border: 1px solid var(--tarot-border);
    border-radius: 8px;
    color: var(--tarot-dark);
    line-height: 1.6;
    font-size: 13px;
}

/* 카드 요약 섹션 */
.cards-summary-section {
    margin-bottom: 25px;
}

.cards-summary-section h3 {
    font-size: 16px;
    color: var(--tarot-dark);
    margin-bottom: 15px;
    font-weight: 600;
}

.summary-cards {
    display: grid;
    gap: 10px;
}

.summary-card-item {
    padding: 10px;
    background: var(--tarot-light);
    border-radius: 6px;
    border-left: 2px solid var(--tarot-gold);
}

/* 액션 버튼들 */
.final-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
    border: none;
}

.primary-btn {
    background: var(--tarot-gold);
    color: var(--tarot-white);
}

.primary-btn:hover {
    background: var(--tarot-mystical);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.3);
}

.secondary-btn {
    background: var(--tarot-white);
    border: 1px solid var(--tarot-gold);
    color: var(--tarot-gold);
}

.secondary-btn:hover {
    background: var(--tarot-gold);
    color: var(--tarot-white);
}

.outline-btn {
    background: var(--tarot-white);
    border: 1px solid var(--tarot-border);
    color: var(--tarot-gray);
}

.outline-btn:hover {
    border-color: var(--tarot-gold);
    color: var(--tarot-gold);
}

/* 모달 스타일 */
.card-modal,
.history-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-card,
.history-modal-content {
    background: var(--tarot-white);
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: 1px solid var(--tarot-border);
    color: var(--tarot-gray);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--tarot-gold);
    color: var(--tarot-white);
    border-color: var(--tarot-gold);
}

/* 히스토리 모달 */
.history-header {
    padding: 20px;
    border-bottom: 1px solid var(--tarot-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.history-header h3 {
    font-size: 18px;
    color: var(--tarot-dark);
    font-weight: 600;
}

.history-list {
    padding: 20px;
}

.empty-history {
    text-align: center;
    padding: 40px;
    color: var(--tarot-gray);
}

.empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-history p {
    font-size: 14px;
    margin-bottom: 5px;
}

.empty-history small {
    font-size: 12px;
    color: var(--tarot-gray);
}

/* 토스트 메시지 */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--tarot-white);
    border: 1px solid var(--tarot-border);
    border-radius: 8px;
    padding: 12px 20px;
    min-width: 250px;
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 3000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-content i {
    color: var(--tarot-gold);
    font-size: 16px;
}

#toastText {
    color: var(--tarot-dark);
    font-size: 13px;
}

/* 로딩 오버레이 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--tarot-border);
    border-top-color: var(--tarot-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.loading-content p {
    color: var(--tarot-gray);
    font-size: 13px;
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardFlip {
    0% {
        transform: rotateY(0);
    }
    50% {
        transform: rotateY(90deg);
    }
    100% {
        transform: rotateY(0);
    }
}

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

/* 반응형 디자인 */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }
    
    .tarot-nav {
        left: -100%;
    }
    
    .tarot-nav.open {
        left: 0;
    }
    
    .tarot-container {
        margin-left: 0;
    }
    
    .main-content {
        flex-direction: column;
        height: auto;
    }
    
    .cards-panel {
        width: 100%;
        min-height: 300px;
        border-right: none;
        border-bottom: 1px solid var(--tarot-border);
    }
    
    .interpretation-panel {
        width: 100%;
    }
}

@media (max-width: 480px) {
    :root {
        --mini-card-width: 50px;
        --mini-card-height: 75px;
    }
    
    .tarot-header h1 {
        font-size: 16px;
    }
    
    .spread-title {
        display: none;
    }
    
    .cards-grid {
        gap: 8px;
    }
}

/* BAAL 임베딩 모드 */
body.embed-mode {
    background: #faf8f4;
    min-height: auto;
}
body.embed-mode .tarot-nav,
body.embed-mode .nav-toggle,
body.embed-mode .nav-header .main-btn,
body.embed-mode .nav-header .close-btn {
    display: none !important;
}
body.embed-mode .tarot-container,
body.embed-mode .main-content,
body.embed-mode [class*="container"] {
    margin-left: 0 !important;
    padding-top: 10px !important;
    max-width: 100% !important;
}