/* ==========================================================================
   Bryggefiskeren på egen side: utstyr, fiskemerker, levering på brygga og fiskeboka.
   Selve spillet styles fortsatt fra hovedstilarket (.fishing-game*).
   ========================================================================== */

.fishing-page .fishing-hero .page-hero__content { padding-bottom: 52px; }
.fishing-page .fishing-page__game .fishing-game { margin: 0; }

/* Fiskemerker i poengfeltet */
.fishing-game__badges {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 10px;
  color: var(--fjord-deep);
  background: #fbeed3;
  border: 2px solid var(--sun);
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 800;
}

/* Utstyrsraden */
.fishing-gear {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.fishing-gear__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  padding: 8px 10px;
  color: var(--fjord-deep);
  background: rgba(255, 253, 247, .85);
  border: 2px solid rgba(17, 106, 141, .16);
  border-radius: 14px;
}
.fishing-gear__item b { grid-row: 1 / span 2; font-size: 1.5rem; line-height: 1; }
.fishing-gear__item strong { font-family: var(--font-title); font-size: .92rem; line-height: 1.15; }
.fishing-gear__item small { font-size: .74rem; opacity: .8; }
.fishing-gear__item.is-unlocked { background: #e7f5ec; border-color: #2f7d53; }
.fishing-gear__item.is-unlocked small { color: #2f7d53; font-weight: 800; opacity: 1; }
.fishing-gear__item.is-locked b { filter: grayscale(1); opacity: .55; }
.fishing-gear__item.is-soon { border-style: dashed; opacity: .7; }
@media (max-width: 700px) {
  .fishing-gear { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fishing-gear__item { padding: 6px 8px; }
}

/* Levering på brygga i sluttkortet */
.fishing-delivery {
  display: grid;
  gap: 6px;
  margin: 4px 0 12px;
  padding: 12px 14px;
  background: rgba(255, 253, 247, .9);
  border: 2px solid rgba(232, 166, 58, .6);
  border-radius: 16px;
}
.fishing-delivery[hidden] { display: none; }
.fishing-delivery p { margin: 0; }
.fishing-delivery__unlock { color: #2f7d53; font-weight: 700; }
.fishing-delivery__unlock b { font-size: 1.3rem; }
.fishing-delivery__next { font-size: .92rem; opacity: .85; }

/* Fiskeboka på siden */
.fishing-book__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.fishing-book__slot {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 12px 8px 14px;
  background: #fff;
  border: 2px dashed rgba(17, 106, 141, .3);
  border-radius: 18px;
  text-align: center;
}
.fishing-book__slot.is-caught { background: #f3fbff; border-style: solid; border-color: var(--fjord, #116a8d); }
.fishing-book__slot.is-locked { opacity: .7; }
.fishing-book__slot.is-rare.is-caught { background: #fff8e6; border-color: var(--sun); }
.fishing-book__slot .fish-art { display: block; width: 92px; height: 58px; }
.fishing-book__slot .fish-art img,
.fishing-book__slot .fish-art svg { width: 100%; height: 100%; object-fit: contain; }
.fishing-book__slot strong { font-family: var(--font-title); }
.fishing-book__slot small { color: var(--fjord-deep); opacity: .8; }
.fishing-book__unknown {
  display: grid;
  width: 92px;
  height: 58px;
  place-items: center;
  color: var(--fjord-deep);
  background: rgba(17, 106, 141, .1);
  border-radius: 14px;
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 900;
}
.fishing-book__status { margin: 12px 0 8px; font-weight: 700; }

/* Inngangskortet på øya bruker samme stil som traktorkortet (tractor-entry). */

/* ==========================================================================
   Fiskefølelsen: vannet synlig på mobil, kast selv, pirk, fiskeskygger og plask.
   ========================================================================== */

/* Oppsett: fullskjerm får rad til utstyrsraden, og på små skjermer ligger vannet øverst. */
/* I én skjerm er stegene borte og utstyrsraden kompakt, så vannet får mest plass. */
.fishing-game.is-game-viewport,
.fishing-game.is-game-viewport[data-fishing-phase] { grid-template-rows: auto auto auto minmax(0, 1fr); }
.fishing-game.is-game-viewport .fishing-game__steps { display: none; }
.fishing-game.is-game-viewport .fishing-gear__item { grid-template-rows: auto; padding: 3px 8px; }
.fishing-game.is-game-viewport .fishing-gear__item b { grid-row: auto; }
.fishing-game.is-game-viewport .fishing-gear__item b img { width: 24px; height: 24px; }
.fishing-game.is-game-viewport .fishing-gear__item small { display: none; }
.fishing-game.is-game-viewport .fishing-game__lesson { padding: 6px; }
.fishing-game.is-game-viewport .fishing-game__clue { min-height: 0; }
.fishing-game.is-game-viewport .fishing-gear { gap: 4px; }
.fishing-game.is-game-viewport .fishing-gear__item { padding: 4px 8px; }
.fishing-game.is-game-viewport .fishing-gear__item strong { font-size: .8rem; }
.fishing-game.is-game-viewport .fishing-gear__item small { font-size: .66rem; }
.fishing-game.is-game-viewport .fishing-game__play { position: relative; }
.fishing-game__cast {
  position: absolute;
  z-index: 41;
  right: 0;
  bottom: 12px;
  left: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.fishing-game__cast[hidden] { display: none; }
.fishing-game__cast-button {
  min-height: 56px;
  padding: 10px 26px;
  font-size: 1.15rem;
  pointer-events: auto;
  animation: fishing-cast-pulse 1.4s ease-in-out infinite;
}
@keyframes fishing-cast-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.fishing-game__stage { position: relative; }

@media (max-width: 900px) {
  /* På siden: vannet før hint og dybdeknapper, så alt henger sammen på én skjerm. */
  .fishing-page .fishing-game { display: grid; gap: 12px; }
  .fishing-page .fishing-game__head { order: 1; }
  .fishing-page .fishing-game__steps { order: 2; }
  .fishing-page .fishing-gear { order: 3; }
  .fishing-page .fishing-game__play { order: 4; margin-top: 0; }
  .fishing-page .fishing-game__lesson { order: 5; }
  .fishing-page .fishing-game__finish { order: 6; }
  .fishing-page .fishing-game__safety { order: 7; }
  .fishing-page .fishing-game__stage { min-height: 0; }
  /* Fullskjerm: vannet øverst og stort, dybdeknappene rett under, resten skjult. */
  .fishing-game.is-game-viewport,
  .fishing-game.is-game-viewport[data-fishing-phase] { grid-template-rows: auto minmax(0, 1fr) auto; gap: 6px; }
  .fishing-game.is-game-viewport[data-fishing-phase="caught"] .fishing-game__lesson,
  .fishing-game.is-game-viewport[data-fishing-phase="complete"] .fishing-game__lesson { display: none; }
  .fishing-game.is-game-viewport .fishing-game__head { order: 1; }
  .fishing-game.is-game-viewport .fishing-game__play { order: 2; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); min-height: 0; }
  .fishing-game.is-game-viewport .fishing-game__lesson { order: 3; }
  .fishing-game.is-game-viewport .fishing-game__steps,
  .fishing-game.is-game-viewport .fishing-gear,
  .fishing-game.is-game-viewport .fishing-game__panel,
  .fishing-game.is-game-viewport .fishing-game__head > div:first-child { display: none; }
  .fishing-game.is-game-viewport .fishing-game__stage { height: 100%; min-height: 0; aspect-ratio: auto; }
  .fishing-game.is-game-viewport .fishing-game__lesson { grid-template-columns: minmax(0, 1fr); gap: 5px; padding: 4px 0 0; background: transparent; }
  .fishing-game.is-game-viewport .fishing-game__clue { min-height: 0; padding: 4px 8px; }
  .fishing-game.is-game-viewport .fishing-game__clue p { display: block; overflow: hidden; font-size: .78rem; white-space: nowrap; text-overflow: ellipsis; }
  .fishing-game.is-game-viewport .fishing-game__depths { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .fishing-game.is-game-viewport .fishing-game__depths button { min-height: 52px; padding: 4px; font-size: .82rem; }
  .fishing-game.is-game-viewport .fishing-game__reel { right: 6px; bottom: 6px; width: calc(100% - 12px); }
  .fishing-game.is-game-viewport .fishing-game__cast { bottom: 10px; }
}

/* Kastet: duppen flyr i en bue ut på vannet. */
.fishing-game--v2 .fishing-game__stage.is-casting .fishing-bobber { animation: fishing-cast-arc .62s cubic-bezier(.3, .8, .4, 1) both; }
@keyframes fishing-cast-arc {
  0% { transform: translate(120px, -140px) scale(.4); opacity: 0; }
  40% { transform: translate(60px, -160px) scale(.7); opacity: 1; }
  100% { transform: translate(0, 0) scale(1); opacity: 1; }
}

/* Pirk: duppen dupper litt ned før det ekte nappet. */
.fishing-game--v2 .fishing-game__stage.is-nibble .fishing-bobber { animation: fishing-nibble .42s ease-in-out 1; }
@keyframes fishing-nibble {
  0%, 100% { transform: scale(1) translateY(0); }
  35% { transform: scale(.94) translateY(9px); }
  70% { transform: scale(1.02) translateY(-3px); }
}

/* Fiskeskygger som glir under overflaten i riktig dybde. */
.fishing-game__shadows { position: absolute; z-index: 3; inset: 0; overflow: hidden; pointer-events: none; }
.fishing-game__shadows i {
  position: absolute;
  top: calc(var(--fish-top, 43%) + var(--shadow-offset, 0%));
  left: -20%;
  width: clamp(70px, 12%, 140px);
  height: 26px;
  background: radial-gradient(ellipse at center, rgba(6, 34, 52, .55), rgba(6, 34, 52, 0) 70%);
  border-radius: 50%;
  filter: blur(3px);
  transform: scale(var(--shadow-scale, 1));
  animation: fishing-shadow-drift var(--shadow-duration, 8s) linear var(--shadow-delay, 0s) infinite;
}
@keyframes fishing-shadow-drift {
  0% { left: -20%; transform: scale(var(--shadow-scale, 1)) scaleX(1); }
  49% { transform: scale(var(--shadow-scale, 1)) scaleX(1); }
  50% { left: 105%; transform: scale(var(--shadow-scale, 1)) scaleX(-1); }
  100% { left: -20%; transform: scale(var(--shadow-scale, 1)) scaleX(-1); }
}
/* Mens vi venter er fisken selv bare en skygge; arten avsløres når den er fanget. */
.fishing-game--v2 .fishing-game__stage.is-waiting .fishing-game__fish,
.fishing-game--v2 .fishing-game__stage.is-biting .fishing-game__fish { filter: brightness(.25) blur(1.5px); opacity: .55; }
.fishing-game--v2 .fishing-game__stage.is-reeling .fishing-game__fish { filter: brightness(.55) blur(.6px); }
.fishing-game--v2 .fishing-game__stage.is-reeling.reel-2 .fishing-game__fish { filter: brightness(.85); }
.fishing-game--v2 .fishing-game__stage.is-reeling.reel-1 { --line-height: calc(var(--line-height-base, 37%) - 4%); }
.fishing-game--v2 .fishing-game__stage.is-caught .fishing-game__fish { filter: none; }

/* Plask: dråper fra duppen når snøret lander og når fisken kommer opp. */
.fishing-game__splash { position: absolute; z-index: 8; top: var(--hook-top, 49%); right: calc(21.5% + 5px); width: 0; height: 0; pointer-events: none; }
.fishing-game__splash i {
  position: absolute;
  width: 9px;
  height: 9px;
  background: rgba(255, 255, 255, .9);
  border-radius: 50%;
  opacity: 0;
}
.fishing-game__splash.is-splashing i { animation: fishing-drop .8s ease-out var(--drop-delay, 0s) both; }
@keyframes fishing-drop {
  0% { transform: translate(0, 0) scale(.6); opacity: .95; }
  60% { transform: translate(var(--drop-x, 0), var(--drop-y, -40px)) scale(1); opacity: .9; }
  100% { transform: translate(var(--drop-x, 0), 10px) scale(.3); opacity: 0; }
}

html[data-calm="true"] .fishing-game__cast-button,
html[data-calm="true"] .fishing-game__shadows i,
html[data-calm="true"] .fishing-game__splash i { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .fishing-game__cast-button, .fishing-game__shadows i, .fishing-game__splash i,
  .fishing-game--v2 .fishing-game__stage.is-casting .fishing-bobber,
  .fishing-game--v2 .fishing-game__stage.is-nibble .fishing-bobber { animation: none; }
}

/* ==========================================================================
   Havna-verden: fiskeplasser, gå langs havna, ro båten på fjordkartet, kveldsfiske.
   ========================================================================== */

/* Scene per plass ligger over det låste bryggebildet og tones inn. */
.fishing-game__place-scene {
  position: absolute;
  z-index: 2;
  inset: 0;
  opacity: 0;
  background-position: 50% 50%;
  background-size: cover;
  pointer-events: none;
  transition: opacity .7s ease;
}
.fishing-game__place-scene.is-visible { opacity: 1; }
/* Egen fiskestang der Pappa ikke er med i bildet. */
/* Stanga holdes nede fra høyre, og tuppen møter snøret der det starter. */
.fishing-game--v2 .fishing-game__rod--place {
  position: absolute;
  z-index: 5;
  display: block;
  opacity: 1;
  bottom: auto;
  left: auto;
  top: 12%;
  right: calc(21.5% - 5px);
  width: 10px;
  height: 110%;
  background: linear-gradient(90deg, #4d3116, #b7854b 45%, #5a3a1c);
  border-radius: 6px 6px 0 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .35);
  transform: rotate(-17deg);
  transform-origin: top center;
  pointer-events: none;
}
.fishing-game--v2 .fishing-game__rod--place::after { display: none; }
.fishing-game--v2 .fishing-game__rod--place::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 16px;
  height: 16px;
  background: #e94e43;
  border: 2px solid #fff;
  border-radius: 50%;
  transform: translateX(-50%);
}
.fishing-game--v2 .fishing-game__rod--place[hidden] { display: none !important; }

/* Plassbrikken øverst til venstre i scenen. */
.fishing-game__chips {
  position: absolute;
  z-index: 9;
  top: 12px;
  left: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fishing-game__place-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 5px 11px;
  color: #123d54;
  background: rgba(255, 253, 247, .94);
  border: 2px solid #123d54;
  border-radius: 999px;
  font: inherit;
  font-size: .8rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 3px 3px 0 #123d54;
}
.fishing-game__place-chip[hidden] { display: none; }
.fishing-game__place-chip[aria-pressed="true"] { background: #ffda4f; }
.fishing-game__stage.is-evening .fishing-game__callout { background: #fff2c9; }

/* Plassvelgeren: panorama å gå langs + liste over plasser. */
.fishing-place,
.fishing-chart {
  position: absolute;
  z-index: 45;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  padding: 12px;
  overflow: auto;
  color: #123d54;
  background: #f0f8fb;
  border-radius: 30px;
}
.fishing-place[hidden],
.fishing-chart[hidden] { display: none; }
.fishing-place__head strong { display: block; font-family: var(--font-title); font-size: 1.25rem; }
.fishing-place__head p { margin: 2px 0 0; font-size: .92rem; }
.fishing-walk { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px; align-items: center; min-height: 0; }
.fishing-walk__view {
  height: 100%;
  min-height: 120px;
  background-position: 0 50%;
  background-size: auto 100%;
  border: 3px solid #123d54;
  border-radius: 18px;
  transition: background-position .55s ease;
}
.fishing-walk__arrow {
  width: 46px;
  height: 46px;
  color: #123d54;
  background: #fff;
  border: 3px solid #123d54;
  border-radius: 50%;
  font-size: 1.3rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 3px 3px 0 #123d54;
}
.fishing-place__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 6px; }
.fishing-place__button {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 6px;
  color: #123d54;
  background: #fff;
  border: 3px solid rgba(18, 61, 84, .25);
  border-radius: 16px;
  font: inherit;
  text-align: center;
  cursor: pointer;
}
.fishing-place__button span { font-size: 1.4rem; }
.fishing-place__button strong { font-family: var(--font-title); font-size: .95rem; }
.fishing-place__button small { font-size: .7rem; line-height: 1.2; opacity: .85; }
.fishing-place__button[aria-pressed="true"] { border-color: #123d54; background: #ffda4f; }
.fishing-place__button.is-locked { opacity: .6; cursor: default; }
.fishing-place__actions { display: flex; justify-content: center; }

/* Fjordkartet */
.fishing-chart { grid-template-rows: auto auto auto; align-content: start; gap: 10px; }
.fishing-chart__map {
  position: relative;
  align-self: center;
  justify-self: center;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  aspect-ratio: 1672 / 941;
  background: #0a5b84 url("../images/generated/games/fjorden-kart-v01-sm.jpg") center / 100% 100% no-repeat;
  border: 3px solid #123d54;
  border-radius: 18px;
}
@media (min-width: 701px) {
  .fishing-chart__map { background-image: url("../images/generated/games/fjorden-kart-v01.jpg"); }
}
.fishing-chart__boat {
  position: absolute;
  z-index: 3;
  width: 11%;
  transform: translate(-50%, -50%);
  transition: transform .12s linear;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .4));
}
.fishing-chart__boat img { display: block; width: 100%; height: auto; background: transparent; }
.fishing-chart__spot {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
}
.fishing-chart__spot i {
  display: block;
  width: 40px;
  height: 40px;
  border: 3px dashed rgba(255, 255, 255, .85);
  border-radius: 50%;
  animation: fishing-spot-spin 6s linear infinite;
}
.fishing-chart__spot b {
  position: absolute;
  top: 100%;
  left: 50%;
  padding: 2px 8px;
  color: #123d54;
  background: rgba(255, 253, 247, .92);
  border-radius: 999px;
  font-size: .72rem;
  white-space: nowrap;
  transform: translate(-50%, 4px);
}
.fishing-chart__spot.is-near i { border-style: solid; border-color: #ffda4f; box-shadow: 0 0 0 6px rgba(255, 218, 79, .35); }
@keyframes fishing-spot-spin { to { transform: rotate(360deg); } }
.fishing-chart__callout {
  position: absolute;
  z-index: 4;
  top: 10px;
  left: 50%;
  max-width: calc(100% - 24px);
  padding: 7px 14px;
  color: #123d54;
  background: #fff;
  border: 3px solid #123d54;
  border-radius: 999px;
  font-weight: 800;
  font-size: .9rem;
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 3px 3px 0 #123d54;
}
.fishing-chart__controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fishing-chart__controls button {
  display: grid;
  justify-items: center;
  min-height: 60px;
  padding: 6px;
  color: #123d54;
  background: #fff;
  border: 3px solid #123d54;
  border-radius: 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 4px 0 #123d54;
}
.fishing-chart__controls button span { font-size: 1.4rem; line-height: 1; }
.fishing-chart__controls button:active { transform: translateY(3px); box-shadow: 0 1px 0 #123d54; }
.fishing-chart__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.fishing-chart__actions [hidden] { display: none; }

/* Utstyrsikoner som bilder */
.fishing-gear__item b img { display: block; width: 34px; height: 34px; object-fit: contain; background: transparent; }

@media (max-width: 700px) {
  .fishing-game__chips { top: 8px; left: 8px; }
  .fishing-game--v2 .fishing-game__stage .fishing-game__callout { top: 50px; font-size: .82rem; }
  .fishing-game__place-chip { min-height: 30px; padding: 4px 9px; font-size: .72rem; }
  .fishing-place, .fishing-chart { padding: 8px; gap: 6px; border-radius: 22px; }
  .fishing-walk__view { min-height: 96px; }
  .fishing-place__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fishing-place__button small { display: none; }
  .fishing-chart__controls button { min-height: 52px; }
}
html[data-calm="true"] .fishing-chart__spot i { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .fishing-chart__spot i { animation: none; }
  .fishing-walk__view, .fishing-game__place-scene, .fishing-chart__boat { transition: none; }
}
