/* game/game.css
 * Flagship elevation styles: home screen, course map strip, pro shop,
 * banners, foursome, hazards, rush mode. Extends the existing black +
 * chartreuse studio identity (#C6F542) and the existing green course
 * palette from styles.css. Additive only: styles.css keeps owning the base
 * game chrome (HUD, buttons, holes, win panel).
 */

:root {
  --lindy-chartreuse: #C6F542;
  --lindy-black: #0a0a0a;
  --fx-vignette-damage: rgba(210, 75, 37, 0.001);
  --fx-vignette-rush: rgba(198, 245, 66, 0.001);
}

/* ---------------- FX canvas + stage shake anchor ---------------- */

.fx-canvas {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.fx-vignette {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: 0;
  border-radius: inherit;
}

.fx-vignette--damage {
  animation: fxVignetteDamage 180ms ease-out;
}

.fx-vignette--rush {
  animation: fxVignetteRush 260ms ease-out;
}

@keyframes fxVignetteDamage {
  0% { opacity: 0; box-shadow: inset 0 0 0 rgba(210, 75, 37, 0); }
  30% { opacity: 1; box-shadow: inset 0 0 90px 30px rgba(210, 75, 37, 0.55); }
  100% { opacity: 0; box-shadow: inset 0 0 0 rgba(210, 75, 37, 0); }
}

@keyframes fxVignetteRush {
  0% { opacity: 0; box-shadow: inset 0 0 0 rgba(198, 245, 66, 0); }
  35% { opacity: 1; box-shadow: inset 0 0 100px 34px rgba(198, 245, 66, 0.5); }
  100% { opacity: 0; box-shadow: inset 0 0 0 rgba(198, 245, 66, 0); }
}

/* ---------------- Combo / rush banners ---------------- */

.fx-banner {
  position: absolute;
  top: 14%;
  left: 50%;
  z-index: 15;
  padding: 10px 26px;
  color: var(--lindy-black);
  background: linear-gradient(180deg, #eaffa0, var(--lindy-chartreuse));
  border-radius: 999px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  font: 950 clamp(1.1rem, 2.6vw, 1.9rem) system-ui, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.7);
  pointer-events: none;
}

.fx-banner[data-kind="rush"] {
  background: linear-gradient(180deg, #f5ffb0, var(--lindy-chartreuse));
  box-shadow: 0 0 60px rgba(198, 245, 66, 0.7);
}

.fx-banner.is-active {
  animation: fxBannerSlide 1100ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fxBannerSlide {
  0% { opacity: 0; transform: translate(-50%, -80%) scale(0.7); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  30% { transform: translate(-50%, -50%) scale(1); }
  82% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -20%) scale(0.94); }
}

/* ---------------- Rush mode: chartreuse light sweep across the course ---------------- */

body.is-rushing .course {
  animation: rushGlow 900ms ease-in-out infinite alternate;
}

@keyframes rushGlow {
  0% { filter: saturate(1.1) brightness(1); }
  100% { filter: saturate(1.35) brightness(1.08); }
}

.rush-sweep {
  position: absolute;
  inset: 0;
  z-index: 14;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(198, 245, 66, 0.55) 48%, rgba(255, 255, 255, 0.75) 50%, rgba(198, 245, 66, 0.55) 52%, transparent 70%);
  background-size: 260% 100%;
  background-position: 130% 0;
}

body.is-rushing .rush-sweep {
  opacity: 1;
  animation: rushSweepMove 1400ms linear infinite;
}

@keyframes rushSweepMove {
  0% { background-position: 130% 0; }
  100% { background-position: -30% 0; }
}

/* ---------------- Archetype palette tints (Morning / High Noon / Dusk / Storm) ---------------- */

.course[data-archetype="morning"] {
  filter: saturate(0.98) brightness(1.04) hue-rotate(-4deg);
}

.course[data-archetype="noon"] {
  filter: saturate(1.12) brightness(1.08) contrast(1.03);
}

.course[data-archetype="dusk"] {
  filter: saturate(0.86) brightness(0.82) sepia(0.16) hue-rotate(-8deg);
}

.course[data-archetype="dusk"] .course-vignette {
  background:
    linear-gradient(180deg, rgba(40, 12, 30, 0.32), transparent 30%, transparent 74%, rgba(20, 8, 30, 0.4)),
    radial-gradient(circle at 50% 45%, transparent 40%, rgba(30, 8, 26, 0.28));
}

.course[data-archetype="storm"] {
  filter: saturate(0.7) brightness(0.68) contrast(1.08);
}

.course[data-archetype="storm"] .course-vignette {
  background:
    linear-gradient(180deg, rgba(6, 14, 20, 0.5), transparent 28%, transparent 76%, rgba(6, 14, 20, 0.52)),
    radial-gradient(circle at 50% 45%, transparent 36%, rgba(4, 10, 16, 0.4));
}

.storm-drift {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  background: repeating-linear-gradient(115deg, transparent 0 40px, rgba(255, 255, 255, 0.05) 40px 42px);
}

.course[data-archetype="storm"] .storm-drift {
  opacity: 1;
  animation: stormDrift 4s linear infinite;
}

@keyframes stormDrift {
  0% { background-position: 0 0; }
  100% { background-position: -220px 90px; }
}

/* ---------------- The Foursome: diegetic timer walking the top edge ---------------- */

.foursome {
  --walk: 0%;
  position: absolute;
  top: 4%;
  left: 4%;
  z-index: 4;
  width: 12%;
  min-width: 46px;
  max-width: 92px;
  display: flex;
  gap: 3px;
  transform: translateX(var(--walk));
  transition: transform 260ms linear;
  pointer-events: none;
}

.foursome__golfer {
  flex: 1;
  aspect-ratio: 3 / 5;
  border-radius: 40% 40% 25% 25%;
  background:
    radial-gradient(circle at 50% 16%, #f4cda3 0 30%, transparent 31%),
    linear-gradient(180deg, transparent 0 30%, #dfe7e2 31% 62%, #274b3a 63% 100%);
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.28));
  animation: foursomeWalk 640ms ease-in-out infinite;
}

.foursome__golfer:nth-child(2) { animation-delay: 90ms; }
.foursome__golfer:nth-child(3) { animation-delay: 180ms; }
.foursome__golfer:nth-child(4) { animation-delay: 270ms; }

@keyframes foursomeWalk {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-6%) rotate(2deg); }
}

.foursome.is-pressure .foursome__golfer {
  animation-name: foursomePoint;
}

@keyframes foursomePoint {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(10deg); }
}

.foursome.is-arrived {
  animation: none;
}

.foursome.is-arrived .foursome__golfer {
  animation: none;
  transform: rotate(0deg);
}

/* ---------------- Hazards: sprinklers, gopher, sand ---------------- */

.sprinkler-head {
  position: absolute;
  left: var(--sx);
  top: var(--sy);
  z-index: 3;
  width: clamp(10px, 1.2vw, 16px);
  height: clamp(10px, 1.2vw, 16px);
  border-radius: 50%;
  background: radial-gradient(circle, #d9d9d0, #8a8a80);
  transform: translate(-50%, -50%);
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.sprinkler-head::after {
  content: "";
  position: absolute;
  inset: -180%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(150, 210, 255, 0.4), transparent 70%);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 140ms ease, transform 140ms ease;
}

.sprinkler-head.is-spraying::after {
  opacity: 1;
  transform: scale(1);
  animation: sprinklerPulse 260ms ease-in-out infinite alternate;
}

@keyframes sprinklerPulse {
  0% { transform: scale(0.92); }
  100% { transform: scale(1.05); }
}

.gopher {
  position: absolute;
  left: var(--gx2);
  top: var(--gy2);
  z-index: 7;
  width: clamp(30px, 3.4vw, 48px);
  height: clamp(24px, 2.8vw, 38px);
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  transition: left 240ms linear, top 240ms linear;
}

.gopher.is-visible {
  transform: translate(-50%, -50%) scale(1);
  animation: gopherBob 380ms ease-in-out infinite;
}

.gopher__body {
  position: absolute;
  inset: 10% 0 0;
  border-radius: 50% 50% 42% 42%;
  background: linear-gradient(180deg, #c9974f, #8a6431);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}

.gopher__body::before,
.gopher__body::after {
  content: "";
  position: absolute;
  top: 16%;
  width: 16%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #2a1a0c;
}

.gopher__body::before { left: 22%; }
.gopher__body::after { right: 22%; }

@keyframes gopherBob {
  0%, 100% { transform: translate(-50%, -50%) scale(1) rotate(-2deg); }
  50% { transform: translate(-50%, -58%) scale(1.03) rotate(2deg); }
}

.sand-cloud {
  position: absolute;
  left: var(--sandx);
  top: var(--sandy);
  z-index: 6;
  width: clamp(120px, 14vw, 200px);
  height: clamp(90px, 10vw, 150px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 202, 150, 0.42), transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: blur(2px);
}

/* ---------------- Home screen ---------------- */

.home-screen {
  display: grid;
  gap: clamp(14px, 2vw, 22px);
  padding: clamp(16px, 2.4vw, 28px);
  color: #F5F5F0;
  background: linear-gradient(180deg, rgba(9, 49, 34, 0.96), rgba(4, 32, 44, 0.98));
  border: 2px solid rgba(198, 245, 66, 0.35);
  border-radius: 8px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.4);
}

.home-screen h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.home-doors {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.daily-chip {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(198, 245, 66, 0.16), rgba(198, 245, 66, 0.04));
  border: 2px solid var(--lindy-chartreuse);
  border-radius: 8px;
  cursor: pointer;
}

.daily-chip__title {
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  font-weight: 950;
  color: var(--lindy-chartreuse);
  text-transform: uppercase;
}

.daily-chip__sub {
  font-size: 0.85rem;
  color: rgba(245, 245, 240, 0.72);
  font-weight: 700;
}

.daily-chip__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 6px;
  font-size: 0.78rem;
  color: rgba(245, 245, 240, 0.65);
}

.daily-chip__stats b {
  color: #F5F5F0;
}

.course-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-height: 340px;
  overflow-y: auto;
}

.course-flag {
  position: relative;
  width: 62px;
  height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #F5F5F0;
  background: linear-gradient(180deg, #123a2c, #0a2318);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease;
}

.course-flag[data-archetype="dusk"] { background: linear-gradient(180deg, #3a2036, #1c0f1e); }
.course-flag[data-archetype="storm"] { background: linear-gradient(180deg, #131c22, #070c10); }
.course-flag[data-archetype="noon"] { background: linear-gradient(180deg, #1c4a2f, #0d2a1b); }

.course-flag:not(:disabled):hover,
.course-flag:not(:disabled):focus-visible {
  transform: translateY(-3px);
  border-color: var(--lindy-chartreuse);
}

.course-flag:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.course-flag__number {
  font-size: 0.92rem;
  font-weight: 950;
}

.course-flag__pips {
  display: flex;
  gap: 2px;
}

.course-flag__pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
}

.course-flag__pip.is-lit {
  background: var(--lindy-chartreuse);
  box-shadow: 0 0 6px rgba(198, 245, 66, 0.7);
}

.course-flag__lock {
  position: absolute;
  bottom: 3px;
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: rgba(245, 245, 240, 0.5);
}

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

/* ---------------- Pro shop ---------------- */

.proshop {
  display: grid;
  gap: 16px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.proshop-section h3 {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245, 245, 240, 0.7);
}

.proshop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.proshop-card {
  display: grid;
  gap: 5px;
  justify-items: center;
  padding: 12px 8px;
  color: #F5F5F0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease;
}

.proshop-card:hover {
  transform: translateY(-2px);
}

.proshop-card.is-selected {
  border-color: var(--lindy-chartreuse);
  box-shadow: 0 0 0 1px var(--lindy-chartreuse);
}

.proshop-card.is-locked {
  opacity: 0.82;
}

.proshop-card.is-unspendable {
  cursor: default;
  opacity: 0.55;
}

.proshop-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 32%, #8fe14a, #3f8a1e);
}

.proshop-swatch--plug-clover { background: radial-gradient(circle at 40% 32%, #b8f55a, #2f7a1c); }
.proshop-swatch--plug-gold { background: radial-gradient(circle at 40% 32%, #ffe874, #c97b00); }
.proshop-swatch--plug-flower { background: radial-gradient(circle at 40% 32%, #ffb3d9, #d94f9c); }
.proshop-swatch--trail-dew { background: radial-gradient(circle at 40% 32%, #d3f4ff, #4bb6e0); }
.proshop-swatch--trail-sparks { background: radial-gradient(circle at 40% 32%, #fff3a0, #ffb020); }
.proshop-swatch--celebration-fireworks { background: conic-gradient(from 0deg, #ff6b6b, #ffd166, #6bffb8, #6ba8ff, #ff6b6b); }
.proshop-swatch--celebration-flock { background: radial-gradient(circle at 40% 32%, #f5f5f0, #9aa5a0); }

.proshop-name {
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.proshop-price {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--lindy-chartreuse);
  text-align: center;
}

.proshop-card.is-unspendable .proshop-price {
  color: rgba(245, 245, 240, 0.5);
}

/* ---------------- Reduced motion ---------------- */

@media (prefers-reduced-motion: reduce) {
  .fx-banner.is-active,
  .fx-vignette--damage,
  .fx-vignette--rush,
  body.is-rushing .course,
  body.is-rushing .rush-sweep,
  .foursome__golfer,
  .sprinkler-head.is-spraying::after,
  .gopher.is-visible,
  .storm-drift {
    animation-duration: 0.001ms !important;
  }
}

@media (max-width: 900px) {
  .course-strip {
    max-height: 220px;
  }

  .course-flag {
    width: 54px;
    height: 54px;
  }
}
