:root {
  color-scheme: dark;
  --blood: #d91532;
  --blood-hot: #ff304c;
  --bone: #ead9bc;
  --ash: #9d9690;
  --veil: rgba(9, 4, 7, 0.72);
  --panel: rgba(32, 9, 15, 0.72);
  --line: rgba(255, 47, 75, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #090609;
  color: var(--bone);
  font-family: Optima, Candara, "Trebuchet MS", Arial, sans-serif;
}

button {
  font: inherit;
}

.game-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #090609;
}

.game-shell > canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100vw;
  height: 100vh;
  image-rendering: auto;
  background: #050407;
}

.map-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.map-overlay {
  position: absolute;
  inset: 0;
  z-index: 18;
  display: grid;
  place-items: center;
  padding: min(6vw, 48px);
  background: rgba(4, 1, 3, 0.72);
  backdrop-filter: blur(1px);
  pointer-events: auto;
}

.map-frame {
  width: min(980px, 92vw);
  height: min(720px, 82vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(234, 217, 188, 0.22);
  background: linear-gradient(180deg, rgba(15, 5, 8, 0.94), rgba(4, 1, 3, 0.9));
  box-shadow: inset 0 0 38px rgba(255, 24, 54, 0.11), 0 22px 70px rgba(0, 0, 0, 0.62);
}

.map-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  color: #f4d9c4;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.map-title-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.map-title span {
  font-family: "Baskerville", Georgia, serif;
  font-size: clamp(19px, 2.4vw, 30px);
  text-transform: none;
  letter-spacing: 0;
}

.map-title small {
  color: #d6bca6;
  font-size: 12px;
  white-space: nowrap;
}

.map-close {
  appearance: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 48, 76, 0.72);
  background: rgba(46, 5, 12, 0.86);
  color: #ffe6dc;
  font-weight: 950;
  cursor: pointer;
  box-shadow: inset 0 0 16px rgba(255, 48, 76, 0.14), 0 10px 22px rgba(0, 0, 0, 0.36);
}

.game-shell::before,
.game-shell::after {
  content: "";
  position: absolute;
  z-index: 8;
  left: 50%;
  top: 50%;
  pointer-events: none;
  background: rgba(244, 220, 190, 0.86);
  box-shadow: 0 0 10px rgba(255, 36, 72, 0.45);
}

.game-shell::before {
  width: 18px;
  height: 2px;
  transform: translate(-50%, -50%);
}

.game-shell::after {
  width: 2px;
  height: 18px;
  transform: translate(-50%, -50%);
}

.game-shell.target-locked::before,
.game-shell.target-locked::after {
  background: #ffdf72;
  box-shadow: 0 0 13px rgba(255, 190, 46, 0.72);
}

.hud {
  position: absolute;
  inset: 0;
  z-index: 14;
  pointer-events: none;
  padding: max(16px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  text-shadow: 0 2px 3px #000;
}

.hud-left,
.hud-center,
.hud-right {
  position: absolute;
}

.hud-left {
  left: max(22px, env(safe-area-inset-left));
  top: max(18px, env(safe-area-inset-top));
  width: min(320px, 36vw);
  padding: 10px 12px 11px;
  border-left: 2px solid rgba(255, 48, 76, 0.62);
  background: linear-gradient(90deg, rgba(8, 3, 6, 0.72), rgba(8, 3, 6, 0.08));
}

.hud-center {
  top: max(16px, env(safe-area-inset-top));
  left: 50%;
  width: min(340px, 38vw);
  transform: translateX(-50%);
  text-align: center;
}

.hud-right {
  right: max(28px, env(safe-area-inset-right));
  top: max(74px, calc(env(safe-area-inset-top) + 74px));
  width: min(220px, 24vw);
  text-align: right;
  padding: 10px 12px;
  border-right: 2px solid rgba(255, 223, 114, 0.42);
  background: linear-gradient(270deg, rgba(8, 3, 6, 0.72), rgba(8, 3, 6, 0.08));
}

.hud-status {
  position: absolute;
  left: max(22px, env(safe-area-inset-left));
  top: max(86px, calc(env(safe-area-inset-top) + 86px));
  display: flex;
  gap: 10px;
  pointer-events: none;
}

.boss-panel {
  position: absolute;
  left: 50%;
  top: max(76px, calc(env(safe-area-inset-top) + 76px));
  width: min(420px, 42vw);
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}

.boss-panel span {
  display: block;
  margin-bottom: 5px;
  color: #ffe5dc;
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.bar.boss {
  height: 10px;
  border-color: rgba(255, 223, 114, 0.22);
}

.bar.boss i {
  background: linear-gradient(90deg, #9b081c, #ff304c, #ffdf72);
}

.opening-objective {
  position: absolute;
  left: 50%;
  bottom: max(86px, calc(env(safe-area-inset-bottom) + 86px));
  max-width: min(520px, 86vw);
  padding: 10px 16px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 223, 114, 0.38);
  background: rgba(10, 3, 6, 0.58);
  color: #ffe9d5;
  font-weight: 950;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  pointer-events: none;
  box-shadow: inset 0 0 20px rgba(255, 48, 76, 0.1), 0 12px 34px rgba(0, 0, 0, 0.38);
}

.hp-line,
.kills,
.minor,
.pacts {
  font-weight: 800;
}

.minor {
  margin-top: 8px;
  font-size: 15px;
}

.timer {
  font-family: "Baskerville", Georgia, serif;
  font-size: clamp(30px, 4.2vw, 48px);
  font-weight: 700;
  letter-spacing: 0;
}

.kills {
  margin-bottom: 7px;
  font-size: 18px;
  color: #ffdf72;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pacts {
  display: inline-block;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(234, 217, 188, 0.12);
  background: rgba(8, 3, 5, 0.34);
  font-size: clamp(12px, 1.25vw, 15px);
  line-height: 1.18;
  color: #f4d9c4;
}

.pacts::before {
  content: "Arsenal";
  display: block;
  margin-bottom: 5px;
  color: rgba(255, 48, 76, 0.92);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.bar {
  position: relative;
  height: 13px;
  overflow: hidden;
  background: rgba(24, 5, 10, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.52), inset 0 0 12px rgba(0, 0, 0, 0.62);
}

.bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, #bd0624, #ff2448);
}

.bar.xp {
  height: 9px;
  margin-top: 5px;
}

.bar.xp i {
  background: linear-gradient(90deg, #8f123c, #d40b8b);
}

.blood-button {
  min-width: 120px;
  min-height: 46px;
  padding: 0 18px;
  border: 2px solid #ff2448;
  background: linear-gradient(#ae071c, #690713);
  color: #ffe6dc;
  font-weight: 900;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08), 0 7px 0 #310207, 0 16px 24px rgba(0, 0, 0, 0.38);
  cursor: pointer;
}

.blood-button:focus-visible {
  outline: 3px solid #ffe2b0;
  outline-offset: 3px;
}

.blood-button:active {
  transform: translateY(4px);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08), 0 3px 0 #310207, 0 10px 16px rgba(0, 0, 0, 0.4);
}

.blood-button.primary {
  background: linear-gradient(#df102f, #7c0618);
}

.pause-button,
.map-button {
  position: absolute;
  min-width: 84px;
  min-height: 38px;
  padding: 0 14px;
  font-size: 13px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 5px 0 #310207, 0 12px 20px rgba(0, 0, 0, 0.34);
  pointer-events: auto;
}

.map-button {
  position: static;
}

.pause-button {
  right: max(22px, env(safe-area-inset-right));
  top: max(18px, env(safe-area-inset-top));
  pointer-events: auto;
}

.mobile-controls {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
}

.mobile-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: auto;
  touch-action: none;
}

.mobile-move-zone {
  left: 0;
  width: 50vw;
}

.mobile-look-zone {
  right: 0;
  width: 50vw;
}

.mobile-action,
.mobile-chip {
  position: absolute;
  z-index: 13;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  border: 1px solid rgba(234, 217, 188, 0.34);
  color: #fff0df;
  font-weight: 950;
  text-shadow: 0 2px 2px #000;
  box-shadow: inset 0 0 18px rgba(255, 48, 76, 0.16), 0 12px 30px rgba(0, 0, 0, 0.42);
}

.mobile-action {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, rgba(255, 54, 84, 0.88), rgba(93, 5, 17, 0.88));
}

.mobile-action:active,
.mobile-chip:active,
.mobile-action.is-active,
.mobile-chip.is-active {
  transform: translateY(3px) scale(0.96);
  filter: brightness(1.18);
}

.mobile-fire {
  right: max(28px, env(safe-area-inset-right));
  bottom: max(30px, env(safe-area-inset-bottom));
  width: 92px;
  height: 92px;
  border-color: rgba(255, 48, 76, 0.82);
  background: radial-gradient(circle at 40% 30%, #ff3d58, #8c0619 68%, #310207);
}

.mobile-chip {
  min-width: 74px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(26, 8, 12, 0.86), rgba(8, 3, 5, 0.72));
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mobile-weapon {
  right: max(34px, env(safe-area-inset-right));
  bottom: max(138px, calc(env(safe-area-inset-bottom) + 138px));
}

.rear-warning {
  position: absolute;
  z-index: 9;
  inset: auto 0 max(34px, env(safe-area-inset-bottom)) 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.hit-marker {
  position: absolute;
  z-index: 15;
  left: 50%;
  top: calc(50% + 34px);
  transform: translate(-50%, -50%);
  min-width: 72px;
  padding: 4px 10px;
  border: 1px solid rgba(234, 217, 188, 0.32);
  background: rgba(18, 4, 8, 0.62);
  color: #fff0df;
  text-align: center;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  pointer-events: none;
  text-shadow: 0 2px 3px #000;
}

.hit-marker.headshot {
  color: #ffdf72;
  border-color: rgba(255, 223, 114, 0.7);
  box-shadow: 0 0 22px rgba(255, 48, 76, 0.32);
}

.loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 45%, rgba(79, 10, 22, 0.72), rgba(4, 1, 3, 0.94) 70%);
  pointer-events: auto;
}

.loading-panel {
  width: min(420px, 86vw);
  display: grid;
  gap: 12px;
  text-align: center;
}

.loading-panel strong {
  font: 900 clamp(32px, 8vw, 58px) "Baskerville", Georgia, serif;
  color: #ffe5dc;
}

.loading-panel span {
  color: #d6bca6;
  font-weight: 800;
}

.loading-track {
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(234, 217, 188, 0.2);
  background: rgba(4, 1, 3, 0.8);
}

.loading-track i {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(0.2);
  transform-origin: left center;
  background: linear-gradient(90deg, #8f123c, #ff304c, #ffdf72);
  transition: transform 260ms ease;
}

.rear-warning::before {
  content: "";
  position: absolute;
  inset: auto 12vw -36px;
  height: 120px;
  background: radial-gradient(ellipse at 50% 100%, rgba(255, 24, 54, 0.58), rgba(255, 24, 54, 0) 68%);
  filter: blur(2px);
}

.rear-warning span {
  position: relative;
  padding: 8px 18px;
  border: 1px solid rgba(255, 50, 80, 0.72);
  background: rgba(50, 4, 12, 0.64);
  color: #ffe5dc;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 0 24px rgba(255, 24, 54, 0.36);
}

.level-banner {
  position: absolute;
  z-index: 16;
  left: 50%;
  top: max(104px, calc(env(safe-area-inset-top) + 104px));
  display: grid;
  gap: 5px;
  min-width: min(420px, 82vw);
  padding: 13px 22px 14px;
  border: 1px solid rgba(255, 223, 114, 0.34);
  background: linear-gradient(180deg, rgba(22, 5, 10, 0.78), rgba(5, 2, 4, 0.62));
  color: #ffe9d5;
  text-align: center;
  text-shadow: 0 2px 4px #000;
  transform: translateX(-50%);
  pointer-events: none;
  box-shadow: inset 0 0 24px rgba(255, 48, 76, 0.12), 0 18px 46px rgba(0, 0, 0, 0.48);
  animation: level-banner-in 1800ms ease both;
}

.level-banner strong {
  color: #ffdf72;
  font: 900 clamp(22px, 3.4vw, 40px) "Baskerville", Georgia, serif;
}

.level-banner span {
  font-size: clamp(13px, 1.4vw, 16px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@keyframes level-banner-in {
  0% {
    opacity: 0;
    transform: translate(-50%, -18px) scale(0.98);
  }
  14%,
  72% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -12px) scale(0.99);
  }
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: auto;
  background:
    linear-gradient(90deg, rgba(5, 1, 3, 0.78), transparent 30%, transparent 70%, rgba(5, 1, 3, 0.78)),
    radial-gradient(circle at 50% 48%, rgba(81, 12, 28, 0.3), rgba(7, 3, 5, 0.84) 66%);
  backdrop-filter: blur(2px);
}

.menu-overlay {
  align-items: center;
  overflow-y: auto;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

.hidden {
  display: none !important;
}

.brand-lockup {
  position: relative;
  isolation: isolate;
  width: min(720px, 92vw);
  text-align: center;
  padding: 34px 26px 30px;
  border: 1px solid rgba(234, 217, 188, 0.16);
  background: linear-gradient(180deg, rgba(25, 6, 12, 0.76), rgba(6, 2, 4, 0.54));
  box-shadow: inset 0 0 64px rgba(255, 24, 54, 0.08), 0 30px 90px rgba(0, 0, 0, 0.48);
}

.brand-lockup::before,
.brand-lockup::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.brand-lockup::before {
  inset: 8px;
  border: 1px solid rgba(255, 48, 76, 0.22);
  clip-path: polygon(0 0, 27% 0, 27% 1px, 73% 1px, 73% 0, 100% 0, 100% 100%, 73% 100%, 73% calc(100% - 1px), 27% calc(100% - 1px), 27% 100%, 0 100%);
}

.brand-lockup::after {
  left: 50%;
  top: 15px;
  width: 76px;
  height: 3px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, #ff304c, #ffdf72, #ff304c, transparent);
  box-shadow: 0 0 18px rgba(255, 48, 76, 0.72);
}

.mark {
  margin: 0 0 12px;
  color: var(--blood-hot);
  font: 800 clamp(36px, 8vw, 88px) "Baskerville", Georgia, serif;
  letter-spacing: -0.035em;
  text-shadow: 0 2px 0 #3c020c, 0 0 32px rgba(255, 24, 54, 0.24);
}

h1,
h2 {
  margin: 0;
  font-family: "Baskerville", Georgia, serif;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(25px, 4.6vw, 56px);
}

h2 {
  font-size: clamp(27px, 4vw, 46px);
  text-align: center;
}

.intro {
  width: min(560px, 84vw);
  margin: 16px auto 28px;
  color: #d9c8bc;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.5;
}

.mode-select {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: min(680px, 92vw);
  margin: 0 auto;
}

.mode-button {
  position: relative;
  appearance: none;
  min-height: 118px;
  padding: 18px 18px 18px 64px;
  border: 1px solid rgba(234, 217, 188, 0.28);
  background: linear-gradient(180deg, rgba(23, 7, 12, 0.88), rgba(10, 3, 6, 0.78));
  color: var(--bone);
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 0 26px rgba(255, 24, 54, 0.08), 0 18px 34px rgba(0, 0, 0, 0.34);
}

.mode-button::before {
  content: "∞";
  position: absolute;
  left: 20px;
  top: 23px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 223, 114, 0.32);
  border-radius: 50%;
  color: #ffdf72;
  font: 900 22px/1 Georgia, serif;
}

.mode-button.primary::before {
  content: "XV";
  font-size: 12px;
}

.mode-button.primary {
  border-color: rgba(255, 48, 76, 0.76);
  background: linear-gradient(180deg, rgba(99, 8, 22, 0.9), rgba(20, 4, 8, 0.82));
}

.mode-button span {
  display: block;
  color: #ffe8d9;
  font: 900 26px "Baskerville", Georgia, serif;
}

.mode-button small {
  display: block;
  margin-top: 10px;
  color: #d6bca6;
  font-size: 14px;
  line-height: 1.35;
}

.mode-button:hover,
.mode-button:focus-visible {
  border-color: #ff304c;
  outline: none;
  box-shadow: inset 0 0 34px rgba(255, 24, 54, 0.16), 0 0 0 3px rgba(255, 226, 176, 0.2), 0 22px 42px rgba(0, 0, 0, 0.42);
}

.choice-overlay {
  align-content: center;
  gap: 28px;
}

.choice-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 270px));
  gap: 22px;
  width: min(920px, 94vw);
}

.choice-card {
  appearance: none;
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(34, 8, 16, 0.86), rgba(14, 4, 8, 0.68));
  color: var(--bone);
  text-align: left;
  box-shadow: 0 20px 38px rgba(0, 0, 0, 0.42);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.choice-card[data-tag="bleed"] {
  border-color: rgba(255, 48, 76, 0.72);
}

.choice-card[data-tag="stagger"] {
  border-color: rgba(255, 223, 114, 0.72);
}

.choice-card[data-tag="ritual"] {
  border-color: rgba(172, 96, 255, 0.72);
}

.choice-card:hover,
.choice-card:focus-visible {
  border-color: rgba(255, 70, 94, 0.86);
  background: linear-gradient(180deg, rgba(56, 10, 22, 0.94), rgba(18, 4, 9, 0.78));
  transform: translateY(-3px);
  outline: none;
}

.choice-card strong {
  display: block;
  margin-bottom: 12px;
  font-size: 19px;
  color: #fff0df;
}

.choice-card p {
  min-height: 58px;
  margin: 0 0 18px;
  color: #cdbdb2;
  line-height: 1.35;
}

.compact-overlay {
  width: min(420px, 88vw);
  height: auto;
  max-height: min(88vh, 620px);
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  gap: 16px;
  padding: 34px;
  overflow-y: auto;
  background: rgba(12, 4, 8, 0.56);
  border: 1px solid rgba(255, 47, 75, 0.28);
}

.compact-overlay .blood-button {
  width: 100%;
}

.compact-overlay .rewarded-button {
  border-color: #ffdf72;
  background: linear-gradient(#8d5f10, #4d2d05);
  color: #fff1c2;
}

.compact-overlay .rewarded-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.compact-overlay p {
  margin: 0;
  text-align: center;
  line-height: 1.45;
}

.settings-grid {
  width: 100%;
  display: grid;
  gap: 10px;
}

.settings-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid rgba(234, 217, 188, 0.15);
  background: rgba(8, 3, 5, 0.42);
  color: #ffe5dc;
  font-size: 13px;
  font-weight: 900;
}

.settings-row input {
  width: 100%;
  accent-color: #ff304c;
}

.settings-row small,
.save-summary {
  color: #d6bca6;
  font-size: 12px;
  font-weight: 800;
}

.save-summary {
  width: 100%;
}

@media (max-width: 760px), (max-height: 520px) {
  .menu-overlay {
    align-items: start;
  }

  .brand-lockup {
    align-self: start;
    padding: 16px 18px 14px;
  }

  .hud-left {
    left: max(12px, env(safe-area-inset-left));
    top: max(10px, env(safe-area-inset-top));
    width: min(310px, 40vw);
  }

  .hud-center {
    top: max(8px, env(safe-area-inset-top));
    width: min(230px, 27vw);
  }

  .hud-right {
    right: max(12px, env(safe-area-inset-right));
    top: max(62px, calc(env(safe-area-inset-top) + 62px));
    width: min(190px, 27vw);
  }

  .hud-status {
    left: max(12px, env(safe-area-inset-left));
    top: max(74px, calc(env(safe-area-inset-top) + 74px));
  }

  .boss-panel {
    top: max(46px, calc(env(safe-area-inset-top) + 46px));
    width: min(340px, 40vw);
  }

  .boss-panel span {
    font-size: 11px;
    margin-bottom: 3px;
  }

  .pause-button {
    right: max(12px, env(safe-area-inset-right));
    top: max(10px, env(safe-area-inset-top));
  }

  .map-button,
  .pause-button {
    min-width: 68px;
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .hp-line,
  .minor,
  .kills,
  .pacts {
    font-size: 12px;
  }

  .minor {
    margin-top: 5px;
  }

  .kills {
    margin-bottom: 4px;
  }

  .pacts {
    padding: 5px 8px;
    line-height: 1.14;
  }

  .timer {
    font-size: clamp(21px, 4vw, 34px);
  }

  .choice-cards {
    grid-template-columns: 1fr;
    max-height: 68vh;
    overflow-y: auto;
  }

  .choice-card {
    min-height: 160px;
  }

  .mode-select {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .mode-button {
    min-height: 82px;
    padding: 13px 13px 13px 52px;
  }

  .mode-button::before {
    left: 14px;
    top: 18px;
    width: 26px;
    height: 26px;
  }

  .mode-button span {
    font-size: 21px;
  }

  .mode-button small {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.22;
  }

  .mark {
    margin-bottom: 4px;
    font-size: clamp(28px, 7vh, 54px);
  }

  h1 {
    font-size: clamp(22px, 5vh, 38px);
  }

  .intro {
    margin: 8px auto 14px;
    font-size: clamp(13px, 3vh, 16px);
    line-height: 1.3;
  }

  .map-frame {
    width: 94vw;
    height: 76vh;
    padding: 10px;
  }

  .map-title {
    gap: 10px;
  }

  .map-title span {
    font-size: clamp(16px, 4vw, 24px);
  }

  .map-close {
    width: 36px;
    height: 36px;
  }

  .compact-overlay {
    width: min(420px, 92vw);
    max-height: 88vh;
    gap: 10px;
    padding: 20px;
  }

  .settings-row {
    grid-template-columns: 84px minmax(0, 1fr) 42px;
    min-height: 40px;
  }
}

@media (pointer: coarse), (hover: none) {
  .mobile-controls:not(.hidden) {
    display: block;
  }

  body.mobile-ready .hud {
    padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  body.mobile-ready .hud-left {
    width: min(310px, 40vw);
  }

  body.mobile-ready .hud-center {
    top: max(10px, env(safe-area-inset-top));
    width: 28vw;
  }

  body.mobile-ready .timer {
    font-size: clamp(22px, 4vw, 36px);
  }

  body.mobile-ready .hud-right {
    right: max(14px, env(safe-area-inset-right));
    top: max(62px, calc(env(safe-area-inset-top) + 62px));
    width: min(190px, 27vw);
  }

  body.mobile-ready .mobile-weapon {
    bottom: max(138px, calc(env(safe-area-inset-bottom) + 138px));
  }
}

@media (max-width: 560px) {
  .mode-select {
    grid-template-columns: 1fr;
  }
}
