/* ═══════════════════════════════════════
   PENALTY KICK — Soccer game
   ═══════════════════════════════════════ */

#soccerScreen {
  display: none;          /* hidden until showScreen() activates it */
  position: fixed;
  inset: 0;
  z-index: 10;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  /* DALL-E generated field — fallback to CSS grass gradient */
  background: url('../Images/GameAssets/Soccer/background.webp') center/cover no-repeat,
    linear-gradient(180deg,
      #87ceeb 0%,
      #87ceeb 32%,
      #5dbf4e 32%,
      #4aad3e 42%,
      #3d9933 42%,
      #52b347 55%,
      #3d9933 55%,
      #4aad3e 68%,
      #52b347 68%,
      #3d9933 80%,
      #4aad3e 80%,
      #52b347 100%
    );
}

/* Stadium crowd — sits in the sky band above the pitch (the field art's own
   sky/grass horizon is ~42% down), so the empty sky now reads as a real
   stadium instead of an open field. Behind everything else (z-index:0, no
   pointer-events) — decorative only, must recede per the scene style guide. */
#scrStadium{
  position:absolute;top:0;left:0;right:0;width:100%;height:44%;
  object-fit:cover;object-position:center bottom;
  z-index:0;pointer-events:none;
}

/* ── Settings cog ── */
#scrSettingsBtn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 40;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  /* Plate removed to match the other cogs — the icon carries its own form and
     its drop-shadow keeps it legible against the pitch. */
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s cubic-bezier(.34,1.56,.64,1), background 0.2s;
  touch-action: manipulation;
  user-select: none;
}
#scrSettingsBtn:active { transform: scale(.9); }
#scrSettingsBtn.open   { transform: rotate(55deg); }

#scrSettingsPanel {
  position: absolute;
  top: 70px;
  right: 14px;
  z-index: 39;
  background: rgba(8, 8, 12, 0.93);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 14px 18px 16px;
  min-width: 210px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  display: none;
  pointer-events: none;
}
#scrSettingsPanel.open {
  display: block;
  pointer-events: auto;
  animation: scr-panel-in 0.28s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes scr-panel-in {
  from { opacity: 0; transform: scale(0.88) translateY(-10px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.scr-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  font-family: 'Baloo 2', cursive;
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
}
.scr-setting-row:last-child { border-bottom: none; padding-bottom: 0; }
.scr-setting-row:first-child { padding-top: 0; }

.scr-setting-divider {
  font-size: 0.6rem;
  letter-spacing: 1.5px;
  color: rgba(34, 180, 80, 0.7);
  font-weight: 900;
  text-transform: uppercase;
  padding: 6px 0 2px;
}

.scr-toggle {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  background: #333;
  transition: background 0.25s;
  flex-shrink: 0;
  touch-action: manipulation;
}
.scr-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1);
}
.scr-toggle.on { background: #22b450; }
.scr-toggle.on::after { transform: translateX(24px); }

/* ── Jumbotron ── */
#scrJumbotron {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  pointer-events: none;
  user-select: none;

  background: #0a0a0e;
  border: 3px solid #2a2a2a;
  border-radius: 14px;
  box-shadow:
    0 0 0 2px #3a3a3a,
    0 0 0 5px #111,
    0 8px 28px rgba(0,0,0,.85),
    inset 0 1px 0 rgba(255,255,255,.06);
  padding: 6px 18px 8px;
  text-align: center;
  white-space: nowrap;
}

#scrJumbotron::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 11px;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,.10) 3px,
    rgba(0,0,0,.10) 4px
  );
  pointer-events: none;
}

.scr-jmb-brand {
  font-size: .58rem;
  letter-spacing: 1.5px;
  color: #22dd66;
  font-weight: 900;
  text-shadow: 0 0 8px rgba(34,220,100,.55);
  margin-bottom: 2px;
  opacity: .9;
}

.scr-jmb-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.scr-jmb-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 10px;
}

.scr-jmb-divider {
  width: 1.5px;
  height: 36px;
  background: rgba(255,255,255,.12);
  border-radius: 1px;
}

.scr-jmb-lbl {
  font-size: .44rem;
  letter-spacing: 2px;
  color: #22dd66;
  font-weight: 900;
  opacity: .5;
  text-transform: uppercase;
  margin-bottom: 1px;
}

/* Stats render as .jmb-pips rows (layout.css) instead of digits —
   DEVELOPMENT_RULES §2 bans numeric scores a toddler can't read. */

@keyframes scr-num-pop {
  0%   { transform: scale(0.6); opacity: .5; }
  55%  { transform: scale(1.6); opacity: 1;  }
  100% { transform: scale(1);   opacity: 1;  }
}

/* ── Goal structure ── */
#soccerGoal {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  width: min(74%, 340px);
  z-index: 12;
}

/* Generated goal image */
#soccerGoalImg {
  width: 100%;
  height: auto;
  display: block;
  position: relative;
  z-index: 13;
  pointer-events: none;
  user-select: none;
}

/* Net flash overlay — covers only the inner net area (between posts) */
#soccerNet {
  position: absolute;
  top: 12%;
  left: 14%;
  right: 14%;
  bottom: 20%;
  border-radius: 3px;
  transition: background-color .15s;
  z-index: 14;
  pointer-events: none;
}

#soccerNet.scr-net-flash {
  background-color: rgba(255,255,100,.45);
}

/* ── Goalkeeper ── */
#soccerKeeper {
  position: absolute;
  bottom: -4px;
  width: 88px;
  height: 88px;
  z-index: 15;
  font-size: 3.0rem;
  line-height: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: none;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.4));
  user-select: none;
  pointer-events: none;
  overflow: visible;
}

#soccerKeeper.scr-kp-right {
  transform: scaleX(-1);
}
#soccerKeeper.scr-kp-left {
  transform: scaleX(1);
}

/* ── Ball ── */
#scrBall {
  position: absolute;
  top: 0;
  left: 0;
  width: 64px;
  height: 64px;
  z-index: 20;
  font-size: 3.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.4));
}

#scrBall.scr-idle {
  animation: scr-ball-bob 1.6s ease-in-out infinite;
}

@keyframes scr-ball-bob {
  0%, 100% { margin-top: 0; }
  50%       { margin-top: -8px; }
}

/* ── Streak bar ── */
#scrStreakBar {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  gap: 10px;
  font-size: 1.8rem;
  pointer-events: none;
}

.scr-streak-dot {
  transition: transform .15s;
}
.scr-streak-active {
  animation: scr-streak-pop .3s ease-out;
}

@keyframes scr-streak-pop {
  0%   { transform: scale(0.5); }
  60%  { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* ── Streak message overlay ── */
#scrStreakMsg {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  font-size: 2.2rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 3px 14px rgba(0,0,0,.7);
  pointer-events: none;
  display: none;
  white-space: nowrap;
}

@keyframes scr-msg-pop {
  0%   { transform: translate(-50%,-50%) scale(0.5); opacity: 0; }
  35%  { transform: translate(-50%,-50%) scale(1.25); opacity: 1; }
  65%  { transform: translate(-50%,-50%) scale(1);    opacity: 1; }
  100% { transform: translate(-50%,-50%) scale(0.9);  opacity: 0; }
}

/* ── Ground line (penalty spot) ── */
#soccerPenaltySpot {
  position: absolute;
  bottom: 22%;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: rgba(255,255,255,.55);
  border-radius: 50%;
  z-index: 10;
  pointer-events: none;
}

/* ── Grass stripe overlay (depth lines) ── */
#soccerScreen::after {
  content: '';
  position: absolute;
  inset: 32% 0 0 0;
  background-image: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 32px,
    rgba(0,0,0,.06) 32px,
    rgba(0,0,0,.06) 64px
  );
  pointer-events: none;
  z-index: 1;
}

/* ── Confetti ── */
.scr-confetti {
  position: absolute;
  top: -18px;
  z-index: 35;
  pointer-events: none;
  border-radius: 2px;
  animation: scr-confetti-fall linear forwards;
}

@keyframes scr-confetti-fall {
  0%   { transform: translateY(0)     translateX(0)             rotate(0deg);   opacity: 1; }
  75%  { opacity: 1; }
  100% { transform: translateY(108vh) translateX(var(--cdrift)) rotate(var(--cspin)); opacity: 0; }
}








