*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box
}

:root {
  --green1: #f8fbf7;
  --green2: #eaf4ee;
  --accent: #2f8f5b;
  --accent2: #246f47;
  --gold: #d8a923;
  --glass: rgba(255, 255, 255, .72);
  --glass2: rgba(255, 255, 255, .9);
  --text: #24342c;
  --white: #102018;
}

html {
  scroll-behavior: smooth
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #fbfdfb 0%, #eef6f0 48%, #ddeee5 100%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Animated Background Particles ── */
.bg-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden
}

.particle {
  position: absolute;
  bottom: -24px;
  border-radius: 50%;
  opacity: 0;
  animation: floatUp linear infinite;
  box-shadow: 0 0 14px rgba(47, 143, 91, .18);
}


@keyframes floatUp {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }

  10% {
    opacity: .42;
  }

  85% {
    opacity: .42;
  }

  100% {
    transform: translateY(-115vh) rotate(720deg);
    opacity: 0;
  }
}


/* ── Animated Grass Stripes ── */
.grass-bg {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 28vh;
  pointer-events: none;
  z-index: 0;
  background: repeating-linear-gradient(90deg,
      rgba(47, 143, 91, .035) 0px, rgba(47, 143, 91, .035) 40px,
      transparent 40px, transparent 80px);
  mask-image: linear-gradient(to top, rgba(0, 0, 0, .22), transparent);
  -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, .22), transparent);
}


/* ── Main Container ── */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Hero Section ── */
.hero {
  text-align: center;
  padding: 50px 20px 30px;
  width: 100%;
  animation: fadeInDown .8s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.logo-svg {
  width: 90px;
  height: 90px;
  margin: 0 auto 20px;
  filter:
    drop-shadow(0 0 10px rgba(47, 143, 91, .32)) drop-shadow(0 0 28px rgba(47, 143, 91, .22));
  animation: pulse 3s ease-in-out infinite;
}


@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    filter:
      drop-shadow(0 0 10px rgba(47, 143, 91, .28)) drop-shadow(0 0 26px rgba(47, 143, 91, .18));
  }

  50% {
    transform: scale(1.04);
    filter:
      drop-shadow(0 0 14px rgba(47, 143, 91, .38)) drop-shadow(0 0 34px rgba(47, 143, 91, .26));
  }
}


.hero h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 800;
  color: #2f8f5b;
  letter-spacing: 0;
  line-height: 1.1;
}

@keyframes gradientShift {

  0%,
  100% {
    background-position: 0% 50%
  }

  50% {
    background-position: 100% 50%
  }
}

.hero .subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: rgba(36, 52, 44, .62);
  margin-top: 10px;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
}


/* ── Countdown ── */
.countdown {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin: 30px 0;
  flex-wrap: wrap;
  animation: fadeIn 1s ease-out .3s both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.countdown-item {
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(36, 52, 44, .08);
  border-radius: 14px;
  padding: 18px 22px;
  min-width: 80px;
  text-align: center;
  transition: transform .3s, box-shadow .3s;
  box-shadow: 0 8px 24px rgba(27, 67, 50, .08);
}

.countdown-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 230, 118, .15);
}

.countdown-item .num {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}

.countdown-item .label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-top: 4px;
}

/* ── Glassmorphism Card ── */
.glass-card {
  background: rgba(255, 255, 255, .7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(36, 52, 44, .08);
  border-radius: 22px;
  padding: 30px;
  width: 100%;
  margin: 20px 0;
  box-shadow: 0 16px 40px rgba(27, 67, 50, .1);
  animation: fadeIn 1s ease-out .5s both;
}

.glass-card h2 {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  color: #24342c;
  text-align: center;
  margin-bottom: 5px;
}

.glass-card .card-sub {
  text-align: center;
  color: rgba(36, 52, 44, .58);
  font-size: .85rem;
  margin-bottom: 20px;
}

/* ── Game Container ── */
.game-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.scoreboard {
  display: flex;
  gap: 30px;
  justify-content: center;
  margin-bottom: 15px;
}

.score-item {
  text-align: center
}

.score-item .score-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(36, 52, 44, .56);
}

.score-item .score-val {
  font-size: 2rem;
  font-weight: 800;
  color: #24342c !important;
  transition: transform .3s, color .3s;
}

.score-item .score-val.goals {
  color: var(--accent) !important;
}

.score-item .score-val.misses {
  color: #ff5252 !important;
}

.score-item .score-val:not(.goals):not(.misses) {
  color: #24342c;
}

.score-item .score-val.bounce {
  animation: bounceIn .4s ease
}

@keyframes bounceIn {
  0% {
    transform: scale(1)
  }

  40% {
    transform: scale(1.4)
  }

  100% {
    transform: scale(1)
  }
}

.canvas-container {
  position: relative;
  width: min(100%, 600px);
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(36, 52, 44, .12);
  box-shadow: 0 12px 30px rgba(27, 67, 50, .16);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

/* ── Game Message Overlay ── */
.game-msg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 800;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
  text-shadow: 0 2px 20px rgba(0, 0, 0, .8);
  white-space: nowrap;
}

.game-msg.show {
  opacity: 1;
  animation: msgPop .6s ease
}

@keyframes msgPop {
  0% {
    transform: translate(-50%, -50%) scale(.5);
    opacity: 0
  }

  50% {
    transform: translate(-50%, -50%) scale(1.15);
    opacity: 1
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1
  }
}

.game-msg.goal {
  color: var(--accent)
}

.game-msg.miss {
  color: #ff5252
}

.game-msg.saved {
  color: var(--gold)
}

/* ── Controls Info ── */
.controls {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 15px;
  flex-wrap: wrap;
}

.control-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, .65);
  border: 1px solid rgba(36, 52, 44, .08);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: .78rem;
  color: rgba(36, 52, 44, .62);
}

.key-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #f7faf7;
  border: 1px solid rgba(36, 52, 44, .14);
  font-size: .7rem;
  color: #24342c;
  font-weight: 600;
  padding: 0 6px;
}

/* ── Mobile Touch Controls ── */
.touch-controls {
  display: none;
  gap: 10px;
  justify-content: center;
  margin-top: 15px;
  width: 100%;
  max-width: 600px;
}

.touch-btn {
  flex: 1;
  max-width: 120px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid rgba(36, 52, 44, .12);
  background: rgba(255, 255, 255, .82);
  color: #24342c;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background .15s, transform .15s;
  -webkit-tap-highlight-color: transparent;
}

.touch-btn:active {
  background: rgba(255, 255, 255, .2);
  transform: scale(.95)
}

.touch-btn.shoot {
  background: #e6f4ea;
  border-color: rgba(47, 143, 91, .22);
  color: #246f47;
  font-weight: 700;
  font-size: .9rem;
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 40px 20px 30px;
  color: rgba(36, 52, 44, .45);
  font-size: .75rem;
  letter-spacing: 1px;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

/* ── Responsive ── */
@media(max-width:600px) {
  .hero {
    padding: 30px 15px 20px
  }

  .glass-card {
    padding: 20px 15px;
    border-radius: 18px
  }

  .countdown-item {
    padding: 12px 16px;
    min-width: 65px
  }

  .controls {
    display: none
  }

  .touch-controls {
    display: flex
  }

  .scoreboard {
    gap: 20px
  }

  .score-item .score-val {
    font-size: 1.5rem
  }
}

@media (max-width: 600px) {
  .container {
    padding: 12px 14px;
  }

  .hero {
    padding: 22px 10px 14px;
  }

  .logo-svg {
    width: 82px;
    height: 82px;
    margin-bottom: 12px;
  }

  .hero h1 {
    font-size: clamp(2.1rem, 11vw, 3rem);
    line-height: 1;
  }

  .hero .subtitle {
    font-size: .72rem;
    letter-spacing: 2px;
    margin-top: 8px;
  }

  .countdown {
    display: grid;
    grid-template-columns: repeat(2, minmax(105px, 1fr));
    gap: 14px;
    width: min(100%, 300px);
    margin: 24px auto 18px;
  }

  .countdown-item {
    min-width: 0;
    padding: 14px 12px;
    border-radius: 14px;
  }

  .countdown-item .num {
    font-size: 2rem;
    line-height: 1;
  }

  .countdown-item .label {
    font-size: .68rem;
    letter-spacing: 2px;
    margin-top: 8px;
  }

  .glass-card {
    margin: 10px 0 18px;
    padding: 24px 12px 18px;
    border-radius: 20px;
  }

  .glass-card h2 {
    font-size: 1.45rem;
  }

  .scoreboard {
    gap: 28px;
    margin-bottom: 18px;
  }

  .canvas-container {
    width: 100%;
    max-width: 100%;
    border-radius: 14px;
  }
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 8px
}

::-webkit-scrollbar-track {
  background: var(--green1)
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 230, 118, .3);
  border-radius: 4px
}

body::before,
body::after {
  content: "";
  position: fixed;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 0;
}

body::before {
  bottom: 0;
  height: 260px;
  background:
    radial-gradient(130px 56px at 16% 74%, rgba(185, 215, 190, .34) 0 58%, transparent 60%),
    radial-gradient(170px 64px at 86% 72%, rgba(185, 215, 190, .32) 0 58%, transparent 60%),
    linear-gradient(7deg, rgba(211, 229, 215, .52) 0 43%, transparent 44%),
    linear-gradient(-6deg, rgba(227, 238, 229, .78) 0 39%, transparent 40%);
}

body::after {
  top: 100px;
  height: 420px;
  background:
    radial-gradient(38px 18px at 17% 30%, rgba(190, 206, 195, .34) 0 58%, transparent 60%),
    radial-gradient(52px 24px at 80% 22%, rgba(190, 206, 195, .26) 0 58%, transparent 60%),
    radial-gradient(58px 26px at 87% 66%, rgba(190, 206, 195, .24) 0 58%, transparent 60%),
    radial-gradient(4px 4px at 21% 13%, rgba(126, 178, 136, .26) 0 98%, transparent 100%),
    radial-gradient(4px 4px at 76% 10%, rgba(126, 178, 136, .24) 0 98%, transparent 100%),
    radial-gradient(3px 3px at 12% 74%, rgba(126, 178, 136, .2) 0 98%, transparent 100%);
}

.container::before,
.container::after {
  content: "";
  position: fixed;
  bottom: 112px;
  width: 120px;
  height: 170px;
  pointer-events: none;
  z-index: -1;
  opacity: .58;
}

.container::before {
  left: max(26px, calc(50% - 640px));
  background:
    radial-gradient(circle at 36% 44%, rgba(112, 165, 121, .35) 0 23px, transparent 24px),
    radial-gradient(circle at 36% 31%, rgba(112, 165, 121, .27) 0 27px, transparent 28px),
    linear-gradient(rgba(112, 165, 121, .42), rgba(112, 165, 121, .42)) 35% 48% / 5px 82px no-repeat,
    linear-gradient(35deg, transparent 45%, rgba(112, 165, 121, .28) 46% 50%, transparent 51%) 30% 62% / 42px 28px no-repeat,
    linear-gradient(-35deg, transparent 45%, rgba(112, 165, 121, .28) 46% 50%, transparent 51%) 30% 65% / 42px 28px no-repeat,
    radial-gradient(ellipse at 78% 46%, rgba(112, 165, 121, .28) 0 32px, transparent 33px),
    linear-gradient(rgba(112, 165, 121, .38), rgba(112, 165, 121, .38)) 78% 54% / 5px 88px no-repeat;
}

.container::after {
  right: max(26px, calc(50% - 640px));
  background:
    radial-gradient(circle at 50% 28%, rgba(112, 165, 121, .34) 0 30px, transparent 31px),
    radial-gradient(circle at 32% 45%, rgba(112, 165, 121, .26) 0 25px, transparent 26px),
    radial-gradient(circle at 68% 45%, rgba(112, 165, 121, .26) 0 25px, transparent 26px),
    linear-gradient(rgba(112, 165, 121, .4), rgba(112, 165, 121, .4)) 50% 55% / 5px 92px no-repeat;
}