body {
  background: #f1efdd;
  color: #293e34;
  font:
    650 16px/1.45 Nunito,
    sans-serif;
}
header {
  background: #233e35;
  border-bottom: 3px solid #af945a;
}
.top,
main,
footer {
  max-width: 1230px;
}
.top nav a,
.top .brand {
  color: #fff0c7;
}
main {
  padding: 20px clamp(11px, 2.6vw, 30px);
}
footer {
  margin: 20px auto;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 15px;
  border-top: 1px solid #abb39b;
}
a {
  color: #315e4d;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2 {
  color: #264536;
}
h1 {
  font:
    800 clamp(36px, 5vw, 66px)/1 Georgia,
    serif;
  letter-spacing: -0.045em;
}
h2 {
  font:
    800 1.6rem/1.12 Georgia,
    serif;
  margin-bottom: 9px;
}
h3 {
  font: 750 1.2rem Georgia;
  margin-bottom: 8px;
}
button,
.clue-primary,
select,
input {
  font: inherit;
}
#catacomb button,
.clue-primary {
  color: #fff6de;
  background: #345f4d;
  border: 1px solid #234b3a;
  border-radius: 7px;
  padding: 8px 12px;
  font-weight: 850;
  line-height: 1.25;
  min-height: 39px;
  cursor: pointer;
  box-shadow: 0 2px #214c36;
  text-decoration: none;
}
#catacomb button:disabled {
  opacity: 0.48;
  cursor: auto;
}
#catacomb button[aria-pressed='true'] {
  background: #f0cb79;
  color: #493d2e;
  border-color: #916f37;
  box-shadow: 0 2px #a2864b;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #d58a35;
  outline-offset: 3px;
}
.crypt-cover {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  background: #234c3c;
  color: #fff1cb;
  border: 3px solid #39563f;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px #b6af8e;
}
.crypt-cover img {
  width: 100%;
  height: 100%;
  max-height: 445px;
  object-fit: cover;
}
.crypt-cover > div {
  padding: clamp(20px, 3.8vw, 49px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}
.crypt-cover h1 {
  color: #fff2ca;
  margin: 0 0 12px;
}
.crypt-cover p:first-child,
.floor-heading p,
.folio small,
.floor-tile small,
.chest small {
  font-size: 0.9rem;
  font-weight: 900;
}
.crypt-cover p:first-child {
  color: #f1ca77;
}
.crypt-cover a.clue-primary {
  background: #f1ca81;
  color: #383c2c;
  border-color: #b39958;
  margin-bottom: 10px;
}
.crypt-cover > div > a:last-child {
  color: #ffe6a6;
}
.floors {
  margin-top: 22px;
}
.floor-heading,
.crypt-nav,
.choices,
.clocks,
.chest {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.floor-heading {
  justify-content: space-between;
  margin-bottom: 12px;
}
.floor-heading h1,
.floor-heading p,
.floor-heading h2 {
  margin: 0;
}
.floor-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.floor-tile,
.clue-notes,
.battle-lab {
  background: #fffbef;
  border: 1px solid #b3af93;
  border-radius: 10px;
  box-shadow: 0 3px #beb99d;
  min-width: 0;
}
.floor-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  text-decoration: none;
  color: inherit;
}
.floor-tile img {
  width: clamp(60px, 7.5vw, 105px);
  height: auto;
}
.floor-tile strong,
.floor-tile small,
.floor-tile span > span {
  display: block;
}
.floor-tile strong {
  font: 800 1.17rem Georgia;
}
.floor-tile small {
  color: #5e6b49;
}
.crypt-nav {
  margin: 0 0 12px;
}
.crypt-nav a {
  background: #fcf9e8;
  border: 1px solid #a1ac8f;
  padding: 6px 10px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 850;
}
.floor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 15px;
  align-items: start;
}
.battle-body,
.clue-notes {
  padding: clamp(13px, 2vw, 21px);
}
.battle-body p {
  margin-bottom: 9px;
}
.clue-notes > a {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.93rem;
}
.clue-notes > button {
  margin: 3px 0;
}
.worked-flow {
  background: #f6f1d9;
  color: #353e30;
}
.worked-flow .flow-caption p,
.worked-flow .flow-detail {
  color: #354434;
}
.battle-lab {
  overflow: hidden;
}
.arena {
  height: clamp(175px, 20vw, 238px);
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(0deg, #263c31d9 0, #23523ca1 32%, #23423419 85%),
    url(assets/catacomb-lost-clues.webp) 50% 9%/150% auto;
}
.arena::after {
  content: '';
  position: absolute;
  bottom: -32%;
  left: -5%;
  width: 115%;
  height: 57%;
  border-radius: 50%;
  background: linear-gradient(0deg, #7a6f4d, #b8a368);
  box-shadow: 0 -4px #b5aa78a3;
}
.party-pet,
.enemy {
  position: absolute;
  z-index: 2;
  bottom: 7%;
  aspect-ratio: 1;
}
.party-pet {
  width: 24%;
  max-width: 125px;
  background: 0 0/400% 100%;
}
.party-pet.michi {
  left: 7%;
  background-image: url(assets/michi-idle.webp);
}
.party-pet.koko {
  left: 24%;
  width: 20%;
  max-width: 102px;
  bottom: 12%;
  background-image: url(assets/koko-idle.webp);
}
.enemy {
  right: 8%;
  height: 76%;
  width: auto;
  bottom: 5%;
  object-fit: contain;
  filter: drop-shadow(1px 4px 2px #2a281e77);
  animation: bob 2.5s ease-in-out infinite;
}
.party-status,
.foe-status {
  position: absolute;
  z-index: 4;
  top: 7px;
  background: #fff3d6ee;
  border: 1px solid #928664;
  color: #344d35;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
}
.party-status {
  left: 7px;
}
.foe-status {
  right: 7px;
}
.party-status span {
  color: #a34543;
  letter-spacing: 0.13em;
  margin-left: 7px;
}
.foe-status span {
  margin-left: 6px;
}
.foe-status meter {
  display: block;
  width: 100%;
  height: 8px;
}
.spell {
  position: absolute;
  z-index: 4;
  top: 56%;
  left: 26%;
  opacity: 0;
  color: #ffeb8a;
  font: bold 44px Georgia;
  text-shadow: 0 0 8px #fff6ad;
}
.spell-hit .spell {
  animation: cast 0.55s ease-out;
}
.ward-hit .party-pet {
  animation: shake 0.26s ease;
}
.choices {
  margin: 11px 0;
}
.folio,
.readout,
.feedback:not(:empty),
.chest {
  background: #f8edc8;
  padding: 12px;
  border-left: 5px solid #a58554;
  border-radius: 4px;
  margin: 9px 0;
}
.folio h3,
.folio p,
.chest p,
.chest h2 {
  margin: 4px 0 0;
}
.feedback:not(:empty) {
  background: #e4eedb;
  border-color: #83a774;
}
.readout {
  background: #e9e9d8;
  border-color: #a8ac81;
  overflow-wrap: anywhere;
}
.feedback:empty {
  display: none;
}
.dust-bars > div {
  display: grid;
  grid-template-columns: 100px 1fr 62px;
  gap: 8px;
  align-items: center;
  font-size: 0.94rem;
}
.dust-bars meter {
  width: 100%;
  height: 18px;
}
.clocks label,
.vault-dials label,
.invite {
  display: grid;
  gap: 4px;
  font-weight: 800;
}
.clocks select,
.vault-dials select,
.invite input {
  background: #fff8df;
  border: 1px solid #a69b79;
  color: #344530;
  padding: 7px 9px;
  border-radius: 5px;
  min-width: 0;
}
.sources p {
  background: #edf0df;
  padding: 8px;
  border-radius: 4px;
  margin: 6px 0;
}
.chest > span {
  font-size: 36px;
  color: #a7792f;
}
.chest {
  background: #fff0bc;
}
.battle-lab table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.battle-lab th,
.battle-lab td {
  border-bottom: 1px solid #cecab0;
  padding: 4px;
}
.battle-lab caption {
  text-align: left;
  font-weight: 800;
  margin: 5px 0;
}
.vault-lock {
  text-align: center;
  padding: 28px;
  background: #fff9e8;
  border: 1px solid #b3ab8d;
  border-radius: 12px;
}
.vault-lock img {
  max-height: 160px;
}
.vault-lock .clue-primary {
  display: inline-block;
}
.vault-dials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 10px 0;
}
.invite {
  margin-top: 12px;
}
.invite input {
  width: 100%;
}
#vault-scene {
  height: clamp(265px, 32vw, 400px);
  background: #365540;
}
#vault-scene canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
@keyframes bob {
  50% {
    transform: translateY(-4px);
  }
}
@keyframes cast {
  0% {
    opacity: 1;
  }
  90% {
    opacity: 1;
    left: 77%;
    transform: scale(1.4);
  }
  100% {
    opacity: 0;
    left: 81%;
  }
}
@keyframes shake {
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}
@media (max-width: 750px) {
  .floor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .floor-layout {
    grid-template-columns: 1fr 0.82fr;
  }
  .arena {
    height: 190px;
  }
  .party-status,
  .foe-status {
    font-size: 0.75rem;
  }
}
@media (max-width: 620px) {
  .crypt-cover,
  .floor-layout {
    grid-template-columns: 1fr;
  }
  .crypt-cover img {
    aspect-ratio: 1.8;
    max-height: 255px;
  }
  .crypt-cover > div {
    padding: 18px;
  }
  .crypt-cover p {
    margin-bottom: 8px;
  }
  .floor-grid {
    grid-template-columns: 1fr;
  }
  .floor-tile img {
    width: 70px;
  }
  .arena {
    height: 180px;
  }
  .top nav {
    flex-wrap: wrap;
  }
  .floor-heading h1 {
    font-size: 34px;
  }
  #vault-scene {
    height: 275px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .enemy,
  .spell,
  .party-pet {
    animation: none !important;
  }
}

.charms,
.satchel {
  margin-top: 12px;
  border-top: 1px dashed #a8b092;
  padding-top: 8px;
}
.charms {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.satchel span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f2ead1;
  border-radius: 6px;
  padding: 2px 6px;
  margin: 2px;
  font-size: 0.86rem;
}
.satchel img {
  width: 27px;
  height: 27px;
}
.crypt-nav button {
  font-size: 0.84rem !important;
  min-height: 31px !important;
}
.charms button {
  font-size: 0.85rem !important;
  background: #686044 !important;
}
