/* Dragon Live World Avatar on SVG Map */
.dragon-world-avatar {
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.5s ease;
  animation: dragonFloat 3s ease-in-out infinite;
}

@keyframes dragonFloat {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(2deg);
  }
}

.dragon-flight-halo {
  fill: rgba(45, 212, 191, 0.4);
  filter: drop-shadow(0 0 12px rgba(15, 118, 110, 0.75));
  animation: dragonAuraPulse 2.4s ease-in-out infinite;
}

@keyframes dragonAuraPulse {
  0%, 100% { r: 28; opacity: 0.4; }
  50% { r: 36; opacity: 0.85; }
}

.dragon-flight-bubble rect {
  fill: #ffffff;
  stroke: var(--jade);
  stroke-width: 1.5;
  filter: drop-shadow(0 3px 6px rgba(15, 118, 110, 0.25));
}

.dragon-flight-bubble text {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 750;
  fill: #18382c;
  dominant-baseline: central;
}

/* Dragon Companion Advice in Drawer */
.drawer-dragon-companion {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(234, 245, 238, 0.9) 0%, rgba(255, 248, 232, 0.85) 100%);
  border: 1.5px solid #bad3c3;
  box-shadow: 0 4px 14px rgba(22, 60, 43, 0.05);
}

.dragon-avatar-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--gold);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(199, 154, 65, 0.25);
}

.dragon-avatar-badge img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.dragon-companion-body {
  flex: 1;
  min-width: 0;
}

.dragon-companion-title {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--jade);
  margin-bottom: 4px;
}

.dragon-companion-text {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink);
  margin: 0;
}

/* 7 Dragon Orbs Shelf */
.dragon-orbs-shelf {
  margin-bottom: 24px;
  padding: 18px 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 2px 10px rgba(22, 60, 43, 0.04);
}

.orbs-shelf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.orbs-shelf-title .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--jade);
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.orbs-shelf-title h3 {
  font-size: 18px;
  margin: 0;
  color: var(--ink);
}

.orbs-shelf-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.orbs-count-badge,
.orbs-bounty-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 10px;
  background: var(--soft);
  border: 1px solid var(--jade);
  font-size: 13px;
  font-weight: 700;
  color: var(--jade);
}

.orbs-bounty-badge {
  background: var(--cream);
  border-color: var(--gold);
  color: #875713;
}

.orbs-count-badge strong,
.orbs-bounty-badge strong {
  font-size: 16px;
  color: var(--ink);
}

.orbs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 10px;
}

.dragon-orb-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 10px;
  border-radius: 14px;
  border: 1.5px dashed var(--line);
  background: var(--bg);
  opacity: 0.65;
  transition: all 0.25s ease;
}

.dragon-orb-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 6px 16px rgba(199, 154, 65, 0.12);
}

.dragon-orb-card.is-unlocked {
  opacity: 1;
  border-style: solid;
  border-color: var(--jade);
  background: linear-gradient(180deg, #f0fdf4 0%, var(--paper) 100%);
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.16);
}

.orb-icon-circle {
  font-size: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  margin-bottom: 6px;
  transition: transform 0.2s ease;
}

.dragon-orb-card.is-unlocked .orb-icon-circle {
  background: #e6f7f2;
  border-color: #5eead4;
  box-shadow: 0 0 10px rgba(15, 118, 110, 0.35);
  transform: scale(1.08);
}

.orb-name {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 3px;
}

.orb-sub {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 6px;
}

.orb-status-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--muted);
}

.dragon-orb-card.is-unlocked .orb-status-chip {
  background: #d4edda;
  color: #155724;
}

/* Hall of Fame (Bảng Phong Thần Long Môn) */
.roadmap-hall-of-fame {
  margin-top: 24px;
  padding: 20px 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 2px 10px rgba(22, 60, 43, 0.04);
}

.roadmap-hof-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.roadmap-hof-head .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--jade);
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.roadmap-hof-head h3 {
  font-size: 20px;
  margin: 0 0 6px;
  color: var(--ink);
}

.roadmap-hof-head p {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
  max-width: 680px;
}

.roadmap-hof-reward-chip {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 750;
  color: #875713;
  background: var(--cream);
  border: 1px solid var(--gold);
  padding: 6px 12px;
  border-radius: 10px;
}

.roadmap-hof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.roadmap-hof-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.hof-seal {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--soft);
  border: 1px solid var(--jade);
  color: var(--jade-deep);
  font-family: Georgia, serif;
  font-size: 15px;
  font-weight: 800;
  flex-shrink: 0;
}

.hof-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.hof-copy strong {
  font-size: 14.5px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hof-copy small {
  font-size: 12px;
  color: var(--muted);
}

.hof-code-pill {
  font-size: 11.5px;
  font-weight: 750;
  color: var(--jade-deep);
  background: var(--soft);
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* Dark mode additions */
html[data-theme=dark] .drawer-dragon-companion {
  background: linear-gradient(135deg, rgba(20, 45, 36, 0.9) 0%, rgba(35, 40, 25, 0.85) 100%);
  border-color: #2b493c;
}
html[data-theme=dark] .dragon-avatar-badge {
  background: #14251e;
  border-color: var(--gold);
}
html[data-theme=dark] .dragon-companion-text {
  color: var(--cream);
}
html[data-theme=dark] .dragon-orbs-shelf,
html[data-theme=dark] .roadmap-hall-of-fame {
  background: #192e26;
  border-color: #2b493c;
}
html[data-theme=dark] .orbs-bounty-badge,
html[data-theme=dark] .roadmap-hof-reward-chip {
  background: #353022;
  color: #f1cf88;
  border-color: #554930;
}
html[data-theme=dark] .roadmap-hof-card {
  background: #14251e;
  border-color: #2b493c;
}
html[data-theme=dark] .hof-seal,
html[data-theme=dark] .hof-code-pill {
  background: #1f372c;
  border-color: #2b493c;
  color: var(--cream);
}
}
html[data-theme=dark] .dragon-orb-card {
  background: #14251e;
  border-color: #2b493c;
}
html[data-theme=dark] .dragon-orb-card.is-unlocked {
  background: linear-gradient(180deg, #272c1c 0%, #172a22 100%);
  border-color: #c99a41;
}


/* ==========================================================================
   8-CHAPTER HSK 3.0 THANH LONG EVOLUTION SYSTEM (GRID + COMPACT RIBBON + HERO)
   ========================================================================== */

/* Responsive canvas scaling for all 8 chapter graduation certificates */
.adventure-cert-box canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--line);
}

/* 1. Overview 8-Card Evolution Artwork Header (/roadmap/) */
.realm-evo-art-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--cream);
  border: 1px solid var(--line);
  margin-bottom: 4px;
}

.realm-evo-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.realm-switch-card:hover .realm-evo-art {
  transform: scale(1.045);
}

.realm-evo-seal-chip {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 4px 7px;
  border-radius: 10px;
  background: rgba(255, 252, 246, 0.92);
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(15, 38, 30, 0.14);
  backdrop-filter: blur(6px);
}

.realm-evo-stage-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 38, 30, 0.86);
  border: 1px solid rgba(236, 194, 120, 0.55);
  color: #fff8ed;
  font-size: 11.5px;
  font-weight: 750;
  line-height: 1.2;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
}

/* 2. Compact 8-Step Evolution Ribbon on Subpages (/roadmap/hsk0/ .. /roadmap/hsk7-9/) */
.roadmap-master-ladder[data-ladder-mode="compact"] {
  padding: 16px 20px;
  margin-bottom: 22px;
}

.evo-ribbon-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.evo-ribbon-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink);
}

.evo-ribbon-kicker .icon {
  width: 16px;
  height: 16px;
  color: var(--jade);
  flex-shrink: 0;
}

.evo-ribbon-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
}

.roadmap-evo-ribbon {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
}

.evo-ribbon-pill {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 5px;
  min-height: 46px;
  padding: 8px 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.evo-ribbon-pill:hover {
  transform: translateY(-2px);
  border-color: var(--jade);
  box-shadow: 0 6px 14px rgba(8, 127, 109, 0.1);
}

.evo-ribbon-pill.is-active {
  background: linear-gradient(155deg, var(--cream) 0%, var(--paper) 100%);
  border-color: var(--jade);
  box-shadow: 0 0 0 1px var(--jade), 0 6px 16px rgba(8, 127, 109, 0.16);
}

.evo-ribbon-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.evo-ribbon-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--line);
  background: var(--cream);
  display: block;
}

.evo-ribbon-pill.is-active .evo-ribbon-avatar {
  border-color: var(--jade);
  box-shadow: 0 0 0 2px rgba(8, 127, 109, 0.18);
}

.evo-ribbon-seal {
  position: absolute;
  right: -4px;
  bottom: -3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--jade-deep);
  color: #ffffff;
  border: 1.5px solid var(--paper);
  font-family: Georgia, serif;
  font-size: 10.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
}

.evo-ribbon-pill.is-active .evo-ribbon-seal {
  background: var(--gold);
  color: #182e26;
}

.evo-ribbon-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 0;
  width: 100%;
}

.evo-ribbon-meta strong {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}

.evo-ribbon-meta small {
  font-size: 11px;
  font-weight: 650;
  color: var(--jade-deep);
  line-height: 1.2;
}

.evo-ribbon-prog-label {
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.evo-ribbon-bar {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: var(--soft);
  overflow: hidden;
  margin-top: 2px;
}

.evo-ribbon-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--jade);
  transition: width 0.3s ease;
}

/* 3. Chapter Hero Evolution Portrait Banner */
.chapter-evo-banner {
  padding: 22px 26px;
}

.chapter-evo-banner-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
}

.chapter-evo-portrait-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.chapter-evo-portrait-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  border: 1.5px solid rgba(255, 219, 128, 0.55);
  background: #fff8ed;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.34);
}

.chapter-evo-portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chapter-evo-seal {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(15, 38, 30, 0.88);
  border: 1px solid rgba(255, 219, 128, 0.65);
  color: #ffdb80;
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.chapter-evo-stage-caption {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 219, 128, 0.35);
}

.chapter-evo-stage-name {
  font-size: 12px;
  font-weight: 750;
  color: #ffdb80;
}

.chapter-evo-stage-zh {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  opacity: 0.9;
}

.chapter-evo-copy h2 {
  font-size: 25px;
  line-height: 1.3;
  margin: 6px 0 8px;
  color: #ffffff;
}

.chapter-evo-copy p {
  font-size: 14px;
  line-height: 1.68;
  color: #e2efe9;
  margin: 0 0 16px;
  max-width: 65ch;
}

.chapter-evo-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.chapter-evo-kpi {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 219, 128, 0.32);
  border-radius: 14px;
  padding: 16px 20px;
  min-width: 196px;
}

.chapter-evo-kpi-label {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  color: #ffdb80;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}

.chapter-evo-kpi-val {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.chapter-evo-kpi-val span {
  font-size: 13.5px;
  font-weight: 650;
  color: #a8e6cf;
  margin-left: 2px;
}

.chapter-evo-kpi small {
  color: #d3e2dc;
  display: block;
  margin-top: 4px;
  font-size: 12px;
}

/* Dark mode support for 8-chapter Evolution components */
html[data-theme=dark] .realm-evo-art-wrap {
  background: #1b2e26;
  border-color: #2b493c;
}

html[data-theme=dark] .realm-evo-seal-chip {
  background: rgba(20, 37, 30, 0.92);
  border-color: #2b493c;
}

html[data-theme=dark] .evo-ribbon-pill {
  background: #14251e;
  border-color: #2b493c;
}

html[data-theme=dark] .evo-ribbon-pill.is-active {
  background: linear-gradient(145deg, #1d3c30 0%, #2b3222 100%);
  border-color: var(--jade);
}

html[data-theme=dark] .evo-ribbon-meta small {
  color: #7dd3fc;
}

html[data-theme=dark] .evo-ribbon-bar {
  background: rgba(255, 255, 255, 0.1);
}

/* Responsive Breakpoints */
@media (max-width: 1120px) {
  .roadmap-realm-switcher {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .roadmap-evo-ribbon {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .chapter-evo-banner-grid {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .chapter-evo-kpi {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
  }
}

@media (max-width: 680px) {
  .roadmap-realm-switcher {
    grid-template-columns: minmax(0, 1fr);
  }
  .roadmap-evo-ribbon {
    display: flex;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
  }
  .evo-ribbon-pill {
    flex: 0 0 104px;
    scroll-snap-align: start;
  }
  .chapter-evo-banner {
    padding: 18px 16px;
  }
  .chapter-evo-banner-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
  .chapter-evo-portrait-card {
    max-width: 240px;
    margin: 0 auto;
    width: 100%;
  }
  .chapter-evo-copy h2 {
    font-size: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .realm-evo-art,
  .evo-ribbon-pill,
  .dragon-world-avatar,
  .dragon-flight-halo {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}
