:root {
  color-scheme: light;
  font-family: Inter, ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #15251c;
  color: #f7fff1;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: none;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

button {
  font: inherit;
}

.shell {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #000;
  overflow: hidden;
}

.shell-video,
.shell-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.shell-video {
  object-fit: cover;
  filter: blur(10px) saturate(1.12);
  transform: scale(1.04);
  pointer-events: none;
}

.shell-shade {
  background: rgba(16, 39, 22, 0.34);
}

.screen {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100vw - 24px));
  min-height: min(650px, calc(100vh - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border: 3px solid rgba(18, 50, 30, 0.32);
  border-radius: 8px;
  background: rgba(250, 255, 237, 0.93);
  color: #173425;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.title-shell {
  background: #000;
}

.title-shell > .shell-video,
.title-shell > .shell-shade {
  display: none;
}

.title-shell .screen {
  width: 100%;
  min-height: 100%;
  padding: 0;
  justify-content: center;
  align-items: center;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  color: #fff8d7;
  box-shadow: none;
  overflow: hidden;
}

.title-video,
.title-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.title-video {
  object-fit: cover;
  pointer-events: none;
}

.shell video::-webkit-media-controls,
.shell video::-webkit-media-controls-panel,
.shell video::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
}

.title-shade {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.28) 58%, rgba(0, 0, 0, 0.6));
}

.title-content {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 28px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px;
  text-align: center;
}

.title-tip {
  color: #fff8d7;
  font-weight: 900;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.5), 0 8px 22px rgba(0, 0, 0, 0.45);
}

.title-logo {
  width: min(680px, 92vw);
  max-height: 44vh;
  object-fit: contain;
  filter: drop-shadow(0 12px 0 rgba(0, 0, 0, 0.3)) drop-shadow(0 22px 28px rgba(0, 0, 0, 0.35));
}

.title-actions {
  justify-content: center;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.2rem, 7vw, 5.2rem);
  line-height: 0.92;
}

h2 {
  font-size: clamp(1.45rem, 4vw, 2.5rem);
}

.muted {
  color: #526858;
}

.currency-pill,
.charm-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  min-height: 30px;
  padding: 4px 9px;
  border: 2px solid rgba(21, 49, 30, 0.9);
  border-radius: 999px;
  background: rgba(255, 250, 220, 0.94);
  color: #173425;
  font-weight: 900;
  line-height: 1;
}

.currency-pill {
  margin-top: 6px;
}

.currency-pill img,
.charm-pill img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.button-row,
.profile-list,
.level-grid,
.collection-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button-row.compact {
  gap: 8px;
  margin-top: 12px;
}

.button-row.compact .button {
  min-height: 38px;
  padding: 8px 12px;
}

.button,
.profile,
.level-card,
.critter-card {
  position: relative;
  isolation: isolate;
  min-height: 48px;
  border: 5px solid transparent;
  border-radius: 8px;
  --button-bg: #ffe66f;
  --button-hi: rgba(255, 255, 255, 0.42);
  --button-dot: rgba(84, 45, 15, 0.26);
  background:
    url("/assets/other/ButtonHalftoneTopOverlay40.png") center top / auto 52px no-repeat,
    linear-gradient(var(--button-bg), var(--button-bg)),
    linear-gradient(#17112f, #17112f);
  background-origin: border-box, padding-box, border-box;
  background-clip: border-box, padding-box, border-box;
  color: #17112f;
  cursor: pointer;
  box-shadow: none;
  overflow: hidden;
}

.button::before,
.profile::before,
.level-card::before,
.critter-card::before {
  content: none;
}

.button {
  padding: 12px 18px;
  font-weight: 900;
}

.button-row.compact .button,
.hud .button {
  background-size: auto 40px, auto, auto;
}

.title-actions .button,
.topbar .button-row .button,
.dev-actions .button {
  background-image:
    url("/assets/other/LongButtonHalftoneTopOverlay40.png"),
    linear-gradient(var(--button-bg), var(--button-bg)),
    linear-gradient(#17112f, #17112f);
  background-size: auto 52px, auto, auto;
}

.profile,
.level-card,
.critter-card,
.form-card,
.level-info-card,
.mastery-card,
.mastery-perk,
.potion-card {
  background-image:
    url("/assets/other/LongButtonHalftoneTopOverlay40.png"),
    linear-gradient(var(--button-bg), var(--button-bg)),
    linear-gradient(#17112f, #17112f);
  background-size: auto 68px, auto, auto;
}

.button:hover,
.profile:hover,
.level-card:not(.locked):hover,
.critter-card:hover {
  filter: brightness(1.05) saturate(1.08);
}

.button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.35) brightness(0.88);
  opacity: 0.68;
}

.shop-shell .screen,
.shop-intro-shell .screen {
  overflow: auto;
  background:
    linear-gradient(rgba(248, 255, 232, 0.82), rgba(248, 255, 232, 0.9)),
    url("/assets/shop/shopBackground.png") center / cover no-repeat;
}

.shop-intro-shell .screen {
  width: min(1180px, calc(100vw - 24px));
  min-height: min(690px, calc(100vh - 24px));
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(rgba(18, 29, 20, 0.04), rgba(18, 29, 20, 0.12)),
    url("/assets/shop/shopBackground.png") center / cover no-repeat;
}

.shop-intro-stage {
  position: relative;
  min-height: min(690px, calc(100vh - 24px));
}

.shop-intro-box {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 5px solid #17112f;
  border-radius: 8px;
  background:
    url("/assets/other/LongButtonHalftoneTopOverlay40.png") center top / auto 66px no-repeat,
    linear-gradient(rgba(255, 246, 198, 0.97), rgba(255, 232, 161, 0.97));
  color: #17112f;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 260ms ease, transform 260ms ease;
  pointer-events: none;
}

.shop-intro-box.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.shop-intro-critter {
  width: 124px;
  height: 124px;
  object-fit: contain;
  filter: drop-shadow(0 10px 10px rgba(23, 17, 47, 0.22));
}

.shop-intro-copy {
  display: grid;
  gap: 12px;
  align-items: center;
}

.shop-intro-copy p {
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-weight: 900;
  line-height: 1.22;
}

.shop-intro-copy .button {
  justify-self: end;
  min-width: 96px;
  min-height: 40px;
  padding: 8px 14px;
}

.shop-topbar,
.shop-grid,
.shop-message {
  position: relative;
  z-index: 1;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  align-items: stretch;
}

.shop-egg-card {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 5px solid #17112f;
  border-radius: 8px;
  background:
    url("/assets/other/LongButtonHalftoneTopOverlay40.png") center top / auto 70px no-repeat,
    linear-gradient(rgba(255, 231, 154, 0.95), rgba(255, 211, 142, 0.95));
  color: #17112f;
  overflow: hidden;
}

.shop-egg-art {
  display: grid;
  place-items: center;
  min-height: 130px;
}

.shop-egg-art img {
  width: min(126px, 72%);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 12px 10px rgba(23, 17, 47, 0.2));
}

.shop-egg-info {
  display: grid;
  gap: 4px;
  text-align: center;
}

.shop-egg-info h3 {
  margin: 0;
  font-size: 1.08rem;
}

.shop-egg-info p,
.shop-odds {
  margin: 0;
}

.shop-owned,
.shop-new-left,
.shop-odds {
  color: #3e4d45;
  font-size: 0.84rem;
  font-weight: 800;
}

.shop-new-left {
  width: max-content;
  justify-self: center;
  padding: 4px 8px;
  border: 3px solid #17112f;
  border-radius: 999px;
  background: rgba(255, 250, 220, 0.88);
  color: #17112f;
}

.shop-egg-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.shop-egg-footer .button {
  min-height: 40px;
  padding: 8px 14px;
}

.shop-message {
  width: max-content;
  max-width: 100%;
  padding: 9px 12px;
  border: 3px solid #17112f;
  border-radius: 8px;
  background: rgba(255, 250, 220, 0.96);
  color: #173425;
  font-weight: 900;
}

.egg-opening-shell .screen {
  display: grid;
  place-items: center;
  overflow: hidden;
}

.egg-opening-screen {
  position: relative;
  z-index: 1;
  width: min(780px, calc(100vw - 28px));
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 5px solid #17112f;
  border-radius: 8px;
  background:
    url("/assets/other/LongButtonHalftoneTopOverlay40.png") center top / auto 78px no-repeat,
    linear-gradient(rgba(255, 246, 198, 0.97), rgba(255, 225, 148, 0.97));
  box-shadow: 0 16px 34px rgba(23, 17, 47, 0.26);
  color: #17112f;
}

.egg-opening-header {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  align-items: center;
}

.egg-opening-header h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.55rem);
  line-height: 1;
}

.egg-opening-egg {
  width: 88px;
  height: 88px;
  object-fit: contain;
  filter: drop-shadow(0 12px 10px rgba(23, 17, 47, 0.22));
}

.egg-opening-reel-window {
  position: relative;
  max-width: 100%;
  min-height: 210px;
  padding: 18px 0;
  overflow: hidden;
  border: 4px solid #17112f;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 28px 0 22px rgba(23, 17, 47, 0.15), inset -28px 0 22px rgba(23, 17, 47, 0.15);
}

.egg-opening-reel {
  display: flex;
  gap: 10px;
  width: max-content;
  will-change: transform;
}

.egg-opening-pointer {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 50%;
  z-index: 3;
  width: 154px;
  border: 5px solid #fff453;
  border-radius: 8px;
  box-shadow: 0 0 0 4px #17112f, 0 0 18px rgba(255, 244, 83, 0.62);
  transform: translateX(-50%);
  pointer-events: none;
}

.egg-opening-card {
  flex: 0 0 138px;
  display: grid;
  gap: 4px;
  justify-items: center;
  min-height: 168px;
  padding: 9px;
  border: 4px solid #17112f;
  border-radius: 8px;
  background:
    url("/assets/other/LongButtonHalftoneTopOverlay40.png") center top / auto 52px no-repeat,
    linear-gradient(#d8f4ff, #fff1b3);
  text-align: center;
  transform: scale(0.9);
  opacity: 0.52;
  transition: transform 90ms ease, opacity 90ms ease, box-shadow 90ms ease, background 90ms ease;
}

.egg-opening-card strong {
  font-size: 0.94rem;
  line-height: 1.05;
}

.egg-opening-card small {
  color: #3e4d45;
  font-size: 0.76rem;
  font-weight: 900;
}

.egg-opening-card img {
  width: 92px;
  height: 92px;
  object-fit: contain;
  align-self: end;
}

.egg-opening-card.active {
  background:
    url("/assets/other/LongButtonHalftoneTopOverlay40.png") center top / auto 52px no-repeat,
    linear-gradient(#fff77d, #ffc56c);
  box-shadow: 0 0 0 5px rgba(255, 244, 83, 0.55), 0 12px 16px rgba(23, 17, 47, 0.22);
  opacity: 1;
  transform: translateY(-6px) scale(1.05);
}

.egg-opening-result {
  display: none;
  justify-items: center;
  gap: 8px;
  padding: 14px;
  border: 4px solid #17112f;
  border-radius: 8px;
  background: rgba(255, 250, 220, 0.96);
  text-align: center;
}

.egg-opening-result.visible {
  display: grid;
}

.egg-opening-result h2,
.egg-opening-result p {
  margin: 0;
}

.egg-opening-badge {
  padding: 5px 10px;
  border: 3px solid #17112f;
  border-radius: 999px;
  background: #a7ecff;
  color: #17112f;
  font-size: 0.82rem;
  font-weight: 900;
}

.egg-opening-result-critter {
  width: 118px;
  height: 118px;
  object-fit: contain;
  filter: drop-shadow(0 10px 10px rgba(23, 17, 47, 0.2));
}

.egg-opening-refund {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 900;
}

.egg-opening-refund img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.button.danger {
  --button-bg: #ff7a6e;
  --button-dot: rgba(88, 18, 20, 0.28);
}

.button-row > .button:nth-of-type(1),
.topbar .button-row > .button:nth-of-type(1) {
  --button-bg: #ffe66f;
  --button-dot: rgba(99, 55, 11, 0.28);
}

.button-row > .button:nth-of-type(2),
.topbar .button-row > .button:nth-of-type(2) {
  --button-bg: #69d7ff;
  --button-dot: rgba(14, 60, 100, 0.28);
}

.button-row > .button:nth-of-type(3),
.topbar .button-row > .button:nth-of-type(3) {
  --button-bg: #ff8ed1;
  --button-dot: rgba(94, 20, 72, 0.28);
}

.button-row > .button:nth-of-type(4) {
  --button-bg: #90e85c;
  --button-dot: rgba(28, 80, 24, 0.28);
}

.button.secondary:nth-of-type(1) {
  --button-bg: #82e870;
  --button-dot: rgba(30, 82, 23, 0.28);
}

.button.secondary:nth-of-type(2) {
  --button-bg: #69d7ff;
  --button-dot: rgba(14, 60, 100, 0.28);
}

.button.secondary:nth-of-type(3) {
  --button-bg: #ff8ed1;
  --button-dot: rgba(94, 20, 72, 0.28);
}

.button.secondary:nth-of-type(4) {
  --button-bg: #bcf78d;
  --button-dot: rgba(44, 108, 24, 0.18);
}

.profile {
  --button-bg: #b8f27b;
  --button-dot: rgba(44, 108, 24, 0.18);
}

.level-card {
  --button-bg: #fff0a6;
  --button-dot: rgba(128, 87, 18, 0.18);
}

.level-card:nth-child(2n) {
  --button-bg: #a7ecff;
  --button-dot: rgba(22, 82, 128, 0.18);
}

.level-card:nth-child(3n) {
  --button-bg: #ffd0ef;
  --button-dot: rgba(132, 37, 99, 0.18);
}

.level-card:nth-child(4n) {
  --button-bg: #bcf78d;
  --button-dot: rgba(54, 112, 30, 0.18);
}

.critter-card {
  --button-bg: #ffd799;
  --button-dot: rgba(139, 75, 16, 0.18);
}

.profile,
.level-card,
.critter-card,
.form-card,
.level-info-card,
.mastery-card,
.mastery-perk {
  padding: 14px;
  text-align: left;
}

.profile {
  width: min(210px, 100%);
}

.level-card {
  width: 150px;
}

.level-card.locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.world-map {
  position: relative;
  flex: 1;
  min-height: 500px;
  max-height: min(605px, calc(100vh - 210px));
  overflow-x: hidden;
  overflow-y: auto;
  border: 5px solid #17112f;
  border-radius: 8px;
  background: #7bbf48;
}

.world-map-stage {
  position: relative;
  min-height: 7500px;
  overflow: hidden;
}

.world-biome {
  position: absolute;
  background-size: 100% auto;
  background-repeat: repeat-y;
  background-position: center top;
  filter: blur(1.5px);
  transform: scale(1.01);
  transform-origin: center top;
}

.world-biome-normal {
  inset: 80% -6px -6px -6px;
  background-image: url("/assets/bgs/Normal.png");
}

.world-biome-winter {
  inset: 60% -6px 20% -6px;
  background-image: url("/assets/bgs/Winter.png");
}

.world-biome-jungle {
  inset: 40% -6px 40% -6px;
  background-image: url("/assets/bgs/Jungle.png");
}

.world-biome-desert {
  inset: 20% -6px 60% -6px;
  background-image: url("/assets/bgs/Desert.png");
}

.world-biome-volcano {
  inset: -6px -6px 80% -6px;
  background-image: url("/assets/bgs/Volcano.png");
}

.world-biome-fade {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(80% - 82px);
  height: 164px;
  background-image: url("/assets/other/Fade.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 1;
}

.world-biome-fade.jungle-fade {
  top: calc(60% - 82px);
}

.world-biome-fade.desert-fade {
  top: calc(40% - 82px);
}

.world-biome-fade.volcano-fade {
  top: calc(20% - 82px);
}

.world-path {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  z-index: 1;
}

.world-path .trail-outline {
  fill: none;
  stroke: #17112f;
  stroke-width: 38px;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  opacity: 0.96;
}

.world-path .trail-fill {
  fill: none;
  stroke: #bf9e61;
  stroke-width: 24px;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.level-node {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
  width: 92px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border: 6px solid #17112f;
  border-radius: 999px;
  --button-bg: #ffe66f;
  background:
    url("/assets/other/ButtonHalftoneTopOverlay40.png") center top / auto 62px no-repeat,
    linear-gradient(var(--button-bg), var(--button-bg));
  color: #17112f;
  font-weight: 900;
  cursor: pointer;
  box-shadow: none;
}

.level-node:nth-of-type(2n) {
  --button-bg: #69d7ff;
}

.level-node:nth-of-type(3n) {
  --button-bg: #ff8ed1;
}

.level-node span {
  font-size: 0.78rem;
}

.level-node.locked {
  --button-bg: #c7c7c7;
  opacity: 0.9;
  cursor: not-allowed;
}

.sandbox-node {
  --button-bg: #bcf78d;
}

.sandbox-node img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.critter-card {
  width: 180px;
}

.collection-worlds {
  display: grid;
  gap: 20px;
  padding-bottom: 18px;
}

.collection-world {
  display: grid;
  gap: 10px;
}

.collection-world-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.collection-world-header h3 {
  margin: 0;
  color: #173424;
}

.critter-card-button {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
}

.critter-card-button.locked {
  --button-bg: #c7c7c7;
  cursor: not-allowed;
  opacity: 0.72;
}

.critter-card-button.locked:hover {
  filter: none;
}

.critter-card-image {
  width: 92px;
  height: 92px;
  object-fit: contain;
}

.critter-card-button.locked .critter-card-image {
  filter: brightness(0) opacity(0.5);
}

.critter-detail {
  display: grid;
  gap: 22px;
}

.critter-detail h3 {
  margin: 0 0 10px;
}

.form-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.base-form {
  display: grid;
  justify-content: center;
  margin-bottom: 14px;
}

.base-form .form-card {
  width: min(210px, calc(100vw - 80px));
}

.form-column {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.form-column .form-grid {
  display: grid;
  grid-template-columns: minmax(150px, 210px);
  align-content: start;
  justify-content: center;
  width: 100%;
}

.form-column h4 {
  margin: 0;
  font-size: 1.05rem;
}

.form-grid,
.level-info-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.form-card,
.level-info-card {
  width: 100%;
  min-height: 160px;
  border: 5px solid transparent;
  border-radius: 8px;
  background-origin: border-box, padding-box, border-box;
  background-clip: border-box, padding-box, border-box;
  color: #17112f;
  overflow: hidden;
}

.form-card {
  --button-bg: #fff0a6;
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
}

.form-card:nth-child(2n) {
  --button-bg: #a7ecff;
}

.form-card:nth-child(3n) {
  --button-bg: #ffd0ef;
}

.form-card img,
.form-mystery {
  width: 86px;
  height: 86px;
  object-fit: contain;
}

.form-mystery {
  display: grid;
  place-items: center;
  border: 4px solid #17112f;
  border-radius: 999px;
  background: rgba(23, 17, 47, 0.14);
  font-size: 2.4rem;
  font-weight: 900;
}

.form-card.unseen {
  opacity: 0.78;
}

.level-info-card {
  width: 170px;
  --button-bg: #bcf78d;
  display: grid;
  align-content: start;
  gap: 8px;
}

.mastery-card {
  --button-bg: #a7ecff;
  display: grid;
  gap: 6px;
  min-height: auto;
  padding: 14px;
}

.mastery-perks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.mastery-perk {
  --button-bg: #c7c7c7;
  min-height: 74px;
  padding: 12px;
  font-weight: 800;
  opacity: 0.78;
}

.mastery-perk.unlocked {
  --button-bg: #ffe66f;
  opacity: 1;
}

.potions-section h4 {
  margin: 0 0 8px;
}

.potion-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.potion-grid {
  display: grid;
  gap: 10px;
}

.potion-card {
  --button-bg: #fff0a6;
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 74px;
  border: 5px solid transparent;
  border-radius: 8px;
  background-origin: border-box, padding-box, border-box;
  background-clip: border-box, padding-box, border-box;
  color: #17112f;
  padding: 10px;
  overflow: hidden;
}

.potion-card:nth-child(2n) {
  --button-bg: #a7ecff;
}

.potion-card:nth-child(3n) {
  --button-bg: #ffd0ef;
}

.potion-card img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.potion-card.enemy-potion img {
  filter: brightness(0.72) saturate(0.82);
}

.potion-card div {
  display: grid;
  gap: 3px;
}

.potion-card small {
  line-height: 1.25;
}

@media (max-width: 560px) {
  .form-columns,
  .potion-columns {
    grid-template-columns: 1fr;
  }
}

.game-wrap {
  position: fixed;
  inset: 0;
  background: #000;
}

#game-root {
  width: 100%;
  height: 100%;
}

.hud {
  position: fixed;
  top: env(safe-area-inset-top, 0);
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  pointer-events: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 2px solid rgba(21, 49, 30, 0.92);
  border-radius: 999px;
  background: rgba(255, 250, 220, 0.94);
  color: #173425;
  font-weight: 900;
  pointer-events: auto;
}

.hud .button {
  min-height: 38px;
  padding: 7px 12px;
  pointer-events: auto;
}

.reward-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  font-weight: 900;
}

.reward-line img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.reward-summary {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 4px solid #17112f;
  border-radius: 8px;
  background:
    url("/assets/other/LongButtonHalftoneTopOverlay40.png") center top / auto 58px no-repeat,
    linear-gradient(#fff0a6, #fff0a6);
  color: #17112f;
}

.reward-summary h3,
.reward-summary p {
  margin: 0;
}

.reward-summary p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
}

.reward-summary strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.reward-summary img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.reward-total {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 3px solid rgba(23, 17, 47, 0.28);
  font-size: 1.08rem;
}

.hud-deck-wrap {
  position: relative;
  pointer-events: auto;
}

.hud-kills-toggle {
  cursor: pointer;
  gap: 8px;
  pointer-events: auto;
}

.hud-deck-arrow {
  font-size: 0.78rem;
  line-height: 1;
}

.hud-deck-panel {
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: min(460px, calc(100vw - 18px));
  padding: 10px 10px 14px;
  border: 5px solid #17112f;
  border-radius: 8px;
  background:
    url("/assets/other/LongButtonHalftoneTopOverlay40.png") center top / auto 82px no-repeat,
    linear-gradient(#fff4bf, #fff4bf);
  color: #17112f;
  opacity: 0;
  pointer-events: none;
  transition: opacity 130ms ease, transform 130ms ease;
}

.hud-deck-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.hud-deck-title {
  margin-bottom: 8px;
  font-weight: 900;
  text-align: center;
}

.hud-deck-cards {
  position: relative;
  height: 160px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.hud-critter-card {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: var(--stack-depth, 1);
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 4px;
  width: 104px;
  min-height: 132px;
  padding: 8px;
  border: 5px solid #17112f;
  border-radius: 8px;
  background:
    url("/assets/other/ButtonHalftoneTopOverlay40.png") center top / auto 62px no-repeat,
    linear-gradient(#bdefff, #bdefff);
  color: #17112f;
  font-weight: 900;
  cursor: pointer;
  transform: translate(calc(-50% + var(--stack-x, 0px)), -50%) rotate(var(--stack-tilt, 0deg)) scale(0.92);
  transition: transform 140ms ease, filter 140ms ease;
}

.hud-critter-card.front {
  z-index: 20;
  width: 126px;
  min-height: 150px;
  background:
    url("/assets/other/ButtonHalftoneTopOverlay40.png") center top / auto 70px no-repeat,
    linear-gradient(#ffe66f, #ffe66f);
  transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

.hud-critter-card:not(.front):hover {
  filter: brightness(1.05);
  transform: translate(calc(-50% + var(--stack-hover-x, 0px)), -50%) rotate(var(--stack-hover-tilt, 0deg)) scale(0.96);
}

.hud-critter-card img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.hud-critter-card.front img {
  width: 70px;
  height: 70px;
}

.hud-critter-card small {
  font-size: 0.68rem;
  text-align: center;
}

.hud .pill,
.hud .button {
  transition: opacity 140ms ease;
}

.hud.hud-rescue .pill,
.hud.hud-rescue .button,
.hud.hud-rescue .hud-deck-wrap {
  opacity: 0.3;
  pointer-events: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 18, 13, 0.5);
}

.modal {
  width: min(520px, 100%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border: 3px solid #173425;
  border-radius: 8px;
  background: #fff8d7;
  color: #173425;
  box-shadow: 0 12px 0 rgba(23, 52, 37, 0.4);
}

.loadout-modal {
  width: min(760px, calc(100vw - 24px));
  max-height: min(680px, calc(100vh - 28px));
  overflow: auto;
}

.loadout-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.loadout-topbar h2 {
  margin: 0;
}

.loadout-count {
  min-width: 74px;
  padding: 9px 12px;
  border: 4px solid #17112f;
  border-radius: 999px;
  background: #a7ecff;
  color: #17112f;
  text-align: center;
}

.loadout-worlds {
  display: grid;
  gap: 18px;
}

.loadout-world {
  display: grid;
  gap: 10px;
}

.loadout-world-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.loadout-world-header h3 {
  margin: 0;
  color: #173424;
}

.loadout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 146px));
  justify-content: center;
  gap: 12px;
}

.loadout-card {
  position: relative;
  isolation: isolate;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  min-height: 150px;
  padding: 10px 8px;
  border: 5px solid transparent;
  border-radius: 8px;
  --button-bg: #ffe66f;
  background-image:
    url("/assets/other/LongButtonHalftoneTopOverlay40.png"),
    linear-gradient(var(--button-bg), var(--button-bg)),
    linear-gradient(#17112f, #17112f);
  background-size: auto 68px, auto, auto;
  background-origin: border-box, padding-box, border-box;
  background-clip: border-box, padding-box, border-box;
  color: #17112f;
  font: inherit;
  cursor: pointer;
  overflow: hidden;
}

.loadout-card:nth-child(5n + 1) {
  --button-bg: #ffe66f;
}

.loadout-card:nth-child(5n + 2) {
  --button-bg: #69d7ff;
}

.loadout-card:nth-child(5n + 3) {
  --button-bg: #ff8ed1;
}

.loadout-card:nth-child(5n + 4) {
  --button-bg: #90e85c;
}

.loadout-card:nth-child(5n + 5) {
  --button-bg: #ffd799;
}

.loadout-card:hover {
  filter: brightness(1.05) saturate(1.08);
}

.loadout-card.selected {
  border-color: #ffffff;
  outline: 5px solid #17112f;
  transform: translateY(-2px);
}

.loadout-card .loadout-card-image {
  width: 74px;
  height: 74px;
  object-fit: contain;
}

.loadout-card small {
  min-height: 30px;
  text-align: center;
  line-height: 1.15;
  font-size: 0.72rem;
}

@media (max-width: 560px) {
  .loadout-modal {
    padding: 14px;
  }

  .loadout-grid {
    grid-template-columns: repeat(2, minmax(112px, 1fr));
  }

  .loadout-card {
    min-height: 136px;
  }

  .loadout-card .loadout-card-image {
    width: 62px;
    height: 62px;
  }
}

.modal:has(.path-choice-grid) {
  width: min(1160px, calc(100vw - 20px));
}

.path-choice-modal {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #161433;
}

.path-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 5vw, 72px);
  align-items: center;
}

.path-choice-card {
  position: relative;
  aspect-ratio: 1.32;
  padding: 0;
  border: 0;
  background: transparent;
  color: #161433;
  cursor: pointer;
  font: inherit;
}

.path-choice-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  transform: scale(1.32);
}

.path-choice-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  justify-items: center;
  align-items: center;
  gap: 4px;
  padding: 18% 14% 12%;
  text-align: center;
  transform: translateY(-32px);
}

.path-choice-title {
  font-size: clamp(0.9rem, 2.2vw, 1.25rem);
  font-weight: 1000;
}

.path-choice-critter {
  width: min(132px, 58%);
  max-height: 126px;
  object-fit: contain;
  filter: drop-shadow(0 5px 0 rgba(22, 20, 51, 0.22));
}

.path-choice-name {
  font-size: clamp(0.86rem, 2vw, 1.05rem);
  font-weight: 1000;
}

.path-choice-note {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border: 3px solid #161433;
  border-radius: 999px;
  background: rgba(255, 248, 215, 0.82);
  font-size: clamp(0.75rem, 1.8vw, 0.92rem);
  font-weight: 1000;
}

.path-choice-card:active {
  transform: translateY(2px);
}

.settings-panel {
  display: grid;
  gap: 16px;
}

.settings-slider {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 5px solid #17112f;
  border-radius: 8px;
  background:
    url("/assets/other/LongButtonHalftoneTopOverlay40.png") center top / auto 62px no-repeat,
    linear-gradient(#fff0a6, #fff0a6);
  color: #17112f;
  font-weight: 900;
}

.settings-slider span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.settings-slider input[type="range"] {
  width: 100%;
  accent-color: #69d7ff;
  cursor: pointer;
}

.settings-debug {
  display: grid;
  gap: 10px;
}

.settings-debug summary {
  min-height: 44px;
  padding: 9px 12px;
  border: 5px solid #17112f;
  border-radius: 8px;
  background:
    url("/assets/other/LongButtonHalftoneTopOverlay40.png") center top / auto 52px no-repeat,
    linear-gradient(#ff8ed1, #ff8ed1);
  color: #17112f;
  font-weight: 900;
  cursor: pointer;
  list-style-position: inside;
}

.settings-debug .button {
  width: 100%;
  margin-top: 10px;
}

@media (max-width: 620px) {
  .path-choice-grid {
    grid-template-columns: 1fr;
    width: min(520px, calc(100vw - 20px));
  }
}

.page-transition {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  background: #000;
  opacity: 0;
  transition: opacity 420ms ease;
}

.page-transition.visible {
  opacity: 1;
}

.dev-menu {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: none;
  pointer-events: none;
}

.dev-menu.open {
  display: flex;
}

.dev-panel {
  position: absolute;
  top: max(14px, env(safe-area-inset-top, 0px));
  left: 14px;
  width: min(360px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 5px solid #17112f;
  border-radius: 8px;
  background: rgba(255, 248, 215, 0.96);
  color: #17112f;
  pointer-events: auto;
}

.dev-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.dev-header:active {
  cursor: grabbing;
}

.dev-close {
  width: 34px;
  height: 34px;
  border: 4px solid #17112f;
  border-radius: 999px;
  background: #ff7a6e;
  color: #17112f;
  font-weight: 900;
  cursor: pointer;
}

.dev-actions {
  display: grid;
  gap: 10px;
}

.dev-section {
  display: grid;
  gap: 8px;
}

.dev-section summary {
  min-height: 38px;
  padding: 8px 12px;
  border: 4px solid #17112f;
  border-radius: 8px;
  background:
    url("/assets/other/LongButtonHalftoneTopOverlay40.png") center top / auto 46px no-repeat,
    linear-gradient(#a7ecff, #a7ecff);
  color: #17112f;
  font-weight: 900;
  cursor: pointer;
  list-style-position: inside;
}

.dev-section[open] summary {
  background:
    url("/assets/other/LongButtonHalftoneTopOverlay40.png") center top / auto 46px no-repeat,
    linear-gradient(#bcf78d, #bcf78d);
}

.dev-input-row {
  display: grid;
  gap: 6px;
  color: #17112f;
  font-weight: 900;
}

.dev-input-row input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 4px solid #17112f;
  border-radius: 8px;
  background: #fff8d7;
  color: #17112f;
  font: inherit;
  font-weight: 900;
}

.dev-actions .button {
  width: 100%;
  text-align: left;
  margin-top: 8px;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  background: #000;
  color: #fff8d7;
  opacity: 1;
  transition: opacity 620ms ease;
}

.loading-screen.done {
  opacity: 0;
  pointer-events: none;
}

.loading-text {
  font-size: clamp(1.5rem, 5vw, 3rem);
  font-weight: 900;
  letter-spacing: 0;
}

@media (orientation: portrait) {
  .rotate-note {
    display: block;
  }

  .shop-intro-box {
    grid-template-columns: 82px 1fr;
    gap: 10px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 10px;
  }

  .shop-intro-critter {
    width: 78px;
    height: 78px;
  }

  .shop-intro-copy .button {
    justify-self: stretch;
  }
}

@media (orientation: landscape) {
  .rotate-note {
    display: none;
  }
}
