:root {
  color-scheme: dark;
  --red: #e5092c; --panel: #101012; --cream: #ead7d2; --muted: #aaa2a8; --gold: #b49364; --line: #ffffff16;
  font: 15px/1.5 "Chakra Petch", "Noto Sans Thai", sans-serif;
  --section-rule: linear-gradient(90deg, transparent, var(--line) 22%, var(--line) 78%, transparent);
  --control: #171417;
  --selection: #e5092c16;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; background: #100e10; }
[hidden] { display: none !important; }
button, select, summary { font: inherit; color: inherit; }
button, select, summary { cursor: pointer; }
button:focus-visible, summary:focus-visible, select:focus-visible, input:focus-visible, .bait-tray:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 3px;
  text-decoration: underline 2px #d2ab73;
  text-underline-offset: .25em;
}
select:focus-visible, input:focus-visible { box-shadow: 0 3px 0 -1px #d2ab73; }
button { min-height: 36px; border: 0; border-radius: 999px; background: var(--control); padding: 5px 14px; transition: background .18s, translate .18s; }
button:hover:not(:disabled) { background: #242024; color: #fff; }
button:active:not(:disabled) { translate: 0 1px; }
button:disabled { opacity: .5; cursor: default; }
h1, h2, h3, p, dl, dd { margin: 0; }
.river { position: fixed; inset: 0; background: linear-gradient(180deg,#10090cca,#10101260 44%,#100a0bdc),linear-gradient(95deg,#170e11a0 2%,transparent 60%,#15090b45),url("assets/river.webp") right 62% / max(182vw, 150vh) auto; }
.identity { position: fixed; top: 25px; left: 30px; display: flex; align-items: center; gap: 14px; mix-blend-mode: screen; }
.identity img { width: 82px; height: 42px; object-fit: contain; }
.brand-logo { mix-blend-mode: screen; }
.identity div { border-left: 1px solid #b4936455; padding-left: 14px; }
.identity strong, .identity small { display: block; }
.identity small, .eyebrow, .gold { color: #d6b17c; }
.preview-tools { position: fixed; bottom: 22px; left: 26px; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; font-size: .82rem; z-index: 2; max-width: calc(100vw - 52px); }
.preview-tools > span { color: #dfc8b9; background: #141013c9; border-radius: 99px; padding: 4px 9px; }
.preview-tools button { background: #191316ec; }
.preview-tools details { position: relative; }
.preview-tools summary { background: #191316ec; border: 0; border-radius: 99px; padding: 8px 12px; }
.preview-tools details[open] > button { display: block; width: 100%; border-radius: 10px; margin-bottom: 2px; }
.preview-tools details[open] { position: absolute; bottom: 40px; right: 0; background: #171217; border-radius: 16px; padding: 7px; min-width: 155px; box-shadow: 0 8px 20px #0009; }
.preview-specimen { display: grid; gap: 3px; padding: 6px 5px; color: var(--gold); }
.preview-specimen select { max-width: 180px; min-height: 32px; border: 0; border-radius: 8px; background: #261b20; color: var(--cream); padding: 3px 6px; }
[aria-pressed="true"][data-demo] { color: #ffd19a; background: #50272e; }
dialog { padding: 0; color: inherit; background: var(--panel); border: 0; box-shadow: 0 26px 85px #000a; }
dialog::backdrop { background: #0c080a6b; }
dialog[open] { animation: arrive .24s ease-out; }
.main-window { width: min(746px, calc(100% - 28px)); max-height: calc(100dvh - 50px); border-radius: 25px; overflow: hidden; }
.main-window[open] { display: grid; grid-template-rows: auto auto minmax(0, 1fr); }
.window-head { background: radial-gradient(ellipse at 19% 0%, #4b1e26a3, transparent 74%), #171215; display: flex; align-items: center; justify-content: space-between; padding: 23px 26px 16px; border-top: 2px solid #9a273c; }
.eyebrow { font-size: .74rem; letter-spacing: .08em; }
.eyebrow span { margin: 0 5px; font-size: .52rem; }
h1 { font-size: clamp(1.45rem, 4vw, 2.05rem); line-height: 1.25; margin-top: 3px; }
h2 { font-size: 1.23rem; }
.close { width: 38px; height: 38px; min-height: 0; padding: 0; font-size: 1.5rem; line-height: 1; }
.tabs { border-bottom: 1px solid var(--line); padding: 0 26px; display: flex; gap: 19px; }
.tabs button { background: none; border: 0; position: relative; border-radius: 5px; padding: 12px 6px; color: var(--muted); }
.tabs button[aria-pressed="true"] { color: var(--cream); }
.tabs button[aria-pressed="true"]::after { content: ""; position: absolute; inset: auto 4px 0; height: 2px; border-radius: 20px; background: #df3150; }
.panel { overflow: auto; scrollbar-color: #613b42 #141014; padding: 21px 26px 25px; }
.section-head { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.muted, small { color: var(--muted); }
.parts { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.part { display: grid; align-content: start; gap: 8px; background: #20191e; border-radius: 16px; border: 1px solid #ffffff13; padding: 12px; min-width: 0; }
.part b { color: #d6b17c; }
.part select { width: 100%; min-width: 0; border: 0; border-radius: 9px; background: #131115; padding: 7px 5px; }
.part small { min-height: 2.6em; }
.footer-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 14px; }
.primary { background: var(--red); color: #fff; font-weight: 600; }
.primary:hover:not(:disabled) { background: #fa1b3e; }
.repair, .journal-detail { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 13px; }
.repair h3 { font-size: 1rem; }
.species-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 7px; }
.species-grid button { min-width: 0; border-radius: 13px; font-size: .78rem; min-height: 73px; padding: 7px 4px; line-height: 1.3; }
.species-grid button[aria-pressed="true"] { border-color: #a34f5b; background: #352027; }
.species-grid button[data-known="false"] canvas { opacity: .35; filter: grayscale(1); }
canvas { display: block; width: min(100%,104px); margin: 0 auto 3px; }
.journal-detail { display: grid; gap: 6px; }
.figures { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.figures dt { font-size: .8rem; color: var(--muted); }
.figures dd { color: #e4c293; font-weight: 600; }
.hud { position: fixed; inset: auto auto max(85px, 12vh) 50%; transform: translateX(-50%); width: min(382px, calc(100% - 24px)); border: 0; border-radius: 24px; background: linear-gradient(115deg,#311820e8,#141015f5 70%); box-shadow: 0 10px 45px #0009; padding: 13px 17px; text-align: center; }
.hud h2 { font-size: 1.12rem; margin-bottom: 5px; }
.hud:focus { outline: none; }
.hud small { display: block; }
.hud .actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
kbd { font: inherit; font-weight: 600; color: #f7d7a6; display: inline-grid; place-items: center; min-width: 25px; padding: 1px 5px; border: 0; border-radius: 8px; background: #161115; }
.track, .meter { position: relative; height: 8px; border-radius: 20px; background: #ffffff18; margin: 9px 0 5px; }
.fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg,#8b2435,var(--red)); border-radius: inherit; width: 0; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: left; font-size: .8rem; }
.metrics b { float: right; }
[data-steer][aria-pressed="true"] { background: #512833; color: #ffe4ba; }
.metrics [data-value="risk"] { background: #d1485d; }
.float { position: fixed; left: 61%; top: 49%; width: 9px; height: 17px; border-radius: 80%; background: linear-gradient(#f1bf91 46%,#a02742 47%); box-shadow: 0 4px 2px #161314a8; animation: bob 2.8s ease-in-out infinite; }
.float::after { content: ""; position: absolute; top: 72%; left: 50%; width: 29px; height: 9px; translate: -50%; border-radius: 50%; border: 1px solid #efcb9c66; animation: ripple 2.8s ease-out infinite; }
.float[data-bite="true"] { animation:bite .62s ease-in-out both; }
.catch-window { width: min(389px, calc(100% - 28px)); text-align: center; border-radius: 27px; background: var(--panel); }
.catch-window .slip { padding: 19px 21px; }
.catch-window canvas { width: 176px; margin-bottom: 6px; }
.catch-window .figures { justify-content: center; margin: 10px 0; }
.catch-window .footer-actions { justify-content: center; }
.notice { position: fixed; top: 25px; right: 28px; max-width: min(335px, calc(100% - 56px)); border: 0; background: var(--panel); box-shadow: 0 8px 28px #0008; border-radius: 16px; padding: 9px 14px; z-index: 3; }
.message { color: #ffc0bb; margin-top: 8px; }
@keyframes arrive { from { opacity: 0; scale: .985; translate: 0 7px; } }
@keyframes bob { 50% { translate: 0 3px; rotate: 8deg; } }
@keyframes ripple { 0% { opacity: .8; scale: .45; } 75%, 100% { opacity: 0; scale: 1.4; } }
@keyframes bite {
  23% { translate:0 13px; scale:1 .67; opacity:.25; }
  45% { translate:0 14px; opacity:0; }
  75% { translate:0 2px; opacity:1; }
}
@media (max-width: 590px) {
  .identity { left: 15px; top: 11px; }
  .window-head { padding: 15px 15px 11px; }
  .tabs { padding-inline: 14px; gap: 10px; }
  .panel { padding: 14px; }
  .parts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .species-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .preview-tools { bottom: 10px; left: 12px; max-width: calc(100vw - 24px); }
  .hud { bottom: 90px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
