
/* =========================================================
   🐾 ANIMAL SMASH
   COMPLETE GAME STYLE
========================================================= */

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  font-family:
    Arial,
    Helvetica,
    sans-serif;

  background:
    radial-gradient(
      circle at top,
      #243047 0%,
      #111827 45%,
      #070b12 100%
    );

  color: white;

  overflow-x: hidden;
}

button {
  font: inherit;
}

.game-page {
  width: min(100%, 900px);
  margin: auto;
  padding: 14px;
}


/* =========================================================
   HEADER
========================================================= */

.game-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;

  margin-bottom: 18px;
}

.title-area {
  text-align: center;
}

.title-area h1 {
  margin: 0;
  font-size: clamp(1.6rem, 6vw, 2.6rem);
}

.title-area p {
  margin: 5px 0 0;
  opacity: .75;
  font-size: .85rem;
}

.back-button,
.icon-button {
  border: 0;
  border-radius: 12px;
  padding: 10px 13px;
  background: rgba(255,255,255,.1);
  color: white;
  cursor: pointer;
}

.icon-button {
  font-size: 1.2rem;
}


/* =========================================================
   DIFFICULTY
========================================================= */

.difficulty-panel {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  text-align: center;
}

.difficulty-panel h2 {
  margin: 0 0 6px;
}

.difficulty-description {
  opacity: .7;
  margin-top: 5px;
}

.difficulty-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 15px;
}

.difficulty-button {
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 15px 8px;
  background: rgba(255,255,255,.08);
  color: white;
  cursor: pointer;
  transition: .2s;
}

.difficulty-button span {
  display: block;
  font-weight: 900;
}

.difficulty-button small {
  display: block;
  margin-top: 6px;
  opacity: .65;
}

.difficulty-button:hover,
.difficulty-button.active {
  transform: translateY(-2px);
  border-color: #fff;
  background: rgba(255,255,255,.15);
}


/* =========================================================
   OBJECTIVE
========================================================= */

.objective-panel {
  display: grid;
  grid-template-columns: 1fr 1.7fr 1fr;
  gap: 10px;
  margin: 14px 0;
}

.round-display,
.target-display,
.special-display {
  border-radius: 18px;
  padding: 12px;
  text-align: center;

  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
}

.round-display span,
.target-display span,
.special-display span {
  display: block;
  font-size: .72rem;
  opacity: .65;
}

.round-display strong {
  display: block;
  font-size: 1.8rem;
  margin-top: 4px;
}

.target-display strong {
  display: block;
  font-size: clamp(1.2rem, 5vw, 1.8rem);
  margin: 5px 0;
}

.special-display strong {
  display: block;
  font-size: 2rem;
  margin: 4px;
}


/* =========================================================
   GAME INFO
========================================================= */

.game-info {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.info-box {
  text-align: center;
  padding: 10px 5px;
  border-radius: 15px;
  background: rgba(255,255,255,.08);
}

.info-label {
  display: block;
  font-size: .65rem;
  opacity: .65;
}

.info-box strong {
  display: block;
  margin-top: 4px;
  font-size: 1.2rem;
}

.time-box strong {
  font-size: 1.4rem;
}


/* =========================================================
   GAME BOARD
========================================================= */

.game-container {
  position: relative;
}

.game-board {
  position: relative;

  width: 100%;
  max-width: 650px;

  margin: auto;

  aspect-ratio: 1 / 1;

  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(10px, 3vw, 18px);

  padding: clamp(10px, 4vw, 22px);

  border-radius: 30px;

  background:
    linear-gradient(
      145deg,
      #182235,
      #0b111c
    );

  box-shadow:
    0 20px 60px rgba(0,0,0,.45),
    inset 0 0 30px rgba(0,0,0,.4);

  overflow: hidden;
}


/* =========================================================
   HOLES
========================================================= */

.hole {
  position: relative;

  border: 0;
  padding: 0;

  border-radius: 50%;

  background:
    radial-gradient(
      ellipse at center,
      #030507 0%,
      #0b0f15 48%,
      #151c29 52%,
      #05070a 100%
    );

  box-shadow:
    inset 0 8px 15px rgba(0,0,0,.8),
    0 5px 10px rgba(0,0,0,.35);

  cursor: crosshair;

  overflow: hidden;

  min-width: 0;
  min-height: 0;

  touch-action: manipulation;

  transition: transform .12s;
}

.hole:active {
  transform: scale(.94);
}

.hole-shadow {
  position: absolute;
  inset: 15%;
  border-radius: 50%;
  background: rgba(0,0,0,.5);
}


/* =========================================================
   ANIMAL
========================================================= */

.animal {
  position: absolute;

  left: 50%;
  top: 58%;

  transform:
    translate(-50%, -50%)
    scale(0);

  font-size: clamp(2.5rem, 10vw, 5rem);

  line-height: 1;

  z-index: 4;

  pointer-events: none;

  transition:
    transform .15s ease;
}

.hole.active .animal {
  transform:
    translate(-50%, -50%)
    scale(1);
}

.hole.active {
  box-shadow:
    inset 0 5px 15px rgba(0,0,0,.8),
    0 0 0 2px rgba(255,255,255,.08);
}


/* =========================================================
   TARGET
========================================================= */

.hole.target-hit {
  animation: targetHit .3s ease;
}

@keyframes targetHit {
  50% {
    transform: scale(1.12);
  }
}


/* =========================================================
   SPECIAL
========================================================= */

.hole.special {
  box-shadow:
    0 0 20px rgba(255,215,0,.8),
    inset 0 0 20px rgba(255,215,0,.2);
}

.hole.special .animal {
  animation: specialPulse .6s infinite alternate;
}

@keyframes specialPulse {
  from {
    filter: brightness(1);
  }

  to {
    filter: brightness(1.6);
    transform:
      translate(-50%, -50%)
      scale(1.12);
  }
}


/* =========================================================
   BOMB
========================================================= */

.hole.bomb {
  box-shadow:
    0 0 18px rgba(255,60,60,.5),
    inset 0 0 15px rgba(255,0,0,.1);
}

.hole.bomb .animal {
  animation: bombShake .2s infinite;
}

@keyframes bombShake {
  0% {
    transform:
      translate(-52%, -50%)
      rotate(-3deg)
      scale(1);
  }

  50% {
    transform:
      translate(-48%, -50%)
      rotate(3deg)
      scale(1.05);
  }

  100% {
    transform:
      translate(-52%, -50%)
      rotate(-3deg)
      scale(1);
  }
}


/* =========================================================
   HAMMER
========================================================= */

.hammer {
  position: absolute;

  left: -100px;
  top: -100px;

  z-index: 50;

  font-size: clamp(3rem, 12vw, 6rem);

  pointer-events: none;

  transform-origin: 75% 75%;

  opacity: 0;

  filter:
    drop-shadow(
      5px 8px 5px rgba(0,0,0,.5)
    );
}

.hammer.hammer-hit {
  animation: hammerSmash .38s ease-out;
}

@keyframes hammerSmash {

  0% {
    opacity: 0;
    transform:
      rotate(-55deg)
      scale(.7);
  }

  20% {
    opacity: 1;
    transform:
      rotate(-35deg)
      scale(1);
  }

  55% {
    opacity: 1;
    transform:
      rotate(28deg)
      scale(1.12);
  }

  70% {
    transform:
      rotate(8deg)
      scale(1);
  }

  100% {
    opacity: 0;
    transform:
      rotate(0)
      scale(.85);
  }
}


/* =========================================================
   SCARE
========================================================= */

.scare-overlay {
  position: absolute;

  inset: 0;

  z-index: 40;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  background: rgba(0,0,0,.72);

  opacity: 0;
  visibility: hidden;

  pointer-events: none;
}

.scare-overlay.show {
  animation: scareFlash .75s ease;
}

.scare-overlay div {
  font-size: clamp(4rem, 20vw, 9rem);
}

.scare-overlay span {
  font-weight: 900;
  letter-spacing: 2px;
}

@keyframes scareFlash {

  0% {
    opacity: 0;
    transform: scale(.6);
  }

  20% {
    opacity: 1;
    transform: scale(1.15);
  }

  55% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
  }
}


/* =========================================================
   MESSAGE
========================================================= */

.message-area {
  min-height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;

  text-align: center;

  padding: 8px;
}

.message-area p {
  margin: 0;
  font-weight: 800;
}


/* =========================================================
   CONTROLS
========================================================= */

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 15px;
  padding: 13px 20px;

  color: white;

  font-weight: 900;

  cursor: pointer;

  transition: .2s;
}

.primary-button {
  background:
    linear-gradient(
      135deg,
      #16a34a,
      #15803d
    );
}

.secondary-button {
  background:
    rgba(255,255,255,.12);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-2px);
}


/* =========================================================
   BEST SCORE
========================================================= */

.best-score {
  display: flex;
  justify-content: center;
  gap: 10px;

  margin: 15px 0;

  padding: 12px;

  border-radius: 15px;

  background: rgba(255,255,255,.06);
}

.best-score strong {
  color: #ffd54a;
}


/* =========================================================
   INSTRUCTIONS
========================================================= */

.instructions,
.game-rules {
  margin-top: 18px;

  padding: 18px;

  border-radius: 20px;

  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
}

.instructions h2,
.game-rules h2 {
  margin-top: 0;
}

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

.instruction-grid div {
  display: flex;
  align-items: center;
  gap: 10px;

  padding: 10px;

  border-radius: 13px;

  background: rgba(255,255,255,.05);
}

.instruction-grid span {
  font-size: 1.6rem;
}

.instruction-grid p {
  margin: 0;
  font-size: .85rem;
}

.game-rules p {
  line-height: 1.55;
  opacity: .78;
}


/* =========================================================
   UTILITIES
========================================================= */

.hidden {
  display: none !important;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 600px) {

  .game-page {
    padding: 9px;
  }

  .game-header {
    grid-template-columns: auto 1fr auto;
    gap: 6px;
  }

  .back-button {
    padding: 8px;
    font-size: .8rem;
  }

  .icon-button {
    padding: 8px;
  }

  .difficulty-buttons {
    grid-template-columns: 1fr;
  }

  .difficulty-button {
    padding: 12px;
  }

  .objective-panel {
    grid-template-columns: 1fr 1.5fr 1fr;
  }

  .objective-panel > div {
    padding: 8px 4px;
  }

  .game-info {
    gap: 5px;
  }

  .info-box {
    padding: 8px 3px;
  }

  .instruction-grid {
    grid-template-columns: 1fr;
  }

}


/* =========================================================
   VERY SMALL PHONES
========================================================= */

@media (max-width: 380px) {

  .title-area h1 {
    font-size: 1.35rem;
  }

  .title-area p {
    font-size: .7rem;
  }

  .game-board {
    gap: 7px;
    padding: 9px;
  }

  .animal {
    font-size: 2.4rem;
  }

}
/* =========================================================
   ❤️ LIFE LOST EFFECT
========================================================= */

#lives.life-lost {
  animation: lifeLost .45s ease;
}

@keyframes lifeLost {

  0% {
    transform: scale(1);
  }

  35% {
    transform: scale(1.35);
  }

  60% {
    transform: scale(.85);
  }

  100% {
    transform: scale(1);
  }

}
