/* ============================================================
   Tacklebot — deep-water instrument theme
   ============================================================ */
:root {
  --ink: #0A1E24;
  --screen-top: #17414c;
  --screen-bot: #0d262d;
  --accent: #C4EE4B;       /* hi-vis chartreuse */
  --accent-deep: #8fb92f;
  --amber: #F5A623;
  --amber-deep: #d98a0c;
  --good: #6fd08c;
  --bad: #ff8a7a;

  --fg: #eaf3ef;
  --fg-dim: rgba(234,243,239,.62);
  --fg-faint: rgba(234,243,239,.42);
  --panel: rgba(255,255,255,.045);
  --panel-2: rgba(255,255,255,.07);
  --line: rgba(255,255,255,.09);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Roboto Mono", ui-monospace, Menlo, Consolas, monospace;
  --display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--fg);
  background: linear-gradient(180deg, var(--screen-top), var(--screen-bot)) fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  overflow: hidden;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
}
.app::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background:
    radial-gradient(80% 30% at 20% 0%, rgba(196,238,75,.10), transparent 55%),
    radial-gradient(90% 40% at 100% 4%, rgba(245,166,35,.10), transparent 60%);
}

/* ---------- Header ---------- */
.apphead {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 20px 12px;
}
.brand { font-family: var(--display); font-size: 23px; font-weight: 700; letter-spacing: -.03em;
  display: flex; align-items: center; gap: 9px; }
.brand span { color: var(--accent); }
.brand-fish { width: 30px; height: 30px; flex: none; color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(196,238,75,.35)); }

/* display font on headline elements for a technical, cohesive feel */
h2, .premium-gate h3, .pg-badge, .bite .t b, .target .b, .rec .nm, .g .val {
  font-family: var(--display); letter-spacing: -.02em;
}
.loc { font-family: var(--mono); font-size: 11px; color: var(--fg-dim); letter-spacing: .02em; margin-top: 2px; }
.refresh {
  width: 40px; height: 40px; flex: none; border-radius: 12px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); color: var(--fg);
  display: grid; place-items: center;
}
.refresh svg { width: 20px; height: 20px; }
.refresh.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Views ---------- */
.views { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 16px 12px; -webkit-overflow-scrolling: touch; }
.view { display: none; }
.view.active { display: block; animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view.active { animation: none; } }

.sect {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(196,238,75,.85); margin: 16px 4px 10px; display: flex; justify-content: space-between;
}
.sect .c { color: var(--fg-faint); }

/* ---------- Lures grid ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.lure {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px; position: relative; overflow: hidden; cursor: pointer; text-align: left;
}
.lure:active { transform: scale(.98); }
.lure .art {
  height: 82px; border-radius: 11px; margin-bottom: 8px; overflow: hidden;
  background: rgba(0,0,0,.22); display: grid; place-items: center;
}
.lure .art img { width: 100%; height: 100%; object-fit: cover; }
.lure .art .ph { color: var(--fg-faint); font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.lure .nm { font-size: 12.5px; font-weight: 700; line-height: 1.2; }
.lure .mt { font-family: var(--mono); font-size: 10px; color: var(--fg-dim); margin-top: 3px; letter-spacing: .02em; }
.lure .swatch { position: absolute; top: 10px; right: 10px; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); }
.sw-natural { background: #6a8a3f; }
.sw-bright  { background: var(--accent); }
.sw-dark    { background: #2b3550; }
.sw-flash   { background: linear-gradient(135deg,#e6edf0,#9fb0b6); }

.addcard {
  width: 100%; margin-top: 11px; border: 1px dashed rgba(255,255,255,.2); border-radius: 16px;
  padding: 16px; display: flex; align-items: center; gap: 12px; color: var(--fg-dim);
  font-size: 13px; background: rgba(255,255,255,.02); cursor: pointer; text-align: left;
}
.addcard .plus { width: 34px; height: 34px; border-radius: 10px; background: rgba(196,238,75,.14); color: var(--accent); display: grid; place-items: center; font-size: 22px; flex: none; }
.addcard b { color: var(--fg); font-weight: 700; display: block; font-size: 13px; }
.addcard small { color: var(--fg-faint); font-size: 11px; }
.empty-hint { color: var(--fg-dim); font-size: 13px; text-align: center; margin: 22px 8px; line-height: 1.5; }

/* ---------- Conditions ---------- */
.locrow { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.locrow .pin { width: 34px; height: 34px; border-radius: 11px; background: rgba(245,166,35,.15); color: var(--amber); display: grid; place-items: center; flex: none; }
.locrow .pin svg { width: 20px; height: 20px; }
.locrow .n { font-weight: 700; font-size: 14px; }
.locrow .s { font-family: var(--mono); font-size: 10.5px; color: var(--fg-dim); letter-spacing: .03em; }
.lakeselect {
  background: var(--panel-2); color: var(--fg); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px; font-size: 12px; max-width: 42%;
}

.bite {
  margin-top: 11px; border-radius: 16px; padding: 15px;
  background: linear-gradient(120deg, rgba(245,166,35,.18), rgba(196,238,75,.14));
  border: 1px solid rgba(245,166,35,.3); display: flex; align-items: center; gap: 14px;
}
.bite .score { font-size: 34px; font-weight: 800; color: var(--amber); font-variant-numeric: tabular-nums; line-height: 1; min-width: 52px; text-align: center; }
.bite .t b { display: block; font-size: 14px; }
.bite .t small { font-size: 11.5px; color: var(--fg-dim); }

.gauges { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 11px; }
.g { background: var(--panel); border: 1px solid var(--line); border-radius: 15px; padding: 12px 13px; }
.g .lab { font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--fg-faint); }
.g .val { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-top: 5px; font-variant-numeric: tabular-nums; }
.g .val small { font-size: 12px; font-weight: 600; color: var(--fg-dim); letter-spacing: 0; }
.g .sub { font-family: var(--mono); font-size: 10px; margin-top: 3px; letter-spacing: .02em; color: var(--fg-dim); }
.g .sub.down { color: var(--amber); }
.g .sub.up { color: var(--good); }
.g .sub.good { color: var(--accent); }
.g .sub.warn { color: var(--bad); }

/* species chips */
.species { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font-size: 11.5px; padding: 7px 12px; border-radius: 20px; font-weight: 600;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--fg); cursor: pointer; transition: all .16s;
}
.chip.on { background: var(--accent); color: #12300f; border-color: var(--accent); }
.species .loading { color: var(--fg-faint); font-size: 12px; font-family: var(--mono); }

/* manual water inputs */
.manual { display: flex; flex-direction: column; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.mrow label, .mlabel { font-size: 12.5px; color: var(--fg-dim); display: flex; justify-content: space-between; margin-bottom: 8px; }
.mrow label b, .mlabel b { color: var(--fg); font-weight: 700; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.seg { display: grid; grid-auto-flow: column; gap: 6px; }
.seg button {
  padding: 9px 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2);
  color: var(--fg-dim); font-size: 12px; font-weight: 600; cursor: pointer; font-family: var(--sans);
}
.seg button.on { background: var(--accent); color: #12300f; border-color: var(--accent); }

/* ---------- Match ---------- */
.match-eq {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 11px 12px; margin-top: 14px;
}
.match-eq .eq-in { display: inline-flex; align-items: center; gap: 5px; color: var(--fg-dim); font-size: 12.5px; font-weight: 600; }
.match-eq .eq-in svg { width: 16px; height: 16px; }
.match-eq .eq-op { color: var(--fg-faint); font-weight: 800; font-size: 15px; }
.match-eq .eq-out { display: inline-flex; align-items: center; gap: 5px; background: var(--accent);
  color: #12300f; font-weight: 800; font-size: 12.5px; padding: 6px 11px; border-radius: 20px;
  box-shadow: 0 6px 16px -6px rgba(196,238,75,.6); }
.match-eq .eq-out svg { width: 17px; height: 17px; }

.target {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(196,238,75,.1); border: 1px solid rgba(196,238,75,.25); border-radius: 16px; padding: 12px 15px;
}
.target .l { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-dim); }
.target .b { font-size: 16px; font-weight: 800; color: var(--accent); margin-top: 2px; }
.target .why { text-align: right; font-size: 10.5px; color: var(--fg-dim); max-width: 50%; line-height: 1.35; }

.rec { background: var(--panel); border: 1px solid var(--line); border-radius: 17px; padding: 13px; margin-top: 10px; display: flex; gap: 12px; align-items: flex-start; }
.rec.top { border-color: rgba(196,238,75,.4); background: rgba(196,238,75,.07); }
.rec .art { width: 60px; height: 60px; flex: none; border-radius: 12px; background: rgba(0,0,0,.22); display: grid; place-items: center; overflow: hidden; }
.rec .art img { width: 100%; height: 100%; object-fit: cover; }
.rec .art .ph { font-size: 9px; color: var(--fg-faint); font-family: var(--mono); }
.rec .body { flex: 1; min-width: 0; }
.rec .rnk { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--fg-faint); text-transform: uppercase; }
.rec .rnk .own { color: var(--accent); }
.rec .nm { font-size: 14px; font-weight: 800; margin-top: 2px; }
.rec .rz { font-size: 11.5px; color: var(--fg-dim); margin-top: 5px; line-height: 1.35; }
.meter { height: 6px; border-radius: 6px; background: rgba(255,255,255,.1); margin-top: 9px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); }
.rec .pct { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--accent); float: right; margin-left: 8px; }

.buy { margin-top: 12px; border-radius: 17px; padding: 15px; background: linear-gradient(135deg, rgba(245,166,35,.16), rgba(245,166,35,.05)); border: 1px solid rgba(245,166,35,.3); }
.buy .flag { font-family: var(--mono); font-size: 9.5px; letter-spacing: .15em; text-transform: uppercase; color: var(--amber); display: flex; align-items: center; gap: 6px; }
.buy .gap { font-size: 13px; font-weight: 700; margin-top: 8px; line-height: 1.4; }
.buy .gap span { color: var(--amber); }
.buy .prod { display: flex; align-items: center; gap: 11px; margin-top: 12px; }
.buy .pn { font-size: 12.5px; font-weight: 700; line-height: 1.2; }
.buy .pm { font-family: var(--mono); font-size: 10.5px; color: var(--fg-dim); margin-top: 3px; }
.buy .btn-amz { margin-top: 13px; width: 100%; border: none; cursor: pointer; background: var(--amber); color: #3a2400; font-weight: 800; font-size: 13px; padding: 12px; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.buy .disc { font-family: var(--mono); font-size: 9px; color: var(--fg-faint); margin-top: 9px; text-align: center; letter-spacing: .03em; }

.notice { color: var(--fg-dim); font-size: 12.5px; text-align: center; margin: 24px 10px; line-height: 1.5; }

/* ---------- Catch log + Tacklebot+ ---------- */
.plus-tag { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 5px;
  background: var(--accent); color: #12300f; font-weight: 800; font-size: 11px; vertical-align: middle; }

.premium-gate { background: var(--panel); border: 1px solid rgba(196,238,75,.22); border-radius: 20px; padding: 22px 20px; margin-top: 16px;
  background-image: radial-gradient(120% 80% at 100% 0%, rgba(196,238,75,.1), transparent 55%); }
.pg-badge { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.pg-badge span { color: var(--accent); }
.premium-gate h3 { font-size: 20px; line-height: 1.15; margin: 12px 0 8px; letter-spacing: -.02em; }
.premium-gate p { color: var(--fg-dim); font-size: 13px; margin: 0 0 14px; }
.premium-gate em { color: var(--accent); font-style: normal; }
.pg-feats { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 9px; }
.pg-feats li { font-size: 13px; color: var(--fg); background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; }
.pg-price { display: flex; align-items: baseline; gap: 4px; margin-bottom: 14px; }
.pg-price b { font-size: 30px; font-weight: 800; }
.pg-price span { color: var(--fg-dim); font-size: 13px; font-family: var(--mono); }
.pg-fine { text-align: center; font-family: var(--mono); font-size: 10px; color: var(--fg-faint); margin: 10px 0 0; }

.catch { background: var(--panel); border: 1px solid var(--line); border-radius: 15px; padding: 13px; margin-top: 10px; position: relative; }
.catch .top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.catch .sp { font-size: 15px; font-weight: 800; }
.catch .sz { font-family: var(--mono); font-size: 12px; color: var(--accent); font-variant-numeric: tabular-nums; }
.catch .lure { font-size: 12.5px; color: var(--fg-dim); margin-top: 3px; }
.catch .lure b { color: var(--fg); font-weight: 700; }
.catch .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.catch .m { font-family: var(--mono); font-size: 10px; letter-spacing: .02em; color: var(--fg-dim); background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 16px; padding: 4px 8px; }
.catch .note { font-size: 12px; color: var(--fg-dim); margin-top: 9px; font-style: italic; }
.catch .del { position: absolute; top: 10px; right: 10px; background: none; border: none; color: var(--fg-faint); font-size: 18px; cursor: pointer; line-height: 1; padding: 2px 6px; }
.catch-context { font-family: var(--mono); font-size: 11px; color: var(--accent-deep); background: rgba(196,238,75,.08); border: 1px solid rgba(196,238,75,.2); border-radius: 10px; padding: 9px 11px; margin-bottom: 14px; }

/* ---------- Tab bar ---------- */
.tabs {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(7,20,24,.8); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
}
.tab {
  position: relative;
  background: none; border: none; cursor: pointer; color: var(--fg-faint);
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 6px 0;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .09em; text-transform: uppercase; font-weight: 600; transition: color .2s;
}
.tab svg { width: 22px; height: 22px; }
.tab.on { color: var(--accent); }

/* Match = the hero action: raised, filled, glowing */
.tab.hero {
  background: linear-gradient(160deg, #d9ff63, var(--accent));
  color: #10240a; font-weight: 800; border-radius: 16px;
  transform: translateY(-9px); padding: 11px 4px 9px; gap: 4px;
  box-shadow: 0 12px 24px -8px rgba(196,238,75,.65), 0 2px 0 rgba(0,0,0,.25);
}
.tab.hero svg { width: 25px; height: 25px; }
.tab.hero.on { box-shadow: 0 14px 28px -8px rgba(196,238,75,.85), 0 0 0 3px rgba(196,238,75,.28); }
@media (prefers-reduced-motion: no-preference) {
  .tab.hero { animation: heroFloat 3.2s ease-in-out infinite; }
  @keyframes heroFloat { 0%,100% { transform: translateY(-9px); } 50% { transform: translateY(-12px); } }
}

/* Log = locked paywall: greyed with a lock badge (still tappable → upsell) */
.tab.locked { opacity: .42; }
.tab.locked:active { opacity: .6; }
.tab-lock { position: absolute; top: 2px; left: calc(50% + 7px); font-size: 11px; line-height: 1; }
.tab:not(.locked) .tab-lock { display: none; }

/* ---------- Add/Edit sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(3,10,12,.6); z-index: 40; animation: fade .2s; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-width: 520px; margin: 0 auto;
  background: #0e2a31; border: 1px solid var(--line); border-bottom: none;
  border-radius: 24px 24px 0 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  max-height: 92dvh; overflow-y: auto;
  animation: slideup .28s cubic-bezier(.2,.8,.2,1);
}
@keyframes slideup { from { transform: translateY(100%); } to { transform: none; } }
.sheet-grip { width: 42px; height: 5px; border-radius: 5px; background: rgba(255,255,255,.25); margin: 4px auto 10px; }
.sheet h2 { font-size: 18px; margin: 0 0 14px; letter-spacing: -.01em; }

.photo-btn { display: block; cursor: pointer; margin-bottom: 14px; }
.photo-preview {
  height: 150px; border-radius: 14px; border: 1px dashed rgba(255,255,255,.2);
  background: rgba(0,0,0,.2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--fg-dim); font-size: 12px; overflow: hidden;
}
.photo-preview svg { width: 30px; height: 30px; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }

/* AI identify status */
.ai-status { font-size: 12px; margin: -6px 0 12px; padding: 8px 11px; border-radius: 10px; font-weight: 600;
  background: rgba(196,238,75,.1); border: 1px solid rgba(196,238,75,.22); color: var(--accent); }
.ai-status.busy { background: rgba(245,166,35,.12); border-color: rgba(245,166,35,.28); color: var(--amber); }
.ai-status.busy::after { content: ""; }
.ai-status.err { background: rgba(255,138,122,.1); border-color: rgba(255,138,122,.25); color: var(--bad); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
.ai-status.busy { animation: pulse 1.1s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .ai-status.busy { animation: none; } }

.fld { display: block; margin-bottom: 12px; }
.fld > span { display: block; font-size: 12px; color: var(--fg-dim); margin-bottom: 6px; }
.fld > span small { color: var(--fg-faint); }
.fld input, .fld select {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line); color: var(--fg);
  border-radius: 11px; padding: 12px; font-size: 15px; font-family: var(--sans);
}
.fld input:focus, .fld select:focus { outline: 2px solid var(--accent-deep); outline-offset: 1px; }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg.colors { grid-auto-flow: column; }

.sheet-actions { display: flex; gap: 10px; margin-top: 18px; }
.btn { flex: 1; padding: 13px; border-radius: 12px; font-size: 14px; font-weight: 700; cursor: pointer; border: 1px solid var(--line); font-family: var(--sans); }
.btn.primary { background: var(--accent); color: #12300f; border-color: var(--accent); flex: 2; }
.btn.ghost { background: transparent; color: var(--fg-dim); }
.btn.ghost#deleteLure { color: var(--bad); border-color: rgba(255,138,122,.4); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #14343d; border: 1px solid var(--line); color: var(--fg); z-index: 50;
  padding: 11px 18px; border-radius: 12px; font-size: 13px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.4);
  animation: fade .2s;
}

.views::-webkit-scrollbar, .sheet::-webkit-scrollbar { width: 0; }
