:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f3ec;
  color: #1f2328;
}

/* Demo-ready states */
.bone-score {
  flex-wrap: wrap;
}

.bone-hint {
  flex-basis: 100%;
  padding-left: 42px;
  color: #7b5729;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.home-actions {
  grid-template-columns: repeat(2, minmax(130px, 190px));
}

.home-menu-button.is-locked,
.home-menu-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  filter: grayscale(0.35);
  transform: none;
}

#donateButton::before {
  content: "✦";
  color: #8a64db;
}

.fitting-title-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 3px solid #68419d;
  border-radius: 16px;
  background: linear-gradient(145deg, #fdf4ff, #d9c8ff);
  color: #7044a8;
  font-size: 30px;
  box-shadow: 0 10px 20px rgba(91, 57, 133, 0.16);
}

.donate-price {
  display: none;
}

.donate-item {
  grid-template-columns: 76px minmax(0, 1fr);
}

.tutorial-panel,
.demo-finale,
.restart-confirm {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.tutorial-panel.is-open,
.demo-finale.is-open,
.restart-confirm.is-open {
  opacity: 1;
  pointer-events: auto;
}

.tutorial-panel {
  background:
    radial-gradient(circle at 85% 14%, rgba(255, 238, 124, 0.85) 0 8%, transparent 8.5%),
    linear-gradient(180deg, rgba(192, 237, 249, 0.98) 0 63%, rgba(126, 202, 99, 0.98) 63%);
}

.tutorial-card {
  display: grid;
  gap: 15px;
  width: min(670px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 24px;
  border: 4px solid rgba(85, 57, 29, 0.28);
  border-radius: 24px;
  background: rgba(255, 253, 238, 0.96);
  box-shadow: 0 24px 70px rgba(47, 70, 38, 0.28);
  text-align: center;
}

.tutorial-mark {
  font-size: 36px;
  line-height: 1;
}

.tutorial-card h2,
.restart-confirm-card h2 {
  margin: 0;
  color: #4e351d;
  font-size: clamp(27px, 5vw, 40px);
}

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

.tutorial-grid p {
  display: grid;
  gap: 4px;
  padding: 13px;
  border-radius: 14px;
  background: #f4edd4;
  color: #573d26;
  font-size: 14px;
  text-align: left;
}

.tutorial-grid strong {
  color: #295847;
  font-size: 17px;
}

.tutorial-boss-tip {
  max-width: none;
  color: #8a3d31;
  font-weight: 800;
}

.tutorial-card button {
  justify-self: center;
  min-width: 220px;
  background: #4c8d51;
}

.demo-finale {
  overflow: hidden;
  background: linear-gradient(180deg, #aee4f5 0 64%, #81ca65 64%);
}

.finale-sun {
  position: absolute;
  top: 8%;
  right: 10%;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: #ffe176;
  box-shadow: 0 0 0 14px rgba(255, 225, 118, 0.25);
}

.finale-cloud {
  position: absolute;
  width: 115px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
}

.finale-cloud::before,
.finale-cloud::after {
  content: "";
  position: absolute;
  bottom: 0;
  border-radius: 50%;
  background: inherit;
}

.finale-cloud::before { left: 18px; width: 48px; height: 48px; }
.finale-cloud::after { right: 16px; width: 58px; height: 58px; }
.finale-cloud-one { top: 16%; left: 8%; }
.finale-cloud-two { top: 30%; right: 24%; transform: scale(0.7); }

.finale-hills {
  position: absolute;
  right: -10%;
  bottom: 16%;
  left: -10%;
  height: 35%;
  border-radius: 50% 50% 0 0;
  background: #6dbb59;
}

.finale-dog {
  position: absolute;
  z-index: 2;
  left: 12%;
  bottom: 2%;
  width: auto;
  height: 62%;
  max-width: 38%;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 16px 13px rgba(49, 75, 39, 0.25));
}

.finale-dialog {
  position: relative;
  z-index: 3;
  justify-self: end;
  display: grid;
  gap: 12px;
  width: min(570px, 63%);
  padding: clamp(18px, 3vw, 30px);
  border: 4px solid #6a431c;
  border-radius: 24px;
  background: rgba(255, 253, 238, 0.97);
  box-shadow: 0 22px 60px rgba(64, 61, 35, 0.26);
}

.finale-dialog::before {
  content: "";
  position: absolute;
  left: -27px;
  bottom: 28%;
  border-top: 18px solid transparent;
  border-right: 28px solid #6a431c;
  border-bottom: 18px solid transparent;
}

.finale-dialog strong {
  color: #2c694b;
  font-size: 20px;
}

.finale-dialog p {
  max-width: none;
  color: #4d351f;
  font-size: clamp(20px, 3.3vw, 31px);
  font-weight: 900;
  line-height: 1.25;
}

.finale-actions,
.restart-confirm-card > div {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.finale-actions button {
  flex: 1;
  min-width: 170px;
}

.finale-actions button:last-child {
  background: #7652ac;
}

.finale-bug-report {
  justify-self: center;
  color: #3478c8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.restart-confirm {
  background: rgba(26, 36, 36, 0.72);
}

.restart-confirm-card {
  display: grid;
  gap: 13px;
  width: min(480px, 100%);
  padding: 25px;
  border-radius: 22px;
  background: #fffdf2;
  box-shadow: 0 24px 80px rgba(11, 22, 22, 0.36);
  text-align: center;
}

.restart-confirm-card > span {
  color: #bf643d;
  font-size: 42px;
  line-height: 1;
}

.restart-confirm-card p {
  max-width: none;
  color: #654d3a;
}

.restart-confirm-card button {
  flex: 1;
  min-width: 160px;
}

#restartConfirmButton {
  background: #a23f3f;
}

.game-toast {
  position: absolute;
  z-index: 14;
  top: 14px;
  left: 50%;
  width: min(520px, calc(100% - 180px));
  padding: 12px 16px;
  border: 2px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  background: rgba(37, 74, 69, 0.94);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 12px 30px rgba(25, 45, 43, 0.27);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.game-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.save-status {
  position: absolute;
  z-index: 13;
  right: 14px;
  bottom: 14px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(238, 255, 238, 0.92);
  color: #28734b;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 7px 18px rgba(34, 83, 54, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.save-status.is-visible {
  opacity: 1;
}

.save-status.is-error {
  background: rgba(255, 239, 235, 0.94);
  color: #9b3f36;
}

@media (max-width: 680px) {
  .save-status {
    right: auto;
    bottom: 8px;
    left: 50%;
    padding: 4px 8px;
    font-size: 9px;
    transform: translateX(-50%);
  }
}

.touch-controls {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: none;
  align-items: flex-end;
  justify-content: space-between;
  padding: 12px;
  pointer-events: none;
}

.touch-move-controls {
  display: flex;
  gap: 9px;
}

.touch-control {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  min-width: 64px;
  padding: 0;
  border: 3px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  background: rgba(34, 74, 79, 0.74);
  font-size: 30px;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(31, 35, 40, 0.25);
  backdrop-filter: blur(4px);
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.touch-control.is-pressed {
  background: rgba(247, 183, 64, 0.9);
  transform: scale(0.94);
}

.touch-jump-control {
  gap: 0;
  width: 76px;
  height: 76px;
  min-width: 76px;
  background: rgba(76, 141, 81, 0.8);
}

.touch-jump-control small {
  font-size: 10px;
  text-transform: uppercase;
}

@media (hover: none), (pointer: coarse), (max-width: 900px) {
  .touch-controls {
    display: flex;
  }
}

@media (max-width: 680px) {
  body {
    display: block;
    min-height: 100dvh;
    padding: 6px;
  }

  .game-shell {
    width: 100%;
  }

  .topbar {
    flex-flow: row nowrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
  }

  .topbar h1 {
    margin: 0;
    font-size: 22px;
  }

  .topbar p,
  .controls {
    display: none;
  }

  .topbar button {
    width: auto;
    min-width: 82px;
    padding: 8px 10px;
    font-size: 13px;
  }

  .hud {
    display: grid;
    grid-template-columns: repeat(5, auto) minmax(80px, 1fr);
    align-items: center;
    gap: 5px 9px;
    min-height: 0;
    margin-bottom: 5px;
    padding: 5px 7px;
    font-size: 12px;
  }

  .bone-score img { width: 25px; height: 25px; }
  .bone-score { gap: 3px; }
  .bone-hint { display: none; }
  .coin-icon { width: 20px; height: 20px; }
  .diamond-icon { width: 20px; height: 20px; }
  .hp-meter, .hp-ring { width: 38px; height: 38px; min-width: 38px; }
  .age-score { min-width: 0; font-size: 10px; }
  #statusText { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .game-stage {
    width: 100%;
  }

  .side-actions {
    top: 7px;
    left: 7px;
    gap: 5px;
  }

  .shop-button,
  .inventory-button,
  .settings-button {
    width: 38px;
    height: 38px;
  }

  .quickbar {
    top: 7px;
    bottom: auto;
    grid-template-columns: repeat(7, minmax(25px, 1fr));
    gap: 3px;
    width: min(61%, 310px);
    padding: 4px;
  }

  .experience-meter {
    display: none;
  }

  .quickbar-slot {
    border-width: 1px;
    border-radius: 5px;
  }

  .quest-alert-button,
  .daily-quest-button {
    top: 7px;
    width: 38px;
    height: 38px;
    border-width: 2px;
    font-size: 24px;
    box-shadow: 0 4px 0 #b96520, 0 8px 15px rgba(67, 43, 21, 0.24);
  }

  .quest-alert-button { right: 7px; }
  .daily-quest-button { right: 50px; }

  .boss-hud {
    top: 50px;
    width: calc(100% - 110px);
    padding: 6px 9px 8px;
  }

  .touch-controls {
    padding: 8px;
  }

  .touch-control {
    width: 54px;
    height: 54px;
    min-width: 54px;
    font-size: 25px;
  }

  .touch-jump-control {
    width: 62px;
    height: 62px;
    min-width: 62px;
  }

  .game-toast {
    top: 50px;
    width: calc(100% - 22px);
    padding: 8px 11px;
    border-radius: 12px;
    font-size: 11px;
  }

  .tutorial-panel,
  .demo-finale,
  .restart-confirm {
    padding: 9px;
  }

  .tutorial-card {
    gap: 8px;
    padding: 13px;
    border-width: 3px;
  }

  .tutorial-mark { display: none; }
  .tutorial-card h2 { font-size: 23px; }
  .tutorial-grid { gap: 6px; }
  .tutorial-grid p { padding: 7px; font-size: 10px; }
  .tutorial-grid strong { font-size: 13px; }
  .tutorial-boss-tip { font-size: 11px; }
  .tutorial-card button { width: auto; min-width: 180px; padding: 9px 12px; }

  .finale-dog {
    left: 4%;
    height: 50%;
    max-width: 34%;
  }

  .finale-dialog {
    width: 70%;
    padding: 13px;
    border-width: 3px;
    border-radius: 15px;
  }

  .finale-dialog p { font-size: 14px; }
  .finale-dialog strong { font-size: 13px; }
  .finale-actions { gap: 5px; }
  .finale-actions button { min-width: 0; width: 100%; padding: 7px; font-size: 10px; }
  .finale-bug-report { font-size: 9px; }
  .finale-cloud-two { display: none; }

  .home-actions {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }

  .donate-item {
    grid-template-columns: 64px minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(120, 188, 214, 0.28), rgba(245, 243, 236, 0) 42%),
    #f5f3ec;
}

.game-shell {
  width: min(100%, 1040px);
}

.topbar,
.hud,
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 14px;
}

h1 {
  margin: 0 0 4px;
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1;
}

p {
  margin: 0;
  max-width: 680px;
  color: #5f6368;
  font-size: 16px;
}

button {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 12px 18px;
  min-width: 110px;
  background: #224a4f;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(34, 74, 79, 0.18);
}

button:hover {
  background: #17383c;
}

.hud {
  min-height: 44px;
  margin-bottom: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(31, 35, 40, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 700;
}

.bone-score {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.bone-score img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  transform: rotate(-18deg);
  filter: drop-shadow(0 2px 2px rgba(92, 61, 30, 0.18));
}

.coin-score {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.diamond-score {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.diamond-icon {
  display: inline-block;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  clip-path: polygon(50% 0, 88% 24%, 100% 58%, 50% 100%, 0 58%, 12% 24%);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0 13%, transparent 14%),
    linear-gradient(135deg, #d8fbff 0%, #63d8f5 40%, #258bdc 68%, #8b65df 100%);
  filter: drop-shadow(0 2px 2px rgba(31, 71, 118, 0.28));
}

.coin-icon {
  position: relative;
  width: 26px;
  height: 26px;
  border: 2px solid #9f6a12;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #fff4a9 0 18%, transparent 19%),
    linear-gradient(135deg, #ffe476 0%, #f5b936 48%, #c77d16 100%);
  box-shadow: 0 2px 3px rgba(112, 71, 12, 0.2);
}

.coin-icon::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px solid rgba(131, 80, 10, 0.35);
  border-radius: 50%;
}

.hp-meter {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  min-width: 58px;
}

.hp-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding: 5px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 4px 10px rgba(117, 35, 48, 0.16),
    inset 0 0 0 1px rgba(117, 35, 48, 0.16);
}

.hp-ring-svg {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: visible;
  transform: rotate(-45deg);
}

.hp-ring-health,
.hp-ring-damage {
  fill: none;
  stroke-width: 5;
}

.hp-ring-health {
  stroke: #e13648;
}

.hp-ring-damage {
  stroke: #fffaf4;
  stroke-linecap: butt;
}

.hp-ring::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  pointer-events: none;
}

.hp-ring img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(31, 35, 40, 0.12);
}

.hp-meter.is-hit .hp-ring {
  animation: hp-hit 260ms ease;
}

.age-score {
  display: inline-flex;
  align-items: center;
  min-width: 110px;
  color: #6b3d1e;
  white-space: nowrap;
}

@keyframes hp-hit {
  0% {
    transform: scale(1);
  }

  42% {
    transform: scale(1.12);
    filter: drop-shadow(0 0 10px rgba(225, 54, 72, 0.42));
  }

  100% {
    transform: scale(1);
  }
}

#statusText {
  flex: 1;
  text-align: right;
  color: #6b3d1e;
}

.game-stage {
  position: relative;
}

.boss-hud {
  position: absolute;
  z-index: 6;
  top: 16px;
  left: 50%;
  width: min(420px, calc(100% - 190px));
  padding: 10px 14px 12px;
  border: 2px solid rgba(105, 34, 20, 0.72);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 248, 218, 0.96), rgba(255, 220, 157, 0.94));
  box-shadow: 0 8px 24px rgba(80, 30, 18, 0.28);
  transform: translateX(-50%);
  pointer-events: none;
}

.boss-hud[hidden] {
  display: none;
}

.boss-hud-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  color: #66271c;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.boss-hud-title strong {
  flex: 1;
  text-align: center;
}

.boss-health-track {
  height: 15px;
  overflow: hidden;
  border: 2px solid rgba(98, 35, 22, 0.72);
  border-radius: 999px;
  background: rgba(97, 41, 31, 0.2);
}

.boss-health-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #db2c2c, #ff713e 70%, #ffb34b);
  box-shadow: inset 0 2px 2px rgba(255, 255, 255, 0.45);
  transition: width 180ms ease-out;
}

.boss-hud.is-defeated {
  border-color: rgba(132, 92, 15, 0.76);
  background: linear-gradient(180deg, rgba(255, 252, 219, 0.97), rgba(255, 220, 91, 0.95));
}

.quickbar {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 14px;
  display: grid;
  grid-template-columns: repeat(7, 52px);
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(236, 250, 232, 0.96), rgba(195, 229, 174, 0.96));
  box-shadow: 0 14px 34px rgba(31, 35, 40, 0.18);
  transform: translateX(-50%);
}

@media (min-width: 681px) and (min-height: 601px) {
  .game-stage {
    margin-bottom: 128px;
  }

  .quickbar {
    bottom: -116px;
    border-color: rgba(92, 130, 66, 0.34);
    box-shadow: 0 12px 28px rgba(42, 73, 35, 0.18);
  }

  .tutorial-panel.is-open ~ .quickbar,
  .demo-finale.is-open ~ .quickbar,
  .home-screen.is-open ~ .quickbar {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }
}

.experience-meter {
  grid-column: 1 / -1;
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  padding: 0 2px;
  color: #f4ffe9;
}

.experience-meter.is-level-up {
  animation: experience-level-up 700ms ease;
}

.experience-meter-title {
  display: grid;
  place-items: center;
  min-height: 20px;
  font-weight: 1000;
  line-height: 1;
}

.experience-meter-title strong {
  color: #9aef49;
  font-size: 21px;
  text-shadow:
    -1px -1px 0 #245b29,
    1px -1px 0 #245b29,
    -1px 1px 0 #245b29,
    1px 1px 0 #245b29,
    0 3px 6px rgba(26, 68, 31, 0.52);
}

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

.experience-segments span {
  height: 9px;
  border: 1px solid rgba(24, 70, 31, 0.66);
  border-radius: 3px;
  background: rgba(222, 241, 199, 0.28);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25);
  transition:
    background 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.experience-segments span.is-filled {
  background: linear-gradient(180deg, #a9ef55, #41b94d);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.6),
    0 0 6px rgba(115, 224, 78, 0.58);
  transform: translateY(-1px);
}

@keyframes experience-level-up {
  0%,
  100% {
    filter: brightness(1);
    transform: scale(1);
  }
  45% {
    filter: brightness(1.35);
    transform: scale(1.045);
  }
}

.quickbar-slot {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  min-width: 0;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(31, 35, 40, 0.12);
  box-shadow:
    inset 0 0 0 1px rgba(31, 35, 40, 0.12),
    0 8px 18px rgba(31, 35, 40, 0.1);
}

.quickbar-slot:hover,
.quickbar-slot.has-item {
  background: rgba(255, 248, 219, 0.64);
  border-color: rgba(247, 201, 90, 0.86);
}

.quickbar-slot img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 5px 8px rgba(83, 43, 30, 0.22));
  pointer-events: none;
}

.carrot-icon {
  display: inline-block;
  width: 52px;
  height: 58px;
  background: transparent url("assets/carrot-v2.png?v=20260830-1") center / contain no-repeat;
  filter: drop-shadow(0 5px 8px rgba(83, 43, 30, 0.18));
}

.carrot-icon::before,
.carrot-icon::after {
  content: none;
}

.quickbar-carrot-icon {
  width: 48px;
  height: 48px;
}

.shell-icon {
  display: inline-block;
  width: 58px;
  height: 44px;
  background: transparent url("assets/turtle-shell-simple.png?v=20260808-1") center / contain no-repeat;
  filter: drop-shadow(0 5px 7px rgba(31, 35, 40, 0.2));
}

.shell-icon::before,
.shell-icon::after {
  content: none;
}

.quickbar-shell-icon {
  width: 50px;
  height: 38px;
}

.stinger-icon {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 46px;
  filter: drop-shadow(0 5px 8px rgba(31, 35, 40, 0.18));
}

.stinger-icon::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 5px;
  width: 14px;
  height: 35px;
  border: 2px solid #5f4314;
  border-radius: 11px 11px 4px 4px;
  background: linear-gradient(180deg, #ffe680 0 24%, #2e2518 25% 39%, #f1b835 40% 62%, #2e2518 63% 76%, #f7d14f 77% 100%);
  transform: rotate(28deg);
}

.stinger-icon::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 31px;
  width: 26px;
  height: 14px;
  background: linear-gradient(135deg, #f7f0dc 0%, #d6c4a1 58%, #8f7751 100%);
  clip-path: polygon(0 50%, 100% 0, 72% 52%, 100% 100%);
  transform: rotate(28deg);
}

.quickbar-stinger-icon {
  width: 40px;
  height: 40px;
}

.blue-orb-icon {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 48px;
  border: 3px solid #1b5ca8;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.88) 0 13%, transparent 14%),
    radial-gradient(circle at 50% 55%, #6ee7ff 0%, #248de8 54%, #173f9a 100%);
  box-shadow:
    0 0 14px rgba(76, 198, 255, 0.58),
    inset -7px -9px 14px rgba(16, 40, 108, 0.34);
}

.blue-orb-icon::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 2px solid rgba(188, 243, 255, 0.48);
  border-radius: 50%;
}

.quickbar-blue-orb-icon {
  width: 40px;
  height: 40px;
}

.rotten-flesh-icon {
  display: inline-block;
  width: 52px;
  height: 52px;
  background: transparent url("assets/rotten-flesh-v2.png?v=20260808-1") center / contain no-repeat;
  filter: drop-shadow(0 5px 7px rgba(31, 35, 40, 0.22));
}

.rotten-flesh-icon::before,
.rotten-flesh-icon::after {
  content: none;
}

.quickbar-rotten-flesh-icon {
  width: 44px;
  height: 44px;
}

.quickbar-count {
  position: absolute;
  right: 4px;
  bottom: 3px;
  min-width: 21px;
  padding: 2px 5px;
  border: 1px solid rgba(85, 57, 29, 0.22);
  border-radius: 999px;
  background: rgba(255, 248, 219, 0.94);
  color: #55391d;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  pointer-events: none;
}

.side-actions {
  position: absolute;
  z-index: 5;
  top: 14px;
  left: 14px;
  display: grid;
  gap: 8px;
}

.quest-alert-button {
  position: absolute;
  z-index: 7;
  top: 15px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  min-width: 0;
  padding: 0;
  border: 4px solid #fff4b8;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffdf57, #ff9f2f);
  color: #704014;
  font-family: inherit;
  font-size: 43px;
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.58);
  box-shadow:
    0 8px 0 #b96520,
    0 14px 25px rgba(67, 43, 21, 0.32);
  animation: quest-alert-pulse 1.7s ease-in-out infinite;
}

.quest-alert-button[hidden] {
  display: none;
}

.quest-alert-button:hover,
.quest-alert-button[aria-expanded="true"] {
  transform: translateY(-2px) scale(1.05);
}

.quest-alert-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.quest-alert-button.is-complete {
  border-color: #dfffc1;
  background: linear-gradient(145deg, #bdf36c, #55bf58);
  box-shadow:
    0 8px 0 #278045,
    0 14px 25px rgba(39, 128, 69, 0.32);
}

.daily-quest-button {
  position: absolute;
  z-index: 7;
  top: 15px;
  right: 90px;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  min-width: 0;
  padding: 0;
  border: 4px solid #fff8ca;
  border-radius: 50%;
  background: linear-gradient(145deg, #fff58d, #ffb52f);
  color: #925316;
  font-family: inherit;
  font-size: 35px;
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.65);
  box-shadow:
    0 8px 0 #c97620,
    0 14px 25px rgba(91, 54, 20, 0.3);
}

.daily-quest-button:hover,
.daily-quest-button[aria-expanded="true"] {
  transform: translateY(-2px) scale(1.05);
}

.daily-quest-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.daily-quest-button.has-reward {
  border-color: #dfffc1;
  background: linear-gradient(145deg, #d8ff7d, #6fce54);
  box-shadow:
    0 8px 0 #388944,
    0 14px 25px rgba(39, 128, 69, 0.32);
  animation: quest-alert-pulse 1.4s ease-in-out infinite;
}

@keyframes quest-alert-pulse {
  0%,
  100% {
    filter: drop-shadow(0 0 0 rgba(255, 214, 69, 0));
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(255, 214, 69, 0.78));
  }
}

.quest-panel {
  position: absolute;
  z-index: 8;
  top: 88px;
  right: 16px;
  width: min(340px, calc(100% - 32px));
  padding: 18px;
  border: 4px solid #f0ba42;
  border-radius: 20px;
  background:
    radial-gradient(circle at 92% 8%, rgba(255, 222, 101, 0.42), transparent 33%),
    #fff9df;
  color: #55391d;
  box-shadow: 0 18px 42px rgba(61, 40, 24, 0.34);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px) scale(0.96);
  transform-origin: top right;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.quest-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.quest-panel-header {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 11px;
}

.quest-panel-mark {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: linear-gradient(145deg, #ffdf57, #ff9f2f);
  color: #704014;
  font-size: 35px;
  font-weight: 1000;
  box-shadow: inset 0 -4px 0 rgba(152, 83, 26, 0.2);
}

.quest-panel-header small {
  display: block;
  margin-bottom: 2px;
  color: #a36a2c;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quest-panel-header h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.05;
}

.quest-close-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #79502d;
  color: white;
  font-size: 27px;
  line-height: 1;
}

.quest-description {
  margin: 17px 0 13px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}

.quest-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.quest-progress-track {
  height: 15px;
  overflow: hidden;
  border: 2px solid rgba(85, 57, 29, 0.2);
  border-radius: 999px;
  background: #eadfbd;
}

.quest-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #61ca65, #b5e55d);
  transition: width 220ms ease;
}

.quest-progress strong {
  min-width: 45px;
  font-size: 15px;
  text-align: right;
}

.quest-reward {
  margin: 14px 0 12px;
  color: #8a5928;
  font-size: 14px;
}

.quest-claim-button {
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(180deg, #76d96f, #3fb659);
  color: #173f26;
  font-family: inherit;
  font-size: 15px;
  font-weight: 1000;
  box-shadow: 0 5px 0 #278045;
}

.quest-claim-button:disabled {
  background: #d8cdb0;
  color: #8b8065;
  box-shadow: 0 4px 0 #b7aa8c;
  cursor: default;
}

.daily-quest-panel {
  position: absolute;
  z-index: 8;
  top: 88px;
  right: 16px;
  width: min(390px, calc(100% - 32px));
  max-height: calc(100% - 112px);
  overflow-y: auto;
  padding: 18px;
  border: 4px solid #e8a92f;
  border-radius: 22px;
  background:
    radial-gradient(circle at 8% 2%, rgba(255, 243, 139, 0.75), transparent 35%),
    #fff9df;
  color: #55391d;
  box-shadow: 0 18px 42px rgba(61, 40, 24, 0.34);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px) scale(0.96);
  transform-origin: top right;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.daily-quest-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.daily-quest-panel-header {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 11px;
}

.daily-quest-panel-mark {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: linear-gradient(145deg, #fff58d, #ffb52f);
  color: #925316;
  font-size: 29px;
  box-shadow: inset 0 -4px 0 rgba(152, 83, 26, 0.18);
}

.daily-quest-panel-header small {
  display: block;
  margin-bottom: 2px;
  color: #a36a2c;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.daily-quest-panel-header h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.05;
}

.daily-quest-close-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #79502d;
  color: white;
  font-size: 27px;
  line-height: 1;
}

.daily-quest-reset-text {
  margin: 12px 0;
  color: #9a642b;
  font-size: 13px;
  font-weight: 850;
}

.daily-quest-list {
  display: grid;
  gap: 10px;
}

.daily-quest-card {
  padding: 12px;
  border: 2px solid #ead29a;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.62);
}

.daily-quest-card.is-complete {
  border-color: #83c963;
  background: #f1ffe5;
}

.daily-quest-card.is-claimed {
  opacity: 0.72;
}

.daily-quest-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.daily-quest-card p {
  margin: 0 0 9px;
  color: #735231;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.daily-quest-card-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.daily-quest-card-track {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #eadfbd;
}

.daily-quest-card-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffb52f, #ffe45d);
}

.daily-quest-card.is-complete .daily-quest-card-track span {
  background: linear-gradient(90deg, #61ca65, #b5e55d);
}

.daily-quest-card-progress strong {
  min-width: 42px;
  font-size: 13px;
  text-align: right;
}

.daily-quest-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.daily-quest-card-reward {
  color: #8a5928;
  font-size: 12px;
  font-weight: 850;
}

.daily-quest-claim-button {
  width: auto;
  min-width: 118px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #76d96f, #3fb659);
  color: #173f26;
  font-family: inherit;
  font-size: 12px;
  font-weight: 1000;
  box-shadow: 0 4px 0 #278045;
}

.daily-quest-claim-button:disabled {
  background: #d8cdb0;
  color: #8b8065;
  box-shadow: 0 3px 0 #b7aa8c;
  cursor: default;
}

canvas.is-raccoon-hover {
  cursor: pointer;
}

.raccoon-dialogue,
.raccoon-shop-panel {
  position: absolute;
  z-index: 18;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 170ms ease;
}

.raccoon-dialogue.is-open,
.raccoon-shop-panel.is-open {
  opacity: 1;
  pointer-events: auto;
}

.raccoon-dialogue {
  display: grid;
  align-items: end;
  padding: 22px 22px 94px;
  background: linear-gradient(180deg, transparent 32%, rgba(20, 27, 29, 0.44));
}

.raccoon-dialogue-card {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  align-items: end;
  gap: 16px;
  width: min(610px, 100%);
  margin: 0 auto;
  padding: 17px 18px;
  border: 4px solid #c59753;
  border-radius: 22px;
  background: linear-gradient(145deg, #fff8dc, #e9d2a0);
  box-shadow: 0 18px 48px rgba(13, 20, 22, 0.42);
}

.raccoon-dialogue-card > img {
  width: 118px;
  height: 118px;
  object-fit: contain;
  filter: drop-shadow(0 8px 8px rgba(35, 30, 24, 0.24));
}

.raccoon-dialogue-copy {
  display: grid;
  gap: 8px;
}

.raccoon-dialogue-copy strong {
  color: #754720;
  font-size: 21px;
}

.raccoon-dialogue-copy p {
  min-height: 44px;
  margin: 0;
  color: #4b3928;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}

.raccoon-dialogue-copy button {
  justify-self: end;
  min-width: 112px;
  padding: 9px 16px;
  border: 0;
  border-radius: 12px;
  background: #79502d;
  color: #fff8e7;
  font-weight: 1000;
}

.raccoon-shop-panel {
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(25, 31, 32, 0.62);
  backdrop-filter: blur(5px);
}

.raccoon-shop-card {
  position: relative;
  display: grid;
  gap: 15px;
  width: min(720px, 100%);
  max-height: calc(100% - 12px);
  padding: 22px;
  overflow: auto;
  border: 5px solid #b98547;
  border-radius: 24px;
  background:
    radial-gradient(circle at 92% 8%, rgba(255, 218, 112, 0.28), transparent 34%),
    linear-gradient(145deg, #fff7d9, #e8d09b);
  box-shadow: 0 26px 75px rgba(9, 15, 17, 0.54);
}

.raccoon-shop-close {
  position: absolute;
  z-index: 2;
  top: 13px;
  right: 13px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 13px;
  background: #69472d;
  color: white;
  font-size: 28px;
  line-height: 1;
}

.raccoon-shop-header {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding-right: 42px;
}

.raccoon-shop-header > img {
  width: 94px;
  height: 94px;
  object-fit: contain;
  filter: drop-shadow(0 7px 8px rgba(50, 39, 27, 0.22));
}

.raccoon-shop-header small {
  color: #9a6935;
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.raccoon-shop-header h2 {
  margin: 2px 0 3px;
  color: #50371f;
  font-size: 29px;
}

.raccoon-shop-header p {
  margin: 0;
  color: #795b39;
  font-size: 14px;
  font-weight: 800;
}

.raccoon-shop-wallet {
  display: grid;
  grid-template-columns: 25px auto;
  align-items: center;
  gap: 5px 7px;
  padding: 9px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  color: #50371f;
}

.raccoon-shop-wallet .coin-icon,
.raccoon-shop-wallet .diamond-icon,
.raccoon-item-price .coin-icon,
.raccoon-item-price .diamond-icon {
  width: 23px;
  height: 23px;
}

.raccoon-shop-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.raccoon-shop-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 13px;
  border: 2px solid rgba(103, 72, 39, 0.18);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.72);
  color: #50371f;
  text-align: left;
  box-shadow: 0 8px 18px rgba(70, 50, 29, 0.12);
}

.raccoon-shop-item:hover:not(:disabled) {
  border-color: #e1a94e;
  background: #fffdf1;
  transform: translateY(-2px);
}

.raccoon-shop-item:disabled {
  cursor: default;
  opacity: 0.55;
  filter: grayscale(0.45);
}

.raccoon-shop-item.is-sold {
  position: relative;
}

.raccoon-shop-item.is-sold::after {
  position: absolute;
  inset: 8px 8px auto auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: #6e543a;
  color: #fff7df;
  content: "Продано";
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.raccoon-shop-item.is-unaffordable:not(.is-sold) {
  border-color: rgba(166, 72, 61, 0.42);
}

.raccoon-shop-item > img,
.raccoon-experience-orb {
  grid-row: 1 / 3;
  align-self: center;
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.raccoon-experience-orb {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #e7ffb0, #78d84e 52%, #287348 100%);
  color: white;
  font-size: 31px;
  text-shadow: 0 2px 5px #245b29;
  box-shadow: 0 0 12px rgba(83, 194, 72, 0.48);
}

.raccoon-shop-item > span:nth-child(2) {
  display: grid;
  align-content: center;
  gap: 4px;
}

.raccoon-shop-item strong {
  font-size: 15px;
  line-height: 1.1;
}

.raccoon-shop-item small {
  color: #856847;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.raccoon-item-price {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #294d52;
  color: white;
  font-size: 14px;
  font-weight: 1000;
}

.raccoon-shop-status {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(112, 78, 39, 0.1);
  color: #76532d;
  font-size: 13px;
  font-weight: 850;
  text-align: center;
}

.shop-button,
.inventory-button,
.settings-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 56px;
  min-width: 0;
  padding: 0;
  border: 2px solid rgba(31, 35, 40, 0.18);
  border-radius: 8px;
  background: #f7c95a;
  box-shadow: 0 12px 26px rgba(31, 35, 40, 0.18);
}

.shop-button:hover,
.shop-button[aria-expanded="true"],
.inventory-button:hover,
.inventory-button[aria-expanded="true"],
.settings-button:hover,
.settings-button[aria-expanded="true"] {
  background: #e8b842;
}

.shop-button:disabled,
.inventory-button:disabled,
.settings-button:disabled {
  cursor: default;
  opacity: 0.45;
  filter: grayscale(0.35);
}

.shop-button:disabled:hover,
.inventory-button:disabled:hover,
.settings-button:disabled:hover {
  background: #f7c95a;
}

.shop-button,
.inventory-button,
.settings-button {
  width: 54px;
  height: 60px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.shop-button:hover,
.shop-button[aria-expanded="true"],
.inventory-button:hover,
.inventory-button[aria-expanded="true"],
.settings-button:hover,
.settings-button[aria-expanded="true"],
.shop-button:disabled:hover,
.inventory-button:disabled:hover,
.settings-button:disabled:hover {
  background: transparent;
}

.shop-button:focus-visible,
.inventory-button:focus-visible,
.settings-button:focus-visible {
  outline: none;
}

.shop-button:hover .shop-button-icon,
.shop-button[aria-expanded="true"] .shop-button-icon,
.inventory-button:hover .inventory-button-icon,
.inventory-button[aria-expanded="true"] .inventory-button-icon,
.shop-button:focus-visible .shop-button-icon,
.inventory-button:focus-visible .inventory-button-icon,
.settings-button:hover .settings-button-icon,
.settings-button[aria-expanded="true"] .settings-button-icon,
.settings-button:focus-visible .settings-button-icon {
  filter: drop-shadow(0 3px 4px rgba(85, 57, 29, 0.32));
  transform: scale(1.06);
}

.shop-button-icon,
.shop-panel-icon,
.inventory-button-icon,
.inventory-panel-icon,
.settings-button-icon,
.settings-panel-icon {
  position: relative;
  display: inline-block;
}

.settings-button-icon,
.settings-panel-icon {
  width: 46px;
  height: 46px;
  background: transparent url("assets/ui-settings-icon-transparent.png?v=20260808-1") center / contain no-repeat;
}

.settings-button-icon::before,
.settings-button-icon::after,
.settings-panel-icon::before,
.settings-panel-icon::after {
  content: none;
}

.shop-button-icon,
.shop-panel-icon {
  width: 46px;
  height: 46px;
  background: transparent url("assets/ui-shop-icon-transparent.png?v=20260808-1") center / contain no-repeat;
}

.shop-button-icon::before,
.shop-panel-icon::before {
  content: none;
}

.inventory-button-icon,
.inventory-panel-icon {
  width: 46px;
  height: 46px;
  background: transparent url("assets/ui-inventory-icon-transparent.png?v=20260808-1") center / contain no-repeat;
}

.inventory-button-icon::before,
.inventory-panel-icon::before {
  content: none;
}

.inventory-button-icon::after,
.inventory-panel-icon::after {
  content: none;
}

.shop-panel,
.inventory-panel,
.settings-panel {
  position: absolute;
  z-index: 6;
  top: 12px;
  bottom: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  width: min(340px, calc(100% - 24px));
  padding: 14px;
  border: 2px solid rgba(31, 35, 40, 0.18);
  border-radius: 8px;
  background: rgba(255, 252, 244, 0.96);
  box-shadow: 0 24px 70px rgba(31, 35, 40, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-18px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.shop-panel {
  overflow: hidden;
}

.inventory-panel {
  bottom: 96px;
  width: min(340px, calc(100% - 24px));
}

.settings-panel {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  width: 100%;
  min-height: 100%;
  padding: 28px;
  border: 0;
  border-radius: 0;
  background: rgba(20, 24, 28, 0.28);
  box-shadow: none;
}

.settings-panel .shop-header {
  width: min(420px, 100%);
}

.settings-panel h2 {
  color: #fffaf4;
  font-size: 32px;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.32);
}

.settings-panel .shop-close {
  width: 44px;
  height: 44px;
  font-size: 24px;
}

.shop-panel.is-open,
.inventory-panel.is-open,
.settings-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.shop-header,
.shop-title,
.shop-wallet,
.shop-tabs,
.inventory-tabs {
  display: flex;
  align-items: center;
}

.shop-header {
  justify-content: space-between;
  gap: 12px;
}

.shop-title {
  gap: 10px;
}

.shop-title h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1;
}

.shop-panel-icon,
.inventory-panel-icon {
  width: 38px;
  height: 38px;
}

.settings-panel-icon {
  width: 38px;
  height: 38px;
}

.shop-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-width: 0;
  padding: 0;
  border-radius: 8px;
  background: #263f44;
  font-size: 27px;
  line-height: 1;
  box-shadow: none;
}

.shop-wallet {
  align-self: flex-start;
  gap: 8px;
  margin-top: 16px;
  padding: 8px 10px;
  border: 1px solid rgba(31, 35, 40, 0.12);
  border-radius: 8px;
  background: #fff8db;
  font-weight: 800;
}

.shop-wallet-divider {
  width: 1px;
  height: 24px;
  margin: 0 2px;
  background: rgba(85, 57, 29, 0.2);
}

.shop-tabs,
.inventory-tabs {
  gap: 6px;
  margin-top: 14px;
}

.shop-tab,
.inventory-tab {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(31, 35, 40, 0.12);
  border-radius: 8px;
  background: #edf5f7;
  color: #263f44;
  font-size: 13px;
  box-shadow: none;
}

.shop-tab:hover,
.shop-tab.is-active,
.inventory-tab:hover,
.inventory-tab.is-active {
  background: #d7ecef;
}

.shop-content {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
  align-content: start;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px dashed rgba(31, 35, 40, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(31, 35, 40, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(31, 35, 40, 0.04) 1px, transparent 1px),
    rgba(255, 255, 255, 0.62);
  background-size: 42px 42px;
}

.shop-content::-webkit-scrollbar {
  width: 9px;
}

.shop-content::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(38, 63, 68, 0.42);
  background-clip: padding-box;
}

.shop-item {
  display: grid;
  grid-template-rows: minmax(104px, 1fr) auto;
  gap: 10px;
  width: 100%;
  min-height: 162px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(31, 35, 40, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: inherit;
  text-align: center;
  box-shadow: 0 10px 22px rgba(31, 35, 40, 0.1);
}

.shop-item:hover {
  background: #fff;
  box-shadow: 0 12px 26px rgba(31, 35, 40, 0.14);
}

.shop-item.is-bought {
  display: none;
}

.shop-item[hidden] {
  display: none;
}

.potion-shop-item {
  grid-template-rows: minmax(104px, 1fr) auto auto;
}

.potion-shop-item > strong {
  font-size: 13px;
}

.potion-shop-item.is-unaffordable {
  opacity: 0.58;
}

.diamond-price {
  background: #edfaff;
  color: #275485;
}

.diamond-price .diamond-icon {
  width: 23px;
  height: 23px;
}

.potion-inventory-item {
  position: relative;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-height: 112px;
  padding: 8px;
  aspect-ratio: 1;
  border-color: rgba(91, 79, 166, 0.22);
  background: linear-gradient(180deg, #ffffff, #f5f2ff);
}

.potion-inventory-item:hover {
  border-color: rgba(112, 73, 188, 0.52);
  background: #fff;
  box-shadow: 0 12px 24px rgba(79, 57, 143, 0.18);
}

.potion-inventory-item img {
  width: 74px;
  height: 74px;
  max-height: none;
  object-fit: contain;
  filter: drop-shadow(0 7px 9px rgba(66, 52, 128, 0.2));
}

.potion-inventory-item strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.05;
  text-overflow: ellipsis;
}

.shop-item-image {
  display: grid;
  place-items: center;
  min-height: 104px;
}

.shop-item-image img {
  width: min(100%, 148px);
  max-height: 118px;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(83, 43, 30, 0.16));
}

.shop-price {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #fff8db;
  color: #6d4108;
  font-weight: 900;
}

.shop-price .coin-icon {
  width: 23px;
  height: 23px;
}

.inventory-panel-icon {
  width: 25px;
  height: 22px;
}

.inventory-content {
  flex: 1;
  display: block;
  align-content: start;
  margin-top: 14px;
  padding: 12px;
  overflow: auto;
  border: 1px dashed rgba(31, 35, 40, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(31, 35, 40, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(31, 35, 40, 0.04) 1px, transparent 1px),
    rgba(255, 255, 255, 0.62);
  background-size: 42px 42px;
}

.inventory-section {
  display: none;
}

.inventory-section.is-active {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  align-content: start;
  gap: 10px;
}

.inventory-section h3,
.inventory-section[hidden] {
  display: none;
}

.inventory-section-grid {
  display: contents;
}

.inventory-section-empty {
  grid-column: 1 / -1;
  max-width: none;
  color: #6b3d1e;
  font-size: 13px;
  font-weight: 800;
}

.inventory-section-empty[hidden],
.inventory-item[hidden] {
  display: none;
}

.vip-inventory-section {
  padding: 10px;
  border: 1px solid rgba(247, 201, 90, 0.55);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 250, 232, 0.95), rgba(240, 251, 255, 0.88));
}

.inventory-item {
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(31, 35, 40, 0.12);
  border-radius: 8px;
  background: #fff;
  color: #263f44;
  font-weight: 900;
  text-align: center;
  box-shadow: 0 10px 22px rgba(31, 35, 40, 0.1);
}

.inventory-item:hover,
.inventory-item.is-equipped {
  background: #fff8db;
  border-color: rgba(159, 106, 18, 0.45);
}

.inventory-item img {
  width: 100%;
  max-height: 164px;
  object-fit: contain;
  filter: drop-shadow(0 7px 9px rgba(83, 43, 30, 0.12));
}

.inventory-item-state {
  display: none;
  justify-self: center;
  padding: 5px 9px;
  border-radius: 8px;
  background: #f7c95a;
  color: #55391d;
  font-size: 13px;
  font-weight: 900;
}

.inventory-item.is-equipped .inventory-item-state {
  display: inline-flex;
}

.food-inventory-item {
  position: relative;
  justify-items: center;
  align-content: center;
  gap: 5px;
  min-height: 92px;
  padding: 7px;
  aspect-ratio: 1;
}

.food-inventory-item .inventory-item-state {
  display: none;
}

.food-inventory-item strong {
  font-size: 12px;
  line-height: 1.05;
}

.food-inventory-item img {
  width: 58px;
  height: 58px;
  max-height: none;
  object-fit: contain;
}

#inventoryBootsItem,
#inventoryCollarItem,
#inventoryJacketItem,
#inventoryFlashlightItem,
#inventoryBeachOutfitItem,
#inventoryPirateOutfitItem {
  grid-column: 1 / -1;
}

.carrot-inventory-item .carrot-icon {
  justify-self: center;
  width: 68px;
  height: 68px;
}

.shell-inventory-item .shell-icon {
  justify-self: center;
  width: 68px;
  height: 50px;
}

.stinger-inventory-item .stinger-icon {
  justify-self: center;
  width: 54px;
  height: 52px;
}

.rotten-flesh-inventory-item .rotten-flesh-icon {
  justify-self: center;
  width: 64px;
  height: 64px;
}

.blue-orb-inventory-item .blue-orb-icon {
  justify-self: center;
  width: 54px;
  height: 54px;
}

.inventory-item-count {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 28px;
  padding: 4px 8px;
  border: 2px solid rgba(85, 57, 29, 0.24);
  border-radius: 999px;
  background: #fff8db;
  color: #55391d;
  font-weight: 900;
  box-shadow: 0 5px 12px rgba(31, 35, 40, 0.12);
}

.inventory-item.is-glowing {
  border-color: rgba(225, 54, 72, 0.36);
  box-shadow:
    0 10px 22px rgba(31, 35, 40, 0.1),
    0 0 0 4px rgba(225, 54, 72, 0.1);
}

.settings-content {
  flex: 0 0 auto;
  display: grid;
  align-content: start;
  width: min(420px, 100%);
  gap: 14px;
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.volume-control {
  display: grid;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.volume-control span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fffaf4;
  font-size: 18px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.36);
}

.volume-control output {
  min-width: 52px;
  color: #ffe38a;
  font-weight: 900;
  text-align: right;
}

.volume-control input {
  width: 100%;
  height: 24px;
  accent-color: #224a4f;
  cursor: pointer;
}

.settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.settings-action-button {
  min-width: 0;
  padding: 14px 12px;
  background: #f7c95a;
  color: #55391d;
  font-size: 18px;
  box-shadow: 0 10px 22px rgba(31, 35, 40, 0.12);
}

.settings-action-button:hover {
  background: #e8b842;
}

.story-intro {
  position: absolute;
  z-index: 20;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 81% 18%, rgba(255, 247, 171, 0.85) 0 7%, rgba(255, 219, 89, 0.68) 7.5% 11%, transparent 11.5%),
    linear-gradient(180deg, #80d7f8 0%, #c9effb 57%, #dff6dc 63%, #81c96c 64%, #4da24f 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms ease;
}

.story-intro.is-open {
  opacity: 1;
  pointer-events: auto;
  transition-duration: 0s;
}

.story-intro.is-ending {
  opacity: 0;
  transition-duration: 500ms;
}

.game-stage.story-intro-active .side-actions,
.game-stage.story-intro-active .quickbar,
.game-stage.story-intro-active .boss-hud,
.game-stage.story-intro-active .quest-alert-button,
.game-stage.story-intro-active .quest-panel,
.game-stage.story-intro-active .daily-quest-button,
.game-stage.story-intro-active .daily-quest-panel {
  visibility: hidden;
  opacity: 0;
}

.game-stage.home-screen-active .side-actions,
.game-stage.home-screen-active .quickbar,
.game-stage.home-screen-active .boss-hud,
.game-stage.home-screen-active .quest-alert-button,
.game-stage.home-screen-active .quest-panel,
.game-stage.home-screen-active .daily-quest-button,
.game-stage.home-screen-active .daily-quest-panel,
.game-stage.home-screen-active .touch-controls {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.story-intro-skip {
  position: absolute;
  z-index: 10;
  top: 16px;
  right: 18px;
  min-width: 0;
  padding: 9px 16px;
  border: 2px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  background: rgba(44, 85, 67, 0.72);
  color: #fffced;
  font-size: 14px;
  box-shadow: 0 7px 18px rgba(31, 58, 44, 0.2);
  backdrop-filter: blur(5px);
}

.story-intro-skip:hover,
.story-intro-skip:focus-visible {
  background: rgba(32, 69, 53, 0.9);
  transform: translateY(-1px);
}

.story-intro-sun {
  position: absolute;
  top: 44px;
  right: 86px;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: #ffe36e;
  box-shadow:
    0 0 0 15px rgba(255, 227, 110, 0.2),
    0 0 44px rgba(255, 215, 74, 0.48);
}

.story-intro-cloud {
  position: absolute;
  width: 112px;
  height: 35px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow:
    25px -16px 0 8px rgba(255, 255, 255, 0.88),
    60px -7px 0 3px rgba(255, 255, 255, 0.88);
  opacity: 0.88;
}

.story-intro-cloud-one {
  top: 86px;
  left: 9%;
  animation: story-cloud-drift 8s ease-in-out infinite alternate;
}

.story-intro-cloud-two {
  top: 145px;
  right: 27%;
  transform: scale(0.72);
  animation: story-cloud-drift-small 10s ease-in-out infinite alternate;
}

.story-intro-hills {
  position: absolute;
  right: -8%;
  bottom: 31%;
  left: -8%;
  height: 23%;
  background:
    radial-gradient(ellipse at 12% 100%, #65b765 0 35%, transparent 36%),
    radial-gradient(ellipse at 44% 100%, #72c76d 0 42%, transparent 43%),
    radial-gradient(ellipse at 78% 100%, #5eb061 0 38%, transparent 39%);
  opacity: 0.9;
}

.story-intro-grass {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 34%;
  background:
    repeating-linear-gradient(101deg, rgba(24, 120, 44, 0.13) 0 2px, transparent 2px 17px),
    linear-gradient(180deg, #7fca66, #409847);
  border-top: 4px solid rgba(220, 250, 184, 0.55);
}

.story-intro-grass::after {
  content: "";
  position: absolute;
  right: 12%;
  bottom: 22px;
  left: 8%;
  height: 14px;
  border-radius: 50%;
  background: rgba(37, 86, 40, 0.15);
  filter: blur(7px);
}

.story-intro-flowers {
  position: absolute;
  z-index: 1;
  inset: auto 0 16px;
  height: 110px;
  pointer-events: none;
}

.story-intro-flowers span {
  position: absolute;
  bottom: 0;
  width: 5px;
  height: 38px;
  border-radius: 999px;
  background: #3c8a43;
  transform-origin: bottom;
}

.story-intro-flowers span::before {
  content: "";
  position: absolute;
  top: -8px;
  left: -8px;
  width: 20px;
  height: 20px;
  border: 5px dotted #fff0a8;
  border-radius: 50%;
  background: #e9974e;
}

.story-intro-flowers span:nth-child(1) { left: 6%; transform: scale(0.8) rotate(-5deg); }
.story-intro-flowers span:nth-child(2) { left: 40%; transform: scale(0.62) rotate(6deg); }
.story-intro-flowers span:nth-child(3) { right: 39%; transform: scale(0.72) rotate(-4deg); }
.story-intro-flowers span:nth-child(4) { right: 19%; transform: scale(0.9) rotate(5deg); }
.story-intro-flowers span:nth-child(5) { right: 5%; transform: scale(0.64) rotate(-6deg); }

.story-artic {
  position: absolute;
  z-index: 4;
  bottom: 35px;
  left: 22%;
  width: 370px;
  height: 270px;
  transform: translateX(-50%);
}

.story-artic img {
  position: absolute;
  left: 50%;
  display: block;
  width: auto;
  max-width: none;
  object-fit: contain;
  filter: drop-shadow(0 12px 9px rgba(38, 66, 35, 0.22));
  transition: opacity 700ms ease, transform 850ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.story-artic-sleeping {
  bottom: 4px;
  height: 205px;
  opacity: 1;
  transform: translateX(-50%) scale(1);
  animation: story-artic-breathe 2.2s ease-in-out infinite;
}

.story-artic-sitting {
  bottom: -5px;
  height: 262px;
  opacity: 0;
  transform: translateX(-50%) translateY(34px) scale(0.82);
}

.story-artic-looking-right {
  bottom: -5px;
  height: 264px;
  opacity: 0;
  transform: translateX(-50%) translateY(8px) scale(0.9);
}

.story-intro:not([data-phase="sleeping"]) .story-artic-sleeping {
  opacity: 0;
  transform: translateX(-50%) translateY(12px) scale(0.9);
  animation: none;
}

.story-intro:not([data-phase="sleeping"]) .story-artic-sitting {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.story-intro:is(
  [data-phase="artic-turns"],
  [data-phase="kroki-arrives"],
  [data-phase="kroki-speaks"],
  [data-phase="kroki-leaves"],
  [data-phase="artic-thinks"]
) .story-artic-sitting {
  opacity: 0;
  transform: translateX(-50%) translateX(8px) scale(0.94);
}

.story-intro:is(
  [data-phase="artic-turns"],
  [data-phase="kroki-arrives"],
  [data-phase="kroki-speaks"],
  [data-phase="kroki-leaves"],
  [data-phase="artic-thinks"]
) .story-artic-looking-right {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.story-intro[data-phase="artic-stands"] .story-artic-sitting,
.story-intro[data-phase="ending"] .story-artic-sitting,
.story-intro[data-phase="artic-stands"] .story-artic-looking-right,
.story-intro[data-phase="ending"] .story-artic-looking-right {
  opacity: 0;
  transform: translateX(-50%) translateY(-13px) scale(1.04);
}

.story-artic-dialog {
  position: absolute;
  z-index: 6;
  top: 73px;
  left: 28%;
  width: min(275px, 40vw);
  padding: 15px 20px 16px;
  border: 3px solid #d3a555;
  border-radius: 24px 24px 24px 8px;
  background: rgba(255, 250, 222, 0.97);
  color: #4d3522;
  box-shadow: 0 13px 27px rgba(47, 65, 41, 0.21);
  opacity: 0;
  transform: translateY(10px) scale(0.93);
  transform-origin: left bottom;
  transition: opacity 300ms ease, transform 380ms ease;
}

.story-artic-dialog::after {
  content: "";
  position: absolute;
  left: 30px;
  bottom: -15px;
  width: 25px;
  height: 25px;
  border-right: 3px solid #d3a555;
  border-bottom: 3px solid #d3a555;
  background: #fffade;
  transform: rotate(45deg);
}

.story-artic-dialog strong {
  display: block;
  margin-bottom: 3px;
  color: #b4693f;
  font-size: 17px;
}

.story-artic-dialog p {
  max-width: none;
  color: #4d3522;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 700;
}

.story-intro[data-phase="artic-speaks"] .story-artic-dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.story-sleep-marks {
  position: absolute;
  top: 22px;
  right: 23px;
  color: #fffde7;
  font: 900 26px Georgia, serif;
  text-shadow: 0 3px 7px rgba(46, 89, 105, 0.3);
  transition: opacity 300ms ease;
}

.story-sleep-marks span {
  position: absolute;
  animation: story-sleep-z 2.1s ease-in-out infinite;
}

.story-sleep-marks span:nth-child(2) { top: -20px; left: 20px; font-size: 20px; animation-delay: 0.35s; }
.story-sleep-marks span:nth-child(3) { top: -38px; left: 39px; font-size: 15px; animation-delay: 0.7s; }

.story-intro:not([data-phase="sleeping"]) .story-sleep-marks {
  opacity: 0;
}

.story-kroki {
  position: absolute;
  z-index: 5;
  right: 12%;
  bottom: 25px;
  width: 205px;
  opacity: 0;
  transform: translateX(70px) scale(0.78);
  transform-origin: bottom;
  transition: opacity 650ms ease, transform 750ms cubic-bezier(0.2, 0.9, 0.3, 1.15), filter 700ms ease;
}

.story-kroki > img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 11px 8px rgba(39, 61, 35, 0.24));
}

.story-intro[data-phase="kroki-arrives"] .story-kroki,
.story-intro[data-phase="kroki-speaks"] .story-kroki {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.story-intro[data-phase="kroki-leaves"] .story-kroki {
  opacity: 0;
  filter: brightness(1.65) blur(2px);
  transform: translateY(-38px) scale(0.72);
}

.story-dialog {
  position: absolute;
  right: 10%;
  bottom: 72%;
  width: min(455px, 62vw);
  padding: 18px 22px 19px;
  border: 3px solid #d3a555;
  border-radius: 25px 25px 8px 25px;
  background: rgba(255, 250, 222, 0.97);
  color: #4d3522;
  box-shadow:
    0 14px 30px rgba(47, 65, 41, 0.23),
    inset 0 0 0 2px rgba(255, 255, 255, 0.7);
  opacity: 0;
  transform: translateY(12px) scale(0.94);
  transform-origin: right bottom;
  transition: opacity 350ms ease, transform 430ms ease;
}

.story-dialog::after {
  content: "";
  position: absolute;
  right: 25px;
  bottom: -17px;
  width: 29px;
  height: 29px;
  border-right: 3px solid #d3a555;
  border-bottom: 3px solid #d3a555;
  background: #fffade;
  transform: rotate(45deg);
}

.story-dialog strong {
  display: inline-block;
  margin-bottom: 5px;
  color: #4f8d37;
  font-size: 18px;
  letter-spacing: 0.02em;
}

.story-dialog p {
  max-width: none;
  color: #4d3522;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.38;
}

.story-intro[data-phase="kroki-speaks"] .story-dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.story-thought {
  position: absolute;
  z-index: 6;
  top: 68px;
  left: 30%;
  width: min(390px, 52vw);
  padding: 22px 27px;
  border: 3px solid rgba(171, 137, 83, 0.72);
  border-radius: 48% 52% 46% 54% / 55% 49% 51% 45%;
  background: rgba(255, 253, 235, 0.97);
  box-shadow: 0 14px 30px rgba(47, 65, 41, 0.2);
  opacity: 0;
  transform: translateY(12px) scale(0.88);
  transition: opacity 380ms ease, transform 480ms cubic-bezier(0.2, 0.9, 0.3, 1.12);
}

.story-thought > span {
  position: absolute;
  bottom: -27px;
  left: 46px;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(171, 137, 83, 0.65);
  border-radius: 50%;
  background: #fffdeb;
}

.story-thought > span:nth-child(2) {
  bottom: -46px;
  left: 30px;
  width: 12px;
  height: 12px;
}

.story-thought p {
  max-width: none;
  color: #4d3522;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.28;
  text-align: center;
}

.story-intro[data-phase="artic-thinks"] .story-thought {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.story-intro-vignette {
  position: absolute;
  z-index: 8;
  inset: 0;
  box-shadow: inset 0 0 75px rgba(36, 75, 57, 0.16);
  pointer-events: none;
}

@keyframes story-artic-breathe {
  0%, 100% { transform: translateX(-50%) scale(1); }
  50% { transform: translateX(-50%) scale(1.018, 0.985); }
}

@keyframes story-sleep-z {
  0%, 100% { opacity: 0.2; transform: translateY(5px); }
  45% { opacity: 1; transform: translateY(-4px); }
}

@keyframes story-cloud-drift {
  to { transform: translateX(24px); }
}

@keyframes story-cloud-drift-small {
  to { transform: translateX(-20px) scale(0.72); }
}

@media (max-width: 720px) {
  .story-artic {
    left: 25%;
    bottom: 27px;
    width: 285px;
    height: 220px;
  }

  .story-artic-sleeping { height: 158px; }
  .story-artic-sitting { height: 208px; }
  .story-artic-looking-right { height: 210px; }

  .story-artic-dialog {
    top: 49px;
    left: 31%;
    width: min(235px, 48vw);
    padding: 11px 15px 12px;
  }

  .story-artic-dialog strong { font-size: 14px; }
  .story-artic-dialog p { font-size: 18px; }

  .story-kroki {
    right: 6%;
    bottom: 17px;
    width: 153px;
  }

  .story-dialog {
    right: 33%;
    bottom: 85%;
    width: min(430px, 78vw);
    padding: 13px 16px 14px;
  }

  .story-dialog p { font-size: 14px; line-height: 1.3; }
  .story-dialog strong { font-size: 15px; }

  .story-thought {
    top: 49px;
    left: 12%;
    width: min(330px, 68vw);
    padding: 16px 20px;
  }

  .story-thought p { font-size: 18px; }
}

.home-screen {
  position: absolute;
  z-index: 19;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 14px 22px;
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 18%, rgba(255, 244, 156, 0.58), transparent 19%),
    linear-gradient(180deg, #75d1ff 0%, #bdeeff 51%, #e9fbff 61%, #79ca69 62%, #3b9d49 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.home-screen::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: -4%;
  right: -4%;
  bottom: 0;
  height: 38%;
  background:
    radial-gradient(ellipse at 18% 0%, #8ddd72 0 23%, transparent 24%),
    radial-gradient(ellipse at 50% 4%, #70ca60 0 30%, transparent 31%),
    radial-gradient(ellipse at 82% 0%, #83d76e 0 25%, transparent 26%),
    repeating-linear-gradient(102deg, rgba(25, 121, 47, 0.2) 0 3px, transparent 3px 17px),
    linear-gradient(180deg, #72cd62 0%, #379647 100%);
  border-top: 4px solid rgba(225, 255, 203, 0.5);
}

.home-screen::after {
  content: "";
  position: absolute;
  z-index: 0;
  right: -10%;
  bottom: 31%;
  left: -10%;
  height: 25%;
  border-radius: 50% 50% 0 0;
  background:
    radial-gradient(ellipse at 14% 100%, #57b45c 0 34%, transparent 35%),
    radial-gradient(ellipse at 48% 100%, #63bc62 0 41%, transparent 42%),
    radial-gradient(ellipse at 84% 100%, #4eaa56 0 38%, transparent 39%);
  opacity: 0.85;
}

.home-screen.is-open {
  opacity: 1;
  pointer-events: auto;
}

.home-preview {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  height: 100%;
}

.home-sun {
  position: absolute;
  z-index: 1;
  top: 22px;
  right: 48px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #fff9bd 0 18%, transparent 19%),
    #ffd84f;
  box-shadow:
    0 0 0 14px rgba(255, 216, 79, 0.18),
    0 0 42px rgba(255, 202, 42, 0.46);
}

.home-cloud {
  position: absolute;
  z-index: 1;
  width: 124px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    28px -18px 0 10px rgba(255, 255, 255, 0.9),
    66px -8px 0 4px rgba(255, 255, 255, 0.9);
}

.home-cloud-one {
  top: 62px;
  left: 34px;
  animation: home-cloud-drift 8s ease-in-out infinite alternate;
}

.home-cloud-two {
  top: 108px;
  right: 152px;
  transform: scale(0.76);
  opacity: 0.82;
  animation: home-cloud-drift-small 10s ease-in-out infinite alternate;
}

@keyframes home-cloud-drift {
  to { transform: translateX(24px); }
}

@keyframes home-cloud-drift-small {
  to { transform: translateX(-22px) scale(0.76); }
}

.home-hero {
  position: absolute;
  z-index: 3;
  top: 42%;
  left: 50%;
  display: grid;
  justify-items: center;
  transform: translate(-50%, -50%);
}

.home-dog-wrap {
  position: relative;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}

.home-dog-wrap::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 176px;
  height: 22px;
  border-radius: 50%;
  background: rgba(31, 35, 40, 0.18);
  transform: translateX(-50%);
}

.home-dog-wrap img {
  position: relative;
  z-index: 1;
  width: auto;
  height: min(278px, 49vh);
  max-width: 58vw;
  object-fit: contain;
  filter: drop-shadow(0 12px 14px rgba(31, 35, 40, 0.22));
}

.play-button {
  position: relative;
  z-index: 2;
  min-width: 210px;
  padding: 15px 34px 15px 58px;
  border: 3px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe47a 0%, #f7bf3e 54%, #e69b25 100%);
  color: #5b3615;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-shadow: 0 1px rgba(255, 255, 255, 0.48);
  box-shadow:
    0 8px 0 #bc7620,
    0 16px 30px rgba(56, 72, 32, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.56);
  animation: home-play-breathe 1.9s ease-in-out infinite;
}

.play-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 27px;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 15px solid #6a431c;
  transform: translateY(-50%);
}

.play-button:hover {
  background: linear-gradient(180deg, #ffec96 0%, #ffd250 56%, #efa62d 100%);
  transform: translateY(-2px);
  box-shadow:
    0 10px 0 #bc7620,
    0 20px 34px rgba(56, 72, 32, 0.34),
    inset 0 2px 0 rgba(255, 255, 255, 0.66);
}

@keyframes home-play-breathe {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}

.home-actions {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(105px, 170px));
  justify-content: center;
  gap: 10px;
  width: 100%;
  justify-items: center;
}

.home-menu-button {
  position: relative;
  min-width: 0;
  width: 100%;
  padding: 11px 12px 11px 34px;
  border: 2px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(255, 252, 239, 0.9);
  color: #285340;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(34, 83, 54, 0.2);
  backdrop-filter: blur(5px);
}

.home-menu-button::before {
  position: absolute;
  top: 50%;
  left: 13px;
  font-size: 16px;
  transform: translateY(-50%);
}

#donateButton::before { content: "♥"; color: #ec5c76; }
#aboutAuthorButton::before { content: "★"; color: #e4a523; }

.home-menu-button:hover {
  background: #fff;
  transform: translateY(-2px);
}

.home-butterflies,
.home-flowers {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}

.home-butterfly {
  position: absolute;
  width: 8px;
  height: 11px;
  border-radius: 50%;
  background: #7755a8;
  animation: home-butterfly-float 4s ease-in-out infinite alternate;
}

.home-butterfly::before,
.home-butterfly::after {
  content: "";
  position: absolute;
  top: -2px;
  width: 15px;
  height: 19px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: linear-gradient(135deg, #ff8bb6, #ffd66e);
}

.home-butterfly::before {
  right: 4px;
  border-radius: 80% 35% 70% 30%;
  transform-origin: right center;
  animation: home-wing-left 0.28s ease-in-out infinite alternate;
}

.home-butterfly::after {
  left: 4px;
  border-radius: 35% 80% 30% 70%;
  transform-origin: left center;
  animation: home-wing-right 0.28s ease-in-out infinite alternate;
}

.home-butterfly-one { top: 24%; left: 19%; }
.home-butterfly-two { top: 31%; right: 18%; animation-delay: -1.4s; transform: scale(0.78); }
.home-butterfly-three { top: 54%; left: 28%; animation-delay: -2.3s; transform: scale(0.65); }

@keyframes home-wing-left {
  to { transform: perspective(18px) rotateY(58deg) rotate(-8deg); }
}

@keyframes home-wing-right {
  to { transform: perspective(18px) rotateY(-58deg) rotate(8deg); }
}

@keyframes home-butterfly-float {
  to { translate: 24px -16px; }
}

.home-flower {
  position: absolute;
  bottom: 43px;
  width: 7px;
  height: 45px;
  border-radius: 999px;
  background: #287a3e;
  transform-origin: bottom center;
}

.home-flower::before {
  content: "";
  position: absolute;
  top: -8px;
  left: -5px;
  width: 17px;
  height: 17px;
  border: 4px dotted #fff1a4;
  border-radius: 50%;
  background: #ef884a;
}

.flower-one { left: 5%; transform: scale(0.82) rotate(-5deg); }
.flower-two { left: 13%; bottom: 56px; transform: scale(0.65) rotate(7deg); }
.flower-three { left: 24%; transform: scale(0.92) rotate(-3deg); }
.flower-four { left: 36%; bottom: 48px; transform: scale(0.58) rotate(5deg); }
.flower-five { right: 34%; bottom: 52px; transform: scale(0.72) rotate(-7deg); }
.flower-six { right: 22%; transform: scale(0.9) rotate(4deg); }
.flower-seven { right: 12%; bottom: 58px; transform: scale(0.62) rotate(-5deg); }
.flower-eight { right: 4%; transform: scale(0.78) rotate(7deg); }

.home-flower:nth-child(3n + 1)::before {
  border-color: #ffc2db;
  background: #f2cd47;
}

.home-flower:nth-child(3n + 2)::before {
  border-color: #d5c2ff;
  background: #ffdf58;
}

.author-book {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 244, 193, 0.18), transparent 48%),
    rgba(25, 31, 28, 0.48);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.author-book.is-open {
  opacity: 1;
  pointer-events: auto;
}

.book-shell {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 16px;
  width: min(740px, 100%);
  height: min(510px, calc(100% - 30px));
  padding: 25px 34px 22px;
  border: 5px solid #613a25;
  border-radius: 24px 15px 15px 24px;
  background:
    linear-gradient(90deg, rgba(255, 224, 154, 0.2) 0 2%, transparent 7% 94%, rgba(52, 25, 13, 0.25) 100%),
    linear-gradient(145deg, #a8653c 0%, #81482c 50%, #5e321f 100%);
  box-shadow:
    0 28px 70px rgba(19, 23, 20, 0.42),
    0 7px 0 #452618,
    inset 0 0 0 2px rgba(255, 231, 178, 0.2);
  transform: translateY(0) rotate(-0.25deg);
}

.book-shell::before,
.book-shell::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: 12px;
  bottom: -9px;
  left: 17px;
  height: 18px;
  border: 2px solid #b89461;
  border-radius: 0 0 18px 18px;
  background: #ead7a7;
}

.book-shell::after {
  right: 20px;
  bottom: -14px;
  left: 25px;
  z-index: -2;
  height: 16px;
  background: #d3b982;
}

.book-bookmark {
  position: absolute;
  z-index: 2;
  top: -5px;
  left: 58px;
  width: 28px;
  height: 55px;
  background: linear-gradient(90deg, #b73746, #e05a63 55%, #a92f3d);
  filter: drop-shadow(0 4px 2px rgba(54, 25, 20, 0.22));
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}

.book-close {
  position: absolute;
  z-index: 5;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  min-width: 0;
  padding: 0;
  border: 3px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  background: linear-gradient(180deg, #ff8f89, #df4f57);
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 38px;
  font-weight: 400;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(109, 28, 34, 0.25);
  box-shadow:
    0 7px 0 #a93540,
    0 12px 22px rgba(56, 28, 25, 0.27),
    inset 0 2px 0 rgba(255, 255, 255, 0.4);
  transition: transform 130ms ease, filter 130ms ease, box-shadow 130ms ease;
}

.book-close span {
  transform: translateY(-2px);
}

.book-close:hover,
.book-close:focus-visible {
  background: linear-gradient(180deg, #ffa09a, #eb5b63);
  filter: brightness(1.04);
  transform: translateY(-2px) rotate(4deg);
  box-shadow:
    0 9px 0 #a93540,
    0 15px 24px rgba(56, 28, 25, 0.3),
    inset 0 2px 0 rgba(255, 255, 255, 0.5);
}

.book-close:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 #a93540;
}

.book-page {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  place-items: stretch;
  height: 100%;
  min-height: 0;
  padding: 23px 70px 17px;
  overflow: hidden;
  border: 2px solid #c8a66d;
  border-radius: 18px 8px 8px 18px;
  background:
    linear-gradient(90deg, rgba(91, 54, 25, 0.12), transparent 7% 93%, rgba(91, 54, 25, 0.11)),
    repeating-linear-gradient(0deg, transparent 0 33px, rgba(140, 100, 55, 0.065) 34px 35px),
    radial-gradient(circle at 22% 12%, rgba(255, 255, 255, 0.72), transparent 28%),
    #f8e9bd;
  box-shadow:
    inset 10px 0 18px rgba(92, 57, 27, 0.12),
    inset -7px 0 12px rgba(92, 57, 27, 0.08),
    0 8px 18px rgba(31, 35, 40, 0.16);
}

.book-page::before,
.book-page::after {
  content: "❦";
  position: absolute;
  color: rgba(151, 91, 48, 0.42);
  font: 28px Georgia, serif;
}

.book-page::before {
  top: 13px;
  left: 23px;
}

.book-page::after {
  right: 23px;
  bottom: 13px;
  transform: rotate(180deg);
}

.book-page-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #9a5a34;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.book-page-heading span {
  color: #c69249;
  font-size: 11px;
}

.book-page p {
  display: grid;
  align-content: center;
  gap: 7px;
  width: 100%;
  max-width: 570px;
  min-height: 0;
  margin: 0 auto;
  color: #52331f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 4.4vh, 37px);
  font-weight: 700;
  line-height: 1.17;
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 1px rgba(255, 255, 255, 0.68);
  animation: book-page-arrive 220ms ease-out;
}

.book-page p span {
  display: block;
}

.book-page-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 26px;
}

.book-progress {
  grid-column: 2;
  display: flex;
  gap: 8px;
}

.book-progress-dot {
  width: 9px;
  height: 9px;
  border: 2px solid #b47a42;
  border-radius: 50%;
  background: transparent;
  transition: width 150ms ease, background 150ms ease;
}

.book-progress-dot.is-current {
  width: 22px;
  border-radius: 999px;
  background: #b96545;
}

.book-page-number {
  grid-column: 3;
  justify-self: end;
  padding: 4px 10px;
  border: 1px solid rgba(141, 88, 43, 0.22);
  border-radius: 999px;
  background: rgba(255, 250, 227, 0.42);
  color: #81532d;
  font: 700 16px Georgia, "Times New Roman", serif;
}

.book-controls {
  display: flex;
  justify-content: center;
  gap: 18px;
}

.book-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 164px;
  padding: 12px 22px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe688, #efbd4d);
  color: #57391f;
  font-size: 17px;
  box-shadow:
    0 6px 0 #b9792f,
    0 12px 20px rgba(31, 35, 40, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.5);
  transition: transform 130ms ease, box-shadow 130ms ease, filter 130ms ease;
}

.book-nav-arrow {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  color: #744521;
  font-size: 25px;
  line-height: 1;
}

.book-nav-button:hover:not(:disabled),
.book-nav-button:focus-visible:not(:disabled) {
  background: linear-gradient(180deg, #fff0a4, #f8ca5a);
  filter: brightness(1.03);
  transform: translateY(-2px);
  box-shadow:
    0 8px 0 #b9792f,
    0 15px 24px rgba(31, 35, 40, 0.23),
    inset 0 2px 0 rgba(255, 255, 255, 0.6);
}

.book-nav-button:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #b9792f;
}

.book-nav-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.35);
  opacity: 0.45;
}

@keyframes book-page-arrive {
  from { opacity: 0; transform: translateX(9px); }
  to { opacity: 1; transform: translateX(0); }
}

.donate-panel {
  position: absolute;
  z-index: 9;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(31, 35, 40, 0.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.donate-panel.is-open {
  opacity: 1;
  pointer-events: auto;
}

.donate-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 18px;
  width: min(760px, 100%);
  max-height: min(560px, calc(100% - 20px));
  padding: 24px;
  border: 3px solid rgba(85, 57, 29, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 251, 231, 0.96), rgba(255, 244, 216, 0.98)),
    #fff8df;
  box-shadow: 0 24px 70px rgba(31, 35, 40, 0.34);
  overflow: hidden;
}

.donate-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 8px;
  background: linear-gradient(90deg, #f55f7f, #f7c95a, #70c878, #65b7ff);
}

.donate-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-width: 0;
  padding: 0;
  background: #55391d;
  color: #fff8df;
  font-size: 28px;
  box-shadow: 0 8px 18px rgba(31, 35, 40, 0.2);
}

.donate-close:hover {
  background: #3f2a15;
}

.donate-header {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding-right: 54px;
}

.donate-title-steak {
  display: block;
  width: 58px;
  height: 58px;
  border: 3px solid #55391d;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 10px 20px rgba(85, 57, 29, 0.16);
}

.donate-header-copy {
  min-width: 0;
}

.donate-header h2 {
  margin: 0;
  color: #55391d;
  font-size: 36px;
  line-height: 1;
}

.donate-header p {
  margin-top: 5px;
  color: #7a4c25;
  font-weight: 700;
}

.donate-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.donate-tab {
  min-width: 0;
  padding: 12px 10px;
  background: #fffaf4;
  color: #55391d;
  box-shadow: inset 0 0 0 2px rgba(85, 57, 29, 0.12);
}

.donate-tab:hover,
.donate-tab.is-active {
  background: #f7c95a;
}

.donate-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 2px 4px 2px 0;
}

.donate-item {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 2px solid rgba(85, 57, 29, 0.12);
  background: rgba(255, 255, 255, 0.78);
  color: #55391d;
  text-align: left;
  box-shadow: 0 10px 22px rgba(31, 35, 40, 0.1);
}

.donate-item:hover {
  background: #fff;
  border-color: rgba(247, 201, 90, 0.76);
}

.donate-item.is-preview-equipped {
  border-color: #9b88ff;
  background: #fffaff;
  box-shadow:
    0 0 0 3px rgba(155, 136, 255, 0.22),
    0 10px 22px rgba(31, 35, 40, 0.1);
}

.donate-item[hidden] {
  display: none;
}

.donate-item strong {
  min-width: 0;
  font-size: 17px;
  line-height: 1.15;
}

.donate-item-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.donate-item-perk {
  color: #a34578;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.15;
}

.donate-price {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  background: #224a4f;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.donate-price img {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.72);
}


.donate-item-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 62px;
  border-radius: 8px;
  background: #f5e2ff;
  box-shadow: inset 0 0 0 2px rgba(85, 57, 29, 0.12);
  overflow: hidden;
}

.donate-item-art::before,
.donate-item-art::after {
  content: "";
  position: absolute;
}

.donate-item-art.donate-item-image {
  width: 62px;
  height: 62px;
  justify-self: center;
  background: #fff;
}

.donate-item-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}


.purchase-modal {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(31, 35, 40, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.purchase-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.purchase-modal.is-notice .purchase-actions {
  display: none;
}

.purchase-card {
  display: grid;
  gap: 18px;
  width: min(260px, 100%);
  padding: 22px;
  border: 2px solid rgba(31, 35, 40, 0.14);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(31, 35, 40, 0.24);
  text-align: center;
}

.purchase-card p {
  max-width: none;
  color: #263f44;
  font-size: 24px;
  font-weight: 900;
}

.purchase-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.purchase-actions button {
  min-width: 0;
  padding: 10px 12px;
}

.purchase-actions button:last-child {
  background: #8d3b44;
}

.purchase-actions button:last-child:hover {
  background: #702d35;
}

canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 2px solid #1f2328;
  border-radius: 8px;
  background: #a9def0;
  box-shadow: 0 24px 70px rgba(31, 35, 40, 0.16);
}

.controls {
  margin-top: 12px;
  color: #5f6368;
  font-size: 14px;
}

@media (max-width: 680px) {
  body {
    padding: 14px;
  }

  .topbar,
  .hud,
  .controls {
    align-items: flex-start;
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  .side-actions {
    top: 12px;
    left: 12px;
    transform: none;
  }

  .boss-hud {
    top: 10px;
    width: min(360px, calc(100% - 122px));
  }

  .quest-alert-button {
    top: 10px;
    right: 10px;
    width: 54px;
    height: 54px;
    font-size: 37px;
  }

  .daily-quest-button {
    top: 10px;
    right: 74px;
    width: 54px;
    height: 54px;
    font-size: 31px;
  }

  .quest-close-button,
  .daily-quest-close-button {
    width: 38px;
  }

  .quickbar {
    bottom: 10px;
    grid-template-columns: repeat(7, minmax(34px, 1fr));
    gap: 5px;
    width: calc(100% - 20px);
    padding: 6px;
  }

  .experience-meter {
    grid-column: 1 / -1;
    gap: 4px;
    padding: 5px 8px;
  }

  .experience-meter-title {
    font-size: 11px;
  }

  .experience-meter-title strong {
    font-size: 13px;
  }

  .experience-segments span {
    height: 7px;
  }

  .raccoon-dialogue {
    padding: 12px 10px 84px;
  }

  .raccoon-dialogue-card {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }

  .raccoon-dialogue-card > img {
    width: 82px;
    height: 82px;
  }

  .raccoon-dialogue-copy p {
    min-height: 38px;
    font-size: 13px;
  }

  .raccoon-dialogue-copy button {
    width: auto;
  }

  .raccoon-shop-panel {
    padding: 10px;
  }

  .raccoon-shop-card {
    gap: 11px;
    padding: 16px 12px;
  }

  .raccoon-shop-header {
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 9px;
    padding-right: 40px;
  }

  .raccoon-shop-header > img {
    width: 70px;
    height: 70px;
  }

  .raccoon-shop-header h2 {
    font-size: 22px;
  }

  .raccoon-shop-wallet {
    grid-column: 1 / -1;
    grid-template-columns: 23px auto 23px auto;
    justify-content: center;
  }

  .raccoon-shop-items {
    grid-template-columns: 1fr;
  }

  .raccoon-shop-item {
    width: 100%;
  }

  .quickbar-slot {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }

  .quickbar-slot img {
    width: 82%;
    height: 82%;
  }

  .shop-button,
  .inventory-button,
  .settings-button {
    width: 44px;
    height: 50px;
  }

  .shop-panel,
  .inventory-panel,
  .settings-panel {
    top: 10px;
    bottom: 10px;
    left: 10px;
    width: calc(100% - 20px);
  }

  .inventory-panel {
    bottom: 86px;
    width: calc(100% - 20px);
  }

  .settings-panel {
    inset: 0;
    width: 100%;
    min-height: 100%;
    padding: 18px;
  }

  .settings-panel h2 {
    font-size: 28px;
  }

  .settings-content {
    width: min(360px, 100%);
    gap: 12px;
    margin-top: 0;
  }

  .volume-control span {
    font-size: 17px;
  }

  .settings-action-button {
    padding: 13px 10px;
    font-size: 17px;
  }

  .home-screen {
    padding: 10px;
  }

  .home-preview {
    height: 100%;
  }

  .home-hero {
    top: 40%;
  }

  .home-sun {
    top: 18px;
    right: 28px;
    width: 68px;
    height: 68px;
  }

  .home-cloud-one {
    top: 66px;
    left: 24px;
    transform: scale(0.74);
  }

  .home-cloud-two {
    display: none;
  }

  .home-dog-wrap img {
    width: auto;
    height: min(205px, 42vh);
    max-width: 52vw;
  }

  .play-button {
    min-width: 168px;
    padding: 11px 22px 11px 45px;
    font-size: 19px;
  }

  .play-button::before {
    left: 21px;
    border-top-width: 7px;
    border-bottom-width: 7px;
    border-left-width: 12px;
  }

  .home-actions {
    grid-template-columns: repeat(3, minmax(86px, 1fr));
    width: 100%;
    gap: 8px;
  }

  .home-menu-button {
    padding: 9px 5px 9px 24px;
    font-size: 12px;
  }

  .home-menu-button::before {
    left: 8px;
    font-size: 13px;
  }

  .home-butterfly-three,
  .flower-four,
  .flower-five {
    display: none;
  }

  .book-shell {
    gap: 12px;
    height: min(450px, calc(100% - 22px));
    padding: 16px 13px 14px;
    border-width: 4px;
    border-radius: 18px 11px 11px 18px;
  }

  .book-page {
    min-height: 0;
    padding: 18px 30px 13px;
  }

  .book-page p {
    gap: 5px;
    font-size: clamp(21px, 5.1vh, 29px);
    line-height: 1.13;
  }

  .book-page-heading {
    gap: 8px;
    font-size: 12px;
  }

  .book-close {
    top: 7px;
    right: 7px;
    width: 46px;
    height: 46px;
    font-size: 33px;
  }

  .book-bookmark {
    left: 37px;
    width: 22px;
    height: 43px;
  }

  .book-nav-button {
    min-width: 126px;
    padding: 9px 13px;
    font-size: 14px;
  }

  .book-nav-arrow {
    width: 27px;
    height: 27px;
    font-size: 21px;
  }

  .book-page-number {
    padding: 3px 8px;
    font-size: 13px;
  }

  .book-progress {
    gap: 5px;
  }

  .book-progress-dot {
    width: 7px;
    height: 7px;
    border-width: 1px;
  }

  .book-progress-dot.is-current {
    width: 17px;
  }

  .donate-panel {
    padding: 14px;
  }

  .donate-card {
    gap: 12px;
    max-height: calc(100% - 10px);
    padding: 18px 14px 14px;
  }

  .donate-header {
    gap: 10px;
    padding-right: 44px;
  }

  .donate-title-steak {
    width: 46px;
    height: 46px;
  }

  .donate-header {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .donate-header h2 {
    font-size: 29px;
  }

  .donate-header p {
    font-size: 14px;
  }

  .donate-close {
    width: 38px;
    height: 38px;
  }

  .donate-tabs {
    gap: 7px;
  }

  .donate-tab {
    padding: 10px 6px;
    font-size: 14px;
  }

  .donate-items {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .donate-item {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 10px;
  }

  .donate-item-art {
    width: 64px;
    height: 54px;
  }

  .donate-item-art.donate-item-image {
    width: 54px;
    height: 54px;
  }

  .donate-item strong {
    font-size: 15px;
  }

  .shop-tabs,
  .inventory-tabs {
    flex-wrap: wrap;
  }

  .shop-tab,
  .inventory-tab,
  .shop-close {
    width: auto;
  }

  #statusText {
    text-align: left;
  }
}

/* Final cascade overrides for the compact demo layout. */
.home-actions {
  grid-template-columns: repeat(2, minmax(130px, 190px));
}

#donateButton::before {
  content: "✦";
  color: #8a64db;
}

.donate-price {
  display: none;
}

.donate-item {
  grid-template-columns: 76px minmax(0, 1fr);
}

@media (max-width: 680px) {
  body {
    display: block;
    min-height: 100dvh;
    padding: 6px;
  }

  .game-shell {
    width: 100%;
  }

  .topbar {
    flex-flow: row nowrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
  }

  .topbar h1 {
    margin: 0;
    font-size: 22px;
  }

  .topbar p,
  .controls {
    display: none;
  }

  .topbar button {
    width: auto;
    min-width: 82px;
    padding: 8px 10px;
    font-size: 13px;
  }

  .hud {
    display: grid;
    grid-template-columns: repeat(5, auto) minmax(80px, 1fr);
    align-items: center;
    flex-direction: initial;
    gap: 5px 9px;
    min-height: 0;
    margin-bottom: 5px;
    padding: 5px 7px;
    font-size: 12px;
  }

  .bone-score img { width: 25px; height: 25px; }
  .bone-score { gap: 3px; }
  .bone-hint { display: none; }
  .coin-icon, .diamond-icon { width: 20px; height: 20px; }
  .hp-meter, .hp-ring { width: 38px; height: 38px; min-width: 38px; }
  .age-score { min-width: 0; font-size: 10px; }
  #statusText { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .side-actions {
    top: 7px;
    left: 7px;
    gap: 5px;
  }

  .shop-button,
  .inventory-button,
  .settings-button {
    width: 38px;
    height: 38px;
  }

  .quickbar {
    top: 7px;
    bottom: auto;
    grid-template-columns: repeat(7, minmax(25px, 1fr));
    gap: 3px;
    width: min(61%, 310px);
    padding: 4px;
  }

  .experience-meter {
    display: none;
  }

  .quickbar-slot {
    border-width: 1px;
    border-radius: 5px;
  }

  .quest-alert-button,
  .daily-quest-button {
    top: 7px;
    width: 38px;
    height: 38px;
    border-width: 2px;
    font-size: 24px;
    box-shadow: 0 4px 0 #b96520, 0 8px 15px rgba(67, 43, 21, 0.24);
  }

  .quest-alert-button { right: 7px; }
  .daily-quest-button { right: 50px; }
  .boss-hud { top: 50px; width: calc(100% - 110px); padding: 6px 9px 8px; }

  .touch-controls { padding: 8px; }
  .touch-control { width: 54px; height: 54px; min-width: 54px; font-size: 25px; }
  .touch-jump-control { width: 62px; height: 62px; min-width: 62px; }

  .home-actions {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
    bottom: 5px;
    gap: 5px;
  }

  .home-hero {
    top: 38%;
  }

  .home-dog-wrap img {
    height: min(118px, 30vw);
    max-width: 38vw;
  }

  .home-dog-wrap::after {
    width: 104px;
    height: 14px;
  }

  .play-button {
    min-width: 142px;
    padding: 7px 18px 7px 39px;
    font-size: 16px;
    box-shadow:
      0 5px 0 #bc7620,
      0 10px 20px rgba(56, 72, 32, 0.26),
      inset 0 2px 0 rgba(255, 255, 255, 0.56);
  }

  .play-button::before {
    left: 18px;
    border-top-width: 6px;
    border-bottom-width: 6px;
    border-left-width: 10px;
  }

  .home-menu-button {
    padding: 6px 4px 6px 22px;
    font-size: 10px;
  }

  .home-menu-button::before {
    left: 7px;
    font-size: 12px;
  }

  .donate-item {
    grid-template-columns: 64px minmax(0, 1fr);
  }
}

/* Phone interface: panels use the whole screen and never compete with controls. */
@media (hover: none), (pointer: coarse), (max-width: 900px) {
  .touch-control {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .game-stage.mobile-controls-blocked .touch-controls,
  .game-stage.mobile-controls-blocked .side-actions,
  .game-stage.mobile-controls-blocked .quickbar,
  .game-stage.mobile-controls-blocked .quest-alert-button,
  .game-stage.mobile-controls-blocked .daily-quest-button,
  .game-stage.mobile-controls-blocked .boss-hud {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }

  .shop-panel,
  .inventory-panel {
    position: fixed;
    z-index: 60;
    inset:
      max(8px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
    width: auto;
    min-height: 0;
    padding: 10px;
    border-radius: 14px;
    transform: translateY(12px) scale(0.985);
  }

  .shop-panel.is-open,
  .inventory-panel.is-open {
    transform: translateY(0) scale(1);
  }

  .settings-panel,
  .tutorial-panel,
  .demo-finale,
  .restart-confirm,
  .raccoon-dialogue,
  .raccoon-shop-panel,
  .purchase-modal,
  .story-intro,
  .home-screen,
  .author-book,
  .donate-panel {
    position: fixed;
    z-index: 70;
    inset: 0;
    width: 100%;
    min-height: 100dvh;
  }

  .quest-panel,
  .daily-quest-panel {
    position: fixed;
    z-index: 65;
    inset:
      max(8px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
    width: auto;
    max-height: none;
    overflow-y: auto;
    padding: 14px;
    transform-origin: center;
  }

  .quest-panel {
    bottom: auto;
    max-height: calc(100dvh - 16px);
  }

  .shop-header {
    gap: 8px;
  }

  .shop-title {
    gap: 7px;
  }

  .shop-title h2 {
    font-size: 20px;
  }

  .shop-panel-icon,
  .inventory-panel-icon,
  .settings-panel-icon {
    width: 32px;
    height: 32px;
  }

  .shop-close {
    width: 36px;
    height: 36px;
    font-size: 24px;
  }

  .shop-wallet {
    margin-top: 8px;
    padding: 6px 8px;
  }

  .shop-tabs,
  .inventory-tabs {
    flex: none;
    gap: 5px;
    margin-top: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .shop-tabs::-webkit-scrollbar,
  .inventory-tabs::-webkit-scrollbar {
    display: none;
  }

  .shop-tab,
  .inventory-tab {
    flex: 0 0 auto;
    padding: 7px 9px;
    white-space: nowrap;
  }

  .shop-content,
  .inventory-content {
    min-height: 0;
    gap: 8px;
    margin-top: 8px;
    padding: 8px;
  }

  .shop-content {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  }

  .shop-item {
    grid-template-rows: minmax(72px, 1fr) auto;
    gap: 6px;
    min-height: 128px;
    padding: 7px;
  }

  .potion-shop-item {
    grid-template-rows: minmax(72px, 1fr) auto auto;
  }

  .shop-item-image {
    min-height: 72px;
  }

  .shop-item-image img {
    max-height: 82px;
  }

  .shop-price {
    min-height: 32px;
    padding: 5px 8px;
  }

  .quest-panel-header,
  .daily-quest-panel-header {
    grid-template-columns: 44px minmax(0, 1fr) 36px;
    gap: 8px;
  }

  .quest-panel-mark,
  .daily-quest-panel-mark {
    width: 44px;
    height: 44px;
    border-radius: 13px;
  }
}

@media (max-width: 480px) {
  .shop-content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
