/*
 * «Рыбалка» — the fishing mode of the hunt tab (warsmith-webapp #7426 / #7495,
 * web/fishing.js). Forge-Glass (ADR-0013): glass cards, the one gold accent,
 * dark only; the water tone is a muted teal used for the float and the fish bar.
 */

.fish-viewseg {
  margin-top: 2px;
}

/* item / skill icons: a fixed small tile (.icon-tile fills its parent by default) */
.fish-card .icon-tile,
.fish-bar .icon-tile {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.fish-lure .icon-tile {
  width: 28px;
  height: 28px;
}

.fish-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fish-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.fish-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 2px;
}
.fish-select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 11px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-size: 13px;
}
.fish-select option {
  background: #16171d;
}
.fish-miss {
  color: var(--warn);
}

/* --- the spot picker --- */
.fish-spots {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.fish-spot {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  border-radius: 11px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.fish-spot.on {
  border-color: rgba(201, 162, 75, 0.55);
  background: rgba(201, 162, 75, 0.12);
}
.fish-spot-dot {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--glass-border);
}
.fish-spot.on .fish-spot-dot {
  border-color: var(--accent);
  background: radial-gradient(circle, var(--accent-strong) 0 40%, transparent 45%);
}
.fish-spot-name {
  flex: 1 1 auto;
  min-width: 0;
}
.fish-spot-band {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--ink-muted);
}
.fish-place-note {
  font-size: 11.5px;
}

/* --- the fisherman's skills --- */
.fish-skill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.fish-skill:first-of-type {
  border-top: 0;
}
.fish-skill-main {
  flex: 1 1 auto;
  min-width: 0;
}
.fish-skill-name {
  font-weight: 600;
  font-size: 13px;
}
.fish-skill-next {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  max-width: 52%;
  text-align: right;
}
.fish-skill-cost,
.fish-skill-why {
  font-size: 11px;
  color: var(--ink-muted);
}
.fish-skill-sum {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  font-size: 12.5px;
  color: var(--ink-muted);
}
.fish-skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* a small inline icon (the journal, the skill chips, the last hit) */
.fish-ico {
  display: inline-flex;
  vertical-align: -4px;
  margin-right: 4px;
}
.fish-ico .icon-tile,
.fish-card .fish-ico .icon-tile,
.fish-bar .fish-ico .icon-tile {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 0;
  background: transparent;
}
.fish-ico .icon-tile img {
  width: 100%;
  height: 100%;
}

/* --- gear --- */
.fish-lures {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.fish-lure {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 6px 10px;
  border-radius: 11px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}
.fish-lure.on {
  border-color: rgba(201, 162, 75, 0.55);
  background: rgba(201, 162, 75, 0.1);
}
.fish-lure-n {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #1a1408;
  background: var(--accent);
}
.fish-lure-txt {
  flex: 1 1 auto;
  min-width: 0;
}
.pill.fish-night {
  border-color: rgba(120, 150, 220, 0.6);
  color: #a9bff0;
}
.fish-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 6px 10px;
  border-radius: 11px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.fish-toggle-knob {
  flex: 0 0 auto;
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.15s;
}
.fish-toggle-knob::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink-muted);
  transition: transform 0.15s, background 0.15s;
}
.fish-toggle.on .fish-toggle-knob {
  background: rgba(201, 162, 75, 0.4);
}
.fish-toggle.on .fish-toggle-knob::after {
  transform: translateX(14px);
  background: var(--accent-strong);
}
.fish-toggle-sub {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
}
.fish-market {
  align-self: flex-start;
}
.fish-combat-note {
  margin: 2px 2px -4px;
  font-size: 12px;
}

/* --- start --- */
.fish-ready {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fish-ready .pill {
  white-space: normal;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11.5px;
  font-weight: 600;
}

/* --- the running card: the fish bar --- */
.fish-bar {
  margin-top: 12px;
  padding: 10px 11px;
  border-radius: 13px;
  border: 1px solid rgba(90, 170, 175, 0.28);
  background: linear-gradient(180deg, rgba(40, 90, 100, 0.16), rgba(20, 40, 50, 0.1));
}
.fish-bar--idle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
}
.fish-bar-line {
  font-size: 13px;
  color: var(--ink-muted);
}
.fish-float {
  flex: 0 0 auto;
  width: 12px;
  height: 18px;
  border-radius: 6px 6px 7px 7px;
  background: linear-gradient(180deg, #d9574f 0 45%, #f1ede4 45% 100%);
  box-shadow: 0 6px 10px -4px rgba(90, 170, 175, 0.7);
}
.fish-float.bob {
  animation: fish-bob 2.2s ease-in-out infinite;
}
@keyframes fish-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(3px); }
}
.fish-bar-head {
  display: flex;
  align-items: center;
  gap: 9px;
}
.fish-bar-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
}
.fish-time {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-strong);
}
.fish-hp {
  position: relative;
  height: 14px;
  margin-top: 9px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.fish-hp > i {
  display: block;
  height: 100%;
  border-radius: 7px;
  background: linear-gradient(90deg, #3f8f96, #6cc3bf);
  box-shadow: 0 0 10px rgba(108, 195, 191, 0.4);
  transition: width 0.35s ease-out;
}
.fish-hp.warn > i {
  background: linear-gradient(90deg, #9b8a3e, var(--warn));
}
.fish-hp.crit > i {
  background: linear-gradient(90deg, #b5514c, #cf5b54);
  box-shadow: 0 0 10px rgba(207, 91, 84, 0.45);
}
/* the fish's starting HP: past this mark it gets away sooner */
.fish-hp-start {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(255, 255, 255, 0.35);
}
.fish-hp-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
  font-size: 11.5px;
}
.fish-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.fish-mode {
  font-size: 12.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
}
.fish-mode.rest {
  color: #9fd8d2;
  border-color: rgba(108, 195, 191, 0.45);
}
.fish-mode.fight {
  color: var(--warn);
  border-color: rgba(230, 193, 115, 0.5);
}
.fish-regen {
  font-size: 11.5px;
  color: var(--crit);
}
.fish-trick {
  margin-top: 7px;
  padding: 6px 9px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-strong);
  background: rgba(201, 162, 75, 0.12);
  border: 1px dashed rgba(201, 162, 75, 0.5);
}
.fish-hit {
  margin-top: 7px;
  font-size: 12px;
  color: var(--ink-muted);
  animation: fish-hit-pop 0.45s ease-out;
}
.fish-hit.good {
  color: var(--ok);
}
.fish-hit.bad {
  color: var(--crit);
}
@keyframes fish-hit-pop {
  0% { transform: scale(1.08); opacity: 0.4; }
  100% { transform: scale(1); opacity: 1; }
}

/* --- the controls: the mode switch and MANUAL's two thumb-zone buttons --- */
/* The buttons stick to the bottom of the scroller while the card scrolls:
   the hunt tab's .screen must not be the sticky's scroll container. */
.screen:has(#fishCtlSection) {
  overflow: visible;
  flex: 0 0 auto;
}
.fish-ctl-wrap {
  margin-top: 12px;
}
.fish-ctl-wrap.sticky {
  position: sticky;
  bottom: 0;
  z-index: 3;
}
.fish-ctl {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(14, 15, 20, 0.88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.fish-ctl--self {
  gap: 0;
}
.fish-taps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.fish-tap {
  position: relative;
  overflow: hidden;
  min-height: 92px;
  border-radius: 14px;
  border: 1px solid rgba(201, 162, 75, 0.35);
  background: linear-gradient(180deg, rgba(201, 162, 75, 0.16), rgba(201, 162, 75, 0.06));
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.08s, box-shadow 0.15s, border-color 0.15s;
}
.fish-tap:active:not(:disabled) {
  transform: scale(0.97);
}
.fish-tap.want:not(:disabled) {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(201, 162, 75, 0.5), 0 0 18px var(--accent-glow);
}
.fish-tap:disabled {
  opacity: 0.45;
  cursor: default;
}
.fish-tap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.fish-tap-ico {
  position: relative;
  z-index: 1;
  display: flex;
}
.fish-tap-ico .icon-tile {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  border: 1px solid rgba(201, 162, 75, 0.45);
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.fish-tap-ico .icon-tile img {
  width: 100%;
  height: 100%;
}
.fish-tap.cool .fish-tap-ico {
  filter: grayscale(0.7) brightness(0.7);
}
.fish-tap-name {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent-strong);
}
.fish-tap.cool .fish-tap-name {
  color: var(--ink-muted);
}
/* the reuse sweep: a dark veil that shrinks away over the reuse time */
.fish-cd {
  position: absolute;
  inset: 0;
  background: rgba(8, 9, 12, 0.55);
  transform-origin: right center;
  animation-name: fish-cd;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}
@keyframes fish-cd {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}
.fish-tap-sub {
  min-height: 16px;
  font-size: 12px;
  text-align: center;
  color: var(--ink-muted);
}
.fish-tap-sub.refused {
  color: var(--warn);
}

/* --- counters and gear --- */
.fish-cnts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  margin-top: 12px;
}
.fish-cnt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 2px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  min-width: 0;
}
.fish-cnt b {
  font-size: 15px;
}
.fish-cnt .lbl {
  font-size: 10px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fish-gear-live {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 9px;
}
.fish-gear-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  min-width: 0;
}
.fish-gear-chip .icon-tile {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}
.fish-skill-main,
.fish-lure-txt,
.fish-spot-name {
  text-align: left;
}
.fish-gear-txt {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- the catch --- */
.fish-catch {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fish-catch-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  min-width: 0;
}
.fish-catch-item .icon-tile {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.fish-catch-txt {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .fish-float.bob,
  .fish-hit {
    animation: none;
  }
  .fish-hp > i {
    transition: none;
  }
}
