@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: 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.png") 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: 97px;
  left: 0;
  right: 0;
  text-align: center;
  color: #d0ded5;
  font-size: 10px;
  text-shadow: 0 2px 4px #000;
  pointer-events: none;
}
.directionpad {
  position: absolute;
  bottom: 11px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 3px;
}
.directionpad > div {
  display: flex;
  gap: 5px;
}
.directionpad button {
  background: #142c37db;
  border: 1px solid #607b79;
  border-bottom: 3px solid #24434e;
  width: 44px;
  height: 34px;
  border-radius: 10px;
  font-size: 21px;
  color: #d5e4dc;
  backdrop-filter: blur(6px);
}
.directionpad > div > button:nth-child(2) {
  background: #dab46d;
  color: #17242b;
  border-color: #f4dca1;
  border-bottom-color: #9e7b42;
}
.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.png") 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.png") 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 {
  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 {
  height: 130px;
  max-width: 100%;
  object-fit: contain;
}
