/* Display-only IceFishin adapter. The stage keeps world controls interactive. */
#winter-fishing-minigame {
  position: absolute;
  z-index: 5;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  color: #e9f8ff;
  font-family: "Rajdhani", "Arial Narrow", sans-serif;
}

.winter-fishing-hud,
.winter-fishing-hud * { box-sizing: border-box; }
.winter-fishing-hud[hidden],
.winter-fishing-hud [hidden] { display: none !important; }

.winter-fishing-hud {
  --fish-cyan: #3fd8ff;
  --fish-violet: #a36bff;
  --fish-pink: #ff4fc8;
  --fish-gold: #ffd36e;
  --fish-ice: #d9f6ff;
  position: absolute;
  left: 50%;
  bottom: clamp(88px, 12vh, 124px);
  width: min(520px, calc(100% - 28px));
  transform: translateX(-50%);
  filter: drop-shadow(0 10px 22px rgb(0 0 0 / 48%));
  animation: fish-hud-enter 260ms ease-out both;
}

.fishing-hud-frame {
  position: relative;
  overflow: hidden;
  padding: 10px 13px 12px;
  border: 1px solid rgb(63 216 255 / 46%);
  border-radius: 13px 3px 13px 3px;
  background:
    radial-gradient(ellipse at 7% 0%, rgb(63 216 255 / 13%), transparent 42%),
    radial-gradient(ellipse at 100% 100%, rgb(163 107 255 / 14%), transparent 44%),
    linear-gradient(112deg, rgb(4 13 28 / 84%), rgb(8 14 34 / 75%) 56%, rgb(17 10 37 / 82%));
  box-shadow: inset 0 0 22px rgb(63 216 255 / 5%), 0 0 18px rgb(63 216 255 / 9%);
  backdrop-filter: blur(5px);
}

.fishing-hud-frame::before,
.fishing-hud-frame::after {
  position: absolute;
  z-index: 0;
  width: 42px;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, var(--fish-cyan), transparent);
  opacity: .82;
}
.fishing-hud-frame::before { top: 0; left: 14px; }
.fishing-hud-frame::after { right: 14px; bottom: 0; transform: rotate(180deg); }
.fishing-hud-frame > * { position: relative; z-index: 1; }

.fishing-hud-head,
.fishing-status-line,
.fight-heading,
.fight-metrics { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fishing-hud-head { margin-bottom: 4px; color: rgb(207 233 255 / 70%); font-size: 10px; font-weight: 800; letter-spacing: .17em; }
.fishing-hud-brand,
.fishing-hud-live,
.live-meter { display: inline-flex; align-items: center; gap: 6px; }
.fishing-hud-brand i { width: 7px; height: 7px; border: 1px solid var(--fish-cyan); transform: rotate(45deg); box-shadow: 0 0 8px var(--fish-cyan); }
.fishing-hud-live { color: var(--fish-cyan); font-size: 9px; }
.fishing-hud-live i,
.live-meter i { width: 6px; height: 6px; border-radius: 50%; background: var(--fish-cyan); box-shadow: 0 0 8px var(--fish-cyan); animation: fish-live 1.5s ease-in-out infinite; }

.sonar-layout { display: grid; grid-template-columns: 166px minmax(0, 1fr); align-items: center; gap: 14px; }
.flasher-wrap { position: relative; width: min(166px, 100%); margin: -2px auto -4px; }
.ice-flasher { display: block; width: 100%; overflow: visible; filter: drop-shadow(0 0 8px rgb(63 216 255 / 10%)); }
.flasher-track { fill: rgb(3 15 29 / 70%); stroke: rgb(63 216 255 / 22%); stroke-width: 1; }
.flasher-ring { fill: none; stroke: rgb(63 216 255 / 19%); stroke-width: .7; }
.flasher-tick { stroke: rgb(173 211 236 / 38%); stroke-width: 1.2; }
.flasher-tick.major { stroke: rgb(63 216 255 / 75%); stroke-width: 1.8; }
.flasher-return { fill: none; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 100px 100px; }
.return-ice { stroke: rgb(217 246 255 / 78%); stroke-width: 3; }
.return-bottom { stroke: rgb(130 157 177 / 55%); stroke-width: 4; }
.return-zone { stroke: var(--fish-gold); stroke-width: 5; filter: drop-shadow(0 0 5px rgb(255 211 110 / 66%)); }
.return-fish { stroke: var(--fish-cyan); stroke-width: 4; filter: drop-shadow(0 0 5px currentColor); }
.return-lure { stroke: var(--fish-ice); stroke-width: 2.5; }
.flasher-marker { fill: #071525; stroke-width: 2; }
.marker-fish { stroke: var(--fish-cyan); filter: drop-shadow(0 0 5px currentColor); }
.marker-lure { fill: var(--fish-ice); stroke: #071525; }
.flasher-center-label,.flasher-bottom-label { fill: rgb(189 220 240 / 62%); font: 700 6px "Rajdhani", sans-serif; letter-spacing: 1px; text-anchor: middle; }
.flasher-depth { fill: #f0fbff; font: 800 13px "Rajdhani", sans-serif; text-anchor: middle; filter: drop-shadow(0 0 4px rgb(63 216 255 / 75%)); }
.flasher-key { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: -9px; color: rgb(205 226 240 / 76%); font-size: 9px; letter-spacing: .04em; white-space: nowrap; }
.flasher-key i { display: inline-block; width: 6px; height: 6px; border: 1px solid currentColor; border-radius: 50%; }
.flasher-key .key-fish { color: var(--fish-cyan); box-shadow: 0 0 5px currentColor; }
.flasher-key .key-lure { color: var(--fish-ice); background: currentColor; }
.flasher-key .key-zone { width: 11px; height: 3px; border: 0; border-radius: 2px; color: var(--fish-gold); background: currentColor; }

.sonar-readout { min-width: 0; }
.fishing-status-line { align-items: baseline; border-bottom: 1px solid rgb(163 107 255 / 22%); padding-bottom: 4px; }
.fishing-phase { color: var(--fish-cyan); font-size: 10px; font-weight: 900; letter-spacing: .15em; }
.fish-name { overflow: hidden; color: #fff; font-size: 16px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.interest-readout { display: grid; grid-template-columns: auto minmax(36px, 1fr) 29px; align-items: center; gap: 7px; margin: 7px 0 3px; color: rgb(198 221 237 / 76%); font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.interest-readout strong { color: var(--fish-cyan); font-size: 11px; text-align: right; }
.interest-rail,.landing-rail { overflow: hidden; height: 4px; border: 1px solid rgb(63 216 255 / 38%); border-radius: 5px; background: rgb(2 12 25 / 85%); }
.interest-rail i,.landing-rail i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--fish-cyan), var(--fish-violet), var(--fish-pink)); box-shadow: 0 0 7px rgb(63 216 255 / 74%); transition: width 140ms linear; }
.fishing-cue { margin: 7px 0 2px; color: #f6fbff; font-size: 13px; font-weight: 800; line-height: 1.22; }
.fishing-prompt { margin: 2px 0 6px; color: rgb(200 223 240 / 76%); font-size: 10px; line-height: 1.25; }
.fishing-action-tip { display: flex; align-items: center; gap: 7px; min-height: 22px; color: rgb(196 218 236 / 78%); font-size: 9px; letter-spacing: .02em; }
.fishing-action-tip b { padding: 3px 7px; border: 1px solid rgb(163 107 255 / 65%); border-radius: 4px 1px; color: #fff; background: rgb(91 44 153 / 31%); font-size: 9px; letter-spacing: .13em; box-shadow: inset 0 0 9px rgb(163 107 255 / 13%); }
.flasher-wrap[data-bite="nibble"] .return-zone { animation: fish-zone-pulse 1.1s ease-in-out infinite; }
.flasher-wrap[data-bite="bite"] .marker-fish { stroke: var(--fish-pink); fill: var(--fish-pink); animation: fish-bite 340ms steps(2, end) infinite; }
.flasher-wrap[data-bite="bite"] .return-zone { stroke: var(--fish-pink); }

.fight-layout { display: grid; gap: 5px; }
.fight-heading { align-items: baseline; }
.fight-heading .fish-name { font-size: 17px; }
.fight-gauge { position: relative; height: 22px; overflow: hidden; border: 1px solid rgb(63 216 255 / 35%); border-radius: 2px 7px; background: linear-gradient(90deg, rgb(63 216 255 / 17%), rgb(163 107 255 / 12%) 50%, rgb(255 79 200 / 16%)), repeating-linear-gradient(90deg, transparent 0 9.5%, rgb(221 241 255 / 12%) 10%); box-shadow: inset 0 0 13px rgb(0 0 0 / 65%); }
.gauge-zone { position: absolute; top: 3px; bottom: 3px; border: 1px solid rgb(255 211 110 / 86%); background: rgb(255 211 110 / 17%); box-shadow: 0 0 10px rgb(255 211 110 / 38%), inset 0 0 7px rgb(255 211 110 / 20%); }
.gauge-needle { position: absolute; z-index: 2; top: 0; bottom: 0; width: 2px; background: #f6fdff; box-shadow: 0 0 7px #fff, 0 0 12px var(--fish-cyan); transition: left 90ms linear; }
.gauge-glow { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at var(--needle-position, 50%) 50%, rgb(63 216 255 / 17%), transparent 17%); }
.fight-gauge[data-tension-state="danger"] .gauge-needle,.fight-gauge[data-tension-state="tight"] .gauge-needle { background: var(--fish-pink); box-shadow: 0 0 8px var(--fish-pink); }
.fight-gauge[data-tension-state="good"] .gauge-needle { background: var(--fish-cyan); box-shadow: 0 0 9px var(--fish-cyan); }
.gauge-labels { display: flex; justify-content: space-between; color: rgb(189 215 235 / 64%); font-size: 8px; font-weight: 800; letter-spacing: .1em; }
.fight-metrics { color: rgb(204 225 240 / 78%); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.fight-metrics b { color: #fff; font-size: 12px; }
.live-meter i { animation-duration: 1s; }
.landing-rail { height: 6px; border-color: rgb(163 107 255 / 56%); }
.landing-rail i { background: linear-gradient(90deg, var(--fish-violet), var(--fish-cyan)); }
.fight-cue { margin: 2px 0 0; }
.fight-layout[data-tension-state="danger"] .fight-cue { color: #ffb4e5; text-shadow: 0 0 8px rgb(255 79 200 / 48%); }
.wildlife-note { margin: 0; color: var(--fish-gold); font-size: 9px; font-weight: 800; letter-spacing: .08em; }

@keyframes fish-live { 50% { opacity: .4; box-shadow: 0 0 2px var(--fish-cyan); } }
@keyframes fish-zone-pulse { 50% { opacity: .53; filter: drop-shadow(0 0 2px var(--fish-gold)); } }
@keyframes fish-bite { to { opacity: .35; } }
/* `translate`, not `transform`: the filled end state keeps each layout's own transform (centred translateX(-50%),
   or none in short landscape). */
@keyframes fish-hud-enter { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: none; } }

@media (max-width: 520px) {
  /* Keep the full sonar/fight display above the walk, sprint and turn controls. */
  .winter-fishing-hud { bottom: max(220px, calc(env(safe-area-inset-bottom) + 212px)); width: calc(100% - 16px); }
  .fishing-hud-frame { padding: 7px 9px 8px; border-radius: 10px 2px; }
  .sonar-layout { grid-template-columns: minmax(106px, 36%) minmax(0, 1fr); gap: 8px; }
  .flasher-wrap { width: 100%; }
  .flasher-key { gap: 3px; font-size: 8px; }
  .fishing-cue { font-size: 12px; }
  .fishing-prompt { margin-bottom: 4px; font-size: 9px; }
  .fishing-action-tip { font-size: 8px; }
  .fishing-action-tip b { padding: 3px 5px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  /* Reserve the left steering pad and right music dock; use the center lane, centred on x = 360 px (the
     placement the 844x390 gates verified). Sit above the nearby-action row (FISH / JIG / STOW, 44 px targets
     on the bottom safe edge) so the row never covers the instruments. */
  .winter-fishing-hud { left: calc(360px - min(130px, (100% - 500px) / 2)); bottom: calc(var(--i8-safe-b, 10px) + var(--i8-touch, 44px) + 8px); width: min(260px, calc(100% - 500px)); transform: none; }
  .sonar-layout { grid-template-columns: minmax(94px, 38%) minmax(0, 1fr); gap: 8px; }
  .flasher-key { margin-top: -6px; gap: 3px; font-size: 7px; }
  .fishing-hud-frame { padding: 5px 8px 6px; }
  .fishing-hud-head { margin-bottom: 1px; font-size: 8px; }
  .fishing-status-line .fish-name,.fight-heading .fish-name { font-size: 13px; }
  .interest-readout { margin: 4px 0 1px; }
  .fishing-cue { margin-top: 4px; font-size: 11px; }
  .fishing-prompt { margin-bottom: 3px; font-size: 9px; }
  .fight-layout { gap: 3px; }
  .fight-gauge { height: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .winter-fishing-hud,.winter-fishing-hud *,
  .winter-fishing-hud *::before,.winter-fishing-hud *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
