:root {
  --bg: #0d1f1b;
  --bg-soft: #17312a;
  --panel: rgba(16, 33, 28, 0.82);
  --panel-light: rgba(246, 239, 221, 0.92);
  --ink: #f4f0e4;
  --ink-dark: #19322c;
  --muted: #bad6c6;
  --gold: #efbe55;
  --green: #49a36d;
  --green-deep: #2f6d4c;
  --red: #d35e48;
  --blue: #4fa7c6;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
  --line: rgba(255, 255, 255, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(87, 152, 115, 0.24), transparent 28%),
    linear-gradient(180deg, #081310 0%, #10211c 34%, #10231d 100%);
}

button,
input,
label {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
}

.hero {
  position: relative;
  min-height: 54vh;
  display: flex;
  align-items: end;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hero__backdrop,
.hero__shade {
  position: absolute;
  inset: 0;
}

.hero__backdrop {
  background:
    linear-gradient(180deg, rgba(7, 13, 11, 0.08), rgba(7, 13, 11, 0.48)),
    url("assets/images/cover.png") center/cover no-repeat;
  transform: scale(1.04);
}

.hero__shade {
  background:
    linear-gradient(90deg, rgba(8, 18, 15, 0.86) 0%, rgba(8, 18, 15, 0.52) 46%, rgba(8, 18, 15, 0.18) 100%);
}

.hero__content {
  position: relative;
  z-index: 1;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 36px;
}

.eyebrow,
.panel-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: #d9e7dc;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.eyebrow::before,
.panel-tag::before {
  content: "";
  width: 30px;
  height: 2px;
  background: var(--gold);
}

.hero h1 {
  max-width: 10ch;
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 1.03;
}

.hero__summary {
  max-width: 660px;
  margin: 16px 0 0;
  line-height: 1.9;
  color: #e5efe9;
}

.hero__actions,
.zone-actions,
.battle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.layout {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 42px;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 22px;
}

.sidebar,
.main {
  display: grid;
  gap: 22px;
  align-content: start;
}

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 18px;
}

.panel h2,
.panel h3,
.panel p {
  margin-top: 0;
}

.panel h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 13px 22px;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

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

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.button--primary {
  background: linear-gradient(135deg, #4ca36e, #25573f);
  color: white;
  box-shadow: 0 10px 24px rgba(44, 115, 78, 0.3);
}

.button--ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.button--tiny {
  padding: 10px 14px;
  font-size: 0.92rem;
}

.hud__header {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.avatar-badge,
.monster-token,
.combatant__icon,
.certificate__seal {
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 800;
}

.avatar-badge {
  width: 64px;
  height: 64px;
  background: radial-gradient(circle at 35% 35%, #ffe79a, #c18b30);
  color: #533600;
}

.status-grid,
.mini-stats,
.reward-grid {
  display: grid;
  gap: 12px;
}

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

.status-card,
.reward-grid article {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 14px;
}

.status-card span,
.reward-grid span,
.mini-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-card strong,
.reward-grid strong {
  display: block;
  margin: 6px 0 8px;
  font-size: 1.1rem;
}

.meter {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.meter__fill {
  height: 100%;
  width: 0;
  transition: width 0.26s ease;
}

.meter__fill--hp {
  background: linear-gradient(90deg, #ff9b6e, #d55445);
}

.meter__fill--exp {
  background: linear-gradient(90deg, #74d8e4, #4e91e3);
}

.meter__fill--monster {
  background: linear-gradient(90deg, #ffcc6e, #df6556);
}

.mini-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.mini-stats div {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 18px;
  padding: 12px;
}

.mini-stats strong {
  font-size: 1.3rem;
}

.inventory-grid,
.loot-list,
.zone-tags,
.certificate__badges,
.zone-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.item-card,
.loot-chip,
.tag {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 12px 14px;
}

.item-card {
  width: calc(50% - 5px);
}

.item-card strong,
.loot-chip strong {
  display: block;
}

.item-card span,
.loot-chip span {
  color: var(--muted);
  font-size: 0.9rem;
}

.map-panel {
  background:
    linear-gradient(180deg, rgba(10, 24, 20, 0.88), rgba(16, 33, 28, 0.9)),
    radial-gradient(circle at top right, rgba(79, 167, 198, 0.18), transparent 28%);
}

.map-summary {
  color: var(--muted);
  font-weight: 700;
}

.map-board {
  position: relative;
  min-height: 320px;
  border-radius: 24px;
  margin-top: 18px;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(244, 237, 219, 0.06), rgba(244, 237, 219, 0.04)),
    rgba(9, 22, 18, 0.5);
  overflow: hidden;
}

.map-path {
  position: absolute;
  left: 9%;
  right: 9%;
  top: 52%;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(239, 190, 85, 0.16), rgba(239, 190, 85, 0.55), rgba(239, 190, 85, 0.16));
  transform: translateY(-50%);
}

.map-nodes {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
  min-height: 280px;
}

.map-node {
  position: relative;
  z-index: 1;
  border: 0;
  border-radius: 24px;
  min-height: 200px;
  padding: 14px;
  color: white;
  cursor: pointer;
  background: transparent;
}

.map-node__image,
.zone-panel__backdrop {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
}

.map-node__shade,
.zone-panel__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(9, 20, 18, 0.12), rgba(9, 20, 18, 0.82));
}

.map-node__body {
  position: relative;
  z-index: 1;
  min-height: 172px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  text-align: left;
}

.map-node__index {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
  font-weight: 800;
  margin-bottom: auto;
}

.map-node__body h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.map-node.is-locked {
  filter: grayscale(1);
  opacity: 0.42;
}

.map-node.is-complete::after {
  content: "已淨化";
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(239, 190, 85, 0.95);
  color: #503400;
  font-size: 0.85rem;
  font-weight: 700;
  z-index: 2;
}

.map-node.is-selected {
  transform: translateY(-6px);
}

.zone-panel {
  min-height: 390px;
  padding: 0;
}

.zone-panel__content {
  position: relative;
  z-index: 1;
  min-height: 390px;
  padding: 26px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.8fr);
  gap: 18px;
  align-items: end;
}

.zone-panel__intro p {
  max-width: 720px;
  line-height: 1.85;
}

.encounter-card {
  background: rgba(8, 18, 15, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 18px;
  backdrop-filter: blur(8px);
}

.encounter-card__header {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.monster-token,
.combatant__icon--enemy {
  width: 72px;
  height: 72px;
  background: radial-gradient(circle at 35% 35%, #ffd296, #b44a3b);
  color: #4d180f;
  font-size: 1.8rem;
}

.boss-bar {
  margin-top: 12px;
}

.boss-bar span {
  display: block;
  margin-bottom: 8px;
}

.battle-panel {
  background:
    radial-gradient(circle at top left, rgba(211, 94, 72, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(79, 167, 198, 0.15), transparent 28%),
    var(--panel-light);
  color: var(--ink-dark);
}

.battle-top {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

.battle-round {
  color: #6b4d1d;
  font-weight: 800;
}

.battle-arena {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
  margin: 18px 0;
}

.combatant {
  background: rgba(255, 255, 255, 0.72);
  border-radius: 26px;
  padding: 18px;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(25, 50, 44, 0.08);
}

.combatant__icon {
  width: 74px;
  height: 74px;
  margin: 0 auto 12px;
  background: radial-gradient(circle at 35% 35%, #ffe7a1, #4fa7c6);
  color: #17322a;
  font-size: 1.8rem;
}

.battle-vs {
  font-size: 2rem;
  font-weight: 900;
  color: #774533;
}

.battle-status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.battle-status__item {
  background: rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  padding: 14px;
}

.battle-status__item span {
  display: block;
  color: #4b635c;
  margin-bottom: 6px;
}

.challenge-card {
  background: rgba(255, 255, 255, 0.82);
  border-radius: 26px;
  padding: 22px;
  box-shadow: inset 0 0 0 1px rgba(25, 50, 44, 0.08);
}

.challenge-label {
  color: #746449;
  font-weight: 700;
  margin-bottom: 10px;
}

.challenge-question {
  font-size: 1.18rem;
  line-height: 1.8;
  margin-bottom: 16px;
}

.choice-list,
.sequence-list,
.reward-grid {
  display: grid;
  gap: 12px;
}

.choice-item,
.sequence-item {
  display: flex;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(25, 50, 44, 0.1);
  background: rgba(255, 255, 255, 0.9);
}

.sequence-item {
  justify-content: space-between;
  align-items: center;
}

.sequence-controls {
  display: flex;
  gap: 8px;
}

.sequence-controls button {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  background: rgba(74, 167, 198, 0.16);
}

.battle-log {
  min-height: 54px;
  margin-top: 16px;
  border-radius: 18px;
  padding: 14px;
  background: rgba(25, 50, 44, 0.08);
  line-height: 1.8;
  color: #274038;
  font-weight: 700;
}

.reward-panel,
.certificate-panel {
  background: var(--panel-light);
  color: var(--ink-dark);
}

.reward-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 16px 0;
}

.loot-drop {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.certificate {
  max-width: 860px;
  margin: 0 auto;
  border-radius: 28px;
  padding: 34px 24px;
  background: linear-gradient(180deg, #fff7de, #fffdf4);
  border: 6px solid rgba(212, 171, 77, 0.55);
  text-align: center;
}

.certificate__seal {
  width: 90px;
  height: 90px;
  margin: 0 auto 16px;
  background: radial-gradient(circle at 30% 30%, #ffeaa2, #cf9839);
  color: #563500;
}

.certificate__headline {
  font-size: 1.2rem;
  font-weight: 800;
}

.certificate__body {
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.9;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: 2;
  }

  .main {
    order: 1;
  }
}

@media (max-width: 860px) {
  .map-nodes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-path {
    display: none;
  }

  .zone-panel__content,
  .battle-arena,
  .battle-status {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .layout,
  .hero__content {
    width: min(100% - 20px, 1280px);
  }

  .item-card {
    width: 100%;
  }

  .panel {
    padding: 18px;
  }

  .hero {
    min-height: 62vh;
  }
}
