/* ==========================================================================
   БРАКОНЬЕР · кожа интерфейса по киту Brakoner_UI_Portrait v2.1
   Панели, кнопки, вкладки, слоты и подсказки собираются из картинок кита
   через nine-slice (border-image), как в ui-theme.css / PORTRAIT_LAYOUT.md.
   Поле «три в ряд» (#screenMatch3, .m3-*, #board, .booster-panel) не трогаем.
   ========================================================================== */

@font-face {
  font-family: 'Interface';
  src: url('assets/ui/fonts/Interface-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Interface';
  src: url('assets/ui/fonts/Interface-Bold.ttf') format('truetype');
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Display';
  src: url('assets/ui/fonts/Display-Serif.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ui-text: #e8e0ce;
  --ui-muted: #b7bca8;
  --ui-accent: #c3aa75;
  --ui-bg: #111815;
  --ui-line: #687153;
  --ui-plate: #182019;
  color-scheme: dark;
}

html body {
  background: var(--ui-bg) !important;
  background-image: radial-gradient(120% 80% at 50% 0%, #16201b 0%, #0d1411 55%, #080d0b 100%) !important;
  color: var(--ui-text) !important;
  font-family: Interface, 'Nunito', system-ui, sans-serif !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html body.in-menu { background: #080d09 !important; }

html body ::-webkit-scrollbar { width: 6px; height: 6px; }
html body ::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.35) !important; }
html body ::-webkit-scrollbar-thumb {
  background: url('assets/ui/img/components/scroll_thumb.webp') center/100% 100% no-repeat !important;
  border-radius: 0 !important;
}

/* --------------------------------------------------------------------------
   HUD: hud_topbar + hud_resource, пиктограммы кита
   -------------------------------------------------------------------------- */
html body .global-hud {
  max-width: 440px !important;
  gap: 4px !important;
  margin-bottom: 10px !important;
  padding: 8px 10px !important;
  background: url('assets/ui/img/components/hud_topbar.webp') center / 100% 100% no-repeat !important;
  border: 0 !important;
  box-shadow: none !important;
  align-items: center !important;
}
html body .global-hud .hud-item {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--ui-text) !important;
  padding: 2px !important;
  gap: 3px !important;
}
html body .global-hud .hud-item + .hud-item {
  border-left: 1px solid rgba(195, 170, 117, 0.18) !important;
}
html body .global-hud .hud-icon {
  display: inline-block !important;
  width: 15px !important;
  height: 15px !important;
  font-size: 0 !important;
  line-height: 0 !important;
  margin: 0 !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: contain !important;
  filter: none !important;
}
html body .global-hud .lives-stat .hud-icon { background-image: url('assets/ui/img/icons/icon_heart.webp') !important; }
html body .global-hud .stars-stat .hud-icon { background-image: url('assets/ui/img/icons/icon_star.webp') !important; }
html body .global-hud .silver-stat .hud-icon { background-image: url('assets/ui/img/icons/icon_silver.webp') !important; }
html body .global-hud .rep-stat .hud-icon { background-image: url('assets/ui/img/icons/icon_reputation.webp') !important; }
html body .global-hud .hud-val {
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  letter-spacing: 0.01em !important;
  color: var(--ui-text) !important;
  text-shadow: none !important;
}
html body .global-hud .stars-stat .hud-val { color: #e2c88f !important; }
html body .global-hud .lives-stat .hud-val { color: #e7dccb !important; }
html body .global-hud .silver-stat .hud-val { color: var(--ui-accent) !important; }
html body .global-hud .rep-stat .hud-val { color: #b8c8a8 !important; }

/* --------------------------------------------------------------------------
   Локация и цель: badge_location / badge_quest
   -------------------------------------------------------------------------- */
html body .location-banner {
  background: url('assets/ui/img/components/badge_location.webp') center / 100% 100% no-repeat !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--ui-text) !important;
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  letter-spacing: 0.03em !important;
  text-transform: none !important;
  text-align: left !important;
  padding: 10px 16px 10px 40px !important;
  text-shadow: none !important;
  margin-bottom: 10px !important;
  min-height: 48px;
}
html body .location-banner::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  background: url('assets/ui/img/icons/icon_pin.webp') center / contain no-repeat;
}
html body .location-banner { position: relative !important; }
html body .pirate-map-banner {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
html body .pirate-map-banner .map-hint-mini {
  font-family: Interface, sans-serif !important;
  font-weight: 400 !important;
  font-size: 10.5px !important;
  letter-spacing: 0.02em !important;
  color: var(--ui-muted) !important;
  text-transform: none !important;
}

html body .story-goal-chip {
  background: url('assets/ui/img/components/badge_quest.webp') center / 100% 100% no-repeat !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--ui-text) !important;
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  font-size: 11.5px !important;
  padding: 8px 16px !important;
  letter-spacing: 0.02em !important;
}
html body .story-goal-chip:active { transform: translateY(1px); }

/* --------------------------------------------------------------------------
   Нижняя навигация: hud_bottombar + icon_button_idle + пиктограммы
   -------------------------------------------------------------------------- */
html body .screen-navigation {
  gap: 6px !important;
  padding: 8px 10px !important;
  margin-top: 8px !important;
  background: url('assets/ui/img/components/hud_bottombar.webp') center / 100% 100% no-repeat !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

html body .menu-btn {
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
  color: var(--ui-text) !important;
  background: url('assets/ui/img/components/button_secondary_idle.webp') center / 100% 100% no-repeat !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 12px 16px !important;
  min-height: 48px !important;
}
html body .menu-btn:active {
  transform: translateY(1px) !important;
  background-image: url('assets/ui/img/components/button_secondary_pressed.webp') !important;
}

html body #screenHideout .nav-with-play.nav-icons {
  justify-content: space-between !important;
  gap: 6px !important;
}
html body #screenHideout .nav-with-play .menu-btn.icon-btn {
  width: 50px !important;
  height: 50px !important;
  min-height: 50px !important;
  flex: 0 0 50px !important;
  border-radius: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  font-size: 0 !important;
  color: transparent !important;
  padding: 0 !important;
  background-color: transparent !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 100% 100% !important;
  text-shadow: none !important;
}
html body #screenHideout .nav-with-play .menu-btn.story-btn {
  background-image:
    url('assets/ui/img/icons/icon_journal.webp'),
    url('assets/ui/img/components/icon_button_idle.webp') !important;
  background-size: 24px 24px, 100% 100% !important;
  background-repeat: no-repeat, no-repeat !important;
  background-position: center, center !important;
}
html body #screenHideout .nav-with-play .menu-btn.inv-btn {
  background-image:
    url('assets/ui/img/icons/icon_inventory.webp'),
    url('assets/ui/img/components/icon_button_idle.webp') !important;
  background-size: 24px 24px, 100% 100% !important;
  background-repeat: no-repeat, no-repeat !important;
  background-position: center, center !important;
}
html body #screenHideout .nav-with-play .menu-btn.hunt-btn {
  background-image:
    url('assets/ui/img/icons/icon_map.webp'),
    url('assets/ui/img/components/icon_button_idle.webp') !important;
  background-size: 24px 24px, 100% 100% !important;
  background-repeat: no-repeat, no-repeat !important;
  background-position: center, center !important;
}
html body #screenHideout .nav-with-play .menu-btn.icon-btn:active {
  transform: translateY(1px) !important;
  filter: brightness(1.25);
}

html body #screenHideout .nav-with-play .menu-btn.play-btn {
  width: 60px !important;
  height: 60px !important;
  min-height: 60px !important;
  flex: 0 0 60px !important;
  border-radius: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  background:
    url('assets/ui/img/icons/icon_play.webp') center / 26px 26px no-repeat,
    url('assets/ui/img/components/icon_button_idle.webp') center / 100% 100% no-repeat !important;
  color: transparent !important;
  text-shadow: none !important;
  filter: drop-shadow(0 0 10px rgba(195, 170, 117, 0.35));
}
html body #screenHideout .nav-with-play .menu-btn.play-btn:active {
  transform: translateY(1px) !important;
  filter: none;
}
html body #screenHideout .nav-with-play .play-icon {
  font-size: 0 !important;
  width: 0 !important;
  height: 0 !important;
  color: transparent !important;
}

/* --------------------------------------------------------------------------
   Панель находок в комнате
   -------------------------------------------------------------------------- */
html body .inventory-panel {
  background: url('assets/ui/img/components/hud_bottombar.webp') center / 100% 100% no-repeat !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 8px 14px !important;
  min-height: 48px;
}
html body .inv-title {
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  font-size: 10.5px !important;
  letter-spacing: 0.08em !important;
  color: var(--ui-accent) !important;
}
html body .inventory-item {
  background: url('assets/ui/img/components/slot_idle.webp') center / 100% 100% no-repeat !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: var(--ui-text) !important;
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  font-size: 10.5px !important;
  padding: 7px 10px !important;
}

html body .hideout-viewport {
  border-radius: 10px !important;
  box-shadow: inset 0 0 0 1px rgba(195, 170, 117, 0.22), 0 12px 30px rgba(0, 0, 0, 0.45) !important;
}

/* --------------------------------------------------------------------------
   Главное меню: ui_menu_background + button_primary/secondary
   -------------------------------------------------------------------------- */
html body .menu-bg {
  background: url('assets/ui/img/art/ui_menu_background.webp') center / cover no-repeat !important;
  filter: saturate(0.95) brightness(1.02) contrast(1.02) !important;
}
html body .menu-vignette {
  background:
    radial-gradient(110% 75% at 50% 28%, rgba(8, 13, 10, 0) 0%, rgba(8, 13, 10, 0.18) 58%, rgba(6, 10, 8, 0.88) 100%),
    linear-gradient(180deg, rgba(6, 10, 8, 0.72) 0%, rgba(6, 10, 8, 0.05) 30%, rgba(6, 10, 8, 0.9) 100%) !important;
  background-size: auto !important;
}
html body .menu-inner {
  max-width: 440px !important;
  padding: calc(16px + env(safe-area-inset-top)) 18px calc(16px + env(safe-area-inset-bottom)) !important;
}
html body .menu-build {
  font-family: Interface, sans-serif !important;
  font-size: 9.5px !important;
  letter-spacing: 0.16em !important;
  color: rgba(232, 224, 206, 0.42) !important;
}
html body .menu-kicker {
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  letter-spacing: 0.34em !important;
  color: var(--ui-accent) !important;
  opacity: 1;
}
html body #screenMenu .menu-title {
  font-family: Display, serif !important;
  font-weight: 400 !important;
  font-size: clamp(40px, 13vw, 58px) !important;
  line-height: 1.02 !important;
  letter-spacing: 0.05em !important;
  color: #f2ead8 !important;
  text-shadow: 0 3px 22px rgba(0, 0, 0, 0.8) !important;
  margin: 8px 0 6px !important;
}
html body #screenMenu .menu-title::after { display: none !important; }
html body .menu-tagline {
  font-family: Display, serif !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  font-weight: 400 !important;
  color: rgba(232, 224, 206, 0.8) !important;
  max-width: 320px;
}
html body #screenMenu .menu-tags span {
  font-family: Interface, sans-serif !important;
  font-size: 10px !important;
  letter-spacing: 0.06em !important;
  color: rgba(232, 224, 206, 0.78) !important;
  border: 1px solid rgba(195, 170, 117, 0.28) !important;
  background: rgba(17, 24, 21, 0.72) !important;
  border-radius: 999px !important;
  padding: 4px 10px !important;
  box-shadow: none !important;
  text-transform: none !important;
}
html body #screenMenu .menu-stat {
  background: url('assets/ui/img/components/hud_resource.webp') center / 100% 100% no-repeat !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 8px 4px 7px !important;
}
html body #screenMenu .menu-stat-ico {
  width: 14px !important;
  height: 14px !important;
  font-size: 0 !important;
  line-height: 0 !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: contain !important;
}
html body #menuStats .menu-stat:nth-child(1) .menu-stat-ico { background-image: url('assets/ui/img/icons/icon_trophy.webp') !important; }
html body #menuStats .menu-stat:nth-child(2) .menu-stat-ico { background-image: url('assets/ui/img/icons/icon_star.webp') !important; }
html body #menuStats .menu-stat:nth-child(3) .menu-stat-ico { background-image: url('assets/ui/img/icons/icon_heart.webp') !important; }
html body #menuStats .menu-stat:nth-child(4) .menu-stat-ico { background-image: url('assets/ui/img/icons/icon_silver.webp') !important; }
html body #screenMenu .menu-stat-val {
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  color: #e2c88f !important;
  letter-spacing: 0.01em !important;
}
html body #screenMenu .menu-stat-cap {
  font-family: Interface, sans-serif !important;
  font-size: 8.5px !important;
  letter-spacing: 0.1em !important;
  color: var(--ui-muted) !important;
}

html body #screenMenu .menu-play-btn {
  clip-path: none !important;
  border: 16px solid transparent !important;
  border-radius: 0 !important;
  border-image: url('assets/ui/img/components/button_primary_idle.webp') 20 fill / 16px stretch !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--ui-text) !important;
  padding: 2px 8px !important;
  min-height: 60px !important;
}
html body #screenMenu .menu-play-btn:hover {
  border-image-source: url('assets/ui/img/components/button_primary_hover.webp') !important;
}
html body #screenMenu .menu-play-btn:active {
  transform: translateY(1px) !important;
  border-image-source: url('assets/ui/img/components/button_primary_pressed.webp') !important;
}
html body #screenMenu .menu-play-arrow {
  width: 34px !important;
  height: 34px !important;
  font-size: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: url('assets/ui/img/icons/icon_play.webp') center / 20px no-repeat !important;
  color: transparent !important;
}
html body #screenMenu .menu-play-label {
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  font-size: 17px !important;
  letter-spacing: 0.22em !important;
  text-transform: uppercase !important;
  color: #f2ead8 !important;
}
html body #screenMenu .menu-play-sub {
  font-family: Interface, sans-serif !important;
  font-weight: 400 !important;
  font-size: 10.5px !important;
  color: rgba(232, 224, 206, 0.66) !important;
  margin-top: 3px;
}
html body #screenMenu .menu-secondary-btn {
  border: 14px solid transparent !important;
  border-radius: 0 !important;
  border-image: url('assets/ui/img/components/button_secondary_idle.webp') 20 fill / 14px stretch !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--ui-text) !important;
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  padding: 2px 8px !important;
  min-height: 52px !important;
}
html body #screenMenu .menu-secondary-btn:hover {
  border-image-source: url('assets/ui/img/components/button_secondary_hover.webp') !important;
}
html body .menu-footer {
  font-family: Interface, sans-serif !important;
  font-size: 9px !important;
  letter-spacing: 0.12em !important;
  color: rgba(232, 224, 206, 0.32) !important;
}

/* --------------------------------------------------------------------------
   Оверлеи: ui_modal_panel через nine-slice
   -------------------------------------------------------------------------- */
html body .ui-overlay {
  background: rgba(8, 12, 10, 0.86) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

html body .ui-overlay .ui-card {
  background: transparent !important;
  border: 20px solid transparent !important;
  border-radius: 0 !important;
  border-image: url('assets/ui/img/art/ui_modal_panel.webp') 48 / 20px stretch !important;
  background: radial-gradient(120% 60% at 50% 0%, rgba(255,255,255,0.04), transparent 60%), linear-gradient(180deg, #1b241f 0%, #121915 100%) !important;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.6) !important;
  color: var(--ui-text) !important;
  padding: 8px 10px !important;
}

html body .ui-overlay .ui-card h2 {
  font-family: Display, serif !important;
  font-weight: 400 !important;
  font-size: 24px !important;
  letter-spacing: 0.01em !important;
  color: var(--ui-text) !important;
  text-align: left !important;
  margin: 0 0 12px !important;
  padding-bottom: 8px !important;
  border-bottom: 1px solid rgba(195, 170, 117, 0.28) !important;
  text-transform: none !important;
}
html body #overlayLives .ui-card h2,
html body #overlayResults .ui-card h2,
html body #overlayOutOfMoves .ui-card h2,
html body #overlayIntro .ui-card h2 {
  text-align: center !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
}
html body .ui-overlay .ui-card p,
html body .ui-overlay .ui-card li,
html body .ui-overlay .ui-card label {
  color: var(--ui-muted) !important;
  font-family: Interface, sans-serif !important;
}

html body .action-btn {
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  font-size: 14.5px !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
  border: 14px solid transparent !important;
  border-radius: 0 !important;
  border-image: url('assets/ui/img/components/button_primary_idle.webp') 20 fill / 14px stretch !important;
  background: transparent !important;
  color: var(--ui-text) !important;
  box-shadow: none !important;
  padding: 2px 8px !important;
  min-height: 54px !important;
}
html body .action-btn:hover {
  border-image-source: url('assets/ui/img/components/button_primary_hover.webp') !important;
}
html body .action-btn:active {
  transform: translateY(1px) !important;
  border-image-source: url('assets/ui/img/components/button_primary_pressed.webp') !important;
}
html body .action-btn.cancel-btn {
  border-image-source: url('assets/ui/img/components/button_secondary_idle.webp') !important;
  color: var(--ui-muted) !important;
}
html body .action-btn.cancel-btn:hover {
  border-image-source: url('assets/ui/img/components/button_secondary_hover.webp') !important;
}
html body .action-btn.oom-buy {
  border-image-source: url('assets/ui/img/components/button_secondary_idle.webp') !important;
  color: var(--ui-accent) !important;
}
html body .action-btn.oom-lose {
  border-image-source: url('assets/ui/img/components/button_danger_idle.webp') !important;
  color: #e6c3b8 !important;
}
html body .action-btn.oom-lose:hover {
  border-image-source: url('assets/ui/img/components/button_danger_hover.webp') !important;
}

/* Настройки: переключатели-картинки, ползунки кита */
html body .ui-overlay .ui-card.menu-settings-card { border-image-source: url('assets/ui/img/art/ui_modal_panel.webp') !important; }
html body .menu-set-row { border-bottom: 1px solid rgba(195, 170, 117, 0.16) !important; }
html body .menu-set-row:last-of-type { border-bottom: none !important; }
html body .menu-set-title {
  color: var(--ui-text) !important;
  font-family: Interface, sans-serif !important;
  text-transform: none !important;
  letter-spacing: 0.01em !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}
html body .menu-set-hint { color: var(--ui-muted) !important; font-size: 11px !important; }
html body .menu-switch {
  background: url('assets/ui/img/components/button_secondary_idle.webp') center / 100% 100% no-repeat !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: var(--ui-text) !important;
  min-width: 64px !important;
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  padding: 10px 14px !important;
  min-height: 44px !important;
}
html body .menu-switch[aria-pressed] {
  width: 72px !important;
  min-width: 72px !important;
  height: 44px !important;
  padding: 0 !important;
  font-size: 0 !important;
  color: transparent !important;
  background: url('assets/ui/img/components/toggle_off.webp') center / contain no-repeat !important;
}
html body .menu-switch[aria-pressed="true"] {
  background-image: url('assets/ui/img/components/toggle_on.webp') !important;
}
html body .menu-reset-btn {
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  border: 12px solid transparent !important;
  border-radius: 0 !important;
  border-image: url('assets/ui/img/components/button_danger_idle.webp') 20 fill / 12px stretch !important;
  background: transparent !important;
  color: #e6c3b8 !important;
  padding: 2px 8px !important;
  min-height: 44px !important;
}
html body .menu-build-line { color: var(--ui-muted) !important; }

/* --------------------------------------------------------------------------
   Диалог: ui_dialogue_panel + ui_nameplate + choice_*
   -------------------------------------------------------------------------- */
html body #overlayDialogue.ui-overlay { background: #080d09 !important; }
html body #overlayDialogue .dialogue-bg::after {
  background: linear-gradient(180deg, rgba(5, 9, 7, 0.72) 0%, rgba(5, 9, 7, 0.05) 34%, rgba(5, 9, 7, 0.86) 100%) !important;
}

html body #overlayDialogue .dialogue-window {
  background: transparent !important;
  border: 22px solid transparent !important;
  border-radius: 0 !important;
  border-image: url('assets/ui/img/art/ui_dialogue_panel.webp') 40 48 40 48 / 20px stretch !important;
  background: radial-gradient(120% 60% at 50% 0%, rgba(255,255,255,0.04), transparent 60%), linear-gradient(180deg, #1b241f 0%, #121915 100%) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55) !important;
  color: var(--ui-text) !important;
  padding: 4px 8px 6px !important;
  max-width: 440px !important;
  bottom: 14px !important;
}

html body #dialogueBox .speaker-name {
  display: inline-block !important;
  position: relative !important;
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  color: var(--ui-text) !important;
  background: url('assets/ui/img/art/ui_nameplate.webp') center / 100% 100% no-repeat !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 9px 20px !important;
  margin: -36px 0 6px -6px !important;
  min-width: 150px;
  box-shadow: none !important;
}
html body #dialogueBox .speaker-name:empty { display: none !important; }

html body .dialogue-text {
  font-family: Interface, sans-serif !important;
  font-size: 15px !important;
  line-height: 1.5 !important;
  color: var(--ui-text) !important;
  margin: 2px 0 8px !important;
}

html body .scene-title {
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  font-size: 10.5px !important;
  letter-spacing: 0.14em !important;
  color: var(--ui-accent) !important;
  background: rgba(17, 24, 21, 0.6) !important;
  border: 1px solid rgba(195, 170, 117, 0.3) !important;
  border-radius: 4px !important;
  padding: 4px 10px !important;
  box-shadow: none !important;
}
html body .scene-title.scene-title-ending {
  background: rgba(188, 128, 112, 0.16) !important;
  border-color: rgba(188, 128, 112, 0.45) !important;
  color: #edc8bb !important;
}

html body .choices-container { gap: 8px !important; margin-top: 10px !important; }

html body .choice-btn {
  font-family: Interface, sans-serif !important;
  font-weight: 400 !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
  color: var(--ui-text) !important;
  background: transparent !important;
  border: 16px solid transparent !important;
  border-radius: 0 !important;
  border-image: url('assets/ui/img/components/choice_idle.webp') 20 fill / 16px stretch !important;
  box-shadow: none !important;
  padding: 2px 8px !important;
  min-height: 52px !important;
  text-align: left !important;
}
html body .choice-btn:hover {
  border-image-source: url('assets/ui/img/components/choice_hover.webp') !important;
  color: #f2ead8 !important;
}
html body .choice-btn:active {
  transform: translateY(1px) !important;
  border-image-source: url('assets/ui/img/components/choice_selected.webp') !important;
}
html body .choice-btn.premium {
  border-image-source: url('assets/ui/img/components/choice_hover.webp') !important;
  box-shadow: none !important;
}
html body .choice-btn.choice-locked {
  border-image-source: url('assets/ui/img/components/choice_locked.webp') !important;
  color: #89947e !important;
  opacity: 1 !important;
  filter: none;
}
html body .choice-btn .choice-hint,
html body .choice-btn .choice-req {
  border-top-color: rgba(195, 170, 117, 0.22) !important;
  color: var(--ui-muted) !important;
  font-weight: 400 !important;
}

html body .dialogue-hint {
  font-family: Interface, sans-serif !important;
  font-size: 9px !important;
  letter-spacing: 0.12em !important;
  color: var(--ui-muted) !important;
  opacity: 1 !important;
}

html body .dialogue-close-btn {
  width: 32px !important;
  height: 32px !important;
  border-radius: 0 !important;
  border: 0 !important;
  background: url('assets/ui/img/components/icon_button_idle.webp') center / 100% 100% no-repeat !important;
  color: transparent !important;
  font-size: 0 !important;
  box-shadow: none !important;
}
html body .dialogue-close-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('assets/ui/img/icons/icon_close.webp') center / 16px no-repeat;
}
html body .dialogue-close-btn:hover { filter: brightness(1.2); }

/* --------------------------------------------------------------------------
   Рюкзак: ui_inventory_panel + tab_* + slot_* + badge_counter
   -------------------------------------------------------------------------- */
html body #inventoryScreen.ui-overlay .inv-screen-card {
  background: transparent !important;
  border: 20px solid transparent !important;
  border-radius: 0 !important;
  border-image: url('assets/ui/img/art/ui_inventory_panel.webp') 48 / 20px stretch !important;
  background: radial-gradient(120% 60% at 50% 0%, rgba(255,255,255,0.04), transparent 60%), linear-gradient(180deg, #1b241f 0%, #121915 100%) !important;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.6) !important;
  padding: 6px 8px !important;
}
html body .inv-screen-head h2 {
  font-family: Display, serif !important;
  font-weight: 400 !important;
  font-size: 26px !important;
  color: var(--ui-text) !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  text-align: left !important;
}
html body .inv-screen-sub {
  font-family: Interface, sans-serif !important;
  color: var(--ui-muted) !important;
  font-size: 11.5px !important;
}
html body .inv-screen-close {
  border: 0 !important;
  border-radius: 0 !important;
  background: url('assets/ui/img/components/icon_button_idle.webp') center / 100% 100% no-repeat !important;
  color: transparent !important;
  font-size: 0 !important;
  width: 44px !important;
  height: 44px !important;
}
html body .inv-screen-close::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('assets/ui/img/icons/icon_close.webp') center / 18px no-repeat;
}
html body .inv-screen-close:hover { filter: brightness(1.2); }

html body .inv-search {
  background: rgba(12, 18, 15, 0.9) !important;
  border: 1px solid var(--ui-line) !important;
  border-radius: 4px !important;
  color: var(--ui-text) !important;
  font-family: Interface, sans-serif !important;
  font-size: 13px !important;
  padding: 10px 12px 10px 34px !important;
  background-image: url('assets/ui/img/icons/icon_search.webp') !important;
  background-repeat: no-repeat !important;
  background-position: 10px center !important;
  background-size: 16px 16px !important;
}
html body .inv-search::placeholder { color: var(--ui-muted) !important; }
html body .inv-search:focus {
  outline: 2px solid var(--ui-accent) !important;
  outline-offset: 2px !important;
}

html body .inv-chip {
  font-family: Interface, sans-serif !important;
  font-weight: 400 !important;
  font-size: 12px !important;
  color: var(--ui-text) !important;
  background: transparent !important;
  border: 12px solid transparent !important;
  border-radius: 0 !important;
  border-image: url('assets/ui/img/components/tab_idle.webp') 24 fill / 12px stretch !important;
  padding: 2px 6px !important;
  min-height: 40px !important;
}
html body .inv-chip.active {
  background: transparent !important;
  border-image-source: url('assets/ui/img/components/tab_active.webp') !important;
  color: #f2ead8 !important;
}
html body .inv-chip:hover { border-image-source: url('assets/ui/img/components/tab_active.webp') !important; }
html body .inv-chip .inv-chip-count { color: var(--ui-accent) !important; opacity: 1 !important; }

html body .inv-card {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--ui-text) !important;
  padding: 2px !important;
  gap: 4px !important;
}
html body .inv-card-pic {
  aspect-ratio: 1 / 1;
  height: auto !important;
  background: url('assets/ui/img/components/slot_idle.webp') center / 100% 100% no-repeat !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 12% !important;
}
html body .inv-card:hover .inv-card-pic {
  background-image: url('assets/ui/img/components/slot_hover.webp') !important;
}
html body .inv-card-name {
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  color: var(--ui-text) !important;
  text-align: center !important;
}
html body .inv-card-desc {
  font-family: Interface, sans-serif !important;
  font-size: 10.5px !important;
  color: var(--ui-muted) !important;
  line-height: 1.35 !important;
  text-align: center !important;
}
html body .inv-card-count {
  background: url('assets/ui/img/components/badge_counter.webp') center / 100% 100% no-repeat !important;
  border: 0 !important;
  color: var(--ui-text) !important;
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  border-radius: 0 !important;
  min-width: 30px !important;
  padding: 4px 6px !important;
  right: 6px !important;
  bottom: 4px !important;
}
html body .inv-screen-empty { color: var(--ui-muted) !important; }

/* --------------------------------------------------------------------------
   Экран перед уровнем: ui_modal_panel, цели-слоты, button_primary
   -------------------------------------------------------------------------- */
html body #overlayPreLevel.ui-overlay {
  background: rgba(8, 12, 10, 0.82) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
html body .pre-level-card-wrap { filter: drop-shadow(0 24px 44px rgba(0, 0, 0, 0.6)) !important; }

html body .pre-level-card,
html body .pre-level-card.diff-normal,
html body .pre-level-card.diff-medium,
html body .pre-level-card.diff-hard,
html body .pre-level-card.diff-hard-level,
html body .pre-level-card.diff-superhard,
html body .pre-level-card.diff-extreme,
html body .pre-level-card.diff-challenge {
  --pre-ink: #e8e0ce;
  --pre-ink-soft: #b7bca8;
  --pre-header: #2f4030;
  --pre-header-text: #e8e0ce;
  --pre-plate: transparent;
  --pre-plate-deep: transparent;
  --pre-stitch: transparent;
  --pre-title: #e8e0ce;
  --pre-booster-title: #c3aa75;
  --pre-well-bg: rgba(9, 14, 11, 0.7);
  background: transparent !important;
  border: 20px solid transparent !important;
  border-radius: 0 !important;
  border-image: url('assets/ui/img/art/ui_modal_panel.webp') 48 / 20px stretch !important;
  background: radial-gradient(120% 60% at 50% 0%, rgba(255,255,255,0.04), transparent 60%), linear-gradient(180deg, #1b241f 0%, #121915 100%) !important;
  box-shadow: none !important;
  font-family: Interface, sans-serif !important;
  color: var(--ui-text) !important;
  padding: 4px 8px 8px !important;
}
html body .pre-level-card::before { display: none !important; }

html body .pre-level-card .pre-level-header h2,
html body .pre-level-card h2 {
  font-family: Display, serif !important;
  font-weight: 400 !important;
  font-size: 26px !important;
  color: var(--ui-text) !important;
  letter-spacing: 0.01em !important;
  margin: 8px 0 6px !important;
}
html body .diff-badge {
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  font-size: 10px !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: var(--ui-accent) !important;
  background: rgba(195, 170, 117, 0.1) !important;
  border: 1px solid rgba(195, 170, 117, 0.3) !important;
  border-radius: 999px !important;
  padding: 4px 10px !important;
}
html body .pre-goal-well {
  background: url('assets/ui/img/components/slot_idle.webp') center / 100% 100% no-repeat !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 8px !important;
}
html body .pre-booster-title {
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  font-size: 10.5px !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  color: var(--ui-accent) !important;
}
html body .pre-booster-btn {
  background: url('assets/ui/img/components/slot_idle.webp') center / 100% 100% no-repeat !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--ui-text) !important;
  padding: 6px !important;
  min-width: 52px;
  min-height: 52px;
}
html body .pre-booster-btn.selected {
  background-image: url('assets/ui/img/components/slot_selected.webp') !important;
}
html body .pre-play-btn {
  border: 16px solid transparent !important;
  border-radius: 0 !important;
  border-image: url('assets/ui/img/components/button_primary_idle.webp') 20 fill / 16px stretch !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--ui-text) !important;
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  font-size: 17px !important;
  letter-spacing: 0.3em !important;
  text-transform: uppercase !important;
  min-height: 58px !important;
  padding: 2px 8px !important;
}
html body .pre-play-btn:active {
  border-image-source: url('assets/ui/img/components/button_primary_pressed.webp') !important;
}
html body .pre-close-btn {
  border: 0 !important;
  border-radius: 0 !important;
  background: url('assets/ui/img/components/icon_button_idle.webp') center / 100% 100% no-repeat !important;
  color: transparent !important;
  font-size: 0 !important;
  width: 44px !important;
  height: 44px !important;
}
html body .pre-close-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url('assets/ui/img/icons/icon_close.webp') center / 18px no-repeat;
}
html body .pre-meta-row .pre-moves-chip {
  background: url('assets/ui/img/components/hud_resource.webp') center / 100% 100% no-repeat !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: var(--ui-text) !important;
  padding: 6px 14px !important;
}
html body .pre-level-rewards .reward-pill {
  background: url('assets/ui/img/components/hud_resource.webp') center / 100% 100% no-repeat !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: var(--ui-accent) !important;
  padding: 6px 14px !important;
}

/* --------------------------------------------------------------------------
   Карта, задания, дневник (лист журнала)
   -------------------------------------------------------------------------- */
html body .pirate-map-legend {
  background: url('assets/ui/img/components/hud_bottombar.webp') center / 100% 100% no-repeat !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: var(--ui-muted) !important;
  font-family: Interface, sans-serif !important;
  padding: 12px 16px !important;
  min-height: 48px;
}
html body .tasks-scroll-list {
  color: var(--ui-muted) !important;
  font-family: Interface, sans-serif !important;
}

html body #overlayDiary .ui-card {
  background: transparent !important;
  border: 18px solid transparent !important;
  border-radius: 0 !important;
  border-image: url('assets/ui/img/art/ui_journal_paper.webp') 36 fill / 18px stretch !important;
  color: #2a2318 !important;
}
html body #overlayDiary .ui-card h2 {
  color: #2a2318 !important;
  border-bottom-color: rgba(42, 35, 24, 0.25) !important;
  font-family: Display, serif !important;
}
html body #overlayDiary .action-btn.cancel-btn {
  border-image-source: url('assets/ui/img/components/button_secondary_idle.webp') !important;
  color: var(--ui-text) !important;
}
html body #overlayDiary .sm-progress,
html body #overlayDiary .sm-section-title {
  font-family: Interface, sans-serif !important;
  color: #6b5a3c !important;
  opacity: 1 !important;
}
html body #overlayDiary .sm-row {
  background: rgba(42, 35, 24, 0.05) !important;
  border: 1px solid rgba(42, 35, 24, 0.16) !important;
  border-radius: 8px !important;
  color: #2a2318 !important;
  font-family: Interface, sans-serif !important;
}
html body #overlayDiary .sm-name { color: #2a2318 !important; }
html body #overlayDiary .sm-hint { color: #5a4b37 !important; opacity: 1 !important; }
html body #overlayDiary .sm-val { color: #6b5a3c !important; }

/* --------------------------------------------------------------------------
   Уведомления: ui_tooltip_panel
   -------------------------------------------------------------------------- */
html body .toast-notification {
  background: transparent !important;
  border: 14px solid transparent !important;
  border-radius: 0 !important;
  border-image: url('assets/ui/img/art/ui_tooltip_panel.webp') 36 38 36 38 / 14px stretch !important;
  background: linear-gradient(180deg, #1f2822 0%, #121814 100%) !important;
  color: var(--ui-text) !important;
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  font-size: 12.5px !important;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55) !important;
  padding: 2px 10px !important;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

html body .intro-counter { font-family: Interface, sans-serif !important; color: var(--ui-accent) !important; }
html body .intro-text { color: var(--ui-muted) !important; font-family: Interface, sans-serif !important; }
html body .intro-swipe { color: var(--ui-accent) !important; }
html body .intro-dots span { background: rgba(195, 170, 117, 0.25) !important; }
html body .intro-dots span.active { background: var(--ui-accent) !important; }
html body .intro-skip { color: var(--ui-muted) !important; font-family: Interface, sans-serif !important; }

html body .results-content,
html body .lives-lead,
html body .oom-lead,
html body .oom-hint,
html body .lives-regen {
  font-family: Interface, sans-serif !important;
  color: var(--ui-muted) !important;
}
html body .lives-status {
  font-family: Display, serif !important;
  color: #e2c88f !important;
  font-size: 34px !important;
}
html body .m3-loading-label { font-family: Interface, sans-serif !important; }


/* --------------------------------------------------------------------------
   Гасим multiply/blend из прежних текстурных стилей: иначе светлые
   пиктограммы и рамки кита сливаются с плашкой и «исчезают».
   -------------------------------------------------------------------------- */
html body .menu-btn,
html body .action-btn,
html body .global-hud,
html body .global-hud .hud-item,
html body .screen-navigation,
html body .inventory-panel,
html body .inventory-item,
html body .story-goal-chip,
html body .location-banner,
html body .menu-stat,
html body .menu-play-btn,
html body .menu-play-arrow,
html body .menu-secondary-btn,
html body .ui-card,
html body .inv-screen-card,
html body .inv-screen-close,
html body .inv-card,
html body .inv-card-pic,
html body .inv-card-count,
html body .inv-chip,
html body .inv-search,
html body .choice-btn,
html body .dialogue-window,
html body .dialogue-close-btn,
html body .speaker-name,
html body .scene-title,
html body .toast-notification,
html body .pre-level-card,
html body .pre-booster-btn,
html body .pre-play-btn,
html body .pre-close-btn,
html body .pre-goal-well,
html body .pre-moves-chip,
html body .reward-pill,
html body .menu-switch,
html body .menu-reset-btn,
html body .pirate-map-legend,
html body .dialog-overlay,
html body .sm-row {
  background-blend-mode: normal !important;
}


/* ---- Сброс blend с достаточной специфичностью (старые правила с !important) ---- */
html body .menu-btn,
html body .menu-btn.play-btn,
html body .icon-btn,
html body #screenHideout .nav-with-play .menu-btn.icon-btn,
html body #screenHideout .nav-with-play .menu-btn.play-btn,
html body #screenMenu .menu-play-btn,
html body #screenMenu .menu-play-btn:hover,
html body #screenMenu .menu-secondary-btn,
html body #screenMenu .menu-stat,
html body #screenMenu .menu-tags span,
html body .hud-item,
html body .location-banner,
html body .ui-card,
html body .ui-overlay.overlay-win .ui-card,
html body .action-btn,
html body .action-btn.start-btn,
html body .dialogue-window,
html body .dialogue-close-btn,
html body .speaker-name,
html body .choice-btn,
html body #inventoryScreen .inv-screen-card,
html body #inventoryScreen .inv-card,
html body #inventoryScreen .inv-card-pic,
html body #inventoryScreen .inv-card-count,
html body #inventoryScreen .inv-chip,
html body #inventoryScreen .inv-screen-close,
html body #inventoryScreen .inv-search,
html body .pre-level-card,
html body .pre-level-card .start-btn,
html body .pre-level-card .start-btn:active,
html body .pre-level-header,
html body .pre-booster-btn,
html body .pre-booster-btn.selected,
html body .pre-goal-well,
html body .pre-close-btn,
html body .reward-shelf,
html body .reward-pill,
html body .toast-notification,
html body .pirate-map-legend,
html body #screenHideout .inventory-panel,
html body .inventory-item,
html body .menu-switch,
html body .menu-switch[aria-pressed="true"],
html body .menu-reset-btn,
html body .story-goal-chip {
  background-blend-mode: normal !important;
}


/* --- Предуровень: шапка и кнопка PLAY по киту --------------------------- */
html body .pre-level-card .pre-level-header,
html body .pre-level-header,
html body .pre-level-header.pre-header-walk,
html body .pre-level-header.pre-header-fix,
html body .pre-level-header.pre-header-ambush {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-height: 0 !important;
}
html body .pre-level-card .pre-level-header h2,
html body .pre-level-header h2 {
  font-family: Display, serif !important;
  font-weight: 400 !important;
  font-size: 28px !important;
  color: var(--ui-text) !important;
  text-transform: none !important;
  letter-spacing: 0.02em !important;
  text-shadow: none !important;
  margin: 6px 0 4px !important;
}
html body .pre-level-card .start-btn,
html body .pre-level-card .start-btn:active,
html body .pre-level-card .pre-play-btn {
  clip-path: none !important;
  background: transparent !important;
  border: 16px solid transparent !important;
  border-image: url('assets/ui/img/components/button_primary_idle.webp') 20 fill / 16px stretch !important;
  box-shadow: none !important;
  color: var(--ui-text) !important;
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  letter-spacing: 0.28em !important;
  text-transform: uppercase !important;
  padding: 2px 8px !important;
  min-height: 56px !important;
}
html body .pre-level-card .start-btn:hover {
  border-image-source: url('assets/ui/img/components/button_primary_hover.webp') !important;
}
html body .pre-level-card .start-btn:active {
  border-image-source: url('assets/ui/img/components/button_primary_pressed.webp') !important;
}


html body .pre-goal-chip { background: transparent !important; border: 0 !important; box-shadow: none !important; }
html body .pre-goal-num {
  color: var(--ui-text) !important;
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  text-shadow: none !important;
}
html body .pre-goal-chip .pre-goal-icon { filter: none !important; }


/* Убираем старые декоративные псевдоэлементы (блики, мазки, искры) */
html body .pre-close-btn::before,
html body .pre-close-btn::after,
html body .pre-play-btn::before,
html body .pre-play-btn::after,
html body .pre-level-card .start-btn::before,
html body .pre-level-card .start-btn::after,
html body .pre-level-card::after,
html body .dialogue-close-btn::before,
html body .inv-screen-close::before {
  display: none !important;
}
html body .pre-close-btn::after,
html body .dialogue-close-btn::after,
html body .inv-screen-close::after {
  display: block !important;
}
html body .pre-play-btn .pre-play-label {
  color: var(--ui-text) !important;
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  text-shadow: none !important;
  letter-spacing: 0.28em !important;
}


/* --------------------------------------------------------------------------
   Точные правки под макет: без старых мазков, с рабочими крестиками,
   рюкзак в три колонки, подписи навигации, стрелка «далее», футер карты.
   -------------------------------------------------------------------------- */
html body .ui-overlay .ui-card h2::after,
html body .ui-overlay .ui-card h2::before,
html body .inv-screen-head h2::after,
html body #overlayDiary .ui-card h2::after,
html body .inv-screen-head h2::before {
  display: none !important;
  content: none !important;
}

/* Крестики: иконка позиционируется внутри кнопки, а не панели */
html body .inv-screen-close { position: relative !important; }
html body #overlayDialogue .dialogue-close-btn {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
}

/* Рюкзак: три колонки, крупная картинка в ячейке */
html body #inventoryScreen .inv-screen-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
}
html body #inventoryScreen .inv-card { padding: 0 !important; gap: 4px !important; }
html body #inventoryScreen .inv-card-pic { padding: 6% !important; }
html body #inventoryScreen .inv-card-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}
html body #inventoryScreen .inv-card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 9.5px !important;
}
html body #inventoryScreen .inv-card-name { font-size: 11px !important; }

/* Диалог: стрелка «далее» в углу панели, крестик не в тексте */
html body #overlayDialogue .dialogue-window { padding-bottom: 20px !important; }
html body #overlayDialogue .dialogue-window::after {
  content: '';
  position: absolute;
  right: 10px;
  bottom: 8px;
  width: 20px;
  height: 20px;
  background: url('assets/ui/img/icons/icon_next.webp') center / contain no-repeat;
  opacity: 0.75;
  pointer-events: none;
}
html body #overlayDialogue .dialogue-close-btn {
  width: 30px !important;
  height: 30px !important;
}
html body .dialogue-hint {
  text-align: left !important;
  padding-right: 24px;
}

/* Нижняя навигация: иконка + подпись, как в макете */
html body #screenHideout .nav-with-play .menu-btn.icon-btn {
  position: relative !important;
  height: 58px !important;
  min-height: 58px !important;
  flex: 0 0 58px !important;
  background-position: center 10px, center !important;
  background-size: 22px 22px, 100% 100% !important;
}
html body #screenHideout .nav-with-play .menu-btn.icon-btn::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5px;
  text-align: center;
  font-family: Interface, sans-serif;
  font-size: 8.5px;
  letter-spacing: 0.04em;
  color: var(--ui-muted);
  pointer-events: none;
}
html body #screenHideout .nav-with-play .story-btn::after { content: 'Дневник'; }
html body #screenHideout .nav-with-play .inv-btn::after { content: 'Рюкзак'; }
html body #screenHideout .nav-with-play .hunt-btn::after { content: 'Карта'; }
html body #screenHideout .nav-with-play .play-btn::after {
  content: 'Играть';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -14px;
  text-align: center;
  font-family: Interface, sans-serif;
  font-size: 8.5px;
  color: var(--ui-muted);
  pointer-events: none;
}

/* Карта: баннер без эмодзи, футер не уезжает за экран */
html body #screenMap:not(.hidden) {
  overflow: hidden !important;
  height: 100dvh !important;
}
html body #screenMap .pirate-map-viewport {
  flex: 1 1 auto !important;
  min-height: 0 !important;
}
html body #screenMap .screen-navigation {
  flex: 0 0 auto !important;
  margin-bottom: env(safe-area-inset-bottom, 0px) !important;
}
html body .pirate-map-title-stamp {
  color: rgba(195, 170, 117, 0.5) !important;
  opacity: 1 !important;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

/* Настройки: строки и переключатели ближе к макету */
html body .ui-overlay .ui-card.menu-settings-card {
  padding: 10px 12px !important;
  max-height: min(88dvh, 760px);
  overflow-y: auto;
}
html body .menu-set-row { padding: 12px 0 !important; }


/* Нижняя панель всегда поверх сцены */
html body #screenHideout .screen-navigation,
html body #screenMap .screen-navigation {
  position: relative !important;
  z-index: 30 !important;
}
html body #screenHideout .hideout-viewport { z-index: 1 !important; }


/* Сцена снова в потоке: навигация остаётся внизу, а не уезжает под HUD */
html body #screenHideout .hideout-viewport {
  position: relative !important;
  inset: auto !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}
html body #screenHideout .screen-navigation {
  margin-top: auto !important;
  margin-bottom: 0 !important;
}


/* Меню: компактная вертикаль, как на макете — действия видны без прокрутки */
html body #screenMenu .menu-logo { margin-top: clamp(10px, 3vh, 28px) !important; }
html body #screenMenu .menu-title {
  font-size: clamp(34px, 10.5vw, 48px) !important;
  margin: 4px 0 4px !important;
}
html body #screenMenu .menu-tagline {
  font-size: 12.5px !important;
  margin-top: 6px !important;
  line-height: 1.4 !important;
}
html body #screenMenu .menu-tags { display: none !important; }
html body #screenMenu .menu-stats { padding-top: 12px !important; }
html body #screenMenu .menu-actions { margin-top: 10px !important; }
html body #screenMenu .menu-footer { margin-top: 8px !important; }
html body #screenMenu .menu-kicker { font-size: 10px !important; }


html body #screenMenu .menu-stats { margin-top: 22px !important; padding-top: 0 !important; }
html body #screenMenu .menu-actions { margin-top: auto !important; padding-top: 16px !important; }
html body #screenMenu .menu-inner { justify-content: flex-start !important; }
html body #screenMenu .menu-footer { padding-top: 6px !important; }


/* Кнопки без старых вырезок-мазков */
html body .action-btn,
html body .menu-btn,
html body .choice-btn,
html body .pre-play-btn { clip-path: none !important; }
html body .ui-overlay .ui-card h2::before,
html body .ui-overlay .ui-card h2::after { display: none !important; content: none !important; }


/* Убираем старые «скотч/скрепки» на бумажных панелях */
html body #overlayDiary .ui-card::before,
html body #overlayDiary .ui-card::after,
html body #inventoryScreen .inv-screen-card::before,
html body #inventoryScreen .inv-screen-card::after {
  display: none !important;
  content: none !important;
}


/* Карта: «Играть» — плита кита, а не старая красная клякса */
html body #screenMap .menu-btn.play-btn {
  background: url('assets/ui/img/components/button_primary_idle.webp') center / 100% 100% no-repeat !important;
  border: 0 !important;
  border-radius: 0 !important;
  clip-path: none !important;
  box-shadow: none !important;
  color: var(--ui-text) !important;
  text-transform: none !important;
  letter-spacing: 0.02em !important;
}
html body #screenMap .menu-btn.play-btn .play-icon { color: var(--ui-text) !important; }


/* Плашка опасности — компактный чип кита, а не красная полоса на весь экран */
html body .location-danger-badge {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  align-self: flex-start !important;
  width: auto !important;
  max-width: 100%;
  padding: 5px 12px !important;
  margin: 0 0 6px !important;
  font-family: Interface, sans-serif !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em !important;
  text-transform: none !important;
  border: 1px solid rgba(188, 128, 112, 0.5) !important;
  background: rgba(24, 18, 17, 0.85) !important;
  color: #e0bdb2 !important;
  border-radius: 999px !important;
  box-shadow: none !important;
}
html body .location-danger-badge.danger-mid {
  color: var(--ui-accent) !important;
  border-color: rgba(195, 170, 117, 0.45) !important;
}
html body .location-danger-badge.danger-safe {
  color: #b8c8a8 !important;
  border-color: rgba(140, 160, 120, 0.45) !important;
}
html body .location-danger-badge.hidden { display: none !important; }


/* Нет портрета — нет плашки вместо него: имя остаётся простым текстом */
html body #dialogueBox .speaker-name.speaker-no-portrait {
  background: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 0 6px !important;
  margin: 0 !important;
  min-height: 0 !important;
  color: var(--ui-accent) !important;
}


/* Никаких мазков: второстепенная кнопка и баннер локации — плиты кита */
html body #screenMenu .menu-secondary-btn,
html body .menu-play-btn,
html body .location-banner,
html body .action-btn.start-btn,
html body .start-btn { clip-path: none !important; }

/* Кнопки «Назад» в оверлеях — плита кита, а не тёмная клякса */
html body .ui-overlay .action-btn {
  background: transparent !important;
  border: 14px solid transparent !important;
  border-image: url('assets/ui/img/components/button_secondary_idle.webp') 20 fill / 14px stretch !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  clip-path: none !important;
  color: var(--ui-text) !important;
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  letter-spacing: 0.16em !important;
  text-transform: uppercase !important;
  min-height: 52px !important;
}
html body .ui-overlay .action-btn:hover {
  border-image-source: url('assets/ui/img/components/button_secondary_hover.webp') !important;
}

/* Заголовки панелей: без иконок-эмодзи, серифный шрифт кита */
html body .ui-overlay .ui-card h2 {
  font-family: Display, serif !important;
  font-weight: 400 !important;
  text-transform: none !important;
  letter-spacing: 0.02em !important;
}


/* Футер карты: «Играть» — подпись и уровень в столбик, без теней и наложений */
html body #screenMap .menu-btn.play-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  text-shadow: none !important;
}
html body #screenMap .menu-btn.play-btn .play-text { gap: 1px !important; }
html body #screenMap .menu-btn.play-btn .play-label {
  font-family: Interface, sans-serif !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  letter-spacing: 0.06em !important;
  line-height: 1.1 !important;
  text-shadow: none !important;
}
html body #screenMap .menu-btn.play-btn .play-level {
  font-family: Interface, sans-serif !important;
  font-weight: 400 !important;
  font-size: 10px !important;
  line-height: 1.1 !important;
  opacity: 1 !important;
  color: var(--ui-muted) !important;
  text-shadow: none !important;
}
html body #screenMap .menu-btn.play-btn .play-icon {
  font-size: 0 !important;
  width: 16px !important;
  height: 16px !important;
  background: url('assets/ui/img/icons/icon_play.webp') center / contain no-repeat !important;
  color: transparent !important;
}
html body #screenMap .menu-btn.back-btn { text-shadow: none !important; }


/* Старая «изолента» над заголовком карточки — убираем во всех оверлеях */
html body .ui-overlay .ui-card:not(.intro-card)::before {
  display: none !important;
  content: none !important;
}

/* Поле три-в-ряд намеренно не переоформляется:
   #screenMatch3, .m3-*, #board, .booster-panel */

/* ================= ЭКРАН СОХРАНЕНИЙ ================= */
html body #overlaySaves .saves-card {
  width: min(94vw, 460px) !important;
  max-height: min(88dvh, 720px) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  padding: 14px 16px !important;
}
html body .saves-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
html body .saves-head h2 {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  font-size: 28px !important;
  line-height: 1.05 !important;
}
html body .saves-close {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: url('assets/ui/img/components/icon_button_idle.webp') center / 100% 100% no-repeat;
  position: relative;
  cursor: pointer;
}
html body .saves-close:hover {
  background-image: url('assets/ui/img/components/icon_button_hover.webp');
}
html body .saves-close::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url('assets/ui/img/icons/icon_close.webp') center / 17px 17px no-repeat;
  opacity: 0.9;
}
html body .saves-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
html body .saves-mode {
  min-height: 46px;
  cursor: pointer;
  border: 1px solid rgba(195, 170, 117, 0.3);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(37, 47, 41, 0.95), rgba(22, 29, 25, 0.95));
  color: var(--ui-muted, #a99d86);
  font-family: Interface, sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
}
html body .saves-mode.is-active {
  color: var(--ui-text, #ece3cd);
  border-color: rgba(195, 170, 117, 0.8);
  background: linear-gradient(180deg, rgba(70, 78, 57, 0.95), rgba(37, 44, 33, 0.95));
  box-shadow: inset 0 -2px 0 rgba(195, 170, 117, 0.55);
}
html body .saves-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  min-height: 0;
  flex: 1 1 auto;
  padding: 2px;
}
html body .save-slot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 6px 10px;
  cursor: pointer;
  border: 1px solid rgba(195, 170, 117, 0.28);
  border-radius: 6px;
  background: rgba(12, 17, 14, 0.72);
  color: var(--ui-text, #ece3cd);
  font-family: Interface, sans-serif;
}
html body .save-slot:hover {
  border-color: rgba(214, 190, 132, 0.6);
}
html body .save-slot.is-selected {
  border-color: rgba(214, 190, 132, 0.95);
  background: rgba(45, 53, 38, 0.78);
  box-shadow: inset 0 0 0 1px rgba(214, 190, 132, 0.35);
}
html body .save-slot.is-empty {
  border-style: dashed;
  border-color: rgba(195, 170, 117, 0.22);
}
html body .save-slot[data-locked="1"] {
  opacity: 0.55;
  cursor: default;
}
html body .save-thumb {
  width: 56px;
  height: 70px;
  flex: 0 0 56px;
  border-radius: 4px;
  border: 1px solid rgba(195, 170, 117, 0.3);
  background-color: #0b100d;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
html body .save-thumb--empty {
  background-image: none;
  border-style: dashed;
  position: relative;
}
html body .save-thumb--empty::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url('assets/ui/img/icons/icon_save.webp') center / 20px 20px no-repeat;
  opacity: 0.35;
}
html body .save-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}
html body .save-title {
  font-family: Interface, sans-serif;
  font-weight: 700;
  font-size: 14px;
}
html body .save-sub {
  font-family: Interface, sans-serif;
  font-size: 11px;
  color: var(--ui-muted, #a99d86);
}
html body .save-place {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: Interface, sans-serif;
  font-size: 11px;
  color: var(--ui-muted, #a99d86);
}
html body .save-place::before {
  content: "";
  width: 12px;
  height: 12px;
  background: url('assets/ui/img/icons/icon_clock.webp') center / contain no-repeat;
  opacity: 0.75;
}
html body .save-time {
  position: absolute;
  right: 10px;
  bottom: 9px;
  font-family: Interface, sans-serif;
  font-size: 10px;
  color: rgba(198, 186, 158, 0.55);
}
html body #btnSavesAction {
  border: 16px solid transparent;
  border-radius: 0;
  border-image: url('assets/ui/img/components/button_primary_idle.webp') 20 fill / 16px stretch;
  background: transparent;
  color: var(--ui-text, #ece3cd);
  font-family: Interface, sans-serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  min-height: 58px;
  padding: 2px 8px;
  cursor: pointer;
}
html body #btnSavesAction:hover {
  border-image-source: url('assets/ui/img/components/button_primary_hover.webp');
}
html body #btnSavesAction:active {
  transform: translateY(1px);
}
html body #btnSavesAction:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ================= ПЕРСОНАЖИ В КОМНАТЕ ================= */
html body .hotspot.type-npc.npc-with-art::before {
  content: none !important;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  animation: none !important;
}
html body .hotspot.type-npc.npc-with-art::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  width: 260%;
  height: 205%;
  background-image: var(--npc-art);
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: contain;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.55));
  pointer-events: none;
}
html body .hotspot.type-npc.npc-with-art:hover::after {
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.65)) brightness(1.06);
}
html body .hotspot.type-npc.npc-with-art .hotspot-label {
  top: auto !important;
  bottom: -26px !important;
  border-color: rgba(255, 226, 154, 0.45);
}

/* ---------- удаление слота и подтверждение ---------- */
html body .save-slot:focus-visible {
  outline: 2px solid rgba(214, 190, 132, 0.55);
  outline-offset: 2px;
}
html body .save-delete {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  background: rgba(58, 28, 22, 0.6);
  border: 1px solid rgba(198, 110, 90, 0.35);
}
html body .save-delete::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('assets/ui/img/icons/icon_trash.webp') center / 13px 13px no-repeat;
  opacity: 0.8;
}
html body .save-delete:hover,
html body .save-delete:focus-visible {
  background: rgba(112, 44, 32, 0.85);
  border-color: rgba(226, 140, 110, 0.75);
}
html body .saves-confirm {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid rgba(200, 120, 90, 0.55);
  background: rgba(52, 26, 20, 0.88);
}
html body .saves-confirm.hidden {
  display: none !important;
}
html body .saves-confirm-text {
  font-family: Interface, sans-serif;
  font-size: 12px;
  line-height: 1.35;
  color: #f0dccb;
}
html body .saves-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
html body .saves-confirm-actions button {
  min-height: 38px;
  cursor: pointer;
  border-radius: 5px;
  font-family: Interface, sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
}
html body #btnSavesConfirmNo {
  background: rgba(30, 38, 32, 0.95);
  border: 1px solid rgba(195, 170, 117, 0.4);
  color: var(--ui-text, #ece3cd);
}
html body #btnSavesConfirmNo:hover {
  border-color: rgba(195, 170, 117, 0.7);
}
html body #btnSavesConfirmYes {
  background: linear-gradient(180deg, rgba(122, 54, 38, 0.95), rgba(74, 30, 22, 0.95));
  border: 1px solid rgba(220, 140, 110, 0.6);
  color: #ffe9dc;
}
html body #btnSavesConfirmYes:hover {
  border-color: rgba(240, 165, 135, 0.9);
}

/* Пока висит подтверждение, основная кнопка не нужна — освобождаем место списку */
html body #overlaySaves.confirm-open #btnSavesAction {
  display: none !important;
}

/* ================= ПЕРСОНАЖИ В КОМНАТЕ (v2) ================= */
/* Старый вариант с псевдоэлементом больше не используется */
html body .hotspot.type-npc.npc-with-art::after {
  content: none !important;
  background: none !important;
  filter: none !important;
}
html body .hotspot.type-npc.npc-with-art .hotspot-label {
  display: none !important;
}
html body .hotspot.type-npc.npc-with-art {
  pointer-events: none !important;
}
html body .npc-figure {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  height: 88%;
  display: flex;
  align-items: flex-end;
  z-index: 6;
  cursor: pointer;
  pointer-events: auto;
}
html body .npc-figure-img {
  height: 100%;
  width: auto;
  max-width: none;
  display: block;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
  transition: filter 0.2s ease;
  user-select: none;
}
html body .npc-figure:hover .npc-figure-img {
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.6)) brightness(1.06);
}
html body .npc-figure-label {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 226, 154, 0.6);
  background: rgba(13, 11, 15, 0.82);
  color: #ffe6a8;
  font-family: Interface, sans-serif;
  font-weight: 700;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
}

/* NPC: персонажа просто тапаем — никаких пунктирных маркеров поверх фигуры.
   Порталы, которые оказывались под силуэтом, отодвинуты в world.js. */
html body .hotspot.type-npc.npc-with-art {
  pointer-events: none !important;
}

html body .hotspot.type-npc.npc-with-art .hotspot-label {
  display: none !important;
}

html body .npc-figure {
  pointer-events: auto !important;
  z-index: 6 !important;
}

/* Зоны поиска и находок: вместо пунктирной рамки — картинка самого предмета */
html body .hotspot.has-item {
  background: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
}

html body .hotspot.has-item::before,
html body .hotspot.has-item::after {
  content: none !important;
  display: none !important;
}

html body .hotspot.has-item {
  background: radial-gradient(closest-side, rgba(8, 12, 10, 0.55), rgba(8, 12, 10, 0) 74%) !important;
}

html body .hotspot-item {
  display: block;
  height: 58px;
  width: auto;
  max-width: 86%;
  object-fit: contain;
  pointer-events: none !important;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.75)) drop-shadow(0 0 6px rgba(0, 0, 0, 0.45));
  transition: transform 0.18s ease, filter 0.18s ease;
}

html body .hotspot.has-item:hover .hotspot-item {
  transform: scale(1.12);
  filter: drop-shadow(0 0 9px rgba(214, 190, 132, 0.65)) drop-shadow(0 3px 6px rgba(0, 0, 0, 0.7));
}

/* Зоны поиска/находок: картинка предмета либо тихий значок — без рамок и плашек */
html body .hotspot.type-search,
html body .hotspot.type-collectible {
  background: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
}

html body .hotspot.type-collectible::after {
  content: "✨" !important;
  font-size: 15px !important;
  opacity: 0.55 !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

html body .hotspot.type-collectible:hover::after {
  opacity: 1 !important;
}

html body .hotspot.type-search::before {
  background: rgba(13, 11, 15, 0.55) !important;
  border-color: rgba(214, 190, 132, 0.55) !important;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6) !important;
}


html body .npc-figure::after {
  content: "" !important;
  position: absolute !important;
  left: 50% !important;
  bottom: -6px !important;
  width: 72% !important;
  height: 30px !important;
  transform: translateX(-50%) !important;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0) 74%) !important;
  filter: blur(3px) !important;
  pointer-events: none !important;
  display: block !important;
}


/* Фигура стоит ровно по нижней кромке комнаты — без утопления и без обрезки. */
html body .npc-figure {
  bottom: 0 !important;
  margin-bottom: 0 !important;
}

/* Подсветка NPC: только у первого встреченного персонажа, как обучение.
   После первого тапа флаг npcTalkHint закрывает подсказку навсегда. */
html body .npc-figure:hover .npc-figure-img {
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.6)) !important;
}

html body .npc-figure.npc-hint .npc-figure-img {
  animation: npcHintPulse 2.6s ease-in-out infinite !important;
  filter: drop-shadow(0 0 12px rgba(255, 226, 154, 0.5)) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55)) !important;
}

html body .npc-figure.npc-hint:hover .npc-figure-img {
  animation-play-state: paused !important;
  filter: drop-shadow(0 0 20px rgba(255, 226, 154, 0.8)) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.6)) brightness(1.08) !important;
}

html body .npc-figure.npc-hint:active .npc-figure-img {
  filter: drop-shadow(0 0 26px rgba(255, 232, 170, 0.95)) drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6)) brightness(1.12) !important;
}

@keyframes npcHintPulse {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(255, 226, 154, 0.32)) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
  }
  50% {
    filter: drop-shadow(0 0 16px rgba(255, 226, 154, 0.62)) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
  }
}

/* Индивидуальный масштаб фигур: Жора в обменнике — вдвое крупнее остальных. */
html body .npc-figure[data-npc="zhora"] {
  height: 200% !important;   /* Жора вдвое крупнее остальных */
  bottom: -104% !important;  /* посажен ниже: голова у верха кадра, ступни за кромкой */
  max-height: none !important;
}

/* Бутя во дворе третьего дома — вдвое крупнее обычного и ниже посадкой. */
html body .npc-figure[data-npc="butya"] {
  height: 176% !important;
  bottom: -80% !important;
  max-height: none !important;
}

/* «Играть» в нижней панели: латунная плита с иконкой play, без красной заливки.
   Правило стоит последним и перебивает красный градиент из style.css. */
html body #screenHideout .nav-with-play .menu-btn.play-btn,
html body #screenHideout .nav-with-play .menu-btn.play-btn:hover {
  background:
    url('assets/ui/img/icons/icon_play.webp') center / 26px 26px no-repeat,
    url('assets/ui/img/components/icon_button_idle.webp') center / 100% 100% no-repeat !important;
  background-blend-mode: normal !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: transparent !important;
  text-shadow: none !important;
  filter: drop-shadow(0 0 10px rgba(195, 170, 117, 0.35)) !important;
}

html body #screenHideout .nav-with-play .menu-btn.play-btn:active {
  background:
    url('assets/ui/img/icons/icon_play.webp') center / 26px 26px no-repeat,
    url('assets/ui/img/components/icon_button_idle.webp') center / 100% 100% no-repeat !important;
  border: 0 !important;
  box-shadow: none !important;
  filter: brightness(1.25) !important;
  transform: translateY(1px) !important;
}

/* Порталы: только надпись, без голубого шара и иконки двери внутри него.
   Белая точка дверей прихожей (.hotspot-door) остаётся как была. */
html body .hotspot.type-portal:not(.hotspot-door)::before {
  content: none !important;
  display: none !important;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  animation: none !important;
  padding: 0 !important;
  width: 0 !important;
  height: 0 !important;
}
html body .hotspot.type-portal {
  background: none !important;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}
html body .hotspot.type-portal:not(.hotspot-door) .hotspot-label {
  max-width: 190px !important;
  overflow: visible !important;
  font-size: 12.5px !important;
  letter-spacing: 0.2px !important;
  color: #f4e7cf !important;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.95),
    0 0 6px rgba(0, 0, 0, 0.9),
    0 0 14px rgba(0, 0, 0, 0.7) !important;
}
html body .hotspot.type-portal:not(.hotspot-door):hover .hotspot-label {
  color: #ffd9a0 !important;
}

/* Плашка «Что с ним сделать?» для найденного предмета (item_actions.js) */
html body #overlayItemAction { z-index: 140; }
html body #overlayItemAction .item-action-card {
  width: min(360px, 86vw);
  padding: 20px 18px 16px;
  border-radius: 16px;
  text-align: center;
  background: linear-gradient(180deg, #241f18 0%, #16130e 100%);
  border: 1px solid rgba(198, 166, 106, 0.55);
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
html body #overlayItemAction .item-action-title {
  font-size: 19px; font-weight: 800; color: #f3dfb2; margin-bottom: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
html body #overlayItemAction .item-action-text {
  margin: 0 0 16px; font-size: 13.5px; font-weight: 600; color: #c9b795;
}
html body #overlayItemAction .item-action-buttons { display: flex; flex-direction: column; gap: 9px; }
html body #overlayItemAction .item-action-btn {
  width: 100%; min-height: 46px; border-radius: 10px; cursor: pointer;
  font-size: 15px; font-weight: 800; letter-spacing: 0.2px;
  color: #f6e6c4;
  background: linear-gradient(180deg, #3a3226 0%, #27211a 55%, #1b1712 100%);
  border: 1px solid rgba(198, 166, 106, 0.5);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
html body #overlayItemAction .item-action-btn:hover { border-color: rgba(240, 205, 140, 0.9); color: #ffe4b0; }
html body #overlayItemAction .item-action-btn:active { transform: translateY(1px); }

/* Картинка предмета в плашке «Что с ним сделать?» */
html body #overlayItemAction .item-action-art {
  display: flex; align-items: center; justify-content: center;
  width: 104px; height: 104px; margin: 0 auto 12px;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 38%, rgba(198, 166, 106, 0.18), rgba(0, 0, 0, 0.4));
  border: 1px solid rgba(198, 166, 106, 0.3);
}
html body #overlayItemAction .item-action-art img {
  max-width: 92px; max-height: 92px; object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.65));
}
html body #overlayItemAction .item-action-art--emoji { font-size: 54px; line-height: 1; }

/* ---------------------------------------------------------------------------
   Превью комнат на пиратской карте: настоящий фон локации в миниатюре.
   Миниатюры лежат в images/thumbs/ (200 px, ~8 КБ), грузятся лениво.
   --------------------------------------------------------------------------- */
html body .pirate-pin .pin-thumb {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #2b2620 center/cover no-repeat;
  border: 2px solid rgba(226, 204, 152, .8);
  box-shadow: 0 2px 7px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(0, 0, 0, .4);
  pointer-events: none;
}
html body .pirate-pin .pin-thumb.is-loaded {
  border-color: rgba(232, 210, 158, .95);
}
html body .pirate-pin.is-here .pin-thumb {
  border-color: #f3d98a;
  box-shadow: 0 0 0 3px rgba(243, 217, 138, .32), 0 2px 9px rgba(0, 0, 0, .6);
}
html body .pirate-pin.has-thumb .pin-label {
  margin-top: 3px;
}

/* Вещь без готовой картинки: значок категории вместо пустой точки */
html body .hotspot.type-collectible .hotspot-label {
  font-size: 20px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .8));
}

/* Люк у Сивого: точка события в комнате */
html body .hotspot.type-hatch {
  border-radius: 10px;
  background: rgba(12, 14, 18, .42);
  border: 1px solid rgba(150, 190, 255, .5);
  box-shadow: 0 2px 9px rgba(0, 0, 0, .5);
}
html body .hotspot.type-hatch .hotspot-label {
  color: #cfe0ff;
  font-size: 16px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .95);
}

/* Мини-игры в локациях */
html body .hotspot.type-minigame {
  border-radius: 10px;
  background: rgba(18, 16, 22, .42);
  border: 1px solid rgba(224, 180, 92, .5);
  box-shadow: 0 2px 9px rgba(0, 0, 0, .5);
}
html body .hotspot.type-minigame .hotspot-label {
  color: #f0dfb8;
  font-size: 16px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .95);
}


/* ==================== ПЛАНШЕТ ДОМА (пак §13) ==================== */
.house-tablet-card { max-height: 88vh; overflow-y: auto; }
.house-tablet-stars { font-weight: 700; margin: 4px 0; }
.house-tablet-summary { opacity: .85; margin: 0 0 4px; }
.house-tablet-lead { font-size: 12px; line-height: 1.4; opacity: .8; margin: 0 0 10px; }
.house-tablet-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.house-room-block { border: 1px solid rgba(255,255,255,.16); border-radius: 10px; padding: 8px; }
.house-room-block.is-restored { border-color: rgba(120,220,140,.5); }
.house-room-block.is-locked { opacity: .55; }
.house-room-head { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.house-room-status { font-weight: 400; font-size: 12px; opacity: .85; }
.house-room-bar { height: 6px; background: rgba(255,255,255,.14); border-radius: 3px; margin: 6px 0; overflow: hidden; }
.house-room-bar i { display: block; height: 100%; background: #d9a441; }
.house-job-head { display: flex; justify-content: space-between; font-size: 13px; margin: 6px 0 2px; }
.house-task { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 3px 0; font-size: 12px; }
.house-task.locked { opacity: .5; }
.house-task-name { flex: 1 1 140px; }
.house-task-cost { opacity: .8; }
.house-task-btn { font-size: 12px; padding: 3px 6px; border-radius: 6px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: inherit; }
.house-task-btn:disabled { opacity: .45; }
.house-task-pay { margin-left: auto; }
.house-room-hint { font-size: 12px; opacity: .7; }


/* Подписи под иконками нижней панели: игрок видит, что за кнопка. */
.nav-with-play .menu-btn[data-label] { position: relative; padding-bottom: 15px; }
.nav-with-play .menu-btn[data-label]::after {
  content: attr(data-label);
  position: absolute; left: 0; right: 0; bottom: 2px;
  font-size: 8.5px; line-height: 1; letter-spacing: .02em;
  opacity: .8; text-align: center; pointer-events: none;
}


/* Подписи на экране уровня: что за цифры. */
.pre-goal-caption {
  font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase;
  opacity: .72; text-align: center; margin-bottom: 2px;
}
.pre-moves-word { font-size: 11px; opacity: .8; margin-left: 3px; }


/* Находки: мягкое свечение, иначе предмет теряется на пёстром фоне комнаты. */
html body .hotspot.has-item {
  animation: hotspotHalo 2.4s infinite ease-in-out;
}
@keyframes hotspotHalo {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 226, 154, 0)); }
  50%      { filter: drop-shadow(0 0 9px rgba(255, 226, 154, .9)); }
}


/* Цель задания прямо на экране комнаты */
html body .location-objective {
  margin: 0 10px 6px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(195, 170, 117, .35);
  background: rgba(16, 13, 12, .78);
  color: #e8d9b6;
  font-family: Interface, sans-serif;
  font-size: 11.5px;
  line-height: 1.35;
}
html body .location-objective.hidden { display: none !important; }

/* Пояснение к закрытым слотам помощи на экране уровня */
html body .pre-boost-hint {
  margin-top: 4px;
  text-align: center;
  font-size: 10.5px;
  opacity: .75;
}
html body .pre-boost-hint.hidden { display: none !important; }

/* На узких экранах подписи панели не должны превращаться в точки */
@media (max-width: 380px) {
  .nav-with-play .menu-btn[data-label] { padding-bottom: 16px; }
  .nav-with-play .menu-btn[data-label]::after { font-size: 9.5px; }
}


/* Цель задания не должна раздувать полосу: не больше двух строк */
html body .location-objective {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Форма отзыва: баг или идея ---------- */
html body #overlayFeedback .feedback-card {
  width: min(94vw, 460px) !important;
  max-height: min(90dvh, 720px) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  padding: 14px 16px !important;
  overflow-y: auto;
}
html body .fb-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
html body .fb-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
html body .fb-tab {
  min-height: 46px;
  cursor: pointer;
  border: 1px solid rgba(195, 170, 117, 0.3);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(37, 47, 41, 0.95), rgba(22, 29, 25, 0.95));
  color: var(--ui-muted, #a99d86);
  font-family: Interface, sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
}
html body .fb-tab.is-active {
  color: #f0e4c6;
  border-color: rgba(224, 196, 120, 0.8);
  background: linear-gradient(180deg, rgba(72, 62, 38, 0.95), rgba(40, 34, 22, 0.95));
}
html body .fb-label {
  font-family: Interface, sans-serif;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ui-muted, #a99d86);
}
html body .fb-text,
html body .fb-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(195, 170, 117, 0.35);
  border-radius: 6px;
  background: rgba(10, 14, 12, 0.85);
  color: #efe6d2;
  font-family: Interface, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  padding: 10px 12px;
}
html body .fb-text { min-height: 120px; resize: vertical; }
html body .fb-text:focus,
html body .fb-input:focus {
  outline: none;
  border-color: rgba(224, 196, 120, 0.85);
  box-shadow: 0 0 0 2px rgba(224, 196, 120, 0.16);
}
html body .fb-counter {
  align-self: flex-end;
  font-size: 10.5px;
  color: rgba(169, 157, 134, 0.8);
}
html body .fb-status {
  min-height: 18px;
  font-size: 12.5px;
  line-height: 1.35;
}
html body .fb-status.is-error { color: #f0a58c; }
html body .fb-status.is-ok { color: #b9d9a4; }
html body .fb-send {
  min-height: 52px;
  cursor: pointer;
  border: 1px solid rgba(224, 196, 120, 0.55);
  border-radius: 7px;
  background: linear-gradient(180deg, #4b5c3f, #2d3a26);
  color: #f4ecd6;
  font-family: Interface, sans-serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.05em;
}
html body .fb-send:disabled { opacity: 0.6; cursor: default; }
html body .fb-note {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(169, 157, 134, 0.85);
}

/* Кликабельность важнее декора: находки, NPC и мини-игры всегда выше порталов.
   Портал («world-passage», z-index 8) раньше накрывал их своим хитбоксом 42×42,
   и предмет под ним нельзя было взять. */
html body #hotspotsContainer .hotspot.type-search,
html body #hotspotsContainer .hotspot.type-collectible,
html body #hotspotsContainer .hotspot.type-npc,
html body #hotspotsContainer .hotspot.type-minigame,
html body #hotspotsContainer .hotspot.type-hatch {
  z-index: 9 !important;
}
/* фигура NPC остаётся под предметами: предмет должен браться, даже если фигура рядом */
