/* Phase 2 screens: tab bar, log flow, catch cards, reveal, Me. Tokens live in application.css. */

.app { padding-bottom: 110px; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.screen-head h1 { font-size: 34px; font-weight: 800; line-height: 1.05; }
.hint { font-size: 12px; color: var(--ink-3); margin: 4px 0 0; }
.live-dot { color: #e2442a; font-weight: 800; }
.live-banner { display: block; text-decoration: none; color: var(--ink); }
.logo { display: flex; align-items: center; gap: 6px; }
.logo-fish { width: 34px; height: 14px; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--olive); transition: width 1s cubic-bezier(.2,.8,.2,1); }
.empty { text-align: center; padding: 28px 16px; border: 1.5px dashed var(--line); border-radius: 22px; display: grid; gap: 12px; justify-items: center; }

/* Avatars with rank ring */
.av { --size: 38px; width: var(--size); height: var(--size); border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--spot); color: #1d2416; font-weight: 800; font-size: calc(var(--size) * .36);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--rk, var(--line)); }

/* Tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  max-width: 430px; margin: 0 auto; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); padding: 6px var(--gut-r) calc(10px + env(safe-area-inset-bottom, 0px)) var(--gut-l); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 48px; justify-content: center;
  font-size: 11px; font-weight: 600; color: var(--ink-3); text-decoration: none; }
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tab.on { color: var(--ink); }
.tab.off { opacity: .4; }
.tab.log .plus { width: 56px; height: 56px; border-radius: 18px; background: var(--fin); color: var(--fin-ink); display: grid; place-items: center;
  margin-top: -26px; transform: rotate(-4deg); box-shadow: 0 8px 20px color-mix(in srgb, var(--fin) 45%, transparent); }
.tab.log .plus svg { width: 28px; height: 28px; }
.tab.log.live .plus { background: #e2442a; }

/* Forms: chips, fields, toggles */
.log-form { display: grid; gap: 16px; }
.field { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; }
.field legend, .field > label { font-weight: 700; font-size: 13px; padding: 0; margin-bottom: 8px; }
.field input[type=number], .field input[type=date], .field input[type=time] { min-height: 48px; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; width: 100%; }
.row3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }
.row3 label { display: grid; gap: 4px; font-size: 12px; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; align-items: center; min-height: 42px; padding: 0 14px; border-radius: 12px;
  background: var(--surface-2); font-weight: 600; font-size: 14px; border: 1.5px solid transparent; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { border-color: var(--ink); background: var(--surface); }
.chip:has(input:focus-visible) { outline: 2px solid var(--fin); outline-offset: 2px; }
.hero-water { border-radius: 24px; padding: 20px; background: linear-gradient(160deg, #2f4e3f, #13261f); color: #eef0e0; }
.hero-water h2 { font-size: 26px; line-height: 1.1; }
.hero-water p { color: #c7d6a4; margin: 8px 0 14px; }
.hero-water .chip { background: rgba(255,255,255,.12); color: #fff; }
.hero-water .chip:has(input:checked) { background: var(--fin); color: var(--fin-ink); border-color: transparent; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); }
.switch { appearance: none; width: 50px; height: 30px; border-radius: 15px; background: var(--line); position: relative; cursor: pointer; flex-shrink: 0; transition: background .15s; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch:checked { background: var(--good); }
.switch:checked::after { transform: translateX(20px); }
.photo { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; border: 1.5px dashed var(--line); background: var(--surface); cursor: pointer; }
.photo input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.photo.done { border-style: solid; border-color: var(--good); }
.cam { width: 46px; height: 46px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; flex-shrink: 0; }
.cam svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; }
.photo.done .cam { background: var(--good); color: #fff; }
.lenread { display: flex; align-items: baseline; gap: 10px; }
.lenread .v { font-family: var(--f-display); font-weight: 800; font-size: 52px; line-height: 1; letter-spacing: -.04em; }
.rar { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 4px 8px; border-radius: 7px; color: #fff; background: var(--rc, var(--r-common)); }
input[type=range] { width: 100%; accent-color: var(--fin); height: 32px; }
.ruler { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 10px; color: var(--ink-3); }

/* Session screen */
.counters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.counter-form { display: contents; }
.counter { width: 100%; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); padding: 14px; text-align: left;
  display: flex; flex-direction: column; gap: 4px; min-height: 112px; color: var(--ink); font: inherit; cursor: pointer; }
.counter:active { transform: scale(.97); }
.counter .n { font-family: var(--f-display); font-weight: 800; font-size: 44px; line-height: 1; }
.counter .l { font-weight: 700; }
.counter small { color: var(--ink-3); }
.landed { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 84px; padding: 14px 18px; border-radius: 20px;
  background: var(--fin); color: var(--fin-ink); text-decoration: none; }
.landed b { display: block; font-family: var(--f-display); font-size: 28px; font-weight: 800; }
.landed small { opacity: .85; }
.landed .landed-fish { width: 90px; height: 28px; --pbody: #fff7ee; --pspot: var(--fin); --pfin: #fff7ee; --pbelly: #fff7ee; }

/* Rarity tokens */
.rarity-common { --rc: var(--r-common); }
.rarity-uncommon { --rc: var(--r-uncommon); }
.rarity-rare { --rc: var(--r-rare); }
.rarity-epic { --rc: var(--r-epic); }
.rarity-legendary { --rc: var(--r-legend); }

/* Catch card */
.card { position: relative; aspect-ratio: 4 / 4.6; border-radius: 22px; overflow: hidden; color: #fff; }
.card .art { position: absolute; inset: 0; background: linear-gradient(165deg, #3a5d4a, #10221a); display: grid; place-items: center; overflow: hidden; isolation: isolate; }
.card .art::before { content: ""; position: absolute; inset: -20%; background: repeating-radial-gradient(ellipse at 30% 120%, rgba(255,255,255,.07) 0 2px, transparent 3px 26px); }
.card .art .card-photo { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; display: block; }
.card .fish { position: relative; transform: rotate(-8deg); filter: drop-shadow(0 14px 14px rgba(0,0,0,.45)); }
.card .frame { position: absolute; inset: 0; border-radius: inherit; border: 4px solid var(--rc); pointer-events: none; }
.card .frame.dashed { border-style: dashed; }
.card .tags { position: absolute; left: 12px; top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 4px 8px; border-radius: 7px; background: var(--rc); color: #fff; }
.tag.foil { background: linear-gradient(110deg, #f7e7a0, #fff, #e9c75b, #fff6cf); color: #4a3604; }
.card .len { position: absolute; left: 14px; bottom: 10px; font-family: var(--f-display); font-weight: 800; font-size: 46px; line-height: .9; letter-spacing: -.04em; text-shadow: 0 2px 12px rgba(0,0,0,.35); }
.card .len small { font-size: 18px; margin-left: 2px; }
.card .meta { position: absolute; right: 14px; bottom: 14px; text-align: right; color: #dfe8cf; font-size: 11px; line-height: 1.4; }
.card.rarity-legendary .art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,236,170,.3) 45%, transparent 60%);
  background-size: 250% 100%; animation: shine 3.2s linear infinite; }
@keyframes shine { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.card.mini { aspect-ratio: 3 / 4; border-radius: 12px; }
.card.mini .frame { border-width: 3px; }
.card.mini .len { font-size: 22px; left: 8px; bottom: 6px; }
.card.mini .len small { font-size: 11px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.grid a { display: block; }
.card.blank .blankart { position: absolute; inset: 0; background: linear-gradient(165deg, #4b5a52, #1d2622); display: grid; place-content: center; gap: 12px; text-align: center; }
.blankart .big { font-family: var(--f-display); font-weight: 800; font-size: 40px; }
.stats3 { display: flex; gap: 18px; font-size: 11px; color: #b9c6ae; text-transform: uppercase; letter-spacing: .06em; }
.stats3 div { display: grid; }
.stats3 b { font-family: var(--f-mono); font-size: 20px; color: #fff; text-transform: none; letter-spacing: 0; }

/* Reveal */
.reveal { display: grid; justify-items: center; gap: 12px; margin: -12px calc(-1 * var(--gut-r)) -110px calc(-1 * var(--gut-l));
  padding: 24px var(--gut-r) 40px var(--gut-l); min-height: 100dvh; color: #eef0e0;
  background: radial-gradient(circle at 50% 30%, #2b4434, #0b130e 70%); }
.reveal .eyebrow { color: #a9bb92; }
.reveal h1 { font-size: 30px; text-align: center; }
.flip { width: min(260px, 68vw); perspective: 1000px; }
.flip-in { position: relative; aspect-ratio: 4 / 4.6; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.3,1.4,.4,1); }
.flip.go .flip-in { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; border-radius: 22px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.face .card { height: 100%; aspect-ratio: auto; }
.back { background: repeating-linear-gradient(45deg, #2a3d24 0 10px, #22331d 10px 20px); display: grid; place-items: center; border: 4px solid #4a6a3b; }
.back .logo { color: var(--spot); font-size: 30px; }
.front { transform: rotateY(180deg); }
.xplines { list-style: none; padding: 0; margin: 4px 0 0; width: 100%; max-width: 340px; display: grid; gap: 6px; }
.xplines li { display: flex; justify-content: space-between; color: #c9d4bb; opacity: 0; transform: translateY(6px); transition: all .25s; }
.xplines li.on { opacity: 1; transform: none; }
.xplines b { font-family: var(--f-mono); color: var(--spot); font-weight: 500; }
.xptotal { display: flex; justify-content: space-between; align-items: baseline; width: 100%; max-width: 340px; margin: 0; padding-top: 10px; border-top: 1px solid #3c5236; }
.xptotal b { font-family: var(--f-display); font-size: 38px; font-weight: 800; color: var(--fin); }
.lvl { width: 100%; max-width: 340px; }
.lvl p { display: flex; justify-content: space-between; font-size: 12px; color: #a9bb92; margin: 0; }
.lvl .bar { background: #2c3f28; }
.lvl .bar i { background: linear-gradient(90deg, #9cc06a, #efe2a2); }
.unlock { width: 100%; max-width: 340px; display: grid; padding: 10px 14px; border-radius: 14px; background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12); opacity: 0; transform: scale(.94); transition: all .3s; }
.unlock.on { opacity: 1; transform: none; }
.unlock small { color: #a9bb92; }
.reveal .btn { max-width: 340px; }

/* Me */
.me-head { display: flex; gap: 14px; align-items: center; }
.me-head h1 { font-size: 28px; }
.me-av { padding: 4px; border-radius: 50%; background: conic-gradient(var(--rk) var(--p), var(--surface-2) 0); }
.me-av .av { box-shadow: 0 0 0 3px var(--bg); }
.statrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.statrow .stat { background: var(--surface); border: 1px solid var(--line); }
.seg { display: flex; gap: 6px; }
.seg a { padding: 8px 14px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); font-weight: 600; font-size: 13px; text-decoration: none; }
.seg a.on { background: var(--ink); color: var(--bg); }
.journal { list-style: none; padding: 0; margin: 0; }
.journal a { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-weight: 400; }
.journal small { display: block; color: var(--ink-3); }
.jdate { text-align: center; font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); line-height: 1.2; }
.jdate b { display: block; font-family: var(--f-display); font-size: 20px; color: var(--ink); }
.xpchip { font-family: var(--f-mono); font-size: 12px; color: var(--olive); background: color-mix(in srgb, var(--olive) 14%, transparent); padding: 4px 8px; border-radius: 8px; }
.pill { font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); }
.cond { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cond div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.cond small { display: block; color: var(--ink-3); font-size: 11px; }
.xprow { display: flex; justify-content: space-between; margin: 0; padding: 6px 0; border-bottom: 1px solid var(--line); }
.xprow.total { border: 0; font-weight: 700; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Encounter list under the counters */
.enc-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.enc-list li + li { border-top: 1px solid var(--line); }
.enc-list summary { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; list-style: none; min-height: 44px; }
.enc-list summary::-webkit-details-marker { display: none; }
.enc-kind { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 7px; background: var(--surface-2); }
.enc-follow { color: var(--olive); }
.enc-strike { color: var(--fin); }
.enc-lure { flex: 1; min-width: 0; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.enc-edit { font-size: 12px; font-weight: 700; color: var(--fin); }
details[open] .enc-edit { visibility: hidden; }
.enc-form { display: grid; gap: 10px; padding: 0 14px 10px; }
.enc-row { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; }
.enc-row label { display: grid; gap: 4px; font-size: 12px; color: var(--ink-2); }
.enc-row input { min-height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: inherit; min-width: 0; }
.enc-delete { padding: 0 14px 12px; }
