/* ============================================================
   ???????輯???? ??Premium UI Styling
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;600;700;800;900&family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* ?????? Reset & Base ?????????????????????????????????????????????????????????????????????????????????????? */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Brand palette */
  --orange-start:   #FF8C42;
  --orange-mid:     #F97316;
  --orange-end:     #EA580C;
  --amber-glow:     #FDE68A;

  --surface-white:  rgba(255,255,255,0.92);
  --surface-card:   rgba(255,255,255,0.80);
  --surface-frost:  rgba(255,255,255,0.18);

  --text-on-orange: rgba(255,255,255,1);
  --text-sub:       rgba(255,255,255,0.78);
  --text-dark:      #1C1917;
  --text-medium:    #44403C;
  --text-muted:     #78716C;

  --shadow-card:    0 8px 32px rgba(0,0,0,0.14);
  --shadow-pop:     0 20px 60px rgba(234,88,12,0.30);
  --shadow-glow:    0 0 40px rgba(255,140,66,0.45);

  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-pill: 100px;

  --transition: 0.3s cubic-bezier(0.4,0,0.2,1);

  /* Dark theme for overview/step pages */
  --dark-bg:        #0F0A06;
  --dark-surface:   #1C1410;
  --dark-card:      #261D17;
  --dark-border:    rgba(255,255,255,0.08);
  --dark-text:      #FAF7F4;
  --dark-muted:     #A8998F;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Noto Sans TC', 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: #1a0a04;
}

/* ???????Page system ???????????????????????????????????????????????????????????????????????????????????????????*/
.page {
  position: fixed;
  overflow-y: auto;
  overflow-x: hidden;
  inset: 0;
  display: flex;
  flex-direction: column;
  transition: opacity 0.3s ease;
  will-change: opacity;
  backface-visibility: hidden;
}

.page.hidden {
  opacity: 0;
  pointer-events: none;
  display: none !important;
}

/* Checkout page: override fixed positioning so the layout can scroll */
#page-checkout {
  position: relative;
  inset: auto;
  overflow-y: auto;
  min-height: 100%;
}

/* ?????? Shared: Back button ?????????????????????????????????????????????????????????????????????????? */
.back-btn {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.18);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  padding: 7px 14px 7px 10px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.3px;
}
.back-btn:hover {
  background: rgba(0,0,0,0.30);
  transform: translateX(-2px);
}
.back-btn-dark {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
  color: var(--dark-muted);
}
.back-btn-dark:hover {
  background: rgba(255,255,255,0.14);
  color: var(--dark-text);
}

/* ================================================================
   COVER PAGE
   ================================================================ */
.cover-page {
  background:
    linear-gradient(160deg,
      rgba(30, 10, 0, 0.55) 0%,
      rgba(200, 80, 0, 0.45) 50%,
      rgba(80, 20, 0, 0.60) 100%),
    url('assets/images/ncku_campus_golden.png') center/cover no-repeat;
  overflow: hidden;
  align-items: center;
  justify-content: center;
}

/* Decorative blobs */
.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}
.blob-tl {
  width: 320px;
  height: 320px;
  background: rgba(255, 200, 100, 0.45);
  top: -80px;
  left: -80px;
  animation: blobFloat 8s ease-in-out infinite;
}
.blob-tr {
  width: 240px;
  height: 240px;
  background: rgba(255, 220, 130, 0.30);
  top: -40px;
  right: -60px;
  animation: blobFloat 10s ease-in-out infinite reverse;
}
.blob-br {
  width: 300px;
  height: 300px;
  background: rgba(200, 60, 0, 0.20);
  bottom: 100px;
  right: -80px;
  animation: blobFloat 12s ease-in-out infinite;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(15px, 20px) scale(1.05); }
}

/* Central content */
.cover-center {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  padding: 60px 32px 100px;
  max-width: 540px;
  width: 100%;
}

/* House with tag badge */
.house-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.28);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.45);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.5px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

.house-emoji {
  width: clamp(110px, 24vw, 160px);
  height: clamp(110px, 24vw, 160px);
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 12px 40px rgba(0,0,0,0.35)) drop-shadow(0 4px 12px rgba(0,0,0,0.20));
  animation: houseFloat 4s ease-in-out infinite;
  transform-origin: center bottom;
}

.house-svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@keyframes houseFloat {
  0%, 100% { transform: translateY(0) rotate(-0.5deg); }
  50% { transform: translateY(-10px) rotate(0.5deg); }
}

/* Headline */
.cover-headline {
  display: flex;
  flex-direction: column;
  gap: 0px;
}
.cover-headline h1 {
  font-size: clamp(28px, 7vw, 48px);
  font-weight: 900;
  color: white;
  line-height: 1.2;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.15);
}

/* Sub description */
.cover-desc {
  font-size: clamp(13px, 3vw, 15px);
  color: rgba(255,255,255,0.82);
  line-height: 1.6;
  max-width: 300px;
  letter-spacing: 0.2px;
}

/* ?????? Float Stage: 3D floating cards + NCKU emblem ?????? */
.float-stage {
  position: relative;
  width: 100%;
  height: 230px;
  flex-shrink: 0;
}

/* Central NCKU emblem */
.ncku-emblem-circle {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 2px solid rgba(255,255,255,0.60);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 12px 40px rgba(0,0,0,0.30),
    0 0 0 12px rgba(255,255,255,0.08),
    0 0 0 26px rgba(255,255,255,0.04);
  z-index: 2;
  animation: emblemGlow 4s ease-in-out infinite;
}
@keyframes emblemGlow {
  0%, 100% { box-shadow: 0 12px 40px rgba(0,0,0,0.30), 0 0 0 12px rgba(255,255,255,0.08), 0 0 50px rgba(220,30,30,0.18); }
  50%       { box-shadow: 0 12px 40px rgba(0,0,0,0.30), 0 0 0 14px rgba(255,255,255,0.12), 0 0 70px rgba(220,30,30,0.32); }
}

.ncku-emblem-img {
  width: 92px;
  height: 92px;
  object-fit: contain;
  border-radius: 50%;
}

/* Base float card */
.float-card {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 13px 18px;
  border-radius: 14px;
  background: #ffffff;
  border: 2.5px solid #CC0000;
  box-shadow:
    0 12px 36px rgba(0,0,0,0.22),
    0 4px 10px rgba(204,0,0,0.15);
  min-width: 86px;
  cursor: default;
  z-index: 3;
}

/* Faint NCKU emblem watermark inside each card */
.float-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('assets/images/ncku_emblem.png');
  background-size: 80%;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.14;
  pointer-events: none;
  z-index: 0;
  border-radius: 12px;
}

/* Keep text above the watermark */
.fc-value, .fc-label {
  position: relative;
  z-index: 1;
}


.fc-icon  { display: none; }
.fc-value {
  font-size: 17px;
  font-weight: 800;
  color: #1a1a1a;
  font-family: 'Outfit', sans-serif;
  letter-spacing: -0.3px;
  line-height: 1;
}
.fc-label {
  font-size: 11px;
  color: #555555;
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* ???? Hover Tooltip ???? */
.fc-tooltip {
  position: absolute;
  top: 50%;
  white-space: nowrap;
  background: #ffffff;
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  padding: 11px 15px;
  border-radius: 12px;
  border: 2.5px solid #CC0000;
  box-shadow:
    0 10px 32px rgba(0,0,0,0.20),
    0 3px 8px rgba(204,0,0,0.12);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 20;
  min-width: 82px;
  text-align: center;
}
/* Triangle arrow */
.fc-tooltip::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 7px solid transparent;
}

/* Tooltip to the LEFT of card (card 1, on the left side) */
.fc-tip-left {
  right: calc(100% + 12px);
  transform: translateY(-50%) translateX(6px);
}
.fc-tip-left::after {
  left: 100%;
  border-left-color: #CC0000;
}

/* Tooltip to the RIGHT of card (cards 2 & 3, on the right side) */
.fc-tip-right {
  left: calc(100% + 12px);
  transform: translateY(-50%) translateX(-6px);
}
.fc-tip-right::after {
  right: 100%;
  border-right-color: #CC0000;
}

/* Show on hover */
.float-card:hover .fc-tip-left {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.float-card:hover .fc-tip-right {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
/* Pause float animation on hover */
.float-card:hover {
  animation-play-state: paused;
}

/* Card 1 ??left, leaning right */
.fc-1 {
  left: 2%;
  top: 50%;
  transform: translateY(-50%) perspective(500px) rotateY(22deg) rotateX(-6deg);
  animation: fcFloat1 5.2s ease-in-out infinite;
}
@keyframes fcFloat1 {
  0%, 100% { transform: translateY(-50%)   perspective(500px) rotateY(22deg) rotateX(-6deg) translateZ(0);  }
  50%       { transform: translateY(-58%)   perspective(500px) rotateY(25deg) rotateX(-9deg) translateZ(10px); }
}

/* Card 2 ??upper right, leaning left */
.fc-2 {
  right: 2%;
  top: 8%;
  transform: perspective(500px) rotateY(-20deg) rotateX(-8deg);
  animation: fcFloat2 6.4s ease-in-out infinite 1s;
}
@keyframes fcFloat2 {
  0%, 100% { transform: perspective(500px) rotateY(-20deg) rotateX(-8deg)  translateZ(0);   }
  50%       { transform: perspective(500px) rotateY(-23deg) rotateX(-11deg) translateZ(12px); }
}

/* Card 3 ??lower right, leans left */
.fc-3 {
  right: 2%;
  bottom: 4%;
  transform: perspective(500px) rotateY(-14deg) rotateX(7deg);
  animation: fcFloat3 7s ease-in-out infinite 1.8s;
}
@keyframes fcFloat3 {
  0%, 100% { transform: perspective(500px) rotateY(-14deg) rotateX(7deg)  translateZ(0);   }
  50%       { transform: perspective(500px) rotateY(-16deg) rotateX(4deg) translateZ(14px); }
}



/* ?????? CTA Bar ?????????????????????????????????????????????????????????????????????????????????????????????????? */
.cta-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 68px;
  background: rgba(30, 20, 10, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.15);
}

.cta-label {
  font-size: 15px;
  font-weight: 700;
  color: white;
  letter-spacing: 0.2px;
}

.cta-arrow-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #d9001b;
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(217, 0, 27, 0.4);
  transition: var(--transition);
  position: relative;
}

/* Pulsing ripple hint */
.cta-arrow-btn::before,
.cta-arrow-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(217, 0, 27, 0.4);
  animation: ctaPulse 2s ease-out infinite;
}
.cta-arrow-btn::after {
  animation-delay: 0.7s;
}

@keyframes ctaPulse {
  0%   { transform: scale(1);   opacity: 0.6; }
  100% { transform: scale(2.2); opacity: 0;   }
}

.cta-arrow-btn:hover {
  transform: translateX(3px) scale(1.08);
  background: #f0001e;
  box-shadow: 0 6px 24px rgba(217, 0, 27, 0.6);
}



/* ================================================================
   OVERVIEW PAGE
   ================================================================ */
.overview-page {
  background: var(--dark-bg);
  overflow: hidden;
}

.ov-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 20px 24px;
  border-bottom: 1px solid var(--dark-border);
  background: var(--dark-surface);
  flex-shrink: 0;
}

.ov-header .back-btn-dark {
  position: static;
}

.ov-title-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.ov-subtitle {
  font-size: 11px;
  font-weight: 600;
  color: var(--orange-mid);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.ov-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--dark-text);
}

/* Progress ring */
.ov-progress-ring {
  position: relative;
  width: 48px;
  height: 48px;
}
.circular-chart {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.circle-bg {
  fill: none;
  stroke: rgba(255,255,255,0.06);
  stroke-width: 3;
}
.circle {
  fill: none;
  stroke: var(--orange-mid);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 0.6s ease;
}
.progress-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--orange-mid);
  font-family: 'Outfit', sans-serif;
}

/* Steps list */
.steps-list {
  flex: 1;
  overflow-y: auto;
  padding: 20px 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.steps-list::-webkit-scrollbar { width: 4px; }
.steps-list::-webkit-scrollbar-track { background: transparent; }
.steps-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

.step-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.step-row::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: transparent;
  transition: var(--transition);
}
.step-row:hover {
  border-color: rgba(255,140,66,0.25);
  transform: translateX(3px);
}
.step-row:hover::before { background: var(--orange-mid); }

.step-row.completed {
  border-color: rgba(34,197,94,0.2);
}
.step-row.completed::before { background: #22C55E; }

.step-row.active {
  background: linear-gradient(135deg, rgba(249,115,22,0.10), rgba(255,140,66,0.05));
  border-color: rgba(249,115,22,0.35);
}
.step-row.active::before { background: var(--orange-mid); }

.step-num-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  transition: var(--transition);
}
.step-row.completed .step-num-badge {
  background: rgba(34,197,94,0.12);
  border-color: rgba(34,197,94,0.25);
}
.step-row.active .step-num-badge {
  background: rgba(249,115,22,0.18);
  border-color: rgba(249,115,22,0.35);
}

.step-row-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.step-row-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark-text);
}
.step-row-subtitle {
  font-size: 12px;
  color: var(--dark-muted);
  line-height: 1.4;
}

.step-row-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--dark-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
  color: transparent;
}
.step-row.completed .step-row-check {
  background: #22C55E;
  border-color: #22C55E;
  color: white;
}

/* Overview footer */
.ov-footer {
  padding: 16px 24px 28px;
  background: var(--dark-surface);
  border-top: 1px solid var(--dark-border);
  flex-shrink: 0;
}


/* ================================================================
   STEP DETAIL PAGE
   ================================================================ */
.step-page {
  background: var(--dark-bg);
  overflow: hidden;
}

.step-hero {
  flex-shrink: 0;
  position: relative;
  background: linear-gradient(160deg, #FFB347 0%, #F97316 60%, #EA580C 100%);
  padding: 56px 28px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}
.step-hero::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 40px;
  background: var(--dark-bg);
  clip-path: ellipse(55% 100% at 50% 100%);
}

.step-hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.step-chip {
  background: rgba(255,255,255,0.22);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.40);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.5px;
}

.step-emoji-large {
  font-size: 64px;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.20));
  animation: houseFloat 4s ease-in-out infinite;
}

.step-hero-title {
  font-size: 22px;
  font-weight: 900;
  color: white;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

/* Step body */
.step-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.step-body::-webkit-scrollbar { width: 4px; }
.step-body::-webkit-scrollbar-track { background: transparent; }
.step-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

.step-desc-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.step-desc-text {
  font-size: 14px;
  color: var(--dark-text);
  line-height: 1.7;
  font-weight: 400;
}

/* Checklist */
.step-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}
.checklist-item:hover {
  border-color: rgba(249,115,22,0.25);
}
.checklist-item.checked {
  background: rgba(34,197,94,0.06);
  border-color: rgba(34,197,94,0.20);
}
.checklist-box {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
  color: transparent;
  font-size: 13px;
}
.checklist-item.checked .checklist-box {
  background: #22C55E;
  border-color: #22C55E;
  color: white;
}
.checklist-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--dark-text);
  flex: 1;
}
.checklist-item.checked .checklist-label {
  color: var(--dark-muted);
  text-decoration: line-through;
}

/* Tip box */
.step-tip-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: rgba(255,180,50,0.08);
  border: 1px solid rgba(255,180,50,0.20);
  border-radius: var(--radius-md);
}
.tip-icon { font-size: 18px; flex-shrink: 0; }
.tip-text {
  font-size: 13px;
  color: rgba(255,220,130,0.90);
  line-height: 1.6;
  font-weight: 500;
}

/* Step footer */
.step-footer {
  display: flex;
  gap: 12px;
  padding: 16px 20px 28px;
  background: var(--dark-surface);
  border-top: 1px solid var(--dark-border);
  flex-shrink: 0;
}


/* ================================================================
   SUCCESS PAGE
   ================================================================ */
.success-page {
  background: var(--dark-bg);
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.success-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 30%, rgba(249,115,22,0.18) 0%, transparent 70%);
  pointer-events: none;
}

.success-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 32px;
}

.success-badge-ring {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(249,115,22,0.12);
  border: 2px solid rgba(249,115,22,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 16px rgba(249,115,22,0.06), 0 0 0 32px rgba(249,115,22,0.03);
  animation: successPop 0.6s cubic-bezier(0.175,0.885,0.32,1.275);
}

.success-badge-inner {
  font-size: 48px;
  animation: houseFloat 3s ease-in-out infinite;
}

@keyframes successPop {
  0% { transform: scale(0.3); opacity: 0; }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

.success-title {
  font-size: 32px;
  font-weight: 900;
  color: var(--dark-text);
  letter-spacing: -0.5px;
}

.success-desc {
  font-size: 15px;
  color: var(--dark-muted);
  line-height: 1.6;
}

.xp-reward {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,220,80,0.12);
  border: 1px solid rgba(255,220,80,0.30);
  border-radius: var(--radius-pill);
  padding: 10px 24px;
  margin-top: 8px;
}
.xp-star { font-size: 20px; }
.xp-text {
  font-size: 15px;
  font-weight: 800;
  color: #FDE68A;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.3px;
}


/* ================================================================
   SHARED BUTTON STYLES
   ================================================================ */
.btn-primary-large {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #FF8C42, #EA580C);
  color: white;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(234,88,12,0.35);
  transition: var(--transition);
  letter-spacing: 0.2px;
}
.btn-primary-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(234,88,12,0.50);
}
.btn-primary-large:active {
  transform: translateY(0);
}


.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 20px;
  border-radius: var(--radius-lg);
  background: transparent;
  border: 1px solid var(--dark-border);
  color: var(--dark-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-outline:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.15);
  color: var(--dark-text);
}

.flex-1 { flex: 1; }


/* ================================================================
   QUIZ PAGE
   ================================================================ */
.quiz-page {
  background:
    linear-gradient(rgba(8,4,2,0.68), rgba(8,4,2,0.68)),
    url('assets/images/ncku_dorm.png') center center / cover no-repeat;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: rgba(8, 4, 2, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  flex-shrink: 0;
}
.quiz-header .back-btn-dark { position: static; }
.quiz-header-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-logo-img {
  height: 52px;
  object-fit: contain;
}

/* Body ??flex row, panels animate width */
.quiz-body {
  flex: 1;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  min-height: 0;
}

/* ???? Left Panel ???? */
.quiz-left-panel {
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow: hidden;
  border-right: 1px solid var(--dark-border);
  position: relative;
  z-index: 2;
}
/* Safari fix to ensure bottom padding is respected in flex scroll containers */
.quiz-left-panel::after {
  content: "";
  display: block;
  min-height: 20px;
  flex-shrink: 0;
}
.quiz-left-panel.full-width {
  flex: 1;
  border-right-color: transparent;
}
.quiz-left-panel::-webkit-scrollbar { width: 3px; }
.quiz-left-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius:3px; }

/* ???? Step Section ???? */
.quiz-step-section {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
  margin-bottom: 12px;
}
.quiz-step-section.hidden {
  display: none;
}

/* ?? Right Panel ?? */
.quiz-right-panel {
  display: none;
  flex-direction: column;
  padding: 24px;
  overflow: hidden;
  position: relative;
  z-index: 1;
  width: 50%;
  flex-shrink: 0;
  animation: slideInRight 0.5s cubic-bezier(0.4,0,0.2,1) forwards;
}
.quiz-right-panel:not(.hidden) {
  display: flex;
}
.quiz-right-panel.hidden {
  display: none !important;
  pointer-events: none;
}

/* Step meta label */
.quiz-step-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.quiz-step-tag {
  font-size: 10px;
  font-weight: 800;
  color: var(--orange-mid);
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(249,115,22,0.12);
  border: 1px solid rgba(249,115,22,0.25);
  padding: 2px 8px;
  border-radius: 100px;
}
.quiz-step-cat {
  font-size: 10px;
  font-weight: 600;
  color: var(--dark-muted);
  letter-spacing: 0.5px;
}

.quiz-q-title {
  font-size: clamp(16px, 4.5vw, 22px);
  font-weight: 900;
  color: var(--dark-text);
  line-height: 1.25;
  margin-bottom: 4px;
  flex-shrink: 0;
}
.quiz-q-desc {
  font-size: 12px;
  color: var(--dark-muted);
  margin-bottom: 14px;
  flex-shrink: 0;
  line-height: 1.5;
}

/* ???? Step 1 option cards ???? */
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden;
}
.quiz-options::-webkit-scrollbar { width: 3px; }
.quiz-options::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius:3px; }

.quiz-option {
  border-radius: var(--radius-lg);
  padding: 12px 20px;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  border: 2px solid transparent;
  transition: var(--transition);
  flex: 0 1 auto;
  min-height: 0;
  height: auto;
}
.quiz-option:active { transform: scale(0.97); }

/* Semi-transparent white ??same base for all three */
.quiz-opt-male,
.quiz-opt-female,
.quiz-opt-all {
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255,255,255,0.35);
}

.quiz-option.selected {
  border-color: rgba(255,255,255,0.80);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.20);
}
.quiz-opt-male.selected,
.quiz-opt-female.selected,
.quiz-opt-all.selected {
  background: rgba(255,255,255,0.30);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.25), 0 8px 24px rgba(0,0,0,0.15);
}

/* Icon ??left side, pure white, large */
.quiz-opt-icon {
  font-size: 34px;
  line-height: 1;
  color: white;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
  filter: brightness(10) saturate(0);  /* force pure white */
}

/* Text group ??stacks label + sub vertically */
.quiz-opt-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.quiz-opt-label {
  font-size: 22px;
  font-weight: 800;
  color: white;
  text-align: left;
  line-height: 1.2;
}
.quiz-opt-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  text-align: left;
  line-height: 1.4;
}

/* Option layout */
.quiz-option {
  padding: 10px 16px;
  min-height: 68px;
  gap: 14px;
  flex-direction: row;
  align-items: center;
}
.quiz-opt-icon {
  font-size: 24px;
  width: 28px;
}
.quiz-opt-label {
  font-size: 15px;
}
.quiz-opt-sub {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,0.75);
}
.quiz-left-panel.full-width .quiz-option {
  padding: 14px 20px;
  min-height: 0;
  height: auto;
}
.quiz-left-panel.full-width .quiz-opt-icon {
  font-size: 30px;
  width: 36px;
}
.quiz-left-panel.full-width .quiz-opt-label {
  font-size: 18px;
}
.quiz-left-panel.full-width .quiz-opt-sub {
  font-size: 12px;
}
.quiz-q-title { font-size: 16px; margin-bottom: 8px; }
.quiz-q-desc  { display: none; }


/* ???? Map Container ???? */
.quiz-map-container {
  border-radius: 14px;
  background: #ffffff;
  border: 3.5px solid #C0C0C0; /* Silver-gray frame */
  box-shadow:
    0 12px 30px rgba(0,0,0,0.25),
    0 0 15px rgba(192,192,192,0.30); /* Silver glow */
  overflow: hidden;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.quiz-map-img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* display full map clearly without cropping */
  background: #fdfdfd;
  display: block;
}

/* ???? Step 2 preference grid ???? */
.quiz-pref-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden;
}
.quiz-pref-grid::-webkit-scrollbar { width: 3px; }
.quiz-pref-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius:3px; }

.quiz-pref-card {
  background: rgba(255,255,255,0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255,255,255,0.32);
  border-radius: var(--radius-md);
  padding: 12px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 auto;
  min-height: 0;
  height: auto;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}
.quiz-pref-card:hover {
  background: rgba(255,255,255,0.24);
  border-color: rgba(255,255,255,0.55);
}
.quiz-pref-card.selected {
  background: rgba(255,255,255,0.32);
  border-color: rgba(255,255,255,0.85);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.20), 0 8px 24px rgba(0,0,0,0.15);
}
.quiz-pref-label {
  font-size: 17px;
  font-weight: 700;
  color: var(--dark-text);
  line-height: 1.35;
}
.quiz-pref-card.selected .quiz-pref-label { color: #ffffff; }

/* ???? Quiz footer ???? */
.quiz-footer {
  position: relative;
  padding: 16px 0 0;
  margin-top: auto;

  flex-shrink: 0;
  animation: slideUp 0.35s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}
.footer-emblem {
  position: static;
  width: 110px; /* Slightly smaller to prevent clipping and balance with button */
  height: auto;
  z-index: 2;
  margin-bottom: 12px; /* Visually nudge up to align with button text */
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s ease;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
}
/* When footer shows, play the grow animation */
.quiz-footer:not(.hidden) .footer-emblem {
  animation: emblemGrow 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes emblemGrow {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Hovering the button makes the emblem glow */
.quiz-footer:has(.btn-primary-large:hover) .footer-emblem {
  filter: drop-shadow(0 0 20px rgba(255, 60, 60, 0.9)) brightness(1.1);
}
.quiz-footer .btn-primary-large {
  position: relative;
  z-index: 5;
  width: auto;
  padding-left: 40px;
  padding-right: 40px;
  margin-left: 0; 
}
#btn-quiz-next {
  background: #ffffff;
  color: #111111;
  font-size: 18px;
  font-weight: 700;
  height: 64px;
  border-radius: 12px;
  border: 2px solid #cc0000;
  box-shadow: 0 4px 12px rgba(204, 0, 0, 0.2);
  transition: all 0.3s ease;
}
#btn-quiz-next:hover {
  background: #fff5f5;
  color: #000000;
  border-color: #e60000;
  box-shadow: 0 6px 20px rgba(204, 0, 0, 0.3);
  transform: translateY(-2px);
}
.quiz-footer.hidden { display: none; }

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ================================================================
   RESPONSIVE (Mobile optimized)
   ================================================================ */
@media (max-height: 700px) {
  .cover-center { gap: 14px; padding-bottom: 80px; }
  .house-emoji { font-size: 80px; }
  .cover-headline h1 { font-size: 26px; }
  .info-card { padding: 10px 14px; min-width: 76px; }
}

@media (min-width: 600px) {
  .cover-center { max-width: 480px; }
  .info-cards { gap: 14px; }
  .info-card { min-width: 110px; }
}

/* ================================================================


   RESULTS PAGE (Trip.com style)
   ================================================================ */
.results-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: url('assets/images/S__23257107.jpg') center/cover no-repeat fixed;
  overflow: hidden;
}

.results-header {
  height: 80px;
  background: #1a1b20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  flex-shrink: 0;
  z-index: 10;
}

.results-header-left, .results-header-right {
  flex: 1;
  display: flex;
  align-items: center;
}

.results-header-right {
  justify-content: flex-end;
}

.results-header-center {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.results-logo-img {
  height: 60px;
  object-fit: contain;
}

.results-header-search {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
}

.results-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Left Sidebar */
.results-sidebar {
  width: 360px;
  min-width: 360px;
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid #e5e5e5;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.results-map-container {
  height: 400px;
  width: 100%;
  background: #e0e0e0;
  position: relative;
  flex-shrink: 0;
}

.results-filters {
  padding: 24px 20px;
}

.filter-group {
  margin-bottom: 24px;
}

.filter-group h4 {
  font-size: 14px;
  color: #333;
  margin-bottom: 12px;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 8px;
}
.filter-grid label {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #555;
  cursor: pointer;
  margin-bottom: 0;
}

.filter-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #555;
  margin-bottom: 10px;
  cursor: pointer;
}

/* Right Content ??card list */
.results-list {
  flex: 1;
  width: 100%;
  perspective: 1200px;
  transform-style: preserve-3d;
  position: relative;
  overflow: hidden !important;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

/* ?? Dorm Card base ?? */
.dorm-card {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  position: absolute;
  width: 88%;
  max-width: none;
  left: 50%;
  transform: translateX(-50%);
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.6s, background-color 0.4s, box-shadow 0.4s;
  transform-origin: center center;
  will-change: transform, opacity;
  cursor: pointer;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  border: 1px solid #eee;
  padding: 0;
  overflow: hidden;
  min-height: 130px;
}
.dorm-card.tilt-up {
  transform: translateX(-50%) translateY(-240px) rotateX(15deg) translateZ(-80px);
  opacity: 0.6;
}
.dorm-card.tilt-down {
  transform: translateX(-50%) translateY(240px) rotateX(-15deg) translateZ(-80px);
  opacity: 0.6;
}
.dorm-card.expanded {
  background: #e0e0e0;
  border-radius: 20px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.25);
  transform: translateX(-50%) scale(1.02) translateZ(40px);
  z-index: 10;
  cursor: default;
  margin: 16px 0;
  padding: 24px;
  width: 88%;
  max-width: none !important;
  display: block !important;
  overflow: visible;
  min-height: unset;
}
.dorm-card.expanded > .dorm-card-img,
.dorm-card.expanded > .dorm-card-info {
  display: none !important;
}
.dorm-expanded-view {
  display: none;
  flex-direction: column;
  animation: fadeIn 0.4s ease forwards;
}
.dorm-card.expanded .dorm-expanded-view {
  display: flex;
}

/* ?? Collapsed card: left image + right info ?? */
.dorm-card-img {
  border-radius: 0;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  align-self: stretch;
  min-height: 120px;
}
.dorm-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #c0001a;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  z-index: 1;
}
.dorm-card-info {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  padding: 16px 20px;
  gap: 12px;
  min-width: 0;
}
.dorm-card-header {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.dorm-name {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.dorm-stars {
  font-size: 14px;
}
.dorm-score {
  font-size: 12px;
  color: #555;
}
.dorm-score .score-num {
  font-weight: 700;
  color: #1a1a1a;
}
.dorm-location {
  font-size: 12px;
  color: #777;
  display: flex;
  align-items: center;
  gap: 4px;
}
.dorm-location a {
  color: #0066cc;
  text-decoration: none;
}
.dorm-location a:hover { text-decoration: underline; }
.dorm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}
.dorm-tag {
  background: #f0f0f0;
  color: #555;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
}

/* Price column ??right side of collapsed card */
.dorm-card-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  flex-shrink: 0;
  min-width: 120px;
}
.price-discount {
  background: #fff0f0;
  color: #c0001a;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  align-self: flex-end;
}
.price-old {
  font-size: 12px;
  color: #aaa;
  text-decoration: line-through;
  text-align: right;
}
.price-current {
  font-size: 20px;
  font-weight: 800;
  color: #c0001a;
  text-align: right;
  line-height: 1.1;
}
.price-tax {
  font-size: 11px;
  color: #888;
  text-align: right;
}
.btn-book {
  margin-top: 8px;
  background: #c0001a;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.btn-book:hover { background: #a0001a; }

/* Hide action-only elements on collapsed (non-expanded) cards */
.dorm-card:not(.expanded) .btn-book {
  display: none;
}
.dorm-card:not(.expanded) .price-discount {
  display: none;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}



/* ===== DETAILS PAGE ===== */
.details-page {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 41, 77, 0.45) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}
.details-page.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}
.details-container {
  background: #ffffff;
  width: 92%;
  max-width: 1150px;
  max-height: 88vh;
  margin: 0 auto;
  padding: 32px;
  border-radius: 24px;
  box-shadow: 0 30px 70px rgba(0,0,0,0.3), inset 0 1px 1px rgba(255,255,255,0.4);
  overflow-y: auto;
  position: relative;
  border: 1px solid rgba(255,255,255,0.25);
  animation: modalPop 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.details-header {
  margin-bottom: 24px;
}
.details-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}
.details-title-area h1 {
  font-size: 28px;
  color: #0f294d;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.details-title-area h1 span {
  font-size: 16px;
}
.detail-address {
  font-size: 14px;
  color: #555;
}
.detail-address a {
  color: #287dfa;
  text-decoration: none;
  margin-left: 8px;
}
.details-price-area {
  display: flex;
  align-items: center;
  gap: 20px;
}
.detail-price-text {
  text-align: right;
  display: flex;
  flex-direction: column;
}
.detail-price-text .old-price {
  font-size: 14px;
  color: #888;
  text-decoration: line-through;
}
.detail-price-text .current-price {
  font-size: 28px;
  font-weight: 700;
  color: #0f294d;
}
.detail-price-text .tax-info {
  font-size: 12px;
  color: #666;
}
.btn-primary {
  background: #287dfa;
  color: #fff;
  border: none;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}
.btn-primary:hover {
  background: #1c66d8;
}

/* Gallery Grid */
.details-gallery {
  display: flex;
  gap: 8px;
  height: 400px;
  margin-bottom: 32px;
  border-radius: 12px;
  overflow: hidden;
}
.gallery-main {
  flex: 2;
  background-size: cover;
  background-position: center;
}
.gallery-sub {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
}
.gallery-sub div {
  background-size: cover;
  background-position: center;
}

/* Content Columns */
.details-content {
  display: flex;
  gap: 32px;
}
.details-content-left {
  flex: 2;
}
.details-content-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Sections */
.detail-section {
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  margin-bottom: 24px;
}
.detail-section h3 {
  font-size: 18px;
  color: #333;
  margin-bottom: 20px;
  border-left: 4px solid #287dfa;
  padding-left: 12px;
}
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  text-align: center;
}
.highlight-item {
  font-size: 14px;
  color: #555;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.facilities-list {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  list-style: none;
  font-size: 14px;
  color: #444;
}
.facilities-list li::before {
  content: '✓';
  color: #287dfa;
  margin-right: 8px;
  font-weight: bold;
}
.detail-section p {
  font-size: 14px;
  line-height: 1.6;
  color: #555;
}

/* Right Boxes */
.detail-score-box, .detail-map-box {
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.score-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.score-badge {
  background: #287dfa;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px 8px 8px 0;
}
.score-text {
  font-size: 18px;
  font-weight: 700;
  color: #287dfa;
}
.score-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 16px;
}
.detail-score-box a, .detail-map-box a {
  font-size: 14px;
  color: #287dfa;
  text-decoration: none;
}
.detail-map-box h3 {
  font-size: 16px;
  margin-bottom: 16px;
  color: #333;
}
.mini-map {
  margin-bottom: 16px;
  border-radius: 8px;
  overflow: hidden;
}
.surroundings-list {
  list-style: none;
  font-size: 13px;
  color: #555;
  margin-bottom: 16px;
}
.surroundings-list li {
  margin-bottom: 8px;
}


/* ================================================================
   HOME PAGE ???大???主??
   ================================================================ */

#page-home {
  position: fixed;
  inset: 0;
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
  background: #1a0a04;
  font-family: 'Noto Sans TC', 'Outfit', sans-serif;
  --ui-scale: 1;
}
#page-home.hidden { display: none !important; }

/* ?? HEADER ??????????????????????????????????????????????????? */
.hm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
  zoom: var(--ui-scale);
  background: #fdf6ec; /* Cream/beige background */
  border-bottom: 1.5px solid #eadbce;
  flex-shrink: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.hm-header-left { display: flex; align-items: center; gap: 14px; }
.hm-logo-img { height: 32px; object-fit: contain; }
.hm-sys-title { font-size: 17px; font-weight: 800; color: #1a1a1a; letter-spacing: 0.5px; }
.hm-header-right { display: flex; align-items: center; gap: 12px; }

.hm-user-badge {
  display: flex; align-items: center; gap: 8px;
  background: #f4f4f5; border-radius: 30px; padding: 6px 14px 6px 8px;
  cursor: pointer; transition: background 0.2s;
}
.hm-user-badge:hover { background: #e4e4e7; }
.hm-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: #cc0000; display: flex; align-items: center; justify-content: center;
  color: white; flex-shrink: 0;
}
.hm-user-name { font-size: 13px; font-weight: 700; color: #111; }

.hm-level-badge {
  display: flex; align-items: center; gap: 8px;
  background: #fef3c7; border: 1.5px solid #f59e0b; border-radius: 30px; padding: 5px 14px;
}
.hm-lv-label {
  font-size: 11px; font-weight: 900; color: #92400e;
  background: #f59e0b; border-radius: 10px; padding: 1px 7px;
}
.hm-lv-name { font-size: 12px; font-weight: 700; color: #78350f; }
.hm-xp-bar-wrap { width: 100px; height: 6px; background: #fde68a; border-radius: 3px; overflow: hidden; }
.hm-xp-bar-fill { height: 100%; background: #f59e0b; border-radius: 3px; }
.hm-xp-text { font-size: 11px; font-weight: 700; color: #92400e; }
.hm-coin { color: #f59e0b; display: flex; align-items: center; }

.hm-bell {
  position: relative; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #f4f4f5; cursor: pointer; color: #555;
}
.hm-bell:hover { background: #e4e4e7; }
.hm-bell-dot {
  position: absolute; top: 7px; right: 7px;
  width: 8px; height: 8px; border-radius: 50%; background: #cc0000; border: 2px solid white;
}
.hm-menu-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #f4f4f5; cursor: pointer; color: #555;
}
.hm-menu-icon:hover { background: #e4e4e7; }

/* ?? BODY: fills remaining space, background image covers it ALL ?? */
.hm-body {
  flex: 1;
  display: flex;
  gap: 0;
  position: relative;
  overflow: hidden;
  min-height: 0;
  zoom: var(--ui-scale);
}



/* background div ??stretches to cover entire hm-body */
.hm-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  z-index: 0;
}
/* warm amber overlay on top of background */
.hm-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(30, 8, 0, 0.52) 0%,
    rgba(120, 45, 0, 0.32) 45%,
    rgba(40, 12, 0, 0.50) 100%
  );
}

/* ?? LEFT sidebar ???????????????????????????????????????????? */
.hm-left {
  width: 380px; flex-shrink: 0;
  padding: 30px 24px;
  z-index: 2;
  display: flex; flex-direction: column;
  pointer-events: none;
  zoom: 1.05;
}
.hm-char-card {
  background: #fdf6ec;
  border: 1.5px solid #d2bca8; 
  border-radius: 16px;
  padding: 24px 28px;
  display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hm-char-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
  border-color: #c4a482;
}
.hm-char-top { display: flex; align-items: center; gap: 20px; }
.hm-char-badge { width: 90px; height: 90px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15)); }
.hm-char-info { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.hm-char-header { display: flex; align-items: center; gap: 12px; }
.hm-char-role { font-size: 20px; font-weight: 800; color: #6e1414; white-space: nowrap; }
.hm-char-lv {
  font-size: 12px; font-weight: 800; color: #f4ece4;
  background: #6e1414; border-radius: 12px; padding: 2px 12px;
}
.hm-exp-label { font-size: 14px; font-weight: 800; color: #4a2323; margin-top: 4px; }
.hm-exp-bar { height: 8px; background: #d2bca8; border-radius: 4px; overflow: hidden; }
.hm-exp-fill { height: 100%; background: #6e1414; border-radius: 4px; }
.hm-char-divider { height: 1.5px; background: rgba(210, 188, 168, 0.5); width: 100%; margin: 4px 0; }
.hm-char-stats { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0 4px; }
.hm-stat { display: flex; align-items: center; gap: 10px; }
.hm-stat-sep { width: 1.5px; height: 30px; background: rgba(210, 188, 168, 0.5); }
.hm-stat-icon-gold {
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fbbf24, #d97706);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-size: 10px;
  border: 1.5px solid #92400e; box-shadow: inset 0 1px 2px rgba(255,255,255,0.4), 0 2px 4px rgba(0,0,0,0.1);
}
.hm-stat-icon-red {
  width: 26px; height: 32px; background: #6e1414;
  border-radius: 4px 4px 14px 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.2), 0 2px 4px rgba(0,0,0,0.1);
}
.hm-stat-icon-flag { display: flex; align-items: center; justify-content: center; margin-right: -4px; }
.hm-stat-val { font-size: 14px; font-weight: 600; color: #4a2323; display: flex; align-items: baseline; gap: 4px; }
.hm-stat-val strong { font-size: 16px; font-weight: 800; color: #111; }
.hm-stat-val-col { display: flex; flex-direction: column; line-height: 1.2; font-size: 12px; font-weight: 600; color: #4a2323; }
.hm-stat-val-col strong { font-size: 15px; font-weight: 800; color: #111; }

/* ?? CENTER content ?????????????????????????????????????????? */
.hm-center {
  flex: 1; z-index: 2; display: flex; flex-direction: column;
  align-items: center; padding: clamp(50px, 10vh, 100px) 20px 0; position: relative; min-width: 0;
  pointer-events: none;
  container-type: inline-size;
}
.hm-center-divider { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; pointer-events: auto; }
.hm-deco-line {
  width: 50px; height: 1px;
  background: #d97706;
}
.hm-deco-text {
  font-size: 14px; font-weight: 700;
  color: #111; letter-spacing: 2px; white-space: nowrap;
}
.hm-title-sparkle { color: #f59e0b; font-size: 24px; vertical-align: middle; margin: 0 10px; }
.hm-hero-title {
  position: relative;
  display: inline-block;
  font-family: "Noto Serif TC", "PMingLiU", serif;
  font-size: clamp(22px, 7.5cqw, 72px);
  font-weight: 900; 
  color: #1a0f0f;
  text-align: center;
  text-shadow: 0 4px 15px rgba(255,255,255,0.8);
  line-height: 1.2; 
  margin-bottom: 8px; 
  letter-spacing: 4px;
  pointer-events: auto;
  white-space: nowrap;
}
.hm-hero-title::before,
.hm-hero-title::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 66px;
  height: 133px;
  background: url('assets/images/laurel.svg?v=2') center/contain no-repeat;
  transform: translateY(-50%);
  pointer-events: none;
}
.hm-hero-title::before {
  left: -93px;
  transform: translateY(-50%) scaleX(-1);
}
.hm-hero-title::after {
  right: -93px;
}
.hm-red { 
  color: #8b0000; 
  font-size: 1.25em;
  display: inline-block;
  cursor: pointer;
}
.hm-red:hover {
  animation: textJump 0.5s ease;
}
.hm-hero-sub {
  font-family: "Noto Serif TC", "PMingLiU", serif;
  font-size: clamp(16px, 2.5vw, 26px); 
  color: #333; 
  font-weight: 700; 
  margin-bottom: 24px;
  text-shadow: 0 2px 8px rgba(255,255,255,0.9);
  letter-spacing: 2px;
}

.hm-start-btn {
  background: #6e1414;
  border: 2px solid #d97706; border-radius: 6px; padding: 6px;
  cursor: pointer; box-shadow: 0 8px 24px rgba(110,20,20,0.4);
  transition: all 0.25s ease; margin-bottom: 16px;
}
.hm-start-btn-inner {
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(217,119,6,0.5); padding: 8px 20px;
}
.hm-wreath-left, .hm-wreath-right { height: 32px; object-fit: contain; }
.hm-wreath-right { transform: scaleX(-1); }
.hm-start-text {
  color: white; font-size: 18px; font-weight: 900;
  margin: 0 16px; letter-spacing: 2px; text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.hm-start-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(110,20,20,0.6); }

/* ?? QUEST MAP ??????????????????????????????????????????????? */
.hm-quest-map {
  position: absolute; width: 100%; left: 0; bottom: 0; top: 0;
  pointer-events: none; z-index: 100;
  transform: translateY(-40px) scale(0.99);
  transform-origin: center bottom;
}
.hm-path-svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }

.hm-node {
  position: absolute; display: flex; flex-direction: column;
  align-items: center; transform: translateX(-50%) scale(1.05); z-index: 5;
  pointer-events: auto;
  margin-top: -95px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), z-index 0s;
}
.hm-node:hover {
  transform: translateX(-50%) translateY(-5px) scale(1.15);
  z-index: 20;
}
.hm-node-pedestal {
  position: relative; width: 115px; height: 115px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 6px; filter: drop-shadow(0 12px 18px rgba(0,0,0,0.5));
}
.hm-pedestal-img {
  width: 125%; height: auto; position: absolute; bottom: -34px;
  z-index: 1; transition: transform 0.2s; pointer-events: none;
}
.hm-node:hover .hm-node-pedestal { transform: scale(1.05) translateY(-2px); }

.hm-node-icon-disk {
  position: relative; z-index: 2; width: 100px; height: 100px;
  background: transparent;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transform: translateY(-10px);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 6px 10px rgba(0,0,0,0.5);
}
.hm-node-icon-disk::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, #ffe599 0%, #d4af37 50%, #b8860b 100%); border-radius: 50%;
  box-shadow: inset 0 -4px 8px rgba(139,69,19,0.5), inset 0 4px 8px rgba(255,255,255,0.7);
  z-index: -2; transition: all 0.4s ease;
}
.hm-node-icon-disk::after {
  content: ""; position: absolute; width: 88px; height: 88px;
  background: #fdf6ec; border-radius: 50%; z-index: -1;
  box-shadow: inset 0 3px 6px rgba(0,0,0,0.15), 0 2px 5px rgba(0,0,0,0.3);
  transition: all 0.4s ease;
  margin-top: 0;
}

.hm-node-desc {
  position: absolute;
  bottom: 110px; /* Position above the node */
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 800;
  color: #5c3a21;
  background: linear-gradient(135deg, #fff9e6 0%, #fde68a 100%);
  border: 2px solid #d4af37;
  border-radius: 8px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateX(-50%) translateY(10px) scale(0.9);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 50;
  white-space: nowrap;
  pointer-events: none;
}
.hm-node-desc::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #d4af37;
}

.hm-node-icon-disk > svg,
.hm-node-num-badge,
.hm-node-badge-done,
.hm-node-badge-lock,
.hm-node-badge-locked {
  transition: all 0.3s ease;
}

.hm-node:hover .hm-node-desc {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  transition-delay: 0.05s;
}
.hm-node-icon-disk > svg {
  width: 44px; height: 44px; stroke-width: 1.5;
  stroke: #6e1414;
  fill: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
  position: relative; z-index: 1;
  margin-top: 0;
}

.hm-disk-active {
  background: #fdf6ec;
  border-color: #d4af37;
  box-shadow:
    inset 0 3px 8px rgba(255,240,200,0.9),
    inset 0 -5px 10px rgba(0,0,0,0.15),
    0 0 0 2px #fff,
    0 0 0 6px #d4af37,
    0 8px 20px rgba(0,0,0,0.6),
    0 0 22px rgba(255, 245, 200, 0.8);
  animation: hmNodePulse 2s infinite;
}
.hm-node-done .hm-node-icon-disk {
  filter: drop-shadow(0 0 2px #3d0000) drop-shadow(0 0 4px #6e1414) drop-shadow(0 0 15px rgba(34,197,94,0.8));
}
.hm-disk-active::before { display: none; }

.hm-disk-end {
  background: #fff;
  box-shadow: inset 0 -4px 6px rgba(0,0,0,0.1), 0 0 16px rgba(245,158,11,0.5);
}
.hm-disk-end::before {
  background: 
    repeating-conic-gradient(from 0deg, rgba(255,255,255,0.4) 0deg 4deg, transparent 4deg 8deg),
    linear-gradient(135deg, #fef08a 0%, #f59e0b 35%, #b45309 65%, #fef08a 100%);
  border-color: #78350f;
}

@keyframes hmNodePulse {
  0%,100% { box-shadow: inset 0 3px 8px rgba(255,240,200,0.9), inset 0 -5px 10px rgba(0,0,0,0.15), 0 0 0 2px #fff, 0 0 0 6px #d4af37, 0 8px 20px rgba(0,0,0,0.6), 0 0 40px 10px rgba(255, 230, 100, 0.5); }
  50% { box-shadow: inset 0 3px 8px rgba(255,240,200,0.9), inset 0 -5px 10px rgba(0,0,0,0.15), 0 0 0 2px #fff, 0 0 0 6px #d4af37, 0 8px 20px rgba(0,0,0,0.6), 0 0 80px 30px rgba(255, 230, 100, 1); }
}

.hm-node-num-badge {
  position: absolute; top: -6px; left: -6px; width: 28px; height: 28px;
  background: #6e1414; color: white; border-radius: 50%;
  font-size: 13px; font-weight: 900; display: flex; align-items: center; justify-content: center;
  border: 2px solid #fde68a; box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}
.hm-node-badge-done {
  position: absolute; bottom: -2px; right: -2px; width: 26px; height: 26px;
  background: #22c55e; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 2px solid white; box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}
.hm-node-badge-done svg { width: 14px; height: 14px; }
.hm-node-badge-lock {
  position: absolute; bottom: -2px; right: -2px; width: 26px; height: 26px;
  background: #e5e7eb; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 2px solid #6b7280; box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}
.hm-node-badge-lock svg { width: 14px; height: 14px; }

.hm-node-label-box {
  background: #1a1a1a; border: 1.5px solid #d97706; color: white;
  font-size: 12px; font-weight: 800; padding: 6px 12px; border-radius: 6px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.4); z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.hm-node-status { font-size: 10px; font-weight: 700; border-radius: 10px; padding: 2px 8px; }
.hm-status-done { background: #22c55e; color: white; }
.hm-status-active { background: #cc0000; color: white; }
.hm-status-locked { background: transparent; color: #aaa; font-weight: 800; }
.hm-node-next {
  font-size: 10px; color: #d97706; font-weight: 800;
  background: rgba(255,255,255,0.7); border-radius: 10px; padding: 2px 8px; margin-top: 4px;
}

/* ?? RIGHT sidebar ??????????????????????????????????????????? */
.hm-right {
  width: 380px; flex-shrink: 0;
  padding: 30px 24px; z-index: 2; display: flex; flex-direction: column;
  zoom: 1.05;
}
.hm-progress-card {
  background: #f4ece4;
  border: 1.5px solid #d2bca8;
  border-radius: 16px; padding: 24px 28px;
  display: flex; flex-direction: column; gap: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hm-progress-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
  border-color: #c4a482;
}
.hm-progress-title {
  font-size: 16px; font-weight: 800; color: #4a2323;
  text-align: left; border-bottom: 1px solid rgba(210, 188, 168, 0.6); padding-bottom: 12px;
}
.hm-progress-body { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.hm-ring-wrap { position: relative; width: 86px; height: 86px; flex-shrink: 0; }
.hm-ring-svg { width: 100%; height: 100%; }
.hm-ring-pct {
  position: absolute; top: 35%; left: 0; right: 0; transform: translateY(-50%);
  text-align: center; font-size: 24px; font-weight: 900; color: #6e1414;
}
.hm-ring-sub {
  position: absolute; bottom: 20%; left: 0; right: 0;
  text-align: center; font-size: 11px; font-weight: 700; color: #4a2323; opacity: 0.8;
}
.hm-progress-stats { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.hm-pstat { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.hm-pstat-left { display: flex; align-items: center; gap: 8px; }
.hm-pstat-dot { width: 5px; height: 5px; border-radius: 50%; background: #b88d67; flex-shrink: 0; }
.hm-pstat-label { font-size: 13px; font-weight: 600; color: #4a2323; }
.hm-pstat-val { font-size: 13px; font-weight: 600; color: #4a2323; }
.hm-pstat-num { font-size: 14px; font-weight: 800; color: #6e1414; }

.hm-rewards-btn {
  background: transparent; color: #4a2323; border: 1.5px solid #4a2323;
  border-radius: 30px; padding: 10px; font-size: 14px; font-weight: 800;
  cursor: pointer; transition: all 0.2s; width: 100%;
}
.hm-rewards-btn:hover { background: rgba(74, 35, 35, 0.05); transform: translateY(-1px); }

/* ?? SHOP CARD: absolute bottom-left overlay ????????????????? */
.hm-shop-card {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 10;
  display: flex; align-items: center; gap: 16px;
  background: #f4ece4;
  border: 1.5px solid #d2bca8;
  border-radius: 16px; padding: 20px 24px;
  width: 420px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.15);
  zoom: 1.05;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}
.hm-shop-card:hover {
  transform: scale(1.04) translateY(-10px);
  box-shadow: 
    0 20px 40px rgba(0,0,0,0.25),
    inset 0 4px 12px rgba(255,255,255,0.8),
    inset 0 -4px 10px rgba(0,0,0,0.05);
  border-color: #e0b080;
}
.hm-sticker-icon {
  width: 44px; height: 44px;
  background: white;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  flex-shrink: 0;
}
.hm-sticker-icon-small {
  width: 28px; height: 28px;
  background: white;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  flex-shrink: 0;
}
.hm-shop-info { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.hm-shop-title { font-size: 16px; font-weight: 800; color: #4a2323; display: flex; align-items: center; }
.hm-shop-desc { font-size: 13px; color: #4a2323; line-height: 1.5; opacity: 0.9; }
.hm-shop-btn {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  background: transparent; color: #4a2323; border: 1.5px solid #4a2323; border-radius: 20px;
  padding: 6px 16px; font-size: 13px; font-weight: 800; cursor: pointer;
  margin-top: 6px; width: fit-content; transition: all 0.2s;
}
.hm-shop-btn:hover { background: rgba(74, 35, 35, 0.05); transform: translateY(-1px); }
.hm-shop-bag { position: relative; flex-shrink: 0; }

/* ?? AI CARD: absolute bottom-right overlay ?????????????????? */
.hm-ai-card {
  position: absolute;
  bottom: 24px;
  right: 24px;
  z-index: 10;
  background: #f4ece4;
  border: 1.5px solid #d2bca8; border-radius: 16px;
  width: 320px; overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  pointer-events: auto;
  zoom: 1.0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hm-ai-card:hover {
  transform: scale(1.04) translateY(-10px);
  box-shadow: 
    0 20px 40px rgba(0,0,0,0.25),
    inset 0 4px 12px rgba(255,255,255,0.8),
    inset 0 -4px 10px rgba(0,0,0,0.05);
  border-color: #e0b080;
}
.hm-ai-header {
  display: flex; align-items: center; justify-content: space-between;
  background: #6e1414; color: #f4ece4;
  padding: 14px 18px;
}
.hm-ai-header-left { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 800; }
.hm-ai-minimize {
  background: none; border: none;
  color: rgba(244, 236, 228, 0.7); font-size: 18px; cursor: pointer; line-height: 1;
}
.hm-ai-minimize:hover { color: #f4ece4; }
.hm-ai-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.hm-ai-content {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; text-align: center;
}
.hm-ai-text {
  font-size: 14px; font-weight: 700; color: #4a2323; line-height: 1.5;
}
.hm-ai-chat-btn {
  background: #6e1414; color: #f4ece4; border: none; border-radius: 30px;
  padding: 10px; font-size: 15px; font-weight: 800; cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; width: 100%;
}
.hm-ai-chat-btn:hover { background: #5c0f0f; transform: translateY(-1px); }
.hm-ai-faq-btn {
  background: transparent; color: #4a2323; border: none;
  font-size: 13px; font-weight: 800; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center; width: 100%; margin-top: 0;
}
.hm-ai-faq-btn:hover { color: #6e1414; }

/* ?? FOOTER: slim dark translucent bar ??????????????????????? */
.hm-footer {
  display: flex; align-items: center;
  position: relative;
  padding: 12px 24px;
  background: #7a0e11;
  border-top: 1.5px solid #610a0c;
  zoom: var(--ui-scale);
  flex-shrink: 0; z-index: 20;
}
.hm-footer-left {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.9); flex-shrink: 0;
  z-index: 2;
}
.hm-footer-nav { 
  display: flex; align-items: center; gap: 48px; 
  position: absolute; left: 50%; transform: translateX(-50%);
  flex-wrap: nowrap; justify-content: center; z-index: 1;
}
.hm-footer-nav a {
  font-size: 20px; font-weight: 700; color: rgba(255,255,255,0.9);
  text-decoration: none; white-space: nowrap; transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}
.hm-footer-nav a:hover { 
  color: #ffffff; 
  transform: scale(1.15);
}
.hm-footer-copy { display: none; }

/* ?? LOCKED EFFECT ????????????????????????????????????????? */
.hm-node-locked .hm-node-icon-disk > img,
.hm-node-locked .hm-node-icon-disk > svg {
  opacity: 1 !important;
}
.hm-node-locked .hm-node-icon-disk {
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.4)) !important;
}
.hm-node-locked .hm-node-icon-disk::before {
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 50%, #4b5563 100%) !important;
}
.hm-node-locked .hm-node-icon-disk::after {
  background: #e5e7eb !important;
}
.hm-node-locked .hm-pedestal-img {
  filter: grayscale(100%) brightness(0.85);
}
.hm-node-locked .hm-node-label-box {
  border-color: #6b7280 !important;
}
.hm-node-locked .hm-node-desc {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%) !important;
  border-color: #9ca3af !important;
  color: #4b5563 !important;
}

/* ?? ACTIVE NODE HIGHLIGHT ????????????????????????????????????????? */
.hm-node.hm-node-active {
  transform: translateX(-50%) scale(1.2);
  z-index: 10;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hm-node.hm-node-active:hover {
  transform: translateX(-50%) translateY(-5px) scale(1.25);
}
.hm-node.hm-node-active .hm-node-icon-disk {
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
}
.hm-node.hm-node-active .hm-node-icon-disk::before {
  background: #fbbf24;
}

/* ?? SHOP CARD FLOAT IMAGES ?????????????????????????????????? */
.hm-shop-float-imgs {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: -1;
}
.shop-float-img {
  position: absolute;
  width: 76px; height: 76px;
  object-fit: cover;
  border-radius: 14px;
  border: 3px solid #fff;
  background: #fff;
  box-shadow: 
    0 12px 24px rgba(0,0,0,0.2),
    0 0 0 1px rgba(0,0,0,0.05),
    0 0 20px rgba(255,255,255,0.6);
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: scale(0.3);
}
.hm-shop-card:hover .f-img-1 { opacity: 1; animation: orbitFloat1 4.5s ease-in-out infinite; }
.hm-shop-card:hover .f-img-2 { opacity: 1; animation: orbitFloat2 5.5s ease-in-out infinite; }
.hm-shop-card:hover .f-img-3 { opacity: 1; animation: orbitFloat3 4s ease-in-out infinite; }
.hm-shop-card:hover .f-img-4 { opacity: 1; animation: orbitFloat4 5s ease-in-out infinite; }

@keyframes orbitFloat1 {
  0%   { transform: translate(-20px, -60px) scale(1) rotate(-15deg); }
  50%  { transform: translate(-30px, -70px) scale(1.05) rotate(-5deg); }
  100% { transform: translate(-20px, -60px) scale(1) rotate(-15deg); }
}
@keyframes orbitFloat2 {
  0%   { transform: translate(140px, -70px) scale(1.1) rotate(10deg); }
  50%  { transform: translate(150px, -80px) scale(1.15) rotate(20deg); }
  100% { transform: translate(140px, -70px) scale(1.1) rotate(10deg); }
}
@keyframes orbitFloat3 {
  0%   { transform: translate(320px, -50px) scale(0.9) rotate(25deg); }
  50%  { transform: translate(310px, -60px) scale(0.85) rotate(15deg); }
  100% { transform: translate(320px, -50px) scale(0.9) rotate(25deg); }
}
@keyframes orbitFloat4 {
  0%   { transform: translate(390px, 30px) scale(1) rotate(-12deg); }
  50%  { transform: translate(400px, 40px) scale(1.05) rotate(-22deg); }
  100% { transform: translate(390px, 30px) scale(1) rotate(-12deg); }
}
/* Responsive inner scaling for panels and map */

.hm-header, .hm-footer { zoom: 0.9; }
.hm-left, .hm-right, .hm-shop-card, .hm-ai-card { zoom: 1.2; }

@media (max-width: 1600px) {
  .hm-header, .hm-footer { zoom: 0.9 !important; }
  .hm-left, .hm-right, .hm-shop-card, .hm-ai-card { zoom: 1.02 !important; }
  .hm-quest-map { transform: translateY(-80px) scale(0.94) !important; }
}
@media (max-width: 1300px) {
  .hm-header, .hm-footer { zoom: 0.9 !important; }
  .hm-left, .hm-right, .hm-shop-card, .hm-ai-card { zoom: 0.9 !important; }
  .hm-quest-map { transform: translateY(-120px) scale(0.83) !important; }
}

/* Apply global UI scale to success page and results page contents */
.op-sidebar, #mock-screen-success { zoom: var(--ui-scale); }
.results-header, .results-container { zoom: var(--ui-scale); }


/* ===== LOADING PAGE ===== */
.loading-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: url('assets/images/S__23257107.jpg') center/cover no-repeat fixed;
  overflow: hidden;
  position: relative;
  align-items: center;
  justify-content: center;
}
.loading-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 105px;
  background: #6a0008;
  display: flex;
  align-items: center;
  padding: 0 45px;
  color: white;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}
.loading-topbar-icon {
  background: white;
  border-radius: 50%;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  margin-right: 24px;
}
.loading-topbar-icon svg {
  width: 36px;
  height: 36px;
  animation: spin 3s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }
.loading-topbar-text {
  display: flex;
  flex-direction: column;
}
.loading-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1.5px;
  line-height: 1.2;
}
.loading-subtitle {
  font-size: 16px;
  color: #e8d8a8;
  line-height: 1.2;
  margin-top: 4px;
}

.loading-center-box {
  width: 800px;
  position: relative;
  margin-top: 40px;
  transform: scale(1.365);
  z-index: 1;
}
.loading-center-box::before {
  content: '';
  position: absolute;
  top: -3px; left: -3px; right: -3px; bottom: -3px;
  background: rgba(62, 39, 35, 0.65);
  backdrop-filter: blur(8px);
  border: 3px solid #e8d8a8;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  z-index: -2;
  pointer-events: none;
  -webkit-mask-image: 
    linear-gradient(to right, black calc(50% - 44px), transparent calc(50% - 44px), transparent calc(50% + 44px), black calc(50% + 44px)),
    linear-gradient(black, black);
  -webkit-mask-size: 100% 3px, 100% calc(100% - 3px);
  -webkit-mask-position: top, bottom;
  -webkit-mask-repeat: no-repeat;
  mask-image: 
    linear-gradient(to right, black calc(50% - 44px), transparent calc(50% - 44px), transparent calc(50% + 44px), black calc(50% + 44px)),
    linear-gradient(black, black);
  mask-size: 100% 3px, 100% calc(100% - 3px);
  mask-position: top, bottom;
  mask-repeat: no-repeat;
}

.loading-emblem-wrap {
  position: absolute;
  top: -48px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 48px;
  background: rgba(62, 39, 35, 0.65);
  backdrop-filter: blur(8px);
  border: 3px solid #e8d8a8;
  border-bottom: none;
  border-top-left-radius: 45px;
  border-top-right-radius: 45px;
  z-index: 10;
}

.loading-emblem-inner {
  position: absolute;
  top: 5px; 
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 3;
}

.loading-emblem {
  width: 50px;
  height: auto;
  filter: sepia(100%) saturate(300%) hue-rotate(5deg) brightness(120%) drop-shadow(0 2px 3px rgba(0,0,0,0.5));
}
.loading-emblem-text {
  color: #d4af37;
  font-size: 11px;
  letter-spacing: 2px;
  margin-top: 2px;
  font-family: serif;
}

.loading-decor-left, .loading-decor-right {
  position: absolute;
  top: -1px;
  width: 150px;
  height: 1px;
  z-index: 15;
}
.loading-decor-left {
  left: 50%;
  margin-left: -195px;
  background: linear-gradient(to left, #ffd700, #d4af37 20%, transparent);
}
.loading-decor-right {
  right: 50%;
  margin-right: -195px;
  background: linear-gradient(to right, #ffd700, #d4af37 20%, transparent);
}
.loading-decor-left::after, .loading-decor-right::after {
  content: '';
  position: absolute;
  top: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid #d4af37;
}
.loading-decor-left::after { right: -3px; }
.loading-decor-right::after { left: -3px; }

.loading-content {
  padding: 50px 40px 40px;
  display: flex;
  flex-direction: column;
}

.loading-banner {
  background: #fff8f0;
  border-radius: 12px;
  display: flex;
  padding: 0;
  overflow: hidden;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
  height: 220px;
  position: relative;
}
.loading-banner-img {
  width: 260px;
  background: #fdfdfd;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading-banner-img img {
  width: 90%;
  height: 90%;
  object-fit: contain;
}
.loading-recommend-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: #8b0000;
  color: white;
  padding: 6px 10px;
  font-size: 12px;
  text-align: center;
  border-radius: 4px;
  border: 1px solid #b8860b;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
}

.loading-banner-info {
  flex: 1;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.loading-banner-subtitle {
  color: #b8860b;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}
.loading-banner-title {
  font-size: 32px;
  font-weight: 900;
  color: #333;
  margin-bottom: 20px;
}
.loading-banner-features {
  display: flex;
  gap: 20px;
}
.loading-banner-features span {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 13px;
  color: #666;
  gap: 4px;
}

.loading-banner-discount {
  width: 180px;
  background: #7a0f1d;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border-left: 2px dashed #b8860b;
}
.loading-discount-top {
  font-size: 13px;
  margin-bottom: 5px;
}
.loading-discount-mid {
  font-size: 20px;
  margin-bottom: 5px;
}
.loading-discount-mid span {
  font-size: 40px;
  font-weight: 900;
}
.loading-discount-bot {
  font-size: 11px;
  margin-bottom: 15px;
}
.loading-discount-btn {
  background: transparent;
  color: white;
  border: 1px solid white;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.loading-discount-btn:hover {
  background: white;
  color: #7a0f1d;
}

.loading-progress-area {
  margin-top: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.loading-progress-label {
  color: #e8d8a8;
  font-size: 20px;
  letter-spacing: 5px;
  margin-bottom: 25px;
}
.loading-progress-track-wrapper {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 15px;
}
.loading-progress-track {
  flex: 1;
  height: 6px;
  background: rgba(0,0,0,0.5);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}
.loading-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d4af37, #fff8dc, #d4af37);
  border-radius: 3px;
}
.loading-progress-pct {
  color: #d4af37;
  font-size: 24px;
  width: 60px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.loading-bottom-hint {
  position: absolute;
  bottom: 50px;
  width: 100%;
  justify-content: center;
  color: #ffd700;
  font-size: 28px;
  font-weight: 300;
  letter-spacing: 3px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}



