/* 1.5.6 — bundled serif (subset of Liberation Serif, SIL OFL 1.1) so titles and
   buttons look the same on iPhone, Android and desktop. */
@font-face { font-family:"Kopai Serif"; src:url("/assets/fonts/kopai-serif-regular.woff2") format("woff2"); font-weight:400; font-style:normal; font-display:swap; }
@font-face { font-family:"Kopai Serif"; src:url("/assets/fonts/kopai-serif-bold.woff2") format("woff2"); font-weight:700; font-style:normal; font-display:swap; }
@import url("/fonts.css");
:root {
  --bg: #0c1c29;
  --panel: #142b38;
  --panel2: #1b3744;
  --line: #2d4953;
  --text: #ecf4ef;
  --muted: #9bb5be;
  --gold: #ffcc74;
  --mint: #82ded1;
  --danger: #ff9a8c;
  font-family: "Dig Digits",Nunito, "Trebuchet MS", system-ui, sans-serif;
  color: var(--text);
  background: #060f17;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  overscroll-behavior: none;
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
  border: 0;
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.48;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
button:active:not(:disabled) {
  transform: translateY(1px);
  filter: brightness(1.1);
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: var(--mint);
}
[hidden] {
  display: none !important;
}
#app {
  max-width: 520px;
  min-height: 100dvh;
  margin: auto;
  background: var(--bg);
  position: relative;
  overflow-x: clip;
  padding: calc(12px + env(safe-area-inset-top)) 16px
    calc(88px + env(safe-area-inset-bottom));
  box-shadow: 0 0 130px #172b3b;
}
header {
  display: flex;
  gap: 11px;
  align-items: center;
  height: 52px;
}
.avatar {
  width: 44px;
  height: 44px;
  border: 1px solid #74664e;
  background: linear-gradient(135deg, #574631, #273946);
  border-radius: 15px;
  font-size: 24px;
}
.identity {
  flex: 1;
  min-width: 0;
}
.identity small {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 1.6px;
  display: block;
  margin-bottom: 4px;
}
.identity strong {
  font-size: 16px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  display: block;
}
.currency {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #26352f;
  border: 1px solid #4c5140;
  border-radius: 20px;
  padding: 8px 10px;
  font-size: 13px;
}
.currency > span:last-child {
  color: #a6b392;
}
.coin {
  color: #ffcc60;
  background: #9c692d;
  width: 18px;
  height: 18px;
  text-align: center;
  border-radius: 50%;
  border: 2px solid #ffcc60;
  font-size: 11px;
}
.statusrow {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 13px 1px 12px;
}
.energy {
  flex: 1;
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: 160px;
  font-size: 11px;
}
.energy > span {
  font-size: 28px;
  color: var(--mint);
}
.energy > div {
  width: 100%;
}
.bar {
  height: 4px;
  background: #29414a;
  border-radius: 9px;
  overflow: hidden;
}
.bar i {
  display: block;
  background: var(--mint);
  height: 100%;
  transition: width 0.35s;
  max-width: 100%;
}
.energy .bar {
  margin-top: 4px;
}
.energy b {
  font-size: 11px;
  color: #bed6d9;
}
.bag {
  margin-left: auto;
  background: transparent;
  font-size: 13px;
  color: var(--muted);
}
.iconbutton {
  background: transparent;
  color: #b1c7ce;
  font-size: 22px;
  opacity: 0.5;
}
.iconbutton.on {
  color: var(--gold);
  opacity: 1;
}
.zoneheading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 2px 14px;
}
.zoneheading small,
.eyebrow {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--mint);
  font-weight: 800;
}
h1 {
  margin: 5px 0 0;
  font-size: 28px;
  letter-spacing: -0.7px;
  line-height: 1.2;
}
.depthpill {
  display: flex;
  flex-direction: column;
  text-align: center;
  min-width: 66px;
  padding: 8px 12px;
  background: #1c3340;
  border: 1px solid #35505d;
  border-radius: 14px;
}
.depthpill b {
  font-size: 23px;
  line-height: 1.15;
}
.depthpill span {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 1px;
  margin-top: 3px;
}
.nextzone {
  margin: 0 2px 13px;
  position: relative;
  font-size: 10px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 7px;
}
.nextzone b {
  color: #c9d6d4;
  font-weight: 500;
}
.nextzone .bar {
  width: 100%;
  height: 3px;
}
.nextzone .bar i {
  background: #d3b170;
}
#gameArea {
  height: clamp(320px, 51dvh, 540px);
  margin: 0 -16px;
  position: relative;
  overflow: hidden;
  background: #112632 url("/assets/cavern.webp") center/cover;
}
#gameArea:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    #0c1c29,
    transparent 12%,
    transparent 75%,
    #0c1c29
  );
  pointer-events: none;
}
#world {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  touch-action: none;
}
.surfacebutton {
  position: absolute;
  top: 12px;
  left: 17px;
  background: #132531d9;
  border: 1px solid #556450;
  border-radius: 18px;
  padding: 7px 11px;
  font-size: 12px;
  color: #e0c795;
  backdrop-filter: blur(8px);
}
.coordinates {
  position: absolute;
  right: 16px;
  top: 20px;
  font-size: 10px;
  color: #b6c9c6;
  background: #0d2428bb;
  padding: 4px 8px;
  border-radius: 8px;
}
#hint {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  text-align: center;
  color: #d0ded5;
  font-size: 10px;
  text-shadow: 0 2px 4px #000;
  pointer-events: none;
}
.questteaser {
  display: flex;
  width: 100%;
  gap: 10px;
  align-items: center;
  text-align: left;
  padding: 14px 12px;
  margin-top: 10px;
  background: linear-gradient(110deg, #293b3c, #1a313b);
  border: 1px solid #4a594c;
  border-radius: 15px;
}
.questicon {
  color: var(--gold);
  font-size: 28px;
}
.questteaser small {
  display: block;
  font-size: 8px;
  color: #c8bd9c;
  letter-spacing: 1.1px;
}
.questteaser b {
  font-size: 12px;
  display: block;
  margin-top: 4px;
}
.questprogress {
  margin-left: auto;
  font-size: 11px;
  color: var(--gold);
  white-space: nowrap;
}
nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  max-width: 520px;
  width: 100%;
  display: flex;
  padding: 10px 8px calc(12px + env(safe-area-inset-bottom));
  background: #102530f5;
  border-top: 1px solid #30444c;
  backdrop-filter: blur(20px);
  z-index: 10;
}
nav button {
  width: 20%;
  background: transparent;
  color: #8da6b0;
  font-size: 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}
nav button > span {
  font-size: 23px;
  height: 29px;
  line-height: 29px;
}
nav button.active {
  color: var(--gold);
}
nav button.active:before {
  content: "";
  position: absolute;
  top: -11px;
  background: var(--gold);
  width: 28px;
  height: 2px;
  border-radius: 2px;
}
nav i {
  position: absolute;
  right: 26%;
  top: 1px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  display: none;
}
#pageView {
  padding-top: 12px;
  min-height: 70dvh;
}
.pagehead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.pagehead h1 {
  font-size: 26px;
}
.pagehead p {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 0;
}
.badge {
  font-size: 10px;
  background: #264347;
  color: var(--mint);
  padding: 7px 10px;
  border-radius: 15px;
}
.hero {
  padding: 20px;
  background: linear-gradient(130deg, #26504b, #263144);
  border: 1px solid #466054;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  margin-bottom: 17px;
}
.hero h2 {
  margin: 0 0 8px;
  font-size: 22px;
}
.hero p {
  font-size: 12px;
  max-width: 250px;
  line-height: 1.6;
  color: #c2d8d5;
  margin: 0 0 12px;
}
.hero .bigicon {
  position: absolute;
  right: 20px;
  bottom: 22px;
  font-size: 66px;
  opacity: 0.3;
}
.goldbutton {
  background: linear-gradient(#ffe0a2, #dfb269);
  color: #253039;
  border: 1px solid #efd39e;
  border-radius: 11px;
  padding: 11px 16px;
  font-size: 12px;
  font-weight: 800;
}
.secondary {
  background: #28424d;
  border: 1px solid #3c5b67;
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 12px;
  color: #cee0df;
}
.danger {
  color: var(--danger);
}
.sectiontitle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 1px 10px;
}
.sectiontitle h2 {
  font-size: 16px;
  margin: 0;
}
.sectiontitle small {
  color: var(--muted);
  font-size: 10px;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.card {
  padding: 15px 12px;
  background: var(--panel);
  border: 1px solid #2c4651;
  border-radius: 15px;
  min-width: 0;
}
.card .art {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  margin: -2px 0 10px;
  position: relative;
}
.card .art:before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse,
    var(--accent, #476a61) 0,
    transparent 70%
  );
  opacity: 0.35;
  pointer-events: none;
}
.card h3 {
  font-size: 13px;
  margin: 0 0 6px;
}
.card p {
  font-size: 10px;
  color: var(--muted);
  margin: 4px 0 9px;
  line-height: 1.6;
}
.card button {
  width: 100%;
  padding: 9px 5px;
  font-size: 10px;
}
.card .level {
  display: block;
  font-size: 9px;
  color: var(--gold);
  margin-bottom: 8px;
}
.row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 10px;
  background: var(--panel);
  border: 1px solid #294550;
  border-radius: 13px;
  margin: 8px 0;
}
.row .symbol {
  font-size: 25px;
  width: 33px;
  text-align: center;
}
.row .content {
  flex: 1;
  min-width: 0;
}
.row h3 {
  margin: 0 0 5px;
  font-size: 12px;
}
.row p {
  font-size: 10px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}
.row button {
  font-size: 10px;
  padding: 8px 10px;
}
.row .rank {
  font-size: 14px;
  color: var(--gold);
  width: 26px;
  text-align: center;
}
.row .score {
  font-size: 14px;
  color: var(--mint);
  white-space: nowrap;
}
.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 3px 0 12px;
  scrollbar-width: none;
}
.tabs button {
  border-radius: 18px;
  background: #1c3542;
  color: #aec8cc;
  font-size: 11px;
  padding: 9px 14px;
  white-space: nowrap;
}
.tabs button.active {
  background: #dec087;
  color: #192c34;
}
.muted {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}
.empty {
  text-align: center;
  padding: 34px 15px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.progress {
  margin-top: 9px;
}
.progress .bar {
  height: 4px;
}
.statgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.statgrid > div {
  background: #172f3c;
  padding: 13px 4px;
  border: 1px solid #2a4652;
  border-radius: 13px;
  text-align: center;
}
.statgrid b {
  font-size: 17px;
  color: var(--gold);
  display: block;
}
.statgrid small {
  font-size: 9px;
  color: var(--muted);
}
input,
textarea,
select {
  background: #0e232f;
  border: 1px solid #385665;
  color: var(--text);
  padding: 12px;
  border-radius: 10px;
  max-width: 100%;
  width: 100%;
  font-size: 13px;
}
input {
  min-width: 0;
}
.inputrow {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}
.inputrow button {
  white-space: nowrap;
}
.resourcegem {
  width: 23px;
  height: 29px;
  display: inline-block;
  background: var(--gem, #80d7d4);
  clip-path: polygon(50% 0, 90% 25%, 100% 66%, 50% 100%, 0 66%, 10% 25%);
  box-shadow:
    inset -9px 0 #0003,
    inset 7px 0 #fff3;
  transform: rotate(10deg);
}
.row .resourcegem {
  margin: 0 7px;
}
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background:
    linear-gradient(#0b213177, #071923bb),
    url("/assets/cavern.webp") center/cover;
  display: grid;
  place-items: center;
  padding: 24px;
}
.welcome {
  text-align: center;
  max-width: 330px;
}
.brandmark {
  font-size: 66px;
  margin-bottom: 20px;
}
.welcome h1 {
  font-size: 62px;
  font-weight: 900;
  line-height: 0.93;
  letter-spacing: -2px;
  color: #fff2d2;
  text-shadow:
    0 4px #493a2b,
    0 7px 15px #0006;
  margin: 23px 0;
}
.welcome h1 em {
  font-style: normal;
  color: var(--gold);
}
.welcome p {
  font-size: 13px;
  color: #c6dcd8;
  line-height: 1.7;
}
.welcome .eyebrow {
  font-size: 9px;
  color: var(--mint);
  letter-spacing: 2px;
}
.welcome a {
  display: block;
  font-size: 10px;
  margin-top: 28px;
  color: #acc1bf;
}
.welcome button {
  padding: 12px 24px;
  background: var(--gold);
  color: #182e38;
  border-radius: 12px;
  margin: 12px;
}
.loader {
  width: 32px;
  height: 32px;
  border: 2px solid #617e77;
  border-top-color: #efc986;
  border-radius: 50%;
  margin: 23px auto;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
#toast {
  position: fixed;
  bottom: 110px;
  left: 50%;
  transform: translate(-50%, 20px);
  z-index: 100;
  background: #dae9df;
  color: #142d33;
  border-radius: 13px;
  padding: 12px 18px;
  width: max-content;
  max-width: 88%;
  font-size: 12px;
  box-shadow: 0 7px 30px #0004;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
#toast.error {
  background: #ffe0cf;
  color: #5a2a1a;
}
dialog {
  position: fixed;
  top: auto;
  bottom: 0;
  max-height: 85dvh;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  background: #122b37;
  border: 1px solid #45636b;
  border-radius: 24px 24px 0 0;
  color: var(--text);
  padding: 20px 20px calc(26px + env(safe-area-inset-bottom));
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: #02101bcc;
  backdrop-filter: blur(5px);
}
.sheethead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 17px;
  position: sticky;
  top: 0;
  background: #122b37;
  z-index: 1;
}
.sheethead h2 {
  margin: 0;
  font-size: 20px;
}
.sheethead button {
  background: #2b4754;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 23px;
}
#findBanner {
  position: absolute;
  top: 60px;
  left: 24px;
  right: 24px;
  text-align: center;
  background: #173b3de8;
  border: 1px solid #94b691;
  color: #fff0c3;
  border-radius: 14px;
  padding: 14px;
  font-size: 13px;
  opacity: 0;
  transform: translateY(-10px);
  transition: 0.25s;
  pointer-events: none;
}
#findBanner.show {
  opacity: 1;
  transform: translateY(0);
}
.campart {
  height: 150px;
  margin: -20px -20px 14px;
  background:
    linear-gradient(0deg, #22434022, #0000),
    url("/assets/camp.webp") center 57% / cover;
  position: relative;
}
.campart.winter {
  filter: hue-rotate(125deg) saturate(0.55);
}
.campart.garden {
  filter: hue-rotate(-22deg);
}
.full {
  width: 100%;
}
.spacer {
  height: 8px;
}
.linkbutton {
  background: transparent;
  padding: 8px;
  color: var(--mint);
  font-size: 11px;
}
.passrow {
  border-color: #766343;
}
.passrow.locked {
  opacity: 0.6;
}
.legal {
  padding: 25px;
  max-width: 720px;
  margin: auto;
  font-size: 14px;
  line-height: 1.8;
}
.legal h1 {
  margin: 20px 0;
}
.legal h2 {
  margin-top: 30px;
  font-size: 20px;
}
#sheetBody {
  overflow-wrap: anywhere;
}
.newbiome {
  animation: glow 1.2s;
}
@keyframes glow {
  50% {
    filter: brightness(1.4);
  }
}
@media (min-width: 700px) {
  #app {
    margin: 18px auto;
    min-height: calc(100dvh - 36px);
    border-radius: 24px;
    border: 1px solid #2a434e;
  }
  nav {
    bottom: 18px;
    border-radius: 0 0 24px 24px;
  }
  #gameArea {
    height: clamp(360px, 51dvh, 600px);
  }
}
@media (max-height: 700px) {
  #gameArea {
    height: 330px;
  }
  .zoneheading {
    margin-top: 3px;
    margin-bottom: 8px;
  }
  h1 {
    font-size: 24px;
  }
  .statusrow {
    padding-top: 7px;
    padding-bottom: 7px;
  }
  .questteaser {
    padding: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
}

.character-preview {
  height: 175px;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse, #38595677, transparent 70%);
  margin: -8px -8px 10px;
}
.character-preview canvas, .character-preview .shop-character {
  max-width: 100%;
  height: 175px;
  object-fit: contain;
}
.character-card {
  text-align: center;
}

.avatar.premium {
  border: 2px solid #eac272;
  box-shadow: 0 0 18px #e8b55855;
}
.avatar.premium + div strong {
  color: #f8d187;
}

.ui-icon {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  vertical-align: middle;
  overflow: visible;
}
.art .ui-icon {
  width: 42px;
  height: 42px;
  position: relative;
}
nav .ui-icon {
  width: 26px;
  height: 26px;
}
.brandmark .ui-icon {
  width: 70px;
  height: 70px;
}
.avatar .ui-icon {
  width: 29px;
  height: 29px;
}

.skin-preview {
  height: 130px;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse, #45637f55, transparent 65%);
}
.skin-preview canvas, .skin-preview .shop-character {
  height: 130px;
  max-width: 100%;
  object-fit: contain;
}

/* Active expeditions: reuse the mine renderer and native controls. */
.adventure-entry {display:flex;align-items:center;gap:12px;width:100%;padding:12px 14px;margin:0 0 12px;border:1px solid #a28750;border-radius:14px;background:linear-gradient(115deg,#354338,#273244);text-align:left;}
.adventure-entry>span:first-child{font-size:30px;color:var(--gold)}
.adventure-entry>span:nth-child(2){flex:1;min-width:0}.adventure-entry b,.adventure-entry small{display:block}.adventure-entry small{font-size:11px;color:#b6c6c6;margin-top:3px}
.adventure-controls{display:flex;gap:8px;justify-content:space-between;align-items:center;padding:9px 12px;margin-bottom:10px;border:1px solid var(--line);border-radius:12px;font-size:12px;background:#102735}.adventure-controls button{padding:9px;font-size:12px}.adventure-controls.danger{border-color:var(--danger);color:var(--danger)}
.adventure-intro{display:flex;gap:14px;align-items:center}.adventure-intro>span{font-size:48px;color:var(--gold)}.adventure-intro p{line-height:1.5}.kit-options{display:grid;gap:8px}.kit-option{display:flex;gap:12px;align-items:center;padding:12px;text-align:left;border:1px solid var(--line);border-radius:12px;background:var(--panel)}.kit-option b,.kit-option small{display:block}.kit-option small{color:var(--muted);margin-top:3px;font-size:12px}.kit-option{display:block}.kit-option.selected{border-color:var(--gold);background:#3b3b30;box-shadow:inset 3px 0 var(--gold)}
.run-stats{display:flex;gap:8px;justify-content:space-between;background:#091c29;padding:14px 10px;border-radius:12px;margin:12px 0}.run-stats span{font-size:11px;color:var(--muted);text-align:center;flex:1}.run-stats b{display:block;font-size:18px;color:var(--gold)}
.route-options{display:grid;grid-template-columns:1fr 1fr;gap:12px}.route-card{overflow:hidden;min-width:0;padding:12px;border:1px solid var(--line);border-radius:15px;background:#142e35;display:flex;flex-direction:column}.route-card h3{margin:8px 0;font-size:18px;line-height:1.2}.route-card p{font-size:12px;color:var(--muted);line-height:1.5;flex:1}.route-card button{font-size:12px;padding:12px 8px}.route-card .eyebrow{font-size:10px;letter-spacing:.08em;margin-top:10px}.route-art{height:110px;display:grid;place-items:center;font-size:52px;border-radius:9px;position:relative;overflow:hidden;background:radial-gradient(ellipse at 50% 100%,#78d4b04d,transparent 70%),linear-gradient(#081923,#244433);color:var(--mint)}.route-art i{position:absolute;width:20px;height:50px;background:#b7ffd622;transform:rotate(28deg);bottom:-5px;left:12%;border-radius:4px}.route-art i:nth-of-type(2){left:75%;height:70px;transform:rotate(-22deg)}.route-art i:nth-of-type(3){left:56%;height:24px}.violet .route-art{background:radial-gradient(ellipse at 50% 100%,#ae85ed66,transparent 75%),#191d30;color:#d0b6ff}.amber .route-art{background:radial-gradient(ellipse at 50% 100%,#e4aa3866,transparent 75%),#272820;color:var(--gold)}
.danger-note{color:var(--danger);font-size:13px}.bar i.low-air{background:var(--danger)!important}.result-emblem{text-align:center;font-size:66px;padding:16px;color:var(--gold)}.result-title{text-align:center}.adventure-hero{border-color:#746a48}.adventure-world[data-route="explore"]{box-shadow:inset 0 0 70px #685ca833}.adventure-world[data-route="treasure"]{box-shadow:inset 0 0 70px #bf8b2533}
@media(max-width:350px){.route-options{grid-template-columns:1fr}.route-art{height:70px}.run-stats b{font-size:16px}}
.adventure-controls>span{min-width:0;flex:1;overflow-wrap:anywhere}
.adventure-controls button{flex-shrink:0;min-height:44px}
.run-stats span{min-width:0;overflow-wrap:anywhere}
.route-card button,.kit-option{min-height:44px}
.route-card h3,.route-card p{overflow-wrap:anywhere}
.adventure-world #hint{top:52px;bottom:auto;left:12px;right:12px;padding:4px 7px;border-radius:8px;background:#0c1c29c9;line-height:1.35}
dialog[data-type^="adventure-"] .sheethead{gap:12px;align-items:flex-start}
dialog[data-type^="adventure-"] .sheethead h2{min-width:0;line-height:1.2}
dialog[data-type^="adventure-"] .sheethead button{flex-shrink:0}
@media(max-width:350px){
  .statusrow{gap:6px}.energy{gap:4px;min-width:0}.bag{font-size:11px;padding:5px 2px}
  .zoneheading>div{min-width:0}.zoneheading h1{font-size:22px}.depthpill{flex-shrink:0}
  dialog[data-type^="adventure-"]{padding-left:15px;padding-right:15px}
  .adventure-controls{padding:7px 9px}.adventure-controls button{font-size:11px}
}

/* Illustrated interface and a visible, stack-based backpack. */
header{display:grid;grid-template-columns:44px minmax(0,1fr);height:auto;gap:10px 11px}
.wallet{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}
.wallet .currency{min-width:0;justify-content:flex-start;border-radius:15px;padding:10px 12px;background:linear-gradient(130deg,#3f392a,#26342f);gap:9px}
.wallet .currency>.ui-icon{width:30px;height:30px;flex-shrink:0}
.wallet .currency>div{min-width:0}
.wallet .currency small,.wallet .bag small{display:block;font-size:10px;line-height:1.35;color:#acc2bc}
.wallet .currency b{display:block;font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wallet .bag{display:flex;align-items:center;gap:9px;margin:0;width:100%;min-width:0;text-align:left;padding:10px 10px;background:linear-gradient(130deg,#355654,#243b48);border:1px solid #739785;border-radius:15px;box-shadow:inset 0 1px #b0ddbb25;color:#f5eed8}
.wallet .bag>.ui-icon{width:29px;height:29px;flex-shrink:0}
.wallet .bag>span{min-width:0;flex:1}
.wallet .bag strong{font-size:13px}
.wallet .bag .bag-chevron{width:13px;height:18px;opacity:.8}
.statusrow{gap:9px}.statusrow .energy{max-width:none;min-width:0;flex:1}.energy>span{display:flex;font-size:23px;flex-shrink:0}.energy b{white-space:nowrap}
.adventure-cargo{font-size:11px;display:flex;gap:7px;align-items:center;color:var(--gold)}
.adventure-cargo>span{white-space:nowrap}.statusrow #sound{flex-shrink:0;padding:5px;font-size:21px}
.amount{display:inline-flex;align-items:center;gap:2px;white-space:nowrap}
.amount .ui-icon{width:1.1em;height:1.1em;flex-shrink:0}
.run-stats .amount{display:inline-flex;font-size:inherit;color:inherit;flex:none}
.action-button{display:inline-flex;justify-content:center;align-items:center;gap:7px;vertical-align:middle}
.action-button>.ui-icon{width:18px;height:18px;flex-shrink:0}
.action-button>span{min-width:0;overflow-wrap:anywhere}
.row>.action-button{flex-shrink:0}
.depthpill{position:relative;padding-top:8px;align-items:center}.depthpill>.ui-icon{width:18px;height:18px;margin-bottom:3px}
.surfacebutton{display:flex;align-items:center;gap:5px}.surfacebutton>.ui-icon{width:18px;height:18px}
.sheethead button{display:grid;place-items:center;flex-shrink:0}.sheethead button>.ui-icon{width:18px;height:18px}
.questicon>.ui-icon{width:26px;height:26px}.rank>.ui-icon{width:34px;height:38px}.score>.ui-icon{width:16px;height:16px}
.undiscovered-art>.ui-icon{filter:grayscale(1);opacity:.3}.art-check{position:absolute;right:17%;bottom:0;width:22px;height:22px;background:#163c35;border-radius:50%;border:1px solid #78baa0}.art .art-check>.ui-icon{width:20px;height:20px}
.scene-image{display:block;width:100%;max-width:100%;height:auto;object-fit:cover;background:#152c37}
.illustrated-camp{height:auto;aspect-ratio:16/9}.illustrated-camp>.scene-image{height:100%;object-position:center 60%}
.shop-scene{height:175px;width:calc(100% + 40px);max-width:none;margin:-20px -20px 17px;object-position:center}
.route-art{height:125px;border-radius:10px;background:#142d33}
.route-art>.route-scene{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.route-scene-badge{position:absolute;right:7px;bottom:7px;display:grid;place-items:center;width:33px;height:33px;padding:5px;background:#0c1c29d9;border:1px solid #8ba29188;border-radius:11px;font-size:22px}
.route-scene-badge>.ui-icon{width:24px;height:24px}
.kit-option{display:flex;gap:11px;align-items:center}.kit-icon{flex-shrink:0;display:grid;place-items:center;width:36px;height:40px}.kit-icon>.ui-icon{width:32px;height:32px}
.result-illustration{position:relative;border-radius:17px;overflow:hidden;border:1px solid #668479;margin-bottom:17px}
.result-scene{height:190px;object-position:center}
.complete-medal{position:absolute;right:12px;bottom:12px;display:grid;place-items:center;width:42px;height:42px;border-radius:50%;background:#153d34;border:2px solid #ffce70;box-shadow:0 3px 18px #0006}.complete-medal>.ui-icon{width:28px;height:28px}
.exhibit-illustration{margin:-15px -12px 13px;overflow:hidden;border-radius:14px 14px 0 0}.exhibit-scene{height:175px}
.adventure-entry>span:first-child>.ui-icon{width:34px;height:34px}.adventure-entry>span:last-child>.ui-icon{width:16px;height:20px}
.adventure-intro>span>.ui-icon{width:47px;height:47px}
.inventory-heading{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:7px;margin:14px 0 12px;font-size:11px;color:var(--muted)}
.inventory-heading>div{display:flex;gap:6px;align-items:center;color:var(--text);font-size:13px}.inventory-heading .ui-icon{width:24px;height:24px}
.inventory-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.inventory-slot{position:relative;min-width:0;aspect-ratio:1;background:radial-gradient(ellipse at 50% 36%,#345260,#19333f 75%);border:1px solid #506976;border-radius:10px;box-shadow:inset 0 1px #85a5ad25,0 2px 5px #0002}
.inventory-item-art{position:absolute;left:8px;right:8px;top:6px;bottom:24px;display:grid;place-items:center}.inventory-item-art>.ui-icon{width:100%;height:100%;max-width:45px;max-height:45px;filter:drop-shadow(0 3px 3px #0006)}
.inventory-quantity{position:absolute;right:3px;top:3px;border-radius:5px;padding:1px 4px;background:#0a1b25df;border:1px solid #63808966;font-size:9px;line-height:1.2;color:#ffdc95}
.inventory-item-name{position:absolute;left:3px;right:3px;bottom:4px;text-align:center;font-size:9px;line-height:1.08;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;color:#dce9e5}
.inventory-slot.empty-slot{background:#0d2430;opacity:.65;border-color:#304b59;box-shadow:inset 0 2px 5px #0004}
.inventory-note{font-size:11px;line-height:1.5;color:var(--muted);margin:12px 0}
.inventory-sale{display:flex;justify-content:space-between;align-items:center;gap:10px;background:#0d2430;border:1px solid #36534f;border-radius:12px;padding:14px 12px;margin:16px 0 12px;font-size:12px}.inventory-sale>b{font-size:19px;color:var(--gold)}
.inventory-run{background:linear-gradient(125deg,#3c3828,#263640);border:1px solid #95815b;border-radius:13px;padding:13px;margin-bottom:17px}.inventory-run-head{display:flex;gap:8px;align-items:center}.inventory-run-head>.ui-icon{width:25px;height:25px}.inventory-run h3{font-size:15px;margin:0}.inventory-run p{font-size:12px;line-height:1.5;color:#d1dbc9}
@media(max-width:350px){
  .wallet{gap:7px}.wallet .currency,.wallet .bag{padding:9px 8px;gap:6px}.wallet .currency>.ui-icon,.wallet .bag>.ui-icon{width:25px;height:25px}.wallet .currency b{font-size:16px}.wallet .bag strong{font-size:12px}.wallet .bag .bag-chevron{width:10px}
  .statusrow{gap:6px}.energy>span{font-size:20px}.energy b{font-size:10px}.adventure-cargo{gap:4px;font-size:10px}
  .route-art{height:140px}.route-card h3{font-size:17px}.action-button{gap:5px}.action-button>.ui-icon{width:16px;height:16px}
  .inventory-grid{gap:5px}.inventory-item-art{left:6px;right:6px;bottom:22px}.inventory-item-name{font-size:8px}.inventory-quantity{font-size:8px}
  .shop-scene,.result-scene,.exhibit-scene{height:155px}
}
#toast.mine-toast{top:calc(12px + env(safe-area-inset-top));bottom:auto;transform:translate(-50%,-20px)}
#toast.mine-toast.show{transform:translate(-50%,0)}

/* Permanent character and pickaxe catalogue. */
.shop-tabs { flex-wrap: wrap; }
.shop-product { display: flex; flex-direction: column; }
.shop-product > p { flex: 1; }
.character-bonus-icon { display: inline-block; width: 20px; height: 20px; object-fit: contain; vertical-align: -4px; }
.shop-product > .action-button { margin-top: 10px; }
.shop-product .art > img { width: 100%; height: 100%; object-fit: contain; }
.elixir-shop-card .craft-heading > img { width: 76px; height: 76px; flex-shrink: 0; }
.elixir-shop-card .secondary { margin-top: 8px; }

/* Chest rewards stay compact above the bottom navigation. */
#toast.reward-toast {
  top: auto; bottom: calc(90px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: max-content; max-width: min(300px, calc(100vw - 32px));
  box-sizing: border-box; padding: 8px 12px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.16); border-image: none;
  background: rgba(0,0,0,.78); color: #fff; font-size: 13px;
  font-weight: 600; line-height: 1.3; text-align: center;
  box-shadow: 0 5px 20px rgba(0,0,0,.32); backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); pointer-events: none;
  transform: translate(-50%, 14px); z-index: 100;
}
#toast.reward-toast.show { transform: translate(-50%, 0); }
#toast.reward-toast img { width: 28px; height: 28px; flex: 0 0 28px; object-fit: contain; }
#toast.reward-toast span { min-width: 0; overflow-wrap: anywhere; }
#toast.reward-toast.reward-stars { border-color: rgba(255,215,120,.45); color: #ffe6a5; box-shadow: 0 5px 24px #0008, 0 0 15px #ffc85726; }
@media(min-width:700px) { #toast.reward-toast { bottom: calc(108px + env(safe-area-inset-bottom)); } }

/* 1.5.6 — "out of energy" toast: same bottom spot as chest rewards; a dark,
   semi-transparent teal notice (no metal rim, so it never reads as a button)
   with a notification bell. */
#toast.energy-toast {
  top:auto; bottom:calc(90px + env(safe-area-inset-bottom));
  display:flex; align-items:center; gap:8px;
  width:max-content; max-width:min(300px, calc(100vw - 32px)); box-sizing:border-box;
  padding:8px 14px 8px 11px; border-radius:10px;
  border:1px solid #5fc3d433; border-image:none;
  background:linear-gradient(180deg,#0b3442b8,#05202bc4);
  -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
  box-shadow:0 5px 18px #0007;
  color:#fff; line-height:1.2; pointer-events:none;
  transform:translate(-50%, 14px); z-index:100;
}
#toast.energy-toast.show { transform:translate(-50%, 0); }
#toast.energy-toast .energy-toast-icon { flex:none; width:19px; height:19px; fill:#8fd9e6; stroke:none; filter:drop-shadow(0 1px 1px #0008); }
#toast.energy-toast b { font-size:14px; font-weight:600; color:#fff; text-shadow:0 1px 2px #0008; white-space:nowrap; }
@media(min-width:700px) { #toast.energy-toast { bottom:calc(108px + env(safe-area-inset-bottom)); } }
/* The mine hint sits under the energy toast; hide it while the toast shows. */
body.energy-toast-on #hint { opacity:0; transition:opacity .2s; }
#adventurePanel:empty { display:none; }
/* The bell rings while the energy notice is on screen. */
#toast.energy-toast.show .energy-toast-icon { transform-origin:50% 8%; animation:energy-bell-ring .9s ease-in-out .15s 1,energy-bell-tint 1.8s ease-in-out .1s 1; }
/* During the red tint the bell warms up with it, then returns to cyan. */
@keyframes energy-bell-tint { 0%,100% { fill:#8fd9e6; } 8%,64% { fill:#f0c9cc; } }
@keyframes energy-bell-ring {
  0%,100% { transform:rotate(0); }
  20% { transform:rotate(22deg); } 50% { transform:rotate(-20deg); } 78% { transform:rotate(12deg); }
}
@media(prefers-reduced-motion:reduce) { #toast.energy-toast.show .energy-toast-icon { animation:none; } }
/* One dark-red flash (0.5 s) when the energy notice appears. */
#toast.energy-toast { isolation:isolate; }
#toast.energy-toast::before {
  content:""; position:absolute; inset:-1px; z-index:-1; border-radius:inherit; pointer-events:none;
  background:#8a1e24; box-shadow:0 0 0 1px #d0525a55;
  opacity:0;
}
#toast.energy-toast.show::before { animation:energy-toast-flash 1.8s ease-in-out .1s 1; }
/* ~0.15 s in, 1 s of red tint, then a smooth ~0.65 s fade back. */
@keyframes energy-toast-flash { 0%,100% { opacity:0; } 8%,64% { opacity:.3; } }
@media(prefers-reduced-motion:reduce) { #toast.energy-toast.show::before { animation:none; } }
