:root {
  --font-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-serif: "Gowun Batang", "Noto Serif KR", Georgia, serif;
  --bg-body: #140b1e;
  --bg-card: #1e102c;
  --primary: #ff477e;
  --primary-dark: #ff85a9;
  --primary-soft: rgba(255, 71, 126, 0.16);
  --secondary: #d4af37;
  --text-main: #f8f0fc;
  --text-sub: #d8c8e8;
  --text-muted: #a491b8;
  --border-color: rgba(212, 175, 55, 0.28);
  --ad-bg: rgba(38, 21, 56, 0.85);
  --ad-border: #d4af37;
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.45);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  background: radial-gradient(circle at 50% 0%, #2a163d 0%, #190d26 60%, #11081a 100%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 건물주 상단 컨트롤 바 */
.owner-bar {
  width: 100%;
  background: #191f28;
  color: #ffffff;
  padding: 9px 16px;
  font-size: 12.5px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.owner-bar-inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.owner-badge {
  background: linear-gradient(135deg, #ffb800, #ff7a00);
  color: #191f28;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 400;
  color: #e5e8eb;
  user-select: none;
}

.toggle-label input {
  accent-color: #ffb800;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* 메인 앱 컨테이너 (모바일 폭 고정) */
.app-wrapper {
  width: 100%;
  max-width: 480px;
  min-height: calc(100vh - 42px);
  background: linear-gradient(180deg, #1e102c 0%, #241335 50%, #190d25 100%);
  box-shadow: 0 0 48px rgba(0, 0, 0, 0.55);
  border-left: 1px solid rgba(212, 175, 55, 0.18);
  border-right: 1px solid rgba(212, 175, 55, 0.18);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* 헤더 */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(29, 16, 43, 0.94);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.logo-btn {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-family: inherit;
}

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

.logo-text {
  font-family: var(--font-serif);
  font-size: 17.5px;
  font-weight: 700;
  color: #fce8a6;
  letter-spacing: -0.2px;
}

.logo-text small {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: #ffb3c6;
  background: rgba(255, 71, 126, 0.18);
  border: 1px solid rgba(255, 71, 126, 0.38);
  padding: 2px 7px;
  border-radius: 99px;
  margin-left: 3px;
}

.live-counter {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--primary-dark);
  background: var(--primary-soft);
  padding: 4px 10px;
  border-radius: 99px;
}

/* 헤더 황실 신분증(로그인) 버튼 */
.royal-id-btn {
  background: linear-gradient(135deg, #2b1438 0%, #190c22 100%);
  border: 1.2px solid #d4af37;
  color: #fce8a6;
  font-family: var(--font-serif);
  font-size: 11.5px;
  font-weight: 400;
  padding: 5px 12px;
  border-radius: 99px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(43, 20, 56, 0.2);
  transition: all 0.15s ease;
}

.royal-id-btn:hover {
  background: #3d1c4e;
  border-color: #fff3b0;
  transform: translateY(-1px);
}

/* 오프닝 상단 1초 이름 각인 배너 */
.name-prompt-banner {
  background: linear-gradient(90deg, rgba(43, 20, 56, 0.95), rgba(74, 25, 66, 0.95));
  border: 1px solid rgba(212, 175, 55, 0.65);
  border-radius: 12px;
  padding: 9px 13px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #f8f0fc;
  font-family: var(--font-serif);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.name-prompt-banner:hover {
  border-color: #ffd43b;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

.name-prompt-action {
  background: #d4af37;
  color: #191024;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
  white-space: nowrap;
}

/* 황실 차원 신분증 모달 */
.royal-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 6, 18, 0.76);
  backdrop-filter: blur(5px);
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.royal-modal-card {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(165deg, #221230 0%, #140b1d 100%);
  border: 2px solid #d4af37;
  border-radius: 22px;
  padding: 24px 20px 20px;
  color: #f8f0fc;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(212, 175, 55, 0.1);
  text-align: center;
}

.royal-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fce8a6;
  width: 28px;
  height: 28px;
  border-radius: 99px;
  cursor: pointer;
  font-size: 13px;
}

.royal-crest {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #d4af37;
  border: 1px solid rgba(212, 175, 55, 0.5);
  padding: 3px 10px;
  border-radius: 99px;
  margin-bottom: 8px;
}

.royal-modal-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
  color: #fce8a6;
  margin-bottom: 6px;
}

.royal-modal-sub {
  font-size: 12px;
  color: #d0c4df;
  line-height: 1.5;
  margin-bottom: 16px;
  word-break: keep-all;
}

.royal-id-preview {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
}

.royal-id-avatar {
  width: 48px;
  height: 48px;
  border-radius: 99px;
  border: 1.5px solid #d4af37;
  overflow: hidden;
  flex-shrink: 0;
}

.royal-id-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.royal-id-info {
  flex: 1;
}

.royal-id-rank {
  font-size: 11px;
  color: #ffd43b;
  font-weight: 500;
  margin-bottom: 2px;
}

.royal-id-name {
  font-family: var(--font-serif);
  font-size: 15px;
  color: #ffffff;
  margin-bottom: 2px;
}

.royal-id-stats {
  font-size: 11px;
  color: #b8a8c8;
}

.royal-form-group {
  text-align: left;
  margin-bottom: 14px;
}

.royal-label {
  display: block;
  font-family: var(--font-serif);
  font-size: 12px;
  color: #fce8a6;
  margin-bottom: 6px;
}

.royal-input-row {
  display: flex;
  gap: 8px;
}

.royal-input {
  flex: 1;
  background: rgba(12, 6, 18, 0.7);
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 10px;
  padding: 10px 12px;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 13.5px;
  outline: none;
}

.royal-input:focus {
  border-color: #ffd43b;
}

.royal-save-btn {
  background: linear-gradient(135deg, #d4af37 0%, #a8790f 100%);
  color: #191024;
  border: none;
  border-radius: 10px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-sans);
}

.royal-sub-btn {
  background: rgba(212, 175, 55, 0.2);
  border: 1px solid rgba(212, 175, 55, 0.6);
  color: #fce8a6;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.royal-backup-details {
  text-align: left;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 11.5px;
  color: #d0c4df;
}

.royal-backup-details summary {
  cursor: pointer;
  color: #fce8a6;
  font-weight: 500;
}

.royal-backup-body {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.royal-backup-body p {
  font-size: 11px;
  color: #b8a8c8;
  margin-bottom: 8px;
  line-height: 1.45;
  word-break: keep-all;
}

/* 수익화 광고 슬롯 표시 스타일 */
.ad-slot {
  margin: 10px 16px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all 0.25s ease;
}

body.hide-ad-guide .ad-slot {
  display: none !important;
}

.ad-placeholder {
  background: var(--ad-bg);
  border: 1.5px dashed var(--ad-border);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  text-align: center;
}

.ad-tag {
  display: inline-block;
  background: #ffb800;
  color: #191f28;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  margin-bottom: 4px;
}

.ad-desc {
  font-size: 11.5px;
  color: #fce8a6;
  font-weight: 400;
  word-break: keep-all;
}

/* 메인 컨텐츠 */
.main-content {
  flex: 1;
  padding: 16px 20px 36px;
  display: flex;
  flex-direction: column;
}

/* 인트로 / 홈 화면 */
.hero-card {
  background: linear-gradient(155deg, #fff0f5 0%, #ffffff 55%, #f5f0ff 100%);
  border: 1.5px solid #ffd6e4;
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  text-align: center;
  box-shadow: var(--shadow-md);
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}

.hero-badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-weight: 500;
  font-size: 11.5px;
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 14px;
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0px) scale(1); }
  50% { transform: translateY(-6px) scale(1.02); }
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 700;
  line-height: 1.38;
  letter-spacing: -0.3px;
  margin-bottom: 10px;
  color: var(--text-main);
  word-break: keep-all;
}

.hero-title .highlight {
  color: var(--primary);
  background: linear-gradient(transparent 62%, #ffd6e4 62%);
}

.hero-subtitle {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-sub);
  margin-bottom: 20px;
  word-break: keep-all;
}

.thermo-preview {
  background: #fff;
  border-radius: 99px;
  padding: 8px 14px;
  margin: 0 auto 20px;
  max-width: 280px;
  border: 1px solid #ffd6e4;
  display: flex;
  align-items: center;
  gap: 10px;
}

.thermo-bar-bg {
  flex: 1;
  height: 8px;
  background: #f2f4f6;
  border-radius: 99px;
  overflow: hidden;
}

.thermo-bar-fill {
  height: 100%;
  width: 78%;
  background: linear-gradient(90deg, #4dabf7, #ff8787, #ff2b6b);
  border-radius: 99px;
  animation: pulseBar 2s infinite alternate;
}

@keyframes pulseBar {
  0% { width: 45%; }
  100% { width: 92%; }
}

.thermo-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--primary-dark);
}

.primary-btn {
  width: 100%;
  background: linear-gradient(135deg, #ff477e 0%, #e62e68 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 15.5px;
  font-weight: 500;
  letter-spacing: 0.1px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(255, 43, 107, 0.24);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(255, 43, 107, 0.32);
}

.primary-btn:active {
  transform: translateY(1px);
}

.secondary-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  color: #fce8a6;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.15s ease;
}

.secondary-btn:hover {
  background: rgba(212, 175, 55, 0.22);
  border-color: #ffd43b;
}

/* 포털 내 다른 테스트 리스트 */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 12px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: #fce8a6;
  letter-spacing: -0.2px;
}

.section-tag {
  font-size: 11.5px;
  color: #ff8fa3;
  font-weight: 500;
}

.test-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.test-item-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #241335 0%, #170c24 100%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
  width: 100%;
  font-family: inherit;
}

.test-item-card:hover {
  border-color: #ffd43b;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.test-item-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(212, 175, 55, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.test-item-info {
  flex: 1;
}

.test-item-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 500;
  color: #fce8a6;
  background: rgba(212, 175, 55, 0.18);
  border: 1px solid rgba(212, 175, 55, 0.35);
  padding: 2px 7px;
  border-radius: 6px;
  margin-bottom: 3px;
}

.test-item-title {
  font-size: 14.5px;
  font-weight: 600;
  color: #f8f0fc;
  margin-bottom: 2px;
}

.test-item-meta {
  font-size: 12px;
  font-weight: 400;
  color: #b8a6cc;
}

/* 질문 진행 화면 (Quiz View) */
.quiz-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.25s ease;
}

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

.progress-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--primary);
}

.progress-track {
  width: 100%;
  height: 7px;
  background: #f2f4f6;
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff7597, #ff2b6b);
  border-radius: 99px;
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.answers-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.answer-btn {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid #e8ecef;
  border-radius: var(--radius-md);
  padding: 16px 16px;
  font-size: 14.5px;
  font-weight: 400;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: all 0.16s ease;
  font-family: var(--font-sans);
  line-height: 1.52;
  word-break: keep-all;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.answer-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-1px);
}

.answer-btn:active {
  transform: scale(0.985);
}

.answer-chip {
  background: #f2f4f6;
  color: var(--text-sub);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 2px;
}

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

/* 로딩 및 결과 확인 게이트 */
.loading-gate {
  text-align: center;
  padding: 24px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.spinner-heart {
  font-size: 52px;
  animation: heartBeat 0.9s infinite;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

.loading-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 700;
}

.loading-sub {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text-sub);
}

/* 결과 화면 (Result View) */
.result-card {
  background: linear-gradient(180deg, #251436 0%, #170c24 100%);
  border: 1.5px solid #d4af37;
  border-radius: var(--radius-lg);
  padding: 26px 20px;
  text-align: center;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}

.result-sub-label {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.result-temp-badge {
  display: inline-block;
  background: linear-gradient(135deg, #ff477e, #ff7a00);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  padding: 5px 16px;
  border-radius: 99px;
  margin-bottom: 10px;
  box-shadow: 0 6px 16px rgba(255, 71, 126, 0.22);
}

/* 수집형 16종 타로 도감 바 & 펼쳐보기 서랍 */
.grimoire-bar {
  background: linear-gradient(90deg, #1a1024 0%, #2d183b 50%, #1a1024 100%);
  color: #fce8a6;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.6);
}

.grimoire-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.grimoire-title {
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 6px;
}

.grimoire-toggle-btn {
  background: rgba(212, 175, 55, 0.16);
  border: 1px solid rgba(212, 175, 55, 0.65);
  color: #fce8a6;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.grimoire-toggle-btn:hover {
  background: #d4af37;
  color: #191120;
}

.grimoire-drawer {
  display: none;
  padding-top: 8px;
  border-top: 1px solid rgba(212, 175, 55, 0.22);
}

.grimoire-drawer.open {
  display: block;
}

.grimoire-drawer-sub {
  font-size: 11px;
  color: rgba(252, 232, 166, 0.78);
  text-align: center;
  margin-bottom: 8px;
  font-family: var(--font-serif);
}

.grimoire-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.grimoire-item-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 8px;
  padding: 5px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #f8f0fc;
  font-family: var(--font-sans);
  transition: all 0.18s ease;
}

.grimoire-item-btn:hover {
  border-color: #ffd43b;
  background: rgba(212, 175, 55, 0.18);
  transform: translateY(-2px);
}

.grimoire-item-btn.unlocked {
  border-color: #ffd43b;
  background: rgba(212, 175, 55, 0.12);
  box-shadow: 0 0 10px rgba(255, 212, 59, 0.32);
}

.grimoire-item-btn.locked {
  border-color: rgba(255, 255, 255, 0.12);
  opacity: 0.78;
}

.grimoire-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 5px;
  overflow: hidden;
  background: #120a1a;
}

.grimoire-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: filter 0.3s ease;
}

.grimoire-item-btn.locked .grimoire-thumb img {
  filter: brightness(0.16) grayscale(0.85) blur(2.5px);
}

.grimoire-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: radial-gradient(circle, rgba(25, 12, 38, 0.35) 0%, rgba(12, 6, 18, 0.78) 100%);
}

.grimoire-lock-icon {
  font-size: 18px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.grimoire-lock-label {
  font-size: 9.5px;
  color: rgba(252, 232, 166, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.45);
  background: rgba(18, 10, 26, 0.75);
  padding: 1px 6px;
  border-radius: 99px;
}

.grimoire-item-code {
  font-size: 10px;
  font-weight: 600;
  color: #ffd43b;
}

.grimoire-item-btn.locked .grimoire-item-code {
  color: #9b8cab;
}

.grimoire-item-name {
  font-size: 10px;
  font-weight: 400;
  color: #e9d8f4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  text-align: center;
}

.grimoire-item-btn.locked .grimoire-item-name {
  color: #847596;
}

/* 황실 골드 타로카드 */
.tarot-card-wrapper {
  width: 100%;
  max-width: 280px;
  margin: 8px auto 18px;
}

.tarot-card-outer {
  position: relative;
  width: 100%;
  aspect-ratio: 320 / 420;
  border-radius: 20px;
  overflow: hidden;
  background: #1a1121;
  box-shadow: 0 14px 32px rgba(45, 25, 54, 0.28), 0 0 0 1.5px #d4af37;
  animation: floatSlow 3.4s ease-in-out infinite;
}

.tarot-art-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.tarot-art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.tarot-vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(20, 10, 28, 0.52) 0%,
    rgba(20, 10, 28, 0) 22%,
    rgba(20, 10, 28, 0) 74%,
    rgba(20, 10, 28, 0.76) 100%
  );
  pointer-events: none;
}

.tarot-frame-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* 다음 회차 빙의(회귀) 스페셜 버튼 */
.reincarnate-box {
  background: linear-gradient(135deg, #231330 0%, #3d1c47 100%);
  border: 1.5px solid #d4af37;
  border-radius: var(--radius-md);
  padding: 18px 16px;
  margin-bottom: 18px;
  text-align: center;
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(35, 19, 48, 0.18);
}

.reincarnate-tag {
  display: inline-block;
  background: linear-gradient(90deg, #fce8a6, #d4af37);
  color: #1a1121;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  margin-bottom: 8px;
}

.reincarnate-desc {
  font-family: var(--font-serif);
  font-size: 13.5px;
  font-weight: 400;
  color: #f8f0fc;
  margin-bottom: 12px;
  line-height: 1.55;
  word-break: keep-all;
}

.reincarnate-btn {
  width: 100%;
  background: linear-gradient(135deg, #d4af37 0%, #b5851b 100%);
  color: #191120;
  border: none;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.3);
  transition: transform 0.15s ease;
}

.reincarnate-btn:hover {
  transform: translateY(-2px);
}

.result-title {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 700;
  color: #fce8a6;
  margin-bottom: 8px;
  line-height: 1.38;
  word-break: keep-all;
}

.result-Summary-quote {
  font-family: var(--font-serif);
  font-size: 14.5px;
  font-weight: 400;
  color: #ff9ebb;
  margin-bottom: 20px;
  word-break: keep-all;
}

/* 스탯 게이지 바 */
.stat-box {
  background: rgba(18, 10, 26, 0.72);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  margin-bottom: 18px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}

.stat-name {
  width: 78px;
  font-weight: 500;
  color: #e9d8f4;
}

.stat-bar {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  overflow: hidden;
}

.stat-fill {
  height: 100%;
  background: linear-gradient(90deg, #d4af37, #ff477e);
  border-radius: 99px;
}

.stat-val {
  width: 36px;
  text-align: right;
  font-weight: 600;
  color: #fce8a6;
}

/* 팩폭 설명 리스트 */
.trait-box {
  text-align: left;
  background: rgba(18, 10, 26, 0.72);
  border: 1px solid rgba(212, 175, 55, 0.32);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 18px;
}

.trait-box-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #fce8a6;
  display: flex;
  align-items: center;
  gap: 6px;
}

.trait-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.trait-list li {
  font-size: 13.5px;
  font-weight: 400;
  color: #e9dcf5;
  padding-left: 18px;
  position: relative;
  line-height: 1.55;
  word-break: keep-all;
}

.trait-list li::before {
  content: "🥀";
  position: absolute;
  left: 0;
  top: 2px;
  font-size: 11px;
}

/* 궁합 박스 */
.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.match-card {
  background: rgba(18, 10, 26, 0.7);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
  border: 1px solid rgba(212, 175, 55, 0.28);
}

.match-card.good {
  background: rgba(255, 71, 126, 0.12);
  border-color: rgba(255, 117, 151, 0.45);
}

.match-card.bad {
  background: rgba(18, 10, 26, 0.72);
  border-color: rgba(255, 255, 255, 0.16);
}

.match-label {
  font-size: 11px;
  font-weight: 500;
  color: #b8a6cc;
  margin-bottom: 4px;
}

.match-card.good .match-label {
  color: #ff8fa3;
}

.match-emoji {
  font-size: 26px;
  margin: 4px 0;
}

.match-name {
  font-size: 13px;
  font-weight: 500;
  color: #f8f0fc;
  word-break: keep-all;
}

/* 쿠팡파트너스 / 제휴 수익용 행운 아이템 카드 */
.affiliate-card,
.affiliate-box {
  background: linear-gradient(135deg, #251338 0%, #180c25 100%);
  border: 1.5px solid rgba(212, 175, 55, 0.55);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  margin-bottom: 20px;
  text-align: left;
  position: relative;
}

.affiliate-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  background: linear-gradient(90deg, #fce8a6, #d4af37);
  color: #191024;
  padding: 3px 9px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.affiliate-title {
  font-size: 14.5px;
  font-weight: 600;
  color: #fce8a6;
  margin-bottom: 4px;
}

.affiliate-desc,
.affiliate-notice {
  font-size: 12.5px;
  font-weight: 400;
  color: #cbbbe0;
  margin-bottom: 12px;
  word-break: keep-all;
}

.affiliate-link {
  display: inline-block;
  background: linear-gradient(135deg, #d4af37 0%, #a8790f 100%);
  color: #191024;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 10px;
  text-decoration: none;
}

.coupang-iframe-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 10px auto 14px;
  padding: 10px;
  background: #ffffff;
  border-radius: 12px;
  border: 1.5px solid #d4af37;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.affiliate-btn {
  width: 100%;
  background: linear-gradient(135deg, #d4af37 0%, #b5851b 100%);
  color: #191024;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-sans);
}

.coupang-showcase-box {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed rgba(212, 175, 55, 0.35);
}

.coupang-showcase-title {
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 700;
  color: #fce8a6;
  text-align: center;
  margin-bottom: 10px;
}

.coupang-showcase-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}

.coupang-showcase-item {
  flex: 0 0 auto;
  background: rgba(18, 10, 26, 0.78);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.coupang-showcase-tag {
  font-size: 11px;
  font-weight: 600;
  color: #fce8a6;
  text-decoration: none;
  background: rgba(212, 175, 55, 0.18);
  border: 1px solid rgba(212, 175, 55, 0.45);
  padding: 3px 9px;
  border-radius: 99px;
  white-space: nowrap;
}

.coupang-showcase-tag:hover {
  background: #d4af37;
  color: #191024;
}

.share-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.coupang-disclaimer {
  margin-top: 8px;
  font-size: 11px;
  color: #a491b8;
  text-align: center;
  line-height: 1.4;
  word-break: keep-all;
}

/* 애드센스/애드핏 심사용 SEO 아코디언 */
.seo-guide-section {
  padding: 0 20px 16px;
}

.seo-details {
  background: rgba(18, 10, 26, 0.65);
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 12px;
  color: #cbbbe0;
}

.seo-summary {
  cursor: pointer;
  font-weight: 500;
  color: #e9d8f4;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.seo-summary::-webkit-details-marker {
  display: none;
}

.seo-summary::after {
  content: "▼";
  font-size: 10px;
  color: #d4af37;
}

.seo-details[open] .seo-summary::after {
  content: "▲";
}

.seo-body {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(212, 175, 55, 0.22);
  line-height: 1.6;
  font-size: 11.5px;
  color: #b8a6cc;
}

.seo-body h4 {
  color: #fce8a6;
  font-weight: 600;
  margin: 6px 0 4px;
  font-size: 12px;
}

.seo-body p {
  margin-bottom: 8px;
  word-break: keep-all;
}

/* 푸터 */
.app-footer {
  padding: 20px;
  text-align: center;
  border-top: 1px solid rgba(212, 175, 55, 0.25);
  font-size: 11.5px;
  font-weight: 400;
  color: #9c89b0;
  background: #140b1e;
}

.footer-sub {
  margin-top: 4px;
  font-size: 11px;
}

/* =================================================================
   비주얼 노벨(미연시 게임) 오프닝 & 대화창 UI 스타일 (섬세한 서체 적용)
   ================================================================= */
.vn-stage-card {
  position: relative;
  width: 100%;
  border-radius: 22px;
  overflow: hidden;
  background: #120a1a;
  border: 1.5px solid #d4af37;
  box-shadow: 0 16px 38px rgba(18, 10, 26, 0.3);
  margin-bottom: 20px;
}

.vn-eyelid-top,
.vn-eyelid-bottom {
  position: absolute;
  left: 0;
  width: 100%;
  height: 52%;
  background: #08040c;
  z-index: 15;
  pointer-events: none;
}

.vn-eyelid-top {
  top: 0;
  animation: eyelidOpenTop 1.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.vn-eyelid-bottom {
  bottom: 0;
  animation: eyelidOpenBottom 1.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes eyelidOpenTop {
  0% { transform: translateY(0%); }
  30% { transform: translateY(-35%); }
  50% { transform: translateY(-10%); }
  100% { transform: translateY(-105%); }
}

@keyframes eyelidOpenBottom {
  0% { transform: translateY(0%); }
  30% { transform: translateY(35%); }
  50% { transform: translateY(10%); }
  100% { transform: translateY(105%); }
}

.vn-cg-wrap {
  position: relative;
  width: 100%;
  height: 310px;
  overflow: hidden;
  background: #191024;
}

.vn-cg-wrap.quiz-mode {
  height: 245px;
}

.vn-cg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 8%;
  display: block;
  transform-origin: center;
}

.vn-cg-img.scene-fade {
  animation: sceneCrossFade 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes sceneCrossFade {
  0% {
    opacity: 0.35;
    transform: scale(1.04);
    filter: brightness(0.75);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: brightness(1);
  }
}

.vn-cg-img.awaken-blur {
  animation: awakenFocus 2s ease-out forwards;
}

@keyframes awakenFocus {
  0% { filter: blur(12px) brightness(0.4); transform: scale(1.08); }
  55% { filter: blur(4px) brightness(0.85); }
  100% { filter: blur(0px) brightness(1); transform: scale(1); }
}

.vn-cg-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(14, 8, 22, 0.6) 0%,
    rgba(14, 8, 22, 0.05) 35%,
    rgba(14, 8, 22, 0.2) 65%,
    rgba(18, 10, 26, 0.96) 100%
  );
  pointer-events: none;
}

/* 상단 게임 HUD 바 */
.vn-hud-top {
  position: absolute;
  top: 8px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  z-index: 10;
}

.vn-location-pill {
  background: rgba(18, 10, 26, 0.72);
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: #fce8a6;
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.1px;
  padding: 3px 9px;
  border-radius: 99px;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}

.vn-skip-btn {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  font-size: 11px;
  font-weight: 400;
  padding: 4px 10px;
  border-radius: 99px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  font-family: var(--font-sans);
  transition: background 0.15s ease;
}

.vn-skip-btn:hover {
  background: rgba(255, 71, 126, 0.75);
  border-color: #ff477e;
}

/* 게임 대화창 ([대화창]) 영역 — 우아한 명조(고운바탕) 서체 & 가벼운 굵기 */
.vn-dialogue-box {
  position: relative;
  background: linear-gradient(180deg, #1b1026 0%, #120a1a 100%);
  border-top: 1.5px solid rgba(212, 175, 55, 0.85);
  padding: 24px 18px 16px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.vn-speaker-badge {
  position: absolute;
  top: -14px;
  left: 18px;
  background: linear-gradient(135deg, #d6336c 0%, #a61e4d 100%);
  color: #ffffff;
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 400;
  padding: 3px 13px;
  border-radius: 6px;
  border: 1px solid rgba(255, 212, 59, 0.8);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.3px;
}

.vn-speaker-badge.narration {
  background: linear-gradient(135deg, #343a40 0%, #212529 100%);
  border-color: #adb5bd;
}

.vn-speaker-badge.male_lead {
  background: linear-gradient(135deg, #5f3dc4 0%, #364fc7 100%);
  border-color: #f3c663;
}

.vn-speaker-badge.system {
  background: linear-gradient(135deg, #d4af37 0%, #9c6f08 100%);
  color: #120a1a;
  font-family: var(--font-sans);
  font-weight: 600;
  border-color: #fff3b0;
}

.vn-dialogue-text {
  font-family: var(--font-serif);
  color: #f6f0fa;
  font-size: 15.5px;
  font-weight: 400;
  line-height: 1.72;
  letter-spacing: 0.15px;
  word-break: keep-all;
  margin-top: 4px;
  min-height: 72px;
}

.vn-dialogue-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(212, 175, 55, 0.18);
}

.vn-step-dots {
  display: flex;
  gap: 5px;
}

.vn-dot {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  transition: all 0.2s ease;
}

.vn-dot.active {
  width: 18px;
  background: #ffd43b;
}

.vn-next-prompt {
  font-size: 11.5px;
  font-weight: 400;
  color: #fce8a6;
  animation: blinkPrompt 1s infinite alternate;
}

@keyframes blinkPrompt {
  0% { opacity: 0.45; transform: translateX(0); }
  100% { opacity: 1; transform: translateX(3px); }
}

.vn-action-area {
  padding: 4px 16px 18px;
  background: #120a1a;
}

/* 비주얼 노벨 전용 다크 골드 프로그레스 바 */
.vn-progress-bar-wrap {
  background: #120a1a;
  padding: 12px 16px 10px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.28);
}

.vn-progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-serif);
  font-size: 11.5px;
  color: #fce8a6;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.vn-progress-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  overflow: hidden;
}

.vn-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #d4af37, #ff477e);
  border-radius: 99px;
  transition: width 0.35s ease;
}

/* 대사 완료 후 등장하는 로판 게임 선택지 영역 */
.vn-choice-chamber {
  background: linear-gradient(180deg, #120a1a 0%, #1a0f26 100%);
  padding: 6px 16px 20px;
  border-top: 1px solid rgba(212, 175, 55, 0.22);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.38s ease, transform 0.38s ease, max-height 0.4s ease, padding 0.3s ease;
}

.vn-choice-chamber.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  max-height: 420px;
  padding: 14px 16px 20px;
}

.vn-choice-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-serif);
  font-size: 11.5px;
  color: #d4af37;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

.vn-choice-header::before,
.vn-choice-header::after {
  content: "";
  height: 1px;
  width: 44px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.6), transparent);
}

.vn-choice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vn-choice-btn {
  width: 100%;
  background: linear-gradient(135deg, rgba(38, 21, 56, 0.96) 0%, rgba(23, 12, 34, 0.98) 100%);
  border: 1px solid rgba(212, 175, 55, 0.52);
  border-radius: 12px;
  padding: 14px 15px;
  color: #f6f0fa;
  font-family: var(--font-serif);
  font-size: 14.5px;
  font-weight: 400;
  line-height: 1.58;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  box-shadow: inset 0 0 12px rgba(212, 175, 55, 0.06), 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: all 0.2s ease;
  word-break: keep-all;
  position: relative;
}

.vn-choice-btn:hover {
  background: linear-gradient(135deg, rgba(74, 25, 66, 0.96) 0%, rgba(42, 16, 48, 0.98) 100%);
  border-color: #ffd43b;
  box-shadow: 0 0 16px rgba(255, 71, 126, 0.32), inset 0 0 10px rgba(255, 212, 59, 0.15);
  transform: translateY(-1.5px);
}

.vn-choice-btn:active {
  transform: scale(0.985);
}

.vn-choice-emblem {
  flex-shrink: 0;
  margin-top: 2px;
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid rgba(212, 175, 55, 0.65);
  color: #fce8a6;
  font-family: var(--font-serif);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.vn-choice-btn:hover .vn-choice-emblem {
  background: #d4af37;
  color: #120a1a;
  border-color: #fff3b0;
}

/* 로판 다크 벨벳 메인 액션 버튼 (오프닝 하단용) */
.vn-gold-btn {
  width: 100%;
  background: linear-gradient(135deg, #3b183f 0%, #24102c 100%);
  border: 1.2px solid #d4af37;
  color: #fce8a6;
  border-radius: 12px;
  padding: 14px 16px;
  font-family: var(--font-serif);
  font-size: 14.5px;
  font-weight: 400;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), inset 0 0 12px rgba(212, 175, 55, 0.12);
  transition: all 0.2s ease;
}

.vn-gold-btn:hover {
  background: linear-gradient(135deg, #591f56 0%, #35143d 100%);
  border-color: #fff3b0;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(255, 71, 126, 0.3);
}

/* 토스트 */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(25, 31, 40, 0.92);
  color: #fff;
  padding: 11px 18px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 400;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 200;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
