:root {
  --bg: #f3f7f8; --card: #ffffff; --ink: #0f2430; --muted: #5a7180; --line: #dbe6ea;
  --lake: #0b4f6c; --lake-2: #0e6d8f; --sun: #ff7a1a; --sun-2: #ffb020; --good: #1f9d55; --fair: #d99a00; --slow: #7d8f9b; --hot: #e8461e;
  --chip: #e8f1f4; --shadow: 0 1px 2px rgba(10,40,55,.06), 0 6px 18px rgba(10,40,55,.07);
  --r: 18px; --tabh: 72px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", var(--font);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #071a22; --card: #0e2631; --ink: #e9f3f6; --muted: #93aab6; --line: #1d3a47; --chip: #143341;
    --lake: #0a3f57; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 20px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #071a22; --card: #0e2631; --ink: #e9f3f6; --muted: #93aab6; --line: #1d3a47; --chip: #143341;
  --lake: #0a3f57; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 20px rgba(0,0,0,.25); color-scheme: dark;
}
* { box-sizing: border-box; }
html { touch-action: manipulation; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--font); -webkit-text-size-adjust: 100%; }
body { padding-bottom: calc(var(--tabh) + env(safe-area-inset-bottom)); overflow-x: hidden; }
a { color: var(--lake-2); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: 28px; font-weight: 800; } h2 { font-size: 21px; font-weight: 800; } h3 { font-size: 17px; font-weight: 600; }
.muted { color: var(--muted); } .small { font-size: 14px; } .tiny { font-size: 12.5px; }
[hidden] { display: none !important; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: linear-gradient(135deg, var(--lake) 0%, #0d6a8a 100%); color: #fff; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 800; font-size: 20px; flex: 1; min-width: 0; }
.brand .logo { width: 30px; height: 28px; display: block; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.back { background: rgba(255,255,255,.15); border: 0; color: #fff; width: 36px; height: 36px; border-radius: 12px; font-size: 26px; line-height: 1; padding-bottom: 3px; cursor: pointer; }
.loc { background: rgba(255,255,255,.15); border: 0; color: #fff; border-radius: 999px; padding: 7px 12px; font-size: 14px; font-weight: 600; max-width: 46%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }

main { padding: 16px; max-width: 720px; margin: 0 auto; outline: none; }
.section { margin: 22px 0 10px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section a { font-size: 14px; font-weight: 600; text-decoration: none; }

/* tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); height: calc(var(--tabh) + env(safe-area-inset-bottom)); }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 600; padding: 4px 0; }
.tabs a .ti { font-size: 22px; line-height: 1.1; filter: grayscale(.6); opacity: .8; }
.tabs a.on { color: var(--lake-2); } .tabs a.on .ti { filter: none; opacity: 1; }
.tabs a.cam .ti { width: 56px; height: 56px; margin-top: -26px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; filter: none; opacity: 1;
  background: linear-gradient(145deg, var(--sun-2), var(--sun)); box-shadow: 0 6px 16px rgba(255,122,26,.45); border: 4px solid var(--bg); }

/* cards */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; border: 1px solid var(--line); }
.card.tap { cursor: pointer; transition: transform .12s ease; } .card.tap:active { transform: scale(.985); }
.hero { position: relative; overflow: hidden; color: #fff; border: 0;
  background: radial-gradient(120% 90% at 100% 0%, rgba(255,176,32,.55) 0%, rgba(255,176,32,0) 55%), linear-gradient(160deg, #0e6d8f 0%, #0b4f6c 60%, #08394f 100%); }
.hero .muted, .hero .small { color: rgba(255,255,255,.82); }
.hero-top { display: flex; gap: 16px; align-items: center; }
.hero h2 { font-size: 24px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 700; opacity: .85; }
.ring { --v: 50; --c: var(--sun); width: 86px; height: 86px; flex: 0 0 86px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--v) * 1%), rgba(255,255,255,.18) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #0b4f6c; }
.ring b { position: relative; font: 800 30px/1 var(--display); } .ring small { position: relative; display: block; font-size: 10.5px; text-align: center; opacity: .85; margin-top: 2px; font-weight: 700; }
.ring-in { position: relative; text-align: center; }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.reasons li { background: rgba(255,255,255,.14); border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 600; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.btn { appearance: none; border: 0; border-radius: 14px; padding: 12px 16px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; min-height: 46px; }
.btn.primary { background: linear-gradient(145deg, var(--sun-2), var(--sun)); color: #2a1300; }
.btn.blue { background: var(--lake-2); color: #fff; }
.btn.ghost { background: var(--chip); color: var(--ink); }
.hero .btn.ghost { background: rgba(255,255,255,.16); color: #fff; }
.btn.full { width: 100%; } .btn.danger { background: #fde7e3; color: #b3261e; }
.btn:disabled { opacity: .55; cursor: default; }

.warn { background: #fff3cd; color: #6b4b00; border-radius: 14px; padding: 10px 14px; font-weight: 600; font-size: 14px; margin-bottom: 12px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .warn { background: #3a2f0b; color: #ffd76a; } }

/* week strip */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 2px; text-align: center; cursor: pointer; box-shadow: var(--shadow); }
.day .d { font-size: 12px; font-weight: 700; color: var(--muted); } .day .s { font: 800 20px/1.2 var(--display); } .day .e { font-size: 15px; }
.day.on { outline: 3px solid var(--sun); outline-offset: -1px; } .day.best { background: linear-gradient(180deg, #fff1e0, var(--card)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .day.best { background: linear-gradient(180deg, #3b2412, var(--card)); } }

/* chart */
.chart { width: 100%; height: 130px; display: block; }
.chart text { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

.astro { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.astro div { background: var(--chip); border-radius: 12px; padding: 8px 4px; } .astro b { display: block; font-size: 15px; } .astro span { font-size: 12px; color: var(--muted); }

/* lists */
.row { display: flex; gap: 12px; align-items: center; }
.row .grow { flex: 1; min-width: 0; }
.score { min-width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font: 800 20px/1 var(--display); color: #fff; }
.s-hot { background: var(--hot); } .s-good { background: var(--good); } .s-fair { background: var(--fair); } .s-slow { background: var(--slow); }
.t-hot { color: var(--hot); } .t-good { color: var(--good); } .t-fair { color: var(--fair); } .t-slow { color: var(--slow); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--chip); border-radius: 999px; padding: 5px 11px; font-size: 13.5px; font-weight: 600; border: 0; cursor: pointer; white-space: nowrap; }
.chip.on { background: var(--lake-2); color: #fff; }
.scroller { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.scroller::-webkit-scrollbar { display: none; }
.thumbs { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.thumbs img { width: 46px; height: 30px; object-fit: contain; background: #fff; border-radius: 6px; border: 1px solid var(--line); }

/* fish grid */
.search { width: 100%; padding: 13px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); font-size: 16px; margin-bottom: 10px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fishcard { padding: 0; overflow: hidden; margin: 0; }
.fishcard .pic { background: #fff; aspect-ratio: 3/2; display: grid; place-items: center; position: relative; }
.fishcard .pic img { width: 92%; height: 92%; object-fit: contain; }
.fishcard .body { padding: 10px 12px 12px; }
.fishcard h3 { font-size: 15.5px; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: var(--chip); color: var(--muted); }
.badge.in { background: #dff5e7; color: #13723c; } .badge.caught { position: absolute; top: 8px; right: 8px; background: var(--sun); color: #2a1300; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.in { background: #13402a; color: #7ee0a5; } }

.fishhero { background: #fff; border-radius: var(--r); padding: 8px; margin: -4px 0 12px; box-shadow: var(--shadow); }
.facts { display: grid; gap: 12px; }
.fact h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; font-family: var(--font); font-weight: 800; }
.fact p { margin: 0; }

/* feed */
.post { padding: 0; overflow: hidden; }
.post .ph { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--chip); }
.post .pb { padding: 12px 14px 14px; }
.who { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.av { width: 34px; height: 34px; border-radius: 50%; background: var(--chip); display: grid; place-items: center; font-size: 18px; flex: 0 0 34px; }
.proof { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 800; padding: 4px 9px; border-radius: 999px; }
.proof.match, .proof.fish { background: #dff5e7; color: #13723c; } .proof.pending { background: var(--chip); color: var(--muted); } .proof.nofish, .proof.error { background: #fdeee0; color: #9a4a00; }
.actions { display: flex; gap: 8px; margin-top: 10px; }
.actions button { background: var(--chip); border: 0; border-radius: 12px; padding: 8px 12px; font-weight: 700; cursor: pointer; }
.actions button.liked { background: #ffe3d1; color: #a63c00; }
.comment { padding: 10px 0; border-top: 1px solid var(--line); }

/* forms */
label.f { display: block; font-weight: 700; font-size: 14px; margin: 12px 0 6px; }
.in { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 16px; }
textarea.in { min-height: 80px; resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.drop { border: 2px dashed var(--line); border-radius: var(--r); padding: 26px 16px; text-align: center; cursor: pointer; background: var(--card); display: block; }
.drop .big { font-size: 48px; }
.preview { width: 100%; max-height: 360px; object-fit: contain; border-radius: 14px; background: #000; }
.avatars { display: flex; flex-wrap: wrap; gap: 8px; }
.avatars button { width: 48px; height: 48px; border-radius: 14px; font-size: 26px; background: var(--chip); border: 2px solid transparent; cursor: pointer; }
.avatars button.on { border-color: var(--sun); background: #fff1e0; }

/* ID */
.idbox { text-align: center; }
.scan { position: relative; overflow: hidden; border-radius: 14px; }
.scan::after { content: ""; position: absolute; left: 0; right: 0; height: 40%; top: -40%; background: linear-gradient(180deg, transparent, rgba(255,176,32,.45), transparent); animation: scan 1.4s linear infinite; }
@keyframes scan { to { top: 100%; } }
.conf { height: 10px; border-radius: 999px; background: var(--chip); overflow: hidden; margin: 6px 0 2px; } .conf i { display: block; height: 100%; background: linear-gradient(90deg, var(--sun-2), var(--good)); }

/* dex */
.dex { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dex div { background: #fff; border-radius: 12px; padding: 6px; text-align: center; font-size: 11.5px; font-weight: 700; color: #0f2430; border: 1px solid var(--line); }
.dex img { aspect-ratio: 3/2; object-fit: contain; width: 100%; }
.dex .no img { filter: grayscale(1) contrast(.6) opacity(.32); } .dex .no { color: #9aa9b2; }

/* map */
.map { height: 300px; border-radius: var(--r); overflow: hidden; margin-bottom: 12px; box-shadow: var(--shadow); z-index: 1; }
.map.small { height: 190px; }
.leaflet-container { font: 14px var(--font); }

/* sheet, toast */
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(5,20,28,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet .panel { background: var(--card); width: 100%; max-width: 720px; border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 88vh; overflow: auto; animation: up .2s ease; }
@keyframes up { from { transform: translateY(30px); opacity: .5; } }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabh) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: #0f2430; color: #fff; padding: 11px 16px; border-radius: 14px; font-weight: 600; z-index: 60; transition: .2s; max-width: calc(100% - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* onboarding */
.welcome { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; }
.welcome .big { font-size: 64px; text-align: center; }
.welcome h1 { text-align: center; font-size: 34px; }
.skeleton { background: linear-gradient(90deg, var(--chip), var(--card), var(--chip)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--r); height: 180px; margin-bottom: 12px; }
@keyframes sk { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty .big { font-size: 44px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14.5px; }
.kv b { color: var(--muted); font-weight: 700; }
.code { font: 800 22px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; background: var(--chip); padding: 10px 14px; border-radius: 12px; display: inline-block; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- your fisher, room, collection ---------- */
.check { display: flex; gap: 10px; align-items: center; margin: 14px 2px 0; font-weight: 600; font-size: 14.5px; }
.check input { width: 22px; height: 22px; accent-color: var(--sun); }
.prog { height: 10px; border-radius: 999px; background: var(--chip); overflow: hidden; margin-top: 8px; }
.prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--sun-2), var(--sun)); border-radius: 999px; }
.av.head { background: #bfe3ef; overflow: hidden; padding: 0; }
.av.head svg { width: 100%; height: 100%; display: block; }
.mebtns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 10px; }
.mebtns .btn { padding: 10px 6px; font-size: 14.5px; }
.roomwrap { display: block; text-decoration: none; }

.room { position: relative; isolation: isolate; z-index: 0; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); border: 3px solid #5a3a22; user-select: none; -webkit-user-select: none; touch-action: none; }
.room .wall { position: absolute; inset: 0 0 38% 0; background: var(--wall); }
.room .floor { position: absolute; inset: 62% 0 0 0; background: var(--floor); box-shadow: inset 0 8px 0 #f4f1ea, inset 0 14px 12px rgba(0,0,0,.12); }
.room .win { position: absolute; left: 36%; top: 8%; width: 28%; height: 30%; border: 6px solid #f4f1ea; border-radius: 10px; overflow: hidden; background: linear-gradient(#7fc8f0, #cdeaf7); box-shadow: 0 3px 0 rgba(0,0,0,.12); }
.room .win::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 5px; margin-left: -2.5px; background: #f4f1ea; }
.room .win .sun { position: absolute; width: 28%; aspect-ratio: 1; border-radius: 50%; background: #ffcf33; right: 12%; top: 14%; }
.room .win .hill { position: absolute; left: -10%; right: -10%; bottom: -40%; height: 70%; border-radius: 50%; background: #5aae4a; }
.room .it { position: absolute; transform: translate(-50%, -100%); }
.room .it > svg, .room .it .char { width: 100%; height: auto; display: block; overflow: visible; }
.room .it.flip > svg { transform: scaleX(-1); }
.room.edit .it { cursor: grab; }
.room.edit .it.sel { outline: 3px dashed var(--sun); outline-offset: 3px; border-radius: 8px; }
.room .it.me.bob .char { animation: bob 2.4s ease-in-out infinite; transform-origin: bottom center; }
@keyframes bob { 50% { transform: translateY(-3%) rotate(-1.5deg); } }

.tank .glass { position: relative; aspect-ratio: 1.35; background: linear-gradient(180deg, rgba(160,225,250,.75), rgba(40,140,190,.85)); border: 4px solid #e8f6fb; border-radius: 6px 6px 3px 3px; overflow: hidden; box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); }
.tank .glass::before { content: ""; position: absolute; left: 8%; top: 6%; width: 10%; height: 50%; background: rgba(255,255,255,.35); border-radius: 6px; transform: skewX(-12deg); }
.tank .swim { position: absolute; width: 48%; top: 26%; animation: swim 7s ease-in-out infinite; }
@keyframes swim {
  0% { left: 4%; transform: scaleX(-1) translateY(0); } 22% { transform: scaleX(-1) translateY(-10%); }
  45% { left: 48%; transform: scaleX(-1) translateY(0); } 50% { left: 48%; transform: scaleX(1); }
  72% { transform: scaleX(1) translateY(8%); } 95% { left: 4%; transform: scaleX(1); } 100% { left: 4%; transform: scaleX(-1); }
}
.tank .gravel { position: absolute; left: 0; right: 0; bottom: 0; height: 16%; background: radial-gradient(circle, #d9b37a 0 2px, transparent 3px) 0 0/8px 8px, #b88a52; }
.tank .weed { position: absolute; right: 8%; bottom: 8%; width: 14%; }
.tank .bub { position: absolute; bottom: 14%; width: 5%; aspect-ratio: 1; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.85); animation: bub 3.2s linear infinite; }
@keyframes bub { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-500%); opacity: 0; } }
.tank .stand { height: 0; padding-bottom: 22%; background: linear-gradient(#8a5a2b, #6f4520); border-radius: 0 0 4px 4px; margin: 0 4%; }

.book { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 520px) { .book { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.slot { position: relative; border: 0; border-radius: 16px; padding: 18px 6px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 112px;
  background: radial-gradient(120% 90% at 50% 10%, #d4f0fa 0%, #9bd3e8 100%); box-shadow: inset 0 -4px 0 rgba(0,0,0,.08); transition: transform .12s; }
.slot:active { transform: scale(.96); }
.slot img { width: 86%; aspect-ratio: 2 / 1; object-fit: contain; filter: drop-shadow(0 3px 2px rgba(0,0,0,.2)); }
.slot.no { background: radial-gradient(120% 90% at 50% 10%, #2a5a70 0%, #173a4b 100%); }
.slot.no img { filter: brightness(0) opacity(.55); }
.slot .num { position: absolute; top: 6px; left: 9px; font-size: 11px; font-weight: 800; color: rgba(15,36,48,.55); }
.slot.no .num { color: rgba(255,255,255,.4); }
.slot .nm { font-size: 12.5px; font-weight: 800; color: #0f2430; text-align: center; line-height: 1.15; }
.slot.no .nm { color: rgba(255,255,255,.55); letter-spacing: .1em; }
.slot .cnt { position: absolute; top: 6px; right: 8px; font-size: 11.5px; font-weight: 800; background: var(--sun); color: #2a1300; border-radius: 999px; padding: 1px 7px; }
.bookhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ring.sm { width: 58px; height: 58px; flex-basis: 58px; } .ring.sm::before { inset: 6px; background: var(--bg); } .ring.sm b { font-size: 20px; color: var(--ink); }
.sheetfish { background: radial-gradient(120% 90% at 50% 10%, #d4f0fa 0%, #9bd3e8 100%); border-radius: 18px; padding: 16px; margin-bottom: 12px; }
.sheetfish img { width: 80%; margin: 0 auto; aspect-ratio: 2/1; object-fit: contain; }
.sheetfish.no { background: radial-gradient(120% 90% at 50% 10%, #2a5a70 0%, #173a4b 100%); } .sheetfish.no img { filter: brightness(0) opacity(.6); }

.closet { position: relative; margin-top: 12px; border-radius: var(--r); background: radial-gradient(90% 80% at 50% 30%, #fff6e8 0%, #ffd9a8 100%); border: 1px solid var(--line); }
.closet .stage { width: 52%; max-width: 240px; margin: 0 auto; padding: 14px 0 4px; }
.closet .stage .char { width: 100%; height: auto; display: block; }
.closet .dice { position: absolute; top: 10px; right: 10px; background: #fff; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sw { width: 46px; height: 46px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line), var(--shadow); cursor: pointer; }
.sw.on { box-shadow: 0 0 0 3px var(--sun), var(--shadow); }
.looks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.lk { background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 4px 4px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; font-weight: 700; }
.lk .char { width: 100%; height: auto; aspect-ratio: 1; background: #fff6e8; border-radius: 10px; }
.lk.on { border-color: var(--sun); background: #fff1e0; }

.seltools { display: flex; align-items: center; gap: 8px; margin-top: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; font-weight: 700; }
.tray { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tr { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; cursor: pointer; min-height: 92px; justify-content: center; text-align: center; }
.tr img, .tr svg { width: 82%; max-height: 52px; object-fit: contain; }
.tr.locked { opacity: .55; cursor: default; } .tr.locked svg { filter: grayscale(1); }
.tr.pat i { width: 100%; height: 44px; border-radius: 10px; display: block; }
.tr.on { border: 2px solid var(--sun); }

.celebrate { position: relative; width: 56%; max-width: 230px; margin: 0 auto 6px; }
.celebrate .char { position: relative; width: 100%; height: auto; animation: cheer 1s ease-in-out infinite; }
.celebrate .burst { position: absolute; inset: -10% -20%; background: repeating-conic-gradient(rgba(255,176,32,.35) 0 10deg, transparent 10deg 20deg); border-radius: 50%; animation: spin 8s linear infinite; }
@keyframes cheer { 50% { transform: translateY(-6%); } }
@keyframes spin { to { transform: rotate(360deg); } }
.bigcount { font: 800 34px/1 var(--display); color: var(--sun); } .bigcount small { font-size: 16px; color: var(--muted); }

/* v1.2: friends, challenges, learn, gear */
.seg { display: flex; gap: 4px; background: var(--chip); padding: 4px; border-radius: 14px; margin-bottom: 14px; }
.seg a { flex: 1; text-align: center; padding: 9px 4px; border-radius: 11px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 14px; position: relative; white-space: nowrap; }
.seg a.on { background: var(--card); box-shadow: var(--shadow); color: var(--lake-2); }
.dot { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--hot); color: #fff; font: 800 11px/1 var(--font); font-style: normal; vertical-align: 1px; }
.tabs a { position: relative; }
.tabs a[data-badge]::after { content: attr(data-badge); position: absolute; top: 0; left: 50%; margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--hot); color: #fff; font: 800 11px/18px var(--font); text-align: center; }
.btn.sm { min-height: 38px; padding: 8px 12px; }
.mebtns.two { grid-template-columns: 1fr 1fr; }
.codecard { text-align: center; }
.fcode { font: 800 38px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .18em; color: var(--lake-2); margin: 6px 0; }
.codecard .btns { justify-content: center; }
.frow { gap: 8px; }
.qh { font-size: 17px; margin: 18px 0 8px; }
.kinds { display: grid; gap: 8px; }
.kindcard { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 10px; text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 12px; cursor: pointer; color: var(--ink); font: inherit; }
.kindcard .big { grid-row: span 2; font-size: 32px; align-self: center; }
.kindcard.on { border-color: var(--sun); background: color-mix(in srgb, var(--sun) 10%, var(--card)); }
.pickf { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 84px; padding: 10px 4px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); color: var(--ink); font: 600 13px/1.2 var(--font); cursor: pointer; overflow: hidden; }
.pick span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick.on { border-color: var(--sun); background: color-mix(in srgb, var(--sun) 12%, var(--card)); }
.summary { margin: 16px 0 10px; }
.chcard { gap: 12px; align-items: center; }
.chcard.over { opacity: .85; }
.chicon { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 14px; background: var(--chip); display: grid; place-items: center; font-size: 28px; }
.chicon img { width: 46px; height: 46px; object-fit: contain; }
.chrank { display: flex; flex-direction: column; align-items: center; font-size: 26px; line-height: 1; }
.chrank small { font: 800 15px/1.2 var(--display); color: var(--muted); }
.invite { border: 2px solid var(--sun); }
.invite > .row { gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.chhead { text-align: center; background: linear-gradient(160deg, var(--lake-2), var(--lake)); color: #fff; border-radius: var(--r); padding: 18px 16px 16px; }
.chhead.over { background: linear-gradient(160deg, #5b6f7a, #34454f); }
.chhead h1 { color: #fff; margin: 4px 0 2px; }
.chbig { font-size: 48px; line-height: 1; } .chbig img { width: 120px; height: 72px; object-fit: contain; }
.chclock { font: 800 22px/1.2 var(--display); margin-top: 10px; }
.chhead .prog { background: rgba(255,255,255,.2); }
.winner { margin-top: 12px; text-align: center; font-size: 18px; background: color-mix(in srgb, var(--sun-2) 18%, var(--card)); }
.board { padding: 6px 12px; }
.lbrow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.lbrow:last-child { border-bottom: 0; }
.lbrow.me .grow { font-weight: 800; } .lbrow.wait { opacity: .6; }
.medal { width: 34px; text-align: center; font-size: 24px; font-weight: 800; }
.score { font: 800 26px/1 var(--display); color: var(--sun); min-width: 36px; text-align: right; }
.tip { background: color-mix(in srgb, var(--good) 12%, var(--card)); font-size: 14.5px; }
.lesson { display: flex; align-items: center; gap: 12px; padding: 10px; }
.lesson.done { opacity: .7; }
.lthumb { position: relative; width: 112px; flex: 0 0 112px; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: var(--chip); display: grid; place-items: center; }
.lthumb img { width: 100%; height: 100%; object-fit: cover; }
.lthumb .play { position: absolute; width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; font-size: 14px; }
.lthumb .knot { font-size: 34px; }
.ltext { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; min-width: 0; }
.lcheck { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; border: 2px solid var(--line); background: transparent; color: #fff; font-weight: 800; font-size: 17px; cursor: pointer; }
.lesson.done .lcheck { background: var(--good); border-color: var(--good); }
.rlink { display: flex; flex-direction: column; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.rlink:last-child { border-bottom: 0; } .rlink b { color: var(--lake-2); }
.gearhero { background: linear-gradient(150deg, var(--sun-2), var(--sun)); color: #2a1300; margin-top: 10px; }
.gearhero h2 { margin: 2px 0 6px; }
.rod ul { margin: 8px 0; padding-left: 20px; font-size: 14.5px; } .rod li { margin: 3px 0; }
.price { color: var(--good); letter-spacing: .05em; }
.kit { padding: 4px 14px; }
.kitrow { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.kitrow:last-child { border-bottom: 0; }
.kitrow input { width: 22px; height: 22px; accent-color: var(--good); flex: 0 0 22px; }
.kitrow .ki { font-size: 22px; }
.store .btns { margin-top: 8px; }
.badge.tagb { background: #dff5e7; color: #13723c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.tagb { background: #13402a; color: #7ee0a5; } }
:root[data-theme="dark"] .badge.tagb { background: #13402a; color: #7ee0a5; }
.nudge { gap: 10px; border: 2px dashed var(--sun); }

/* What's new popup */
.wn-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(5,32,45,.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; animation: wnFade .25s ease-out; }
.wn-card { width: 100%; background: var(--card); color: var(--ink); border-radius: 26px 26px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.3); overflow: hidden; padding-bottom: env(safe-area-inset-bottom); animation: wnRise .42s cubic-bezier(.16,1,.3,1) both; max-height: 92dvh; display: flex; flex-direction: column; }
@media (min-width: 640px) { .wn-scrim { align-items: center; } .wn-card { width: 28rem; border-radius: 26px; } }
.wn-head { position: relative; text-align: center; padding: 18px 16px 14px; background: linear-gradient(160deg, #1694bd, var(--lake)); color: #fff; }
.wn-x { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff; font-size: 16px; cursor: pointer; }
.wn-count { position: absolute; top: 18px; left: 16px; font-size: 12.5px; font-weight: 700; opacity: .85; }
.wn-hey { font: 800 24px/1.1 var(--display); color: var(--sun-2); margin-top: 6px; animation: wnUp .4s .12s both; }
.wn-badgewrap { position: relative; width: 80px; height: 80px; margin: 12px auto 8px; }
.wn-badge { width: 80px; height: 80px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 42px; box-shadow: 0 0 0 6px rgba(255,176,32,.45), 0 8px 20px rgba(0,0,0,.25); animation: wnPop .56s .12s cubic-bezier(.34,1.56,.64,1) both; }
.wn-burst i { position: absolute; left: 50%; top: 50%; font-style: normal; font-size: 20px; margin: -12px 0 0 -12px; opacity: 0; animation: wnBurst 1.3s ease-out both; }
.wn-line { font-size: 14px; font-weight: 600; opacity: .9; animation: wnUp .4s .18s both; }
.wn-body { padding: 16px 18px 6px; overflow-y: auto; max-height: 50dvh; animation: wnUp .4s .16s both; }
.wn-body h2 { margin: 6px 0 4px; font-size: 21px; } .wn-body p { margin: 0 0 8px; }
.wn-body ul, .wn-item ul { list-style: none; padding: 0; margin: 6px 0 0; }
.wn-body li { display: flex; gap: 8px; margin: 6px 0; font-size: 15px; }
.wn-body li span { flex: 0 0 22px; height: 22px; border-radius: 50%; background: color-mix(in srgb, var(--good) 18%, var(--card)); color: var(--good); font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.wn-item li { margin: 3px 0; padding-left: 16px; position: relative; } .wn-item li::before { content: "✓"; position: absolute; left: 0; color: var(--good); font-weight: 800; }
.wn-meta { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.wn-tag { font-weight: 800; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; }
.wn-new { background: linear-gradient(145deg, var(--sun-2), var(--sun)); color: #2a1300; }
.wn-updated { background: color-mix(in srgb, var(--lake-2) 18%, var(--card)); color: var(--lake-2); }
.wn-fixed { background: var(--chip); color: var(--muted); }
.wn-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px 16px; }
.wn-foot .btn { min-height: 46px; }
.wn-dots { flex: 1; display: flex; gap: 6px; } .wn-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); } .wn-dots i.on { background: var(--sun); width: 18px; border-radius: 4px; }
.wn-soft { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 50%; background: var(--chip); display: grid; place-items: center; font-size: 24px; }
.wn-item h3 { margin-top: 6px; }
.wn-item .btn { margin-top: 8px; }
@keyframes wnFade { from { opacity: 0; } }
@keyframes wnRise { from { transform: translateY(40px); opacity: 0; } }
@keyframes wnUp { from { transform: translateY(10px); opacity: 0; } }
@keyframes wnPop { 0% { transform: scale(.3) rotate(-12deg); opacity: 0; } 70% { transform: scale(1.12) rotate(4deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@keyframes wnBurst { 0% { transform: translate(0,0) scale(.4); opacity: 0; } 15% { opacity: 1; } 60% { transform: translate(var(--x), var(--y)) scale(1); opacity: 1; } 100% { transform: translate(var(--x), calc(var(--y) + 40px)) scale(.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .wn-scrim, .wn-card, .wn-hey, .wn-badge, .wn-line, .wn-body { animation: wnFade .2s ease-out both !important; }
  .wn-burst { display: none; }
}

/* V1: levels, badges, unlocks */
.lvl { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 14px; display: grid; place-items: center; font: 800 22px/1 var(--display); color: #2a1300; background: linear-gradient(145deg, var(--sun-2), var(--sun)); box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.lvl.sm { width: 32px; height: 32px; flex-basis: 32px; font-size: 15px; border-radius: 10px; }
.levelcard { gap: 12px; }
.badgerow { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.bdg { width: 38px; height: 38px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; font-size: 20px; }
.badgegrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.badge-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; margin: 0; padding: 14px 10px; opacity: .6; }
.badge-card.got { opacity: 1; border: 2px solid var(--sun-2); }
.bbig { font-size: 34px; line-height: 1.1; }
.badge-card .unl { margin-top: 4px; color: var(--lake-2); font-weight: 700; }
.lvrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; opacity: .65; }
.lvrow:last-child { border-bottom: 0; } .lvrow.got { opacity: 1; }
.lk.locked, .tr.locked { opacity: .5; filter: grayscale(.6); cursor: default; }
.lk.locked span, .tr.locked span { font-size: 11px; }
.wlogo { display: block; margin: 8px auto 6px; border-radius: 22px; box-shadow: 0 8px 24px rgba(11,79,108,.25); }
.gbtn { display: flex; justify-content: center; margin-top: 10px; min-height: 44px; } .gbtn:empty { display: none; }
