/* Production exports of the approved visual direction; text and interaction stay in DOM. */
:root { --paper:url('img/ui/paper-texture.webp'); --paper-color:#faf4e1; }
.ui-icon { width:28px; height:28px; object-fit:contain; vertical-align:middle; flex-shrink:0; }
.wallet { position:relative; }
.wallet b { display:flex; align-items:center; justify-content:flex-end; gap:4px; }
.wallet .coin { width:30px; height:30px; object-fit:contain; }
#moneyChange { position:absolute; top:calc(100% + 5px); right:0; z-index:8; background:#fff8e9; border-radius:6px; padding:3px 8px; font-size:15px; pointer-events:none; box-shadow:0 2px 8px #254c5024; }
#moneyChange:empty { display:none; }
.stage,.tools-panel,.conditions[open],.card {
  border:14px solid transparent; border-radius:0;
  border-image:url('img/ui/panel-large.webp') 48 / 14px stretch;
  background:var(--paper-color) var(--paper) center/cover;
  background-clip:padding-box; box-shadow:none;
}
.stage { padding:9px; max-height:76%; width:390px; border-width:9px; border-image-width:9px; }
button,.tools>summary,.water-picker>summary {
  border:8px solid transparent; border-radius:0;
  border-image:url('img/ui/button-secondary.webp') 24 fill / 8px stretch;
  background:transparent; min-height:44px; padding:5px 9px;
}
button:hover:not(:disabled) { background:transparent; filter:brightness(.97); }
.primary,.primary:hover:not(:disabled),.strike,.strike:hover:not(:disabled),
.card .row .primary {
  border:8px solid transparent; border-image:url('img/ui/button-primary.webp') 24 fill / 8px stretch;
  background:transparent; color:#fff9e9; text-shadow:0 1px 1px #193f43; font-weight:600;
}
button:disabled { opacity:.5; filter:grayscale(.65); }
button:disabled:hover { filter:grayscale(.65); }
.tools>summary { width:44px; padding:0; }
.water-picker { position:relative; z-index:4; flex:1 1 auto; min-width:0; }
.water-picker>summary { list-style:none; display:flex; align-items:center; justify-content:space-between; gap:4px; cursor:pointer; font:15px Georgia,serif; white-space:nowrap; }
.water-picker>summary>span:first-of-type { overflow:hidden; text-overflow:ellipsis; }
/* HUD after art/ui-v002: the water with its picture, money and day in one line. */
.water-thumb { width:44px; height:30px; flex-shrink:0; object-fit:cover; border-radius:6px; }
.water-options .water-thumb { width:60px; height:40px; vertical-align:middle; margin-right:8px; }
.water-picker>summary { justify-content:flex-start; }
.water-picker>summary>span[aria-hidden] { margin-left:auto; }
.wallet { display:flex; flex-direction:row; align-items:center; gap:8px; }
.wallet small#day { margin:0; padding-left:8px; border-left:1px solid var(--line); font-size:14px; text-transform:capitalize; }
.gate { display:flex; align-items:center; flex-wrap:wrap; gap:2px 8px; }
.gate .fish-icon { width:26px; height:16px; color:var(--teal); flex-shrink:0; }
.gate .hint { flex:1 1 0; }
.gate .cells { flex:1 1 100%; max-width:none; }
.water-picker>summary::-webkit-details-marker { display:none; }
.water-options { position:absolute; left:0; top:calc(100% + 5px); width:min(360px,calc(100vw - 36px)); padding:12px; background:var(--paper-color) var(--paper) center/cover; border:10px solid transparent; border-image:url('img/ui/frame-small.webp') 24 / 10px stretch; background-clip:padding-box; box-shadow:0 5px 18px #18394240; }
.water-options .tabs { padding:0; flex-direction:column; gap:8px; }
.water-options .tab { flex:initial; min-height:48px; padding:6px 12px; font-size:14px; }
.water-options .tab.on { background:#d8e6d5; color:#224f52; }
.water-options .tab small { display:block; font-size:12px; color:var(--dim); }
.gate { flex-shrink:0; margin:0 8px; padding:3px 8px; border:6px solid transparent; border-image:url('img/ui/frame-small.webp') 24 / 6px stretch; background:var(--paper-color) var(--paper) center/cover; background-clip:padding-box; }
.gate .hint { font-size:12px; }
.cells { flex:1 1 100%; max-width:none; }
.g { height:4px; }
.view-title { margin:0; display:flex; align-items:center; gap:10px; font:24px Georgia,serif; flex-shrink:0; }
.view-title .ui-icon { width:38px; height:38px; }
#v-gear,#v-tank,#v-stand { margin:0 8px 6px; border:12px solid transparent; border-image:url('img/ui/panel-large.webp') 48 / 12px stretch; background:var(--paper-color) var(--paper) center/cover; background-clip:padding-box; }
.gear { grid-template-columns:104px minmax(0,1fr); column-gap:14px; background-image:url('img/ui/item-watercolor-wash.webp'),var(--paper); background-position:10px 14px,center; background-size:110px 110px,cover; background-repeat:no-repeat; }
.gear .ico { grid-column:1; grid-row:1 / 4; width:104px; height:104px; align-self:center; }
.gear>div:not(.wide) { grid-column:2; }
.gear .wide { grid-column:2; }
.gear .name { font:22px Georgia,serif; margin:3px 0 7px; }
.gear .hint { font-size:12px; line-height:1.5; }
.gear button { font-size:14px; }
.catch { border-image:url('img/ui/frame-small.webp') 24 / 6px stretch; border-width:6px; grid-template-columns:86px minmax(0,1fr); padding:7px; }
.catch .thumb { width:86px; height:76px; background:url('img/ui/item-watercolor-wash.webp') center/contain no-repeat; }
.catch .name { font-size:20px; }
.catch .name .ui-icon,.catch .rec .ui-icon { width:22px; height:22px; }
.catch .kg,.catch .rank,.catch .new,.catch .rec,.catch .hint { font-size:12px; }
.catch .price { font-size:14px; }
.catch .row { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.catch .row .primary { grid-column:1 / -1; order:-1; }
.card .row button { font-size:14px; }
.catch-heading { min-height:32px; justify-content:center; gap:6px; }
.catch-heading .ui-icon { width:26px; height:26px; }
.profit { font-size:13px; }
.pond-title { display:flex; align-items:center; gap:7px; font:18px/1.3 Georgia,serif; margin:14px 0 7px; flex-shrink:0; }
.pond-title .ui-icon { width:34px; height:34px; }
.set-reward { display:flex; align-items:center; gap:6px; flex-wrap:wrap; font-size:12px; color:var(--dim); margin:6px 0 14px; }
.set-reward .ui-icon { width:23px; height:23px; }
.cell { background:var(--paper-color); border-color:#b4beb0; }
.cell.got { background:#fff8e9; }
.cell small { font-size:12px; }
.cell .ui-icon { width:26px; height:26px; }
.stats,.hint { font-size:12px; }
.card .line { font-size:14px; }
.card .line button { font-size:12px; min-height:44px; }
.status { font-size:12px; }
.conditions summary,.action-note { font-size:12px; }
.track { border:6px solid transparent; border-radius:12px; border-image:url('img/ui/timing-track-frame.webp') 36 / 6px stretch; height:34px; background:#dbe2d1; background-clip:padding-box; }
.zone { background:#65977580; }
.zone.mid { background:#377c568f; }
.marker { background:#d6a44c; }
.tabbar { border:10px solid transparent; border-image:url('img/ui/navigation-base.webp') 32 fill / 10px stretch; border-radius:0; background:none; gap:5px; padding:1px 3px max(2px,env(safe-area-inset-bottom)); }
.tabbar button { border:0; border-image:none; background:none; color:var(--text); min-height:64px; padding:3px 5px; font-size:12px; }
.tabbar button:hover:not(:disabled) { background:none; }
.tabbar button .ui-icon { width:34px; height:30px; }
.tabbar button.on { background:url('img/ui/active-tab-wash.webp') center/100% 100% no-repeat; color:#fff9e9; }
.tabbar button.on:hover:not(:disabled) { background:url('img/ui/active-tab-wash.webp') center/100% 100% no-repeat; color:#fff9e9; }
.tabbar button.on .ui-icon { filter:brightness(0) invert(1); }
.tabbar button:disabled { opacity:.5; }
.tabbar button i { background:#ac7837; }
@media(max-width:600px) {
  .wallet small { font-size:12px; }
  .wallet .coin { width:24px; height:24px; }
  .view { padding:8px; gap:10px; }
  #v-fish { padding:0; gap:0; }
  .stage { width:calc(100% - 16px); right:8px; bottom:6px; max-width:none; padding:6px; border-width:9px; border-image-width:9px; }
  .gear { grid-template-columns:76px minmax(0,1fr); column-gap:10px; }
  .gear .ico { width:76px; height:76px; }
  .gear .name { font-size:20px; }
  .tabbar button { min-height:60px; }
  .tabbar button .ui-icon { width:30px; height:28px; }
}
@media(max-height:600px) {
  .gate { display:none; }
  .stage { max-height:calc(100% - 12px); }
  .tabbar { border-width:6px; border-image-width:6px; padding:0; }
  .tabbar button { min-height:44px; flex-direction:column; }
  .tabbar button .ui-icon { width:24px; height:24px; }
}
@media(max-height:600px) and (min-width:600px) {
  .tabbar button { flex-direction:row; }
  .stage { width:calc(100% - 16px); }
  .fishing-footer { padding:8px; }
}

/* The scene fills the game; plates lie over it and never move it (art/ui-v002). */
body { background:var(--paper-color) var(--paper) center/cover; }
#app { position:relative; overflow:hidden; max-width:calc(100dvh * 9 / 16); background:#83a4a0; }
#scene { position:absolute; inset:0; z-index:0; overflow:hidden; container-type:size; --at-x:.5; --at-y:.5; background:linear-gradient(160deg,#9bb6ad,#4d776f 55%,#2b504b); }
#scene[data-water="1"] { background:linear-gradient(160deg,#8faeb6,#446b77 55%,#244e5b); }
#scene[data-water="2"] { background:linear-gradient(160deg,#87bbc5,#367f98 55%,#20536c); }
#sceneLoad { position:absolute; inset:0; z-index:1; display:grid; place-content:center; justify-items:center; gap:10px; color:#fff9e9; font-weight:700; text-align:center; text-shadow:0 1px 3px #1f3a40; pointer-events:none; }
#sceneLoad progress { width:min(210px,70vw); height:12px; accent-color:#e8bc73; }
#sceneLoad button { pointer-events:auto; }
.scene-pending #cast,.scene-pending #actionNote { visibility:hidden; }
/* Like object-fit:cover, but the canvas takes its real size on screen: the scenes pick their resolution from it. */
#scene canvas { --w:max(100cqw,calc(100cqh * 941 / 1672)); --h:calc(var(--w) * 1672 / 941); position:absolute; display:block; width:var(--w); height:var(--h); left:calc((100cqw - var(--w)) * var(--at-x)); top:calc((100cqh - var(--h)) * var(--at-y)); }
/* On a phone narrower than the picture: the point that keeps the heroine and the float in frame. */
#scene[data-water="1"] { --at-x:.3; }
main { position:relative; z-index:1; overflow:visible; }
#v-fish { overflow:visible; background:none; }
.hud { z-index:5; align-items:center; gap:6px; padding:8px; background:none; border:0; }
.wallet { flex:0 1 auto; min-width:0; padding:0 6px; border:6px solid transparent; border-image:url('img/ui/frame-small.webp') 24 / 6px stretch; background:var(--paper-color) var(--paper) center/cover; background-clip:padding-box; }
.wallet b { font-size:19px; }
.wallet small { display:block; margin-top:0; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wallet .coin { width:24px; height:24px; }
.tools>summary { background:var(--paper-color); background-clip:padding-box; flex-shrink:0; }
.water-picker>summary,.tools>summary { color:var(--text); }
/* The plate's own border is the margin; "Северные воды" has to fit at 360 px. */
.water-picker>summary { padding:5px 2px; }
@media(max-width:380px) { .water-picker>summary { font-size:14px; } .wallet small { font-size:11px; } }

.stage { width:calc(100% - 16px); right:8px; bottom:6px; max-width:none; }
/* The catch panel grows up to the top of the scene (user 11.11): capped at 76 % it hid its buttons on a 412×790 phone while the scene above stood empty. */
.stage:has(.cards) { max-height:calc(100% - 12px); }
/* A message alone is a label on the scene, not a panel. */
.stage:not(:has(.track,.cards)) { background:none; border:0; border-image:none; padding:0; align-items:center; overflow:visible; }
/* Words on the scene: light text with a dark outline, no plates (user 11.11). */
.stage:not(:has(.track,.cards))>*:not(.float) { padding:4px 12px; text-align:center; color:#fff9e9; text-shadow:0 0 2px #1f3a40,0 0 2px #1f3a40,0 1px 3px #1f3a40cc; font-weight:700; }
.stage:not(:has(.track,.cards))>.bite { font-size:26px; padding:6px 40px; }
.stage .wait::first-letter { text-transform:uppercase; }

.fishing-footer { display:flex; flex-direction:column; gap:4px; padding:4px 8px 6px; background:none; border:0; transition:transform .18s ease-out,visibility 0s; }
.fishing-footer .bar { order:2; }
.fishing-footer .status { order:3; min-height:44px; }
.action-note { margin:0; padding:2px 8px; align-self:center; text-align:center; font-size:13px; color:#fff9e9; text-shadow:0 0 2px #1f3a40,0 0 2px #1f3a40,0 1px 3px #1f3a40cc; font-weight:700; }
.action-note:empty { display:none; }
#pity,.conditions summary { padding:2px 8px; color:#fff9e9; text-shadow:0 0 2px #1f3a40,0 0 2px #1f3a40,0 1px 3px #1f3a40cc; font-weight:700; }
.conditions summary { min-height:32px; }
.status { min-width:0; }
.conditions { padding:6px 0; }
.conditions[open] { padding:10px 16px 16px; }
.tabbar { position:relative; z-index:2; margin:0 6px 6px; }
#panelTab { flex:0 0 44px; align-self:center; height:44px; min-height:44px; padding:0; border:6px solid transparent; border-image:url('img/ui/button-secondary.webp') 24 fill / 6px stretch; color:var(--text); }
#panelTab svg { width:21px; height:21px; }
#panelTab[aria-expanded="true"] svg { transform:rotate(180deg); }
.tabbar:has(#panelTab[aria-expanded="false"]) { max-width:340px; width:calc(100% - 12px); margin-inline:auto; border:0; border-image:none; padding:0 0 env(safe-area-inset-bottom); }
.tabbar:has(#panelTab[aria-expanded="false"]) button { min-height:44px; padding:0; background:none; }
.tabbar:has(#panelTab[aria-expanded="false"]) button > span,
.tabbar:has(#panelTab[aria-expanded="false"]) button > i { display:none; }
.tabbar:has(#panelTab[aria-expanded="false"]) .ui-icon { width:26px; height:26px; opacity:.84; filter:brightness(0) invert(1) drop-shadow(0 1px 2px #193f43) drop-shadow(0 0 3px #fff1c899); }
.tabbar:has(#panelTab[aria-expanded="false"]) .on .ui-icon { opacity:.98; }
@media(max-width:360px) {
  .tabbar button { min-width:44px; padding-inline:0; font-size:10px; }
}
/* The whole approach: the main button stays where it is, the lines around it leave without moving it. */
.panel-hidden .fishing-footer > :not(.bar),.panel-hidden .gate { visibility:hidden; }
#phase .ui-icon { width:30px; height:30px; vertical-align:middle; }
.series-count { display:flex; align-items:center; gap:6px; font-size:20px; }
.series-count .ui-icon { width:30px; height:26px; }
.tools-panel label { display:flex; align-items:center; gap:8px; min-height:44px; }
.tools-panel select { min-height:36px; }

/* Screens */
.view .card { border-width:6px; border-image:url('img/ui/frame-small.webp') 24 / 6px stretch; }
.catch .thumb { object-fit:contain; }
.catch .name::first-letter,.cell b::first-letter { text-transform:uppercase; }
.stage .card { border-width:6px; border-image:url('img/ui/frame-small.webp') 24 / 6px stretch; }
.stage:has(>.cards>.catch:only-child) { background:var(--paper-color) var(--paper) center/cover; background-clip:padding-box; }
/* The catch plate after art/ui-v002/05 (one fish) and 06 (several); the fish on the line has already been seen, so the plate may be large. */
.catch-heading b { font:20px Georgia,serif; color:var(--text); }
.stage:has(>.cards>.catch:only-child) .catch-heading { align-self:center; margin-bottom:-4px; }
.cards:has(>.catch:only-child) .catch { grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:6px 12px; padding:6px 4px; border:0; border-image:none; background:none; }
.cards:has(>.catch:only-child) .thumb { width:100%; height:128px; background:url('img/ui/item-watercolor-wash.webp') center/90% 90% no-repeat; }
.cards:has(>.catch:only-child) .catch .name { font-size:21px; line-height:1.1; overflow-wrap:anywhere; }   /* «Краснопёрка» fits a 375 px phone at 21 px */
.cards:has(>.catch:only-child) .catch .kg { font:22px Georgia,serif; color:var(--text); margin-top:4px; }
.cards:has(>.catch:only-child) .catch .rank { font-size:14px; margin:8px 0; }
.cards:has(>.catch:only-child) .catch .price { padding-top:8px; border-top:1px solid var(--line); font:16px Georgia,serif; }
.cards:has(>.catch:only-child) .catch .row { gap:8px; margin-top:4px; }
.cards:has(>.catch:only-child) .catch .row .primary { flex:1 1 100%; min-height:56px; font-size:17px; }
.cards:has(>.catch:only-child) .catch .row button:not(.primary) { flex:1 1 0; font-size:14px; }
.catch .rank::first-letter { text-transform:uppercase; }
.catch .rank .ui-icon { width:24px; height:24px; margin-right:4px; vertical-align:-7px; }
.catch .price .coin { width:18px; height:18px; vertical-align:-3px; }
.catch .price .hint { display:block; margin-top:2px; font:12px "Segoe UI",sans-serif; color:var(--dim); }
.card .row button .ui-icon { width:22px; height:22px; vertical-align:middle; margin-right:6px; }
.card .row button .coin { width:20px; height:20px; vertical-align:-4px; }
.card .row button small { display:block; font-size:12px; font-weight:normal; opacity:.9; }
/* Several fish: the catch as tiles, the picked one in the large card above; a dot — the stand needs it, «×7» — one species seven times. */
.catch-strip { display:flex; gap:6px; flex-shrink:0; overflow-x:auto; padding:2px 2px 4px; scrollbar-width:thin; }
.catch-strip button { position:relative; flex:0 0 68px; height:56px; padding:2px; border-width:6px; border-image-width:6px; box-shadow:inset 0 -3px var(--catch-rank,var(--line)); }
.catch-strip button[aria-current] { border-image-source:url('img/ui/active-tab-wash.webp'); border-image-slice:24 fill; }
.catch-strip img { width:100%; height:100%; object-fit:contain; }
.catch-strip .dot { position:absolute; top:-2px; right:-2px; width:10px; height:10px; border-radius:50%; background:#ac7837; box-shadow:0 0 0 2px var(--paper-color); }
.catch-strip i { position:absolute; right:-3px; bottom:-3px; margin:0; background:#ac7837; }
/* With a catch on the plate the next cast stands beside «Продать», its note below (05, 06). */
#app:has(.stage .cards) .fishing-footer .bar { flex-direction:row; }
#app:has(.stage .cards) .fishing-footer .bar > button { flex:1 1 0; }
#app:has(.stage .cards) .action-note { order:3; background:none; }
#cast .ui-icon { width:24px; height:24px; vertical-align:middle; margin-right:6px; }
/* While sorting a catch the panel keeps only what the decision needs. */
#app:has(.stage .cards) .fishing-footer .status { display:none; }
.card .row button { min-width:0; }
.parts { display:flex; gap:4px; flex-shrink:0; }
.parts button { flex:1; min-width:0; font-size:13px; padding:4px; }
.parts button.on,.parts button.on:hover:not(:disabled) { border-color:transparent; border-image:none; background:url('img/ui/active-tab-wash.webp') center/100% 100% no-repeat; color:#fff9e9; }
#v-stand[data-part="sets"] [data-section]:not([data-section="sets"]),
#v-stand[data-part="elite"] [data-section]:not([data-section="elite"]),
#v-stand[data-part="myth"] [data-section]:not([data-section="myth"]) { display:none; }
.stats-box { flex-shrink:0; font-size:12px; }
.stats-box summary { min-height:44px; display:flex; align-items:center; cursor:pointer; color:var(--teal); }
.stand,.elite-grid { grid-template-columns:repeat(auto-fill,minmax(92px,1fr)); }
.cell { background:transparent; }
.cell .pic { object-fit:contain; }
.cell .pic.sil,.cell.locked .pic.sil { filter:brightness(0); opacity:.28; }

@media(max-height:600px) and (min-width:600px) {
  #app { max-width:none; background:var(--paper-color) var(--paper) center/cover; }
  #scene { right:260px; }
  #scene,#scene[data-water="1"] { --at-x:.5; --at-y:.45; }
  .fishing-footer { background:var(--paper-color) var(--paper) center/cover; }
  /* Here the panel stands beside the scene, not over it. */
  .panel-hidden .fishing-footer { transform:none; visibility:visible; transition:none; }
}
/* The menu grew a line (the rank moved here from the HUD); it scrolls inside rather than cover the main button. */
.tools-panel { max-height:calc(100dvh - 300px); overflow-y:auto; }   /* 300: the float of the cast stands higher than the old button */
/* Playtest 09.11: the whole name of the water should show. The picture in the HUD goes below 480 px (the list keeps its pictures), a long name wraps rather than ends in «…». */
@media(max-width:480px) { .water-picker>summary .water-thumb { display:none; } }
.water-picker>summary>span:first-of-type { white-space:normal; line-height:1.1; }
/* Pictures in one column and names in another, rather than centred each on its own. */
.water-options .tab { display:flex; align-items:center; justify-content:flex-start; text-align:left; }
#app:has(.stage .cards) .fishing-footer .bar > button { font-size:15px; }
/* One HUD line has to hold «Пруды и реки» and «5 033 | День 1 · Пн» on a phone; below 380 px the word «День» goes. */
.wallet b { font-size:17px; }
.wallet .coin { width:20px; height:20px; }
.wallet small#day { font-size:12px; padding-left:6px; }
.wallet { gap:6px; }
@media(max-width:380px) { .day-word { display:none; } }
/* Short screens (a phone with its address bar, landscape): the catch plate fits without scrolling to its main button.
   The picture shrinks first, then selling and the tank turn into signs on the main button's line. */
@media(max-height:760px) {
  /* 360×640: a record that is also a trophy, with a two-line name and «было», needs 309 px; 76% of the room gave 262. */
  .stage { max-height:calc(100% - 12px); }
  .catch-heading { min-height:32px; }
  .catch-heading b { font-size:17px; }
  .catch-strip button { flex-basis:56px; height:46px; }
  .cards:has(>.catch:only-child) .thumb { height:clamp(72px,14dvh,104px); }
  .stage:has(>.cards) { gap:4px; }
  .cards:has(>.catch:only-child) .catch { gap:4px 10px; padding:2px 4px; }
  .cards:has(>.catch:only-child) .catch .name { font-size:19px; }
  .cards:has(>.catch:only-child) .catch .kg { font-size:16px; margin-top:2px; }
  .cards:has(>.catch:only-child) .catch .rank { margin:2px 0; font-size:12px; }
  .cards:has(>.catch:only-child) .catch .price { font-size:15px; }
  .cards:has(>.catch:only-child) .catch .price { padding-top:4px; }
  .catch .price .hint { display:none; }
  .cards:has(>.catch:only-child) .catch .row { grid-template-columns:minmax(0,1fr) 48px 48px; }
  .cards:has(>.catch:only-child) .catch .row .primary { grid-column:auto; min-height:48px; font-size:14px; padding:4px 6px; }
  .cards:has(>.catch:only-child) .catch .row .primary small { display:none; }
  .cards:has(>.catch:only-child) .catch .row button:not(.primary) { font-size:0; padding:4px; }
  .cards:has(>.catch:only-child) .catch .row button:not(.primary) .ui-icon { margin:0; width:26px; height:26px; }
  #app:has(.stage .cards) .action-note { display:none; }
}
@media(max-height:500px) {
  /* 812×375: a card with its heading and nine tiles overflowed by 19 px; the strip still scrolls by touch and keyboard. */
  .catch-strip { scrollbar-width:none; }
  .catch-strip button { height:44px; }
  .catch-heading { min-height:26px; padding-block:0; }
  /* The weight runs on after the name, so a record that is also a trophy takes one line less. */
  .cards:has(>.catch:only-child) .catch .kg { display:inline; }
  .cards:has(>.catch:only-child) .catch { grid-template-columns:90px minmax(0,1fr) minmax(0,1fr); align-items:center; }
  .cards:has(>.catch:only-child) .catch .row { grid-column:3; grid-row:1; margin:0; grid-template-columns:1fr 1fr; }
  .cards:has(>.catch:only-child) .catch .row .primary { grid-column:1 / -1; }
}
/* Praise and one-time lines (FISHING-UX.md §8): a plate over the scene above the catch card; it takes no taps. */
#praise { position:fixed; z-index:6; display:flex; align-items:center; gap:8px; width:max-content; max-width:min(340px,calc(100vw - 24px)); padding:8px 24px; transform:translateX(-50%); font:15px/1.3 Georgia,serif; color:#fff9e9; text-shadow:0 0 2px #1f3a40,0 0 2px #1f3a40,0 1px 3px #1f3a40cc; font-weight:700; text-align:center; pointer-events:none; animation:praise-in .25s ease-out; }
#praise[hidden] { display:none; }
#praise .ui-icon { width:28px; height:28px; flex-shrink:0; }
@keyframes praise-in { from { opacity:0; transform:translate(-50%,8px); } }
.tank-header { display:grid; flex-shrink:0; align-items:start; }
.tank-header > * { grid-area:1 / 1; }
.tank-header .view-title { min-height:44px; padding-right:48px; }
#tankCount:not(:empty) { padding:2px 8px; border:1px solid var(--line); border-radius:999px; color:var(--dim); font:600 13px "Segoe UI",sans-serif; }
.tank-help summary { list-style:none; display:grid; place-items:center; width:44px; height:44px; margin-left:auto; border:1px solid var(--line); border-radius:50%; color:var(--teal); font:20px Georgia,serif; cursor:pointer; }
.tank-help summary::-webkit-details-marker { display:none; }
.tank-help p { margin:8px 0 0; padding:8px 10px; background:#e9e6d6; border-radius:8px; font-size:13px; }
.tank-empty { padding:24px 8px; text-align:center; }
.tank-empty p { margin:0 0 12px; font:20px Georgia,serif; }
.tank-group { padding:8px 10px; border:1px solid var(--line); border-top:2px solid var(--tank-rank); border-radius:12px; background:#fff9e9b3; }
.tank-group h3 { margin:0 2px 2px; color:var(--tank-rank); font:600 15px Georgia,serif; }
.tank-group h3::first-letter,.tank-fish-info b::first-letter { text-transform:uppercase; }
.tank-fish { margin:0; padding:0; list-style:none; }
.tank-fish li { display:flex; align-items:center; gap:6px; min-height:52px; padding:4px 0; }
.tank-fish li + li { border-top:1px solid var(--line); }
.tank-sprite,.tank-outcome { flex-shrink:0; width:clamp(58px,18vw,76px); height:44px; background:var(--rarity) center/100% 100% no-repeat; }
.tank-sprite { padding:3px 4px; object-fit:contain; }
.tank-fish-info { flex:1; min-width:0; line-height:1.2; }
.tank-fish-info b { display:block; overflow-wrap:anywhere; }
.tank-fish-info .kg { color:var(--dim); font-size:12px; }
.tank-group button { border:1px solid #a9b9ad; border-radius:8px; background:#f9f6e9; font-size:13px; }
.tank-group button:hover:not(:disabled) { background:#eeeee1; }
.tank-group .tank-mount { width:44px; padding:0; flex-shrink:0; }
.tank-mount .ui-icon { width:24px; height:24px; }
.tank-sale { display:flex; align-items:center; justify-content:center; gap:4px; min-width:54px; padding:3px 6px; font-weight:600; white-space:nowrap; font-variant-numeric:tabular-nums; }
.tank-sale .coin { width:18px; height:18px; }
.tank-group .tank-exchange { display:flex; width:100%; align-items:center; justify-content:space-between; gap:8px; margin-top:6px; padding:3px 6px 3px 9px; border-color:var(--teal); background:var(--teal); color:#fff9e9; text-align:left; }
.tank-group .tank-exchange:hover:not(:disabled) { background:#245d5f; }
.tank-group .tank-exchange:disabled { opacity:1; filter:none; border-color:var(--line); background:#f2eee0; color:var(--text); }
.tank-exchange-info { display:grid; gap:3px; }
.tank-progress { display:flex; align-items:center; gap:7px; font-size:12px; font-variant-numeric:tabular-nums; }
.tank-slots { display:flex; gap:3px; }
.tank-slots > span { display:grid; place-items:center; width:20px; height:16px; border:1px dashed currentColor; border-radius:4px; }
.tank-slots > .filled { border-style:solid; border-color:var(--tank-rank); background:#fffaed; color:var(--tank-rank); }
.tank-slots .fish-icon { width:14px; height:9px; }
.tank-outcome { position:relative; display:grid; place-items:center; border-radius:6px; background-color:#fffaed; color:var(--next-rank); }
.tank-outcome .fish-icon { width:38px; height:24px; }
.tank-outcome b { position:absolute; bottom:3px; right:6px; display:grid; place-items:center; width:17px; height:17px; border:1px solid currentColor; border-radius:50%; background:#fffaed; line-height:1; }
/* UI v003 (FISHING-UX.md §5). The rank's wash behind the fish and its name on a ribbon inside the picture; the lettering marks a new species. */
.catch .pic { position:relative; align-self:start; background:var(--rarity) center/100% 100% no-repeat; }
.catch .pic .thumb,.cards:has(>.catch:only-child) .pic .thumb { display:block; width:100%; background:none; }
.catch .pic .ribbon { position:absolute; left:50%; bottom:2px; transform:translateX(-50%); min-width:72%; padding:2px 14px 3px; text-align:center; font:600 12px "Segoe UI",sans-serif; white-space:nowrap; background:url('img/ui/rarity-ribbon.webp') center/100% 100% no-repeat; }
.catch .pic .ribbon::first-letter { text-transform:uppercase; }
.catch .pic .new-species { position:absolute; top:-2px; left:-4px; width:78%; max-width:150px; pointer-events:none; }
/* Adding to the collection: the fish's own set (the same sign as on its «set» line), then the words «В коллекцию» and the bonus. */
.catch .row .primary { display:flex; align-items:center; justify-content:center; gap:8px; }
.card .row .primary > .ui-icon { width:36px; height:36px; margin:0; flex-shrink:0; filter:drop-shadow(0 0 2px #fff9e9); }
.catch .row .primary b { white-space:nowrap; }
/* Bulk sale as an exchange: fish ×N → coin ≈sum. */
#sellAll .trade { display:inline-flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:2px 4px; font-size:17px; }
#sellAll .fish-icon { width:30px; height:19px; }
#sellAll .coin { width:22px; height:22px; }
/* No button on the scene (user 11.11): a tap anywhere casts, strikes and holds. Ready to cast, only the price stays on the water;
   while the action is new or on the day's first approach (.hand-new), a still hand taps the water and big rings spread from it: the whole water answers, not a spot.
   The phase buttons stay for the keyboard, unseen. */
#cast.ready { position:relative; flex:0 0 auto; align-self:center; width:120px; min-height:104px; margin:0 auto; padding:0; border:0; border-image:none; background:none; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; color:var(--text); font:700 18px Georgia,serif; }
#phase .tap { position:absolute; width:1px; height:1px; min-height:0; padding:0; overflow:hidden; clip-path:inset(50%); }
.cast-price { display:flex; align-items:center; gap:4px; padding:3px 12px; border-radius:999px; background:#fff9e9; box-shadow:0 0 0 1.5px #1f3a40,0 2px 6px #1d3c4440; font-variant-numeric:tabular-nums; line-height:1.2; }
.cast-price .coin { width:20px; height:20px; }
#cast.ready:disabled { opacity:1; }
#cast.ready:disabled .cast-price { color:#b8432f; }
.cast-hint { display:none; position:absolute; left:calc(50% + 50px); top:-40px; pointer-events:none; }
.hand-new #cast.ready:not(:disabled) .cast-hint,.idle #cast.ready:not(:disabled) .cast-hint { display:block; opacity:.6; }
.tap-hand { position:absolute; left:-24px; top:-12px; width:52px; height:57px; fill:#fff9e9; stroke:#1f3a40; stroke-width:1.1; stroke-linejoin:round; filter:drop-shadow(0 3px 3px #0004); animation:hand-tap 1.1s ease-in-out infinite; }
.tap-ring { opacity:0; animation:hand-ring 1.1s ease-out infinite; }
@keyframes hand-tap { 0%,100% { transform:translate(7px,9px) rotate(-10deg); } 45% { transform:rotate(-10deg) scale(.92); } }
@keyframes hand-ring { 45% { opacity:0; } 55% { opacity:1; } 100% { opacity:0; } }
/* Interface rings, not water ripples: a light outline like the hand's, so they are not taken for a bite. One per press. */
.cast-hint .ring { display:block; position:absolute; margin:0; padding:0; background:none; left:-180px; top:-180px; width:360px; height:360px; box-sizing:border-box; border-radius:50%; border:7px solid #fff9e9; box-shadow:0 0 0 1px #1f3a4040; opacity:0; animation:big-ring 2.2s ease-out infinite; }
.cast-hint .ring + .ring { animation-delay:1.1s; }
@keyframes big-ring { 0%,22% { transform:scale(.1); opacity:0; } 25% { opacity:1; } 100% { transform:scale(1); opacity:0; } }
/* The bite: «!» over the float, the hand on it the first times. */
.bite-mark { position:fixed; z-index:5; width:0; height:0; pointer-events:none; }
.bite-mark i { position:absolute; left:-17px; top:-62px; display:grid; place-items:center; width:34px; height:34px; border-radius:50%; font:900 24px/1 Georgia,serif; color:#fff9e9; background:#b8432f; box-shadow:0 0 0 2.5px #fff9e9,0 3px 6px #0004; animation:bite-pop .45s ease-in-out infinite; }
@keyframes bite-pop { 50% { transform:scale(1.15) rotate(8deg); } }
@media (prefers-reduced-motion:reduce) { .tap-hand,.tap-ring,.cast-hint .ring,.bite-mark i { animation:none; } .cast-hint .ring:first-of-type { opacity:.6; transform:scale(.3); } }
.hand-new #pity { visibility:hidden; }
/* Where the finger landed, the water answers with a ring. */
.tap-splash { position:fixed; z-index:5; width:64px; height:64px; margin:-32px 0 0 -32px; border-radius:50%; border:3px solid #fff9e9; pointer-events:none; animation:tap-splash .6s ease-out forwards; }
@keyframes tap-splash { from { transform:scale(.2); opacity:1; } to { transform:scale(1.4); opacity:0; } }
/* The fight's marker: thick and outlined, so it reads over the green zones. */
.marker { width:6px; border-radius:3px; background:#7a3f12; box-shadow:0 0 0 2px #fff9e9; }

#phase:has(.fight-controls) { display:flex; justify-content:center; }
.fight-controls { display:grid; justify-items:center; gap:4px; }
#fightDistance { appearance:none; width:116px; height:7px; border:1px solid #fff1c8; border-radius:6px; overflow:hidden; background:#24474ddd; }
#fightDistance::-webkit-progress-bar { background:transparent; }
#fightDistance::-webkit-progress-value { background:#edbb62; }
#fightDistance::-moz-progress-bar { background:#edbb62; }
#phase #reel { position:relative; isolation:isolate; display:grid; place-items:center; width:80px; height:68px; min-height:44px; padding:0; border:0; background:none; touch-action:none; user-select:none; -webkit-touch-callout:none; }
#reel::before { content:""; position:absolute; z-index:-1; inset:-11px -22px; background:url('img/ui/rarity-legendary.webp') center/100% 100% no-repeat; mask-image:radial-gradient(ellipse,#000 20%,transparent 72%); opacity:.75; pointer-events:none; }
#reel.surging::before { opacity:1; filter:brightness(1.3) saturate(1.45); }
#reel img { width:66px; height:66px; object-fit:contain; pointer-events:none; filter:drop-shadow(0 2px 3px #193f43); }
#reel[aria-pressed="true"] img { scale:.94; }
#reel.reeling img { animation:reeling .5s ease-in-out infinite alternate; }
@keyframes reeling { from { rotate:-6deg; } to { rotate:6deg; } }
@media (prefers-reduced-motion:reduce) { #reel.reeling img { animation:none; } }
.is-busy #cast.ready { visibility:hidden; }
/* Short screens: the set's sign shrinks so the record's action stays one 50 px line (812×375 fits with 1 px to spare). */
@media(max-height:760px) { .card .row .primary > .ui-icon { width:26px; height:26px; } }
/* Opening the catch (user, 09.11): the fish alone on its rank's wash before its card; the rarer, the more light. --rc is the rank's colour. */
.reveal { position:fixed; inset:0; z-index:30; display:grid; place-content:center; justify-items:center; gap:18px; overflow:hidden; cursor:pointer; --rl:color-mix(in srgb,var(--rc) 55%,#fff); }
.reveal-bg,.reveal-flash { position:absolute; inset:0; pointer-events:none; }
.reveal-bg { background:radial-gradient(circle at 50% 45%,color-mix(in srgb,var(--rc) 50%,#0b1a1f) 0,#0b1a1fe8 65%); }
.reveal-flash { background:radial-gradient(circle at 50% 45%,#fff 0,var(--rl) 35%,transparent 75%); opacity:0; }
.reveal-item { position:relative; width:min(84vw,340px); aspect-ratio:384 / 208; }
.reveal-item > * { position:absolute; pointer-events:none; }
.reveal-wash { inset:0; background:center/100% 100% no-repeat; }
.reveal-fish { inset:6% 10%; width:80%; height:88%; object-fit:contain; filter:drop-shadow(0 4px 6px #0006); }
.reveal-new { left:-6%; top:-18%; width:60%; }
.reveal-glow { inset:-45% -12%; border-radius:50%; background:radial-gradient(closest-side,var(--rl),color-mix(in srgb,var(--rc) 55%,transparent) 45%,transparent); opacity:0; }
.reveal-rays { left:50%; top:50%; width:160vmax; height:160vmax; margin:-80vmax 0 0 -80vmax; opacity:0; -webkit-mask:radial-gradient(circle,#000 5%,transparent 30%); mask:radial-gradient(circle,#000 5%,transparent 30%); }
.reveal-rays::before { content:''; position:absolute; inset:0; background:repeating-conic-gradient(var(--rl) 0 5deg,transparent 5deg 15deg); animation:reveal-spin 16s linear infinite; }
.reveal[data-rank="5"] .reveal-rays::before { background:repeating-conic-gradient(#ff9bbb 0 5deg,transparent 5deg 15deg,#ffe28a 15deg 20deg,transparent 20deg 30deg,#9fd8ff 30deg 35deg,transparent 35deg 45deg); }
@keyframes reveal-spin { to { transform:rotate(360deg); } }
.reveal-ring { left:50%; top:50%; width:70%; aspect-ratio:1; margin:-35% 0 0 -35%; border:4px solid var(--rl); border-radius:50%; opacity:0; }
.reveal-spark { left:50%; top:50%; width:10px; height:10px; margin:-5px; border-radius:50%; background:var(--rl); box-shadow:0 0 8px 2px var(--rl); opacity:0; }
.reveal-spark.gold { background:#fff1b8; box-shadow:0 0 8px 2px #ffd36e; }
.reveal-spark.star { width:20px; height:20px; margin:-10px; border-radius:0; background:#fff6d2; box-shadow:none; clip-path:polygon(50% 0,61% 39%,100% 50%,61% 61%,50% 100%,39% 61%,0 50%,39% 39%); }
.reveal-text { position:relative; text-align:center; color:#fff9e9; text-shadow:0 2px 6px #000b; }
.reveal-text b { display:block; font:700 30px/1.1 Georgia,serif; letter-spacing:.03em; color:var(--rl); }
.reveal-text b::first-letter { text-transform:uppercase; }
.r