/* ═══════════════════════════════════════
   HOCKEY: SLAP SHOT — css/hockey.css v1
   Adapted from css/soccer.css (goal/keeper/jumbotron) + the stick-swing
   keyframe from css/baseball.css's #bsbBat/bsbBatSwing.
   ═══════════════════════════════════════ */

#hockeyScreen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  background: url('../Images/GameAssets/Hockey/background.webp') center/cover no-repeat,
    linear-gradient(180deg, #cfeeff 0%, #cfeeff 40%, #eaf7ff 40%, #eaf7ff 100%);
}

/* ── Settings cog (identical structure to soccer's) ── */
#hkySettingsBtn {
  position: absolute; top: 14px; right: 14px; z-index: 40;
  width: 46px; height: 46px; border-radius: 50%;
  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;
}
#hkySettingsBtn:active { transform: scale(.9); }
#hkySettingsBtn.open   { transform: rotate(-18deg); }

#hkySettingsPanel {
  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;
}
#hkySettingsPanel.open {
  display: block; pointer-events: auto;
  animation: hky-panel-in 0.28s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes hky-panel-in {
  from { opacity: 0; transform: scale(0.88) translateY(-10px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.hky-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);
}
.hky-setting-row:last-child { border-bottom: none; padding-bottom: 0; }
.hky-setting-row:first-child { padding-top: 0; }
.hky-setting-divider {
  font-size: 0.6rem; letter-spacing: 1.5px; color: rgba(66, 165, 245, 0.8);
  font-weight: 900; text-transform: uppercase; padding: 6px 0 2px;
}
.hky-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;
}
.hky-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);
}
.hky-toggle.on { background: #2196f3; }
.hky-toggle.on::after { transform: translateX(24px); }

/* ── Jumbotron (same construction as soccer's) ── */
#hkyJumbotron {
  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;
}
#hkyJumbotron::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;
}
.hky-jmb-brand {
  font-size: .58rem; letter-spacing: 1.5px; color: #42a5f5; font-weight: 900;
  text-shadow: 0 0 8px rgba(66,165,245,.55); margin-bottom: 2px; opacity: .9;
}
.hky-jmb-stats { display: flex; align-items: center; justify-content: center; gap: 4px; }
.hky-jmb-stat  { display: flex; flex-direction: column; align-items: center; padding: 0 10px; }
.hky-jmb-divider { width: 1.5px; height: 36px; background: rgba(255,255,255,.12); border-radius: 1px; }
.hky-jmb-lbl {
  font-size: .44rem; letter-spacing: 2px; color: #42a5f5; font-weight: 900;
  opacity: .5; text-transform: uppercase; margin-bottom: 1px;
}

/* ── Goal + net + goalie (identical structure to soccer's) ── */
#hockeyGoal {
  position: absolute; top: 22%; left: 50%; transform: translateX(-50%);
  width: min(74%, 340px); z-index: 12;
}
#hockeyGoalImg { width: 100%; height: auto; display: block; position: relative; z-index: 13; pointer-events: none; user-select: none; }
#hockeyNet {
  position: absolute; top: 12%; left: 14%; right: 14%; bottom: 20%;
  border-radius: 3px; transition: background-color .15s; z-index: 14; pointer-events: none;
}
/* 2026-09-29 (Jason: "get rid of that square that appears when I get a
   goal"): was a flat rgba fill on #hockeyNet's own plain rectangle box —
   with only a 3px border-radius, a goal literally flashed a pale blue
   square over the net. Swapped for a radial glow that fades to
   transparent well inside the box edges, so nothing rectangular is ever
   visible — same "net lights up" read, no visible box. */
#hockeyNet.hky-net-flash {
  background: radial-gradient(circle at 50% 45%, rgba(140,210,255,.85) 0%, rgba(120,200,255,.4) 45%, rgba(120,200,255,0) 72%);
}

#hockeyGoalie {
  position: absolute; bottom: -4px; width: 92px; height: 92px; z-index: 15;
  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;
}
#hockeyGoalie.hky-kp-right { transform: scaleX(-1); }
#hockeyGoalie.hky-kp-left  { transform: scaleX(1); }

/* ── Puck ── */
#hkyPuck {
  position: absolute; top: 0; left: 0; width: 56px; height: 56px; z-index: 20;
  background: url('../Images/GameAssets/Hockey/puck.webp') center/contain no-repeat;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.4));
}
#hkyPuck.hky-idle { animation: hky-puck-bob 1.6s ease-in-out infinite; }
@keyframes hky-puck-bob { 0%, 100% { margin-top: 0; } 50% { margin-top: -6px; } }

/* ── Stick — Jason, 2026-09-26: "the swing anchored to the bottom middle
   of the screen, so the stick swings up... consider how a hockey stick
   hits a puck, we'd need the stick to have an arch that follows a U curve
   almost. So the stick would be persistent on the screen." It lives at
   one fixed pivot (a player's hands) at all times, and a shot rotates it
   from a raised windup, down through the puck near rotate:0 (where the
   blade is lowest AND moving nearly horizontally — a real slap shot's
   blade stays near the ice and sweeps sideways through contact), to a
   forward follow-through — the U curve is the blade tip's swept arc
   around that one fixed pivot.
   2026-09-29 (Jason: "Hockey just needs a better stick and for the motion
   angle of the stick to make sense"): the crude flat-colored placeholder
   stick.svg is gone. Images/GameAssets/Hockey/stick_right.webp was a real
   soft-3D generated asset (generate_hockey_art.py) that got made during
   the sports build-out but was never actually wired in — its diagonal
   "ready to swing" orientation doesn't match this element's own pivot
   convention (grip near the top, blade hanging straight down, like a kid
   actually holding it), so stick.webp is a derived asset: stick_right.webp
   rotated 135° and re-cropped tight to content (see DevAssets/PY history —
   redo via `Image.open(stick_right.webp).rotate(135, expand=True)` then
   `.crop(.getbbox())` if regenerating). transform-origin (59.2% 6.2%) is
   that derived image's actual grip-cap centroid, found by pixel analysis
   (dark navy blob) rather than eyeballed — same discipline as the
   redrawn-shaft grip point this replaced. */
#hkyStick {
  position:absolute;left:calc(50% - 62px);top:calc(80% - 280px);
  width:105px;height:280px;
  background: url('../Images/GameAssets/Hockey/stick.webp') center/contain no-repeat;
  transform-origin:59.2% 6.2%;transform:rotate(0deg);
  z-index: 22; pointer-events: none;
}
@keyframes hkyStickSwing {
  0%   { transform: rotate(0deg); }
  15%  { transform: rotate(-18deg); }
  55%  { transform: rotate(12deg); }
  100% { transform: rotate(0deg); }
}

/* ── Streak bar (reuses soccer's .scr-streak-dot styling wholesale) ── */
#hkyStreakBar {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  z-index: 20; display: flex; gap: 10px; font-size: 1.8rem; pointer-events: none;
}

/* ── Power meter — horizontal, own ice-blue palette (Baseball's is a
   vertical green→red bar on the left; this is deliberately a different
   shape/color/position so Hockey doesn't read as a reskin despite sharing
   the same "value at the instant of tap" honesty). */
#hkyPowerWrap {
  position: absolute; bottom: 72px; left: 50%; transform: translateX(-50%);
  z-index: 20; width: min(72%, 220px); height: 22px;
  background: rgba(0,0,0,.5); border-radius: 11px; overflow: hidden;
  border: 2px solid rgba(255,255,255,.3);
}
#hkyPowerFill {
  position: absolute; top: 0; bottom: 0; left: 0; width: 0%;
  border-radius: 9px; background: hsl(200,90%,55%);
  transition: width .02s linear;
}
#hkyPowerLabel {
  position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
  font-size: .55rem; font-weight: 900; color: rgba(255,255,255,.85);
  letter-spacing: 1px; white-space: nowrap; text-shadow: 0 1px 3px rgba(0,0,0,.5);
}

/* ── Hint text ── */
#hkyHint {
  position: absolute; top: 66px; left: 50%; transform: translateX(-50%);
  z-index: 20; background: rgba(255,255,255,.92); border-radius: 40px;
  padding: 8px 18px; font-family: 'Baloo 2', cursive; font-weight: 800;
  font-size: .95rem; color: #1565c0; white-space: nowrap; pointer-events: none;
  transition: opacity .3s;
}
