/* ============================================
   기본 테마 변수 (default.css에서 통합)
   ============================================ */
:root {
  --bg-color: #FFFFFF;
  --card-bg: #F8F9FA;
  --header-bg: rgba(255,255,255,0.95);
  --text-color: #2D2D2D;
  --text-light: #6c757d;
  --primary-color: #6C5CE7;
  --primary-hover: #5A4BD1;
  --sub-color: #A29BFE;
  --border-color: #E9ECEF;
  --hover-bg: #F1F3F5;
  --shadow-color: rgba(108, 92, 231, 0.1);
  --font-family: '맑은 고딕', 'Malgun Gothic', sans-serif;
  --font-size: 14px;
}

/* ============================================
   타로 앱 - 메인 스타일시트
   v1.0.2 - iOS + Android 최적화
   ============================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  /* Android Chrome 주소창 숨김 대응 */
  height: -webkit-fill-available;
}

body {
  font-family:
    /* iOS */
    -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo',
    /* Android */
    'Roboto', 'Noto Sans KR',
    /* Windows */
    'Malgun Gothic', '맑은 고딕',
    /* 폴백 */
    'Segoe UI', sans-serif;
  font-size: var(--font-size, 14px);
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  /* Android 오버스크롤 색상 */
  overscroll-behavior-y: contain;
}

/* ---- 터치 최적화 (iOS + Android) ---- */
* {
  -webkit-tap-highlight-color: transparent;
  /* Android 터치 리플 투명화 */
  -webkit-touch-callout: none;
}

a, button, .btn {
  -webkit-tap-highlight-color: rgba(108, 92, 231, 0.15);
  /* Android 터치 피드백 */
  touch-action: manipulation;
}

/* 텍스트 선택 방지 (카드/버튼 영역) */
.deck-card,
.card-thumb,
.feature-card,
.spread-card,
.nav-btn,
.tab-btn {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* ---- Header ---- */
#app-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.logo {
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--primary-color);
  white-space: nowrap;
}

#main-nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav-btn {
  padding: 0.4rem 0.8rem;
  border: none;
  background: transparent;
  color: var(--text-color);
  cursor: pointer;
  border-radius: 8px;
  font-size: 0.85rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-btn:hover {
  background: var(--hover-bg);
}

.nav-btn.active {
  background: var(--primary-color);
  color: #fff;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* ---- Main ---- */
#app-main {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  width: 100%;
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary-color);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

.btn-secondary {
  background: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--hover-bg);
}

.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: 3rem 1rem;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--sub-color) 100%);
  border-radius: 16px;
  color: #fff;
  margin-bottom: 2rem;
}

.hero h2 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.hero p {
  opacity: 0.9;
  margin-bottom: 1.5rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-buttons .btn {
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
}

.hero-buttons .btn:hover {
  background: rgba(255,255,255,0.35);
}

/* ---- Home Features ---- */
.home-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow-color);
  border-color: var(--primary-color);
}

/* Android: active 상태 피드백 */
.feature-card:active,
.spread-card:active,
.card-thumb:active {
  transform: scale(0.97);
  opacity: 0.9;
}

.feature-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.feature-card h3 {
  margin-bottom: 0.3rem;
  color: var(--primary-color);
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ---- Daily Card ---- */
.daily-card-section {
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
}

.daily-card-desc {
  color: var(--text-light);
  margin-bottom: 1rem;
}

/* ---- Page Headers ---- */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.page-header h2 {
  color: var(--primary-color);
}

/* ---- Study ---- */
.study-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-color);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.tab-btn:hover {
  border-color: var(--primary-color);
}

.tab-btn.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

.study-search {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.study-search input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-color);
  font-size: 0.9rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

.study-progress {
  text-align: right;
}

#study-progress-text {
  font-size: 0.8rem;
  color: var(--text-light);
}

.progress-bar {
  width: 150px;
  height: 6px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 0.25rem;
}

.progress-fill {
  height: 100%;
  background: var(--primary-color);
  border-radius: 3px;
  transition: width 0.3s;
}

/* ---- Card Grid ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.card-thumb {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.card-thumb:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px var(--shadow-color);
  border-color: var(--primary-color);
}

.card-thumb.studied {
  border-color: var(--primary-color);
}

.card-thumb.studied::after {
  content: '✅';
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.7rem;
}

.card-thumb-img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 6px;
  background: var(--hover-bg);
}

.card-thumb-name {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
}

.card-thumb-name-en {
  font-size: 0.65rem;
  color: var(--text-light);
}

/* ---- Card Detail Modal ---- */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.hidden {
  display: none;
}

.modal-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
}

.modal-content {
  position: relative;
  background: var(--bg-color);
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  /* iOS/Android 스크롤 부드럽게 */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  z-index: 1;
}

.card-detail-header {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.card-detail-img {
  width: 150px;
  border-radius: 10px;
  box-shadow: 0 4px 12px var(--shadow-color);
}

.card-detail-info h3 {
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.card-detail-info .card-name-en {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.card-detail-badges {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  background: var(--hover-bg);
  color: var(--text-light);
}

.badge.major { background: rgba(108,92,231,0.15); color: var(--primary-color); }
.badge.minor { background: rgba(162,155,254,0.15); color: var(--sub-color); }

.meaning-section {
  margin-bottom: 1rem;
}

.meaning-section h4 {
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}

.keyword {
  background: var(--hover-bg);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
}

.keyword.upright { background: rgba(0,184,148,0.1); color: #00b894; }
.keyword.reversed { background: rgba(214,48,49,0.1); color: #d63031; }

.card-detail-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.card-memo {
  width: 100%;
  margin-top: 1rem;
}

.card-memo textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-color);
  font-size: 0.85rem;
  resize: vertical;
  min-height: 60px;
}

/* ---- Reading/Spread ---- */
.spread-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.spread-card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.spread-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px var(--shadow-color);
}

.spread-card.small {
  padding: 1.25rem 1rem;
}

.spread-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.5rem;
}

.spread-card h3, .spread-card h4 {
  margin-bottom: 0.3rem;
  color: var(--primary-color);
}

.spread-card p {
  font-size: 0.85rem;
  color: var(--text-light);
}

.question-form {
  max-width: 500px;
  margin: 0 auto;
}

.question-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

.question-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-color);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  resize: vertical;
}

/* ---- Card Deck (Drawing) ---- */
.draw-instruction {
  text-align: center;
  margin-bottom: 1rem;
}

.draw-instruction p {
  font-size: 1.1rem;
  color: var(--primary-color);
}

#draw-count {
  color: var(--text-light);
  font-size: 0.85rem;
}

.card-deck {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 1.5rem;
  perspective: 1000px;
}

.deck-card {
  width: 60px;
  height: 90px;
  background: linear-gradient(135deg, var(--primary-color), var(--sub-color));
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  transform-style: preserve-3d;
  /* GPU 가속 */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.deck-card::after {
  content: '✦';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255,255,255,0.5);
  font-size: 1.2rem;
}

.deck-card:hover {
  transform: translateY(-10px) rotateY(5deg);
  box-shadow: 0 10px 20px var(--shadow-color);
}

.deck-card.selected {
  opacity: 0.3;
  pointer-events: none;
  transform: scale(0.9);
}

.selected-cards-area {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  min-height: 100px;
}

.selected-card-slot {
  text-align: center;
  width: 120px;
}

.selected-card-slot .card-position-label {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.selected-card-slot img {
  width: 100px;
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow-color);
}

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

.selected-card-slot .card-name-label {
  font-size: 0.75rem;
  margin-top: 0.25rem;
  font-weight: 500;
}

.selected-card-slot .card-direction {
  font-size: 0.7rem;
  color: var(--text-light);
}

/* ---- Spirit Tarot ---- */
.spirit-intro {
  text-align: center;
  margin-bottom: 2rem;
}

.spirit-timer {
  text-align: center;
  margin-bottom: 2rem;
}

.timer-circle {
  width: 100px;
  height: 100px;
  border: 3px solid var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(108,92,231,0.3); }
  50% { box-shadow: 0 0 0 15px rgba(108,92,231,0); }
}

#timer-count {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-color);
}

.spirit-instruction {
  text-align: center;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.shuffle-animation {
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
  position: relative;
}

.shuffle-cards {
  position: relative;
  width: 200px;
  height: 100px;
}

.shuffle-card {
  position: absolute;
  width: 60px;
  height: 90px;
  background: linear-gradient(135deg, var(--primary-color), var(--sub-color));
  border-radius: 6px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* GPU 가속 */
  will-change: transform;
}

.shuffle-card::after {
  content: '✦';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255,255,255,0.5);
  font-size: 1.2rem;
}

.shuffle-card.s1 { animation: shuffle1 1.5s infinite ease-in-out; }
.shuffle-card.s2 { animation: shuffle2 1.5s infinite ease-in-out 0.1s; }
.shuffle-card.s3 { animation: shuffle3 1.5s infinite ease-in-out 0.2s; }
.shuffle-card.s4 { animation: shuffle4 1.5s infinite ease-in-out 0.3s; }
.shuffle-card.s5 { animation: shuffle5 1.5s infinite ease-in-out 0.4s; }

@keyframes shuffle1 {
  0%, 100% { transform: translate(-50%, -50%) translateX(-40px) rotate(-5deg); }
  50% { transform: translate(-50%, -50%) translateX(40px) rotate(5deg); }
}
@keyframes shuffle2 {
  0%, 100% { transform: translate(-50%, -50%) translateX(30px) rotate(3deg); }
  50% { transform: translate(-50%, -50%) translateX(-30px) rotate(-3deg); }
}
@keyframes shuffle3 {
  0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
  50% { transform: translate(-50%, -50%) translateY(-10px) rotate(2deg); }
}
@keyframes shuffle4 {
  0%, 100% { transform: translate(-50%, -50%) translateX(20px) rotate(-2deg); }
  50% { transform: translate(-50%, -50%) translateX(-45px) rotate(4deg); }
}
@keyframes shuffle5 {
  0%, 100% { transform: translate(-50%, -50%) translateX(-25px) rotate(4deg); }
  50% { transform: translate(-50%, -50%) translateX(35px) rotate(-4deg); }
}

.spirit-draw-btn {
  display: block;
  margin: 0 auto 1.5rem;
  font-size: 1.1rem;
  animation: glow 2s infinite;
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px var(--primary-color); }
  50% { box-shadow: 0 0 20px var(--primary-color), 0 0 40px var(--sub-color); }
}

.jump-card-notice {
  text-align: center;
  padding: 1rem;
  background: rgba(253,203,110,0.15);
  border: 1px solid rgba(253,203,110,0.3);
  border-radius: 8px;
  color: #e17055;
  margin-top: 1rem;
}

/* ---- Reading Result ---- */
.result-cards {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.result-card-item {
  text-align: center;
  max-width: 150px;
}

.result-card-item .position-label {
  font-size: 0.8rem;
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.result-card-item img {
  width: 120px;
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow-color);
}

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

.result-card-item .result-card-name {
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 0.3rem;
}

.result-card-item .result-card-direction {
  font-size: 0.7rem;
  color: var(--text-light);
}

.result-guide {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.result-guide h4 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---- Journal ---- */
.journal-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.journal-entry {
    background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all 0.2s;
  /* GPU 가속 */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.journal-entry:hover {
  border-color: var(--primary-color);
}

.journal-date {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.3rem;
}

.journal-spread {
  font-size: 0.75rem;
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: rgba(108,92,231,0.1);
  color: var(--primary-color);
  border-radius: 6px;
  margin-bottom: 0.3rem;
}

.journal-question {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.journal-cards {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.journal-card-badge {
  background: var(--hover-bg);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
}

.journal-memo {
  font-size: 0.85rem;
  color: var(--text-light);
  border-top: 1px solid var(--border-color);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.journal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.empty-message {
  text-align: center;
  color: var(--text-light);
  padding: 3rem 1rem;
  font-size: 0.9rem;
  line-height: 1.8;
}

/* ---- Request ---- */
.request-content {
  max-width: 600px;
  margin: 0 auto;
}

.request-info {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  margin-bottom: 2rem;
}

.request-info h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.request-features {
  list-style: none;
  text-align: left;
  display: inline-block;
  margin-top: 1rem;
}

.request-features li {
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
}

.request-form {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 0.9rem;
  /* Android: 포커스 시 아웃라인 색상 */
  outline-color: var(--primary-color);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.15);
}

.form-group textarea {
  resize: vertical;
}

.form-group select {
  cursor: pointer;
  /* Android select 스타일 통일 */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.error-text {
  color: #d63031;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* ---- Admin ---- */
.admin-login-box {
  max-width: 400px;
  margin: 3rem auto;
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 3rem 2rem;
}

.admin-login-box h2 {
  margin-bottom: 1.5rem;
  color: var(--primary-color);
}

.admin-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.ai-card-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.ai-card-option {
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.ai-card-option:hover {
  border-color: var(--primary-color);
}

.ai-card-option.selected {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

.ai-selected-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.ai-selected-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  background: rgba(108,92,231,0.1);
  color: var(--primary-color);
  border-radius: 6px;
  font-size: 0.8rem;
}

.ai-selected-tag button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--primary-color);
  font-size: 0.9rem;
  padding: 0;
}

.ai-result {
  margin-top: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
}

.ai-result h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

#ai-result-content {
  line-height: 1.8;
  white-space: pre-wrap;
}

.sync-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---- Toast ---- */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  background: #2d3436;
  color: #fff;
  font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  max-width: 350px;
}

.toast.success { border-left: 4px solid #00b894; }
.toast.error { border-left: 4px solid #d63031; }
.toast.info { border-left: 4px solid #0984e3; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(20px); }
}

/* ---- Loading ---- */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  flex-direction: column;
  gap: 1rem;
  color: #fff;
}

.loading-overlay .loading-spinner {
  width: 40px;
  height: 40px;
  border-width: 3px;
  border-color: rgba(255,255,255,0.3);
  border-top-color: #fff;
}

/* ---- Utility ---- */
.hidden {
  display: none !important;
}

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

/* ---- Footer ---- */
#app-footer {
  text-align: center;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border-color);
  margin-top: 2rem;
}

.disclaimer {
  font-size: 0.75rem;
  color: var(--text-light);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto 0.5rem;
}

.copyright {
  font-size: 0.7rem;
  color: var(--text-light);
}

/* ---- Markdown rendering for AI results ---- */
.markdown-content h2 { font-size: 1.2rem; margin: 1rem 0 0.5rem; color: var(--primary-color); }
.markdown-content h3 { font-size: 1.05rem; margin: 0.8rem 0 0.3rem; color: var(--primary-color); }
.markdown-content p { margin-bottom: 0.5rem; }
.markdown-content strong { color: var(--primary-color); }
.markdown-content ul, .markdown-content ol { margin: 0.5rem 0 0.5rem 1.5rem; }
.markdown-content li { margin-bottom: 0.25rem; }
.markdown-content hr { border: none; border-top: 1px solid var(--border-color); margin: 1rem 0; }

/* ============================================
   추가 스타일 (v1.0.1)
   ============================================ */

/* ---- 관리자 숨김 링크 ---- */
.admin-hidden-link {
  margin-top: 0.5rem;
}

.admin-hidden-link a {
  color: var(--border-color);
  text-decoration: none;
  font-size: 0.5rem;
  opacity: 0.3;
  transition: opacity 0.3s;
}

.admin-hidden-link a:hover {
  opacity: 1;
  color: var(--primary-color);
}

/* ---- 영타로 가이드 박스 ---- */
.spirit-guide-box {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem auto;
  max-width: 600px;
  text-align: left;
}

.spirit-guide-box h4 {
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.spirit-guide-box ul {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
}

.spirit-guide-box li {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.spirit-guide-box em {
  display: block;
  margin-top: 0.75rem;
  color: var(--primary-color);
  font-style: italic;
}

/* ---- AI 분석 모달 ---- */
.ai-analysis-section {
  text-align: center;
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(108,92,231,0.05), rgba(162,155,254,0.05));
  border: 1px dashed var(--primary-color);
  border-radius: 12px;
}

.ai-modal-content {
  max-width: 700px;
}

.ai-step {
  margin-top: 1rem;
}

.prompt-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-color);
  font-size: 0.85rem;
  font-family: 'SF Mono', 'Roboto Mono', 'Consolas', monospace;
  line-height: 1.6;
  resize: vertical;
  min-height: 300px;
}

.ai-prompt-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.ai-result-content {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  line-height: 1.8;
  max-height: 500px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---- 설정 페이지 ---- */
.settings-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.settings-section h4 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.settings-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.settings-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hash-result-box {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-color);
  border: 1px solid var(--primary-color);
  border-radius: 8px;
}

.hash-result-box code {
  display: block;
  padding: 0.75rem;
  background: #2d2d2d;
  color: #00b894;
  border-radius: 6px;
  font-size: 0.8rem;
  word-break: break-all;
  margin: 0.5rem 0;
}

.hash-instructions {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(253,203,110,0.1);
  border: 1px solid rgba(253,203,110,0.3);
  border-radius: 8px;
  font-size: 0.85rem;
}

.hash-instructions ol {
  margin: 0.5rem 0 0 1.5rem;
}

.hash-instructions li {
  margin-bottom: 0.3rem;
}

.hash-instructions a {
  color: var(--primary-color);
}

/* ============================================
   iOS/Android 모바일 최적화 (v1.0.2)
   ============================================ */

/* ---- Safe Area 대응 (iOS 노치 + Android 제스처바) ---- */
@supports (padding: env(safe-area-inset-top)) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  #app-header {
    padding-top: max(0.75rem, env(safe-area-inset-top));
  }
  #app-footer {
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }
  #toast-container {
    bottom: max(2rem, calc(env(safe-area-inset-bottom) + 1rem));
    right: max(1rem, env(safe-area-inset-right));
  }
  /* Android 제스처 네비게이션 하단 여백 */
  .result-actions,
  .journal-actions {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ---- 스크롤 성능 (iOS + Android) ---- */
.modal-content,
.ai-result-content,
.ai-card-selector,
.journal-list,
.card-grid {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ---- GPU 가속 (애니메이션 요소) ---- */
.deck-card,
.card-thumb,
.feature-card,
.spread-card,
.journal-entry,
.shuffle-card {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* ---- Responsive: 모바일 공통 ---- */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .logo {
    text-align: center;
  }

  #main-nav {
    justify-content: center;
  }

  .header-actions {
    justify-content: center;
  }

  .hero h2 {
    font-size: 1.3rem;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
  }

  .card-detail-header {
    flex-direction: column;
    align-items: center;
  }

  .modal-content {
    padding: 1.25rem;
    max-height: 90vh;
  }

  .spread-grid {
    grid-template-columns: 1fr;
  }

  .deck-card {
    width: 45px;
    height: 67px;
  }

  .deck-card::after {
    font-size: 0.9rem;
  }

  /* 터치 타겟 최소 44px (iOS + Android 가이드라인) */
  .nav-btn,
  .tab-btn,
  .btn {
    min-height: 44px;
    min-width: 44px;
  }

  .nav-btn {
    padding: 0.6rem 1rem;
  }

  .modal-close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .deck-card {
    min-width: 50px;
    min-height: 75px;
  }

  /* 모바일 입력 필드 줌 방지 (iOS + Android) */
  input[type="text"],
  input[type="password"],
  input[type="email"],
  textarea,
  select {
    font-size: 16px;
  }

  /* Android: 하단 네비게이션바 겹침 방지 */
  #app-footer {
    padding-bottom: max(2rem, env(safe-area-inset-bottom, 0px));
  }

  /* 토스트 위치 조정 */
  #toast-container {
    bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
    right: 0.5rem;
    left: 0.5rem;
  }

  .toast {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .nav-btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
  }

  /* 작은 화면에서 히어로 축소 */
  .hero {
    padding: 2rem 1rem;
  }

  .hero h2 {
    font-size: 1.1rem;
  }

  .feature-icon {
    font-size: 2rem;
  }
}

/* ---- 가로 모드 대응 ---- */
@media (max-width: 896px) and (orientation: landscape) {
  .hero {
    padding: 1.5rem 1rem;
  }
  .modal-content {
    max-height: 95vh;
  }
  /* 가로 모드에서 카드 그리드 조정 */
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
}

/* ---- Android Chrome 풀스크린 PWA 대응 ---- */
@media (display-mode: standalone) {
  body {
    /* PWA 모드에서 상태바 영역 대응 */
    padding-top: env(safe-area-inset-top, 0px);
  }
  #app-header {
    /* standalone 모드에서 헤더 상단 여백 */
    padding-top: max(0.5rem, env(safe-area-inset-top, 0px));
  }
}

/* ============================================
   ★★ 켈틱크로스 레이아웃 (겹침 해결 버전) ★★
   ============================================ */

.celtic-cross-layout {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 1rem 0;
}

/* --- 십자 영역 --- */
.celtic-cross-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* 중간 줄 (⑤ - 중앙 - ⑥) */
.celtic-cross-middle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* --- 중앙 겹침 (이미지만) --- */
.celtic-center-stack {
  position: relative;
  width: 80px;
  height: 120px;
  flex-shrink: 0;
}

.celtic-center-base {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.celtic-center-crossing {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(90deg);
  width: 100%;
  height: 100%;
  z-index: 2;
}

.celtic-center-base .celtic-card-img,
.celtic-center-crossing .celtic-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* --- 중앙 카드 정보 (겹침 아래 분리 표시) --- */
.celtic-center-info {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.5rem;
  width: 100%;
}

.celtic-center-info-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  min-width: 100px;
  gap: 0.15rem;
}

.celtic-center-icon {
  font-size: 1.1rem;
}

.celtic-center-label {
  font-size: 0.65rem;
  color: var(--primary-color);
  font-weight: 600;
}

.celtic-center-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-color);
  text-align: center;
}

.celtic-center-dir {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 4px;
}

.celtic-center-dir.upright {
  color: #2e7d32;
  background: #e8f5e9;
}

.celtic-center-dir.reversed {
  color: #c62828;
  background: #ffebee;
}

/* --- 일반 카드 아이템 --- */
.celtic-card-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  width: 80px;
  flex-shrink: 0;
}

.celtic-card-label {
  font-size: 0.6rem;
  color: var(--primary-color);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.celtic-card-img {
  width: 70px;
  height: 105px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

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

.celtic-card-img.celtic-crossing-img {
  transform: rotate(90deg);
}

.celtic-card-img.celtic-crossing-reversed {
  transform: rotate(270deg);
}

.celtic-card-name {
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-color);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.celtic-card-direction {
  font-size: 0.6rem;
  color: var(--text-light);
}

/* --- 기둥 영역 (⑦~⑩) --- */
.celtic-pillar-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

/* --- 모바일 대응 --- */
@media (max-width: 600px) {
  .celtic-cross-layout {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }

  .celtic-center-stack {
    width: 65px;
    height: 98px;
  }

  .celtic-card-item {
    width: 65px;
  }

  .celtic-card-img {
    width: 58px;
    height: 87px;
  }

  .celtic-card-label {
    font-size: 0.55rem;
    max-width: 65px;
  }

  .celtic-card-name {
    font-size: 0.6rem;
    max-width: 65px;
  }

  .celtic-center-info {
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
  }

  .celtic-center-info-item {
    flex-direction: row;
    min-width: auto;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
  }

  .celtic-pillar-section {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
  }
}


/* ============================================
   켈틱크로스 안내 박스 (질문 입력 화면)
   ============================================ */
.celtic-guide-box {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1rem auto 1.5rem;
  max-width: 600px;
  text-align: left;
}

.celtic-guide-box h4 {
  color: var(--primary-color);
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.celtic-guide-box > p {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.celtic-positions-guide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 0.75rem 0;
}

@media (max-width: 480px) {
  .celtic-positions-guide {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

.celtic-guide-group strong {
  display: block;
  font-size: 0.85rem;
  color: var(--primary-color);
  margin-bottom: 0.4rem;
}

.celtic-guide-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.celtic-guide-group li {
  font-size: 0.8rem;
  color: var(--text-color);
  margin-bottom: 0.25rem;
  padding-left: 0.5rem;
  line-height: 1.5;
}

.celtic-guide-tip {
  font-size: 0.8rem;
  color: var(--primary-color);
  font-style: italic;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(108, 92, 231, 0.05);
  border-radius: 6px;
}

/* ============================================
   의뢰 면책 문구
   ============================================ */
.request-disclaimer {
  font-size: 0.75rem;
  color: var(--text-light);
  text-align: center;
  margin-top: 1rem;
  line-height: 1.6;
  padding: 0.75rem;
  background: rgba(108, 92, 231, 0.03);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

/* ============================================
   무료 AI 분석 결과 스타일 (v1.5)
   ============================================ */

/* ---- AI 섹션 설명 텍스트 ---- */
.ai-section-desc {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

/* ---- 무료 횟수 표시 ---- */
.ai-free-count {
  font-weight: 600;
  margin-left: 0.25rem;
}

.ai-free-count.available {
  color: #00b894;
}

.ai-free-count.exhausted {
  color: #d63031;
}

/* ---- 무료 분석 로딩 ---- */
.ai-free-loading {
  text-align: center;
  padding: 2rem 1rem;
}

.ai-free-loading .loading-spinner {
  width: 36px;
  height: 36px;
  border-width: 3px;
  margin: 0 auto 1rem;
}

.ai-free-loading p {
  color: var(--primary-color);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

/* ---- 무료 분석 결과 (인라인) ---- */
.ai-free-result {
  background: var(--card-bg);
  border: 1px solid var(--primary-color);
  border-radius: 12px;
  overflow: hidden;
}

.ai-free-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(162, 155, 254, 0.08));
  border-bottom: 1px solid var(--border-color);
}

.ai-free-result-header h4 {
  color: var(--primary-color);
  font-size: 1rem;
  margin: 0;
}

.ai-free-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: rgba(0, 184, 148, 0.12);
  color: #00b894;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}

.ai-free-result-body {
  padding: 1.25rem;
  line-height: 1.8;
  max-height: 500px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.ai-free-result-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background: rgba(108, 92, 231, 0.02);
}

.ai-free-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

/* ---- AI 면책 문구 (인라인 결과 내) ---- */
.ai-disclaimer {
  font-size: 0.7rem;
  color: var(--text-light);
  line-height: 1.5;
  margin: 0;
}

/* ---- 무료 분석 횟수 초과 안내 ---- */
.ai-limit-notice {
  text-align: center;
  padding: 2rem 1.5rem;
}

.ai-limit-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.75rem;
}

.ai-limit-notice h4 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.ai-limit-notice p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.ai-limit-divider {
  width: 60px;
  height: 2px;
  background: var(--border-color);
  margin: 1rem auto;
}

/* ---- 의뢰 면책 문구 (v1.5 강화) ---- */
.request-disclaimer {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 1.25rem;
  line-height: 1.6;
  padding: 1rem 1.25rem;
  background: rgba(108, 92, 231, 0.03);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.request-disclaimer p {
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
}

.request-disclaimer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.request-disclaimer li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
}

.request-disclaimer li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--text-light);
}

/* ---- 의뢰 가격 정보 ---- */
.request-price-info {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(162, 155, 254, 0.05));
  border-radius: 8px;
  border: 1px solid rgba(108, 92, 231, 0.15);
}

.request-price-info p {
  font-size: 0.85rem;
  color: var(--primary-color);
  font-weight: 500;
  text-align: center;
  margin: 0;
}

/* ---- 반응형: 무료 AI 결과 ---- */
@media (max-width: 768px) {
  .ai-free-result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    padding: 0.75rem 1rem;
  }

  .ai-free-result-body {
    padding: 1rem;
    max-height: 400px;
  }

  .ai-free-result-footer {
    padding: 0.75rem 1rem;
  }

  .ai-free-actions {
    flex-direction: column;
  }

  .ai-free-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .ai-limit-notice {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 480px) {
  .ai-free-result-body {
    max-height: 350px;
    font-size: 0.85rem;
  }

  .request-price-info p {
    font-size: 0.75rem;
  }
}

/* ============================================
   의뢰 페이지 — 카드 없을 때 안내
   ============================================ */
.request-no-cards {
  text-align: center;
  padding: 1rem 0;
}

.request-how-to {
  text-align: left;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 1.2rem;
  margin: 1.5rem 0;
}

.request-how-to ol {
  padding-left: 1.2rem;
  margin: 0.8rem 0 0;
}

.request-how-to li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.request-notice {
  color: #aaa;
  font-size: 0.85rem;
  margin-top: 0.8rem;
}

.price-table {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
}

.price-label {
  font-size: 0.95rem;
}

.price-value {
  font-weight: bold;
  color: #f0c040;
}

/* ============================================
   의뢰 페이지 — 카드 미리보기
   ============================================ */
.request-card-preview {
  margin: 1rem 0 1.5rem;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 1rem;
}

.request-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.request-spread-badge {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: bold;
}

.request-preview-date {
  color: #aaa;
  font-size: 0.8rem;
}

.request-preview-cards {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.request-preview-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.request-preview-card:last-child {
  border-bottom: none;
}

.request-card-position {
  color: #aaa;
  font-size: 0.8rem;
  min-width: 90px;
}

.request-card-name {
  flex: 1;
  font-weight: 500;
}

.request-card-dir {
  font-size: 0.8rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
}

.request-card-dir.upright {
  background: rgba(100,200,100,0.2);
  color: #8f8;
}

.request-card-dir.reversed {
  background: rgba(200,100,100,0.2);
  color: #f88;
}

/* ============================================
   의뢰 결제 안내
   ============================================ */
.request-payment-info {
  background: rgba(240,192,64,0.1);
  border: 1px solid rgba(240,192,64,0.3);
  border-radius: 12px;
  padding: 1.2rem;
  margin: 1rem 0;
  text-align: center;
}

.request-price-display {
  font-size: 1.1rem;
  margin: 0.5rem 0;
}

.bank-info {
  font-size: 1rem;
  font-weight: bold;
  color: #f0c040;
  margin: 0.5rem 0;
}

.bank-notice {
  font-size: 0.8rem;
  color: #aaa;
}