/* =============================================================================
   Fish the Bank; the homepage fishing game (fishing-game.js).
   Scoped under .f4f-game so nothing leaks into the rest of the site.
   ============================================================================= */

.fishing-game-section .section-intro {
  max-width: 760px;
}

.f4f-game {
  --fg-navy: #10114e;
  --fg-navy-deep: #0a0b38;
  --fg-blue: #023763;
  --fg-teal: #008E9D;
  --fg-green: #729b3b;
  --fg-green-bright: #8db94e;
  --fg-cream: #f7f3e8;
  --fg-cream-dim: #e8e2cf;
  --fg-pink: #d6336c;
  --fg-amber: #e8b339;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(168deg, var(--fg-navy) 0%, var(--fg-blue) 55%, #06243d 100%);
  box-shadow: 0 18px 45px rgba(16, 17, 78, 0.35);
  color: var(--fg-cream);
  font-family: "Open Sans", sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

/* Faint topographic grain so the dark shell is not a flat slab */
.f4f-game::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: repeating-radial-gradient(circle at 18% 30%, transparent 0 26px, #fff 26px 27px),
                    repeating-radial-gradient(circle at 82% 70%, transparent 0 34px, #fff 34px 35px);
  z-index: 1;
}

.f4f-game * { box-sizing: border-box; }

.f4f-game canvas {
  display: block;
  width: 100%;
  cursor: crosshair;
  touch-action: none;
}

/* --- HUD ------------------------------------------------------------------ */

.fg-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  pointer-events: none;
  z-index: 5;
}

.fg-hud-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.fg-stat {
  background: rgba(10, 11, 56, 0.72);
  border: 1px solid rgba(247, 243, 232, 0.18);
  border-radius: 10px;
  padding: 6px 12px;
  text-align: center;
  min-width: 74px;
  backdrop-filter: blur(3px);
}

.fg-stat b {
  display: block;
  font-family: "Questrial", sans-serif;
  font-size: 22px;
  line-height: 1.1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.fg-stat span {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(247, 243, 232, 0.65);
}

.fg-stat.fg-stat-time b { color: var(--fg-amber); }

.fg-conditions {
  max-width: 46%;
  background: rgba(10, 11, 56, 0.72);
  border: 1px solid rgba(247, 243, 232, 0.18);
  border-radius: 10px;
  padding: 8px 14px;
  text-align: right;
  backdrop-filter: blur(3px);
}

.fg-conditions b {
  display: block;
  font-family: "Questrial", sans-serif;
  font-size: 15px;
  color: #fff;
}

.fg-conditions b i { color: var(--fg-amber); margin-right: 6px; }

.fg-conditions span {
  font-size: 12px;
  color: rgba(247, 243, 232, 0.75);
  line-height: 1.35;
  display: block;
}

.fg-hatch-flash b i { color: var(--fg-pink); }

/* Status line: short coaching messages above the controls */
.fg-status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 116px;
  text-align: center;
  pointer-events: none;
  z-index: 5;
  font-family: "Questrial", sans-serif;
  font-size: 17px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(6, 36, 61, 0.9);
  opacity: 0;
  transition: opacity 0.25s;
}

.fg-status.show { opacity: 1; }

/* --- Control bar ----------------------------------------------------------- */

.fg-controls {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px 14px;
  background: linear-gradient(180deg, rgba(10, 11, 56, 0.55), rgba(6, 7, 40, 0.92));
  border-top: 1px solid rgba(247, 243, 232, 0.12);
}

.fg-current-fly {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--fg-cream);
  color: var(--fg-navy);
  border: none;
  border-radius: 12px;
  padding: 6px 14px 6px 6px;
  cursor: pointer;
  min-width: 190px;
  text-align: left;
  transition: transform 0.15s, box-shadow 0.15s;
}

.fg-current-fly:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35); }

.fg-current-fly img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
}

.fg-current-fly .fg-fly-name {
  font-family: "Questrial", sans-serif;
  font-size: 14px;
  line-height: 1.15;
  display: block;
}

.fg-current-fly .fg-fly-type {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-teal);
}

.fg-current-fly .fg-fly-swap {
  margin-left: auto;
  font-size: 11px;
  color: var(--fg-pink);
  white-space: nowrap;
}

.fg-techniques {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.fg-tech {
  border: 1px solid rgba(247, 243, 232, 0.3);
  background: transparent;
  color: var(--fg-cream);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: "Questrial", sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.fg-tech:hover { border-color: var(--fg-green-bright); color: var(--fg-green-bright); }

.fg-tech.active {
  background: var(--fg-green);
  border-color: var(--fg-green);
  color: #fff;
}

.fg-cast-btn {
  margin-left: auto;
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  font-family: "Questrial", sans-serif;
  font-size: 15px;
  background: var(--fg-green);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.fg-cast-btn:hover { background: var(--fg-green-bright); }
.fg-cast-btn:active { transform: scale(0.96); }

/* --- Overlays --------------------------------------------------------------- */

.fg-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, rgba(10, 11, 56, 0.78), rgba(6, 7, 40, 0.88));
  backdrop-filter: blur(4px);
  animation: fg-fade-in 0.35s ease;
}

@keyframes fg-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fg-overlay-card {
  max-width: 560px;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  text-align: center;
  background: rgba(16, 17, 78, 0.55);
  border: 1px solid rgba(247, 243, 232, 0.16);
  border-radius: 16px;
  padding: 28px 30px;
}

.fg-overlay-card h3 {
  font-family: "Questrial", sans-serif;
  font-size: 30px;
  margin: 0 0 4px;
  color: #fff;
}

.fg-overlay-card .fg-sub {
  color: var(--fg-amber);
  font-family: "Questrial", sans-serif;
  font-size: 16px;
  margin-bottom: 14px;
}

.fg-overlay-card p {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(247, 243, 232, 0.85);
}

.fg-btn {
  display: inline-block;
  border: none;
  border-radius: 999px;
  padding: 12px 30px;
  margin-top: 14px;
  font-family: "Questrial", sans-serif;
  font-size: 16px;
  background: var(--fg-green);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.fg-btn:hover { background: var(--fg-green-bright); }
.fg-btn:active { transform: scale(0.97); }

.fg-btn-ghost {
  background: transparent;
  border: 1px solid rgba(247, 243, 232, 0.35);
  margin-left: 8px;
}

.fg-btn-ghost:hover { background: rgba(247, 243, 232, 0.12); }

/* Empty-flybox demo: a looping "tap the heart on a thumbnail" animation that
   shows new players exactly how to fill their flybox. Purely decorative; the
   cursor, heart-fill and badge are all driven by the one 4s timeline. */
.fg-demo {
  position: relative;
  width: 150px;
  height: 178px;
  margin: 16px auto 6px;
}

.fg-demo-card {
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(6, 7, 40, 0.4);
}

.fg-demo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  background: var(--fg-cream);
}

.fg-demo-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--fg-teal);
}

.fg-demo-heart {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
}

.fg-demo-heart i {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 18px;
  transform: translate(-50%, -50%);
}

.fg-demo-heart-out { color: #6c757d; }

.fg-demo-heart-fill {
  color: var(--fg-pink);
  opacity: 0;
  animation: fg-demo-fill 4s ease-in-out infinite;
}

.fg-demo-badge {
  position: absolute;
  left: 50%;
  bottom: -10px;
  white-space: nowrap;
  font-family: "Questrial", sans-serif;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--fg-green);
  color: #fff;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
  animation: fg-demo-badge 4s ease-in-out infinite;
}

.fg-demo-cursor {
  position: absolute;
  top: 20px;
  left: 110px;
  font-size: 26px;
  color: #fff;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
  pointer-events: none;
  animation: fg-demo-tap 4s ease-in-out infinite;
}

/* Cursor glides up to the heart, presses, then drifts back. */
@keyframes fg-demo-tap {
  0%   { transform: translate(28px, 64px) scale(1); opacity: 0; }
  12%  { opacity: 1; }
  35%  { transform: translate(0, 0) scale(1); }
  44%  { transform: translate(0, 0) scale(0.8); }
  54%  { transform: translate(0, 0) scale(1); }
  80%  { transform: translate(0, 0) scale(1); opacity: 1; }
  94%  { transform: translate(28px, 64px) scale(1); opacity: 0; }
  100% { transform: translate(28px, 64px) scale(1); opacity: 0; }
}

/* Heart fills and pops the moment the cursor presses. */
@keyframes fg-demo-fill {
  0%, 44%   { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  52%       { opacity: 1; transform: translate(-50%, -50%) scale(1.4); }
  60%, 82%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  94%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

@keyframes fg-demo-badge {
  0%, 52%   { opacity: 0; transform: translateX(-50%) translateY(8px); }
  62%, 82%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  94%, 100% { opacity: 0; transform: translateX(-50%) translateY(8px); }
}

/* --- Flybox tray ------------------------------------------------------------ */

.fg-flybox {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--fg-cream) 0%, var(--fg-cream-dim) 100%);
  color: var(--fg-navy);
  animation: fg-rise 0.3s ease;
}

@keyframes fg-rise {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.fg-flybox-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 16px 20px 8px;
  border-bottom: 2px dashed rgba(16, 17, 78, 0.18);
}

.fg-flybox-head h4 {
  margin: 0;
  font-family: "Questrial", sans-serif;
  font-size: 22px;
  color: var(--fg-navy);
}

.fg-flybox-head span { font-size: 12px; color: var(--fg-blue); }

.fg-flybox-close {
  margin-left: auto;
  border: none;
  background: var(--fg-navy);
  color: #fff;
  border-radius: 999px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 14px;
}

.fg-flybox-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  padding: 14px 20px 20px;
}

.fg-flybox-slot {
  border: 1px solid rgba(16, 17, 78, 0.15);
  background: #fff;
  border-radius: 10px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}

.fg-flybox-slot:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(16, 17, 78, 0.18);
  border-color: var(--fg-teal);
}

.fg-flybox-slot.selected { border: 2px solid var(--fg-green); }

.fg-flybox-slot img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  background: #f4f4f4;
}

.fg-flybox-slot .fg-slot-name {
  display: block;
  font-family: "Questrial", sans-serif;
  font-size: 12px;
  line-height: 1.2;
  margin-top: 6px;
  min-height: 28px;
}

.fg-slot-type {
  display: inline-block;
  margin-top: 4px;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--fg-navy);
  color: #fff;
}

.fg-slot-type.dry { background: var(--fg-amber); color: var(--fg-navy); }
.fg-slot-type.nymph { background: var(--fg-green); }
.fg-slot-type.buzzer { background: var(--fg-teal); }
.fg-slot-type.wet { background: var(--fg-blue); }
.fg-slot-type.streamer { background: var(--fg-pink); }
.fg-slot-type.salmon { background: #8a2d52; }
.fg-slot-type.saltwater { background: #0b6e8e; }

/* --- Fight panel ------------------------------------------------------------ */

.fg-fight {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 8;
  width: min(420px, 86%);
  background: rgba(10, 11, 56, 0.85);
  border: 1px solid rgba(247, 243, 232, 0.22);
  border-radius: 14px;
  padding: 14px 18px;
  text-align: center;
  backdrop-filter: blur(4px);
  animation: fg-rise 0.25s ease;
}

.fg-fight h5 {
  margin: 0 0 8px;
  font-family: "Questrial", sans-serif;
  font-size: 19px;
  color: var(--fg-amber);
  letter-spacing: 0.04em;
}

.fg-fight .fg-fight-tip { font-size: 12px; color: rgba(247, 243, 232, 0.75); margin: 8px 0 0; }

.fg-bar {
  height: 14px;
  border-radius: 999px;
  background: rgba(247, 243, 232, 0.15);
  overflow: hidden;
  margin-top: 6px;
  position: relative;
}

.fg-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.08s linear, background 0.2s;
}

.fg-bar-tension .fg-bar-fill { background: var(--fg-green); position: relative; z-index: 1; }
.fg-bar-tension.danger .fg-bar-fill { background: var(--fg-pink); }
.fg-bar-progress .fg-bar-fill { background: var(--fg-teal); }

/* The "keep it here" band on the tension bar: slack to the left of it loses the
   hook, too tight to the right snaps the leader. Edges are marked left (amber)
   and right (pink). */
.fg-safe-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 14%;
  right: 20%;
  z-index: 0;
  background: rgba(141, 185, 78, 0.32);
  box-shadow: inset 2px 0 0 rgba(232, 179, 57, 0.9), inset -2px 0 0 rgba(214, 51, 108, 0.9);
}

.fg-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(247, 243, 232, 0.6);
  margin-top: 8px;
}

.fg-reel-btn {
  width: 100%;
  margin-top: 12px;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-family: "Questrial", sans-serif;
  font-size: 17px;
  background: var(--fg-green);
  color: #fff;
  cursor: pointer;
}

.fg-reel-btn:active { background: var(--fg-green-bright); }

/* --- Leaderboard ------------------------------------------------------------ */

.fg-score-form {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 14px 0 4px;
  flex-wrap: wrap;
}

.fg-score-form input {
  border: 1px solid rgba(247, 243, 232, 0.35);
  background: rgba(6, 7, 40, 0.6);
  color: #fff;
  border-radius: 999px;
  padding: 10px 18px;
  font-family: "Questrial", sans-serif;
  font-size: 15px;
  width: 200px;
  text-align: center;
}

.fg-score-form input:focus { outline: 2px solid var(--fg-teal); border-color: transparent; }

.fg-leaderboard {
  width: 100%;
  margin-top: 14px;
  border-collapse: collapse;
  font-size: 13px;
}

.fg-leaderboard th {
  font-family: "Questrial", sans-serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-amber);
  padding: 6px 8px;
  border-bottom: 1px solid rgba(247, 243, 232, 0.25);
  text-align: left;
}

.fg-leaderboard td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(247, 243, 232, 0.08);
  color: rgba(247, 243, 232, 0.9);
  text-align: left;
}

.fg-leaderboard td.fg-num, .fg-leaderboard th.fg-num { text-align: right; font-variant-numeric: tabular-nums; }

.fg-leaderboard tr.fg-me td {
  color: #fff;
  background: rgba(114, 155, 59, 0.25);
  font-weight: 600;
}

.fg-catch-list {
  font-size: 13px;
  color: rgba(247, 243, 232, 0.85);
  margin: 8px 0 0;
}

/* --- Responsive -------------------------------------------------------------- */

@media (max-width: 640px) {
  .fg-conditions { max-width: 58%; }
  .fg-conditions span { display: none; }
  .fg-stat { min-width: 60px; padding: 4px 8px; }
  .fg-stat b { font-size: 17px; }
  .fg-current-fly { min-width: 0; flex: 1 1 100%; }
  .fg-cast-btn { margin-left: 0; flex: 1 1 auto; }
  .fg-techniques { order: 3; }
  .fg-status { bottom: 160px; font-size: 14px; }
  .fg-fight { bottom: 150px; }
  .fg-overlay { padding: 10px; }
  .fg-overlay-card { padding: 18px 16px; }
}
