:root {
  color-scheme: light;
  --ink: #24352a;
  --cream: #fff9e9;
  --yellow: #ffd84d;
  --orange: #ff8d42;
  --green: #77c95a;
  --deep-green: #2f7c45;
  --blue: #80d9f4;
  --red: #ed5f4f;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 6%, rgba(255, 255, 255, 0.85) 0 5%, transparent 16%),
    linear-gradient(180deg, #dff6ff 0%, #f7ffe1 100%);
  overflow-x: hidden;
}

button {
  font: inherit;
}

.game {
  width: min(1120px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 24px;
}

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

.topbar-actions {
  display: flex;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-dog {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  font-size: 35px;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-4deg);
}

.brand-dog img {
  width: 90%;
  height: 90%;
  object-fit: contain;
}

h1,
h2,
p {
  margin-top: 0;
}

.brand h1 {
  margin: 0;
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.brand p {
  margin: 6px 0 0;
  color: #5d725f;
  font-size: 13px;
  font-weight: 700;
}

.music-toggle {
  margin-top: 7px;
  padding: 4px 9px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  background: #fff7bf;
  border: 2px solid var(--ink);
  border-radius: 99px;
  box-shadow: 2px 2px 0 rgba(36, 53, 42, 0.45);
  cursor: pointer;
}

.music-toggle[aria-pressed="false"] {
  color: #69736b;
  background: #e7ebe5;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(76px, 1fr));
  gap: 8px;
}

.stat {
  min-width: 96px;
  padding: 8px 13px;
  text-align: center;
  background: rgba(255, 255, 255, 0.86);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 3px 3px 0 rgba(36, 53, 42, 0.25);
}

.stat span {
  display: block;
  color: #68786c;
  font-size: 11px;
  font-weight: 800;
}

.stat strong {
  display: block;
  margin-top: 1px;
  font-size: 23px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.lives-stat strong {
  color: #d55b2e;
}

.lives-stat strong.critical {
  color: var(--red);
}

.animal-count-stat strong {
  color: var(--deep-green);
}

.animal-count-stat strong.critical {
  color: var(--red);
}

.farm-shell {
  padding: 5px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 28px;
  box-shadow: 8px 9px 0 rgba(36, 53, 42, 0.22);
}

.farm {
  position: relative;
  height: clamp(390px, 57vh, 590px);
  min-height: 390px;
  overflow: hidden;
  cursor: default;
  touch-action: manipulation;
  background:
    linear-gradient(176deg, transparent 0 64%, rgba(58, 139, 65, 0.15) 64.2% 65%, transparent 65.2%),
    repeating-linear-gradient(102deg, transparent 0 58px, rgba(50, 127, 62, 0.08) 60px 63px),
    linear-gradient(180deg, var(--blue) 0 39%, #a8dc65 39.3% 73%, #79c34f 73.2% 100%);
  border-radius: 21px;
  isolation: isolate;
}

.farm.targeting {
  cursor: crosshair;
}

.farm::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: -5%;
  right: -5%;
  bottom: 20%;
  height: 28%;
  background: #8fd05c;
  border-radius: 50% 50% 0 0;
  transform: rotate(-2deg);
}

.sun {
  position: absolute;
  z-index: 0;
  top: 32px;
  right: 9%;
  width: 70px;
  height: 70px;
  background: var(--yellow);
  border: 4px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  box-shadow: 0 0 0 13px rgba(255, 226, 91, 0.25);
}

.cloud {
  position: absolute;
  z-index: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 76px;
  line-height: 1;
  animation: cloud-drift 16s ease-in-out infinite alternate;
}

.cloud-one {
  top: 30px;
  left: 14%;
}

.cloud-two {
  top: 88px;
  left: 45%;
  font-size: 54px;
  animation-delay: -6s;
}

.barn {
  position: absolute;
  z-index: 1;
  right: 8%;
  top: 23%;
  width: 118px;
  height: 100px;
  background: #dc5547;
  border: 4px solid #983b34;
  border-radius: 5px 5px 12px 12px;
  box-shadow: 5px 7px 0 rgba(36, 53, 42, 0.18);
}

.barn-roof {
  position: absolute;
  left: -17px;
  top: -50px;
  width: 145px;
  height: 70px;
  background: #754232;
  clip-path: polygon(50% 0, 100% 75%, 94% 100%, 6% 100%, 0 75%);
}

.barn-door {
  position: absolute;
  left: 35px;
  bottom: 0;
  display: grid;
  width: 48px;
  height: 64px;
  place-items: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 34px;
  font-weight: 300;
  background: #6f392d;
  border: 3px solid #4d2c24;
}

.fence {
  position: absolute;
  z-index: 1;
  top: 47%;
  width: 31%;
  height: 50px;
  border-top: 9px solid #f3dcad;
  border-bottom: 9px solid #f3dcad;
  filter: drop-shadow(0 3px 0 rgba(70, 62, 42, 0.18));
}

.fence::before,
.fence::after {
  content: "";
  position: absolute;
  top: -23px;
  width: 13px;
  height: 76px;
  background: #f3dcad;
  border-radius: 5px 5px 2px 2px;
}

.fence::before {
  left: 17%;
}

.fence::after {
  right: 17%;
}

.fence-left {
  left: -3%;
}

.fence-right {
  right: -3%;
}

.phase-pill {
  position: absolute;
  z-index: 8;
  top: 15px;
  left: 15px;
  padding: 7px 13px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  background: rgba(36, 53, 42, 0.74);
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 99px;
  backdrop-filter: blur(5px);
}

.event-banner {
  position: absolute;
  z-index: 20;
  top: 18%;
  left: 50%;
  padding: 9px 18px;
  color: var(--ink);
  font-size: clamp(20px, 4vw, 34px);
  font-weight: 1000;
  white-space: nowrap;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 5px 5px 0 var(--ink);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -20px) rotate(-2deg) scale(0.8);
}

.event-banner.show {
  animation: banner-pop 1.55s ease both;
}

.combo-panel {
  position: absolute;
  z-index: 8;
  top: 15px;
  right: 15px;
  width: min(260px, 54%);
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.88);
  border: 2px solid var(--ink);
  border-radius: 13px;
  box-shadow: 3px 3px 0 rgba(36, 53, 42, 0.35);
  backdrop-filter: blur(5px);
  transition: transform 0.18s, background 0.18s;
}

.combo-panel.fever {
  background: #fff2a6;
}

.combo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.combo-row strong {
  font-size: clamp(16px, 3vw, 23px);
  letter-spacing: -0.03em;
}

.combo-row span {
  color: #bf4b2b;
  font-weight: 900;
}

.combo-track {
  height: 8px;
  margin-top: 6px;
  overflow: hidden;
  background: #dce5d8;
  border-radius: 99px;
}

.combo-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--yellow), var(--orange), var(--red));
  border-radius: inherit;
  transition: width 0.08s linear;
}

.boss-layer {
  position: absolute;
  z-index: 40;
  inset: 0;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(18, 30, 23, 0.58);
  backdrop-filter: blur(4px);
}

.boss-layer.visible {
  display: grid;
}

.boss-card {
  width: min(420px, 100%);
  padding: 18px 22px;
  text-align: center;
  background: var(--cream);
  border: 4px solid var(--ink);
  border-radius: 24px;
  box-shadow: 8px 9px 0 var(--ink);
  animation: boss-enter 0.3s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.boss-eyebrow {
  margin: 0 0 4px;
  color: #d55b2e;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0.14em;
}

.boss-title {
  margin: 0;
  font-size: clamp(27px, 6vw, 42px);
}

.boss-description,
.boss-status {
  margin: 7px 0;
  color: #607065;
  font-weight: 800;
  line-height: 1.45;
}

.boss-target {
  display: grid;
  min-width: 170px;
  min-height: 112px;
  margin: 12px auto 5px;
  padding: 8px 20px;
  place-items: center;
  color: var(--ink);
  background: #ffe69a;
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 4px 5px 0 var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  animation: boss-target-pulse 0.7s ease-in-out infinite alternate;
}

.boss-target:active {
  transform: translateY(3px) scale(0.97);
  box-shadow: 1px 2px 0 var(--ink);
}

.boss-target-icon {
  font-size: 54px;
  line-height: 1;
}

.boss-target-icon img {
  display: block;
  width: min(220px, 63vw);
  height: 100px;
  object-fit: contain;
  filter: drop-shadow(2px 3px 0 var(--ink));
  pointer-events: none;
}

.boss-target strong {
  font-size: 16px;
}

.boss-timer-track {
  height: 10px;
  overflow: hidden;
  background: #dce5d8;
  border: 1px solid var(--ink);
  border-radius: 99px;
}

.boss-timer-track span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--red));
  border-radius: inherit;
  transform-origin: left center;
}

.boss-meme-art {
  position: relative;
  display: none;
  width: 176px;
  height: 176px;
  margin: 0 auto 8px;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 18px;
  overflow: hidden;
}

.boss-layer.chicken-intro .boss-meme-art {
  display: grid;
}

.boss-layer.chicken-result .boss-meme-art,
.boss-layer.chicken-result .boss-target {
  display: none;
}

.boss-layer.chicken-result .boss-card {
  animation: chicken-result-in 0.28s ease-out both;
}

.boss-meme-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.boss-layer.rush {
  display: block;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}

.boss-layer.rush .boss-card {
  position: absolute;
  top: 67px;
  left: 50%;
  width: min(300px, calc(100% - 30px));
  padding: 7px 12px;
  border-width: 2px;
  border-radius: 14px;
  box-shadow: 3px 3px 0 var(--ink);
  transform: translateX(-50%);
  animation: none;
}

.boss-layer.rush .boss-eyebrow,
.boss-layer.rush .boss-title,
.boss-layer.rush .boss-description,
.boss-layer.rush .boss-target {
  display: none;
}

.boss-layer.rush .boss-status {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 13px;
}

.boss-layer.rush .boss-timer-track {
  height: 7px;
}

.target-hint {
  position: absolute;
  z-index: 19;
  left: 50%;
  bottom: 75px;
  padding: 8px 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  background: rgba(36, 53, 42, 0.84);
  border-radius: 99px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: 0.2s ease;
}

.target-hint.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.animals-layer,
.fx-layer {
  position: absolute;
  z-index: 5;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.fx-layer {
  z-index: 12;
}

.animal {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  padding: 0;
  place-items: center;
  background: transparent;
  border: 0;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  filter: drop-shadow(0 5px 2px rgba(36, 53, 42, 0.25));
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
}

.animal:hover .animal-sprite {
  filter: brightness(1.08);
}

.animal:focus-visible {
  outline: 4px solid #fff;
  border-radius: 50%;
}

.animal-sprite {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  animation: animal-bob 0.48s ease-in-out infinite alternate;
}

.animal.chicken .animal-sprite {
  animation-duration: 0.33s;
}

.animal.cow .animal-sprite {
  animation-duration: 0.62s;
}

.animal.cat .animal-sprite {
  animation-duration: 0.4s;
}

.farm.cat-active .animal.chicken .animal-sprite {
  animation-duration: 0.28s;
}

.farm.cat-active .phase-pill {
  background: var(--red);
}

.animal.golden .animal-sprite {
  filter: drop-shadow(0 0 7px #ffe11f) saturate(1.5);
  animation: animal-bob 0.28s ease-in-out infinite alternate, golden-glow 0.55s ease-in-out infinite alternate;
}

.animal-tag {
  position: absolute;
  top: -8px;
  left: 50%;
  padding: 2px 6px;
  color: #705100;
  font-size: 10px;
  font-weight: 1000;
  background: #fff3a1;
  border: 1px solid #9f7900;
  border-radius: 99px;
  transform: translateX(-50%);
}

.farm.boss-active .animal.boss-frozen .animal-sprite {
  animation-play-state: paused;
}

.farm.chicken-frenzy .animal.boss-frozen {
  visibility: hidden;
}

.farm.chicken-transition-out .animal.suspenders {
  opacity: 0;
  filter: blur(2px);
  transition: opacity 0.42s ease-out, filter 0.42s ease-out;
}

.snake-event-target {
  position: absolute;
  z-index: 18;
  display: grid;
  padding: 0;
  place-items: center;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  filter: drop-shadow(0 5px 2px rgba(36, 53, 42, 0.25));
  animation: snake-event-appear 0.52s ease-out both;
}

.snake-event-target img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  animation: snake-event-wiggle 0.9s ease-in-out infinite alternate;
}

.snake-event-target.is-hit img {
  animation: snake-event-hit 0.2s ease-out;
}

.farm.snake-event-out .snake-event-target,
.snake-event-target.snake-event-out {
  opacity: 0;
  filter: blur(3px);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.snake-event-count {
  position: absolute;
  right: -8px;
  bottom: -8px;
  padding: 2px 6px;
  color: #fff;
  font-size: 11px;
  font-weight: 1000;
  white-space: nowrap;
  background: var(--red);
  border: 2px solid var(--ink);
  border-radius: 99px;
  transform: scaleX(var(--snake-face, 1));
  pointer-events: none;
}

.farm-event-result {
  position: absolute;
  z-index: 31;
  top: 50%;
  left: 50%;
  display: grid;
  gap: 5px;
  min-width: min(280px, calc(100% - 36px));
  padding: 15px 22px;
  color: var(--ink);
  text-align: center;
  background: rgba(255, 245, 190, 0.96);
  border: 4px solid var(--ink);
  border-radius: 22px;
  box-shadow: 6px 7px 0 var(--ink);
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: farm-event-result-in 1.5s ease-out both;
}

.farm-event-result strong {
  font-size: clamp(26px, 7vw, 42px);
  line-height: 1;
}

.farm-event-result span {
  font-size: 13px;
  font-weight: 900;
}

.score-pop {
  position: absolute;
  z-index: 30;
  color: #fff;
  font-size: 22px;
  font-weight: 1000;
  text-shadow: -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink);
  pointer-events: none;
  animation: score-rise 0.72s ease-out forwards;
}

.skill-ring {
  position: absolute;
  z-index: 13;
  border: 7px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 5px var(--orange), inset 0 0 28px rgba(255, 216, 77, 0.75);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.2);
  animation: ring-blast 0.55s ease-out forwards;
}

.fly-beam {
  position: absolute;
  z-index: 13;
  left: -20%;
  width: 140%;
  height: 110px;
  border-top: 5px solid rgba(255, 255, 255, 0.95);
  border-bottom: 5px solid rgba(255, 255, 255, 0.95);
  background: linear-gradient(90deg, transparent, rgba(255, 241, 116, 0.78), rgba(255, 255, 255, 0.92), transparent);
  pointer-events: none;
  transform: translateY(-50%) skewX(-12deg);
  animation: fly-sweep 0.6s ease-out forwards;
}

.flying-character {
  position: absolute;
  left: -170px;
  width: 160px;
  height: 160px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 5px 3px rgba(36, 53, 42, 0.3));
  transform: translateY(-50%) rotate(18deg);
  animation: flyer 0.6s linear forwards;
}

.kangaroo-jump {
  position: absolute;
  width: 125px;
  height: 145px;
  object-fit: contain;
  pointer-events: none;
  transform: translate(-50%, -85%);
  animation: kangaroo-land 0.55s ease-out forwards;
}

.dog-flash {
  position: absolute;
  z-index: 14;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: clamp(36px, 7vw, 72px);
  font-weight: 1000;
  text-shadow: 5px 6px 0 var(--ink);
  background: rgba(255, 216, 77, 0.65);
  pointer-events: none;
  animation: dog-flash 0.6s ease-out forwards;
}

.dog-flash img {
  position: absolute;
  width: min(240px, 48%);
  height: 75%;
  object-fit: contain;
}

.dog-flash span {
  z-index: 1;
  align-self: end;
  margin-bottom: 18px;
}

.overlay {
  position: absolute;
  z-index: 50;
  inset: 0;
  display: grid;
  padding: 18px;
  place-items: center;
  background: rgba(25, 54, 38, 0.5);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(4px);
  transition: opacity 0.24s ease;
}

.overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.card {
  width: min(490px, 100%);
  max-height: calc(100% - 16px);
  overflow-y: auto;
  padding: clamp(20px, 4vw, 34px);
  text-align: center;
  background: var(--cream);
  border: 4px solid var(--ink);
  border-radius: 24px;
  box-shadow: 9px 10px 0 var(--ink);
  transform: translateY(16px) scale(0.97);
  transition: transform 0.25s ease;
}

.overlay.visible .card {
  transform: translateY(0) scale(1);
}

.hero-animals {
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 12px;
  margin-bottom: 5px;
}

.hero-animals img {
  width: clamp(64px, 15vw, 100px);
  height: clamp(70px, 15vw, 105px);
  object-fit: contain;
}

.eyebrow {
  margin-bottom: 5px;
  color: #d55b2e;
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: 0.14em;
}

.card h2 {
  margin-bottom: 10px;
  font-size: clamp(26px, 5vw, 40px);
  line-height: 1.05;
}

.card > p:not(.eyebrow):not(.near-miss) {
  color: #607065;
  line-height: 1.65;
}

.quick-rules {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 18px 0;
}

.quick-rules span {
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 800;
  background: #e7f2d6;
  border-radius: 99px;
}

.primary-button {
  min-width: 190px;
  padding: 12px 24px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 1000;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 13px;
  box-shadow: 5px 5px 0 var(--ink);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}

.primary-button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 7px 7px 0 var(--ink);
}

.primary-button:active {
  transform: translate(4px, 4px);
  box-shadow: 1px 1px 0 var(--ink);
}

.secondary-button,
.text-button {
  color: var(--ink);
  font-weight: 900;
  background: #fff7bf;
  border: 2px solid var(--ink);
  border-radius: 10px;
  cursor: pointer;
}

.secondary-button {
  padding: 9px 13px;
  box-shadow: 3px 3px 0 rgba(36, 53, 42, 0.45);
}

.secondary-button:disabled {
  color: #788178;
  cursor: wait;
  background: #e7ebe5;
}

.result-score {
  margin: 16px auto 12px;
  padding: 14px;
  background: #fff0a9;
  border: 3px solid var(--ink);
  border-radius: 17px;
}

.result-score span {
  display: block;
  font-size: 13px;
  font-weight: 800;
}

.result-score strong {
  display: block;
  font-size: clamp(38px, 9vw, 64px);
  line-height: 1;
}

.result-details {
  display: flex;
  justify-content: center;
  gap: 20px;
  color: #627064;
  font-size: 13px;
}

.result-details strong {
  color: var(--ink);
  font-size: 17px;
}

.near-miss {
  margin: 17px 0;
  padding: 10px;
  color: #9d3e25;
  font-weight: 900;
  background: #ffe4c7;
  border-radius: 10px;
}

.skills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.skill {
  position: relative;
  display: flex;
  min-height: 78px;
  overflow: hidden;
  align-items: center;
  gap: 11px;
  padding: 10px 15px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.9);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 5px 5px 0 rgba(36, 53, 42, 0.75);
  cursor: pointer;
  transition: transform 0.12s, background 0.15s, box-shadow 0.12s;
}

.skill:not(:disabled):hover {
  background: #fff4ad;
  transform: translateY(-2px);
}

.skill:not(:disabled):active,
.skill.armed {
  background: var(--yellow);
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 rgba(36, 53, 42, 0.75);
}

.skill:disabled {
  color: #788178;
  cursor: not-allowed;
  background: #e7ebe5;
  box-shadow: 3px 3px 0 rgba(36, 53, 42, 0.35);
}

.skill.locked {
  background: #f1ead9;
}

.skill.locked .skill-status {
  background: #a66b36;
}

.skill-icon {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  object-fit: contain;
  pointer-events: none;
}

.skill-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.skill-copy strong,
.skill-copy small {
  display: block;
}

.skill-copy strong {
  overflow: hidden;
  font-size: clamp(14px, 2vw, 18px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-copy small {
  margin-top: 3px;
  color: #657469;
  font-size: 11px;
  font-weight: 700;
}

.skill-status {
  position: relative;
  z-index: 2;
  margin-left: auto;
  padding: 4px 7px;
  color: #fff;
  font-size: 10px;
  font-weight: 1000;
  background: var(--deep-green);
  border-radius: 99px;
  font-variant-numeric: tabular-nums;
}

.skill:disabled .skill-status {
  color: #fff;
  background: #79867c;
}

.skill-progress {
  position: absolute;
  z-index: 1;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 7px;
  background: var(--green);
  transform-origin: left;
}

.tip {
  margin: 15px 0 0;
  color: #59705e;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

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

.leaderboard-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 2px dashed #c9d7bd;
}

.leaderboard-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(25, 54, 38, 0.52);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(5px);
  transition: opacity 0.2s ease;
}

.leaderboard-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.leaderboard-card {
  width: min(520px, 100%);
  max-height: min(720px, 92vh);
  overflow: auto;
  padding: clamp(20px, 4vw, 30px);
  background: var(--cream);
  border: 4px solid var(--ink);
  border-radius: 22px;
  box-shadow: 8px 9px 0 var(--ink);
  transform: translateY(12px) scale(0.97);
  transition: transform 0.2s ease;
}

.leaderboard-modal.visible .leaderboard-card {
  transform: translateY(0) scale(1);
}

.leaderboard-card .eyebrow {
  margin-bottom: 3px;
}

.leaderboard-card h2 {
  margin: 0;
  font-size: 25px;
}

.leaderboard-close {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--ink);
  font-size: 27px;
  line-height: 1;
  background: #fff7bf;
  border: 2px solid var(--ink);
  border-radius: 50%;
  cursor: pointer;
}

.leaderboard-card .leaderboard-box {
  margin-top: 16px;
  padding-top: 0;
  border-top: 0;
}

.rank-tools {
  margin-top: 12px;
}

.rank-caption {
  color: #607065;
  font-size: 12px;
  font-weight: 700;
}

.my-rank {
  margin-top: 10px;
  padding: 9px 11px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  background: #fff0a9;
  border: 2px solid #d9b83d;
  border-radius: 9px;
}

.rank-status {
  margin: 9px 0 0;
  color: #607065;
  font-size: 12px;
  font-weight: 700;
}

.leaderboard-header strong {
  font-size: 17px;
}

.text-button {
  padding: 4px 9px;
  font-size: 12px;
  background: transparent;
  border-color: #809877;
}

.rank-tabs {
  display: flex;
  gap: 7px;
  margin-top: 10px;
}

.rank-tab {
  padding: 6px 11px;
  color: #607065;
  font-size: 12px;
  font-weight: 900;
  background: #edf3e5;
  border: 2px solid transparent;
  border-radius: 99px;
  cursor: pointer;
}

.rank-tab.active {
  color: var(--ink);
  background: var(--yellow);
  border-color: var(--ink);
}

.rank-list {
  display: grid;
  gap: 6px;
  min-height: 34px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.rank-item {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 13px;
  background: #fffdf1;
  border-radius: 9px;
}

.rank-item > strong {
  color: #b16b29;
}

.rank-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-item b {
  font-variant-numeric: tabular-nums;
}

.rank-empty {
  padding: 10px;
  color: #7a887b;
  text-align: center;
  background: #f2f5ed;
  border-radius: 9px;
}

@keyframes animal-bob {
  from { transform: translateY(0) rotate(-3deg); }
  to { transform: translateY(-7px) rotate(3deg); }
}

@keyframes golden-glow {
  to { filter: drop-shadow(0 0 15px #fff6a3) saturate(1.9); }
}

@keyframes score-rise {
  0% { opacity: 0; transform: translate(-50%, 4px) scale(0.6); }
  20% { opacity: 1; transform: translate(-50%, -9px) scale(1.18); }
  100% { opacity: 0; transform: translate(-50%, -58px) scale(0.95); }
}

@keyframes ring-blast {
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

@keyframes fly-sweep {
  0% { opacity: 0; transform: translateY(-50%) translateX(-35%) skewX(-12deg); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-50%) translateX(30%) skewX(-12deg); }
}

@keyframes flyer {
  to { left: calc(100% + 10px); }
}

@keyframes kangaroo-land {
  0% { opacity: 0; transform: translate(-50%, -180%) scale(0.75); }
  35% { opacity: 1; transform: translate(-50%, -85%) scale(1.08, 0.9); }
  65% { opacity: 1; transform: translate(-50%, -90%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -85%) scale(1); }
}

@keyframes dog-flash {
  0% { opacity: 0; transform: scale(0.35) rotate(-7deg); }
  25% { opacity: 1; transform: scale(1.05) rotate(3deg); }
  100% { opacity: 0; transform: scale(1.35) rotate(-2deg); }
}

@keyframes banner-pop {
  0% { opacity: 0; transform: translate(-50%, -20px) rotate(-3deg) scale(0.75); }
  18%, 70% { opacity: 1; transform: translate(-50%, 0) rotate(-2deg) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -15px) rotate(2deg) scale(1.08); }
}

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

@keyframes boss-enter {
  from { opacity: 0; transform: translateY(18px) scale(0.86) rotate(-2deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

@keyframes chicken-result-in {
  from { opacity: 0; transform: translateY(12px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes snake-event-appear {
  from { opacity: 0; filter: blur(5px); }
  to { opacity: 1; filter: blur(0); }
}

@keyframes snake-event-wiggle {
  from { transform: translateY(0) rotate(-2deg) scaleY(0.98); }
  to { transform: translateY(-7px) rotate(3deg) scaleY(1.02); }
}

@keyframes snake-event-hit {
  0% { transform: scale(1); }
  45% { transform: scale(0.88) rotate(-4deg); }
  100% { transform: scale(1); }
}

@keyframes farm-event-result-in {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.72); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  70% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -58%) scale(0.96); }
}

@keyframes boss-target-pulse {
  to { transform: scale(1.045) rotate(1deg); }
}

@media (max-width: 720px) {
  .game {
    width: min(100% - 14px, 1120px);
    padding-top: 6px;
    padding-bottom: 12px;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: flex-start;
    gap: 10px;
  }

  .topbar-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .brand-dog {
    width: 44px;
    height: 44px;
    font-size: 28px;
    border-radius: 13px;
  }

  .brand p,
  .best-stat {
    display: none;
  }

  .music-toggle {
    margin-top: 5px;
  }

  .stats {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(2, minmax(68px, 1fr));
  }

  .stat {
    min-width: 68px;
    padding: 5px 7px;
  }

  .stat strong {
    font-size: 18px;
  }

  .farm-shell {
    border-radius: 20px;
  }

  .farm {
    height: clamp(360px, 48vh, 430px);
    min-height: 360px;
    border-radius: 14px;
  }

  .barn {
    right: 3%;
    transform: scale(0.78);
    transform-origin: bottom right;
  }

  .skills {
    gap: 7px;
  }

  .leaderboard-modal {
    padding: 10px;
  }

  .skill {
    min-height: 82px;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 4px 2px 8px;
    text-align: center;
    border-width: 2px;
    border-radius: 14px;
    box-shadow: 3px 3px 0 rgba(36, 53, 42, 0.75);
  }

  .skill-icon {
    width: 38px;
    height: 38px;
  }

  .skill-copy strong {
    font-size: 13px;
  }

  .skill-copy small {
    display: none;
  }

  .skill-status {
    margin: 2px 0 0;
    padding: 3px 5px;
    font-size: 9px;
  }

  .boss-layer {
    padding: 12px;
  }

  .boss-card {
    padding: 13px 15px;
  }

  .boss-target {
    min-height: 94px;
    margin-top: 8px;
  }

  .boss-target-icon {
    font-size: 46px;
  }

  .boss-meme-art {
    width: 140px;
    height: 140px;
  }

  .card {
    max-height: calc(100% - 16px);
    padding: 12px 14px;
    overflow-y: auto;
  }

  .hero-animals {
    gap: 4px;
    margin-bottom: 2px;
  }

  .hero-animals img {
    width: 50px;
    height: 54px;
  }

  .card h2 {
    margin-bottom: 6px;
    font-size: 26px;
  }

  .card > p:not(.eyebrow):not(.near-miss) {
    font-size: 14px;
    line-height: 1.4;
  }

  .quick-rules {
    gap: 4px;
    margin: 10px 0;
  }

  .quick-rules span {
    padding: 4px 6px;
    font-size: 11px;
  }

  .primary-button {
    min-width: 160px;
    padding: 9px 18px;
    font-size: 16px;
  }

  .tip {
    margin-top: 8px;
    font-size: 11px;
  }
}

@media (max-width: 720px) and (max-height: 700px) {
  .game {
    padding-top: 4px;
    padding-bottom: 6px;
  }

  .topbar {
    gap: 5px;
  }

  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .stat {
    min-width: 0;
    padding: 4px 3px;
    border-radius: 10px;
  }

  .stat span {
    font-size: 10px;
  }

  .stat strong {
    font-size: 16px;
  }

  .farm {
    height: 300px;
    min-height: 300px;
  }

  .skills {
    gap: 4px;
    margin-top: 8px;
  }

  .skill {
    min-height: 66px;
    padding: 3px 2px 6px;
  }

  .skill-icon {
    width: 30px;
    height: 30px;
  }

  .skill-copy strong {
    font-size: 12px;
  }

  .skill-status {
    margin-top: 1px;
    padding: 2px 4px;
    font-size: 8px;
  }

  .tip {
    display: none;
  }

  .card {
    padding: 8px 10px;
  }

  .hero-animals {
    gap: 2px;
  }

  .hero-animals img {
    width: 38px;
    height: 41px;
  }

  .card h2 {
    margin-bottom: 4px;
    font-size: 22px;
  }

  .card > p:not(.eyebrow):not(.near-miss) {
    font-size: 12px;
    line-height: 1.3;
  }

  .start-card > p:not(.eyebrow):not(.near-miss) {
    display: none;
  }

  .quick-rules {
    gap: 3px;
    margin: 6px 0;
  }

  .quick-rules span {
    padding: 3px 4px;
    font-size: 10px;
  }

  .primary-button {
    min-width: 140px;
    padding: 7px 14px;
    font-size: 15px;
  }
}

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