:root {
  --bg: #040507;
  --panel: rgba(11, 14, 18, 0.72);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #eef2f5;
  --muted: rgba(238, 242, 245, 0.66);
  --danger: #ff5f6e;
  --accent: #8feeff;
  --gold: #f3d07a;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  background: radial-gradient(circle at top, #102230 0%, #06080d 38%, #020204 100%);
  color: var(--text);
  font-family: "Segoe UI Variable", "Segoe UI", "Trebuchet MS", sans-serif;
  overflow: hidden;
}

body {
  letter-spacing: 0.01em;
}

body[data-desktop-app="false"] .desktop-only {
  display: none;
}

body[data-reality-state="healing"] {
  --panel: rgba(10, 22, 24, 0.78);
  --panel-border: rgba(182, 244, 238, 0.2);
  --text: #eef8f8;
  --muted: rgba(219, 240, 239, 0.72);
  --danger: #ff6d79;
  --accent: #9af3e6;
  --gold: #dff4b1;
}

body[data-reality-state="collapse"] {
  --panel: rgba(24, 8, 11, 0.82);
  --panel-border: rgba(255, 96, 110, 0.18);
  --accent: #ff8d96;
  --gold: #ffd1a6;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #020304;
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.intro-overlay {
  position: absolute;
  top: 2rem;
  left: 50%;
  width: min(36rem, calc(100vw - 3rem));
  transform: translateX(-50%);
  padding: 1.1rem 1.2rem 1rem;
  border: 1px solid rgba(180, 245, 238, 0.2);
  background:
    linear-gradient(180deg, rgba(239, 255, 251, 0.08), rgba(239, 255, 251, 0.03)),
    rgba(7, 21, 24, 0.78);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
  transition: opacity 220ms ease, transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

.intro-kicker {
  margin: 0 0 0.45rem;
  color: #cbf6de;
  font-size: 0.74rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

#intro-title-text {
  font-family: "Impact", "Arial Black", "Franklin Gothic Heavy", sans-serif;
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.intro-body-text {
  margin: 0.55rem 0 0;
  color: rgba(232, 247, 246, 0.8);
  line-height: 1.6;
}

.intro-status {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.intro-status span {
  color: rgba(219, 240, 239, 0.78);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.intro-bar {
  height: 0.68rem;
}

.intro-fill {
  width: 100%;
  background: linear-gradient(90deg, #8dd0d4, #dff8b7);
  transition: width 180ms linear;
}

body:not([data-game-state="running"]) #hud .panel,
body:not([data-game-state="running"]) #crosshair,
body:not([data-game-state="running"]) #pointer-hint,
body:not([data-game-state="running"]) .intro-overlay {
  opacity: 0;
  transform: translateY(12px);
}

.panel {
  position: absolute;
  padding: 1rem 1.1rem;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  transition: opacity 180ms ease, transform 180ms ease;
}

body[data-reality-state="healing"] .panel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(160, 240, 232, 0.02)),
    rgba(7, 22, 24, 0.72);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.24);
}

body[data-reality-state="collapse"] .panel {
  box-shadow: 0 18px 52px rgba(18, 0, 0, 0.42);
}

.top-left {
  top: 1.4rem;
  left: 1.4rem;
  width: min(30rem, calc(100vw - 2.8rem));
}

.top-right {
  top: 1.4rem;
  right: 1.4rem;
  width: min(20rem, calc(100vw - 2.8rem));
}

.bottom-left {
  left: 1.4rem;
  bottom: 1.4rem;
  width: min(28rem, calc(100vw - 2.8rem));
}

.compact {
  display: grid;
  gap: 0.9rem;
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "Baskerville Old Face", "Palatino Linotype", "Book Antiqua", serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(1.6rem, 2vw, 2.25rem);
}

h2 {
  font-size: clamp(2.2rem, 4vw, 4.4rem);
}

.lead {
  margin: 1rem 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 1rem;
}

.zone-line {
  margin: 0.35rem 0 0.55rem;
  color: var(--accent);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.meter {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.85rem;
}

.meter span,
.label,
.feature-label {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bar {
  width: 100%;
  height: 0.6rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.fill {
  height: 100%;
  border-radius: inherit;
  transition: width 120ms linear;
}

.fill.stamina {
  background: linear-gradient(90deg, #8adf82, #c8f18c);
}

.fill.fear {
  background: linear-gradient(90deg, #a1202c, #ff6b7a);
}

.fill.battery {
  background: linear-gradient(90deg, #47b4c7, #9cf6ff);
}

.stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.stat strong {
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.weakness-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.log-panel ul {
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.log-panel li {
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  line-height: 1.45;
}

.log-panel li.important {
  color: var(--gold);
  background: rgba(243, 208, 122, 0.08);
}

.log-panel li.danger {
  color: #ffc0c6;
  background: rgba(255, 95, 110, 0.1);
}

#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 26px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.05);
  transition: opacity 180ms ease, transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

#crosshair::before,
#crosshair::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.42);
}

#crosshair::before {
  left: 50%;
  top: 4px;
  width: 1px;
  height: 18px;
  transform: translateX(-50%);
}

#crosshair::after {
  top: 50%;
  left: 4px;
  width: 18px;
  height: 1px;
  transform: translateY(-50%);
}

#crosshair[data-state="hunt"] {
  border-color: rgba(255, 95, 110, 0.55);
  box-shadow: 0 0 28px rgba(255, 95, 110, 0.2);
}

#crosshair[data-state="hunt"]::before,
#crosshair[data-state="hunt"]::after {
  background: rgba(255, 95, 110, 0.8);
}

.floating-hint {
  position: absolute;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  padding: 0.8rem 1rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  transition: opacity 180ms ease, transform 180ms ease;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.4rem;
  background:
    radial-gradient(circle at 30% 20%, rgba(143, 238, 255, 0.12), transparent 30%),
    radial-gradient(circle at 70% 75%, rgba(255, 95, 110, 0.12), transparent 28%),
    rgba(2, 3, 5, 0.52);
  backdrop-filter: blur(12px);
}

.overlay-card {
  width: min(64rem, 100%);
  padding: clamp(1.4rem, 4vw, 3rem);
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(8, 10, 14, 0.78);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
}

.hero-card {
  display: grid;
  gap: 1.3rem;
}

.end-card {
  width: min(52rem, 100%);
  text-align: center;
}

.release-shell {
  width: min(84rem, 100%);
  background:
    radial-gradient(circle at top left, rgba(143, 238, 255, 0.08), transparent 28%),
    radial-gradient(circle at bottom right, rgba(255, 95, 110, 0.08), transparent 25%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(8, 10, 14, 0.82);
}

.app-banner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.banner-copy {
  display: grid;
  gap: 0.45rem;
}

.runtime-pill {
  margin-bottom: 0;
}

.runtime-hint,
.control-note,
.record-last {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.95rem;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.85rem;
}

.status-chip,
.record-item {
  display: grid;
  gap: 0.35rem;
  min-width: 7rem;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.status-chip span,
.record-item span {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.status-chip strong,
.record-item strong {
  font-size: 0.94rem;
  letter-spacing: 0.08em;
}

.title-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(18rem, 0.92fr);
  gap: 1.4rem;
  align-items: start;
}

.hero-copy {
  display: grid;
  gap: 1.3rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.feature-grid > div {
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.feature-grid p {
  margin: 0.55rem 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.control-stack {
  display: grid;
  gap: 1rem;
}

.control-card {
  display: grid;
  gap: 1rem;
  padding: 1.15rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.setting-row {
  display: grid;
  gap: 0.55rem;
}

.setting-row label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.setting-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
}

.slider-input {
  gap: 1rem;
}

select,
input[type="range"] {
  width: 100%;
}

select {
  appearance: none;
  padding: 0.82rem 0.95rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 7, 10, 0.85);
  color: var(--text);
  font: inherit;
}

input[type="range"] {
  accent-color: var(--gold);
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.primary-button {
  pointer-events: auto;
  align-self: start;
  justify-self: start;
  padding: 0.95rem 1.45rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #f3d07a, #ff8f7d);
  color: #140e0d;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 18px 35px rgba(255, 143, 125, 0.25);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 40px rgba(255, 143, 125, 0.34);
}

.primary-button:active {
  transform: translateY(0);
}

.secondary-button {
  pointer-events: auto;
  padding: 0.95rem 1.2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.secondary-button:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.secondary-button:active {
  transform: translateY(0);
}

.danger-button {
  border-color: rgba(255, 95, 110, 0.24);
  color: #ffcdd3;
}

.run-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1.4rem;
}

.summary-item {
  min-width: 0;
}

.end-actions {
  justify-content: center;
  margin-top: 0.6rem;
}

@media (max-width: 900px) {
  .feature-grid,
  .record-grid,
  .run-summary {
    grid-template-columns: 1fr;
  }

  .app-banner,
  .title-layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .top-left,
  .top-right,
  .bottom-left {
    width: calc(100vw - 2rem);
    left: 1rem;
    right: 1rem;
  }

  .top-right {
    top: auto;
    bottom: 13.75rem;
  }

  .bottom-left {
    bottom: 1rem;
  }
}

body {
  background:
    radial-gradient(circle at 50% 15%, rgba(151, 18, 29, 0.18), transparent 30%),
    radial-gradient(circle at 50% 115%, rgba(151, 18, 29, 0.14), transparent 34%),
    linear-gradient(180deg, #090707 0%, #12090b 50%, #050404 100%);
  color: #ece6d7;
  font-family: "Courier New", "Lucida Console", monospace;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.04), transparent 16%),
    radial-gradient(circle at 76% 80%, rgba(176, 15, 25, 0.08), transparent 24%),
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.012) 0,
      rgba(255, 255, 255, 0.012) 1px,
      transparent 1px,
      transparent 4px
    );
  mix-blend-mode: screen;
  opacity: 0.8;
}

.panel,
.overlay-card,
.control-card,
.status-chip,
.record-item {
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.1)),
    rgba(13, 11, 11, 0.9);
  border: 1px solid rgba(92, 14, 20, 0.95);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.02),
    0 18px 48px rgba(0, 0, 0, 0.45);
  backdrop-filter: none;
}

.eyebrow,
.label,
.feature-label,
.status-chip span,
.record-item span,
.setting-row label {
  color: #b5161f;
  font-family: "Impact", "Arial Black", sans-serif;
  letter-spacing: 0.18em;
}

h1,
h2,
#end-title,
#title-shell .menu-brand,
#title-shell h3 {
  font-family: "Impact", "Arial Black", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.9), 0 0 18px rgba(176, 15, 25, 0.16);
}

.runtime-hint,
.lead,
.control-note,
.record-last,
.weakness-text,
.log-panel li,
.pane-copy {
  color: rgba(236, 230, 215, 0.78);
}

#title-screen {
  background:
    radial-gradient(circle at 50% 50%, rgba(95, 9, 15, 0.14), transparent 40%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.82));
}

#title-shell.horror-menu-shell {
  position: relative;
  width: min(88rem, 100%);
  min-height: min(50rem, calc(100vh - 4rem));
  padding: 1.8rem 2rem 2rem;
  overflow: hidden;
  border: 1px solid rgba(78, 12, 17, 0.95);
  background:
    radial-gradient(circle at 50% 40%, rgba(176, 15, 25, 0.08), transparent 22%),
    linear-gradient(180deg, rgba(12, 10, 10, 0.96), rgba(8, 7, 7, 0.98));
}

#title-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.035), transparent 26%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.018) 0,
      rgba(255, 255, 255, 0.018) 1px,
      transparent 1px,
      transparent 5px
    );
  opacity: 0.65;
}

.menu-banner,
.horror-layout,
.menu-column,
.menu-stage {
  position: relative;
  z-index: 1;
}

.menu-banner {
  align-items: flex-start;
  margin-bottom: 1.75rem;
}

.menu-banner .banner-copy {
  max-width: 30rem;
}

.horror-layout {
  grid-template-columns: minmax(17rem, 22rem) minmax(0, 1fr);
  gap: 2.2rem;
  align-items: stretch;
}

.menu-column {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1rem 1.1rem 1.25rem;
  border-right: 1px solid rgba(176, 15, 25, 0.35);
}

.menu-caption {
  margin: 0;
  color: #cf1c26;
  font-family: "Impact", "Arial Black", sans-serif;
  font-size: 2rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.menu-rule {
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #b00f19 14%, #b00f19 86%, transparent);
}

.menu-brand {
  margin: 0.5rem 0 0;
  font-size: clamp(2.3rem, 5vw, 4.4rem);
  line-height: 0.95;
  color: #ece6d7;
}

.menu-subcopy {
  margin: 0;
  color: rgba(236, 230, 215, 0.7);
  font-size: 0.95rem;
  line-height: 1.8;
}

.menu-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.menu-button {
  justify-content: flex-start;
  width: 100%;
  padding: 0.9rem 1.15rem;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #ece6d7;
  font-family: "Courier New", monospace;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
  box-shadow: none;
  position: relative;
}

.menu-button::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(2% 18%, 97% 5%, 100% 34%, 96% 80%, 5% 96%, 0 64%);
  background: rgba(176, 15, 25, 0);
  transition: background 140ms ease, opacity 140ms ease, transform 140ms ease;
  z-index: -1;
}

.menu-button:hover,
.menu-button:focus-visible,
.menu-button.is-active,
.menu-button-primary {
  color: #fff4e8;
  border-left-color: #d7202a;
  transform: translateX(2px);
}

.menu-button:hover::before,
.menu-button:focus-visible::before,
.menu-button.is-active::before,
.menu-button-primary::before {
  background: linear-gradient(90deg, rgba(176, 15, 25, 0.95), rgba(220, 25, 36, 0.88));
}

.menu-button-primary {
  box-shadow: 0 10px 24px rgba(176, 15, 25, 0.22);
}

.menu-stage {
  min-height: 36rem;
  padding: 0.6rem 0;
}

.title-pane {
  display: grid;
  gap: 1rem;
  align-content: start;
  height: 100%;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(176, 15, 25, 0.38);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 20%),
    rgba(11, 9, 9, 0.72);
}

#title-shell[data-pane="archive"] .title-pane-settings,
#title-shell[data-pane="settings"] .title-pane-archive {
  display: none;
}

.pane-label {
  margin: 0;
  color: #cf1c26;
  font-family: "Impact", "Arial Black", sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.title-pane h3 {
  margin: 0;
  font-size: 2rem;
  color: #ece6d7;
}

.pane-copy {
  margin: 0;
  max-width: 52rem;
  font-size: 1rem;
  line-height: 1.75;
}

.archive-card,
.settings-card {
  margin-top: 0.35rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 20%),
    rgba(15, 11, 11, 0.88);
}

.settings-card select,
.settings-card input[type="range"] {
  width: 100%;
}

select {
  padding: 0.78rem 0.92rem;
  border-radius: 0;
  border: 1px solid rgba(104, 15, 22, 0.9);
  background: rgba(5, 4, 4, 0.92);
  color: #f1eada;
  font-family: "Courier New", monospace;
  font-size: 1.05rem;
}

input[type="range"] {
  accent-color: #d7202a;
}

.status-strip {
  gap: 0.7rem;
}

.status-chip,
.record-item {
  border-radius: 0;
  min-width: 8rem;
}

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

.top-left,
.top-right,
.bottom-left {
  border-radius: 0;
  border-color: rgba(100, 15, 22, 0.9);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 18%),
    rgba(12, 11, 11, 0.88);
}

.top-left {
  width: min(30rem, calc(100vw - 2.8rem));
}

.top-right {
  width: min(23rem, calc(100vw - 2.8rem));
}

.bottom-left {
  width: min(29rem, calc(100vw - 2.8rem));
}

.compact,
.log-panel ul {
  gap: 0.7rem;
}

.weakness-text,
.zone-line,
.log-panel li,
.record-last {
  font-size: 0.92rem;
}

.bar {
  height: 0.48rem;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(109, 15, 21, 0.6);
}

.fill {
  border-radius: 0;
}

.fill.stamina {
  background: linear-gradient(90deg, #cfb787, #f0ead7);
}

.fill.fear {
  background: linear-gradient(90deg, #4e0a10, #d7202a);
}

.fill.battery {
  background: linear-gradient(90deg, #67645b, #d8d1c1);
}

#crosshair {
  border-radius: 0;
  border-color: rgba(176, 15, 25, 0.42);
  box-shadow: 0 0 20px rgba(176, 15, 25, 0.14);
}

#crosshair::before,
#crosshair::after {
  background: rgba(236, 230, 215, 0.5);
}

#crosshair[data-state="hunt"] {
  border-color: rgba(215, 32, 42, 0.82);
  box-shadow: 0 0 22px rgba(176, 15, 25, 0.28);
}

#crosshair[data-state="hunt"]::before,
#crosshair[data-state="hunt"]::after {
  background: rgba(215, 32, 42, 0.95);
}

.floating-hint {
  border-radius: 0;
  border-color: rgba(99, 15, 21, 0.9);
  background: rgba(10, 8, 8, 0.92);
  color: #ece6d7;
}

#end-screen .end-card {
  width: min(58rem, 100%);
  text-align: left;
  border-radius: 0;
  background:
    radial-gradient(circle at 15% 15%, rgba(176, 15, 25, 0.08), transparent 18%),
    rgba(11, 9, 9, 0.96);
}

#end-screen .eyebrow {
  margin-bottom: 0.75rem;
}

#end-screen #end-title {
  margin-bottom: 0.85rem;
}

.run-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.primary-button,
.secondary-button {
  border-radius: 0;
  border: 0;
  background: transparent;
  color: #ece6d7;
  font-family: "Courier New", monospace;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: none;
  position: relative;
}

.primary-button::before,
.secondary-button::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(2% 16%, 99% 2%, 96% 82%, 4% 98%, 0 48%);
  background: rgba(176, 15, 25, 0.22);
  border: 1px solid rgba(176, 15, 25, 0.88);
  z-index: -1;
  transition: background 140ms ease, transform 140ms ease;
}

.primary-button:hover::before,
.secondary-button:hover::before,
.primary-button:focus-visible::before,
.secondary-button:focus-visible::before {
  background: rgba(176, 15, 25, 0.88);
}

.danger-button {
  color: #ffdfdf;
}

.danger-button::before {
  background: rgba(92, 14, 20, 0.44);
}

.end-actions {
  justify-content: flex-start;
}

@media (max-width: 1100px) {
  .horror-layout {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }

  .menu-column {
    border-right: 0;
    border-bottom: 1px solid rgba(176, 15, 25, 0.35);
    padding-bottom: 1.5rem;
  }

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

@media (max-width: 900px) {
  #title-shell.horror-menu-shell {
    padding: 1.2rem;
    min-height: calc(100vh - 2rem);
  }

  .menu-banner,
  .horror-layout {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .record-grid,
  .run-summary {
    grid-template-columns: 1fr;
  }

  .top-right {
    top: auto;
    bottom: 16rem;
  }
}

body[data-reality-state="healing"] .intro-overlay {
  animation: introFloat 4.8s ease-in-out infinite;
}

body[data-reality-state="collapse"] .intro-overlay {
  border-color: rgba(255, 76, 94, 0.4);
  background:
    linear-gradient(180deg, rgba(255, 86, 104, 0.14), rgba(255, 86, 104, 0.04)),
    rgba(18, 5, 8, 0.84);
  animation: collapseJitter 220ms steps(2, end) infinite;
}

body[data-reality-state="collapse"] .intro-fill {
  background: linear-gradient(90deg, #ff6f7d, #ffcf93);
}

body[data-reality-state="healing"] .log-panel li.important {
  color: #dbf8b7;
  background: rgba(223, 248, 183, 0.08);
}

#crosshair[data-state="healing"] {
  border-color: rgba(168, 245, 229, 0.48);
  box-shadow: 0 0 28px rgba(158, 240, 226, 0.16);
}

#crosshair[data-state="healing"]::before,
#crosshair[data-state="healing"]::after {
  background: rgba(173, 247, 230, 0.76);
}

@keyframes introFloat {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(-6px);
  }
}

@keyframes collapseJitter {
  0% {
    transform: translateX(-50%) translateY(0) skewX(0deg);
  }

  25% {
    transform: translateX(calc(-50% - 4px)) translateY(1px) skewX(-1.5deg);
  }

  60% {
    transform: translateX(calc(-50% + 3px)) translateY(-2px) skewX(1deg);
  }

  100% {
    transform: translateX(-50%) translateY(0) skewX(0deg);
  }
}

body[data-reality-state="healing"] .panel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(160, 240, 232, 0.02)),
    rgba(7, 22, 24, 0.72);
  border-color: rgba(182, 244, 238, 0.2);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.24);
}

body[data-reality-state="healing"] .bar {
  border-color: rgba(126, 206, 198, 0.5);
}

body[data-reality-state="healing"] .fill.stamina {
  background: linear-gradient(90deg, #9dded5, #ddf7b5);
}

body[data-reality-state="healing"] .fill.fear {
  background: linear-gradient(90deg, #4a6367, #95d8cf);
}

body[data-reality-state="healing"] .fill.battery {
  background: linear-gradient(90deg, #7fcad1, #ebfaf6);
}

body[data-reality-state="collapse"] .panel {
  border-color: rgba(176, 15, 25, 0.55);
  background:
    radial-gradient(circle at top left, rgba(176, 15, 25, 0.12), transparent 20%),
    rgba(11, 8, 8, 0.94);
}

#title-shell.horror-menu-shell {
  width: min(90rem, 100%);
  min-height: min(52rem, calc(100vh - 3rem));
  padding: 2rem 2.2rem 2.1rem;
  border-radius: 18px;
  border: 1px solid rgba(112, 49, 18, 0.72);
  background:
    radial-gradient(circle at 74% 26%, rgba(255, 183, 91, 0.18), transparent 16%),
    radial-gradient(circle at 68% 40%, rgba(255, 121, 31, 0.12), transparent 22%),
    linear-gradient(180deg, rgba(31, 14, 9, 0.58), rgba(7, 4, 3, 0.92)),
    #090605;
  box-shadow:
    inset 0 0 0 1px rgba(255, 186, 112, 0.04),
    0 32px 100px rgba(0, 0, 0, 0.62);
}

#title-shell.horror-menu-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.72) 0, rgba(0, 0, 0, 0.22) 34%, rgba(0, 0, 0, 0) 52%),
    radial-gradient(circle at 18% 58%, rgba(0, 0, 0, 0.48), transparent 22%);
  pointer-events: none;
}

#title-shell.horror-menu-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 12% 24%, rgba(255, 214, 144, 0.12) 0 2px, transparent 3px),
    radial-gradient(circle at 28% 82%, rgba(255, 173, 72, 0.08) 0 1px, transparent 2px),
    radial-gradient(circle at 82% 32%, rgba(255, 205, 134, 0.12) 0 2px, transparent 3px),
    radial-gradient(circle at 74% 76%, rgba(255, 162, 67, 0.09) 0 2px, transparent 4px);
  background-size: 20rem 20rem, 24rem 24rem, 18rem 18rem, 28rem 28rem;
  mix-blend-mode: screen;
  opacity: 0.34;
  pointer-events: none;
}

#title-shell.horror-menu-shell .menu-banner {
  position: absolute;
  inset: 1rem 1.35rem auto 1.35rem;
  z-index: 3;
  margin: 0;
  align-items: flex-start;
  opacity: 0.62;
}

#title-shell.horror-menu-shell .banner-copy {
  gap: 0.22rem;
}

#title-shell.horror-menu-shell .runtime-pill,
#title-shell.horror-menu-shell .runtime-hint,
#title-shell.horror-menu-shell .status-chip span,
#title-shell.horror-menu-shell .status-chip strong {
  color: rgba(233, 218, 197, 0.72);
}

#title-shell.horror-menu-shell .status-chip {
  min-width: 5.8rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(17, 9, 7, 0.58);
  border: 1px solid rgba(112, 49, 18, 0.42);
}

#title-shell .horror-layout {
  grid-template-columns: minmax(17rem, 24rem) minmax(0, 1fr);
  gap: 1.4rem;
  min-height: 44rem;
}

#title-shell .menu-column {
  justify-content: center;
  gap: 0.8rem;
  padding: 5.6rem 0 2rem 0.35rem;
  border: 0;
}

#title-shell .menu-caption {
  color: #f3e6d5;
  font-size: clamp(2.2rem, 3.6vw, 4rem);
  line-height: 0.88;
  letter-spacing: 0.06em;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.88),
    0 0 22px rgba(255, 172, 78, 0.08);
}

#title-shell .menu-rule {
  width: 12rem;
  height: 1px;
  margin: 0.15rem 0 0.25rem;
  background: linear-gradient(90deg, rgba(255, 179, 89, 0.7), rgba(255, 179, 89, 0));
}

#title-shell .menu-brand {
  display: grid;
  gap: 0.15rem;
  margin: 0;
  color: #f4eadc;
  text-transform: uppercase;
  text-shadow:
    0 3px 0 rgba(0, 0, 0, 0.92),
    0 0 28px rgba(255, 184, 104, 0.08);
}

#title-shell .menu-brand span {
  display: block;
}

#title-shell .menu-brand span:first-child {
  font-size: clamp(3.9rem, 6.4vw, 6rem);
  line-height: 0.86;
  letter-spacing: 0.05em;
}

#title-shell .menu-brand span:last-child {
  font-size: clamp(2.3rem, 3.9vw, 3.2rem);
  line-height: 0.9;
  letter-spacing: 0.19em;
}

#title-shell .menu-subcopy {
  max-width: 16rem;
  color: rgba(229, 211, 188, 0.78);
  font-size: 0.92rem;
  line-height: 1.6;
}

#title-shell .menu-list {
  display: grid;
  gap: 0.45rem;
  width: min(16.5rem, 100%);
  margin-top: 1rem;
}

#title-shell .menu-button {
  min-height: 3.2rem;
  padding: 0.88rem 1rem 0.88rem 1.15rem;
  border: 1px solid rgba(255, 191, 126, 0.08);
  border-left: 0.28rem solid transparent;
  background: linear-gradient(90deg, rgba(22, 10, 8, 0.88), rgba(15, 8, 7, 0.38));
  color: rgba(244, 234, 220, 0.88);
  font-family: "Impact", "Arial Black", "Franklin Gothic Heavy", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.14em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.84);
  box-shadow: inset 0 0 0 1px rgba(255, 186, 112, 0.04);
}

#title-shell .menu-button::before {
  inset: 0;
  clip-path: none;
  background: linear-gradient(90deg, rgba(255, 153, 50, 0), rgba(255, 153, 50, 0));
}

#title-shell .menu-button:hover,
#title-shell .menu-button:focus-visible,
#title-shell .menu-button.is-active,
#title-shell .menu-button-primary {
  color: #fff5e7;
  border-left-color: #ffb053;
  border-color: rgba(255, 191, 126, 0.28);
  transform: translateX(4px);
  box-shadow:
    0 0 0 1px rgba(255, 183, 91, 0.06),
    0 12px 28px rgba(255, 122, 34, 0.12);
}

#title-shell .menu-button:hover::before,
#title-shell .menu-button:focus-visible::before,
#title-shell .menu-button.is-active::before,
#title-shell .menu-button-primary::before {
  background: linear-gradient(90deg, rgba(255, 140, 44, 0.94), rgba(255, 183, 91, 0.68) 55%, rgba(255, 183, 91, 0.12));
}

#title-shell .menu-button.danger-button:hover::before,
#title-shell .menu-button.danger-button:focus-visible::before {
  background: linear-gradient(90deg, rgba(160, 25, 24, 0.95), rgba(255, 114, 72, 0.48));
}

#title-shell .menu-stage {
  min-height: 40rem;
  padding: 3.5rem 0 0.2rem;
}

#title-shell .menu-scene {
  position: relative;
  min-height: 38rem;
  overflow: hidden;
}

#title-shell .menu-scene::before {
  content: "";
  position: absolute;
  inset: 2.6rem 0 0 0;
  background:
    radial-gradient(circle at 68% 18%, rgba(255, 164, 69, 0.1), transparent 18%),
    linear-gradient(180deg, rgba(20, 8, 5, 0.08), rgba(7, 4, 3, 0.58)),
    radial-gradient(circle at 42% 44%, rgba(0, 0, 0, 0.62), transparent 20%);
  border-radius: 1.2rem;
}

#title-shell .menu-scene::after {
  content: "";
  position: absolute;
  inset: 4rem 20% 3rem 10%;
  border-radius: 999px 999px 0 0;
  border: 1px solid rgba(255, 177, 96, 0.06);
  box-shadow:
    0 0 0 1px rgba(255, 177, 96, 0.03),
    inset 0 0 80px rgba(0, 0, 0, 0.44);
  opacity: 0.4;
}

#title-shell .bulb-hero {
  position: absolute;
  right: 6%;
  top: 0.6rem;
  width: clamp(15rem, 26vw, 23rem);
  height: clamp(24rem, 40vw, 34rem);
  pointer-events: none;
  z-index: 1;
}

#title-shell .bulb-wire {
  position: absolute;
  left: 50%;
  top: -8rem;
  width: 0.22rem;
  height: 10rem;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(58, 45, 36, 0), rgba(102, 77, 49, 0.92));
}

#title-shell .bulb-aura {
  position: absolute;
  inset: 16% 6% 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 193, 108, 0.52) 0, rgba(255, 151, 58, 0.22) 36%, rgba(255, 128, 36, 0.06) 58%, rgba(255, 128, 36, 0) 76%);
  filter: blur(26px);
  animation: bulbPulse 4.4s ease-in-out infinite;
}

#title-shell .bulb-glass {
  position: absolute;
  left: 50%;
  top: 2.7rem;
  width: 73%;
  height: 78%;
  transform: translateX(-50%);
  border-radius: 48% 48% 42% 42% / 46% 46% 54% 54%;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 234, 204, 0.24), transparent 20%),
    linear-gradient(180deg, rgba(255, 198, 111, 0.16), rgba(94, 49, 22, 0.24) 56%, rgba(20, 10, 6, 0.6));
  border: 1px solid rgba(255, 194, 114, 0.24);
  box-shadow:
    inset 0 0 32px rgba(255, 218, 166, 0.18),
    inset 0 -2rem 3rem rgba(72, 24, 8, 0.32),
    0 0 44px rgba(255, 164, 69, 0.18);
}

#title-shell .bulb-glass::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1.3rem;
  width: 26%;
  height: 1.7rem;
  transform: translateX(-50%);
  border-radius: 0.55rem;
  background: linear-gradient(180deg, rgba(107, 77, 50, 0.92), rgba(38, 24, 17, 0.96));
  box-shadow: 0 -0.2rem 0 rgba(255, 209, 145, 0.14);
}

#title-shell .bulb-glass::after {
  content: "";
  position: absolute;
  inset: 8% 14% 10%;
  border-radius: 50%;
  border-left: 1px solid rgba(255, 231, 191, 0.2);
  opacity: 0.58;
  filter: blur(0.2px);
}

#title-shell .bulb-core {
  position: absolute;
  left: 50%;
  top: 19%;
  width: 42%;
  height: 54%;
  transform: translateX(-50%);
  border-radius: 42%;
  background: radial-gradient(circle, rgba(255, 230, 166, 0.92) 0, rgba(255, 182, 88, 0.74) 36%, rgba(255, 128, 36, 0.16) 72%, rgba(255, 128, 36, 0) 100%);
  filter: blur(8px);
}

#title-shell .bulb-filament,
#title-shell .bulb-spark {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center;
}

#title-shell .bulb-filament {
  border: 0.18rem solid rgba(255, 214, 147, 0.94);
  border-radius: 999px;
  box-shadow:
    0 0 18px rgba(255, 197, 112, 0.8),
    0 0 44px rgba(255, 126, 38, 0.28);
  filter: blur(0.15px);
}

#title-shell .filament-main {
  width: 3.6rem;
  height: 7rem;
  margin-left: -1.8rem;
  margin-top: -2.8rem;
  border-left-color: transparent;
  border-right-color: transparent;
}

#title-shell .filament-left {
  width: 2.6rem;
  height: 5.6rem;
  margin-left: -4.4rem;
  margin-top: -0.8rem;
  transform: rotate(-18deg);
  border-left-color: transparent;
}

#title-shell .filament-right {
  width: 2.6rem;
  height: 5.6rem;
  margin-left: 1.8rem;
  margin-top: 0.4rem;
  transform: rotate(22deg);
  border-right-color: transparent;
}

#title-shell .bulb-spark {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: rgba(255, 238, 187, 0.92);
  box-shadow: 0 0 18px rgba(255, 206, 132, 0.82);
}

#title-shell .spark-a {
  margin-left: -3.6rem;
  margin-top: 2rem;
}

#title-shell .spark-b {
  margin-left: 2.7rem;
  margin-top: -2.4rem;
}

#title-shell .title-pane {
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(35rem, calc(100% - 18rem));
  padding: 1.15rem 1.25rem 1.2rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 177, 96, 0.14);
  background:
    linear-gradient(180deg, rgba(31, 14, 10, 0.72), rgba(11, 7, 5, 0.94)),
    rgba(10, 6, 5, 0.92);
  box-shadow:
    0 16px 44px rgba(0, 0, 0, 0.48),
    inset 0 0 0 1px rgba(255, 191, 126, 0.04);
  z-index: 2;
}

#title-shell .title-pane .record-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#title-shell .title-pane .record-item {
  min-width: 0;
  padding: 0.72rem 0.75rem;
  border-radius: 0.8rem;
  background: rgba(255, 173, 72, 0.04);
  border: 1px solid rgba(255, 177, 96, 0.08);
}

#title-shell .pane-label {
  color: rgba(255, 190, 118, 0.78);
  letter-spacing: 0.14em;
}

#title-shell .title-pane h3 {
  color: #fff0dd;
  font-size: clamp(1.6rem, 2.4vw, 2.3rem);
  letter-spacing: 0.08em;
}

#title-shell .pane-copy,
#title-shell .control-note,
#title-shell .record-last,
#title-shell .setting-row label {
  color: rgba(236, 220, 197, 0.76);
}

#title-shell .control-card {
  border-radius: 0.9rem;
  background: rgba(255, 173, 72, 0.03);
  border: 1px solid rgba(255, 177, 96, 0.08);
}

#title-shell .settings-card select,
#title-shell .settings-card input[type="range"] {
  accent-color: #ffb053;
}

#title-shell .settings-card select {
  background: rgba(14, 9, 7, 0.92);
  border: 1px solid rgba(255, 177, 96, 0.16);
  color: #fff0dd;
}

#title-shell .settings-card strong,
#title-shell .archive-card strong {
  color: #fff4e6;
}

#title-shell[data-pane="archive"] .title-pane-settings,
#title-shell[data-pane="settings"] .title-pane-archive {
  display: none;
}

#end-screen .primary-button,
#end-screen .secondary-button {
  color: #fff1de;
}

#end-screen .primary-button::before,
#end-screen .secondary-button::before {
  background: linear-gradient(90deg, rgba(255, 140, 44, 0.94), rgba(255, 183, 91, 0.58));
  border: 1px solid rgba(255, 191, 126, 0.42);
}

@keyframes bulbPulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }

  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

@media (max-width: 1100px) {
  #title-shell .horror-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  #title-shell .menu-column {
    padding-top: 5rem;
  }

  #title-shell .menu-list {
    width: min(18rem, 100%);
  }

  #title-shell .menu-stage {
    padding-top: 0.8rem;
  }

  #title-shell .menu-scene {
    min-height: 34rem;
  }

  #title-shell .bulb-hero {
    right: 2%;
    top: 1.5rem;
    width: 17rem;
    height: 24rem;
  }

  #title-shell .title-pane {
    width: min(36rem, 100%);
  }
}

@media (max-width: 800px) {
  #title-shell.horror-menu-shell {
    padding: 1rem;
    min-height: calc(100vh - 1rem);
  }

  #title-shell.horror-menu-shell .menu-banner {
    position: static;
    margin-bottom: 0.8rem;
    opacity: 0.56;
  }

  #title-shell .menu-column {
    padding: 0;
  }

  #title-shell .menu-scene {
    min-height: 28rem;
  }

  #title-shell .bulb-hero {
    right: -1rem;
    top: 0.4rem;
    width: 13rem;
    height: 20rem;
    opacity: 0.92;
  }

  #title-shell .title-pane {
    width: 100%;
    right: 0;
    left: 0;
    bottom: 0;
  }

  #title-shell .title-pane .record-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
