/* «Советская Рыбалка» © TMV — плакатный стиль СССР 1980-х:
 * кремовая бумага, красный, тёмно-зелёный, охра. Современный аккуратный UI. */
:root {
  --paper: #f3e7cd; --paper2: #e9d6ac; --ink: #33392f;
  --red: #b3352b; --red-d: #8e2820; --green: #3c5a43; --green-d: #2a4230;
  --ochre: #c9973f; --blue: #44687d; --shadow: rgba(40, 32, 18, .35);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; background: #20271f; }
body { font-family: "Segoe UI", "Helvetica Neue", Arial, "TMV Color Emoji", sans-serif; color: var(--ink); }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.hidden { display: none !important; }
#app { position: relative; width: calc(100% - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  margin: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); overflow: hidden; }
.screen { position: absolute; inset: 0; }

/* ——— Заставка TMV ——— */
#splash { position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(ellipse at 50% 40%, #f7eed3 0%, var(--paper) 55%, var(--paper2) 100%); }
.tmv-badge { font-family: Impact, "Arial Black", "TMV Color Emoji", sans-serif; font-size: clamp(64px, 14vw, 130px); letter-spacing: .12em; color: var(--paper);
  background: linear-gradient(180deg, #c24337, var(--red-d)); padding: .02em .28em .08em; border: 4px solid var(--ink); border-radius: 14px;
  box-shadow: 0 10px 0 rgba(40,32,18,.25), 0 22px 42px var(--shadow); transform: rotate(-2deg); }
.splash-sub { font-size: clamp(16px, 3vw, 24px); letter-spacing: .35em; text-transform: uppercase; color: var(--green-d); }
.splash-load { opacity: .65; }

/* ——— Кнопки ——— */
.btn { border: 2.5px solid var(--ink); background: linear-gradient(180deg, #fdf6dd, var(--paper)); color: var(--ink);
  border-radius: 12px; padding: 9px 16px; font-weight: 700; font-size: 15px; box-shadow: 0 3px 0 rgba(40,32,18,.35);
  transition: transform .06s, filter .12s; user-select: none; touch-action: manipulation; }
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(40,32,18,.35); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-primary { background: linear-gradient(180deg, #cd4a3e, var(--red-d)); color: #fff7e8; }
.btn-green { background: linear-gradient(180deg, #4d7357, var(--green-d)); color: #f2f7ea; }
.btn-big { font-size: clamp(17px, 2.6vw, 23px); padding: 13px 26px; border-radius: 14px; }
.btn-ghost { background: rgba(243,231,205,.9); }
.btn-round { border-radius: 50%; width: 52px; height: 52px; font-size: 24px; padding: 0; position: relative; }
.badge { position: absolute; right: -4px; top: -6px; background: var(--red); color: #fff; border: 2px solid var(--ink);
  font-size: 12px; min-width: 22px; height: 22px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; }

/* ——— Меню-плакат ——— */
#screen-menu { display: flex; }
.menu-hero { position: absolute; inset: 0; background: url('../assets/img/hero.jpg') center right / cover no-repeat; }
.menu-poster { position: relative; z-index: 2; margin: auto auto auto clamp(10px, 4vw, 54px); max-width: 520px; width: min(92vw, 520px);
  background: linear-gradient(180deg, rgba(247,238,211,.96), rgba(240,225,190,.94)); border: 3px solid var(--ink); border-radius: 18px;
  padding: clamp(14px, 3vh, 28px); box-shadow: 0 18px 50px var(--shadow); text-align: center; }
.poster-star { color: var(--red); font-size: 30px; line-height: 1; }
.poster-title { margin: 2px 0 4px; font-family: Impact, "Arial Black", "TMV Color Emoji", sans-serif; line-height: .92; letter-spacing: .02em; }
.poster-title span { display: block; }
.pt-red { color: var(--red); font-size: clamp(34px, 7.5vw, 58px); text-shadow: 2px 2px 0 rgba(51,57,47,.25); }
.pt-green { color: var(--green-d); font-size: clamp(42px, 9vw, 72px); text-shadow: 2px 2px 0 rgba(51,57,47,.2); }
.poster-sub { font-style: italic; opacity: .85; margin-bottom: 12px; }
.menu-buttons { display: flex; flex-direction: column; gap: 9px; align-items: stretch; }
.menu-buttons .btn { width: 100%; }
.menu-option { position: relative; display: flex; align-items: center; justify-content: center; min-height: 51px; padding-left: 66px; padding-right: 66px; }
.menu-option-art { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 11px;
  background: linear-gradient(145deg, #fff9e9, #e3d0a8); box-shadow: inset 0 0 0 1.5px rgba(51,57,47,.28); display: grid; place-items: center; }
.menu-option-art img { width: 92%; height: 92%; object-fit: contain; }
.menu-profile { margin-top: 12px; font-size: 14px; opacity: .9; }
.tmv-footer { margin-top: 10px; font-weight: 800; letter-spacing: .06em; color: var(--red-d); font-size: 13px; }
.holiday-banner { background: linear-gradient(90deg, #cd4a3e, #a83228); color: #fff7e8; border: 2px solid var(--ink); border-radius: 10px;
  padding: 7px 10px; font-weight: 700; margin-bottom: 10px; font-size: 14px; }

/* ——— Верхняя панель ——— */
.topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 20; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 8px 10px; pointer-events: none; }
.chip { pointer-events: auto; background: linear-gradient(180deg, #fdf6dd, var(--paper)); border: 2px solid var(--ink); border-radius: 20px;
  padding: 4px 12px; font-weight: 700; font-size: 14px; box-shadow: 0 2px 0 rgba(40,32,18,.3); display: inline-flex; gap: 6px; align-items: center; }
.chip small { opacity: .7; font-weight: 600; }
.xpbar { width: 110px; height: 10px; background: #b9a678; border-radius: 6px; overflow: hidden; border: 1.5px solid var(--ink); }
.xpbar > div { height: 100%; background: linear-gradient(90deg, #6fa05e, #4d7d43); }

/* ——— Деревня ——— */
.village-bg { position: absolute; inset: 0; background: url('../assets/img/village.jpg') center / cover no-repeat; }
#screen-village .holiday-banner { position: absolute; top: 56px; left: 50%; transform: translateX(-50%); z-index: 21; }
.village-hint { position: absolute; z-index: 20; left: 50%; transform: translateX(-50%); bottom: clamp(112px, 21vh, 168px);
  max-width: min(92vw, 640px); text-align: center; font-weight: 600; font-size: clamp(13px, 2vw, 16px); padding: 8px 14px; }
.buildings { position: absolute; z-index: 22; left: 0; right: 0; bottom: 10px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 0 10px; }
.building { position: relative; border: 2.5px solid var(--ink); border-radius: 14px; background: linear-gradient(180deg, #fdf6dd, var(--paper));
  width: clamp(92px, 15.5vw, 132px); padding: 10px 4px 8px; font-size: clamp(22px, 3.6vw, 30px); box-shadow: 0 4px 0 rgba(40,32,18,.35);
  display: flex; flex-direction: column; align-items: center; gap: 3px; transition: transform .08s; }
.building span { display: block; width: 100%; min-width: 0; overflow-wrap: anywhere; font-size: clamp(11px, 1.7vw, 14px); font-weight: 800; text-align: center; line-height: 1.1; }
.building:hover { transform: translateY(-3px); }
.building-go { background: linear-gradient(180deg, #cd4a3e, var(--red-d)); color: #fff7e8; }
.dot { position: absolute; top: -7px; right: -7px; width: 18px; height: 18px; border-radius: 50%; background: var(--red); border: 2.5px solid #fff3d6;
  animation: pulse 1s infinite alternate; }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.25); } }
.village-menu-btn { position: absolute; z-index: 23; left: 10px; bottom: clamp(112px, 21vh, 168px); }

/* ——— Рыбалка ——— */
.canvas-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #16202a; }
#game-canvas { width: 100%; height: 100%; object-fit: contain; touch-action: none; }
.fish-side { position: absolute; z-index: 24; right: 10px; top: 62px; display: flex; flex-direction: column; gap: 9px; }
.grandpa-bubble { position: absolute; z-index: 24; left: 10px; top: max(62px, calc(var(--fish-hud-bottom, 54px) + 6px)); max-width: min(74vw, 380px); display: flex; gap: 9px; align-items: center;
  background: linear-gradient(180deg, #fdf6dd, var(--paper)); border: 2.5px solid var(--ink); border-radius: 14px; padding: 7px 11px 7px 7px;
  font-weight: 700; font-size: clamp(13px, 2vw, 16px); box-shadow: 0 4px 14px var(--shadow); }
.grandpa-bubble img { width: 48px; height: 48px; object-fit: cover; border-radius: 50%; border: 2px solid var(--ink); }
.story-chip { position: absolute; z-index: 24; left: 10px; bottom: 104px; max-width: min(80vw, 420px); cursor: pointer; border: 0; background: transparent; padding: 0; font: inherit; color: inherit; text-align: left; }
.story-chip .chip { white-space: normal; text-align: left; }
.story-chip.ready .chip { background: linear-gradient(180deg, #ffe9a8, #f5cf6a); animation: story-ready-glow 2.4s ease-in-out infinite; }
/* A gentle glow is noticeable without repeatedly scaling the task or moving
   its text/hit area. Keep the static highlight for reduced-motion users. */
@keyframes story-ready-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 188, 64, .12); }
  50% { box-shadow: 0 0 0 4px rgba(242, 188, 64, .38); }
}
@media (prefers-reduced-motion: reduce) { .story-chip.ready .chip { animation: none; } }
/* Do not cover the cast/tension meters: the letter returns as soon as the
   interaction ends, while the post-office indicator remains available. */
#screen-fish[data-fishing-phase="casting"] .story-chip,
#screen-fish[data-fishing-phase="fighting"] .story-chip { visibility: hidden; }
.contest-bar { position: absolute; z-index: 24; top: 104px; left: 50%; transform: translateX(-50%); background: rgba(42, 42, 35, .88); color: #ffeec2;
  border: 2px solid #ffe9a8; border-radius: 12px; padding: 6px 14px; font-weight: 800; font-size: 14px; white-space: nowrap; }
.meter-wrap { position: absolute; z-index: 25; left: 50%; transform: translateX(-50%); bottom: 96px; width: min(86vw, 560px); text-align: center; }
.meter-label { color: #fff7e8; font-weight: 800; text-shadow: 0 2px 6px rgba(0,0,0,.7); margin-bottom: 5px; font-size: clamp(14px, 2.4vw, 18px); }
.meter { position: relative; height: 24px; border: 2.5px solid var(--ink); border-radius: 12px; overflow: hidden; background: rgba(0,0,0,.35); box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.meter-cast .zone { position: absolute; top: 0; bottom: 0; }
.zone.z0 { left: 0; width: 34%; background: #79a86b; } .zone.z1 { left: 34%; width: 34%; background: #d9b84f; } .zone.z2 { left: 68%; width: 32%; background: #c25e4e; }
.needle { position: absolute; top: -2px; bottom: -2px; width: 6px; background: #fff; border: 1.5px solid var(--ink); border-radius: 3px; margin-left: -3px; }
.tension-safe { position: absolute; top: 0; bottom: 0; left: 32%; width: 52%; background: rgba(107, 168, 90, .85); }
.meter-tension { background: linear-gradient(90deg, #7c93a3 0 32%, #d9b84f 84%, #c24337 96%); }
.tension-fill { position: absolute; top: 0; bottom: 0; left: 0; width: 0%; background: rgba(255, 247, 232, .88); border-right: 3px solid var(--ink); transition: width .05s linear; }
.fight-stats { margin-top: 5px; color: #fff7e8; font-weight: 700; text-shadow: 0 2px 6px rgba(0,0,0,.7); font-size: 14px; }
.bite-banner { position: absolute; z-index: 26; top: 38%; left: 50%; transform: translate(-50%, -50%) rotate(-3deg);
  font-family: Impact, "Arial Black", "TMV Color Emoji", sans-serif; font-size: clamp(40px, 9vw, 84px); color: #ffd94d; letter-spacing: .04em;
  text-shadow: 3px 3px 0 var(--red-d), 0 8px 26px rgba(0,0,0,.55); animation: bitepulse .18s infinite alternate; pointer-events: none; }
@keyframes bitepulse { from { transform: translate(-50%,-50%) rotate(-3deg) scale(1); } to { transform: translate(-50%,-50%) rotate(-2deg) scale(1.07); } }
.fish-msg { position: absolute; z-index: 25; left: 50%; transform: translateX(-50%); bottom: 168px; max-width: 92vw; text-align: center;
  color: #fff7e8; font-weight: 800; font-size: clamp(15px, 2.6vw, 21px); text-shadow: 0 2px 8px rgba(0,0,0,.75); pointer-events: none; }
.btn-action { position: absolute; z-index: 26; left: 50%; transform: translateX(-50%); bottom: 22px; width: min(90vw, 380px); min-width: 0;
  font-size: clamp(19px, 3.4vw, 27px); padding: 15px 26px; border-radius: 16px; user-select: none; -webkit-user-select: none; touch-action: none; }
/* Preserve the horizontal centering transform in every pressed/disabled state. */
.btn-action:active, .btn-action.holding { transform: translateX(-50%) translateY(2px); }
.btn-action.holding { filter: brightness(1.15); }
.btn-action:disabled { transform: translateX(-50%); }

/* ——— Панели и модалки ——— */
.panel-paper { background: linear-gradient(180deg, #f9f0d4, var(--paper)); border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 rgba(40,32,18,.25); }
.modal { position: absolute; inset: 0; z-index: 50; background: rgba(24, 28, 20, .62); display: flex; align-items: center; justify-content: center; padding: 10px; }
.modal-box { --modal-pad-x: clamp(12px, 3vw, 24px); width: min(96vw, 860px); max-height: 94dvh; overflow: auto; background: linear-gradient(180deg, #f9f0d4, var(--paper));
  border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.5); padding: 16px var(--modal-pad-x) 20px; }
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.modal-head h2 { margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; font-family: Impact, "Arial Black", "TMV Color Emoji", sans-serif; font-weight: 400; letter-spacing: .03em; color: var(--green-d); font-size: clamp(21px, 4vw, 30px); }
.modal-head [data-close] { flex-shrink: 0; max-width: 50%; overflow-wrap: anywhere; }
.modal-cover { width: 100%; height: clamp(110px, 24vh, 190px); object-fit: cover; border: 2.5px solid var(--ink); border-radius: 12px; margin-bottom: 10px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs .btn.active { background: linear-gradient(180deg, #4d7357, var(--green-d)); color: #f2f7ea; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.card { background: #fdf6dd; border: 2px solid var(--ink); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 5px; }
.card h3 { margin: 0; font-size: 15px; }
.card .sub { font-size: 13px; opacity: .82; flex: 1; }
.card .price { font-weight: 800; color: var(--red-d); }
.card img.fish-img { width: 100%; height: 74px; object-fit: contain; }
.card.locked { opacity: .75; }
.loc-card img.loc-img { width: 100%; height: 96px; object-fit: cover; border-radius: 8px; border: 2px solid var(--ink); }
.list-rows { display: flex; flex-direction: column; gap: 9px; }
.row-card { display: flex; gap: 11px; align-items: center; background: #fdf6dd; border: 2px solid var(--ink); border-radius: 12px; padding: 9px 11px; }
.row-card .grow { flex: 1; min-width: 0; }
.row-card h3 { margin: 0 0 3px; font-size: 16px; }
.row-card .sub { font-size: 13.5px; opacity: .88; }
@media (max-width: 700px) {
  /* Keep the groundbait actions inside the backpack/workshop on narrow screens. */
  .groundbait-row { flex-wrap: wrap; }
  .groundbait-row .grow { flex: 1 1 calc(100% - 52px); }
  .groundbait-row .btn { flex: 1 1 110px; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .workshop-box .row-card { flex-wrap: wrap; }
  .workshop-box .row-card:not(.groundbait-row) .grow { flex: 1 1 calc(100% - 100px); overflow-wrap: anywhere; }
  .workshop-box .row-card:not(.groundbait-row) .btn { flex: 1 1 auto; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
}
.portrait { width: 62px; height: 62px; border-radius: 50%; object-fit: cover; border: 2.5px solid var(--ink); flex: none; background: #d8cba6; }
.progress { height: 11px; background: #c3af7d; border: 1.5px solid var(--ink); border-radius: 6px; overflow: hidden; margin-top: 5px; }
.progress > div { height: 100%; background: linear-gradient(90deg, #6fa05e, #4d7d43); }
.progress > div.full { background: linear-gradient(90deg, #e5bd45, #c9973f); }
.catch-box { text-align: center; }
.catch-canvas { width: min(86vw, 520px); height: auto; }
.catch-name { font-family: Impact, "Arial Black", "TMV Color Emoji", sans-serif; font-size: clamp(24px, 5vw, 38px); color: var(--green-d); letter-spacing: .02em; }
.catch-meta { font-size: clamp(16px, 3vw, 20px); font-weight: 700; margin: 6px 0; }
.badges { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 8px 0; }
.badge-txt { background: var(--ochre); border: 2px solid var(--ink); color: #fff8e6; font-weight: 800; border-radius: 16px; padding: 3px 12px; font-size: 13.5px; }
.badge-txt.gold { background: linear-gradient(180deg, #f0cd5e, #c9973f); }
.btn-row { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.catch-actions .btn { max-width: 100%; overflow-wrap: anywhere; }
.news-paper { font-family: Georgia, "Times New Roman", "TMV Color Emoji", serif; }
.news-masthead { text-align: center; border-bottom: 4px double var(--ink); padding-bottom: 8px; margin-bottom: 10px; }
.news-masthead .ntitle { font-family: Impact, "Arial Black", "TMV Color Emoji", sans-serif; font-size: clamp(26px, 6vw, 44px); color: var(--red-d); letter-spacing: .04em; }
.news-headline { font-size: clamp(19px, 4vw, 27px); font-weight: 900; text-align: center; margin: 12px 0; }
.news-cols { font-size: 15.5px; line-height: 1.45; columns: 2; column-gap: 22px; }
@media (max-width: 640px) { .news-cols { columns: 1; } }
.toast { position: absolute; z-index: 70; left: 50%; transform: translateX(-50%); top: 66px; max-width: 92vw; text-align: center;
  background: #33392f; color: #ffeec2; font-weight: 800; border: 2px solid #ffe9a8; border-radius: 12px; padding: 10px 18px; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.levelup-fx { position: absolute; z-index: 65; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none;
  font-family: Impact, "Arial Black", "TMV Color Emoji", sans-serif; font-size: clamp(30px, 7vw, 62px); color: #ffd94d; text-align: center;
  text-shadow: 3px 3px 0 var(--red-d), 0 10px 30px rgba(0,0,0,.5); animation: lvup 2.4s ease forwards; }
@keyframes lvup { 0% { opacity: 0; transform: scale(.6); } 15% { opacity: 1; transform: scale(1.05); } 75% { opacity: 1; } 100% { opacity: 0; transform: scale(1) translateY(-26px); } }
.standings { width: 100%; border-collapse: collapse; font-size: 15px; }
.standings td, .standings th { padding: 6px 8px; border-bottom: 1.5px solid #c3af7d; text-align: left; }
.standings tr.me td { font-weight: 900; color: var(--red-d); }
.online-leaderboard { margin: 16px 0; padding: 12px; border: 2px solid #8aa06c; border-radius: 14px; background: rgba(255, 250, 232, .58); }
.online-leaderboard h3 { margin-top: 0 !important; }
.online-board-tabs { margin: 8px 0 10px; }
.online-standings td:last-child, .online-standings th:last-child { text-align: right; white-space: nowrap; }
.online-standings .online-divider td { text-align: center !important; opacity: .65; }
.backend-status { margin: 6px 0 12px; }
.toggle-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-weight: 700; }
.toggle { margin-left: auto; }
.save-manager { align-items: flex-start; }
.save-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.save-actions .btn { white-space: nowrap; }
.muted { opacity: .75; font-size: 13.5px; }
.big-emoji { font-size: 30px; }
.intro-box { text-align: center; }
.intro-box .portrait-lg { width: min(52vw, 220px); height: min(52vw, 220px); border-radius: 16px; object-fit: cover; border: 3px solid var(--ink); }
.intro-text { font-size: clamp(16px, 3vw, 20px); line-height: 1.5; margin: 13px auto; max-width: 540px; font-style: italic; }
@media (max-width: 560px) {
  .fish-side { top: auto; bottom: 190px; }
  .btn-round { width: 46px; height: 46px; font-size: 21px; }
  .story-chip { bottom: auto; top: 128px; }
}

/* ——— Расширение TMV 2.0: предметы, еда, мир по серверному времени, чат ——— */
.world-art, .menu-hero, .village-bg { transition: filter .6s ease; }
body[data-tod="dawn"] .world-art, body[data-tod="dawn"] .menu-hero, body[data-tod="dawn"] .village-bg { filter: sepia(.22) saturate(1.08) brightness(.96); }
body[data-tod="dusk"] .world-art, body[data-tod="dusk"] .menu-hero, body[data-tod="dusk"] .village-bg { filter: sepia(.38) saturate(1.05) brightness(.78); }
body[data-tod="night"] .world-art, body[data-tod="night"] .menu-hero, body[data-tod="night"] .village-bg { filter: brightness(.56) saturate(.72) hue-rotate(12deg); }
body[data-season="spring"] .world-art { filter: saturate(1.16) brightness(1.03); }
body[data-season="autumn"] .world-art { filter: sepia(.34) saturate(1.12) hue-rotate(-8deg); }
body[data-season="winter"] .world-art { filter: saturate(.48) brightness(1.12) hue-rotate(8deg); }
body[data-tod="night"][data-season="winter"] .world-art { filter: brightness(.58) saturate(.45) hue-rotate(10deg); }
body[data-tod="dusk"][data-season="autumn"] .world-art { filter: sepia(.48) saturate(1.1) brightness(.76); }

.building { width: clamp(82px, 11.8vw, 118px); }
.fish-side { max-height: calc(100dvh - 150px); overflow-y: auto; padding: 2px; }
.fish-side::-webkit-scrollbar { width: 0; }
.satiety-chip { min-width: 112px; justify-content: center; }
.satiety-bar { width: 52px; height: 9px; border: 1.5px solid var(--ink); border-radius: 5px; background: #c7ad79; overflow: hidden; display: inline-block; }
.satiety-bar i { display: block; height: 100%; background: linear-gradient(90deg, #d98b3c, #7aa95c); }
.chip.danger, .satiety-chip.danger { background: linear-gradient(180deg, #ffb199, #e87963); color: #401a12; animation: pulse .55s infinite alternate; }
.warning-box { border: 2px solid #7c2d20; background: #ffd9bd; color: #6d2418; border-radius: 10px; padding: 8px 10px; font-weight: 800; margin-bottom: 10px; }
.item-card { overflow: hidden; }
.item-art { width: 100%; height: 104px; object-fit: contain; border: 2px solid var(--ink); border-radius: 9px; background: #fff7dc; }
.item-art-empty { display: flex; align-items: center; justify-content: center; font-size: 42px; }
.row-card .item-art { width: 86px; height: 58px; flex: none; }
.icon-stage { min-height: 98px; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 40%, #fffdf0, #eadbb7); border: 2px solid #c9b78a; border-radius: 10px; overflow: hidden; }
.icon-stage.small { min-height: 62px; width: 68px; flex: none; }
.sheet-icon { display: inline-block; width: 56px; height: 56px; background-repeat: no-repeat; background-position: center; flex: none; }
.sheet-icon.large { width: 104px; height: 104px; }
.bait-illustration, .food-illustration { object-fit: contain; }
.sheet-icon.none-icon, .sheet-icon.missing-art-icon { display: inline-flex; align-items: center; justify-content: center; font-size: 38px; color: #8b8170; }
.tool-icon { min-height: 104px; display: flex; align-items: center; justify-content: center; font-size: 58px; background: radial-gradient(circle, #fff8dc, #e6d7ae); border: 2px solid var(--ink); border-radius: 10px; }
.tool-illustration { width: 100%; height: 100px; object-fit: contain; border-radius: 8px; }
.tool-illustration-small { width: 26px; height: 26px; vertical-align: middle; }
.tool-art-placeholder { color: #8b8170; }
.tool-art-placeholder.small { font-size: 18px; }
.wear-badge { display: inline-block; background: #efe3bd; border: 1.5px solid #8d7c55; border-radius: 12px; padding: 1px 7px; font-size: 12px; font-weight: 800; }
.wear-badge.danger { background: #ffc2ad; color: #6d2418; }
.workshop-box { margin-bottom: 12px; }
.waters-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.species-chips { font-size: 12px; line-height: 1.9; flex: 1; }
.species-chips span { background: #eee2bd; border: 1px solid #b7a371; border-radius: 10px; padding: 1px 6px; margin: 0 2px 3px 0; white-space: nowrap; }
.album-tools { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.album-tools .tabs { flex: 1; }
.album-tools input, .profile-editor input, .profile-editor select, .toggle-row select, .chat-form input {
  font: inherit; font-weight: 700; color: var(--ink); background: #fffaf0; border: 2px solid var(--ink); border-radius: 10px; padding: 8px 10px;
}
.album-tools input { min-width: min(280px, 100%); }
.fish-card .sub { line-height: 1.45; }
.profile-editor { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-items: end; margin-bottom: 12px; }
.profile-editor label { display: flex; flex-direction: column; gap: 5px; font-weight: 800; font-size: 13px; }
.btn-row.compact { justify-content: flex-start; margin-top: 8px; }
.chip-row { display: flex; gap: 7px; flex-wrap: wrap; }
.team-score { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 9px; }
.team-score > span { background: #fdf6dd; border: 2px solid var(--ink); border-radius: 14px; padding: 5px 10px; }
.chat-list { height: min(42vh, 380px); overflow-y: auto; display: flex; flex-direction: column; gap: 7px; background: rgba(255,250,232,.66); border: 2px solid #b7a371; border-radius: 12px; padding: 10px; }
.chat-msg { max-width: 82%; align-self: flex-start; background: #fff8dc; border: 1.8px solid #95835c; border-radius: 13px; padding: 6px 9px; display: flex; flex-direction: column; gap: 1px; box-shadow: 0 2px 0 rgba(40,32,18,.15); }
.chat-msg.me { align-self: flex-end; background: #dff0d8; border-color: var(--green); }
.chat-msg b { font-size: 12.5px; color: var(--green-d); }
.chat-msg small { align-self: flex-end; opacity: .58; font-size: 11px; }
.chat-form { display: flex; gap: 8px; margin-top: 9px; }
.chat-form input { flex: 1; min-width: 0; }
.modal-box { scrollbar-color: #9b895e #eadfc2; }
@media (max-width: 700px) {
  .fish-side { bottom: 180px; gap: 6px; }
  .satiety-chip { min-width: 94px; }
  .satiety-bar { width: 38px; }
  .building { width: clamp(74px, 22vw, 96px); }
  .village-hint { bottom: clamp(190px, 34vh, 260px); }
  .village-menu-btn { bottom: clamp(190px, 34vh, 260px); }
}
.sheet-icon.bait-icon { width: 76px; height: 45px; }
.sheet-icon.bait-icon.large { width: min(150px, 100%); height: 88px; }
@media (min-width: 701px) {
  .village-hint, .village-menu-btn { bottom: clamp(184px, 27vh, 226px); }
  .buildings { max-width: 1180px; margin-left: auto; margin-right: auto; }
}

/* ——— Пакет 3.0: оснастки, глубина, мастерство, коллекции, журнал ——— */
.btn-small { padding: 5px 9px; font-size: 12.5px; border-width: 2px; border-radius: 9px; }
.btn-small.active { background: linear-gradient(180deg, #4d7357, var(--green-d)); color: #f2f7ea; }
/* Keep the detailed rig accessible without covering the anglers by default. */
.rig-toggle { position: absolute; z-index: 25; left: 10px; bottom: 164px; display: inline-flex; align-items: center; gap: 6px; max-width: min(80vw, 310px); padding: 7px 11px; font-size: 13px; }
.rig-toggle-arrow { transition: transform .15s; }
.rig-toggle[aria-expanded="true"] .rig-toggle-arrow { transform: rotate(180deg); }
.rig-panel { position: absolute; z-index: 24; left: 10px; bottom: 204px; width: min(430px, calc(100% - 86px)); max-height: 38dvh; overflow-y: auto;
  background: linear-gradient(180deg, rgba(253,246,221,.96), rgba(243,231,205,.94)); border: 2.5px solid var(--ink); border-radius: 14px;
  padding: 8px 10px; box-shadow: 0 5px 18px var(--shadow); font-size: 13px; }
.rig-daily { font-weight: 800; line-height: 1.35; margin-bottom: 6px; }
.rig-daily span { font-weight: 650; opacity: .86; }
.segmented { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 4px 0; }
.segmented b { min-width: 58px; }
.rig-info { margin: 5px 0; line-height: 1.35; font-weight: 700; }
.sort-tabs { align-items: center; }
.set-grid { margin-bottom: 14px; }
@media (max-width: 700px) {
  .rig-toggle { bottom: 158px; }
  .rig-panel { bottom: 198px; width: calc(100% - 72px); max-height: 31dvh; font-size: 12px; padding: 6px 8px; }
  .segmented b { min-width: 48px; }
  .story-chip { top: auto; bottom: 112px; }
}

/* TMV 4.0: живая вода, экспедиции и соперник недели */
.ecology-box { margin: 7px 0; padding: 7px 9px; border: 2px solid var(--ink); border-radius: 10px; background: rgba(255,250,230,.72); line-height: 1.42; }
.ecology-box summary { cursor: pointer; font-weight: 800; }
.rig-expedition { margin-top: 7px; padding: 7px 9px; border: 2px dashed var(--green-d); border-radius: 10px; background: rgba(233,243,220,.72); line-height: 1.42; }
.map-ecology { display: inline-block; margin: 4px 0; }
.expedition-active, .rival-card { outline: 3px solid var(--ochre); box-shadow: 0 5px 0 rgba(40,32,18,.28), 0 0 0 5px rgba(201,151,63,.18); }
.expedition-grid .species-chips span { border-style: dashed; }

/* TMV 5.0 — места, школы и именные легенды */
.spot-row .btn.active { outline: 2px solid rgba(47, 93, 58, .35); }
.legend-box { margin: 7px 0; padding: 8px 10px; border: 2px solid #8c6b24; border-radius: 10px; background: linear-gradient(180deg, rgba(255, 244, 190, .92), rgba(244, 216, 145, .82)); line-height: 1.38; box-shadow: inset 0 1px 0 rgba(255,255,255,.8); }
.clue-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.clue-row span { border: 1.5px solid rgba(60, 50, 30, .38); border-radius: 999px; padding: 1px 7px; background: rgba(255,255,255,.42); font-size: 12px; font-weight: 700; }
.clue-row span.hit { background: #dcecc7; border-color: #55773d; color: #23401f; }
.legend-card { border-color: #8c6b24; background: linear-gradient(180deg, #fff8dc, #f4df9f); }
.path-card.selected { border-color: #356b3c; background: linear-gradient(180deg, #f3f9df, #dcecc7); box-shadow: 0 0 0 2px rgba(53,107,60,.16); }
.path-grid .progress, .legend-grid .progress { margin: 7px 0; }
@media (max-width: 720px) { .clue-row span { font-size: 11px; padding: 1px 5px; } }


/* TMV 5.3 — screen-reader fishing status and cloud conflict choice */
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.cloud-conflict { margin-top: 10px; border: 2.5px solid #7c2d20; border-radius: 14px; background: linear-gradient(180deg, #ffe5bd, #ffd3a1); color: #552015; padding: 12px; box-shadow: 0 4px 0 rgba(40,32,18,.22); }
.cloud-conflict h4 { margin: 0 0 6px; font-size: 17px; }
.cloud-conflict p { margin: 4px 0 10px; }
.conflict-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.conflict-choice { border: 2px solid rgba(85,32,21,.55); border-radius: 12px; background: rgba(255,250,232,.78); padding: 10px; }
.conflict-choice h5 { margin: 0 0 5px; font-size: 15px; }
.conflict-choice .btn { width: 100%; margin-top: 8px; }
.storage-warning { margin-top: 10px; }
@media (max-width: 700px) { .conflict-grid { grid-template-columns: 1fr; } }

/* TMV 5.4 — GamePush real-money store */
.store-real { margin-top: 18px; border-top: 2px dashed rgba(64, 50, 27, .45); padding-top: 14px; }
.store-real-head h3 { margin: 0 0 4px; }
.store-real-head p { margin: 0; }
.store-status { margin: 8px 0 12px; border: 2px solid rgba(64, 50, 27, .55); border-radius: 10px; background: rgba(255, 248, 220, .78); padding: 7px 9px; font-weight: 750; }
.store-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.store-card { text-align: center; }
.store-card.no-ads { border-color: #356b3c; background: linear-gradient(180deg, #f7fbef, #dcecc7); }
.store-card.owned { box-shadow: 0 0 0 2px rgba(53, 107, 60, .22), 0 4px 0 rgba(40,32,18,.18); }
.store-icon { font-size: 42px; line-height: 1.1; margin-bottom: 4px; }
.store-price { font-size: 19px; }
.store-missing { margin-bottom: 8px; }
.store-missing code { font-size: 11px; overflow-wrap: anywhere; }
.store-card .btn { width: 100%; }

/* TMV 5.5 — другие игроки: профиль лиги, календарные кубки, сетка и комнаты */
.club-hero{background:linear-gradient(135deg,rgba(255,244,197,.96),rgba(218,238,226,.94));border:2px solid rgba(109,74,36,.24);border-radius:18px;padding:14px;box-shadow:0 8px 22px rgba(56,80,64,.12)}
.club-hero h3{margin:0 0 6px;font-size:21px}
.club-hero p{margin:0 0 8px;line-height:1.35}
.club-hero .chip{font-size:14px}
.club-hero .progress{margin-top:9px}
.team-picker{margin-top:12px;padding-top:10px;border-top:1px dashed rgba(93,69,45,.35);display:flex;flex-direction:column;gap:5px}
.team-score{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 8px;background:rgba(255,255,255,.58);border:1px solid rgba(93,69,45,.22);border-radius:12px;padding:8px 10px;font-weight:800}
.team-score span{white-space:nowrap}
.calendar-grid .card.today{outline:3px solid rgba(65,144,83,.45);background:linear-gradient(165deg,#fff8d7,#effbe9)}
.calendar-card .btn,.mode-card .btn,.rival-profile .btn{width:100%}
.mode-card .sub,.rival-profile .sub{flex:1}
.rival-profile{min-width:0}
.rival-profile .sub,.rival-profile .btn{min-width:0;max-width:100%;overflow-wrap:anywhere}
.rival-profile .btn{white-space:normal}
.rival-heading{display:flex;flex-direction:column;align-items:center;text-align:center;gap:6px;min-width:0;margin-bottom:3px}
.rival-heading h3{width:100%;min-width:0;overflow-wrap:anywhere}
.rival-portrait{width:76px;height:76px;flex:0 0 76px;border:2px solid var(--ink);border-radius:50%;overflow:hidden;background:#e9d8aa;display:grid;place-items:center}
.rival-portrait img{display:block;width:100%;height:100%;object-fit:cover}
.rival-portrait-fallback{font-size:30px;line-height:1}
.rival-portrait [hidden]{display:none!important}
.rival-card{outline:3px solid rgba(243,184,32,.55);background:linear-gradient(165deg,#fff8cf,#fffdf7)}
.standings-wrap{overflow-x:auto;border-radius:14px}
.standings-wrap .standings{min-width:520px;margin:0}
.custom-room-form{align-items:end}
.custom-room-form .btn{min-height:42px}
.cup-round{margin:10px 0;padding:10px;border:2px solid rgba(93,69,45,.16);border-radius:14px;background:rgba(255,250,236,.7)}
.cup-round h4{margin:0 0 8px}
.cup-match{display:grid;grid-template-columns:1fr auto 1fr auto;gap:8px;align-items:center;padding:7px 9px;margin:6px 0;border-radius:10px;background:#fffdf7;border:1px solid rgba(93,69,45,.18);font-weight:700}
.cup-match.me{border-color:rgba(65,144,83,.55);box-shadow:inset 0 0 0 2px rgba(65,144,83,.14)}
.cup-match small{font-weight:900;color:#76501d;white-space:nowrap}
.cup-match em{font-style:normal;color:#2d6a4f;white-space:nowrap}
@media (max-width:640px){
  .club-hero{padding:11px}
  .standings-wrap .standings{min-width:460px}
  .cup-match{grid-template-columns:1fr;gap:3px}
  .cup-match b{display:none}
  .cup-match em{white-space:normal}
}

/* TMV 5.6 — rare colours, treasure maps and the club season ledger */
.badge-txt.variant-badge { background: linear-gradient(180deg, #7d6391, #54406b); }
.badge-txt.variant-badge.gold { background: linear-gradient(180deg, #f0cd5e, #a86d32); color: #fff8e6; }
.variant-grid { margin-bottom: 14px; }
.variant-card.seen { border-color: #6c557f; background: linear-gradient(180deg, #fffaf0, #eadff2); }
.variant-mini-row { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.variant-mini-row .badge-txt { font-size: 11px; padding: 1px 7px; border-width: 1.5px; }
.treasure-card { margin: 10px 0 14px; padding: 12px; border: 2.5px solid #7a5c2e; border-radius: 16px; background: radial-gradient(circle at 18% 10%, rgba(255,255,255,.75), transparent 36%), linear-gradient(150deg, #fff0bd, #e8cf8d 58%, #d9b96f); box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 5px 0 rgba(40,32,18,.18); }
.treasure-active-chip { background: #dcecc7; }
.treasure-route { display: flex; align-items: center; margin: 13px 4px 10px; }
.treasure-dot { width: 34px; height: 34px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 2.5px solid var(--ink); border-radius: 50%; background: #fff8dc; font-weight: 950; box-shadow: 0 2px 0 rgba(40,32,18,.22); }
.treasure-dot.done { background: #7aa95c; color: #fff; }
.treasure-dot.active { background: #f0cd5e; outline: 3px solid rgba(122,92,46,.28); transform: scale(1.08); }
.treasure-line { height: 3px; flex: 1; margin: 0 5px; border-radius: 999px; background: repeating-linear-gradient(90deg, rgba(64,50,27,.72) 0 8px, transparent 8px 14px); }
.treasure-clue { display: flex; flex-direction: column; gap: 2px; margin: 7px 0; line-height: 1.35; }
.treasure-clue span { font-size: 12px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; opacity: .72; }
.treasure-clue b { font-size: 18px; }
.treasure-conditions { margin: 7px 0; }
.treasure-waters { margin-top: 7px; font-weight: 800; }
.rig-treasure { margin-top: 7px; padding: 7px 9px; border: 2px solid #7a5c2e; border-radius: 10px; background: rgba(255,240,189,.82); line-height: 1.42; }
.rig-treasure.here { background: rgba(220,236,199,.9); border-color: #4d7d43; }
.rig-treasure span { opacity: .82; font-size: 12px; }
.loc-card.treasure-target { outline: 3px solid rgba(201,151,63,.5); box-shadow: 0 5px 0 rgba(40,32,18,.2), 0 0 0 5px rgba(240,205,94,.16); }
.season-ledger-grid { margin: 10px 0 16px; }
.season-ledger-card.available { border-color: #4d7d43; background: linear-gradient(180deg, #f7fbef, #dcecc7); box-shadow: 0 0 0 2px rgba(77,125,67,.18); }
.season-ledger-card.claimed { opacity: .78; background: linear-gradient(180deg, #f4ecd2, #e5d8ae); }
.season-ledger-card.locked { opacity: .82; }
.season-ledger-card .progress { margin-top: 8px; }
@media (max-width: 640px) {
  .treasure-card { padding: 10px; }
  .treasure-dot { width: 30px; height: 30px; }
  .treasure-clue b { font-size: 16px; }
  .variant-mini-row .badge-txt { font-size: 10.5px; }
}

/* TMV 5.7 — fish-receiving orders and angler’s kitchen */
.market-order-grid,
.kitchen-recipe-grid { grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); margin: 12px 0 16px; }
.market-order-card,
.kitchen-recipe-card { display: flex; flex-direction: column; gap: 8px; }
.market-order-card.ready,
.kitchen-recipe-card.ready { border-color: #4d7d43; background: linear-gradient(180deg, #fffaf0, #e8f3d7); box-shadow: 0 0 0 2px rgba(77,125,67,.16), 0 4px 0 rgba(40,32,18,.16); }
.market-order-card.special { border-color: #8c6b24; background: linear-gradient(180deg, #fff8dc, #f1dd9d); }
.market-order-card.special.ready { background: linear-gradient(180deg, #fff8dc, #e6efbd); }
.market-order-card.done { opacity: .78; background: linear-gradient(180deg, #f4ecd2, #e3d3a4); }
.market-order-head { display: flex; align-items: flex-start; gap: 10px; }
.market-order-head h3 { margin: 0 0 3px; }
.market-order-head .big-emoji { flex: none; }
.market-objective { margin: 2px 0 0; font-size: 19px; line-height: 1.25; }
.market-hints { margin: 1px 0; }
.market-reward { padding: 7px 9px; border: 1.8px dashed rgba(109,82,39,.55); border-radius: 10px; background: rgba(255,255,255,.48); line-height: 1.4; }
.market-order-card h4,
.kitchen-recipe-card h4 { margin: 6px 0 0; font-size: 14px; }
.catch-selection-list { display: flex; flex-direction: column; gap: 6px; }
.catch-selection-row { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border: 1.8px solid rgba(109,82,39,.45); border-radius: 11px; background: rgba(255,250,232,.78); line-height: 1.3; }
.catch-selection-row img { width: 76px; height: 42px; flex: none; object-fit: contain; }
.catch-selection-row span { font-size: 12.5px; opacity: .82; }
.chip.danger { background: #ffc2ad; color: #6d2418; }
.kitchen-recipe-card > .btn { width: 100%; margin-top: auto; }
.market-order-card .btn-row { margin-top: auto; }
@media (max-width: 640px) {
  .market-order-grid,
  .kitchen-recipe-grid { grid-template-columns: 1fr; }
  .market-objective { font-size: 17px; }
  .catch-selection-row img { width: 62px; height: 36px; }
}

/* TMV 5.8 — Great-Water Calendar and dated fish runs */
.badge-txt.migration-badge { background: linear-gradient(180deg, #397d91, #21566b); }
.migration-map-summary, .migration-calendar { margin: 12px 0; padding: 12px; border: 2.5px solid #2d6478; border-radius: 16px; background: radial-gradient(circle at 12% 0%, rgba(255,255,255,.75), transparent 34%), linear-gradient(150deg, #dff3f2, #b9dcd6 58%, #93c4bd); box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 5px 0 rgba(40,32,18,.16); }
.migration-calendar h3 { margin: 2px 0 6px; }
.migration-calendar h4 { margin: 14px 0 7px; }
.migration-current { margin: 10px 0; padding: 9px 10px; border: 2px solid rgba(45,100,120,.5); border-radius: 12px; background: rgba(255,255,255,.52); line-height: 1.42; }
.migration-stats { margin: 7px 0; }
.migration-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.migration-day { min-height: 92px; padding: 8px; border: 2px solid rgba(45,100,120,.48); border-radius: 12px; background: rgba(255,255,255,.48); line-height: 1.28; overflow-wrap: anywhere; }
.migration-day span, .migration-day small { display: block; }
.migration-day span { margin-bottom: 5px; font-size: 11.5px; font-weight: 900; text-transform: uppercase; opacity: .78; }
.migration-day small { margin-top: 4px; font-size: 12px; font-weight: 800; }
.migration-day.active { background: linear-gradient(180deg, #eefbd9, #cfeabb); border-color: #4d7d43; }
.migration-day.phase-peak, .migration-run-card.phase-peak { box-shadow: 0 0 0 3px rgba(240,205,94,.34), inset 0 0 0 1px rgba(255,255,255,.6); }
.migration-day.today { outline: 3px solid rgba(45,100,120,.35); }
.migration-run-grid { margin: 12px 0 16px; }
.migration-run-card.active { border-color: #2d6478; background: linear-gradient(180deg, #fbfff2, #d9ecce); }
.migration-run-card.seen { box-shadow: inset 0 0 0 2px rgba(45,100,120,.14); }
.loc-card.migration-active { outline: 3px solid rgba(57,125,145,.42); box-shadow: 0 5px 0 rgba(40,32,18,.18), 0 0 0 5px rgba(57,125,145,.13); }
.species-chips span.migration-species { background: #cfe8de; border-color: #397d91; color: #164653; font-weight: 850; }
.migration-species-line { display: inline-block; margin-top: 4px; padding: 4px 7px; border: 1.6px solid rgba(45,100,120,.55); border-radius: 9px; background: rgba(207,232,222,.74); color: #164653; font-weight: 800; }
.news-paper .migration-calendar { margin-top: 16px; }
@media (max-width: 900px) { .migration-days { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .migration-days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .migration-day { min-height: 78px; }
  .migration-map-summary, .migration-calendar { padding: 10px; }
}

/* TMV 5.9 — Field Science & Fish Surveys */
.badge-txt.field-badge { background: linear-gradient(180deg, #5e8d61, #365f3d); }
.chip.ready { background: #dff0c9; border-color: #4d7d43; color: #24471f; font-weight: 900; }
.chip.done { background: #e6d9b8; color: #5c4a22; }
.chip.here { background: #d7eddb; border-color: #4d7d43; color: #234a2d; font-weight: 900; }
.field-stats { margin: 8px 0 10px; }
.field-rank-card { display: flex; align-items: flex-start; gap: 12px; margin: 10px 0 12px; padding: 12px; border: 2.5px solid #54764b; border-radius: 16px; background: radial-gradient(circle at 6% 0%, rgba(255,255,255,.8), transparent 34%), linear-gradient(150deg, #f6fbdf, #dcecc3 60%, #c7dcb0); box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 5px 0 rgba(40,32,18,.14); line-height: 1.45; }
.field-rank-icon, .field-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; border: 2px solid rgba(64,84,48,.5); border-radius: 50%; background: rgba(255,255,255,.66); box-shadow: inset 0 1px 0 rgba(255,255,255,.8); }
.field-rank-icon { width: 52px; height: 52px; font-size: 29px; }
.field-grid, .field-protocol-grid { grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); margin: 12px 0 16px; }
.field-card { display: flex; flex-direction: column; gap: 8px; }
.field-card.ready { border-color: #4d7d43; background: linear-gradient(180deg, #fffdf0, #e7f2d2); box-shadow: 0 0 0 2px rgba(77,125,67,.16), 0 5px 0 rgba(40,32,18,.16); }
.field-card.weekly { border-color: #7a5c8e; background: linear-gradient(180deg, #fffaf0, #eee3f4); }
.field-card.weekly.ready { border-color: #4d7d43; background: linear-gradient(180deg, #fffaf0, #e3f0cd); }
.field-card.claimed { opacity: .8; background: linear-gradient(180deg, #f4ecd2, #ded0a7); }
.field-card-head { display: flex; align-items: flex-start; gap: 10px; }
.field-card-head h3 { margin: 0 0 3px; }
.field-icon { width: 42px; height: 42px; font-size: 23px; }
.field-objective { font-size: 18px; font-weight: 850; line-height: 1.3; }
.field-conditions { line-height: 1.42; }
.field-progress { margin-top: 2px; }
.field-progress > div { background: linear-gradient(90deg, #789f67, #446f3a); }
.field-card .btn-row { margin-top: auto; }
.field-protocol-card.seen { border-color: #54764b; background: linear-gradient(180deg, #fffdf2, #e3efcf); }
.field-protocol-card.locked { opacity: .84; }
.rig-fieldwork, .field-map-summary { margin-top: 7px; padding: 8px 10px; border: 2px solid #647653; border-radius: 11px; background: rgba(232,243,210,.88); line-height: 1.44; }
.rig-fieldwork.here { background: rgba(220,238,194,.93); border-color: #4d7d43; }
.rig-fieldwork.ready { background: rgba(255,244,190,.94); border-color: #8c6b24; box-shadow: inset 0 0 0 2px rgba(240,205,94,.3); }
.rig-fieldwork span { opacity: .84; font-size: 12px; }
.field-map-summary { margin: 12px 0; padding: 11px 12px; border-radius: 15px; background: radial-gradient(circle at 10% 0%, rgba(255,255,255,.75), transparent 34%), linear-gradient(150deg, #eef7d9, #cfe2b6); box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 4px 0 rgba(40,32,18,.14); }
.loc-card.field-target { outline: 3px solid rgba(90,126,68,.48); box-shadow: 0 5px 0 rgba(40,32,18,.18), 0 0 0 5px rgba(122,169,92,.15); }
.loc-card.field-target.migration-active { outline-color: rgba(57,125,145,.55); box-shadow: 0 5px 0 rgba(40,32,18,.18), 0 0 0 4px rgba(122,169,92,.24), 0 0 0 8px rgba(57,125,145,.13); }
.field-species-line { display: inline-block; margin-top: 4px; padding: 4px 7px; border: 1.6px solid rgba(84,118,75,.58); border-radius: 9px; background: rgba(227,239,207,.8); color: #2c4d2b; font-weight: 800; }
.field-catch-note { display: inline-block; margin-top: 6px; padding: 7px 9px; border: 1.8px solid rgba(84,118,75,.65); border-radius: 10px; background: rgba(232,243,210,.9); color: #294c2a; line-height: 1.42; }
@media (max-width: 640px) {
  .field-grid, .field-protocol-grid { grid-template-columns: 1fr; }
  .field-rank-card { padding: 10px; }
  .field-rank-icon { width: 44px; height: 44px; font-size: 25px; }
  .field-objective { font-size: 17px; }
}

/* TMV 6.0 — Naturalist Museum: graded specimens, halls and keeper ranks */
.museum-hero {
  display: flex; gap: 14px; align-items: flex-start; margin: 12px 0; padding: 14px;
  border: 1px solid rgba(122, 82, 36, .28); border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 244, 196, .96), rgba(232, 218, 177, .88));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72), 0 8px 20px rgba(75, 52, 20, .12);
}
.museum-hero-icon {
  flex: 0 0 auto; display: grid; place-items: center; width: 56px; height: 56px;
  border-radius: 50%; background: rgba(255,255,255,.68); font-size: 30px;
  box-shadow: inset 0 0 0 1px rgba(122, 82, 36, .18);
}
.museum-section-title { margin: 18px 0 8px; }
.museum-stats { margin: 10px 0; }
.museum-visitor-card, .museum-house-card, .museum-album-card { border-color: rgba(122, 82, 36, .24); }
.museum-assessment-line { color: #6a4b13; }
.museum-actions { display: flex; flex-direction: column; gap: 7px; flex: 0 0 auto; }
.museum-candidate-grid, .museum-specimen-grid, .museum-hall-grid, .museum-grade-grid { align-items: stretch; }
.museum-candidate-card, .museum-specimen-card, .museum-hall-card, .museum-grade-card { position: relative; overflow: hidden; }
.museum-candidate-card::before, .museum-specimen-card::before, .museum-grade-card::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: #9a8a68;
}
.museum-candidate-card.grade-bronze::before, .museum-specimen-card.grade-bronze::before, .museum-grade-card.grade-bronze::before { background: #b0773f; }
.museum-candidate-card.grade-silver::before, .museum-specimen-card.grade-silver::before, .museum-grade-card.grade-silver::before { background: #9fb3bd; }
.museum-candidate-card.grade-gold::before, .museum-specimen-card.grade-gold::before, .museum-grade-card.grade-gold::before { background: #dcb83f; }
.museum-candidate-card.grade-master::before, .museum-specimen-card.grade-master::before, .museum-grade-card.grade-master::before { background: #7b9d58; }
.museum-candidate-card.grade-legendary::before, .museum-specimen-card.grade-legendary::before, .museum-grade-card.grade-legendary::before {
  background: linear-gradient(90deg, #8d5cff, #e7ba43, #37b6a6);
}
.museum-candidate-card .btn, .museum-hall-card .btn { margin-top: 10px; }
.museum-score-progress, .museum-hall-progress, .museum-rank-progress { margin-top: 10px; }
.museum-score-progress > div { background: linear-gradient(90deg, #a4823f, #e2bd4e); }
.museum-hall-card.ready { border-color: rgba(91, 143, 66, .55); box-shadow: 0 0 0 2px rgba(91, 143, 66, .13); }
.museum-hall-card.complete { background: linear-gradient(145deg, rgba(255, 246, 202, .9), rgba(242, 226, 174, .72)); }
.museum-species-line { color: #6f551f; font-weight: 700; }
.museum-species-line.missing { color: #77705e; }
.museum-water-line { color: #6f551f; font-weight: 700; }
.museum-catch-note {
  display: inline-block; margin-top: 7px; padding: 8px 10px; border-radius: 10px;
  background: rgba(255, 240, 177, .72); color: #5c430d;
}
.museum-badge { background: #f3d77b; color: #59400a; }
@media (max-width: 640px) {
  .museum-hero { padding: 12px; }
  .museum-hero-icon { width: 46px; height: 46px; font-size: 25px; }
  /* Storage rows need to wrap before the full-width action group; otherwise
     its flex basis makes keepnet/cellar overflow at phone widths. */
  .fish-storage-row { flex-wrap: wrap; }
  .fish-storage-row .grow { flex: 1 1 calc(100% - 110px); overflow-wrap: anywhere; }
  .museum-actions { width: 100%; flex-direction: row; flex-wrap: wrap; }
  .fish-storage-row .museum-actions { flex: 1 1 100%; min-width: 0; }
  .museum-actions .btn { flex: 1 1 130px; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
}

/* TMV 6.1 — Museum origin plaques, hall blockers and full catalogue */
.museum-plaque {
  margin-top: 9px; padding: 8px 9px; border: 1.6px solid rgba(122, 82, 36, .34);
  border-radius: 9px; background: linear-gradient(180deg, rgba(255, 252, 232, .92), rgba(239, 224, 178, .78));
  color: #5f4614; font-size: 12.5px; font-weight: 750; line-height: 1.42;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}
.museum-market-warning { color: #7b341e; font-weight: 850; }
.museum-blockers {
  margin-top: 10px; padding: 9px 10px; border: 1.6px dashed rgba(107, 82, 39, .45);
  border-radius: 10px; background: rgba(255, 250, 225, .62); color: #5c491f; line-height: 1.38;
}
.museum-blockers ul { margin: 6px 0 3px 18px; padding: 0; }
.museum-blockers li { margin: 4px 0; }
.museum-blockers li span { opacity: .86; font-size: 12.5px; }
.museum-catalog-tools {
  display: grid; gap: 8px; margin: 10px 0 8px; padding: 10px;
  border: 1.6px solid rgba(122, 82, 36, .25); border-radius: 13px;
  background: rgba(255, 248, 218, .62);
}
.museum-catalog-tools input { width: 100%; box-sizing: border-box; }
.museum-catalog-tabs { align-items: center; }
.museum-catalog-sort-label { align-self: center; font-size: 12.5px; font-weight: 900; opacity: .72; }
.museum-catalog-count { margin: 6px 2px 10px; }
.museum-catalog-grid { align-items: stretch; }
.museum-candidate-actions, .museum-catalog-actions { margin: 10px 0 4px; }
@media (max-width: 640px) {
  .museum-catalog-tools { padding: 8px; }
  .museum-plaque { font-size: 12px; }
}

/* TMV 6.3 — Summer calendar, daily route, weekly ledger and dream piggy bank */
.retention-box {
  margin: 16px 0; padding: 14px; border: 2px solid rgba(60, 90, 67, .38); border-radius: 16px;
  background: radial-gradient(circle at 8% 0%, rgba(255,255,255,.78), transparent 34%), linear-gradient(155deg, rgba(255,248,218,.94), rgba(222,238,199,.82));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 5px 0 rgba(40,32,18,.13);
}
.retention-box > .muted { max-width: 760px; }
.retention-streak-chip { display: inline-flex; margin: 2px 0 10px; }
.retention-comeback { border-color: rgba(179, 53, 43, .48); background: linear-gradient(135deg, rgba(255,239,196,.96), rgba(255,218,181,.88)); }
.retention-calendar { display: grid; grid-template-columns: repeat(7, minmax(86px, 1fr)); gap: 7px; margin: 10px 0 4px; }
.retention-day {
  position: relative; min-height: 104px; padding: 9px 7px 8px; border: 1.8px solid rgba(51,57,47,.38); border-radius: 12px;
  background: rgba(253,246,221,.82); text-align: center; overflow: hidden;
}
.retention-day .sub { margin-top: 4px; font-size: 11.5px; line-height: 1.32; overflow-wrap: anywhere; }
.retention-day-icon { font-size: 24px; line-height: 1.1; }
.retention-day.today { border-color: var(--red-d); background: linear-gradient(180deg, #fff3bd, #f7d98c); box-shadow: 0 0 0 3px rgba(201,151,63,.22), 0 4px 0 rgba(40,32,18,.18); transform: translateY(-2px); }
.retention-day.done, .retention-day.claimed { border-color: rgba(60,90,67,.55); background: linear-gradient(180deg, #e8f3d2, #cfe2b6); }
.retention-day.next { opacity: .72; }
.retention-check {
  position: absolute; top: 5px; right: 5px; display: grid; place-items: center; width: 21px; height: 21px;
  border: 1.6px solid var(--green-d); border-radius: 50%; background: #4d7d43; color: #fff; font-size: 12px; font-weight: 900;
}
.retention-subtitle { margin: 16px 0 6px; }
.retention-task.complete { border-color: rgba(77,125,67,.58); }
.retention-task.claimed { background: linear-gradient(135deg, rgba(232,243,210,.92), rgba(253,246,221,.86)); }
.retention-milestones { margin-top: 9px; }
.retention-week-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-top: 10px; }
.retention-tier.ready { border-color: var(--ochre); box-shadow: 0 0 0 3px rgba(201,151,63,.18), 0 4px 0 rgba(40,32,18,.16); }
.retention-tier.claimed { background: linear-gradient(150deg, #e8f3d2, #fff3bd); }
.retention-tier.locked { opacity: .76; }
.savings-goal-box {
  margin: 12px 0; padding: 12px; border: 2px solid rgba(142,40,32,.42); border-radius: 15px;
  background: radial-gradient(circle at 95% 10%, rgba(255,255,255,.72), transparent 30%), linear-gradient(140deg, rgba(255,239,196,.96), rgba(247,217,160,.88));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78), 0 4px 0 rgba(40,32,18,.14);
}
.savings-goal-main { display: flex; gap: 12px; align-items: flex-start; }
.savings-goal-main h3 { margin: 1px 0 4px; }
.savings-goal-box .btn-row { margin-top: 9px; }
.goal-btn { margin-top: 7px; }
@media (max-width: 760px) {
  .retention-calendar { grid-template-columns: repeat(4, minmax(74px, 1fr)); }
  .retention-day { min-height: 98px; }
}
@media (max-width: 470px) {
  .retention-box { padding: 11px; }
  .retention-calendar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .retention-day { min-height: 92px; }
  .savings-goal-main { gap: 8px; }
}

/* TMV 6.5 — an optional angler's note shared by album, map and fishing */
.planner-board {
  margin: 12px 0 15px; padding: 14px; border: 2px solid #667e56; border-radius: 15px;
  background: radial-gradient(circle at 96% 0%, rgba(255,255,255,.7), transparent 32%), linear-gradient(145deg, #f8f1d5, #dfeacb);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 4px 0 rgba(40,32,18,.14);
}
.planner-board h3 { margin: 0 0 3px; color: var(--green-d); }
.planner-board p { margin: 8px 0; line-height: 1.42; }
.planner-board.empty p { max-width: 54em; }
.planner-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.planner-mark { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border: 2px solid #83976b; border-radius: 50%; background: #fff7da; font-size: 23px; }
.planner-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.planner-facts span { padding: 4px 8px; border: 1px solid #b9b597; border-radius: 8px; background: rgba(255,250,232,.85); font-size: 13px; font-weight: 700; }
.planner-facts .good { border-color: #779767; color: #315c3c; }
.planner-facts .warn, .planner-block, .planner-warning, .planner-special { color: #803e25; }
.planner-note { max-width: 76em; font-size: 12.5px; color: #4e5848; }
.planner-board .btn-row { justify-content: flex-start; }
.plan-track { align-self: flex-start; margin-top: 5px; }
.plan-map-badge { display: inline-block; align-self: flex-start; padding: 3px 7px; border: 1.5px solid #76925a; border-radius: 8px; background: #e2efcb; color: #315b39; font-size: 12px; font-weight: 800; }
.loc-card.plan-target { box-shadow: inset 0 0 0 2px #879e62; }
.rig-plan { margin: 6px 0; padding: 7px 8px; border: 1.5px solid #8b9d77; border-radius: 10px; background: #edf1dc; line-height: 1.38; }
.rig-plan.here { border-color: #53794d; background: #e3efcf; }
.rig-plan.empty { background: rgba(255,250,230,.65); }
.rig-plan .segmented { margin-bottom: 0; }
.planner-quest-row .plan-track { display: inline-block; }
.meter-cast .zone.target-zone { box-shadow: inset 0 0 0 3px #fffbe2; }
.meter-cast .zone.target-zone::after { content: '✓'; position: absolute; left: 50%; transform: translateX(-50%); top: -1px; color: #fff; font-weight: 900; text-shadow: 0 1px 3px #172b1d; }
.meter-cast .zone.non-target-zone { filter: brightness(.56); }
@media (max-width: 600px) {
  .planner-board { padding: 10px; }
  .planner-heading { align-items: flex-start; }
  .planner-facts span { font-size: 12px; }
  .planner-quest-row { flex-wrap: wrap; }
}

/* Individual fish plates: a transparent species illustration, with a
   silhouette for undiscovered fish and visual treatments for rare morphs. */
.fish-picture { display: inline-flex; position: relative; align-items: center; justify-content: center; flex: none; vertical-align: middle; }
.fish-picture > img, .card .fish-picture > img.fish-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.fish-picture--card { width: 100%; height: 74px; }
.fish-picture--row { width: 92px; height: 50px; }
.fish-picture--row-wide { width: 106px; height: 58px; }
.catch-selection-row .fish-picture--choice { width: 76px; height: 42px; opacity: 1; }
.catch-visual { display: inline-block; position: relative; width: min(86vw, 520px); vertical-align: middle; }
.catch-visual .catch-canvas { display: block; width: 100%; }
.fish-picture--catch { position: absolute; left: 10%; top: 12%; width: 80%; height: 76%; }
.fish-illustrated.state-hidden > img { filter: brightness(0) opacity(.8); }
.fish-illustrated.state-golden > img { filter: sepia(.9) saturate(1.8) hue-rotate(5deg) brightness(1.1); }
.fish-illustrated.state-albino > img { filter: grayscale(.8) saturate(.4) brightness(1.25) contrast(.9); }
.fish-illustrated.state-melanic > img { filter: brightness(.53) saturate(.65); }
.fish-illustrated.state-copper > img { filter: sepia(.75) saturate(2) hue-rotate(335deg) brightness(1.02); }
.fish-illustrated.state-moonlit > img { filter: sepia(.8) saturate(.75) hue-rotate(165deg) brightness(1.13); }
.fish-illustrated.pattern-spotted::after, .fish-illustrated.pattern-striped::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .48; mix-blend-mode: multiply;
  -webkit-mask-image: var(--fish-image); mask-image: var(--fish-image);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
}
.fish-illustrated.pattern-spotted::after { background-image: radial-gradient(circle, #a75626 0 22%, transparent 28%); background-size: 18px 16px; }
.fish-illustrated.pattern-striped::after { background-image: repeating-linear-gradient(100deg, transparent 0 9px, #65482c 10px 14px, transparent 15px 23px); }
.fish-picture--catch.pattern-spotted::after { background-size: 30px 27px; }
.fish-picture--catch.pattern-striped::after { background-image: repeating-linear-gradient(100deg, transparent 0 17px, #65482c 19px 25px, transparent 27px 40px); }
@media (max-width: 640px) { .catch-selection-row .fish-picture--choice { width: 62px; height: 36px; } }

/* Portrait camera: a full-height window into the landscape instead of a tiny
   letterboxed strip. JS pans between the anglers and the live float. */
@media (max-width: 560px) and (orientation: portrait) {
  #fish-topbar { max-height: 182px; overflow-y: auto; align-content: flex-start; pointer-events: auto; }
  #screen-fish .canvas-wrap { top: 184px; bottom: 134px; overflow: hidden; }
  #game-canvas { position: absolute; left: 0; top: 0; width: auto; height: 100%; max-width: none; object-fit: fill;
    transform: translateX(var(--fish-camera-x, 0px)); transition: transform .38s ease-out; }
  #screen-fish .grandpa-bubble { top: 190px; max-width: min(76vw, 320px); }
  #screen-fish .fish-msg { top: 190px; bottom: auto; left: 10px; transform: none; max-width: calc(100% - 86px); text-align: left;
    padding: 6px 9px; border-radius: 10px; background: rgba(18, 31, 32, .76); font-size: 13px; }
  #screen-fish .fish-msg:empty { display: none; }
  #grandpa-bubble:not(.hidden) ~ #fish-msg { top: calc(var(--fish-bubble-bottom, 270px) + 8px); }
  #screen-fish .btn-action { padding-left: 14px; padding-right: 14px; }
}

/* A catch objective has two independently visible requirements: historic
   catches and the actual fish that will be surrendered on claim. */
.quest-delivery { margin-top: 7px; padding: 8px 10px; border: 1.5px solid #b39b71; border-radius: 10px; background: #f7eed7; font-size: 12.5px; line-height: 1.4; }
.quest-delivery.is-ready { background: #e7f0d9; border-color: #76945e; }
.quest-delivery strong { color: var(--green-d); }
.quest-delivery details { margin-top: 5px; }
.quest-delivery summary { cursor: pointer; color: var(--green-d); font-weight: 800; }
.quest-delivery ul { margin: 5px 0 0; padding-left: 20px; }
.quest-claim { max-width: 220px; }
@media (max-width: 600px) {
  .planner-quest-row .quest-claim { width: 100%; max-width: none; }
}

/* Avoid placing navigation over wrapped HUD chips; keep every shortcut
   scrollable instead of shrinking the touch targets on short screens. */
#screen-fish .fish-side { top: max(62px, calc(var(--fish-hud-bottom, 54px) + 6px)); bottom: auto;
  max-height: max(0px, calc(100% - max(62px, calc(var(--fish-hud-bottom, 54px) + 6px)) - 110px)); }
#screen-fish .fish-side .btn-round { flex-shrink: 0; }
#screen-fish .fish-side::-webkit-scrollbar { width: 4px; }
#screen-fish .fish-side::-webkit-scrollbar-thumb { background: rgba(243,231,205,.8); border-radius: 4px; }
.modal-box.has-modal-head { padding-top: 0; }
.modal-box.has-modal-head .modal-head { position: sticky; top: 0; z-index: 4; margin: 0 calc(0px - var(--modal-pad-x)) 10px;
  padding: 12px var(--modal-pad-x) 8px; background: #f9f0d4; }
.toast { pointer-events: none; }
#modal:not(.hidden) ~ .toast { top: auto; bottom: 12px; }
@media (max-width: 700px) {
  .rig-toggle { min-height: 44px; }
  .rig-panel .btn-small { min-height: 40px; }
}
@media (max-width: 560px) and (orientation: portrait) {
  #screen-fish .fish-side { top: 190px; max-height: max(0px, calc(100% - 324px)); }
  #village-topbar { max-height: 160px; overflow-y: auto; align-content: flex-start; pointer-events: auto; }
  #screen-village .village-menu-btn { top: calc(var(--village-hud-bottom, 160px) + 6px); bottom: auto; }
  #screen-village .village-hint { top: calc(var(--village-hud-bottom, 160px) + 6px); bottom: auto; left: 125px; transform: none;
    width: calc(100% - 135px); max-height: 96px; overflow-y: auto; padding: 5px 8px; font-size: 12px; line-height: 1.2; }
  #screen-village .building { width: min(128px, calc((100% - 16px) / 3)); }
  #screen-village .building span { font-size: clamp(10px, 3vw, 12px); }
  #screen-village .buildings { max-height: max(80px, calc(100% - var(--village-hud-bottom, 160px) - 110px)); overflow-y: auto; align-content: flex-start; }
}

/* Compact landscape-phone layout: menus and buildings remain reachable, and
   active casting controls do not fight the scene overlays for the same space. */
@media (max-height: 500px) and (orientation: landscape) {
  #screen-menu { overflow-y: auto; align-items: flex-start; }
  .menu-poster { margin: 8px auto; padding: 8px 12px; width: min(96vw, 520px); }
  .poster-star { display: none; }
  .poster-title span { display: inline; font-size: clamp(22px, 5vw, 35px); }
  .poster-sub { margin-bottom: 5px; }
  .menu-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .menu-option { min-height: 44px; padding: 5px 6px 5px 44px; font-size: 15px; }
  .menu-option-art { width: 36px; height: 36px; left: 4px; }
  .menu-profile, .tmv-footer { margin-top: 5px; }

  #village-topbar, #fish-topbar { max-height: 64px; overflow-y: auto; align-content: flex-start; pointer-events: auto; }
  #screen-village .village-menu-btn { top: 70px; bottom: auto; }
  #screen-village .village-hint { top: 70px; bottom: auto; left: 125px; transform: none; width: min(65vw, 460px); max-height: 48px; overflow: hidden; padding: 5px 8px; font-size: 12px; }
  #screen-village .buildings { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; overflow-y: hidden; padding: 4px 10px 7px; bottom: 4px; }
  #screen-village .building { flex: 0 0 96px; width: 96px; min-height: 66px; padding: 4px 3px; font-size: 21px; }
  #screen-village .building span { font-size: 10px; }
  #screen-fish .fish-side { top: 70px; max-height: max(0px, calc(100% - 136px)); gap: 4px; }
  #screen-fish .fish-side .btn-round { width: 44px; height: 44px; font-size: 20px; }
  #screen-fish .grandpa-bubble { top: 70px; max-width: min(62vw, 360px); padding: 5px 8px; font-size: 13px; }
  #screen-fish .grandpa-bubble img { width: 40px; height: 40px; }
  #screen-fish .rig-toggle { bottom: 65px; }
  #screen-fish .rig-panel { bottom: 115px; max-height: max(60px, calc(100% - 190px)); }
  #screen-fish .story-chip { top: auto; bottom: 65px; left: 210px; max-width: calc(100% - 285px); max-height: 42px; overflow: hidden; }
  #screen-fish .story-chip .chip { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #screen-fish .meter-wrap { left: auto; right: 72px; transform: none; bottom: 60px; width: min(45vw, 380px); }
  #screen-fish .fish-msg { top: 70px; bottom: auto; left: 10px; transform: none; max-width: min(62vw, 360px); text-align: left;
    padding: 5px 7px; border-radius: 8px; background: rgba(18,31,32,.76); font-size: 12px; }
  #screen-fish .fish-msg:empty { display: none; }
  #grandpa-bubble:not(.hidden) ~ #fish-msg { top: calc(var(--fish-bubble-bottom, 130px) + 8px); }
  #screen-fish .btn-action { bottom: 8px; min-height: 44px; width: min(58vw, 380px); padding: 8px 14px; font-size: 18px; }
}

/* On mid-width tablets the centered message can otherwise touch the left
   tackle toggle, especially with longer English labels. */
@media (min-width: 561px) and (max-width: 900px) and (min-height: 501px) {
  #screen-fish .fish-msg { bottom: 220px; }
}

/* Persistent language/author controls live above every screen and dialog. */
.global-tools { position: absolute; top: 6px; right: 6px; z-index: 80; display: flex; gap: 5px; align-items: center; }
.global-tool { width: 44px; height: 44px; padding: 3px; display: grid; place-items: center; font-size: 23px; text-decoration: none; }
.global-tool img { width: 32px; height: 32px; object-fit: contain; }
.language-flag { display: block; width: 29px; height: 20px; border: 1px solid rgba(30,30,30,.65); border-radius: 2px; overflow: hidden; }
.flag-ru { background: linear-gradient(to bottom, #fff 0 33.33%, #164aa7 33.33% 66.66%, #d62b35 66.66% 100%); }
.flag-en { background: #19417a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 40'%3E%3Cpath d='M0 0L60 40M60 0L0 40' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M0 0L60 40M60 0L0 40' stroke='%23c92735' stroke-width='4'/%3E%3Cpath d='M30 0V40M0 20H60' stroke='%23fff' stroke-width='14'/%3E%3Cpath d='M30 0V40M0 20H60' stroke='%23c92735' stroke-width='7'/%3E%3C/svg%3E") center / cover no-repeat; }
#screen-menu { padding-top: 50px; overflow-y: auto; }
#screen-village .topbar, #screen-fish .topbar { padding-right: 100px; }
.modal { padding-top: 56px; }
.modal-box { max-height: 100%; }

/* A row of drawn, consistently sized miniature illustrations replaces emoji
   in the village and the fishing shortcut rail. */
.building-art { display: block; width: min(88%, 90px); height: 48px; object-fit: contain; border-radius: 7px; }
.shortcut-art { display: block; width: 100%; height: 100%; padding: 2px; object-fit: cover; border-radius: 50%; }
#screen-fish .fish-side .btn-round { overflow: visible; }
#screen-fish .rig-toggle { bottom: 190px; left: auto; right: 80px; }
.rig-modal-content { display: grid; gap: 8px; }
.rig-modal-content .btn-small { min-height: 40px; }

/* Long windows show just one section at a time; horizontal scrolling keeps
   tabs reachable without turning a phone header into several rows. */
.section-tabs { display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; padding: 2px 0 8px; margin: 0 0 10px; scrollbar-width: thin; }
.section-tabs .btn { flex: 0 0 auto; min-height: 42px; white-space: nowrap; }
.section-tabs .btn.active { background: linear-gradient(180deg, #4d7357, var(--green-d)); color: #f2f7ea; }
.section-tabs::-webkit-scrollbar { height: 5px; }
.section-tabs::-webkit-scrollbar-thumb { background: #a48a5d; border-radius: 4px; }
.author-settings { margin: 12px 0; padding: 12px; border: 2px solid #b39b71; border-radius: 12px; background: #fdf6dd; }
.author-settings h4 { margin: 0; }
.author-settings label { display: block; font-weight: 700; margin: 8px 0; }
.author-settings input[type="url"] { display: block; width: 100%; margin-top: 5px; }
.author-settings .author-toggle { display: flex; gap: 8px; align-items: center; }

@media (max-height: 500px) and (orientation: landscape) {
  #screen-menu { padding-top: 50px; }
  #screen-village .building-art { height: 32px; width: 64px; }
  #screen-fish .rig-toggle { bottom: 116px; right: 70px; }
}
@media (max-width: 560px) and (orientation: portrait) {
  /* The reserved corner beside the scrolling HUD keeps both anglers and the
     quest unobscured on small portrait screens. */
  #screen-fish .rig-toggle { top: 56px; right: 6px; bottom: auto; left: auto; width: 90px; min-height: 44px; max-width: 90px; justify-content: center; padding: 4px; font-size: 12px; line-height: 1.12; text-align: center; }
  #screen-fish .rig-toggle > span:first-child, #screen-fish .rig-toggle .rig-toggle-arrow { display: none; }
}

/* Five direct choices in the house settings; the global flag cycles through
   the same languages without requiring a wide control on phones. */
.flag-de { background: linear-gradient(to bottom, #171717 0 33.33%, #d3202c 33.33% 66.66%, #f8d54a 66.66% 100%); }
.flag-zh { background: #de292e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 40'%3E%3Cpath fill='%23ffde00' d='m10 4 1.7 5.2h5.5l-4.45 3.2 1.7 5.2L10 14.4l-4.45 3.2 1.7-5.2L2.8 9.2h5.5z'/%3E%3C/svg%3E") center / cover no-repeat; }
.flag-tr { background: #e30a17 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 40'%3E%3Ccircle fill='white' cx='25' cy='20' r='12'/%3E%3Ccircle fill='%23e30a17' cx='29' cy='20' r='9.5'/%3E%3Cpath fill='white' d='m39 12 1.9 5.7h6l-4.8 3.5 1.8 5.7-4.9-3.5-4.9 3.5 1.9-5.7-4.9-3.5h6z'/%3E%3C/svg%3E") center / cover no-repeat; }
.language-settings { align-items: flex-start; gap: 8px; }
.language-options { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; min-width: 0; }
.language-options .btn { white-space: nowrap; }
.language-options .btn[aria-pressed="true"] { outline: 2px solid #a45b2a; outline-offset: -3px; }
@media (max-width: 420px) {
  .language-settings { flex-wrap: wrap; }
  .language-options { width: 100%; justify-content: flex-start; }
  /* Preserve complete words in sticky dialog titles beside the close button
     on small phones, without sacrificing the button's touch height. */
  .modal-head { gap: 6px; }
  .modal-head h2 { font-size: clamp(17px, 5vw, 20px); }
  .modal-head [data-close] { padding-left: 8px; padding-right: 8px; }
}

/* TMV 6.5.9: all window tabs remain visible and wrap instead of sliding away. */
.section-tabs { flex-wrap: wrap; overflow: visible; overscroll-behavior-x: auto; }
.section-tabs .btn { flex: 0 1 auto; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.coins-chip { gap: 5px; padding-right: 4px; }
.coin-ad-button { border: 1.5px solid #6d4a29; border-radius: 50%; width: 30px; height: 30px; display: inline-grid; place-items: center; padding: 0; background: #f6dc9b; cursor: pointer; font-size: 15px; }
.coin-ad-button:disabled { opacity: .55; cursor: not-allowed; }
.energy-chip { cursor: pointer; }
#screen-village .topbar, #screen-fish .topbar { padding-right: var(--global-tools-reserve, 150px); }
/* The village header occupies its own strip above the scrollable buildings. */
#screen-village .village-menu-btn { top: calc(var(--village-hud-bottom, 54px) + 6px); bottom: auto; }
#screen-village .village-hint { top: calc(var(--village-hud-bottom, 54px) + 6px); bottom: auto; left: var(--village-hint-left, 120px); right: 10px;
  width: auto; max-width: none; max-height: none; overflow: visible; transform: none; padding: 5px 8px; font-size: 13px; line-height: 1.25; }
#screen-village .buildings { top: calc(var(--village-hud-bottom, 54px) + var(--village-header-height, 66px)); bottom: 8px; max-height: none;
  overflow-x: hidden; overflow-y: auto; align-content: flex-end; }
.parcel-card { flex-wrap: wrap; align-items: center; }
.parcel-card .grow { min-width: min(220px, 100%); flex: 1 1 220px; }
.parcel-card .btn { flex: 1 1 160px; max-width: 100%; white-space: normal; }
.calendar-grid, .calendar-card, .species-chips { min-width: 0; }
.calendar-card { display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.calendar-card .btn { box-sizing: border-box; min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; margin-top: auto; }
.species-chips { display: flex; flex-wrap: wrap; gap: 4px; line-height: 1.3; }
.species-chips span { display: inline-block; min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; margin: 0; }
@media (max-width: 560px) and (orientation: portrait) {
  #screen-village .buildings { top: calc(var(--village-hud-bottom, 160px) + var(--village-header-height, 66px)); max-height: none; align-content: flex-start; }
}
@media (max-height: 500px) and (orientation: landscape) {
  #screen-village .village-menu-btn { top: calc(var(--village-hud-bottom, 64px) + 6px); }
  #screen-village .village-hint { top: calc(var(--village-hud-bottom, 64px) + 6px); width: auto; max-height: none; overflow: visible; }
  #screen-village .buildings { top: calc(var(--village-hud-bottom, 64px) + var(--village-header-height, 58px)); bottom: 4px; flex-wrap: wrap; overflow-x: hidden; overflow-y: auto; align-content: flex-start; }
}
.store-icon img { display: block; width: 100%; height: 112px; object-fit: contain; }
.profile-editor { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin: 12px 0; }
.profile-editor label { flex: 1 1 180px; min-width: 0; font-weight: 700; }
.profile-editor input { width: 100%; box-sizing: border-box; display: block; margin-top: 4px; }

@media (max-width: 560px) and (orientation: portrait) {
  #village-topbar, #fish-topbar { gap: 4px; }
  #village-topbar .chip, #fish-topbar .chip { font-size: 12px; padding: 3px 7px; gap: 4px; white-space: nowrap; }
  #village-topbar .xpbar, #fish-topbar .xpbar { width: 62px; }
}
/* A bundled OFL Chinese fallback also works on devices without CJK fonts. */
@font-face {
  font-family: 'TMV Noto Sans SC';
  src: url('../assets/fonts/noto-sans-sc-400.woff2') format('woff2');
  font-style: normal; font-weight: 400; font-display: swap;
}
html:lang(zh) body { font-family: 'Segoe UI', 'TMV Noto Sans SC', 'TMV Noto Sans Fish', 'TMV Color Emoji', sans-serif; }
.coin-ad-button img { display: block; width: 21px; height: 21px; }
html:lang(zh) .poster-title, html:lang(zh) .modal-head h2,
html:lang(zh) .catch-name, html:lang(zh) .news-paper,
html:lang(zh) .news-masthead .ntitle, html:lang(zh) .levelup-fx {
  font-family: 'TMV Noto Sans SC', 'TMV Noto Sans Fish', 'TMV Color Emoji', sans-serif;
}

/* Local emoji fallback also keeps game symbols visible on systems without an emoji font. */
@font-face {
  font-family: 'TMV Color Emoji';
  src: url('../assets/fonts/noto-color-emoji-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  /* Do not take ordinary spaces or ASCII digits from the emoji font. */
  unicode-range: U+200D, U+2300-23FF, U+2600-27BF, U+2B00-2BFF, U+FE0E-FE0F, U+1F000-1FAFF;
}

/* Rare fish-name ideographs absent from the common simplified-Chinese subset. */
@font-face {
  font-family: 'TMV Noto Sans Fish';
  src: url('../assets/fonts/noto-sans-cjk-fish-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+4C57, U+9B88, U+9BB0, U+9C65, U+9C83, U+9C86, U+9C89, U+9C8C, U+9C8F, U+9CA6, U+9CBB, U+9CC0, U+9CC7, U+9CD1, U+9CDA, U+9CE2;
}

/* Server-required deployment: pending saves must not be mistaken for committed progress. */
.server-gate { position: fixed; z-index: 10000; inset: 0; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(24, 24, 20, .74); }
.server-gate[hidden] { display: none; }
.server-gate-box { width: min(100%, 540px); max-height: calc(100dvh - 36px); overflow: auto; padding: 24px; border: 3px solid var(--ink); border-radius: 12px; background: #fff7dc; color: var(--ink); box-shadow: 0 10px 40px #0006; }
.server-gate-box h2 { margin: 0 0 12px; font-size: 1.25rem; }
.server-gate-box p { line-height: 1.45; }
.server-gate-detail { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; }
.server-gate-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Optional, reversible repair for legacy random quests and clear contest rules. */
.quest-guidance { margin-top: 6px; font-size: 12.5px; line-height: 1.4; color: #35543d; overflow-wrap: anywhere; }
.quest-replace { margin-top: 8px; padding: 8px 10px; border: 1.5px solid #a58c62; border-radius: 9px; background: #faf3df; font-size: 13px; line-height: 1.4; }
.quest-replace summary { cursor: pointer; color: var(--green-d); font-weight: 800; }
.quest-replace p { margin: 8px 0; }
.contest-recovery, .contest-budget { margin: 10px 0; padding: 9px 11px; border-radius: 9px; background: #e9efd9; color: #2c4630; font-size: 13px; line-height: 1.45; }
.contest-recovery { border: 1.5px solid #809b70; }
.contest-recovery .btn { margin-top: 5px; }

/* Confirm a specific sale or a whole-pot soup without hiding the other fish. */
.fish-confirm { margin-top: 9px; padding: 9px 11px; border: 2px solid #8b653a; border-radius: 10px; background: #fff3d3; color: #352718; overflow-wrap: anywhere; }
.fish-confirm p { margin: 0; font-weight: 700; line-height: 1.4; }
.fish-confirm .btn-row { justify-content: flex-start; }
@media (max-width: 480px) {
  .fish-confirm .btn-row .btn { flex: 1 1 130px; min-width: 0; max-width: 100%; }
}

/* A temporary starter repair and a route out of hunger are clearly labelled. */
.emergency-repair, .recovery-info { min-width: 0; margin: 9px 0; padding: 9px 11px; border: 1px solid #8b793e; border-radius: 9px; background: #f6edcf; color: #342c18; overflow-wrap: anywhere; }
.emergency-repair p, .recovery-info p { margin: 0 0 7px; font-size: 13px; line-height: 1.4; }
.emergency-repair .btn, .recovery-info .btn { max-width: 100%; white-space: normal; }
.recovery-info p:empty { display: none; }
.cast-equipment-notice { min-width: 0; margin: 9px 0; padding: 9px 11px; border: 1px solid #8b793e; border-radius: 9px; background: #f6edcf; color: #342c18; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
