:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #05070a;
  color: #f1f3e9;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 18% 12%, rgba(82, 104, 117, 0.24), transparent 28%),
    radial-gradient(circle at 80% 82%, rgba(66, 99, 78, 0.18), transparent 34%),
    linear-gradient(135deg, #05070a 0%, #071012 42%, #0d0c11 100%);
}

.game-shell {
  position: relative;
  width: min(100vw, 1280px);
  aspect-ratio: 16 / 9;
  max-height: 100vh;
  background: #06090c;
  overflow: hidden;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.62);
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
  cursor: crosshair;
}

.hud {
  position: absolute;
  inset: 10px 10px auto 10px;
  display: grid;
  grid-template-columns: minmax(126px, 0.58fr) minmax(320px, 2.4fr);
  gap: 7px;
  align-items: stretch;
  pointer-events: none;
}

body.is-menu .hud,
body.is-menu .inventory,
body.is-menu .stamina,
body.is-intro .hud,
body.is-intro .inventory,
body.is-intro .stamina,
body.is-cutscene .hud,
body.is-cutscene .inventory,
body.is-cutscene .stamina {
  opacity: 0;
}

.main-menu {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  align-items: center;
  justify-items: start;
  padding: clamp(24px, 5vw, 72px);
  background:
    linear-gradient(90deg, rgba(2, 5, 7, 0.9) 0%, rgba(2, 5, 7, 0.7) 42%, rgba(2, 5, 7, 0.24) 100%),
    radial-gradient(circle at 78% 24%, rgba(158, 31, 48, 0.16), transparent 24%),
    radial-gradient(circle at 72% 80%, rgba(124, 255, 208, 0.09), transparent 28%);
  opacity: 1;
  pointer-events: auto;
  transition:
    opacity 180ms ease,
    visibility 180ms ease;
}

.main-menu.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.main-menu__panel {
  display: none;
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid rgba(255, 226, 150, 0.18);
  border-radius: 8px;
  background: rgba(5, 8, 10, 0.76);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.58),
    inset 0 0 28px rgba(255, 226, 150, 0.04);
  backdrop-filter: blur(16px);
}

.main-menu__panel.is-active {
  display: block;
}

.main-menu__panel[data-menu-panel="chapters"],
.main-menu__panel[data-menu-panel="settings"],
.main-menu__panel[data-menu-panel="languages"] {
  width: min(560px, 100%);
}

.main-menu__panel[data-menu-panel="settings"] {
  max-height: calc(100vh - 36px);
  overflow-y: auto;
}

.main-menu__eyebrow {
  margin: 0 0 8px;
  color: rgba(184, 233, 207, 0.78);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.main-menu h1,
.main-menu h2 {
  margin: 0;
  color: #f8efd2;
  letter-spacing: 0;
  line-height: 1.04;
}

.main-menu h1 {
  max-width: 360px;
  font-size: clamp(34px, 4.8vw, 58px);
}

.main-menu h2 {
  font-size: 22px;
}

.main-menu__actions {
  display: grid;
  gap: 9px;
  margin-top: 26px;
}

.main-menu__button {
  min-height: 44px;
  border: 1px solid rgba(255, 226, 150, 0.2);
  border-radius: 8px;
  background: rgba(14, 20, 22, 0.86);
  color: #f1f3e9;
  font: inherit;
  font-size: 15px;
  font-weight: 850;
  cursor: pointer;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.chapter-select {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 12px;
  margin-top: 18px;
  margin-bottom: 12px;
}

.chapter-select__list {
  display: grid;
  gap: 7px;
}

.chapter-select__item {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid rgba(255, 226, 150, 0.16);
  border-radius: 8px;
  background: rgba(14, 20, 22, 0.82);
  color: rgba(241, 243, 233, 0.72);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.chapter-select__item.is-locked {
  border-color: rgba(255, 226, 150, 0.12);
  background: rgba(10, 13, 15, 0.78);
  color: rgba(241, 243, 233, 0.48);
  cursor: not-allowed;
}

.chapter-select__item.is-selected {
  border-color: rgba(184, 233, 207, 0.74);
  background: rgba(31, 60, 51, 0.82);
  color: #f7fff7;
}

.chapter-select__item.is-selected.is-locked {
  border-color: rgba(255, 226, 150, 0.42);
  background: rgba(48, 35, 28, 0.82);
}

.chapter-select__lock {
  position: relative;
  width: 13px;
  height: 10px;
  display: none;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-radius: 3px;
  opacity: 0.9;
}

.chapter-select__lock::before {
  content: "";
  position: absolute;
  left: 2px;
  top: -9px;
  width: 5px;
  height: 7px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.chapter-select__item.is-locked .chapter-select__lock {
  display: inline-block;
}

.chapter-select__footer {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(96px, 0.7fr);
  gap: 9px;
}

.chapter-preview {
  position: relative;
  min-height: 174px;
  overflow: hidden;
  border: 1px solid rgba(255, 226, 150, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #10161b 0%, #1e2220 56%, #07090a 100%);
}

.chapter-preview::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.22), transparent 44%, rgba(0, 0, 0, 0.3)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 5px);
  content: "";
}

.chapter-preview__moon {
  position: absolute;
  top: 20px;
  right: 28px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(241, 243, 229, 0.72);
  box-shadow: 0 0 38px rgba(241, 243, 229, 0.24);
}

.chapter-preview__house {
  position: absolute;
  left: 48%;
  bottom: 36px;
  width: 84px;
  height: 66px;
  background: #090d0f;
  transform: translateX(-50%);
}

.chapter-preview__house::before {
  position: absolute;
  left: -12px;
  top: -32px;
  width: 108px;
  height: 46px;
  background: #050708;
  clip-path: polygon(50% 0, 100% 72%, 0 72%);
  content: "";
}

.chapter-preview__door {
  position: absolute;
  left: 48%;
  bottom: 36px;
  width: 18px;
  height: 34px;
  background: rgba(255, 226, 150, 0.34);
  transform: translateX(-50%);
  box-shadow: 0 0 28px rgba(255, 226, 150, 0.2);
}

.chapter-preview__path {
  position: absolute;
  left: 50%;
  bottom: -18px;
  width: 110px;
  height: 78px;
  background: rgba(92, 84, 66, 0.28);
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
  transform: translateX(-50%);
}

.chapter-preview--2 {
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 226, 150, 0.12), transparent 32%),
    linear-gradient(180deg, #101314 0%, #17130f 58%, #050607 100%);
}

.chapter-preview--2 .chapter-preview__moon {
  top: 36px;
  right: 50%;
  width: 52px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 226, 150, 0.34);
}

.chapter-preview--2 .chapter-preview__house {
  left: 50%;
  bottom: 46px;
  width: 108px;
  height: 72px;
  border: 12px solid #080a0b;
  background: transparent;
}

.chapter-preview--2 .chapter-preview__house::before {
  display: none;
}

.chapter-preview--2 .chapter-preview__door {
  bottom: 46px;
  width: 44px;
  height: 54px;
  background: rgba(8, 10, 11, 0.86);
  box-shadow: inset 0 0 18px rgba(255, 226, 150, 0.08);
}

.chapter-preview--3 {
  background:
    radial-gradient(circle at 74% 30%, rgba(215, 61, 73, 0.16), transparent 26%),
    linear-gradient(180deg, #111b1d 0%, #18201c 58%, #050708 100%);
}

.chapter-preview--3 .chapter-preview__house {
  left: 64%;
  bottom: 42px;
  width: 92px;
  height: 58px;
}

.chapter-preview--3 .chapter-preview__path {
  left: 42%;
  width: 160px;
  background: rgba(75, 84, 78, 0.28);
  transform: skewX(-14deg) translateX(-50%);
}

.chapter-preview--4 {
  background:
    radial-gradient(circle at 30% 42%, rgba(124, 255, 208, 0.12), transparent 30%),
    linear-gradient(180deg, #121a1b 0%, #172221 58%, #050708 100%);
}

.chapter-preview--4 .chapter-preview__house {
  left: 56%;
  bottom: 38px;
  width: 128px;
  height: 84px;
  background: #080b0c;
}

.chapter-preview--4 .chapter-preview__door {
  left: 66%;
  background: rgba(124, 255, 208, 0.25);
  box-shadow: 0 0 32px rgba(124, 255, 208, 0.2);
}

.chapter-preview--5 {
  background:
    radial-gradient(circle at 50% 76%, rgba(215, 61, 73, 0.16), transparent 24%),
    linear-gradient(180deg, #101418 0%, #1a1614 58%, #040506 100%);
}

.chapter-preview--5 .chapter-preview__moon {
  top: 26px;
  right: 44px;
  width: 52px;
  height: 16px;
  border-radius: 999px;
  background: rgba(215, 61, 73, 0.38);
  box-shadow: 0 0 34px rgba(215, 61, 73, 0.2);
}

.chapter-preview--5 .chapter-preview__house {
  left: 50%;
  bottom: 46px;
  width: 136px;
  height: 56px;
  border: 10px solid #07090a;
  background: rgba(55, 36, 30, 0.52);
}

.chapter-preview--5 .chapter-preview__house::before {
  display: none;
}

.chapter-preview--5 .chapter-preview__door {
  left: 50%;
  bottom: 46px;
  width: 28px;
  height: 44px;
  background: rgba(215, 61, 73, 0.26);
  box-shadow: 0 0 30px rgba(215, 61, 73, 0.18);
}

.chapter-preview--6 {
  background:
    radial-gradient(circle at 72% 30%, rgba(255, 226, 150, 0.18), transparent 24%),
    linear-gradient(180deg, #17333a 0%, #314c42 48%, #0b100d 100%);
}

.chapter-preview--6 .chapter-preview__moon {
  top: 22px;
  right: 34px;
  background: rgba(255, 241, 166, 0.74);
  box-shadow: 0 0 42px rgba(255, 241, 166, 0.24);
}

.chapter-preview--6 .chapter-preview__house {
  left: 70%;
  bottom: 52px;
  width: 84px;
  height: 84px;
  border-radius: 999px 999px 18px 18px;
  background: rgba(39, 73, 48, 0.86);
  transform: translateX(-50%) rotate(-8deg);
}

.chapter-preview--6 .chapter-preview__house::before {
  display: none;
}

.chapter-preview--6 .chapter-preview__door {
  left: 70%;
  bottom: 70px;
  width: 42px;
  height: 42px;
  background: rgba(215, 61, 73, 0.58);
  box-shadow: 0 0 32px rgba(215, 61, 73, 0.28);
  transform: translateX(-50%) rotate(45deg);
}

.chapter-preview--6 .chapter-preview__path {
  left: 38%;
  bottom: -12px;
  width: 230px;
  height: 84px;
  border-radius: 50% 50% 0 0;
  background: rgba(184, 233, 255, 0.18);
  clip-path: none;
}

.main-menu__button:hover,
.main-menu__button:focus-visible {
  border-color: rgba(184, 233, 207, 0.7);
  background: rgba(28, 52, 46, 0.9);
  color: #ffffff;
  outline: none;
  transform: translateY(-1px);
}

.main-menu__button--primary {
  border-color: rgba(255, 226, 150, 0.56);
  background: rgba(111, 74, 38, 0.86);
  color: #fff1b8;
}

.main-menu__button--ghost {
  width: 100%;
  margin-top: 14px;
}

.main-menu__button:disabled {
  border-color: rgba(231, 226, 184, 0.1);
  background: rgba(12, 14, 15, 0.58);
  color: rgba(241, 243, 233, 0.38);
  cursor: not-allowed;
  transform: none;
}

.main-menu__status {
  min-height: 18px;
  margin: 14px 0 0;
  color: rgba(241, 243, 233, 0.58);
  font-size: 12px;
  font-weight: 700;
}

.main-menu__controls-list {
  display: grid;
  grid-template-columns: minmax(92px, 0.75fr) minmax(0, 1fr);
  gap: 7px 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(226, 227, 205, 0.1);
  border-radius: 8px;
  background: rgba(9, 13, 14, 0.54);
  font-size: 13px;
}

.main-menu__controls-list span {
  color: #ffe291;
  font-weight: 850;
}

.main-menu__controls-list strong {
  min-width: 0;
  color: rgba(241, 243, 233, 0.78);
  font-weight: 720;
}

.main-menu__settings-list {
  display: grid;
  gap: 9px;
  margin-top: 16px;
  margin-bottom: 18px;
}

.settings-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-top: 14px;
}

.settings-tab-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.settings-tab {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 38px;
  padding: 6px;
  border: 1px solid rgba(255, 226, 150, 0.14);
  border-radius: 7px;
  background: rgba(11, 16, 18, 0.76);
  color: rgba(241, 243, 233, 0.64);
  font: inherit;
  font-size: 11px;
  font-weight: 820;
  line-height: 1.15;
  cursor: pointer;
  text-align: center;
}

.settings-tab:hover,
.settings-tab:focus-visible,
.settings-tab.is-selected {
  border-color: rgba(184, 233, 207, 0.68);
  background: rgba(31, 60, 51, 0.78);
  color: #f7fff7;
  outline: none;
}

.settings-pane {
  display: none;
}

.settings-pane.is-active {
  display: block;
}

#settingsTabGameplay:checked ~ .settings-tabs [data-settings-tab="gameplay"],
#settingsTabAudio:checked ~ .settings-tabs [data-settings-tab="audio"],
#settingsTabAccessibility:checked ~ .settings-tabs [data-settings-tab="accessibility"],
#settingsTabControls:checked ~ .settings-tabs [data-settings-tab="controls"] {
  border-color: rgba(184, 233, 207, 0.68);
  background: rgba(31, 60, 51, 0.78);
  color: #f7fff7;
}

#settingsTabGameplay:checked ~ [data-settings-pane="gameplay"],
#settingsTabAudio:checked ~ [data-settings-pane="audio"],
#settingsTabAccessibility:checked ~ [data-settings-pane="accessibility"],
#settingsTabControls:checked ~ [data-settings-pane="controls"] {
  display: block;
}

.setting-row {
  display: grid;
  grid-template-columns: minmax(94px, 0.72fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid rgba(226, 227, 205, 0.1);
  border-radius: 8px;
  background: rgba(9, 13, 14, 0.54);
}

.setting-row > span {
  color: rgba(241, 243, 233, 0.78);
  font-size: 13px;
  font-weight: 820;
}

.setting-row--range {
  grid-template-columns: minmax(94px, 0.72fr) minmax(120px, 1fr) 34px;
}

.setting-segment {
  display: grid;
  grid-auto-flow: column;
  gap: 5px;
  min-width: 0;
}

.setting-segment__button {
  min-width: 0;
  height: 28px;
  border: 1px solid rgba(255, 226, 150, 0.16);
  border-radius: 7px;
  background: rgba(14, 20, 22, 0.82);
  color: rgba(241, 243, 233, 0.68);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.setting-segment__button.is-selected {
  border-color: rgba(184, 233, 207, 0.72);
  background: rgba(31, 60, 51, 0.82);
  color: #f7fff7;
  box-shadow: inset 0 0 12px rgba(184, 233, 207, 0.1);
}

.setting-range {
  width: 100%;
  min-width: 0;
  accent-color: #b8e9cf;
}

.setting-value {
  color: #ffe291;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.keybinding-list {
  display: grid;
  gap: 7px;
  margin: 16px 0 10px;
}

.keybinding-list .setting-row {
  min-height: 38px;
  padding-block: 6px;
}

.keybinding-button {
  min-width: 82px;
  min-height: 29px;
  justify-self: end;
  border: 1px solid rgba(255, 226, 150, 0.28);
  border-radius: 7px;
  background: rgba(14, 20, 22, 0.9);
  color: #ffe291;
  font: inherit;
  font-size: 12px;
  font-weight: 860;
  cursor: pointer;
}

.keybinding-button:hover,
.keybinding-button:focus-visible,
.keybinding-button.is-listening {
  border-color: rgba(184, 233, 207, 0.82);
  background: rgba(31, 60, 51, 0.9);
  color: #f7fff7;
  outline: none;
}

.keybinding-status {
  min-height: 18px;
  margin: 0 0 8px;
  color: rgba(241, 243, 233, 0.62);
  font-size: 12px;
  font-weight: 720;
}

.main-menu__button--compact {
  width: 100%;
  min-height: 36px;
  font-size: 12px;
}

body.a11y-large-text .message,
body.a11y-large-text .center-message,
body.a11y-large-text .main-menu__panel,
body.a11y-large-text .pause-menu__panel {
  font-size: 118%;
}

body.a11y-high-contrast .main-menu__panel,
body.a11y-high-contrast .pause-menu__panel,
body.a11y-high-contrast .setting-row,
body.a11y-high-contrast .center-message {
  border-color: rgba(255, 255, 255, 0.72);
  background-color: rgba(0, 0, 0, 0.94);
}

body.a11y-high-contrast .hud article,
body.a11y-high-contrast .inventory__slot,
body.a11y-high-contrast .inventory__equipment {
  border-color: rgba(255, 255, 255, 0.66);
}

body.a11y-reduced-motion *,
body.a11y-reduced-motion *::before,
body.a11y-reduced-motion *::after {
  scroll-behavior: auto !important;
  transition-duration: 0.01ms !important;
  animation-duration: 0.01ms !important;
}

.language-select-button {
  min-width: 0;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  border: 1px solid rgba(184, 233, 207, 0.28);
  border-radius: 7px;
  background: rgba(14, 20, 22, 0.82);
  color: #f1f3e9;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.language-select-button:hover,
.language-select-button:focus-visible {
  border-color: rgba(184, 233, 207, 0.72);
  background: rgba(31, 60, 51, 0.72);
  outline: none;
}

.language-select-button strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.language-select-button__arrow {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.74;
}

.language-panel__hint {
  margin: 7px 0 14px;
  color: rgba(241, 243, 233, 0.62);
  font-size: 12px;
  font-weight: 700;
}

.language-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 382px;
  margin-bottom: 14px;
  padding: 2px 7px 2px 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(184, 233, 207, 0.46) rgba(5, 8, 10, 0.5);
}

.language-option {
  min-width: 0;
  height: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  gap: 8px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(226, 227, 205, 0.11);
  border-radius: 7px;
  background: rgba(9, 13, 14, 0.66);
  color: rgba(241, 243, 233, 0.76);
  font: inherit;
  font-size: 12px;
  font-weight: 780;
  text-align: start;
  cursor: pointer;
}

.language-option:hover,
.language-option:focus-visible {
  border-color: rgba(255, 226, 150, 0.42);
  background: rgba(24, 31, 31, 0.84);
  color: #fff8df;
  outline: none;
}

.language-option.is-selected {
  border-color: rgba(184, 233, 207, 0.72);
  background: rgba(31, 60, 51, 0.82);
  color: #f7fff7;
}

.language-option__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.language-option__check {
  position: relative;
  width: 17px;
  height: 17px;
  border: 1px solid rgba(241, 243, 233, 0.18);
  border-radius: 50%;
}

.language-option.is-selected .language-option__check {
  border-color: rgba(184, 233, 207, 0.72);
  background: rgba(184, 233, 207, 0.16);
}

.language-option.is-selected .language-option__check::before {
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border-right: 2px solid #caffdd;
  border-bottom: 2px solid #caffdd;
  content: "";
  transform: rotate(45deg);
}

[dir="rtl"] .language-select-button__arrow {
  transform: rotate(-135deg);
}

.pause-menu {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 42%, rgba(215, 61, 73, 0.08), transparent 28%),
    rgba(0, 0, 0, 0.56);
  opacity: 1;
  pointer-events: auto;
  transition:
    opacity 160ms ease,
    visibility 160ms ease;
}

.pause-menu.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.pause-menu__panel {
  width: min(330px, 100%);
  padding: 20px;
  border: 1px solid rgba(255, 226, 150, 0.2);
  border-radius: 8px;
  background: rgba(5, 8, 10, 0.82);
  box-shadow:
    0 22px 64px rgba(0, 0, 0, 0.62),
    inset 0 0 22px rgba(255, 226, 150, 0.04);
  backdrop-filter: blur(16px);
}

.pause-menu__eyebrow {
  margin: 0 0 7px;
  color: rgba(184, 233, 207, 0.76);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pause-menu h2 {
  margin: 0;
  color: #f8efd2;
  font-size: 28px;
  letter-spacing: 0;
}

.pause-menu__actions {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}

.pause-menu__status {
  min-height: 18px;
  margin: 12px 0 0;
  color: rgba(241, 243, 233, 0.58);
  font-size: 12px;
  font-weight: 700;
}

.brand,
.status-grid article,
.message,
.controls,
.inventory,
.stamina {
  border: 1px solid rgba(226, 227, 205, 0.12);
  background: rgba(7, 10, 12, 0.58);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 8px;
}

.brand__mark {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 1px solid rgba(241, 230, 160, 0.34);
  background:
    linear-gradient(135deg, rgba(248, 224, 123, 0.9), rgba(127, 170, 144, 0.22)),
    #11170f;
  box-shadow:
    0 0 22px rgba(230, 203, 107, 0.22),
    inset 0 0 12px rgba(0, 0, 0, 0.34);
  clip-path: polygon(50% 0, 82% 18%, 100% 50%, 82% 82%, 50% 100%, 18% 82%, 0 50%, 18% 18%);
}

.brand p,
.brand strong {
  display: block;
  margin: 0;
  line-height: 1;
}

.brand p {
  color: rgba(219, 226, 209, 0.68);
  font-size: 9px;
  text-transform: uppercase;
}

.brand strong {
  margin-top: 2px;
  color: #f8efd2;
  font-size: 13px;
  font-weight: 760;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.status-grid article {
  min-width: 0;
  padding: 5px 7px;
}

.status-grid span {
  display: block;
  color: rgba(224, 230, 216, 0.62);
  font-size: 9px;
}

.status-grid strong {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: #f2f6e7;
  font-size: 11px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message {
  display: none;
}

.controls {
  display: none;
}

.center-message {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: min(700px, calc(100% - 56px));
  min-height: 64px;
  padding: 18px 22px;
  border: 1px solid rgba(255, 226, 145, 0.22);
  background: rgba(7, 10, 12, 0.78);
  box-shadow:
    0 18px 54px rgba(0, 0, 0, 0.48),
    inset 0 0 22px rgba(255, 226, 145, 0.05);
  color: #f8efd2;
  font-size: 18px;
  font-weight: 760;
  line-height: 1.35;
  text-align: center;
  text-wrap: balance;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.98);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.center-message.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.center-message.is-map {
  width: min(980px, calc(100% - 34px));
  min-height: 500px;
  padding: 18px;
  border-color: rgba(215, 61, 73, 0.38);
  background: rgba(7, 10, 12, 0.9);
}

.map-view {
  display: grid;
  grid-template-columns: minmax(420px, 1.18fr) minmax(230px, 0.58fr);
  gap: 18px;
  align-items: stretch;
}

.map-view__paper {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border: 1px solid rgba(69, 46, 35, 0.34);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 245, 198, 0.18), transparent 38%),
    #d8c99b;
  box-shadow: inset 0 0 38px rgba(62, 43, 28, 0.22);
}

.map-view__paper::before,
.map-view__paper::after {
  position: absolute;
  content: "";
}

.map-view__paper::before {
  inset: 36px 40px 46px 42px;
  border: 3px solid rgba(62, 43, 28, 0.32);
  border-radius: 48% 42% 50% 44%;
  transform: rotate(-8deg);
}

.map-view__paper::after {
  left: 88px;
  top: 70px;
  width: 210px;
  height: 92px;
  border-top: 5px solid rgba(62, 43, 28, 0.34);
  border-radius: 50%;
  transform: rotate(18deg);
}

.map-view__shore {
  position: absolute;
  left: -36px;
  bottom: -12px;
  width: 62%;
  height: 45%;
  border-radius: 50% 60% 0 0;
  background: rgba(76, 98, 67, 0.34);
}

.map-view__sea {
  position: absolute;
  right: -42px;
  top: -10px;
  width: 58%;
  height: 112%;
  background:
    repeating-linear-gradient(0deg, rgba(184, 233, 255, 0.18), rgba(184, 233, 255, 0.18) 2px, transparent 2px, transparent 22px),
    rgba(30, 83, 97, 0.34);
  clip-path: polygon(26% 0, 100% 0, 100% 100%, 8% 100%, 20% 74%, 12% 48%);
}

.map-view__route {
  position: absolute;
  left: 164px;
  top: 178px;
  width: 250px;
  height: 98px;
  border-top: 7px dashed rgba(215, 61, 73, 0.64);
  border-radius: 50%;
  transform: rotate(-14deg);
}

.map-view__bridge {
  position: absolute;
  left: 176px;
  bottom: 98px;
  width: 118px;
  height: 28px;
  border-top: 7px solid rgba(120, 88, 54, 0.8);
  border-bottom: 7px solid rgba(120, 88, 54, 0.8);
  transform: rotate(-12deg);
}

.map-view__x {
  position: absolute;
  right: 96px;
  top: 118px;
  width: 84px;
  height: 84px;
}

.map-view__x::before,
.map-view__x::after {
  position: absolute;
  left: 38px;
  top: 0;
  width: 10px;
  height: 84px;
  border-radius: 999px;
  background: #d73f4e;
  box-shadow: 0 0 18px rgba(215, 61, 73, 0.32);
  content: "";
}

.map-view__x::before {
  transform: rotate(45deg);
}

.map-view__x::after {
  transform: rotate(-45deg);
}

.map-view__text {
  display: grid;
  align-content: center;
  gap: 12px;
  text-align: left;
}

.map-view__text strong {
  color: #ffe291;
  font-size: 20px;
  line-height: 1.2;
}

.map-view__text span {
  color: rgba(242, 243, 229, 0.84);
  font-size: 14px;
  line-height: 1.5;
}

.inventory {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: min(720px, calc(100% - 20px));
  min-height: 34px;
  padding: 5px 8px;
  pointer-events: none;
}

.stamina {
  position: absolute;
  left: 50%;
  bottom: 54px;
  display: grid;
  grid-template-columns: auto minmax(100px, 180px) 28px;
  gap: 7px;
  align-items: center;
  min-width: 246px;
  height: 28px;
  padding: 5px 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.stamina > span:first-child,
.stamina strong {
  color: rgba(242, 243, 229, 0.78);
  font-size: 10px;
  font-weight: 800;
}

.stamina strong {
  color: #caffdd;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.stamina__track {
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(184, 233, 207, 0.24);
  background: rgba(0, 0, 0, 0.62);
}

.stamina__track i {
  display: block;
  width: 100%;
  height: 100%;
  background: #8fe0b2;
  transform-origin: left center;
  transition: width 100ms linear, background 140ms ease;
}

.stamina.is-low .stamina__track i {
  background: #f0be63;
}

.stamina.is-exhausted .stamina__track i {
  background: #db354c;
}

.stamina.is-exhausted strong {
  color: #ff8392;
}

.inventory__label {
  flex: 0 0 auto;
  color: rgba(242, 243, 229, 0.7);
  font-size: 10px;
  font-weight: 700;
}

.inventory__equipment {
  display: inline-grid;
  grid-template-columns: 19px auto auto auto;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  min-width: 148px;
  height: 24px;
  padding: 0 7px;
  border: 1px solid rgba(255, 224, 139, 0.42);
  background: rgba(61, 50, 30, 0.72);
  color: #fff1b8;
  font-size: 10px;
  font-weight: 760;
  box-shadow:
    inset 0 0 16px rgba(255, 224, 139, 0.1),
    0 0 18px rgba(255, 224, 139, 0.12);
}

.inventory__equipment-icon {
  position: relative;
  width: 17px;
  height: 9px;
  border-radius: 3px 7px 7px 3px;
  background: #1b2529;
  box-shadow: inset 0 0 0 1px rgba(255, 241, 184, 0.22);
}

.inventory__equipment-icon::before {
  position: absolute;
  top: 2px;
  right: -4px;
  width: 6px;
  height: 5px;
  border-radius: 0 5px 5px 0;
  background: #fff1a9;
  box-shadow: 0 0 12px rgba(255, 230, 128, 0.8);
  content: "";
}

.inventory__equipment-state {
  color: rgba(255, 246, 199, 0.72);
  font-size: 9px;
}

.inventory__equipment-time {
  color: #fff1a6;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.inventory__equipment.is-off {
  border-color: rgba(231, 226, 184, 0.16);
  background: rgba(11, 15, 16, 0.66);
  color: rgba(242, 243, 229, 0.58);
  box-shadow: none;
}

.inventory__equipment.is-off .inventory__equipment-icon::before {
  background: #656b68;
  box-shadow: none;
}

.inventory__equipment.is-empty {
  border-color: rgba(211, 73, 82, 0.36);
  color: rgba(245, 184, 184, 0.74);
}

.inventory__equipment.is-empty .inventory__equipment-time {
  color: rgba(245, 184, 184, 0.82);
}

.inventory__equipment.is-selected {
  border-color: rgba(155, 224, 191, 0.82);
  box-shadow:
    inset 0 0 14px rgba(155, 224, 191, 0.14),
    0 0 16px rgba(155, 224, 191, 0.24);
}

.inventory__slots {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  width: min(500px, 100%);
}

.inventory__slot {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  height: 29px;
  padding: 0 5px 0 25px;
  border: 1px solid rgba(231, 226, 184, 0.16);
  background: rgba(11, 15, 16, 0.66);
  color: #fff0b4;
  font-size: 10px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory__slot::after {
  position: absolute;
  left: 7px;
  top: 50%;
  display: none;
  width: 15px;
  height: 10px;
  background: #d7c690;
  content: "";
  filter: drop-shadow(0 0 4px rgba(255, 224, 139, 0.32));
  transform: translateY(-50%);
}

.inventory__slot[data-item]:not([data-item=""])::after {
  display: block;
}

.inventory__slot[data-item="flashlight"]::after {
  height: 7px;
  border: 1px solid rgba(190, 211, 214, 0.6);
  border-radius: 3px 6px 6px 3px;
  background: linear-gradient(90deg, #162328 0 68%, #fff1a9 69% 100%);
  box-shadow: 5px 0 8px rgba(255, 232, 145, 0.38);
}

.inventory__slot[data-item="black-key"]::after,
.inventory__slot[data-item="green-key"]::after {
  width: 18px;
  height: 10px;
  background:
    radial-gradient(circle at 4px 50%, transparent 0 2px, var(--key-color) 2.5px 4.5px, transparent 5px),
    linear-gradient(var(--key-color), var(--key-color)) 8px 4px / 10px 3px no-repeat,
    linear-gradient(var(--key-color), var(--key-color)) 14px 5px / 3px 5px no-repeat;
  transform: translateY(-50%) rotate(-12deg);
}

.inventory__slot[data-item="black-key"]::after {
  --key-color: #829096;
}

.inventory__slot[data-item="green-key"]::after {
  --key-color: #9be0bf;
}

.inventory__slot[data-item="drill"]::after {
  width: 18px;
  height: 13px;
  border: 1px solid rgba(42, 37, 31, 0.74);
  border-radius: 4px 2px 2px 4px;
  background: linear-gradient(90deg, #d4a94d 0 62%, #464d50 63% 82%, #bcc5c3 83% 100%);
  clip-path: polygon(0 0, 78% 0, 100% 38%, 78% 62%, 56% 62%, 56% 100%, 28% 100%, 28% 62%, 0 62%);
}

.inventory__slot[data-item="fuse"]::after {
  height: 9px;
  border-right: 3px solid #8c9b94;
  border-left: 3px solid #8c9b94;
  border-radius: 3px;
  background: linear-gradient(135deg, rgba(214, 239, 193, 0.4), #d73f4e 48% 56%, rgba(214, 239, 193, 0.5) 58%);
}

.inventory__slot[data-item="route-note"]::after,
.inventory__slot[data-item="family-map"]::after {
  width: 13px;
  height: 16px;
  border: 1px solid rgba(85, 68, 44, 0.72);
  border-radius: 1px;
  background: repeating-linear-gradient(0deg, #d8cca8 0 3px, #8f8060 4px, #d8cca8 5px);
  transform: translateY(-50%) rotate(-7deg);
}

.inventory__slot[data-item="family-map"]::after {
  background:
    linear-gradient(45deg, transparent 42%, #b42136 43% 57%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, #b42136 43% 57%, transparent 58%),
    #d0c292;
}

.inventory__slot::before {
  position: absolute;
  top: 1px;
  left: 3px;
  color: rgba(242, 243, 229, 0.34);
  font-size: 7px;
  font-weight: 800;
  content: counter(slot-number);
}

.inventory__slot:nth-child(1) {
  counter-reset: slot-number 1;
}

.inventory__slot:nth-child(2) {
  counter-reset: slot-number 2;
}

.inventory__slot:nth-child(3) {
  counter-reset: slot-number 3;
}

.inventory__slot:nth-child(4) {
  counter-reset: slot-number 4;
}

.inventory__slot:nth-child(5) {
  counter-reset: slot-number 5;
}

.inventory__slot.is-filled {
  border-color: rgba(255, 224, 139, 0.45);
  background: rgba(65, 48, 32, 0.72);
  box-shadow: inset 0 0 16px rgba(255, 220, 130, 0.08);
}

.inventory__slot.is-selected {
  border-color: rgba(155, 224, 191, 0.82);
  background: rgba(34, 60, 52, 0.76);
  box-shadow:
    inset 0 0 14px rgba(155, 224, 191, 0.12),
    0 0 16px rgba(155, 224, 191, 0.24);
}

.inventory__slot.is-selected::before {
  color: rgba(214, 255, 229, 0.8);
}

@media (max-width: 780px) {
  .main-menu {
    align-items: end;
    padding: 14px;
  }

  .main-menu__panel {
    width: 100%;
    max-height: calc(100vh - 28px);
    overflow: auto;
    padding: 18px;
  }

  .main-menu h1 {
    font-size: 34px;
  }

  .main-menu__controls-list {
    grid-template-columns: 1fr;
  }

  .setting-row,
  .setting-row--range {
    grid-template-columns: 1fr;
  }

  .settings-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .keybinding-button {
    width: 100%;
    justify-self: stretch;
  }

  .setting-value {
    text-align: left;
  }

  .language-list {
    grid-template-columns: 1fr;
    max-height: 320px;
  }

  .chapter-select {
    grid-template-columns: 1fr;
  }

  .chapter-select__list {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .chapter-select__footer {
    grid-template-columns: 1fr;
  }

  .hud {
    inset: 10px;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .brand {
    min-height: 58px;
  }

  .status-grid {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .message {
    font-size: 12px;
  }

  .center-message {
    width: calc(100% - 28px);
    min-height: 54px;
    padding: 14px 16px;
    font-size: 14px;
  }

  .center-message.is-map {
    min-height: 0;
    padding: 12px;
  }

  .map-view {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .map-view__paper {
    min-height: 260px;
  }

  .map-view__text {
    text-align: center;
  }

  .map-view__text strong {
    font-size: 16px;
  }

  .map-view__text span {
    font-size: 12px;
  }

  .controls {
    font-size: 11px;
  }

  .inventory {
    bottom: 6px;
    align-items: center;
    flex-flow: row wrap;
    gap: 5px;
    width: calc(100% - 12px);
  }

  .stamina {
    bottom: 76px;
    width: min(246px, calc(100% - 24px));
  }

  .inventory__equipment {
    width: auto;
  }

  .inventory__slots {
    flex: 1 1 260px;
    width: auto;
  }
}
