/* Journey v2 screens (01/12): strip messages of the continuous camp, the "joined" card, the camp's end, the travel
   pick, the journey map, the finale, the camp grid and the deck pick. Panels use the one panel frame (panel.js). */

/* ---- strip: "Wave cleared! ★★☆ +34" */
#banner > span {
  display: flex;
  align-items: center;
  gap: 0.3em;
}
/* the plate's lit rim on top is frame, not face: its text sits 1u lower (ruler: -1 to -2 px before) */
#banner > span,
#recallTip > span {
  translate: 0 calc(var(--u) * 1);
}
#banner .st {
  width: 0.95em;
  height: 0.95em;
  display: block;
  margin: 0 -0.08em;
}
#banner .st:first-of-type {
  margin-left: 0.2em;
}
#banner .coin {
  display: inline-flex;
  align-items: center;
  gap: 0.15em;
  font-style: normal;
  color: var(--gold);
  margin-left: 0.25em;
}
#banner .coin .ic {
  width: 0.95em;
  height: 0.95em;
}
#repairBtn .cost.poor b {
  color: #ff9e8a;
}

/* ---- "X joined the camp!": top-left of the field, never takes a tap, never pauses */
#joinCard {
  position: fixed;
  z-index: 30;
  left: 10px;
  top: calc(var(--field-top, 90px) + 6px);
  display: none;
  align-items: center;
  gap: calc(var(--u) * 6);
  padding: calc(var(--u) * 4) calc(var(--u) * 12) calc(var(--u) * 4) calc(var(--u) * 4);
  border-radius: calc(var(--u) * 12);
  background: rgba(18, 34, 40, 0.92);
  border: 2px solid #4fe39b;
  color: #fff;
  box-shadow: 0 calc(var(--u) * 3) 0 rgba(0, 0, 0, 0.25);
  pointer-events: none;
  max-width: calc(100vw - 20px);
}
#joinCard.on {
  display: flex;
  animation: lookIn 260ms cubic-bezier(0.3, 1.5, 0.5, 1) both;
}
#joinCard.on:enabled {
  pointer-events: auto;
  cursor: pointer;
}
#joinCard.on:enabled b {
  white-space: normal;
  text-align: left;
}
#joinCard .pic {
  flex: none;
  width: calc(var(--u) * 46);
  height: calc(var(--u) * 46);
  background: center bottom / contain no-repeat;
}
#joinCard b {
  color: #9ff5c8;
  font-size: calc(var(--u) * 15);
  font-weight: 600;
  white-space: nowrap;
  padding-top: var(--cap);
}

/* ---- the journey grid: camp name, total stars, 10 waves in 2 rows of 5 (the boss marked on the 10th), one action */
.panel[data-id='levels'] .worlds {
  display: grid;
  grid-template-columns: var(--touch) minmax(0, 1fr) var(--touch);
  gap: calc(var(--u) * 7);
}
.panel[data-id='levels'] .wname {
  min-width: 0;
  max-width: none;
  white-space: normal;
  line-height: 1.14;
  font-size: calc(var(--u) * 16);
  overflow-wrap: anywhere;
}
.panel[data-id='levels'] .camp-actions {
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 5);
}
.panel[data-id='levels'] .camp-actions > .btn {
  width: 100%;
}
.panel[data-id='levels'] .camp-actions > .warn {
  font-size: calc(var(--u) * 14);
  min-height: 44px;
  border: 1px solid #916548;
  border-radius: 9px;
  background: #233944;
  padding: 4px 10px;
}
.panel[data-id='levels'] .camp-actions > .warn > span {
  translate: none;
}
.panel .sttot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  margin: 0 0 calc(var(--u) * 8);
  color: var(--gold);
  font-size: calc(var(--u) * 15);
}
.panel .sttot .ic {
  width: 1.1em;
  height: 1.1em;
}
.panel .sttot b {
  padding-top: var(--cap);
  white-space: nowrap;
}
.lvl.boss {
  box-shadow: inset 0 0 0 calc(var(--u) * 2) rgba(255, 196, 92, 0.55);
  border-radius: calc(var(--u) * 10);
}
.lvl .bossmk {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  top: calc(var(--u) * -13);
  width: calc(var(--u) * 24);
  height: calc(var(--u) * 24);
  object-fit: contain;
  filter: drop-shadow(0 calc(var(--u) * 1) calc(var(--u) * 1) rgba(6, 16, 20, 0.6));
}
.lvl.locked .bossmk {
  filter: grayscale(1) brightness(0.7);
}
.panel[data-id='levels'] .btns {
  margin-top: calc(var(--u) * 10);
}
.panel[data-id='levels'] .btns > p {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: calc(var(--u) * 13);
}

/* ---- the camp's card: the 10 waves with their stars */
.waves {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: calc(var(--u) * 4) calc(var(--u) * 6);
  margin: calc(var(--u) * 4) 0;
}
.waves .wv {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-style: normal;
  padding: calc(var(--u) * 2) 0;
  border-radius: calc(var(--u) * 7);
  background: rgba(8, 20, 26, 0.35);
}
.waves .wv.boss {
  box-shadow: inset 0 0 0 calc(var(--u) * 1.5) rgba(255, 196, 92, 0.6);
}
.waves small {
  font-size: calc(var(--u) * 11);
  color: var(--muted);
  padding-top: var(--cap);
}
.waves .st {
  display: flex;
  gap: 1px;
}
.waves .st img {
  width: calc(var(--u) * 13);
  height: calc(var(--u) * 13);
}
.panel .big-line {
  white-space: nowrap;
  text-align: center;
}
/* a panel never sits under the joined card */
body:has(#modal.on, #stage:not([data-screen='battle'])) #joinCard {
  display: none;
}

/* ---- travel pick and deck pick: hero tiles, the picked ones lit and checked */
.tgrid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(var(--u) * 6);
  margin: calc(var(--u) * 6) 0;
}
.htile {
  position: relative;
  flex: 0 0 calc(var(--u) * 84);
  height: calc(var(--u) * 104);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 0 calc(var(--u) * 4);
  border-radius: calc(var(--u) * 10);
  background: rgba(8, 20, 26, 0.45);
  box-shadow: inset 0 0 0 calc(var(--u) * 1.5) rgba(255, 255, 255, 0.08);
  transition:
    transform 120ms,
    box-shadow 120ms;
}
.htile .pic {
  position: absolute;
  left: 4%;
  right: 4%;
  top: calc(var(--u) * 4);
  bottom: calc(var(--u) * 20);
  background: center bottom / contain no-repeat;
}
.htile small {
  position: relative;
  font-size: calc(var(--u) * 12);
  white-space: nowrap;
  padding-top: var(--cap);
}
.htile .badge {
  position: absolute;
  left: calc(var(--u) * 3);
  top: calc(var(--u) * 3);
  width: calc(var(--u) * 20);
  height: calc(var(--u) * 20);
}
.htile .badge img {
  display: block;
  width: 100%;
  height: 100%;
}
.htile .badge b {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--u) * 11);
  line-height: 1;
  padding-top: var(--cap);
}
.htile .check {
  position: absolute;
  right: calc(var(--u) * 3);
  top: calc(var(--u) * 3);
  width: calc(var(--u) * 20);
  height: calc(var(--u) * 20);
  opacity: 0;
  scale: 0.6;
  transition:
    opacity 120ms,
    scale 160ms cubic-bezier(0.3, 1.6, 0.5, 1);
}
.htile .check img {
  width: 100%;
  height: 100%;
  display: block;
}
.htile.on {
  box-shadow:
    inset 0 0 0 calc(var(--u) * 2.5) #4fe39b,
    0 0 calc(var(--u) * 10) rgba(79, 227, 155, 0.35);
  background: rgba(30, 90, 64, 0.45);
  transform: translateY(calc(var(--u) * -2));
}
.htile.on .check {
  opacity: 1;
  scale: 1;
}
.tgrid.deck .htile {
  flex-basis: calc(var(--u) * 80);
}
/* ---- the journey map: the whole map always (contain), the road walked in dots, the 5 camps, the caravan */
#jmap {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 10);
  background: rgba(10, 18, 22, 0.86);
  pointer-events: auto;
  animation: mapIn 260ms ease-out both;
  padding: calc(var(--u) * 8);
}
@keyframes mapIn {
  from {
    opacity: 0;
  }
}
#jmap .mwrap {
  width: 100%;
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  justify-content: center;
}
#jmap .mbox {
  position: relative;
  width: min(100%, calc((100dvh - var(--u) * 150) * 1672 / 941));
  aspect-ratio: 1672 / 941;
  border-radius: calc(var(--u) * 12);
  overflow: hidden;
  box-shadow:
    0 0 0 calc(var(--u) * 3) #1b2a33,
    0 calc(var(--u) * 6) calc(var(--u) * 18) rgba(0, 0, 0, 0.45);
}
#jmap .map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#jmap .dot,
#jmap .pin {
  position: absolute;
  translate: -50% -50%;
  pointer-events: none;
}
#jmap .dot {
  width: 1.4%;
}
#jmap .pin {
  width: 6.5%;
  translate: -50% -92%;
  filter: grayscale(0.7) brightness(0.75);
}
#jmap .pin.won {
  filter: none;
}
#jmap .pin.next {
  filter: none;
  animation: pinHop 1.4s ease-in-out infinite;
}
@keyframes pinHop {
  50% {
    translate: -50% -104%;
  }
}
#jmap .caravan-piece {
  position: absolute;
  translate: -50% -97%;
  pointer-events: none;
  background-image: url(../assets/journey/caravan-0.webp);
  background-repeat: no-repeat;
}
#jmap .travel-step .caravan-piece {
  background-image: url(../assets/journey/caravan-1.webp);
}
#jmap .minfo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--u) * 6);
  text-align: center;
}
#jmap h2 {
  margin: 0;
  font-size: calc(var(--u) * 22);
  white-space: nowrap;
  padding-top: var(--cap);
}
#jmap .join {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 6);
  margin: 0;
  font-size: calc(var(--u) * 15);
  color: #9ff5c8;
}
#jmap .join .pic {
  width: calc(var(--u) * 40);
  height: calc(var(--u) * 40);
  background: center bottom / contain no-repeat;
}
#jmap .btns {
  width: min(80vw, calc(var(--u) * 260));
  opacity: 0.45;
  transition: opacity 200ms;
}
#jmap.arrived .btns {
  opacity: 1;
}
#jmap .btns .btn {
  width: 100%;
}
.calm #jmap .pin.next {
  animation-name: none !important;
}
@media (min-aspect-ratio: 4/3) and (max-height: 500px) {
  #jmap {
    flex-direction: row;
    gap: 10px;
    padding: 6px 10px;
  }
  #jmap .mbox {
    width: min(calc(100vw - 230px), calc((100dvh - 14px) * 1672 / 941));
  }
  #jmap .minfo {
    width: 200px;
    flex: none;
  }
  #jmap h2 {
    font-size: 17px;
    white-space: normal;
  }
  #jmap .btns {
    width: 100%;
  }
}

/* ---- the finale: the 8 heroes together */
.team {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: calc(var(--u) * 86);
  margin: calc(var(--u) * 4) 0;
}
.team .fh {
  flex: none;
  width: calc(var(--u) * 58);
  height: 100%;
  margin: 0 calc(var(--u) * -6);
  background: center bottom / contain no-repeat;
  animation: teamIn 360ms cubic-bezier(0.3, 1.5, 0.5, 1) calc(var(--i) * 70ms) backwards;
}
@keyframes teamIn {
  from {
    translate: 0 calc(var(--u) * 14);
    opacity: 0;
  }
}

/* ---- heroes panel: the 3 of block 2, a silhouette until they join */
.hcard .joins {
  margin: 0;
  font-size: calc(var(--u) * 11);
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}

/* ---- defeat and pause (01/12): wider and lower. Text on top, compact; the main action big; the other ways out in ONE row
   of tiles, icon over its word (portrait: 2 x 2). The tile is the same lipped button art: --bt/--bb, the group (icon +
   word) centers on its face like every button (css/base.css) */
.panel .acts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: calc(var(--u) * 6);
  margin-top: calc(var(--u) * 6);
}
/* landscape: one row, each tile as wide as its word needs (a long "Restart camp" gets more room, never a tiny word) */
@media (min-aspect-ratio: 4/3) {
  .panel .acts {
    display: flex;
  }
  .panel .acts > .btn.tile {
    flex: 1 1 auto;
    width: auto;
  }
}
.btn.tile {
  --bt: calc(var(--u) * 10);
  --bb: calc(var(--u) * 13);
  width: 100%;
  min-width: 0;
  height: calc(var(--u) * 62);
  padding: 0 calc(var(--u) * 4);
  border-width: var(--bt) calc(var(--u) * 12) var(--bb);
  font-size: calc(var(--u) * 13);
}
.btn.tile > span {
  flex-direction: column;
  gap: calc(var(--u) * 2);
}
.btn.tile .ic {
  width: calc(var(--u) * 24);
  height: calc(var(--u) * 24);
}
.btn.tile b {
  max-width: 100%;
}
.panel .btns.main {
  margin-top: calc(var(--u) * 6);
}
.panel .btns.main.two {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  align-items: center;
}
.panel .btns.main .btn.lite {
  height: max(44px, calc(var(--u) * 44));
  font-size: calc(var(--u) * 14);
  --bt: calc(var(--u) * 10);
  --bb: calc(var(--u) * 12);
  border-width: var(--bt) calc(var(--u) * 12) var(--bb);
}
.panel[data-id='defeat'] .info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--u) * 6);
}
.panel[data-id='defeat'] .txt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--u) * 3);
  text-align: center;
}
.panel[data-id='defeat'] .txt p {
  margin: 0;
  font-size: calc(var(--u) * 14);
  line-height: 1.25;
}
.panel[data-id='defeat'] .txt .kept {
  color: var(--muted);
  font-size: calc(var(--u) * 12);
}
.panel[data-id='defeat'] .txt .hn {
  color: var(--text);
  font-size: calc(var(--u) * 13);
}
.panel[data-id='defeat'] .txt .coinline {
  margin: 0;
}
.panel[data-id='defeat'] .lesson .ground {
  width: calc(var(--u) * 150);
  height: calc(var(--u) * 112);
  border-width: calc(var(--u) * 5);
}
/* portrait: the 4 tiles in 2 x 2, "without reinforcement" right under "Try again" */
@media (max-aspect-ratio: 4/3) {
  .panel .acts:has(> :nth-child(4)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .panel .acts:has(> :nth-child(3):last-child) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .btn.tile {
    height: calc(var(--u) * 56);
  }
  .panel .btns.main.two {
    grid-template-columns: minmax(0, 1fr);
  }
  .panel .btns.main.two .btn.lite {
    justify-self: center;
    width: 78%;
  }
}
/* landscape: wider card, the drawing left of the text */
@media (min-aspect-ratio: 4/3) {
  .panel.wide[data-id='defeat'] {
    width: min(100%, calc(var(--u) * 600));
  }
  .panel.wide[data-id='pause'] {
    width: min(100%, calc(var(--u) * 560));
  }
  .panel[data-id='defeat'] .info {
    flex-direction: row;
    justify-content: center;
    gap: calc(var(--u) * 14);
  }
  .panel[data-id='defeat'] .info:has(.lesson) .txt {
    align-items: flex-start;
    text-align: left;
  }
}
/* ---- one hero portrait (src/ui/hero-pic.js): the box holds the hero's body at one size; the image is placed by its
   manifest `fit` (feet line, body height, body center). Weapons and plumes may stick out of the box, never cut */
.hbox {
  position: relative;
  overflow: visible;
  background-image: none !important;
}
.card .pic.hbox {
  overflow: visible;
}
.hbox > img.hp {
  position: absolute;
  display: block;
  width: auto;
  max-width: none;
  pointer-events: none;
}
.hcard .looks i.hbox {
  position: relative;
  overflow: hidden;
}
.hcard .looks i.hbox > img.hp {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2px;
  box-sizing: border-box;
}
.hcard.soon .pic > img.hp {
  filter: brightness(0) opacity(0.5);
}

/* ---- heroes panel, redrawn (01/12, "everything is small"): the portrait leads (body ~half the card), the short name
   big, the 5 looks as real thumbnails with the color of their step (2 crimson, 3 purple, 4 teal, 5 gold), unseen ones
   in silhouette. Portrait: 2 columns, the looks in one row of 5. Landscape: 4 columns */
.hgrid {
  --cols: 2;
}
.hcard > h3 {
  font-size: calc(var(--u) * 16);
  text-align: center;
} /* the short name (<= 10 letters, i18n-check): never shrunk by fit.js (a hero picture sticking out of the card fooled it) */
.hcard .pic {
  height: calc(var(--u) * 104);
}
.hcard .looks {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: calc(var(--u) * 3);
  margin: calc(var(--u) * 2) 0;
}
.hcard .looks i {
  width: auto;
  height: calc(var(--u) * 30);
  margin: 0;
  border-radius: calc(var(--u) * 6);
  background-color: rgba(8, 20, 26, 0.45) !important;
  box-shadow: inset 0 0 0 1px var(--ring, rgba(255, 255, 255, 0.15));
}
.hcard .looks i.lv2 {
  --ring: #bd2a42;
}
.hcard .looks i.lv3 {
  --ring: #8644b2;
}
.hcard .looks i.lv4 {
  --ring: #20949e;
}
.hcard .looks i.lv5 {
  --ring: #e8b53a;
}
.hcard .looks i.no {
  filter: none;
}
.hcard .looks i.no > img.hp {
  filter: brightness(0) invert(0.55) opacity(0.44);
}
.hcard .stats {
  font-size: calc(var(--u) * 16);
  gap: calc(var(--u) * 9);
} /* a gray silhouette: readable on the dark box */
.hcard .looks i.lv1 {
  --ring: transparent;
} /* the game's level code: level 1 has no rim */
/* the hero picture may stick out of its box, never out of the card (fit.js reads the card's width: no overflow there) */
.hcard {
  overflow: clip;
  overflow-clip-margin: calc(var(--u) * 6);
}
.hcard .btn {
  height: calc(var(--u) * 40);
}
@media (max-aspect-ratio: 4/3) and (max-height: 720px) {
  .hcard .pic {
    height: calc(var(--u) * 84);
  }
  .hcard .looks i {
    height: calc(var(--u) * 26);
  }
}
@media (min-aspect-ratio: 4/3) {
  .hgrid,
  .hgrid:has(> .hcard:nth-child(6)) {
    --cols: 4;
  }
  .panel.wide[data-id='heroes'] {
    width: min(100%, calc(var(--u) * 640));
  }
  .hcard .pic {
    height: calc(var(--u) * 92);
  }
  .hcard .looks i {
    height: calc(var(--u) * 26);
  }
}
/* the hand card's window: a long spear may pass over the name band, like hats (never cut) */
.card .win {
  overflow: visible;
}

/* ---- group H (01/12) */
/* H80: the boss card: the boss's silhouette lights up, then its name comes in */
#bossCard {
  flex-direction: row;
  gap: calc(var(--u) * 8);
}
#bossCard .bpic {
  width: calc(var(--u) * 34);
  height: calc(var(--u) * 34);
  object-fit: contain;
}
#bossCard.reveal .bpic {
  animation: bossReveal 0.9s ease-out both;
}
#bossCard.reveal > span {
  animation: bossName 0.9s ease-out both;
}
@keyframes bossReveal {
  0%,
  35% {
    filter: brightness(0);
  }
  100% {
    filter: none;
  }
}
@keyframes bossName {
  0%,
  45% {
    opacity: 0;
    translate: calc(var(--u) * -6) 0;
  }
  100% {
    opacity: 1;
    translate: 0 0;
  }
}
/* H91: the hourglass turns once a second */
#waveIn .ic.turn {
  animation: glassTurn 0.45s cubic-bezier(0.4, 0, 0.3, 1);
}
@keyframes glassTurn {
  from {
    rotate: -180deg;
  }
}
/* H85: the boss head on the 10th wave of the grid breathes */
.lvl:not(.locked) .bossmk {
  animation: bossBob 2.4s ease-in-out infinite;
}
@keyframes bossBob {
  50% {
    translate: -50% calc(var(--u) * -2);
    rotate: -4deg;
  }
}
.calm .lvl .bossmk {
  animation-name: none !important;
}
/* H78: the travelers by the caravan, and its dust */
#jmap .walker {
  position: absolute;
  width: 5.2%;
  height: 10%;
  translate: -50% -100%;
  z-index: 3;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35));
}
#jmap .dust {
  position: absolute;
  width: 4.5%;
  translate: -50% -70%;
  z-index: 2;
  transition: opacity 0.3s;
  pointer-events: none;
}

/* phone landscape: under the strip of the left column (never over "Wave cleared!") */
@media (min-aspect-ratio: 4/3) and (max-height: 500px) {
  #joinCard {
    top: 96px;
    max-width: min(260px, calc(var(--field-left, 270px) - 14px));
  }
  #joinCard b {
    font-size: 12px;
    white-space: normal;
  }
}
/* End of journey.css */
/* regra-chefes: travelling heroes arrive one level lower: the arrival level beside the badge, and the line that says why */
.htile .arrive {
  position: absolute;
  left: calc(var(--u) * 24);
  top: calc(var(--u) * 4);
  font-style: normal;
  font-weight: 700;
  font-size: calc(var(--u) * 12);
  line-height: 1;
  padding: calc(var(--u) * 3) calc(var(--u) * 5) calc(var(--u) * 2);
  border-radius: calc(var(--u) * 6);
  background: rgba(10, 20, 26, 0.78);
  color: #ffd66b;
}
[data-id='travel'] p.tired,
#jmap p.tired {
  color: #ffd66b;
  font-size: 0.9em;
  margin-top: 0;
}
/* the weather band (src/ui/alerts.js): its icon before the line; wind turns the icon to where it blows */
#banner .wx {
  flex: none;
  width: 1.9em;
  height: 1.9em;
  margin: -0.35em 0.35em -0.35em 0;
  object-fit: contain;
}
#banner.long .wx {
  width: 2.4em;
  height: 2.4em;
}
#banner > span:has(.wx) {
  display: flex;
  align-items: center;
  text-align: left;
}
/* item 58: "New enemy!" card, top-right of the field (the "joined" card owns the left); never takes a tap, never pauses */
#foeCard {
  position: fixed;
  z-index: 30;
  right: 10px;
  top: calc(var(--field-top, 90px) + 6px);
  display: none;
  align-items: center;
  gap: calc(var(--u) * 6);
  width: min(calc(var(--u) * 250), calc(100vw - 20px));
  padding: calc(var(--u) * 5) calc(var(--u) * 10) calc(var(--u) * 5) calc(var(--u) * 5);
  border-radius: calc(var(--u) * 12);
  background: rgba(18, 34, 40, 0.92);
  border: 2px solid #ffb347;
  color: #fff;
  box-shadow: 0 calc(var(--u) * 3) 0 rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
#foeCard.on {
  display: flex;
  animation: lookIn 260ms cubic-bezier(0.3, 1.5, 0.5, 1) both;
}
#foeCard .pic {
  flex: none;
  width: calc(var(--u) * 48);
  height: calc(var(--u) * 40);
  object-fit: contain;
}
#foeCard span {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}
#foeCard small {
  color: #ffcf7a;
  font-size: calc(var(--u) * 11);
  font-weight: 600;
  padding-top: var(--cap);
}
#foeCard b {
  font-size: calc(var(--u) * 15);
  font-weight: 700;
}
#foeCard p {
  margin: 0;
  font-size: calc(var(--u) * 11.5);
  color: #d9e6ea;
}
@media (max-width: 600px) {
  #foeCard {
    max-width: min(240px, 62vw);
    padding: 5px 8px;
    gap: 6px;
  }
  #foeCard .pic {
    width: 27px;
    height: 23px;
  }
  #foeCard small {
    font-size: 10px;
  }
  #foeCard b {
    font-size: 13px;
  }
  #foeCard p {
    font-size: 11px;
  }
  body:has(#banner.show, #bossCard.show, #bossBar.show) #foeCard {
    visibility: hidden;
  }
}
body:has(#modal.on) #foeCard {
  display: none;
}
@media (min-aspect-ratio: 4/3) and (max-height: 500px) {
  #foeCard {
    top: 96px;
    width: min(250px, calc(100vw - var(--field-right, 575px) - 14px));
  }
}
.calm #foeCard.on {
  animation-duration: 1ms;
}
/* items 81/82 on the camp's card: the journey's star counter, the chest beside the coins, what flies between them */
.panel .sttot.vst {
  margin: calc(var(--u) * 2) 0 calc(var(--u) * 4);
}
.panel .payrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 8);
}
.panel .payrow .vchest {
  width: calc(var(--u) * 56);
  height: calc(var(--u) * 52);
  object-fit: contain;
  object-position: bottom;
}
.vfly {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  pointer-events: none;
}
/* item 64: the camp flag panel (reference design the design notes): the chosen flag big on the left, 3 x 2
   grid on the right; portrait: the flag on top, 2 x 3 grid. A tap chooses; locked ones: lock + stars */
.panel .strow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--u) * 12);
  flex-wrap: wrap;
  margin-bottom: calc(var(--u) * 6);
}
.panel .strow .sttot {
  margin: 0;
}
.panel .strow .btn {
  --bt: calc(var(--u) * 8);
  --bb: calc(var(--u) * 10);
  height: max(44px, calc(var(--u) * 40));
  font-size: calc(var(--u) * 13);
  padding: 0 calc(var(--u) * 6);
}
.panel .strow .btn .ic {
  width: calc(var(--u) * 20);
  height: calc(var(--u) * 24);
  object-fit: contain;
}
.fwrap {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 14);
}
.fprev {
  flex: none;
  width: calc(var(--u) * 120);
  display: flex;
  justify-content: center;
}
.fprev .fbig {
  width: 100%;
  height: calc(var(--u) * 150);
  object-fit: contain;
  filter: drop-shadow(0 calc(var(--u) * 4) calc(var(--u) * 3) rgba(0, 0, 0, 0.35));
}
.fgrid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(var(--u) * 8);
}
.ftile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--u) * 2);
  min-height: 44px;
  padding: calc(var(--u) * 6) calc(var(--u) * 4);
  border: 0;
  border-radius: calc(var(--u) * 10);
  background: rgba(8, 20, 26, 0.45);
  box-shadow: inset 0 0 0 calc(var(--u) * 1.5) rgba(255, 255, 255, 0.12);
  color: #fff;
  font: inherit;
  cursor: pointer;
}
.ftile .fl {
  height: calc(var(--u) * 58);
  width: 100%;
  object-fit: contain;
}
.ftile b {
  font-size: calc(var(--u) * 13);
  padding-top: var(--cap);
  white-space: nowrap;
}
.ftile small {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 2);
  color: var(--gold);
  font-size: calc(var(--u) * 12);
  font-weight: 700;
}
.ftile small .ic {
  width: calc(var(--u) * 14);
  height: calc(var(--u) * 14);
}
.ftile.locked {
  cursor: default;
}
.ftile.locked .fl {
  filter: grayscale(0.85) brightness(0.6);
}
.ftile.locked b {
  color: #9fb3bd;
}
.ftile.on {
  box-shadow: inset 0 0 0 calc(var(--u) * 2.5) #4fe39b;
  background: rgba(30, 90, 64, 0.45);
}
.ftile .check {
  position: absolute;
  right: calc(var(--u) * 4);
  top: calc(var(--u) * 4);
  width: calc(var(--u) * 20);
  height: calc(var(--u) * 20);
}
.ftile .check img {
  width: 100%;
  height: 100%;
  display: block;
}
@media (max-aspect-ratio: 4/3) {
  .fwrap {
    flex-direction: column;
    gap: calc(var(--u) * 6);
  }
  .fprev .fbig {
    height: calc(var(--u) * 96);
  }
  .fgrid {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-aspect-ratio: 4/3) and (max-height: 500px) {
  .fprev {
    width: calc(var(--u) * 80);
  }
  .fprev .fbig {
    height: calc(var(--u) * 110);
  }
  .ftile .fl {
    height: calc(var(--u) * 40);
  }
}
/* H86: the finale's ring around the fire. Flame: 3 art frames stepped (the camp's fire), embers rise slowly and fade
   before the faces; calm: one flame, no embers */
.team.ring {
  position: relative;
  display: block;
  width: min(100%, calc(var(--u) * 460));
  height: calc(var(--u) * 210);
  margin: calc(var(--u) * 20) auto calc(var(--u) * 2);
}
.team.ring .fh {
  position: absolute;
  width: calc(var(--u) * 76);
  height: calc(var(--u) * 76);
  margin: 0;
  translate: -50% -70%;
  object-fit: contain;
  object-position: bottom;
  animation: fhBreath 2.6s ease-in-out calc(var(--i) * -0.37s) infinite;
}
@keyframes fhBreath {
  50% {
    transform: scaleY(1.03);
  }
}
.ffire {
  position: absolute;
  left: 50%;
  top: 74%;
  width: calc(var(--u) * 64);
  height: calc(var(--u) * 70);
  translate: -50% -60%;
  z-index: 90;
}
.ffire .logs {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100%;
  translate: -50% 0;
}
.ffire .fl {
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: 72%;
  translate: -50% 0;
  opacity: 0;
  animation: flameStep 0.36s steps(1) infinite;
}
.ffire .f1 {
  animation-delay: -0.12s;
}
.ffire .f2 {
  animation-delay: -0.24s;
}
@keyframes flameStep {
  0% {
    opacity: 1;
  }
  33.4%,
  100% {
    opacity: 0;
  }
}
.ffire .em {
  position: absolute;
  left: calc(36% + var(--k) * 9%);
  bottom: 60%;
  width: calc(var(--u) * 9);
  opacity: 0;
  animation: emberUp 2.8s ease-out calc(var(--k) * -0.7s) infinite;
}
@keyframes emberUp {
  0% {
    opacity: 0;
    translate: 0 0;
  }
  20% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    translate: calc(var(--u) * 6) calc(var(--u) * -60);
  }
}
.calm .team.ring .fh,
.calm .ffire .em {
  animation: none;
}
.calm .ffire .fl {
  animation: none;
}
.calm .ffire .f0 {
  opacity: 1;
}
@media (max-aspect-ratio: 4/3) {
  .team.ring {
    height: calc(var(--u) * 170);
  }
  .team.ring .fh {
    width: calc(var(--u) * 48);
    height: calc(var(--u) * 48);
  }
}
/* H79: arriving at a new camp: the camp's name big at the top, the HUD and the hand come in after it (1.9 s, a tap skips) */
#arrive {
  position: fixed;
  left: 50%;
  top: calc(var(--u) * 18);
  z-index: 40;
  translate: -50% -12px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s,
    translate 0.3s ease-out;
  border-width: calc(var(--u) * 8) calc(var(--u) * 16);
  max-width: calc(100vw - 24px);
}
#arrive.on {
  opacity: 1;
  translate: -50% 0;
}
#arrive b {
  font-size: calc(var(--u) * 22);
  white-space: nowrap;
  padding-top: var(--cap);
  color: #fff;
}
body.arriving #hud,
body.arriving #hand,
body.arriving #strip {
  opacity: 0;
} /* opacity only: the camera measures these boxes */
#hud,
#hand,
#strip {
  transition: opacity 0.35s ease-out;
}
.calm #arrive,
.calm #hud,
.calm #hand,
.calm #strip {
  transition-duration: 1ms;
}
/* H85: footprints between the waves of a row (in the gap, never over a button's face); walked ones bright */
.lvl {
  position: relative;
}
.lvl .steps {
  position: absolute;
  left: 100%;
  top: 50%;
  width: calc(var(--u) * 14);
  translate: calc(var(--u) * -3) -50%;
  z-index: 1;
  opacity: 0.3;
  pointer-events: none;
  filter: grayscale(0.6);
}
.lvl .steps.walked {
  opacity: 0.95;
  filter: none;
}

@media (max-aspect-ratio: 4/3) {
  .menu-foot .stage-btn {
    justify-self: center;
    min-width: 0;
    max-width: 100%;
    height: auto;
    min-height: var(--touch);
  }
  .menu-foot .stage-btn > span {
    flex-wrap: wrap;
    gap: 4px 8px;
    padding-block: calc(var(--u) * 2);
  }
  .menu-foot .stage-btn #stageLbl {
    white-space: normal;
    text-align: center;
    line-height: 1.12;
    font-size: calc(var(--u) * 15);
  }
}
.panel:is([data-id='camp-story'], [data-id='camp-epilogue']) {
  width: min(100%, 760px);
}
.panel:is([data-id='camp-story'], [data-id='camp-epilogue']) .body {
  display: grid;
  gap: clamp(9px, 2vw, 15px);
}
.camp-story-art {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  max-height: 32dvh;
  object-fit: contain;
  border-radius: 12px;
  background: #132c36;
}
.camp-story-copy {
  display: grid;
  gap: 7px;
  font-size: clamp(15px, 2.2vw, 19px);
  line-height: 1.32;
}
.camp-story-copy p {
  margin: 0;
  color: #fff;
}
.camp-story-actions {
  display: flex;
  align-items: center;
  justify-content: center;
}
.camp-story-actions .btn {
  min-height: 44px;
}
@media (max-aspect-ratio: 4/3) {
  .camp-story-art {
    aspect-ratio: 3 / 2;
  }
}
@media (min-aspect-ratio: 4/3) and (max-height: 500px) {
  .panel:is([data-id='camp-story'], [data-id='camp-epilogue']) .body {
    grid-template-columns: 1.08fr 1fr;
    align-items: center;
  }
  .camp-story-art {
    grid-row: span 2;
    max-height: 49dvh;
  }
  .camp-story-copy {
    font-size: 15px;
  }
  .camp-story-actions {
    grid-column: 2;
  }
}
/* End of css/journey.css (complete file). */
