/* ===== 언어 선택 바 ===== */
.lang-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 1.2rem 0 0;
}

.lang-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(90, 58, 158, 0.5);
  border-radius: 20px;
  padding: 0.35rem 0.9rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-family: 'Noto Serif KR', serif;
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: 0.03em;
}

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

.lang-btn.active {
  background: rgba(212, 168, 67, 0.15);
  border-color: var(--gold);
  color: var(--gold-light);
  font-weight: 600;
}

/* ===== 기본 설정 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --gold: #d4a843;
  --gold-light: #f0c060;
  --deep-purple: #0d0820;
  --mid-purple: #1a1035;
  --card-purple: #2a1a5e;
  --card-border: #5a3a9e;
  --text-light: #e8d5ff;
  --text-dim: #9980cc;
}

body {
  background: var(--deep-purple);
  color: var(--text-light);
  font-family: 'Noto Serif KR', serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== 별 배경 ===== */
.stars {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

.star {
  position: absolute;
  background: white;
  border-radius: 50%;
  animation: twinkle var(--dur, 3s) ease-in-out infinite var(--delay, 0s);
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* ===== 컨테이너 ===== */
.container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ===== 헤더 ===== */
.header {
  text-align: center;
  padding: 3rem 0 2rem;
}

.moon-icon {
  font-size: 3rem;
  color: var(--gold);
  display: block;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 12px var(--gold));
  animation: moonGlow 3s ease-in-out infinite;
}

@keyframes moonGlow {
  0%, 100% { filter: drop-shadow(0 0 12px var(--gold)); }
  50% { filter: drop-shadow(0 0 24px var(--gold-light)); }
}

.title {
  font-family: 'Cinzel', serif;
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.3em;
  text-shadow: none;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--gold);
  letter-spacing: 0.2em;
  margin-top: 0.3rem;
}

.desc {
  margin-top: 1.2rem;
  color: var(--text-dim);
  line-height: 1.8;
  font-size: 0.95rem;
}

/* ===== 입력 섹션 ===== */
.input-section {
  margin-top: 2.5rem;
}

.input-card {
  background: linear-gradient(145deg, rgba(42, 26, 94, 0.6), rgba(13, 8, 32, 0.8));
  border: 1px solid rgba(90, 58, 158, 0.5);
  border-radius: 20px;
  padding: 2.5rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 40px rgba(90, 58, 158, 0.2), inset 0 1px 0 rgba(255,255,255,0.05);
  max-width: 480px;
  margin: 0 auto;
}

.input-group {
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.input-group input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(90, 58, 158, 0.6);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  color: var(--text-light);
  font-size: 1rem;
  font-family: 'Noto Serif KR', serif;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.input-group input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 15px rgba(212, 168, 67, 0.2);
}

.input-group input::placeholder {
  color: var(--text-dim);
  opacity: 0.6;
}

.input-group input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.8) sepia(1) saturate(3) hue-rotate(5deg);
  cursor: pointer;
}

/* ===== 버튼 ===== */
.reveal-btn {
  width: 100%;
  background: linear-gradient(135deg, #4a2080, #6a30a8, #4a2080);
  border: 1px solid var(--gold);
  border-radius: 50px;
  padding: 1rem 2rem;
  color: var(--gold-light);
  font-size: 1.1rem;
  font-family: 'Noto Serif KR', serif;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: all 0.3s;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  box-shadow: 0 0 20px rgba(106, 48, 168, 0.4);
}

.reveal-btn:hover {
  background: linear-gradient(135deg, #5a2898, #7a40b8, #5a2898);
  box-shadow: 0 0 35px rgba(212, 168, 67, 0.3), 0 0 60px rgba(106, 48, 168, 0.3);
  transform: translateY(-2px);
}

.reveal-btn:active {
  transform: translateY(0);
}

.btn-icon {
  animation: spin 4s linear infinite;
}

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

/* ===== 카드 선택 섹션 ===== */
.card-select-section {
  margin-top: 2rem;
}

.select-header {
  text-align: center;
  margin-bottom: 2rem;
}

.select-title {
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.select-hint {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.deck-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  max-width: 780px;
  margin: 0 auto;
}

/* 뒷면 카드 */
.deck-card {
  width: 70px;
  height: 110px;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  transition: transform 0.3s, box-shadow 0.3s;
  background: linear-gradient(145deg, #2a1a5e, #1a0e40);
  border: 1px solid rgba(90, 58, 158, 0.7);
  overflow: hidden;
  flex-shrink: 0;
}

.deck-card::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(212, 168, 67, 0.3);
  border-radius: 7px;
  background:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 4px,
      rgba(90, 58, 158, 0.15) 4px,
      rgba(90, 58, 158, 0.15) 5px
    );
}

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

.deck-card:hover {
  transform: translateY(-8px) scale(1.05);
  box-shadow: 0 15px 30px rgba(0,0,0,0.5), 0 0 20px rgba(212, 168, 67, 0.3);
  border-color: var(--gold);
  z-index: 2;
}

.deck-card.selected {
  transform: translateY(-12px) scale(1.08);
  box-shadow: 0 20px 40px rgba(0,0,0,0.6), 0 0 30px rgba(212, 168, 67, 0.5);
  border-color: var(--gold-light);
}

.deck-card.disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.pick-count {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--gold);
  font-size: 1rem;
  letter-spacing: 0.1em;
}

/* ===== 결과 섹션 ===== */
.result-section {
  margin-top: 2rem;
}

.result-header {
  text-align: center;
  margin-bottom: 2rem;
}

.result-name {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  color: var(--gold);
  letter-spacing: 0.1em;
}

.result-date {
  color: var(--text-dim);
  margin-top: 0.3rem;
  font-size: 0.9rem;
}

.spread-label {
  display: flex;
  justify-content: space-around;
  max-width: 700px;
  margin: 0 auto 0.8rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
}

.cards-spread {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

/* 결과 카드 */
.result-card {
  width: 190px;
  background: linear-gradient(145deg, #2a1a5e, #1a0e40);
  border: 1px solid rgba(90, 58, 158, 0.8);
  border-radius: 16px;
  overflow: hidden;
  animation: cardReveal 0.6s ease-out forwards;
  opacity: 0;
  transform: rotateY(90deg);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.result-card:nth-child(1) { animation-delay: 0.1s; }
.result-card:nth-child(2) { animation-delay: 0.4s; }
.result-card:nth-child(3) { animation-delay: 0.7s; }

@keyframes cardReveal {
  from { opacity: 0; transform: rotateY(90deg) translateY(20px); }
  to { opacity: 1; transform: rotateY(0deg) translateY(0); }
}

.card-art {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.card-art-bg {
  position: absolute;
  inset: 0;
  opacity: 0.3;
}

.card-symbol {
  font-size: 4.5rem;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 20px currentColor);
}

.card-roman {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  color: rgba(212, 168, 67, 0.7);
  letter-spacing: 0.15em;
  z-index: 1;
}

.card-info {
  padding: 1rem;
  border-top: 1px solid rgba(90, 58, 158, 0.5);
}

.card-name-ko {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold-light);
  text-align: center;
  margin-bottom: 0.2rem;
}

.card-name-en {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: 0.1em;
  margin-bottom: 0.8rem;
}

.card-reading {
  font-size: 0.8rem;
  color: var(--text-light);
  line-height: 1.7;
  text-align: center;
}

.card-reversed {
  filter: brightness(0.85);
}

.card-reversed .card-symbol {
  transform: rotate(180deg);
  display: inline-block;
}

.reversed-badge {
  font-size: 0.65rem;
  color: #e07070;
  text-align: center;
  margin-bottom: 0.4rem;
  letter-spacing: 0.05em;
}

/* 종합 리딩 */
.overall-reading {
  background: linear-gradient(145deg, rgba(42, 26, 94, 0.4), rgba(13, 8, 32, 0.6));
  border: 1px solid rgba(90, 58, 158, 0.5);
  border-radius: 16px;
  padding: 2rem;
  max-width: 700px;
  margin: 0 auto 2rem;
  animation: fadeIn 1s ease-out 1.2s both;
}

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

.overall-title {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  text-align: center;
  margin-bottom: 1rem;
  font-size: 1rem;
  letter-spacing: 0.15em;
}

.overall-text {
  color: var(--text-light);
  line-height: 2;
  font-size: 0.95rem;
  text-align: center;
}

/* ===== 리셋 버튼 ===== */
.reset-btn {
  display: block;
  margin: 0 auto;
  background: transparent;
  border: 1px solid rgba(90, 58, 158, 0.7);
  border-radius: 50px;
  padding: 0.7rem 2.5rem;
  color: var(--text-dim);
  font-size: 0.95rem;
  font-family: 'Noto Serif KR', serif;
  cursor: pointer;
  transition: all 0.3s;
}

.reset-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 15px rgba(212, 168, 67, 0.2);
}

/* ===== 유틸 ===== */
.hidden {
  display: none !important;
}

/* 카드 색상 테마 */
.theme-sun    { background: linear-gradient(145deg, #3d2010, #1a0e05); }
.theme-moon   { background: linear-gradient(145deg, #0d1a3d, #050a1a); }
.theme-star   { background: linear-gradient(145deg, #0d2030, #050d1a); }
.theme-world  { background: linear-gradient(145deg, #0a2d0a, #051005); }
.theme-fool   { background: linear-gradient(145deg, #2a1a5e, #100830); }
.theme-magician { background: linear-gradient(145deg, #3d1020, #1a0510); }
.theme-love   { background: linear-gradient(145deg, #3d1030, #1a0520); }
.theme-death  { background: linear-gradient(145deg, #151515, #0a0a0a); }
.theme-justice { background: linear-gradient(145deg, #20201a, #0d0d05); }
.theme-wheel  { background: linear-gradient(145deg, #2a1a3d, #100820); }

/* 반응형 */
@media (max-width: 600px) {
  .result-card { width: 150px; }
  .card-art { height: 180px; }
  .card-symbol { font-size: 3.5rem; }
  .deck-card { width: 55px; height: 88px; }
  .input-card { padding: 1.5rem; }
}
