/* Fishing Tour (fish.html, docs/111): what it has that Cara Runs (css/run.css) does not. */

#fish-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }

/* the score, the place and the catch, top left */
.fhud__left { position: absolute; left: max(16px, env(safe-area-inset-left)); top: max(14px, env(safe-area-inset-top)); display: grid; justify-items: start; gap: 2px; pointer-events: none; max-width: 46vw; }
.fhud__score { font: 900 clamp(1.9rem, 6vw, 2.8rem)/1 var(--font-display); letter-spacing: 0.04em; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6), 0 0 18px rgba(0, 0, 0, 0.35); }
.fhud__score.is-pop { animation: fpop 0.3s ease-out; }
.fhud__place { font: 700 0.9rem/1.15 var(--font-body); color: #d8f4ff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fhud__catch { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 5px 12px 5px 8px; border-radius: 999px; background: rgba(6, 20, 26, 0.66); border: 1px solid rgba(150, 230, 255, 0.3); font: 800 1.15rem/1 var(--font-body); font-variant-numeric: tabular-nums; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.fhud__catch.is-met { border-color: #9dffd0; box-shadow: 0 0 14px rgba(80, 230, 140, 0.45); }
.fhud__catch.is-pop { animation: fpop 0.25s ease-out; }
.fhud__fish { font-size: 1rem; }
.fhud__need { font: 700 0.78rem/1 var(--font-body); color: #a8d8e8; }
.fhud__need b { color: #fff; }
.fhud__catch.is-met .fhud__need { color: #9dffd0; }
@keyframes fpop { 0% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* the depth gauge, down the right-hand side */
.fgauge { position: absolute; right: max(16px, env(safe-area-inset-right)); top: calc(max(14px, env(safe-area-inset-top)) + 60px); bottom: max(110px, calc(env(safe-area-inset-bottom) + 96px)); width: 54px; display: grid; grid-template-rows: 1fr auto auto; justify-items: center; gap: 4px; pointer-events: none; }
.fgauge__bar { position: relative; width: 12px; border-radius: 99px; background: linear-gradient(180deg, rgba(160, 230, 255, 0.35), rgba(10, 40, 60, 0.55)); border: 1px solid rgba(200, 240, 255, 0.45); overflow: visible; }
.fgauge__fill { position: absolute; left: 0; right: 0; top: 0; height: 0; border-radius: 99px; background: linear-gradient(180deg, #8fe8ff, #2fa8d8); box-shadow: 0 0 10px rgba(120, 220, 255, 0.6); }
.fgauge__mark { position: absolute; left: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; top: 0; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff, #ff6a4a 55%, #b8301a); border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.fgauge b { font: 900 0.95rem/1 var(--font-display); color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fgauge small { font: 700 0.7rem/1 var(--font-body); color: #a8d8e8; white-space: nowrap; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); }
.fgauge.is-deeper .fgauge__bar { animation: fdeep 0.6s ease-out; }
@keyframes fdeep { 0% { box-shadow: 0 0 0 6px rgba(120, 220, 255, 0.7); } }

/* the power-up badges: under the score on a narrow screen, else top middle (Cara Runs' rings) */
#fish-powers { top: max(14px, env(safe-area-inset-top)); }
.rp--deeper { --c: #8fe8ff; } .rp--wide { --c: #ffd25a; } .rp--lure { --c: #ff8ad8; } .rp--gold { --c: #ffc83a; }
.rp.is-armed { opacity: 0.75; border-style: dashed; }
.rhud__banner.is-deeper { background: linear-gradient(90deg, rgba(20, 90, 140, 0.85), rgba(120, 220, 255, 0.75)); }
.rhud__banner.is-wide { background: linear-gradient(90deg, rgba(200, 140, 20, 0.85), rgba(255, 210, 90, 0.8)); color: #3a2200; text-shadow: none; }
.rhud__banner.is-lure { background: linear-gradient(90deg, rgba(170, 40, 130, 0.85), rgba(255, 138, 216, 0.75)); }
.rhud__banner.is-gold { background: linear-gradient(90deg, rgba(200, 130, 0, 0.9), rgba(255, 230, 120, 0.85)); color: #3a2200; text-shadow: none; }
.rhud__banner.is-place { background: rgba(6, 20, 26, 0.78); border: 1px solid rgba(150, 230, 255, 0.4); font-size: clamp(1.1rem, 4vw, 1.7rem); }
.rhud__banner.is-catch { background: linear-gradient(90deg, rgba(20, 120, 160, 0.85), rgba(80, 210, 230, 0.8)); font-size: clamp(1rem, 3.6vw, 1.5rem); }

/* the camera: a white flash, and the viewfinder's corners */
.fflash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 6; }
.fflash.is-on { animation: fflash 0.32s ease-out; }
@keyframes fflash { 0% { opacity: 0.75; } 100% { opacity: 0; } }
.freticle { position: fixed; left: 0; top: 0; width: 132px; height: 132px; margin: -66px 0 0 -66px; pointer-events: none; z-index: 5; transition: transform 0.06s linear; }
.freticle i { position: absolute; width: 30px; height: 30px; border: 4px solid rgba(255, 255, 255, 0.92); filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6)); }
.freticle i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.freticle i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.freticle i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.freticle i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.freticle.is-on i { border-color: #ffd25a; }
.freticle.is-snap { animation: fsnap 0.18s ease-out; }
@keyframes fsnap { 0% { scale: 0.82; } 100% { scale: 1; } }

/* the card after a cast */
.fsum { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto; padding: 20px 20px 16px; border-radius: 20px; background: rgba(6, 22, 28, 0.88); border: 1px solid rgba(150, 230, 255, 0.3); box-shadow: var(--shadow); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); text-align: center; pointer-events: auto; animation: fsum-in 0.3s ease-out; z-index: 3; }
@keyframes fsum-in { from { transform: translate(-50%, -50%) scale(0.85); opacity: 0; } }
.fsum__head { margin: 0; font: 900 clamp(1.7rem, 7vw, 2.4rem)/1.05 var(--font-display); letter-spacing: 0.04em; color: #fff3df; }
.fsum__line { margin: 8px 0 0; font-size: 0.98rem; line-height: 1.4; color: #d8eef4; }
.fsum__shots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 12px 0 0; }
.fsum__shots figure { margin: 0; padding: 4px 4px 2px; border-radius: 4px; background: #f6f2e6; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35); transform: rotate(var(--r, 0deg)); animation: rp-in 0.3s ease-out backwards; }
.fsum__shots canvas { display: block; width: 60px; height: 36px; border-radius: 2px; background: linear-gradient(180deg, #8fd0e8, #3a8aa8); }
.fsum__shots figcaption { font: 700 0.6rem/1.2 var(--font-body); color: #3a3026; max-width: 60px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fsum__shots figure.is-missed { background: #c8ccc8; opacity: 0.7; }
.fsum__pts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 0; }
.fsum__pts div { padding: 8px 4px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); }
.fsum__pts dt { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.fsum__pts dd { margin: 4px 0 0; font: 800 1.1rem/1.1 var(--font-body); color: #fff3df; font-variant-numeric: tabular-nums; }
.fsum__new { margin: 10px auto 0; width: max-content; max-width: 100%; padding: 4px 14px; border-radius: 99px; background: linear-gradient(135deg, #8fe8ff, #3ab8d8); color: #062028; font-weight: 800; font-size: 0.9rem; }
.fsum .gbtn { width: 100%; margin-top: 14px; justify-content: center; }
.fsum.is-short .fsum__head { color: #ffd8a8; }

/* the logbook */
.flog__count { padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); font: 800 1rem/1 var(--font-body); font-variant-numeric: tabular-nums; color: #9dffd0; }
.flog { overflow-y: auto; min-height: 0; margin-top: 12px; padding: 2px; }
.flog h3 { margin: 12px 0 6px; font: 800 0.95rem/1.2 var(--font-display); letter-spacing: 0.04em; color: #ffe0b4; }
.flog h3 small { font: 600 0.78rem/1 var(--font-body); color: var(--muted); letter-spacing: 0; }
.flog__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.flog__fish { display: grid; justify-items: center; gap: 2px; padding: 8px 6px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); text-align: center; }
.flog__fish canvas { width: 100px; height: 60px; }
.flog__fish b { font-size: 0.82rem; line-height: 1.2; }
.flog__fish small { font-size: 0.72rem; color: var(--muted); }
.flog__fish.is-rare { border-color: rgba(255, 210, 90, 0.5); }
.flog__fish.is-unknown b { color: var(--muted); }
.flog__fish[title] { cursor: help; }

/* Call Cara: big and green on the title and end screens */
.gbtn.gbtn--call.fcall { min-height: 58px; }
.gbtn.gbtn--call.fcall .gbtn__label { font-size: 1.12rem; }
.gbtn.fcall .gbtn__label::before { content: '📞 '; }
#fish-title .rbest { flex-wrap: wrap; gap: 6px 18px; }
#fish-over .rstats { grid-template-columns: repeat(5, 1fr); }

/* a narrow screen: smaller buttons, the gauge slimmer */
@media (max-width: 560px) {
  .rhud__right { gap: 6px; }
  .rhud__right .rhud__btn { width: 36px; height: 36px; font-size: 0.95rem; }
  .rhud__right .rhud__tokens { padding: 5px 10px 5px 6px; font-size: 1.05rem; }
  #fish-powers { top: auto; bottom: max(150px, calc(env(safe-area-inset-bottom) + 136px)); }
  .fgauge { width: 44px; right: max(10px, env(safe-area-inset-right)); }
  #fish-over .rstats { grid-template-columns: repeat(3, 1fr); }
  .fsum__pts dd { font-size: 1rem; }
}
@media (max-width: 380px) { .rhud__right .rhud__btn { width: 33px; height: 33px; } .rhud__right { gap: 4px; } }
@media (max-height: 460px) { .fgauge { top: 64px; bottom: 16px; } .fhud__catch { margin-top: 2px; } .fsum { padding: 12px 16px 10px; } .fsum__shots { display: none; } }
@media (prefers-reduced-motion: reduce) { .fhud__score.is-pop, .fhud__catch.is-pop, .fflash.is-on, .freticle.is-snap, .fsum, .fsum__shots figure { animation: none; } }
/* a phone on its side: the title card compact, Go fishing and Call Cara side by side, both in sight at once */
@media (max-height: 460px) {
  #fish-title .rcard, #fish-over .rcard { padding: 14px 18px 12px; }
  #fish-title .rcard__eyebrow, #fish-title .rcard__tag { display: none; }
  #fish-title .rlogo, #fish-over .rcard__head { font-size: clamp(1.8rem, 7vh, 2.4rem); }
  #fish-title .rtabs--title { margin: 8px 0; }
  #fish-title .rbest { margin-top: 4px; }
  #fish-title .ractions, #fish-over .ractions { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
  #fish-title .ractions > :not(.gbtn--tall):not(.fcall), #fish-over .ractions > :not(.gbtn--tall):not(.fcall) { grid-column: 1 / -1; }
  #fish-over .rstats { margin-top: 8px; }
  #fish-over .rcard__text { margin-top: 6px; font-size: 0.9rem; }
}
/* the hint up top, under the badges, clear of the call's card in the bottom-left corner */
#fish-hint { top: calc(max(14px, env(safe-area-inset-top)) + 62px); bottom: auto; max-width: min(48vw, 440px); font-size: 0.95rem; }
@media (max-width: 560px) { #fish-hint { top: calc(max(14px, env(safe-area-inset-top)) + 100px); max-width: 52vw; } }
