@font-face {
  font-family: 'Pixelta';
  src: url('/assets/brand/pixelta-regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'VT323';
  src: url('/assets/brand/vt323-regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --pixel-display: 'Pixelta', 'VT323', monospace;
  --pixel-body: 'VT323', monospace;
  color-scheme: dark;
  --ink: #111f29;
  --cream: #fff4d6;
  --muted: #bfced1;
  --gold: #f9cd79;
  --dark-gold: #a86237;
  --line: #36515a;
  font: 21px/1.35 var(--pixel-body);
  color: var(--cream);
  background: #0d191f;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 280px; margin: 0; }
button, a { touch-action: manipulation; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.topbar {
  min-height: 66px; position: relative; z-index: 2;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px max(4vw, 16px); background: #12252c;
  border-bottom: 2px solid #35535a;
}
.brand { display: flex; align-items: center; flex: 0 1 auto; }
.brand-logo { display: block; width: clamp(102px, 14vw, 136px); height: auto; object-fit: contain; }
.status { display: flex; align-items: center; gap: 13px; font: 400 18px/1.25 var(--pixel-body); }
.status span { white-space: nowrap; color: #a8e4d3; }
.status i { display: inline-block; width: 7px; height: 7px; background: #8bddac; box-shadow: 0 0 9px #70bfa8; }
.status button, .back, .destinations button { border: 1px solid var(--line); background: #172b31; padding: 9px 12px; }
.status button:hover, .back:hover, .destinations button:hover, .destinations button.active { background: #263d43; border-color: var(--gold); }
.gate {
  min-height: calc(100svh - 66px); display: grid; place-items: center start;
  padding: clamp(24px, 6vw, 92px);
  background: linear-gradient(90deg, #0b1a23b8, #12303a24 72%), url("assets/faith-isle-map.jpg") center / cover;
}
.gate-card {
  width: min(100%, 426px); padding: clamp(24px, 4vw, 46px);
  background: #142830f5; border: 2px solid #d9ad66;
  outline: 4px solid #0e2027a8; box-shadow: 9px 10px #0d2026a6;
}
.eyebrow { color: #9fdac8; font: 400 13px/1.35 var(--pixel-display); letter-spacing: .15em; }
h1 { margin: 0; font: 400 clamp(24px, 4vw, 44px)/1.12 var(--pixel-display); color: var(--gold); }
h1:focus { outline: none; }
.gate h1 { margin: 18px 0 24px; }
.gate h1 img { display: block; width: min(100%, 320px); height: auto; }
.gate p, .location p { color: var(--muted); }
.primary {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; padding: 14px 15px; border: 2px solid #ffe6a2; background: var(--gold);
  color: #271d16; font-weight: 850; box-shadow: 0 4px var(--dark-gold);
}
.primary:hover { background: #ffe3a2; }
.primary span[aria-hidden] { font-size: 20px; line-height: 1; }
.wallet-message { font-size: 17px; margin: 18px 0 8px; }
.gate a { color: #a8e4d3; font-size: 17px; }
.play-screen { width: min(96%, 1200px); margin: 0 auto; padding: clamp(17px, 3vw, 35px) 0 30px; }
.screen-heading { display: flex; align-items: end; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; margin-bottom: 14px; }
.screen-heading h1 { margin-top: 6px; }
#wallet-address { color: var(--muted); font: 18px var(--pixel-body); margin: 0; }
.map-frame { border: 2px solid #47646a; box-shadow: 0 5px #071015; max-width: min(100%, calc((100svh - 222px) * 1.777)); margin: auto; }
.map { display: block; width: 100%; height: auto; background: #096780; }
.hotspot { cursor: pointer; outline: none; }
.hit { fill: transparent; pointer-events: fill; }
.hotspot .effect { opacity: 0; transform-box: fill-box; transform-origin: bottom center; pointer-events: none; transition: opacity .16s, transform .23s; }
.hotspot.active .effect, .hotspot:focus-visible .effect { opacity: 1; transform: translateY(-7px) scale(1.012); }
.hotspot .outline { fill: none; stroke: #fff5bd; stroke-width: 4; stroke-linejoin: round; filter: drop-shadow(0 0 9px #ffe16e); }
.destinations { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 16px; }
.destinations button { font: 400 17px/1.25 var(--pixel-body); min-height: 42px; }
.location { max-width: 980px; }
.back { margin-bottom: 14px; }
.location-card { background: #14282f; border: 1px solid #47646a; box-shadow: 0 5px #071015; }
.location-card img { display: block; width: 100%; max-height: 54svh; object-fit: contain; background: #243a38; }
.location-copy { padding: clamp(20px, 4vw, 40px); }
.location-copy .eyebrow { color: #a1dac8; margin-top: 0; }
.location-copy p:last-child { margin-bottom: 0; }
/* Cloud artwork and vertical motion adapted from Swapnil Patil's MIT-licensed CloudAnimation. */
.clouds {
  position: fixed;
  z-index: 10;
  inset: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: none;
  --cloud-travel: 1000ms;
}
.cloud-cover {
  position: absolute;
  inset: 0;
  background: #f6faff;
  opacity: 0;
  transition: opacity calc(var(--cloud-travel) / 2) ease-out;
}
.clouds.cover .cloud-cover {
  opacity: 1;
  transition-delay: calc(var(--cloud-travel) / 2);
}
.cloud-bank {
  position: absolute;
  inset: -4% -12%;
  opacity: 0;
  transition: transform var(--cloud-travel) cubic-bezier(.4, 0, .2, 1),
    opacity var(--cloud-travel) cubic-bezier(.4, 0, .2, 1);
}
.cloud-bank-top { transform: translateY(-105%); }
.cloud-bank-bottom { transform: translateY(105%); }
.clouds.cover .cloud-bank {
  transform: translateY(0);
  opacity: 1;
  transition-timing-function: cubic-bezier(0, 0, .2, 1);
}
.cloud-bank::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    url("assets/cloud-transition/fog.webp") 49% 45% / max(46%, 32vh) auto no-repeat,
    url("assets/cloud-transition/cloud.webp") 8% 73% / max(51%, 47vh) auto no-repeat,
    url("assets/cloud-transition/cloud.webp") 93% 59% / max(56%, 52vh) auto no-repeat,
    url("assets/cloud-transition/cloud.webp") 49% 100% / max(54%, 55vh) auto no-repeat,
    url("assets/cloud-transition/fog.webp") 50% 105% / max(108%, 90vh) 67% no-repeat;
}
.cloud-bank-top::before { transform: rotate(180deg); }
@media (max-width: 660px) {
  .gate { place-items: end center; padding: 20px 18px 34px; background-position: 55% center; }
  .gate-card { padding: 24px; }
  .map-frame { max-width: 100%; }
  .play-screen { width: calc(100% - 24px); }
}
@media (prefers-reduced-motion: reduce) {
  .cloud-bank, .cloud-cover, .hotspot .effect { transition: none; }
  .hotspot.active .effect, .hotspot:focus-visible .effect { transform: none; }
}

#faith-wallet {
  color: var(--cream);
  width: min(100% - 24px, 460px);
  margin: auto;
  padding: clamp(16px, 5vw, 26px);
  border: 2px solid #d9ad66;
  background: #142830;
  box-shadow: 5px 6px #101818;
}
#faith-wallet::backdrop { background: #0a151bc2; }
.faith-heading { display: flex; align-items: center; gap: 10px; }
.faith-heading h2 { flex: 1; margin: 0; color: var(--gold); font: 400 23px var(--pixel-display); }
.faith-heading button, .faith-actions button { border: 1px solid #60807a; background: #253e42; min-height: 42px; padding: 7px 12px; }
.faith-heading img { image-rendering: pixelated; }
.faith-balances { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 16px 0; }
.faith-balances > div { background: #0e2028; padding: 9px; border: 1px solid var(--line); }
.faith-balances span, #faith-wallet label, #faith-wallet p { color: var(--muted); font-size: 18px; }
.faith-balances strong { display: block; overflow-wrap: anywhere; color: var(--gold); font: 400 23px var(--pixel-body); }
#faith-wallet input { width: 100%; display: block; margin: 5px 0 9px; padding: 9px; font: 20px var(--pixel-body); border: 1px solid #60807a; background: #0d1d24; color: var(--cream); }
.faith-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.faith-actions button:first-child { color: #261a12; background: var(--gold); }
#faith-receipt { color: #a8e4d3; }
.topbar .status { flex-wrap: wrap; justify-content: flex-end; }

#breeding { margin-top: 20px; }
.breed-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
#breed-balance { margin-inline-start: auto; color: var(--gold); }
.breed-slots, .breed-stages { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-bottom: 12px; }
.breed-slot, .breed-stages div, #breed-result { border: 1px solid var(--line); background: #0f2028; padding: 11px; min-width: 0; }
.breed-slot label, .breed-stages span { display: block; color: var(--muted); }
.breed-stages strong, #breed-result h2 { color: var(--gold); }
#breeding input, #breeding select { color: var(--cream); border: 1px solid #617a76; background: #142830; min-width: 0; padding: 9px; font: 20px var(--pixel-body); }
.breed-slot :is(select,input) { width: 100%; margin-top: 4px; }
#breed-action { margin: 12px 0; max-width: 360px; }
#breed-result ul { display: grid; gap: 4px; margin-bottom: 0; padding-left: 20px; }
@media (max-width: 360px) { .breed-slots { grid-template-columns: 1fr; } }
.breed-parent { display: flex; align-items: center; gap: 9px; margin: 10px 0 0; min-width: 0; }
.breed-parent img { object-fit: contain; image-rendering: pixelated; }
.breed-parent figcaption { color: var(--gold); overflow-wrap: anywhere; }

.breeding-location { max-width: 1240px; }
.breeding-location .location-card {
  background: linear-gradient(#191316df,#191317f7), url("assets/breeding.webp") center / cover;
  color: #edddc1;
  border-color: #78523b;
}
.breeding-location .location-copy { padding: clamp(14px,3vw,34px); }
.breeding-location .eyebrow { color: #eab477; }
.breed-toolbar { border-bottom: 1px solid #735039; padding-bottom: 12px; }
#breed-treasury { color: #a6d3b5; font: 17px var(--pixel-body); }
#breeding .breed-slots { grid-template-columns: minmax(0,1fr) minmax(0,1.44fr) minmax(0,1fr); gap: clamp(6px,1.15vw,14px); }
#breeding .breed-slot, .breed-wheel, #breeding .breed-stages div {
  border: 1px solid #856044;
  background: radial-gradient(ellipse at center,#42291f,#251a1b 82%);
  box-shadow: inset 0 0 0 3px #21171a;
}
#breeding .breed-slot { padding: clamp(7px,1.7vw,16px); }
#breeding .breed-slot label, .breed-wheel h2 {
  color: #f5ca83;
  font: 400 clamp(12px,2vw,20px)/1.25 var(--pixel-display);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.breed-wheel { text-align: center; padding: 10px; border-color: #b47e4e; }
.breed-wheel h2 { margin: 1px 0 6px; }
#breeding .breed-wheel img { width: min(100%,360px); height: auto; background: transparent; margin: auto; }
.breed-wheel progress { width: 100%; height: 8px; display: block; accent-color: #f2b66f; }
#breeding .breed-wheel p { margin: 5px 0; font-size: 17px; }
#breeding .breed-parent { display: grid; justify-items: center; text-align: center; }
#breeding .breed-parent img { width: min(100%,185px); height: clamp(104px,17vw,208px); background: transparent; object-fit: contain; }
.breed-stages .current { border-color: #e3a663 !important; }
.breed-composite { position: relative; aspect-ratio: 1; width: min(100%,220px); margin: 8px auto; }
#breed-result .breed-composite img { position: absolute; inset: 0; width: 100%; height: 100%; background: transparent; image-rendering: pixelated; }
@media (max-width: 580px) {
  #breeding .breed-slots { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .breed-wheel { grid-row: 2; grid-column: 1 / -1; }
  #breeding .breed-wheel img { width: min(86%,240px); }
  #breeding input, #breeding select { font-size: 18px; width: 100%; }
}

.topbar .status { row-gap: 6px; }
.nav-count { white-space: nowrap; border: 1px solid #486561; padding: 5px 8px; }
.nav-count span { color: #d0c3a9; }
.nav-count strong, #faith-open strong { color: var(--gold); }
#faith-open { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
#faith-open img { image-rendering: pixelated; object-fit: contain; }
@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; gap: 8px; }
  .topbar .status { width: 100%; justify-content: flex-start; column-gap: 7px; }
  .topbar .status button { padding: 6px 8px; }
}

:is(h1, h2, h3, h4, h5, h6, .eyebrow, .primary, .back) {
  font-family: var(--pixel-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .04em;
}
:is(.primary, .back) { font-size: clamp(12px, 2.2vw, 15px); }
button, input, select, textarea { font-family: var(--pixel-body); }
.primary, .back { font-family: var(--pixel-display); }

#breed-weekly { color: var(--gold); margin: 12px 0; }
#breed-queue { margin: 12px 0; }
#breed-job-list { list-style: none; padding: 0; display: grid; gap: 8px; }
#breed-job-list li { padding: 9px 12px; border: 1px solid var(--line); background: #182e30; }
#breed-job-list li p { margin: 0; }
#breed-job-list li button { margin: 6px 0 0; }

#breed-next-step { scroll-margin-block: 95px 20px; }
#breed-next-step:focus { outline: none; }
#breed-faith-activity { margin: 10px 0; padding: 7px 9px; border: 1px solid var(--line); }
#breed-faith-activity summary { cursor: pointer; }
#breed-faith-activity-list { margin: 5px 0; padding-left: 21px; }

#breed-status:empty { display: none; }
#breed-chain-tx-status { color: var(--gold); }
