:root {
  color-scheme: dark;
  --bg: #14150f;
  --panel: #24251b;
  --panel-2: #30311f;
  --text: #f6f0d2;
  --muted: #bab083;
  --green: #8cbd3f;
  --teal: #38b4a2;
  --yellow: #d8b934;
  --red: #ef766d;
  --shadow: rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 22% 15%, rgba(140, 189, 63, 0.18), transparent 32rem),
    linear-gradient(135deg, #15150f 0%, #232316 50%, #10130f 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button {
  font: inherit;
}

.game-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 27rem);
  gap: 1rem;
  min-height: 100vh;
  padding: 1rem;
}

.stage,
.panel {
  border: 1px solid rgba(243, 247, 223, 0.12);
  background: rgba(36, 39, 31, 0.88);
  box-shadow: 0 1.25rem 3rem var(--shadow);
}

.stage {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(18rem, 1fr);
  align-items: center;
  overflow: hidden;
  padding: clamp(1rem, 3vw, 2rem);
  border-radius: 8px;
  background:
    linear-gradient(rgba(17, 16, 10, 0.18), rgba(17, 16, 10, 0.44)),
    url("assets/terrarium-grimy.png") center / cover no-repeat;
}

.stage::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 50% 45%, rgba(216, 185, 52, 0.22), transparent 22rem),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.08), transparent 16%);
}

.status-bar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.eyebrow,
h1,
h2,
p {
  margin: 0;
}

.eyebrow {
  color: var(--yellow);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin-top: 0.2rem;
  font-size: clamp(2.25rem, 7vw, 5.8rem);
  line-height: 0.9;
}

h2 {
  font-size: 1rem;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  aspect-ratio: 1;
  border: 1px solid rgba(243, 247, 223, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
}

.icon-button:hover {
  border-color: rgba(243, 200, 75, 0.68);
}

.icon-button.danger:hover {
  color: var(--red);
}

.score-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.2rem;
  justify-items: center;
  margin-top: 2rem;
}

.score {
  font-size: clamp(3rem, 12vw, 8.5rem);
  font-weight: 900;
  line-height: 0.86;
  text-shadow:
    0 0.4rem 0 rgba(0, 0, 0, 0.28),
    0 0 1.4rem rgba(0, 0, 0, 0.5);
}

.score-label {
  color: #ddd18a;
  font-size: 1rem;
  font-weight: 700;
  text-shadow: 0 0.12rem 0 rgba(0, 0, 0, 0.35);
}

.lizard-button {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: center;
  width: min(47rem, 90vw);
  max-width: 100%;
  aspect-ratio: 1;
  border: 0;
  background: transparent;
  cursor: pointer;
  filter:
    drop-shadow(0 2rem 2rem rgba(0, 0, 0, 0.42))
    saturate(0.96);
  transition:
    transform 120ms ease,
    filter 120ms ease;
}

.lizard-button:hover {
  transform: translateY(-0.35rem) scale(1.015);
}

.lizard-button:active,
.lizard-button.is-licked {
  transform: translateY(0.2rem) scale(0.965);
  filter:
    drop-shadow(0 1rem 1.1rem rgba(0, 0, 0, 0.38))
    saturate(1.18)
    hue-rotate(-8deg);
}

.lizard {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.lick-pop-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.lick-pop {
  position: absolute;
  z-index: 3;
  color: #d8f057;
  font-weight: 900;
  text-shadow: 0 0.15rem 0 rgba(0, 0, 0, 0.28);
  animation: pop 780ms ease-out forwards;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translate(-50%, 0) scale(0.8);
  }

  20% {
    opacity: 1;
  }

  to {
    opacity: 0;
    transform: translate(-50%, -5rem) scale(1.18);
  }
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  border-radius: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.stats-grid div,
.purchase,
.achievement,
.empty-shop {
  border: 1px solid rgba(243, 247, 223, 0.12);
  border-radius: 8px;
  background: var(--panel-2);
}

.stats-grid div {
  display: grid;
  gap: 0.2rem;
  min-height: 5rem;
  padding: 0.9rem;
}

.stats-grid span {
  font-size: 1.65rem;
  font-weight: 900;
}

small {
  color: var(--muted);
  font-weight: 700;
}

.shop,
.achievements {
  display: grid;
  gap: 0.75rem;
}

.purchase-list,
.achievement-list {
  display: grid;
  gap: 0.6rem;
}

.purchase {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  min-height: 5.8rem;
  padding: 0.8rem;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.purchase:not(:disabled):hover {
  border-color: rgba(98, 211, 111, 0.58);
  background: #39402d;
}

.purchase:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.purchase-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  aspect-ratio: 1;
  border-radius: 8px;
  background: rgba(98, 211, 111, 0.15);
  color: var(--green);
  font-size: 1.4rem;
}

.purchase strong,
.purchase span,
.achievement strong,
.achievement span {
  display: block;
}

.purchase strong,
.achievement strong {
  overflow-wrap: anywhere;
}

.purchase span,
.achievement span {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.purchase small {
  display: block;
  margin-top: 0.25rem;
}

.purchase-cost {
  color: var(--yellow);
  font-weight: 900;
  white-space: nowrap;
}

.purchase .purchase-icon {
  display: grid;
  place-items: center;
  margin-top: 0;
  color: var(--green);
  font-size: 1.4rem;
  line-height: 1;
}

.purchase .purchase-cost {
  margin-top: 0;
  color: var(--yellow);
  font-size: inherit;
  line-height: 1.2;
}

.empty-shop {
  padding: 0.8rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.achievement {
  padding: 0.75rem;
  opacity: 0.46;
}

.achievement.is-unlocked {
  border-color: rgba(243, 200, 75, 0.5);
  opacity: 1;
}

@media (max-width: 860px) {
  .game-shell {
    grid-template-columns: 1fr;
  }

  .stage {
    min-height: 34rem;
  }

  .panel {
    min-height: auto;
  }
}

@media (max-width: 520px) {
  .game-shell {
    padding: 0.6rem;
  }

  .stage,
  .panel {
    padding: 0.8rem;
  }

  .purchase {
    grid-template-columns: 2.35rem minmax(0, 1fr);
  }

  .purchase-cost {
    grid-column: 2;
  }
}
