:root {
  --bg: #0e1719; --card: #162326; --line: rgba(255,255,255,.1); --text: #e9eff0; --dim: #9db0b4;
  --accent: #e0a040; --accent-ink: #1a1205; --danger: #ff8a7a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); position: relative; isolation: isolate; color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1 { font-size: 30px; margin: 0 0 8px; }
h2 { font-size: 17px; margin: 0 0 6px; }
.dim { color: var(--dim); }
.err, .msg { min-height: 1.5em; margin: 8px 0 0; }
.err { color: var(--danger); }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 18px; color: var(--accent); letter-spacing: .3px; }
.brand-logo { height: 40px; width: auto; display: block; }
nav { display: flex; flex-wrap: wrap; gap: 6px; }
nav button { background: none; border: 1px solid transparent; color: var(--dim); }
nav button[aria-pressed="true"] { color: var(--text); border-color: var(--line); background: var(--card); }
.who { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 13px; }
.who img { width: 26px; height: 26px; border-radius: 50%; }

button, .button, input, select { font: inherit; border-radius: 8px; }
button, .button { background: var(--accent); color: var(--accent-ink); border: 1px solid transparent; padding: 7px 14px; cursor: pointer; font-weight: 600; text-decoration: none; display: inline-block; }
button.quiet { background: none; color: var(--dim); border-color: var(--line); font-weight: 400; padding: 4px 10px; }
button.danger { background: none; color: var(--danger); border-color: var(--danger); }
input, select { background: #0b1214; color: var(--text); border: 1px solid var(--line); padding: 7px 10px; }
input.code { font-size: 22px; letter-spacing: 4px; text-transform: uppercase; width: 190px; text-align: center; }
form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

main { max-width: 1100px; margin: 0 auto; padding: 16px; }
.hero { max-width: 620px; margin: 8vh auto 0; }
.hero p { color: var(--dim); }
#google-button { margin: 18px 0 6px; min-height: 44px; }
#dev-form { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
#dev-form p { width: 100%; margin: 0; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
#map { height: calc(100vh - 110px); min-height: 320px; border-radius: 12px; border: 1px solid var(--line); position: sticky; top: 12px; }
.list { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.card.narrow { max-width: 560px; margin-bottom: 14px; }
.card.danger { border-color: rgba(255,138,122,.35); }
.card.pick { cursor: pointer; }
.card.pick:hover, .card.on { border-color: var(--accent); }
.card .s { color: var(--dim); font-size: 13px; overflow-wrap: anywhere; }
.card .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; font-size: 13px; color: var(--dim); }
.card .row select { padding: 3px 6px; }
.card .row .push { margin-left: auto; }
h2.group { margin: 18px 0 10px; }
h2.group.todo { color: var(--accent); }
.leaflet-popup-content button { margin-top: 8px; padding: 4px 10px; font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.trophy .big { font-size: 28px; font-weight: 700; color: var(--accent); line-height: 1.2; margin: 4px 0; }
.device { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.device:first-child { border-top: 0; }
.device .s { flex: 1; }
.empty { color: var(--dim); padding: 6px 0; }
.small { font-size: 13px; }

/* The skin behind every page: brook trout for freshwater, silver scales for saltwater. */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: center / cover no-repeat url(/art/backdrop_brook.jpg); opacity: .22; }
body.salt::before { background-image: url(/art/backdrop_salt.jpg); opacity: .28; }
body.fresh::before { background-image: url(/art/backdrop_fresh.jpg); opacity: .26; }
.place-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 12px; }
.place-row .push { flex: 1; }
.place-row select { max-width: 220px; }
.card.log.wide { max-width: 1000px; margin: 0 auto 14px; }
.lists-form { display: block; }
.lists-form label { display: block; margin: 8px 0; color: var(--dim); font-size: 13px; }
.lists-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 760px) { .lists-cols { grid-template-columns: 1fr; } }
.lists-form textarea { font: inherit; font-size: 14px !important; line-height: 1.45; background: #0b1214; color: var(--text); border: 1px solid var(--line); border-radius: 8px; }
.places { width: 100%; border-collapse: collapse; font-size: 13px; }
.places td, .places th { text-align: left; padding: 7px 6px; border-top: 1px solid var(--line); vertical-align: top; }
.places th { color: var(--dim); font-weight: 400; }
.places .fish { color: var(--dim); }
.places button { padding: 3px 8px; font-size: 12px; margin: 0 4px 4px 0; }
@media (max-width: 760px) { .places .fish, .places .hide-sm { display: none; } }

/* The species wheel: scroll, swipe or tap; the item in the gold band is chosen. */
.wheel { position: relative; height: 230px; background: rgba(22,35,38,.85); border-radius: 12px; }
.wheel-band { position: absolute; left: 0; right: 0; top: 92px; height: 46px; border: 1px solid rgba(224,160,64,.65);
  background: rgba(224,160,64,.16); border-radius: 10px; pointer-events: none; }
.wheel-list { height: 100%; overflow-y: auto; scroll-snap-type: y mandatory; padding: 92px 0; box-sizing: border-box; scrollbar-width: none; }
.wheel-list::-webkit-scrollbar { display: none; }
.wheel-item { height: 46px; scroll-snap-align: center; display: flex; align-items: center; gap: 10px; padding: 0 14px;
  opacity: .38; cursor: pointer; font-size: 16px; }
.wheel-item.near { opacity: .62; }
.wheel-item.on { opacity: 1; font-weight: 650; font-size: 17px; }
.wheel-item .swatch { flex: none; }
.wheel-item.target::after { content: "★"; color: var(--accent); font-size: 13px; margin-left: 2px; }
/* Today's fish: a summary on Home, and the tick list to choose them. */
.card.today { display: block; width: 100%; text-align: left; cursor: pointer; margin-bottom: 14px; color: var(--text); font: inherit; }
.today-head { display: flex; justify-content: space-between; align-items: baseline; }
.today-list { display: block; margin-top: 4px; }
.pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.pick button { background: rgba(0,0,0,.25); color: var(--text); border: 1px solid var(--line); font-weight: 500; }
.pick button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 650; }
.pick button[aria-pressed="true"]::before { content: "✓ "; }

/* Home: season summary and insights */
.home-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.chips { display: flex; gap: 6px; }
.chips button { background: rgba(0,0,0,.25); color: var(--text); border: 1px solid var(--line); font-weight: 600; }
.chips button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.home-log { margin-left: auto; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.tile .v { font-size: 30px; font-weight: 650; line-height: 1.15; }
.tile .k { color: var(--dim); font-size: 13px; }
.biggest { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0; padding: 0; overflow: hidden; margin-bottom: 14px; }
.biggest img { width: 100%; height: 240px; object-fit: cover; display: block; }
.biggest .body { padding: 18px 20px; display: flex; flex-direction: column; justify-content: center; }
.biggest .tag { color: var(--accent); font-weight: 600; font-size: 13px; }
.biggest .size { font-size: 44px; font-weight: 650; line-height: 1.1; }
.biggest .species { font-size: 20px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.home-grid .card h2 { margin-bottom: 12px; }
.bar-row { display: grid; grid-template-columns: 26px minmax(80px, 140px) minmax(0, 1fr); align-items: center; gap: 10px; margin: 8px 0; }
.bar-row.plain { grid-template-columns: minmax(80px, 140px) minmax(0, 1fr); }
.swatch { width: 24px; height: 24px; border-radius: 50%; background: var(--line) center / cover; }
.bar-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar { height: 12px; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 4px; }
.bar-n { font-size: 13px; }
.months svg { width: 100%; height: 150px; display: block; overflow: visible; }
.months .col { fill: var(--accent); opacity: .7; cursor: pointer; }
.months .col.on { opacity: 1; }
.months .axis { stroke: rgba(255,255,255,.18); stroke-width: 1; }
.months .lbl { fill: var(--dim); font-size: 11px; text-anchor: middle; }
.months details { margin-top: 8px; color: var(--dim); font-size: 13px; }
.months table { border-collapse: collapse; margin-top: 6px; }
.months td, .months th { padding: 2px 12px 2px 0; text-align: left; font-weight: 400; }
.insights { list-style: none; margin: 0; padding: 0; }
.insights li { padding: 8px 0 8px 26px; border-top: 1px solid var(--line); position: relative; }
.insights li:first-child { border-top: 0; }
.insights li::before { content: ""; position: absolute; left: 4px; top: 15px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.flies li { display: flex; gap: 12px; padding: 6px 0; }
.flies .rank { color: var(--accent); font-weight: 700; width: 18px; }
.flies .name { flex: 1; }
.span2 { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .biggest, .home-grid { grid-template-columns: 1fr; }
  .home-log { margin-left: 0; width: 100%; }
}
.hero-logo { display: block; width: min(420px, 100%); height: auto; margin: 0 0 12px -6px; }

/* Log a catch */
button.big { display: block; width: 100%; font-size: 17px; padding: 13px 16px; border-radius: 12px; margin-bottom: 14px; }
.log { display: block; max-width: 640px; margin: 0 auto; }
.log-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.field { margin: 14px 0; }
.label { display: block; font-size: 13px; color: var(--dim); margin-bottom: 6px; }
.log input:not([type=file]), .log textarea { width: 100%; font-size: 16px; padding: 10px 12px; }
.log textarea { resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.unit-row { display: flex; gap: 6px; }
.unit-row input { min-width: 0; }
button.unit { background: var(--card); color: var(--text); border: 1px solid var(--line); min-width: 52px; font-weight: 600; }
.species { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
button.sp { height: 64px; border-radius: 12px; border: 2px solid transparent; background: var(--card) center / cover no-repeat;
  color: #fff; font-size: 16px; font-weight: 700; position: relative; overflow: hidden; padding: 0; }
button.sp span { position: relative; text-shadow: 0 1px 3px rgba(0,0,0,.9); }
button.sp::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,.1)); }
button.sp.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.where-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
#log-map { height: 240px; border-radius: 12px; border: 1px solid var(--line); }
.seg { display: flex; gap: 8px; }
.seg button { flex: 1; background: var(--card); color: var(--text); border: 1px solid var(--line); font-weight: 600; padding: 10px; }
.seg button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; background: #0b1214; }
.thumb { position: relative; display: block; }
.thumb a { display: block; }
.thumb-del { position: absolute; top: 3px; right: 3px; min-height: 0; padding: 2px 7px; font-size: 12px; line-height: 1.4;
  border-radius: 999px; background: rgba(0,0,0,.65); color: #fff; border: 1px solid rgba(255,255,255,.35); }
.thumb-del.armed { background: #b3412f; border-color: #b3412f; }
.photo { padding: 0; overflow: hidden; }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: #0b1214; }
.photo .body { padding: 10px 12px 12px; }
.photo select { width: 100%; margin-top: 6px; }
.photo .row { margin-top: 8px; }
.trophy img { width: calc(100% + 32px); margin: -14px -16px 10px; aspect-ratio: 16 / 10; object-fit: cover; display: block; border-radius: 12px 12px 0 0; background: #0b1214; }
[data-view="photos"] > .card { margin-bottom: 14px; }

@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; }
  #map { height: 300px; position: static; order: -1; }
  .who { margin-left: 0; }
}

/* Home: how many fish got away in the period shown. */
.lost-note { margin: -4px 0 14px; }
