/* Mini-game styles: fishing (loaded after shell.css). */

/* The pond panel: picture and headline on top, then reeling or the style
   choice, then one row of actions. Overrides the generic status-pill layout. */
#fishing-hud:not([hidden]) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "pic head"
    "pic copy"
    "reel reel"
    "style style"
    "actions actions";
  align-items: start;
  align-content: start;
  justify-content: stretch;
  gap: 6px 14px;
  width: min(560px, 100%);
  padding: 12px 14px;
  text-align: left;
  color: var(--cz-cocoa);
}
#fishing-hud .fishing-picture {
  grid-area: pic;
  display: block;
  width: 224px;
  height: 96px;
  image-rendering: pixelated;
  border: 2px solid var(--cz-cocoa);
  border-radius: 10px;
  background: #8ec3d9;
}
#fishing-hud .fishing-head {
  grid-area: head;
  display: grid;
  gap: 3px;
  min-width: 0;
}
#fishing-hud p {
  margin: 0;
  min-height: 0;
  grid-column: auto;
}
#fishing-hud .fishing-title {
  font-family: var(--cz-font-display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
#fishing-hud .fishing-sub {
  font-size: 13px;
  line-height: 1.5;
  color: var(--cz-cocoa-soft);
}
#fishing-hud .fishing-copy {
  grid-area: copy;
  font-size: 13px;
  line-height: 1.45;
}
#fishing-hud .fishing-chip {
  display: inline-block;
  padding: 0 7px;
  border: 2px solid var(--cz-cocoa);
  border-radius: 999px;
  background: var(--cz-paper-deep);
  color: var(--cz-cocoa);
  font-family: var(--cz-font-display);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}
#fishing-hud .fishing-chip.is-uncommon { background: #dcebc8; }
#fishing-hud .fishing-chip.is-rare { background: #cfe5f0; }
#fishing-hud .fishing-chip.is-legendary { background: #f5dc93; }
#fishing-hud .fishing-chip.is-new,
#fishing-hud .fishing-chip.is-record {
  background: var(--cz-gold);
  border-color: var(--cz-gold-deep);
  color: var(--cz-cocoa-deep);
}

/* Reeling: tension meter with a sweet spot and two danger edges. */
#fishing-hud .fishing-reel {
  grid-area: reel;
  display: grid;
  gap: 4px;
  min-width: 0;
}
#fishing-hud .fishing-reel[hidden],
#fishing-hud .fishing-reel [hidden] { display: none; }
#fishing-hud .fishing-meter {
  position: relative;
  height: 24px;
  margin: 0;
  border: 2px solid var(--cz-cocoa);
  border-radius: 8px;
  background: #f1e6c8;
  overflow: hidden;
}
#fishing-hud .fishing-meter-zone {
  position: absolute;
  top: 0;
  bottom: 0;
}
#fishing-hud .fishing-meter .is-slack,
#fishing-hud .fishing-meter .is-tight {
  background: repeating-linear-gradient(135deg, #e3a08c 0 4px, #f4d2c4 4px 8px);
  opacity: 0.7;
}
#fishing-hud .fishing-meter .is-slack { left: 0; width: calc(var(--slack) * 100%); }
#fishing-hud .fishing-meter .is-tight { right: 0; width: calc((1 - var(--tight)) * 100%); }
#fishing-hud .fishing-meter .is-sweet {
  left: calc(var(--sweet-lo) * 100%);
  width: calc((var(--sweet-hi) - var(--sweet-lo)) * 100%);
  background: #a8cf86;
  border-inline: 2px solid var(--cz-moss-deep);
}
#fishing-hud .fishing-meter-marker {
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: calc(var(--t, 0.45) * 100%);
  width: 10px;
  margin-left: -5px;
  border: 2px solid var(--cz-cocoa);
  border-radius: 4px;
  background: linear-gradient(#e46b58 0 45%, #fffaee 45%);
}
#fishing-hud[data-zone="slack"] .fishing-meter .is-slack,
#fishing-hud[data-zone="tight"] .fishing-meter .is-tight {
  background: repeating-linear-gradient(135deg, #c4553f 0 4px, #e9a08b 4px 8px);
  opacity: calc(0.6 + var(--strain, 0) * 0.4);
}
#fishing-hud[data-zone="slack"] .fishing-meter-marker,
#fishing-hud[data-zone="tight"] .fishing-meter-marker {
  border-color: #8a2f22;
  background: linear-gradient(#c4553f 0 45%, #f6c3b4 45%);
}
#fishing-hud .fishing-meter-labels {
  position: relative;
  height: 17px;
  font-family: var(--cz-font-display);
  font-size: 12px;
  line-height: 17px;
  color: var(--cz-cocoa-soft);
}
#fishing-hud .fishing-meter-labels span { position: absolute; top: 0; white-space: nowrap; }
#fishing-hud .fishing-meter-labels .is-slack { left: 0; }
#fishing-hud .fishing-meter-labels .is-tight { right: 0; }
#fishing-hud .fishing-meter-labels .is-sweet {
  left: calc(var(--sweet-mid) * 100%);
  transform: translateX(-50%);
}
#fishing-hud[data-zone="sweet"] .fishing-meter-labels .is-sweet {
  color: #3f6a2c;
  font-weight: 700;
}
#fishing-hud[data-zone="slack"] .fishing-meter-labels .is-slack,
#fishing-hud[data-zone="tight"] .fishing-meter-labels .is-tight {
  color: #9a3b2a;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#fishing-hud .fishing-progress {
  width: 100%;
  height: 12px;
  margin: 2px 0 0;
  accent-color: var(--cz-moss-deep);
}

/* Relaxed or Skill: two options, each explained in one line. */
#fishing-hud .fishing-style {
  grid-area: style;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
#fishing-hud .fishing-style[hidden] { display: none; }
#fishing-hud .fishing-style-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  margin: 0;
  padding: 7px 10px;
  border: 2px solid #d8c8a2;
  border-radius: 10px;
  background: var(--cz-paper);
  font-size: 12.5px;
  line-height: 1.4;
  cursor: pointer;
}
#fishing-hud .fishing-style-option:has(input:checked) {
  border-color: var(--cz-cocoa);
  background: #f3ead0;
  box-shadow: 0 2px 0 var(--cz-cocoa);
}
#fishing-hud .fishing-style-option:focus-within {
  outline: 3px solid var(--cz-peach-deep);
  outline-offset: 2px;
}
#fishing-hud .fishing-style-option input {
  appearance: auto;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  padding: 0;
  border: 0;
  flex: none;
  accent-color: var(--cz-cocoa);
}
#fishing-hud .fishing-style-option input:focus-visible { outline: none; }
#fishing-hud .fishing-style-option strong {
  font-family: var(--cz-font-display);
  font-size: 14px;
}

/* Actions: the cast / hook / hold button and Leave pond. */
#fishing-hud .fishing-actions {
  grid-area: actions;
  display: flex;
  gap: 8px;
  margin: 2px 0 0;
}
#fishing-hud .fishing-actions .button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  padding: 6px 12px;
  font-size: 15px;
  grid-column: auto;
}
#fishing-hud .fishing-actions .fishing-primary {
  flex: 2 1 0;
  /* Stage colours switch at once, so text never sits on a half-blended fill. */
  transition: transform 0.15s;
}
#fishing-hud .fishing-primary[aria-disabled="true"] {
  opacity: 0.55;
  cursor: default;
  transform: none;
  box-shadow: 0 3px 0 var(--cz-cocoa-deep);
}
#fishing-hud:is([data-stage="bite"], [data-stage="reeling"]) .fishing-primary {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
#fishing-hud[data-holding="true"] .fishing-primary {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--cz-cocoa-deep);
  background: #6c4d43;
}
#fishing-hud[data-stage="bite"] .fishing-primary {
  background: var(--cz-peach);
  border-color: var(--cz-cocoa);
  color: var(--cz-cocoa-deep);
}

@media (prefers-reduced-motion: no-preference) {
  #fishing-hud[data-motion="full"][data-stage="bite"] .fishing-primary {
    animation: fishing-bite 0.45s ease-in-out infinite alternate;
  }
  #fishing-hud[data-motion="full"]:is([data-zone="slack"], [data-zone="tight"]) .fishing-meter-marker {
    animation: fishing-strain 0.16s steps(2) infinite;
  }
  #fishing-hud[data-motion="full"]:is([data-result="new"], [data-result="record"]) .fishing-chip:is(.is-new, .is-record) {
    animation: fishing-shine 0.8s ease-out 2 alternate;
  }
}
@keyframes fishing-bite { to { transform: translateY(-2px); } }
@keyframes fishing-strain { 50% { translate: 2px 0; } }
@keyframes fishing-shine { to { background: #fff3b4; } }

/* Phones: no picture; the text and controls stack. */
@media (max-width: 650px) {
  #fishing-hud:not([hidden]) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "head" "copy" "reel" "style" "actions";
    gap: 6px;
    padding: 10px 12px;
  }
  #fishing-hud .fishing-picture { display: none; }
  #fishing-hud .fishing-title { font-size: 16px; }
  #fishing-hud .fishing-sub,
  #fishing-hud .fishing-copy { font-size: 12px; }
  #fishing-hud .fishing-style-option { padding: 6px 8px; font-size: 11.5px; }
  #fishing-hud .fishing-actions .button { font-size: 14px; }
}
/* Short landscape: picture off, actions beside the headline. */
@media (max-height: 500px) and (min-width: 651px) {
  #fishing-hud:not([hidden]) {
    grid-template-columns: minmax(0, 1fr) minmax(200px, 40%);
    grid-template-areas: "head actions" "copy actions" "reel reel" "style style";
    gap: 4px 12px;
    padding: 8px 12px;
  }
  #fishing-hud .fishing-picture { display: none; }
  #fishing-hud .fishing-title { font-size: 15px; }
  #fishing-hud .fishing-sub,
  #fishing-hud .fishing-copy { font-size: 12px; }
  #fishing-hud .fishing-actions { align-self: center; margin: 0; }
  #fishing-hud .fishing-actions .button { padding: 4px 8px; font-size: 13px; white-space: normal; }
  #fishing-hud .fishing-style-option { padding: 4px 8px; font-size: 11.5px; }
  #fishing-hud .fishing-meter { height: 18px; }
}
/* Touch: every choice is a comfortable target. */
@media (pointer: coarse) {
  #fishing-hud .fishing-style-option { min-height: 44px; align-items: center; }
  #fishing-hud .fishing-style-option input { width: 22px; height: 22px; }
}

/* The pond field guide in the Journal (Backpack). */
.pond-guide-list {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.pond-guide-list li {
  display: grid;
  gap: 1px;
  padding: 6px 10px;
  border: 2px dashed #d8c8a2;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
}
.pond-guide-list li.found {
  border-style: solid;
  border-color: var(--cz-moss);
  background: #f1f6e6;
}
.pond-guide-list li strong { font-family: var(--cz-font-display); font-size: 14px; }
.pond-guide-list li small { color: var(--cz-cocoa-soft); font-size: 12px; }
