/* Legend Waters */
:root{color-scheme:light;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}body{margin:0;font:14px system-ui}img{max-width:100%}[hidden]{display:none!important}
@font-face{font-family:'Alfa Slab One';font-style:normal;font-display:swap;font-weight:400;src:url(fonts/alfa-slab-one-latin-ext-400-normal.woff2) format('woff2');unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Alfa Slab One';font-style:normal;font-display:swap;font-weight:400;src:url(fonts/alfa-slab-one-latin-400-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Nunito';font-style:normal;font-display:swap;font-weight:400;src:url(fonts/nunito-latin-ext-400-normal.woff2) format('woff2');unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Nunito';font-style:normal;font-display:swap;font-weight:400;src:url(fonts/nunito-latin-400-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Nunito';font-style:normal;font-display:swap;font-weight:600;src:url(fonts/nunito-latin-ext-600-normal.woff2) format('woff2');unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Nunito';font-style:normal;font-display:swap;font-weight:600;src:url(fonts/nunito-latin-600-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Nunito';font-style:normal;font-display:swap;font-weight:700;src:url(fonts/nunito-latin-ext-700-normal.woff2) format('woff2');unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Nunito';font-style:normal;font-display:swap;font-weight:700;src:url(fonts/nunito-latin-700-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Nunito';font-style:normal;font-display:swap;font-weight:800;src:url(fonts/nunito-latin-ext-800-normal.woff2) format('woff2');unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Nunito';font-style:normal;font-display:swap;font-weight:800;src:url(fonts/nunito-latin-800-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Nunito';font-style:normal;font-display:swap;font-weight:900;src:url(fonts/nunito-latin-ext-900-normal.woff2) format('woff2');unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Nunito';font-style:normal;font-display:swap;font-weight:900;src:url(fonts/nunito-latin-900-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Nunito';font-style:italic;font-display:swap;font-weight:600;src:url(fonts/nunito-latin-ext-600-italic.woff2) format('woff2');unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Nunito';font-style:italic;font-display:swap;font-weight:600;src:url(fonts/nunito-latin-600-italic.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Nunito';font-style:italic;font-display:swap;font-weight:700;src:url(fonts/nunito-latin-ext-700-italic.woff2) format('woff2');unicode-range:U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Nunito';font-style:italic;font-display:swap;font-weight:700;src:url(fonts/nunito-latin-700-italic.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
/* ===== Wattlebird Learning shared base (tokens come from each game's style.css) ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { background: var(--ground); color: var(--ink); font-family: var(--font-b); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow-x: hidden; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bar); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: var(--link); }
svg { display: block; }
#app { position: relative; z-index: 1; min-height: 100%; display: flex; flex-direction: column; }
#main { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 14px 28px; }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ----- buttons ----- */
.btn { --b: var(--btn); --bt: var(--btn-ink); --bd: var(--btn-edge); display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 46px; padding: .55em 1.15em; border: 0; border-radius: 14px; background: var(--b); color: var(--bt); font-weight: 800; font-size: 1rem; letter-spacing: .01em; box-shadow: 0 4px 0 var(--bd), 0 6px 14px rgba(0,0,0,.18); transition: transform .08s, box-shadow .08s, filter .15s; text-decoration: none; user-select: none; touch-action: manipulation; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--bd), 0 2px 6px rgba(0,0,0,.18); }
.btn[disabled], .btn[aria-disabled="true"] { filter: grayscale(.7) opacity(.55); cursor: not-allowed; transform: none; }
.btn.primary { --b: var(--accent); --bt: var(--accent-ink); --bd: var(--accent-edge); }
.btn.good { --b: var(--good); --bt: var(--good-ink); --bd: var(--good-edge); }
.btn.gold { --b: var(--gold); --bt: var(--gold-ink); --bd: var(--gold-edge); }
.btn.red { --b: var(--bad); --bt: #fff; --bd: var(--bad-edge); }
.btn.ghost { --b: transparent; --bt: currentColor; --bd: transparent; box-shadow: inset 0 0 0 2px var(--line); }
.btn.ghost:active { box-shadow: inset 0 0 0 2px var(--line); }
.btn.small { min-height: 36px; padding: .35em .85em; font-size: .9rem; border-radius: 11px; }
.btn.big { min-height: 58px; font-size: 1.2rem; padding: .6em 1.6em; border-radius: 18px; }
.btn.wide { width: 100%; }
.iconbtn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--chip); color: var(--chip-ink); font-size: 1.15rem; }

/* ----- modals ----- */
#modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: max(14px, env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) max(14px, env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px)); }
.m-back { position: absolute; inset: 0; background: var(--scrim); backdrop-filter: blur(3px); animation: fadeIn .2s ease-out; }
.m-box { position: relative; width: min(520px, 100%); max-height: calc(100% - 8px); overflow: auto; background: var(--paper); color: var(--paper-ink); border-radius: 22px; padding: 22px 20px 20px; box-shadow: 0 24px 60px rgba(0,0,0,.45); animation: popIn .28s cubic-bezier(.2,1.4,.4,1); overscroll-behavior: contain; }
.m-title { font-family: var(--font-d); font-weight: 400; font-size: 1.55rem; line-height: 1.15; margin-bottom: 8px; color: var(--paper-head); }
.m-text { margin: 6px 0; color: var(--paper-soft); }
.m-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.m-actions .btn { flex: 1 1 140px; }
.eyebrow { font-size: .78rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--eyebrow); }
.small { font-size: .86rem; }
.muted { opacity: .72; }

/* ----- toasts and tooltips ----- */
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(92vw, 460px); pointer-events: none; }
.toast { background: var(--toast); color: var(--toast-ink); padding: 11px 16px; border-radius: 14px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.35); animation: toastIn .3s cubic-bezier(.2,1.3,.4,1); text-align: center; }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .45s; }
#tip { position: fixed; z-index: 85; max-width: 260px; background: var(--toast); color: var(--toast-ink); padding: 7px 10px; border-radius: 10px; font-size: .84rem; font-weight: 700; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,.3); }

/* ----- effects ----- */
.popfx { position: fixed; z-index: 88; transform: translate(-50%, -50%); pointer-events: none; font-family: var(--font-d); font-size: 1.5rem; color: var(--pop); text-shadow: 0 2px 0 rgba(0,0,0,.35), 0 0 14px rgba(0,0,0,.25); animation: popUp 1.25s ease-out forwards; white-space: nowrap; }
.popfx.bad { color: var(--bad-pop); }
.popfx.gold { color: var(--gold); }
.flashfx { position: fixed; inset: 0; z-index: 87; pointer-events: none; animation: flash .45s ease-out forwards; }
.flytok { position: fixed; z-index: 89; pointer-events: none; transform: translate(-50%, -50%); font-size: 1.2rem; line-height: 1; }
.shake { animation: shake .45s; }
.bump { animation: bump .45s; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: scale(.86) translateY(12px); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes popUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.08); } 100% { opacity: 0; transform: translate(-50%, -190%) scale(1); } }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* ----- forms ----- */
.field { display: grid; gap: 6px; }
.field label { font-weight: 800; font-size: .92rem; }
.field input[type=text] { width: 100%; min-height: 50px; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--line-paper); background: var(--input); color: var(--paper-ink); font-size: 1.1rem; font-weight: 700; }
.field input[type=text]:focus { outline: none; border-color: var(--focus); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg button { min-height: 40px; padding: 6px 12px; border-radius: 11px; border: 2px solid var(--line-paper); background: transparent; color: var(--paper-ink); font-weight: 800; }
.seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ===== maths rounds (shared by the Wattlebird games; colours come from each game's tokens) ===== */
kbd { display: inline-block; padding: 0 .4em; border-radius: 5px; border: 1px solid currentColor; font: 700 .8em var(--font-b); opacity: .85; }
.mround { display: grid; gap: 10px; max-width: 780px; margin: 0 auto; }
.mr-prog { display: grid; justify-items: end; gap: 4px; font-weight: 800; font-variant-numeric: tabular-nums; flex: none; }
.mr-meter { display: block; width: 110px; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.mr-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--accent)); transition: width .3s; }
.mr-stage { position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 16 / 6.5; max-width: 100%; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); background: var(--ground-2); }
.mr-stage > svg, .mr-stage .scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.mr-card { background: var(--paper); color: var(--paper-ink); border-radius: 20px; padding: 16px; box-shadow: 0 12px 30px rgba(0, 0, 0, .3); display: grid; gap: 10px; transition: box-shadow .15s; }
.mr-card.good { box-shadow: 0 0 0 4px var(--good), 0 12px 30px rgba(0, 0, 0, .3); }
.mr-card.fast { box-shadow: 0 0 0 4px var(--gold), 0 12px 30px rgba(0, 0, 0, .3); }
.mr-card.bad { box-shadow: 0 0 0 4px var(--bad), 0 12px 30px rgba(0, 0, 0, .3); }
.mr-story { font-weight: 600; font-size: 1.14rem; line-height: 1.42; color: var(--paper-head); text-align: center; text-wrap: balance; }
.mr-row { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.mr-q { font-family: var(--font-d); font-size: clamp(2.3rem, 8.5vw, 3.6rem); line-height: 1; color: var(--paper-head); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.mr-eq { font-family: var(--font-d); font-size: clamp(2rem, 7.5vw, 3.1rem); color: var(--paper-soft); line-height: 1; }
.storyq .mr-q, .storyq .mr-eq { display: none; }
.mr-ans { width: 4.2ch; font-family: var(--font-d); font-size: clamp(2.3rem, 8.5vw, 3.6rem); line-height: 1.1; text-align: center; border: 3px solid var(--line-paper); border-radius: 14px; background: var(--input); color: var(--paper-ink); padding: 2px 6px; font-variant-numeric: tabular-nums; }
.mr-ans:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(255, 209, 102, .35); }
.mr-ans::placeholder { color: rgba(0, 0, 0, .22); }
.q-in { animation: qIn .25s ease-out; }
@keyframes qIn { from { opacity: 0; transform: translateY(6px) scale(.96); } }
.mr-speed { display: flex; align-items: center; gap: 8px; }
.mr-track { flex: 1; height: 10px; border-radius: 5px; background: var(--paper-2); overflow: hidden; }
.mr-track i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--gold), var(--accent)); border-radius: 5px; }
.mr-speed.late .mr-track i { background: var(--line-paper); }
.mr-fb { min-height: 1.7em; display: grid; gap: 4px; justify-items: center; text-align: center; font-weight: 700; }
.fb-fast { color: #9a6e0a; }
.fb-good { color: var(--right); }
.fb-bad { color: var(--wrong); }
.fb-tip { color: var(--paper-soft); font-weight: 600; max-width: 52ch; }
.fb-do { color: var(--paper-ink); }
.fb-hint, .fb-again, .fb-story { color: var(--paper-soft); font-weight: 600; }
.fb-math { color: var(--paper-head); font-weight: 800; }
.mr-foot { display: flex; justify-content: space-between; gap: 10px; min-height: 1.6em; color: var(--ink-soft); font-weight: 700; font-size: .9rem; }
.mr-combo.hot { color: var(--pop); }
@media (pointer: coarse) { .mr-hint { display: none; } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 420px; width: 100%; margin: 0 auto; }
.keypad button { min-height: 54px; border-radius: 14px; border: 0; background: var(--btn); color: var(--btn-ink); font-size: 1.5rem; font-weight: 800; box-shadow: 0 4px 0 var(--btn-edge); touch-action: manipulation; user-select: none; }
.keypad button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--btn-edge); }
.keypad .kp-go { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 0 var(--accent-edge); }
.mr-count { position: fixed; inset: 0; display: grid; place-items: center; font-family: var(--font-d); font-size: clamp(3rem, 14vw, 6rem); color: var(--pop); text-shadow: 0 4px 0 rgba(0, 0, 0, .35); pointer-events: none; z-index: 60; }
.mr-count.pulse { animation: cPulse .55s ease-out; }
@keyframes cPulse { from { transform: scale(.6); opacity: 0; } 40% { transform: scale(1.1); opacity: 1; } to { transform: scale(1); } }
.mdone { display: grid; place-items: center; padding-top: 10px; }
.md-card { width: min(640px, 100%); background: var(--paper); color: var(--paper-ink); border-radius: 24px; padding: 20px; box-shadow: 0 20px 50px rgba(0, 0, 0, .4); display: grid; gap: 12px; text-align: center; }
.md-card .eyebrow { color: var(--eyebrow-paper); }
.md-title { font-family: var(--font-d); font-weight: 400; font-size: clamp(1.7rem, 5vw, 2.3rem); color: var(--paper-head); }
.md-ticket { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; text-align: left; background: var(--paper-2); border-radius: 18px; padding: 12px; }
.md-ticket > svg { width: 96px; height: 96px; flex: none; }
.md-stars { font-size: 1.8rem; color: var(--gold-edge); letter-spacing: .05em; line-height: 1; }
.dimstar { opacity: .25; }
.md-boost { font-weight: 700; max-width: 34ch; margin-top: 4px; }
.md-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.md-stats div { background: var(--paper-2); border-radius: 14px; padding: 8px; }
.md-stats b { display: block; font-family: var(--font-d); font-weight: 400; font-size: 1.5rem; color: var(--paper-head); }
.md-stats small { color: var(--paper-soft); font-weight: 700; }
@media (max-width: 480px) { .md-stats { grid-template-columns: repeat(2, 1fr); } }
.md-gold { font-weight: 800; color: #9a6e0a; }
.md-unlock, .md-perfect { font-weight: 800; color: var(--right); }
.md-miss { color: var(--paper-soft); }
.md-bank { font-weight: 700; }
.mdone .btnrow { justify-content: center; }
.focuspick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 640px) { .focuspick { grid-template-columns: repeat(2, 1fr); } }
.focuspick button, .sumlevels button { display: grid; gap: 2px; align-content: start; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--glass); color: var(--ink); text-align: left; min-width: 0; }
.focuspick b, .sumlevels b { font-weight: 800; }
.focuspick small, .sumlevels small { color: var(--ink-soft); font-weight: 600; font-size: .8rem; }
.focuspick button[aria-pressed="true"], .sumlevels button[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.sumlevels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
@media (max-width: 640px) { .sumlevels { grid-template-columns: 1fr 1fr; } }
.sumlevels button[disabled] { opacity: .5; cursor: not-allowed; }
.sl-st { color: var(--gold); font-size: .9rem; }
.fg-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; }
.fgrid-wrap { overflow-x: auto; max-width: 100%; }
.factgrid { border-collapse: separate; border-spacing: 2px; }
.factgrid th { font-size: .68rem; font-weight: 800; color: var(--ink-soft); min-width: 18px; height: 18px; text-align: center; padding: 0; }
.factgrid td { width: 18px; height: 18px; border-radius: 4px; padding: 0; }
.st-stone { background: rgba(255, 255, 255, .09); }
.st-bronze { background: #b7773f; }
.st-silver { background: #b9c3c9; }
.st-gold { background: #f2c43a; }
.st-diamond { background: linear-gradient(135deg, #d6f7ff, #6fd6ff); }
.fg-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-soft); font-weight: 600; font-size: .84rem; margin-bottom: 8px; }
.fg-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }
.sumstars { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.sumstars .ss { padding: 10px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); display: grid; gap: 2px; }
.sumstars .ss.locked { opacity: .55; }
.sumstars small { color: var(--ink-soft); font-weight: 600; }
.sumstars span { color: var(--gold); }
.mm-sec { margin-top: 8px; }
.mini-h.dark { color: var(--eyebrow); }
.fg-cap { font-weight: 800; color: var(--ink-soft); margin-bottom: 4px; }
.fg-cap b { color: var(--ink); }

/* Legend Waters: deep water and chart paper.
   Layout: a dark ocean ground; paper panels carry the reading; scenes are the hero everywhere. */
:root {
  color-scheme: dark;
  --ground: #0a2232; --ground-2: #0e3247; --ground-3: #145069; --bar: #071a27;
  --ink: #e9f3f2; --ink-soft: #a9c6cc;
  --paper: #eef4ef; --paper-2: #e1ebe6; --paper-ink: #102c3a; --paper-head: #0b2533; --paper-soft: #3d5966;
  --line: rgba(233, 243, 242, .2); --line-paper: #c3d4d0; --glass: rgba(255, 255, 255, .07); --glass-2: rgba(255, 255, 255, .12);
  --accent: #ff7a1a; --accent-ink: #231203; --accent-edge: #c4560a;
  --good: #2fbf8f; --good-ink: #042a1d; --good-edge: #1b8463;
  --gold: #f2c43a; --gold-ink: #3b2a00; --gold-edge: #b48810;
  --bad: #e5484d; --bad-edge: #a2262b;
  --btn: #1c5a76; --btn-ink: #f1f8f7; --btn-edge: #103b50;
  --chip: rgba(255, 255, 255, .09); --chip-ink: #e9f3f2;
  --focus: #ffd166; --link: #8ad8ea; --link-paper: #17607d; --scrim: rgba(3, 14, 22, .62);
  --toast: #0d2a3a; --toast-ink: #e9f3f2; --pop: #ffe08a; --bad-pop: #ff9a9a;
  --eyebrow: #ff9b52; --eyebrow-paper: #b84f08; --input: #ffffff;
  --right: #2fbf8f; --right-bg: #dff6ec; --wrong: #e5484d; --wrong-bg: #fde4e4;
  --sonar: #04160f; --sonar-ink: #6dffb0; --sonar-dim: #2c8a5c;
  --chart-sea: #cfe6e8; --chart-grid: #87adb3; --chart-depth: #86b6c2; --chart-land: #f0e4c2; --chart-coast: #4b6a69; --chart-river: #3d8db0; --chart-reef: #e2765a;
  --sil: #0c3550; --logo-fish: #ff7a1a;
  --font-d: 'Alfa Slab One', Rockwell, 'Roboto Slab', Georgia, serif;
  --font-b: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
}
body { background: var(--ground); }
#sea { position: fixed; inset: 0; z-index: 0; background: radial-gradient(120% 60% at 20% -10%, var(--ground-3) 0%, transparent 60%), radial-gradient(90% 60% at 100% 110%, #0c3a52 0%, transparent 60%), linear-gradient(180deg, var(--ground-2), var(--ground) 60%); }
.hide-sm { }
@media (max-width: 640px) { .hide-sm { display: none !important; } }
.off { opacity: .35; }
.linkbtn { background: none; border: 0; color: var(--link); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; padding: 6px 4px; }
.lead { color: var(--ink-soft); max-width: 62ch; margin-bottom: 16px; }
.h-title { font-family: var(--font-d); font-weight: 400; font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: .01em; margin: 6px 0 12px; }
.sec-h { font-family: var(--font-d); font-weight: 400; font-size: 1.2rem; margin: 18px 0 10px; letter-spacing: .01em; }
.sec-h small { font-family: var(--font-b); font-weight: 800; font-size: .85rem; color: var(--ink-soft); margin-left: 6px; }
.mini-h { font-weight: 900; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--eyebrow-paper); margin: 16px 0 4px; }
.empty { color: var(--ink-soft); padding: 18px 0; }
.side-note { color: var(--ink-soft); font-size: .9rem; margin-top: 8px; max-width: 64ch; }
.btnrow { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.reward { font-weight: 900; font-size: 1.15rem; display: flex; align-items: center; gap: 6px; justify-content: center; margin: 10px 0 4px; }
.xpico { width: 22px; height: 22px; display: inline-block; }
.hookico { width: 18px; height: 18px; display: inline-block; }
.m-box .eyebrow { color: var(--eyebrow-paper); }
.m-box a { color: var(--link-paper); }
.panel { background: var(--paper); color: var(--paper-ink); border-radius: 20px; padding: 16px; box-shadow: 0 12px 30px rgba(0, 0, 0, .3); }
.panel .eyebrow { color: var(--eyebrow-paper); }
.panel .m-text { color: var(--paper-soft); }

/* ----- logo ----- */
.logo { display: inline-grid; grid-template-columns: auto; justify-items: center; line-height: .9; color: var(--ink); position: relative; }
.logo-top, .logo-bot { font-family: var(--font-d); text-transform: uppercase; letter-spacing: .06em; }
.logo-top { font-size: 1em; }
.logo-bot { font-size: 1.24em; color: var(--accent); }
.logo-fishwrap { display: block; width: 3.3em; height: 1.15em; margin: -.1em 0 -.05em; transform: rotate(-12deg); }
.logo-fishwrap svg { width: 100%; height: 100%; }
.logo-wave { width: 100%; height: .3em; color: var(--link); margin-top: .1em; }
.logo.big { font-size: clamp(2.4rem, 9vw, 3.6rem); filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .25)); }
.logo.sm { font-size: 1rem; grid-template-columns: auto auto auto; align-items: center; column-gap: .25em; }
.logo.sm .logo-fishwrap { width: 1.7em; height: .8em; margin: 0; }
.logo.sm .logo-bot { font-size: 1em; }
.logo.sm .logo-wave { display: none; }

/* ----- top bar ----- */
#top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bar); border-bottom: 1px solid var(--line); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 8px; }
.tb-in { display: flex; align-items: center; gap: 10px; max-width: 1180px; margin: 0 auto; }
.tb-player { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 2px 8px 2px 2px; border-radius: 14px; min-width: 0; text-align: left; }
.tb-player:hover { background: var(--glass); }
.tb-av { width: 42px; height: 42px; flex: none; }
.tb-who { display: grid; min-width: 0; }
.tb-who b { font-weight: 900; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 12ch; }
.tb-who small { color: var(--ink-soft); font-weight: 800; font-size: .78rem; white-space: nowrap; }
.xpbar { display: block; height: 6px; border-radius: 4px; background: rgba(255, 255, 255, .14); overflow: hidden; margin-top: 3px; width: 110px; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--accent)); border-radius: 4px; }
.xpbar.big { width: 100%; height: 9px; margin-top: 8px; }
.tb-home { margin: 0 auto; background: none; border: 0; padding: 4px 8px; border-radius: 12px; }
.tb-home:hover { background: var(--glass); }
.tb-right { display: flex; align-items: center; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 10px; border-radius: 12px; background: var(--chip); font-weight: 900; font-variant-numeric: tabular-nums; }
.chip small { font-weight: 700; color: var(--ink-soft); margin-left: -3px; }
.chipmedal { width: 18px; height: 22px; }
@media (max-width: 760px) { .tb-home { display: none; } .tb-right { margin-left: auto; } }
@media (max-width: 420px) { .xpbar { width: 80px; } .tb-who b { max-width: 8ch; } .chip:nth-child(2) { display: none; } }

/* ----- scenes ----- */
.scene { width: 100%; height: 100%; display: block; }
.cloud { animation: drift 60s linear infinite; }
.cloud.c2 { animation-duration: 80s; animation-delay: -30s; }
.cloud.c3 { animation-duration: 95s; animation-delay: -60s; }
@keyframes drift { from { translate: -30px 0; } 50% { translate: 30px 0; } to { translate: -30px 0; } }
.waves { animation: wave 5s linear infinite; }
@keyframes wave { from { translate: 0 0; } to { translate: 20px 0; } }
.ray { animation: ray 7s ease-in-out infinite; }
@keyframes ray { 0%, 100% { opacity: .02; } 50% { opacity: .12; } }
.amb { animation: swim 30s linear infinite; }
.amb.rev { animation-name: swimrev; }
@keyframes swim { from { translate: -60px 0; } to { translate: 540px 0; } }
@keyframes swimrev { from { translate: 540px 0; } to { translate: -60px 0; } }
.sway { animation: sway 4s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes sway { from { rotate: -4deg; } to { rotate: 4deg; } }
.croc { animation: bob 3s ease-in-out infinite; }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 1.2px; } }

/* ----- splash, create, players ----- */
.splash { min-height: 70vh; display: grid; place-content: center; justify-items: center; gap: 18px; }
.splash-sub { color: var(--ink-soft); font-weight: 800; }
.create, .players { display: grid; justify-items: center; gap: 18px; padding-top: 18px; }
.create-card { display: grid; grid-template-columns: 220px 1fr; gap: 0; width: min(780px, 100%); background: var(--paper); color: var(--paper-ink); border-radius: 22px; overflow: hidden; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.create-prev { background: linear-gradient(180deg, #9fd8e8, #4fa0c0); display: grid; place-content: center; justify-items: center; gap: 10px; padding: 20px; }
.cp-av { width: 170px; height: 170px; }
.cp-av svg { width: 100%; height: 100%; }
.cp-name { font-family: var(--font-d); font-size: 1.2rem; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .25); text-align: center; word-break: break-word; }
.create-form { padding: 20px; display: grid; gap: 12px; min-width: 0; }
.lk-row { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 10px; }
.lk-lab { font-weight: 900; font-size: .9rem; }
.lk-sw { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; background: var(--c); box-shadow: 0 0 0 1px var(--line-paper); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--accent); }
.seg button { min-height: 36px; padding: 5px 10px; font-size: .88rem; }
.seg.dark button { color: var(--ink); border-color: var(--line); }
@media (max-width: 640px) { .create-card { grid-template-columns: 1fr; } .cp-av { width: 120px; height: 120px; } .lk-row { grid-template-columns: 1fr; gap: 4px; } }
.pl-grid { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.pl-card { width: 170px; display: grid; justify-items: center; gap: 6px; padding: 16px 12px; border-radius: 20px; border: 0; background: var(--glass); color: var(--ink); }
.pl-card:hover { background: var(--glass-2); }
.pl-card svg { width: 110px; height: 110px; }
.pl-card b { font-weight: 900; font-size: 1.1rem; }
.pl-card small { color: var(--ink-soft); font-weight: 700; }
.pl-plus { width: 110px; height: 110px; border-radius: 50%; border: 3px dashed var(--line); display: grid; place-items: center; font-size: 3rem; color: var(--ink-soft); }

/* ----- mentor speech ----- */
.mbubble { display: flex; gap: 10px; align-items: flex-start; }
.mb-av { width: 64px; height: 64px; flex: none; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .3)); }
.mb-say { background: var(--paper); color: var(--paper-ink); border-radius: 16px; padding: 9px 12px; position: relative; min-width: 0; box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }
.mb-say::before { content: ""; position: absolute; left: -8px; top: 18px; border: 8px solid transparent; border-left: 0; border-right-color: var(--paper); }
.mb-say b { display: block; font-size: .8rem; color: var(--eyebrow-paper); font-weight: 900; }
.mb-say p { font-weight: 700; font-size: .95rem; line-height: 1.35; }
.mbubble.mini .mb-av { width: 46px; height: 46px; }
.mbubble.mini .mb-say { padding: 7px 10px; }
.mbubble.mini .mb-say b { display: none; }
.mbubble.mini .mb-say p { font-size: .88rem; }

/* ----- home ----- */
.hub { display: grid; gap: 16px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); border-radius: 24px; overflow: hidden; background: linear-gradient(135deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03)); border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
.hero-scene { position: relative; order: 2; aspect-ratio: 16 / 10; }
.hero-scene .scene { position: absolute; inset: 0; }
.hero-copy { order: 1; padding: 24px; display: grid; align-content: center; justify-items: start; gap: 10px; min-width: 0; }
.hero-title { font-family: var(--font-d); font-weight: 400; font-size: clamp(1.9rem, 4.4vw, 3rem); line-height: 1.05; text-shadow: 0 3px 0 rgba(0, 0, 0, .3); }
.hero-text { max-width: 52ch; font-weight: 700; color: #dbe9ea; }
.hero-where { font-weight: 800; color: var(--ink-soft); margin-top: -4px; }
.hero-goal { font-weight: 700; color: var(--pop); }
.hero-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.hero-mb { margin-top: 6px; max-width: 460px; }
.hero .back { color: var(--ink); }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } .hero-scene { order: 0; } .hero-copy { padding: 16px 16px 18px; } }
.hub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 860px) { .hub-grid { grid-template-columns: 1fr; } }
.hcard { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--glass); color: var(--ink); text-align: left; min-width: 0; }
button.hcard:hover { background: var(--glass-2); }
.hc-ico { flex: none; width: 92px; height: 64px; display: grid; place-items: center; }
.hc-ico .fish { width: 100%; height: 100%; }
.hc-ico .rankbadge { width: 56px; height: 62px; }
.mentors-ico { display: flex; }
.mentors-ico svg { width: 44px; height: 44px; margin-left: -12px; }
.mentors-ico svg:first-child { margin-left: 0; }
.hc-txt { display: grid; gap: 2px; min-width: 0; flex: 1; }
.hc-txt b { font-family: var(--font-d); font-weight: 400; font-size: 1.15rem; }
.hc-txt small { color: var(--ink-soft); font-weight: 700; }
.hc-last { color: var(--pop) !important; }
.hub-foot { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; padding: 8px 0 0; }

/* ----- tabs and chips ----- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.tabs button { min-height: 42px; padding: 6px 14px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-weight: 900; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.fchip { min-height: 36px; padding: 4px 12px; border-radius: 20px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-weight: 800; }
.fchip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ----- the chart ----- */
.chartwrap { background: #e9f1ee; border-radius: 22px; padding: 10px; max-width: 820px; margin: 0 auto 18px; box-shadow: inset 0 0 0 6px #d5e3df, 0 18px 40px rgba(0, 0, 0, .3); }
.chart { width: 100%; height: auto; border-radius: 14px; }
.chart-note { color: #45626a; font-size: .82rem; font-weight: 700; text-align: center; padding: 6px 0 2px; }
.ch-lbl { font: 700 9px var(--font-b); fill: #5d7d84; }
.ch-name { font: 400 18px var(--font-d); fill: #b9a77c; letter-spacing: .3em; }
.ch-sea { font: italic 700 11px var(--font-b); fill: #5d8a94; letter-spacing: .05em; }
.pin { cursor: pointer; }
.pin:focus { outline: none; }
.pin:focus-visible circle, .pin:hover circle { stroke: var(--focus); }
.pin-ico { font-size: 11px; fill: #fff; pointer-events: none; }
.pin-lbl { font: 900 12px var(--font-b); fill: #10303d; paint-order: stroke; stroke: #e9f1ee; stroke-width: 4px; stroke-linejoin: round; }
.pin.locked .pin-lbl { fill: #6a7f86; }
.world-intro { color: var(--ink-soft); font-weight: 700; margin-bottom: 12px; max-width: 64ch; }
.spotgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.spotcard { display: grid; grid-template-rows: auto 1fr; border: 0; padding: 0; border-radius: 20px; overflow: hidden; background: var(--paper); color: var(--paper-ink); text-align: left; box-shadow: 0 10px 26px rgba(0, 0, 0, .3); transition: transform .15s; }
.spotcard:hover { transform: translateY(-2px); }
.sc-scene { position: relative; display: block; aspect-ratio: 16 / 8; overflow: hidden; }
.sc-scene .scene { position: absolute; inset: 0; }
.spotcard.locked .sc-scene { filter: grayscale(.85) brightness(.75); }
.sc-lock { position: absolute; inset: auto 10px 10px auto; background: rgba(4, 18, 28, .8); color: #fff; padding: 4px 10px; border-radius: 10px; font-weight: 900; font-size: .85rem; }
.sc-body { display: grid; gap: 4px; padding: 12px 14px 14px; }
.sc-body b { font-family: var(--font-d); font-weight: 400; font-size: 1.15rem; color: var(--paper-head); }
.sc-body small { color: var(--paper-soft); font-weight: 700; font-size: .86rem; }
.sc-meta { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: .86rem; margin-top: 4px; }
.sc-av { width: 30px; height: 30px; }
.sc-medals { margin-left: auto; display: flex; gap: 2px; }
.sc-prog { font-size: .8rem; font-weight: 800; color: var(--paper-soft); }
.medal { display: block; }
.medal.mini { width: 18px; height: 24px; }
.medal.unearned circle, .medal.unearned path { fill: #b8c6c4; stroke: #9aaaa8; }
.medal.unearned { opacity: .55; }
.medal.big { width: 110px; height: 138px; margin: 0 auto 6px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .3)); }

/* ----- a spot ----- */
.spot-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; margin-top: 16px; }
@media (max-width: 900px) { .spot-grid { grid-template-columns: 1fr; } .spot-side { order: -1; } }
.spot-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.fcard { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); }
.fcard.mission { background: rgba(47, 191, 143, .09); border-color: rgba(47, 191, 143, .35); }
.fc-art { height: 86px; border: 0; border-radius: 12px; background: linear-gradient(180deg, rgba(127, 211, 230, .22), rgba(127, 211, 230, .06)); display: grid; place-items: center; padding: 6px; }
.fc-art svg { max-width: 100%; max-height: 100%; }
.fcard:not(.known) .fc-art { --sil: #5c8496; }
.fc-body { display: grid; gap: 3px; }
.fc-body b { font-weight: 900; font-size: 1.02rem; }
.fc-body small { color: var(--ink-soft); font-weight: 700; font-size: .84rem; }
.tier { display: inline-flex; gap: 3px; vertical-align: middle; }
.tier i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .2); }
.tier i.on { background: var(--accent); }
.panel .tier i, .m-box .tier i { background: #c9d8d4; }
.panel .tier i.on, .m-box .tier i.on { background: var(--accent); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 8px; font-weight: 900; font-size: .74rem; letter-spacing: .03em; background: #d8e4e0; color: #22424f; }
.tag.prot { background: #bff0dc; color: #0b5a3e; }
.tag.pest { background: #ffd8c2; color: #8a3a0a; }
.tag.intro { background: #e6dcff; color: #45308a; }
.tag.new { background: var(--accent); color: var(--accent-ink); }
.tag.trophy { background: var(--gold); color: var(--gold-ink); }
.tag.pb { background: #bfe7ff; color: #0b4a6e; }
.side-mb .mb-av { width: 72px; height: 72px; }
.mslots { display: grid; gap: 8px; }
.mslot { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 14px; background: var(--glass); }
.mslot .medal { width: 34px; height: 44px; flex: none; }
.mslot b { display: block; font-weight: 900; }
.mslot small { display: block; color: var(--ink-soft); font-weight: 700; font-size: .84rem; }
.mslot.got { background: rgba(242, 196, 58, .12); }

/* ----- logbook ----- */
.lb-sec { margin-bottom: 8px; }
.lb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.lb-card { display: grid; gap: 4px; padding: 10px; border-radius: 16px; border: 1px solid var(--line); background: var(--glass); color: var(--ink); text-align: left; }
.lb-card:hover { background: var(--glass-2); }
.lb-art { height: 64px; display: grid; place-items: center; }
.lb-art svg { max-width: 100%; max-height: 100%; }
.lb-card:not(.known) { --sil: #4d7486; }
.lb-card b { font-weight: 900; font-size: .92rem; line-height: 1.2; }
.lb-card small { color: var(--ink-soft); font-weight: 700; font-size: .78rem; }
.tablewrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--line); }
.catchlog { width: 100%; border-collapse: collapse; font-size: .92rem; }
.catchlog th, .catchlog td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.catchlog th { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); background: rgba(0, 0, 0, .15); }
.catchlog .num { text-align: right; font-variant-numeric: tabular-nums; }
.m-ff { width: min(640px, 100%); }
.ff-art { height: 150px; border-radius: 16px; background: linear-gradient(180deg, #bfe3ee, #7cc0d6); display: grid; place-items: center; padding: 12px; margin-bottom: 12px; --sil: #2d5d73; }
.ff-art svg { max-width: 100%; max-height: 100%; }
.ff-sci { color: var(--paper-soft); margin-bottom: 8px; }
.ff-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ff-data { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 8px 0; }
.ff-data div { background: var(--paper-2); border-radius: 12px; padding: 8px 10px; }
.ff-data div.wide { grid-column: 1 / -1; }
.ff-data dt { font-size: .72rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--paper-soft); }
.ff-data dd { margin: 2px 0 0; font-weight: 700; }
.ff-facts { margin: 4px 0; padding-left: 20px; display: grid; gap: 6px; }
.ff-src { font-size: .85rem; word-break: break-word; }

/* ----- mentors ----- */
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.mcard { display: grid; justify-items: center; gap: 5px; padding: 14px 10px; border-radius: 20px; border: 1px solid var(--line); background: var(--glass); color: var(--ink); text-align: center; }
.mcard:hover { background: var(--glass-2); }
.mcard svg.portrait { width: 96px; height: 96px; }
.mcard b { font-weight: 900; }
.mcard small { color: var(--ink-soft); font-weight: 700; font-size: .82rem; }
.mc-medals { display: flex; gap: 3px; }
.mcard.locked svg.portrait { filter: grayscale(1) brightness(.7); }
.mc-lock { font-size: .78rem; font-weight: 900; color: var(--pop); }
.mentor-m { text-align: center; }
.mentor-m .portrait.big, .master-side .portrait.big { width: 140px; height: 140px; margin: 0 auto 8px; }
.m-quote { font-style: italic; font-weight: 800; color: var(--paper-head); margin: 10px 0; }
.mm-medals { display: flex; justify-content: center; gap: 14px; margin: 8px 0; }
.mm-medals span { display: grid; justify-items: center; gap: 2px; }
.mm-medals .medal { width: 34px; height: 44px; }
.mm-medals small { font-weight: 800; font-size: .78rem; color: var(--paper-soft); }

/* ----- grown-ups ----- */
.gcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.gcard { padding: 14px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); }
.gcard b { display: block; font-family: var(--font-d); font-weight: 400; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.gcard small { color: var(--ink-soft); font-weight: 700; }
.gsec { margin-top: 10px; }
.bars { display: grid; gap: 8px; max-width: 640px; }
.bar { display: grid; grid-template-columns: 140px 1fr 90px; gap: 10px; align-items: center; }
.bar-l { font-weight: 800; font-size: .9rem; }
.bar-t { height: 12px; border-radius: 6px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.bar-t i { display: block; height: 100%; background: var(--good); border-radius: 6px; }
.bar-v { font-weight: 900; font-variant-numeric: tabular-nums; }
.bar-v small { color: var(--ink-soft); font-weight: 700; }
@media (max-width: 520px) { .bar { grid-template-columns: 1fr 70px; } .bar-l { grid-column: 1 / -1; } }
.setrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.setrow > span { font-weight: 800; }

/* ----- fishing ----- */
body[data-screen="fish"] #main, body[data-screen="master"] #main, body[data-screen="mission"] #main { padding-block: 10px 16px; }
.fishscr, .master, .mission { display: grid; gap: 10px; }
.fs-bar { display: flex; align-items: center; gap: 10px; }
.fs-bar .btn.ghost { color: var(--ink); }
.fs-title { display: grid; min-width: 0; flex: 1; }
.fs-title b { font-family: var(--font-d); font-weight: 400; font-size: 1.15rem; }
.fs-title small { color: var(--ink-soft); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-hud { display: flex; gap: 8px; align-items: center; }
.hud-line { display: inline-flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 10px; background: var(--chip); }
.hud-line small { font-size: .7rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); margin-right: 2px; }
.knot { width: 14px; height: 14px; border-radius: 50%; background: var(--good); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25); }
.knot.gone { background: var(--bad); opacity: .45; }
.fs-body { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 1000px) { .fs-body { grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr); align-items: start; } .stage { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 10px); } }
.stage { position: relative; border-radius: 22px; overflow: hidden; aspect-ratio: 16 / 10; box-shadow: 0 16px 36px rgba(0, 0, 0, .35); background: #0e3247; }
.stage .scene, .stage .overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage.biting { animation: shakeY .35s 2; }
@keyframes shakeY { 0%, 100% { translate: 0 0; } 30% { translate: 0 2px; } 60% { translate: 0 -2px; } }
.stage-mb { position: absolute; top: 10px; left: 10px; right: 10px; max-width: 420px; }
.stage-meter { position: absolute; right: 10px; bottom: 10px; }
.sonar { display: grid; grid-template-columns: auto auto; column-gap: 10px; align-items: center; background: var(--sonar); color: var(--sonar-ink); border-radius: 12px; padding: 8px 12px; font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 2px #0f3a28, 0 6px 16px rgba(0, 0, 0, .35); background-image: repeating-linear-gradient(0deg, rgba(109, 255, 176, .05) 0 1px, transparent 1px 3px); min-width: 170px; }
.sonar b { font-size: 1.3rem; font-weight: 900; text-shadow: 0 0 8px rgba(109, 255, 176, .5); }
.sn-l { font-size: .68rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--sonar-dim); }
.sn-bar { grid-column: 1 / -1; height: 6px; background: #0a2a1c; border-radius: 4px; overflow: hidden; margin: 4px 0; }
.sn-bar i { display: block; height: 100%; background: var(--sonar-ink); transition: width .4s; }
.hooked-fish > svg { overflow: visible; }
.splash ellipse { animation: ring .8s ease-out forwards; transform-box: fill-box; transform-origin: center; }
.splash path { animation: drop .8s ease-out forwards; }
@keyframes ring { from { scale: .3; opacity: 1; } to { scale: 1.8; opacity: 0; } }
@keyframes drop { from { opacity: 1; } to { opacity: 0; translate: 0 -6px; } }
.fs-panel { min-height: 200px; }
.phase { display: grid; gap: 10px; }
.ph-h { font-family: var(--font-d); font-weight: 400; font-size: 1.3rem; color: var(--paper-head); line-height: 1.2; }
.ph-h.big { font-size: 2.2rem; }
.rig-target { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--paper-2); border-radius: 14px; padding: 8px 10px; }
.rig-target > div { min-width: 200px; flex: 1; display: grid; gap: 2px; }
.rig-target b { font-weight: 900; }
.rig-target small { color: var(--paper-soft); font-weight: 700; font-size: .82rem; }
.rt-art { width: 86px; height: 46px; flex: none; display: grid; place-items: center; --sil: #5c8496; }
.rt-art svg { max-width: 100%; max-height: 100%; }
.qcard { display: grid; gap: 10px; }
.q-text { font-weight: 900; font-size: 1.12rem; line-height: 1.3; color: var(--paper-head); }
.q-img { height: 120px; border-radius: 14px; background: linear-gradient(180deg, #bfe3ee, #7cc0d6); display: grid; place-items: center; padding: 10px; }
.q-img svg { max-width: 100%; max-height: 100%; }
.q-clue { margin: 0; padding: 10px 14px; border-left: 4px solid var(--accent); background: var(--paper-2); border-radius: 0 12px 12px 0; font-weight: 700; color: var(--paper-ink); }
.gap { display: inline-block; min-width: 3.2em; padding: 0 .4em; margin: 0 .1em; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font-weight: 900; text-align: center; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opts.long { grid-template-columns: 1fr; }
@media (max-width: 480px) { .opts { grid-template-columns: 1fr; } }
.opt { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; border-radius: 14px; border: 2px solid var(--line-paper); background: #fff; color: var(--paper-ink); font-weight: 800; text-align: left; box-shadow: 0 3px 0 var(--line-paper); transition: transform .08s, border-color .12s, background .12s; }
.opt:hover:not([disabled]) { border-color: var(--btn); }
.opt:active:not([disabled]) { transform: translateY(2px); box-shadow: 0 1px 0 var(--line-paper); }
.opt .okey { flex: none; width: 24px; height: 24px; border-radius: 7px; background: var(--paper-2); display: grid; place-items: center; font-size: .78rem; font-weight: 900; color: var(--paper-soft); }
.opt .otext { min-width: 0; line-height: 1.25; }
.otext.sci { font-style: italic; }
.opt .lure { width: 44px; height: 44px; flex: none; }
.opts.lures .opt { min-height: 62px; }
.opt.right { border-color: var(--right); background: #c5f0dc; box-shadow: 0 3px 0 var(--right); }
.opt.right .okey { background: var(--right); color: #fff; }
.opt.wrong { border-color: var(--wrong); background: var(--wrong-bg); }
.opt.wrong .okey { background: var(--wrong); color: #fff; }
.opt.dim { opacity: .55; }
.opt[disabled] { cursor: default; }
.fb { border-radius: 14px; padding: 10px 12px; display: grid; gap: 6px; justify-items: start; }
.fb.good { background: var(--right-bg); }
.fb.bad { background: var(--wrong-bg); }
.fb-h { font-family: var(--font-d); font-size: 1.1rem; color: var(--paper-head); }
.fb-a { font-weight: 700; }
.fb-x { font-weight: 600; color: var(--paper-soft); font-size: .94rem; }
.powerbar { position: relative; height: 26px; border-radius: 13px; background: linear-gradient(90deg, #cfe0dc, #a9c4be); overflow: hidden; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .15); }
.pb-zone { position: absolute; top: 0; bottom: 0; background: var(--good); opacity: .85; }
.pb-needle { position: absolute; top: -2px; bottom: -2px; width: 5px; margin-left: -2.5px; left: 0; background: var(--paper-head); border-radius: 3px; }
.holdbtn.down { transform: translateY(3px); box-shadow: 0 1px 0 var(--accent-edge); filter: brightness(1.08); }
.strikebtn { font-size: 1.5rem; min-height: 72px; }
.stage.biting ~ .fs-panel .strikebtn, .fishscr .strikebtn:focus-visible { animation: pulse .6s infinite alternate; }
@keyframes pulse { from { filter: brightness(1); } to { filter: brightness(1.25); } }
.catchcard { display: grid; grid-template-columns: 1fr; border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 8px 22px rgba(16, 44, 58, .18); }
.catchcard.trophy { box-shadow: 0 0 0 4px var(--gold), 0 8px 22px rgba(16, 44, 58, .18); }
.cc-art { position: relative; height: 170px; background: linear-gradient(180deg, #bfe3ee, #6fb8d0); display: grid; place-items: center; padding: 14px; }
.cc-art svg { max-width: 100%; max-height: 100%; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .2)); }
.cc-tags { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.cc-body { padding: 12px 14px 14px; display: grid; gap: 4px; }
.cc-name { font-family: var(--font-d); font-weight: 400; font-size: 1.5rem; color: var(--paper-head); }
.cc-sci { color: var(--paper-soft); }
.cc-size { display: flex; align-items: baseline; gap: 10px; }
.cc-size b { font-family: var(--font-d); font-weight: 400; font-size: 1.8rem; color: var(--accent-edge); font-variant-numeric: tabular-nums; }
.cc-size span { font-weight: 800; color: var(--paper-soft); }
.cc-fact { font-weight: 600; color: var(--paper-ink); }
.cc-xp { list-style: none; margin: 6px 0 0; padding: 8px 0 0; border-top: 1px dashed var(--line-paper); display: grid; gap: 3px; font-size: .9rem; }
.cc-xp li { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; color: var(--paper-soft); }
.cc-xp li b { font-variant-numeric: tabular-nums; color: var(--paper-ink); }
.cc-xp li.tot { font-weight: 900; color: var(--paper-ink); padding-top: 4px; }
.cc-xp li.tot b { display: inline-flex; align-items: center; gap: 4px; }
.pestq { background: #fff3e8; border-radius: 14px; padding: 10px 12px; }
.pestq .btn.right { --b: var(--good); --bt: var(--good-ink); --bd: var(--good-edge); }
.pestq .btn.dim { opacity: .5; }
.pickfish { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.pf { display: grid; gap: 4px; justify-items: center; padding: 8px; border-radius: 14px; border: 2px solid var(--line-paper); background: #fff; color: var(--paper-ink); --sil: #5c8496; }
.pf svg.fish { height: 50px; max-width: 100%; }
.pf b { font-weight: 900; font-size: .88rem; text-align: center; }
.m-pick { width: min(640px, 100%); }
.dots { display: flex; gap: 5px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.dots i.cur { background: var(--ink); }
.dots i.ok { background: var(--good); }
.dots i.no { background: var(--bad); }
.master-body { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 800px) { .master-body { grid-template-columns: 1fr; } .master-side { display: flex; align-items: center; gap: 12px; } .master-side .portrait.big { width: 80px; height: 80px; margin: 0; } }
.master-side { text-align: center; }
.m-say { background: var(--paper); color: var(--paper-ink); border-radius: 16px; padding: 10px 12px; font-weight: 800; }
.stage.under .free-fish { position: absolute; left: 0; top: 55%; width: clamp(140px, 30%, 260px); animation: cruise 16s ease-in-out infinite alternate; }
.free-fish svg { width: 100%; height: auto; }
@keyframes cruise { from { translate: 4vw 0; } to { translate: min(60vw, 560px) 10px; } }
.medal-m, .rank-m, .open-m { text-align: center; }
.mm-say { text-align: left; margin: 10px 0; }
.rank-m .rankbadge.big { width: 120px; height: 132px; margin: 0 auto 8px; display: block; }
.om-row { display: flex; gap: 12px; align-items: center; text-align: left; margin: 10px 0; }
.om-scene { width: 130px; height: 70px; border-radius: 12px; overflow: hidden; flex: none; position: relative; }
.om-scene .scene { position: absolute; inset: 0; }
.om-row b { display: block; font-family: var(--font-d); font-weight: 400; font-size: 1.1rem; }
.om-row small { color: var(--paper-soft); font-weight: 700; }
.about { text-align: left; }
.about .logo { margin-bottom: 8px; color: var(--paper-head); --logo-fish: var(--accent); }
.about-sup { background: var(--paper-2); border-radius: 14px; padding: 10px 12px; margin: 10px 0; display: grid; gap: 8px; justify-items: start; }
.flytok { font-size: 1.2rem; }

@media (max-width: 640px) {
  .stage-mb { top: 6px; left: 6px; right: 6px; }
  .stage-mb .mbubble.mini .mb-av { width: 34px; height: 34px; }
  .stage-mb .mbubble.mini .mb-say { padding: 5px 8px; border-radius: 12px; }
  .stage-mb .mbubble.mini .mb-say p { font-size: .78rem; }
  .stage-meter { right: 6px; bottom: 6px; }
  .sonar { min-width: 140px; padding: 6px 10px; }
  .sonar b { font-size: 1.05rem; }
}

/* ----- maths: casts, the berley stage, the out-of-casts gate ----- */
.chipbtn { border: 0; color: inherit; font: inherit; cursor: pointer; }
.chipbtn:hover { background: var(--glass-2); }
.chiptoken { width: 22px; height: 22px; display: block; }
@media (max-width: 420px) { .hide-xs { display: none !important; } }
.hub-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.minigrid { width: 60px; height: 60px; }
.hero-goal.soft { color: var(--ink-soft); }
.hero-casts { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--pop); }
.hero-casts .token { width: 34px; height: 34px; flex: none; }
.hud-casts { display: inline-flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 10px; background: var(--chip); font-weight: 900; }
.phase.gate { text-align: left; }
.bl-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bl-tag { position: absolute; left: 10px; top: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); font-weight: 800; font-size: .9rem; }
.bl-tag b { font-family: var(--font-d); font-weight: 400; font-size: 1.05rem; }
.bfish { position: absolute; transform: translate(-50%, -50%); animation: bfIn 1.1s cubic-bezier(.2, .8, .3, 1) both; }
.bfish .bf-in { animation: bfBob 3.2s ease-in-out infinite; }
.bfish svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35)); }
.bfish.big svg { filter: drop-shadow(0 0 8px rgba(255, 220, 120, .7)) drop-shadow(0 3px 4px rgba(0, 0, 0, .35)); }
.bfish.leave { animation: bfOut .8s ease-in forwards; }
@keyframes bfIn { from { opacity: 0; translate: calc(var(--dir) * 260px) 0; } to { opacity: 1; translate: 0 0; } }
@keyframes bfOut { to { opacity: 0; translate: calc(var(--dir) * -320px) 20px; } }
@keyframes bfBob { 0%, 100% { translate: 0 0; rotate: 0deg; } 50% { translate: calc(var(--dir) * -6px) 4px; rotate: calc(var(--dir) * 3deg); } }
.feeding .bfish .bf-in { animation-duration: .9s; }
.bdot { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #e8d6a8; opacity: .9; animation: bdFall 1.8s ease-in forwards; }
@keyframes bdFall { to { translate: var(--dx) var(--dy); opacity: 0; } }
