/* Phase 3: the connected Forge -> Vault -> Battle adventure. */

:root {
  --adventure-panel: rgba(24, 24, 42, 0.94);
  --adventure-panel-soft: rgba(38, 35, 56, 0.88);
  --adventure-raised: rgba(48, 42, 64, 0.96);
  --adventure-border: rgba(251, 191, 36, 0.28);
  --adventure-border-strong: rgba(251, 191, 36, 0.68);
  --adventure-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  --adventure-muted: #d1d5db;
  --adventure-danger: #fda4af;
}

body.light-mode {
  --adventure-panel: rgba(255, 252, 245, 0.97);
  --adventure-panel-soft: rgba(247, 239, 222, 0.96);
  --adventure-raised: rgba(255, 247, 230, 0.99);
  --adventure-border: rgba(154, 52, 18, 0.24);
  --adventure-border-strong: rgba(154, 52, 18, 0.62);
  --adventure-shadow: 0 18px 44px rgba(82, 45, 13, 0.13);
  --adventure-muted: #5f4b35;
  --adventure-danger: #9f1239;
}

body.duck-mode {
  --adventure-panel: rgba(255, 253, 231, 0.98);
  --adventure-panel-soft: rgba(255, 248, 193, 0.96);
  --adventure-raised: rgba(255, 252, 214, 0.99);
  --adventure-border: rgba(133, 77, 14, 0.28);
  --adventure-border-strong: rgba(133, 77, 14, 0.65);
  --adventure-shadow: 0 18px 44px rgba(98, 62, 8, 0.13);
  --adventure-muted: #5c421a;
  --adventure-danger: #9f1239;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.vault-page {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2.25rem);
  padding-bottom: 5rem;
}

.adventure-journey {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  align-items: center;
  padding: 0.72rem;
  border: 1px solid var(--adventure-border);
  border-radius: 18px;
  background: var(--adventure-panel);
  box-shadow: var(--adventure-shadow);
}

.adventure-journey a,
.adventure-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
  min-width: 0;
  min-height: 58px;
  padding: 0.65rem 0.8rem;
  border: 2px solid transparent;
  border-radius: 13px;
  color: var(--text-primary);
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.adventure-journey a:hover,
.adventure-step:hover {
  border-color: var(--adventure-border);
  background: var(--adventure-panel-soft);
  transform: translateY(-2px);
}

.adventure-journey a:focus-visible,
.adventure-step:focus-visible {
  border-color: var(--adventure-border-strong);
  outline: 3px solid var(--focus-ring, var(--gold-bright));
  outline-offset: 3px;
}

.adventure-journey a.is-current,
.adventure-step.is-current {
  border-color: var(--adventure-border-strong);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.17), rgba(255, 107, 53, 0.12));
}

.adventure-step > span:first-child,
.journey-step-number {
  display: grid;
  grid-row: 1 / 3;
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--gold-bright), var(--volcanic-primary));
  color: #221406;
  font-weight: 950;
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.22);
}

.adventure-step > strong,
.adventure-journey a > strong {
  align-self: end;
  font-size: 0.94rem;
  letter-spacing: 0.02em;
}

.adventure-step > small,
.adventure-journey a > small {
  align-self: start;
  overflow: hidden;
  color: var(--adventure-muted);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vault-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(1.25rem, 4vw, 3.5rem);
  align-items: center;
  overflow: hidden;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  border-color: var(--adventure-border-strong);
  background:
    radial-gradient(circle at 86% 24%, rgba(251, 191, 36, 0.16), transparent 30%),
    radial-gradient(circle at 10% 100%, rgba(255, 107, 53, 0.12), transparent 34%),
    var(--adventure-panel);
  box-shadow: var(--adventure-shadow);
}

.vault-hero::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 46%, rgba(251, 191, 36, 0.04) 46% 48%, transparent 48%);
  content: '';
  pointer-events: none;
}

.vault-hero-copy {
  position: relative;
  z-index: 1;
}

.vault-hero-copy > p:last-of-type {
  max-width: 68ch;
  margin: 1.1rem 0 0;
  color: var(--adventure-muted);
  font-size: clamp(1rem, 1.8vw, 1.16rem);
  line-height: 1.72;
}

.vault-eyebrow {
  margin: 0 0 0.45rem;
  color: var(--gold-bright);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

body.light-mode .vault-eyebrow,
body.duck-mode .vault-eyebrow {
  color: var(--volcanic-deep);
}

.vault-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.vault-hero-actions .nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  text-decoration: none;
}

.vault-sound-toggle {
  min-width: 7.2rem;
}

.maker-next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--adventure-border);
}

.maker-next-actions > a {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.saved-dragons-heading {
  display: flex;
  gap: 0.8rem;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.saved-dragons-heading h3 {
  margin: 0;
}

.saved-dragons-heading a {
  color: var(--gold-bright);
  font-size: 0.8rem;
  font-weight: 850;
  text-underline-offset: 0.2em;
}

.saved-dragons-heading a:focus-visible {
  border-radius: 5px;
  outline: 3px solid var(--focus-ring, var(--gold-bright));
  outline-offset: 3px;
}

body.light-mode .saved-dragons-heading a,
body.duck-mode .saved-dragons-heading a {
  color: var(--volcanic-deep);
}

.adventure-inline-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: center;
  margin-block: 1rem;
}

.adventure-inline-controls button,
.adventure-inline-controls a {
  min-height: 44px;
}

.vault-hero-emblem {
  position: relative;
  z-index: 1;
  display: grid;
  width: clamp(140px, 19vw, 220px);
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid var(--adventure-border-strong);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(251, 191, 36, 0.17), transparent 58%),
    var(--adventure-panel-soft);
  box-shadow:
    inset 0 0 0 10px rgba(251, 191, 36, 0.045),
    0 0 46px rgba(255, 107, 53, 0.14);
}

.vault-hero-emblem span {
  font-size: clamp(4rem, 10vw, 7rem);
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.3));
}

.vault-hero-emblem strong {
  position: absolute;
  bottom: 14%;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: var(--adventure-panel);
  color: var(--gold-bright);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
}

.vault-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.vault-summary-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.05rem 0.75rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--adventure-border);
  border-radius: 16px;
  background: var(--adventure-panel);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.17);
}

.vault-summary-icon {
  grid-row: 1 / 3;
  font-size: 1.75rem;
}

.vault-summary-card strong {
  color: var(--gold-bright);
  font-size: 1.75rem;
  line-height: 1;
}

body.light-mode .vault-summary-card strong,
body.duck-mode .vault-summary-card strong {
  color: var(--volcanic-deep);
}

.vault-summary-card > span:last-child {
  color: var(--adventure-muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.daily-challenge {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1.15rem 1.3rem;
  border-color: var(--adventure-border-strong);
  background:
    linear-gradient(110deg, rgba(251, 191, 36, 0.12), transparent 55%),
    var(--adventure-panel);
}

.daily-challenge-icon {
  display: grid;
  width: 3.25rem;
  height: 3.25rem;
  place-items: center;
  border-radius: 50%;
  background: rgba(251, 191, 36, 0.13);
  font-size: 1.65rem;
}

.daily-challenge h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

.daily-challenge-copy > p:not(.vault-eyebrow) {
  margin: 0.38rem 0 0;
  color: var(--adventure-muted);
}

.daily-challenge-reward {
  font-size: 0.85rem;
  font-weight: 800;
}

.daily-challenge-actions {
  display: grid;
  gap: 0.4rem;
  justify-items: stretch;
}

.daily-challenge-actions > .nav-btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.daily-complete-status {
  border-color: var(--adventure-border-strong);
  color: var(--gold-bright);
  cursor: default;
}

body.light-mode .daily-complete-status,
body.duck-mode .daily-complete-status {
  color: var(--volcanic-deep);
}

.vault-text-btn {
  min-height: 42px;
  padding: 0.45rem 0.75rem;
  border: 0;
  background: transparent;
  color: var(--adventure-muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.vault-text-btn:hover {
  color: var(--text-primary);
}

.vault-text-btn:focus-visible,
.vault-heading-link:focus-visible {
  border-radius: 7px;
  outline: 3px solid var(--focus-ring, var(--gold-bright));
  outline-offset: 3px;
}

.vault-section {
  padding: clamp(1rem, 3vw, 1.6rem);
  border: 1px solid var(--adventure-border);
  border-radius: 20px;
  background: var(--adventure-panel);
  box-shadow: var(--adventure-shadow);
}

.vault-section-heading {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.15rem;
}

.vault-section-heading h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  line-height: 1.08;
}

.vault-section-heading p:last-child {
  max-width: 64ch;
  margin: 0.45rem 0 0;
  color: var(--adventure-muted);
  line-height: 1.55;
}

.vault-section-heading-compact {
  align-items: center;
}

.vault-section-mark {
  display: grid;
  flex: 0 0 3rem;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border: 1px solid var(--adventure-border);
  border-radius: 50%;
  background: var(--adventure-panel-soft);
  color: var(--gold-bright);
  font-size: 1.35rem;
}

.vault-count-label {
  flex: 0 0 auto;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--adventure-border);
  border-radius: 999px;
  color: var(--adventure-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.vault-dragon-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.vault-dragon-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--adventure-border);
  border-radius: 17px;
  background: var(--adventure-raised);
  box-shadow: 0 13px 28px rgba(0, 0, 0, 0.2);
}

.vault-dragon-card.is-favourite {
  border-color: var(--adventure-border-strong);
  box-shadow: 0 13px 34px rgba(251, 191, 36, 0.12);
}

.vault-dragon-art {
  position: relative;
  display: grid;
  min-height: 180px;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 60%, var(--dragon-aura, rgba(251, 191, 36, 0.3)), transparent 58%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent);
}

.vault-dragon-art img {
  width: 100%;
  height: 190px;
  object-fit: contain;
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.35));
  transition: transform 180ms ease;
}

.vault-dragon-card:hover .vault-dragon-art img {
  transform: translateY(-3px) scale(1.025);
}

.vault-favourite-crown {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border: 1px solid var(--adventure-border-strong);
  border-radius: 50%;
  background: var(--adventure-panel);
  color: var(--gold-bright);
  font-size: 1.08rem;
}

.vault-dragon-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem;
}

.vault-dragon-name-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
}

.vault-dragon-name-row h3 {
  overflow-wrap: anywhere;
  margin: 0;
  color: var(--gold-bright);
  font-size: 1.35rem;
  line-height: 1.08;
}

body.light-mode .vault-dragon-name-row h3,
body.duck-mode .vault-dragon-name-row h3 {
  color: var(--volcanic-deep);
}

.vault-element-chip {
  flex: 0 0 auto;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--adventure-border);
  border-radius: 999px;
  color: var(--adventure-muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: capitalize;
}

.vault-dragon-description {
  overflow-wrap: anywhere;
  margin: 0;
  color: var(--adventure-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.vault-record-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.vault-record-stat {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
  padding: 0.5rem 0.38rem;
  border: 1px solid var(--adventure-border);
  border-radius: 10px;
  background: var(--adventure-panel-soft);
  text-align: center;
}

.vault-record-stat strong {
  color: var(--text-primary);
  font-size: 1.03rem;
}

.vault-record-stat span {
  overflow: hidden;
  color: var(--adventure-muted);
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.vault-title-control {
  display: grid;
  gap: 0.38rem;
  color: var(--adventure-muted);
  font-size: 0.75rem;
  font-weight: 850;
}

.vault-title-control select {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 2rem 0.55rem 0.65rem;
  border: 1px solid var(--adventure-border);
  border-radius: 10px;
  background: var(--adventure-panel);
  color: var(--text-primary);
  font: inherit;
}

.vault-title-control select:focus-visible {
  border-color: var(--adventure-border-strong);
  outline: 3px solid var(--focus-ring, var(--gold-bright));
  outline-offset: 2px;
}

.vault-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: auto;
}

.vault-action,
.vault-action-link {
  display: inline-flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.55rem;
  border: 1px solid var(--adventure-border);
  border-radius: 9px;
  background: var(--adventure-panel);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.vault-action:hover,
.vault-action-link:hover {
  border-color: var(--adventure-border-strong);
  background: var(--adventure-panel-soft);
}

.vault-action:focus-visible,
.vault-action-link:focus-visible {
  border-color: var(--adventure-border-strong);
  outline: 3px solid var(--focus-ring, var(--gold-bright));
  outline-offset: 2px;
}

.vault-action[aria-pressed="true"] {
  border-color: var(--adventure-border-strong);
  color: var(--gold-bright);
}

.vault-action:disabled {
  opacity: 0.62;
  cursor: wait;
}

body.light-mode .vault-action[aria-pressed="true"],
body.duck-mode .vault-action[aria-pressed="true"] {
  color: var(--volcanic-deep);
}

.vault-delete-action {
  color: var(--adventure-danger);
}

.vault-inline-empty,
.vault-empty-state {
  display: grid;
  justify-items: center;
  padding: 1.4rem;
  border: 2px dashed var(--adventure-border);
  border-radius: 15px;
  color: var(--adventure-muted);
  text-align: center;
}

.vault-inline-empty > span {
  color: var(--gold-bright);
  font-size: 2rem;
}

.vault-inline-empty p {
  max-width: 50ch;
  margin: 0.45rem 0 0;
  line-height: 1.55;
}

.vault-empty-state {
  padding: clamp(1.8rem, 5vw, 3.6rem);
  background:
    radial-gradient(circle at 50% 10%, rgba(251, 191, 36, 0.12), transparent 38%),
    var(--adventure-panel-soft);
}

.vault-empty-emblem {
  font-size: clamp(3rem, 8vw, 5.5rem);
}

.vault-empty-state h3 {
  margin: 0.75rem 0 0;
  color: var(--text-primary);
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.vault-empty-state p {
  max-width: 55ch;
  margin: 0.65rem 0 1rem;
  color: var(--adventure-muted);
  line-height: 1.6;
}

.vault-discovery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
  align-items: start;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.badge-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid var(--adventure-border);
  border-radius: 12px;
  background: var(--adventure-panel-soft);
}

.badge-card.is-locked {
  border-style: dashed;
}

.badge-card.is-locked .badge-icon {
  filter: saturate(0.15);
  opacity: 0.72;
}

.badge-icon {
  display: grid;
  width: 2.55rem;
  height: 2.55rem;
  place-items: center;
  border-radius: 50%;
  background: var(--adventure-panel);
  font-size: 1.3rem;
}

.badge-copy {
  min-width: 0;
}

.badge-copy strong,
.badge-copy span {
  display: block;
  overflow-wrap: anywhere;
}

.badge-copy strong {
  color: var(--text-primary);
  font-size: 0.86rem;
}

.badge-copy span {
  margin-top: 0.12rem;
  color: var(--adventure-muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.lore-list {
  display: grid;
  gap: 0.7rem;
}

.lore-card {
  position: relative;
  overflow: hidden;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--adventure-border);
  border-radius: 12px;
  background: var(--adventure-panel-soft);
}

.lore-card.is-discovered {
  border-color: var(--adventure-border-strong);
}

.lore-card h3 {
  overflow-wrap: anywhere;
  margin: 0;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.lore-card p {
  overflow-wrap: anywhere;
  margin: 0.35rem 0 0;
  color: var(--adventure-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.lore-state {
  display: inline-block;
  margin-bottom: 0.35rem;
  color: var(--gold-bright);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body.light-mode .lore-state,
body.duck-mode .lore-state {
  color: var(--volcanic-deep);
}

.lore-card.is-locked::after {
  position: absolute;
  top: 0.55rem;
  right: 0.65rem;
  color: var(--adventure-muted);
  content: '🔒';
  font-size: 0.86rem;
}

.records-list {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.record-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.8rem;
  border: 1px solid var(--adventure-border);
  border-radius: 12px;
  background: var(--adventure-panel-soft);
}

.record-result-icon {
  display: grid;
  width: 2.55rem;
  height: 2.55rem;
  place-items: center;
  border-radius: 50%;
  background: var(--adventure-panel);
  font-size: 1.2rem;
}

.record-item.is-win .record-result-icon {
  color: var(--gold-bright);
}

.record-copy {
  min-width: 0;
}

.record-copy strong,
.record-copy span {
  display: block;
  overflow-wrap: anywhere;
}

.record-copy strong {
  color: var(--text-primary);
  font-size: 0.9rem;
}

.record-copy span {
  margin-top: 0.15rem;
  color: var(--adventure-muted);
  font-size: 0.74rem;
}

.record-date {
  color: var(--adventure-muted);
  font-size: 0.7rem;
  text-align: right;
  white-space: nowrap;
}

.vault-heading-link {
  flex: 0 0 auto;
  color: var(--gold-bright);
  font-size: 0.86rem;
  font-weight: 900;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

body.light-mode .vault-heading-link,
body.duck-mode .vault-heading-link {
  color: var(--volcanic-deep);
}

.vault-toast {
  position: fixed;
  z-index: 10050;
  right: 1rem;
  bottom: 1rem;
  max-width: min(380px, calc(100vw - 2rem));
  padding: 0.85rem 1rem;
  border: 1px solid var(--adventure-border-strong);
  border-radius: 12px;
  background: var(--adventure-panel);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
  color: var(--text-primary);
  font-weight: 800;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translateY(1rem);
  transition: opacity 180ms ease, transform 180ms ease;
}

.vault-toast.is-visible,
.adventure-toast.is-visible,
.adventure-unlock-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.adventure-toast,
.adventure-unlock-toast {
  position: fixed;
  z-index: 10060;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  max-width: min(410px, calc(100vw - 2rem));
  padding: 0.85rem 1rem;
  border: 1px solid var(--adventure-border-strong);
  border-radius: 13px;
  background: var(--adventure-panel);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
  color: var(--text-primary);
  opacity: 0;
  pointer-events: none;
  transform: translateY(1rem);
  transition: opacity 180ms ease, transform 180ms ease;
}

.adventure-toast-stack {
  position: fixed;
  z-index: 10060;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  width: min(410px, calc(100vw - 2rem));
  gap: 0.65rem;
  pointer-events: none;
}

.adventure-toast-stack .adventure-toast {
  position: relative;
  right: auto;
  bottom: auto;
  width: 100%;
  max-width: none;
}

.adventure-toast-success {
  border-color: rgba(74, 222, 128, 0.66);
}

.adventure-toast-lore {
  border-color: rgba(196, 181, 253, 0.7);
}

.adventure-toast-error {
  border-color: rgba(251, 113, 133, 0.76);
}

.adventure-toast-icon {
  display: grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border: 1px solid var(--adventure-border);
  border-radius: 50%;
  background: var(--adventure-panel-soft);
  font-size: 1.2rem;
}

.adventure-toast-copy {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.4;
}

.vault-celebration {
  position: fixed;
  z-index: 10040;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.vault-celebration-spark {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  animation: vault-spark-burst 1100ms cubic-bezier(0.18, 0.72, 0.28, 1) forwards;
  transform: translate(-50%, -50%);
}

@keyframes vault-spark-burst {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.5);
  }
  to {
    opacity: 0;
    transform: translate(
      calc(-50% + var(--spark-x)),
      calc(-50% + var(--spark-y))
    ) rotate(var(--spark-r)) scale(1.35);
  }
}

.vault-dialog {
  width: min(500px, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid var(--adventure-border-strong);
  border-radius: 18px;
  background: var(--adventure-panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
  color: var(--text-primary);
}

.vault-dialog::backdrop {
  background: rgba(3, 5, 12, 0.78);
  backdrop-filter: blur(4px);
}

.vault-dialog form {
  padding: clamp(1.2rem, 4vw, 2rem);
}

.vault-dialog h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(1.5rem, 4vw, 2.1rem);
}

.vault-dialog form > p:not(.vault-eyebrow) {
  overflow-wrap: anywhere;
  margin: 0.75rem 0 0;
  color: var(--adventure-muted);
  line-height: 1.6;
}

.vault-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

.vault-button-secondary {
  background: var(--adventure-panel-soft);
}

.vault-danger-btn {
  border-color: rgba(251, 113, 133, 0.62);
  background: rgba(159, 18, 57, 0.25);
  color: #fff1f2;
}

body.light-mode .vault-danger-btn,
body.duck-mode .vault-danger-btn {
  color: #881337;
}

.vault-danger-btn:hover {
  border-color: #fda4af;
}

@media (max-width: 980px) {
  .vault-dragon-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vault-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vault-discovery-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .adventure-journey {
    gap: 0.25rem;
    padding: 0.5rem;
  }

  .adventure-journey a,
  .adventure-step {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 66px;
    padding: 0.5rem 0.3rem;
    text-align: center;
  }

  .adventure-step > span:first-child,
  .journey-step-number {
    grid-row: auto;
  }

  .adventure-journey small,
  .adventure-step > small {
    display: none;
  }

  .vault-hero {
    grid-template-columns: 1fr;
  }

  .vault-hero-emblem {
    display: none;
  }

  .daily-challenge {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .daily-challenge-actions {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .record-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .record-date {
    grid-column: 2;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .vault-page {
    gap: 1rem;
  }

  .vault-dragon-grid,
  .vault-summary-grid,
  .badge-grid {
    grid-template-columns: 1fr;
  }

  .vault-section-heading {
    align-items: flex-start;
  }

  .vault-section-mark {
    display: none;
  }

  .vault-hero-actions {
    display: grid;
  }

  .vault-hero-actions .nav-btn {
    width: 100%;
  }

  .vault-dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .adventure-journey a,
  .adventure-step,
  .vault-dragon-art img,
  .vault-toast,
  .adventure-toast,
  .adventure-unlock-toast {
    transition: none;
  }

  .adventure-journey a:hover,
  .vault-dragon-card:hover .vault-dragon-art img {
    transform: none;
  }

  .vault-celebration-spark {
    animation: none;
  }
}
