#choke-vignette,
#death-blackout {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

#choke-vignette {
  z-index: 12;
  background: radial-gradient(circle at 50% 44%, transparent 16%, rgba(37, 5, 5, 0.54) 58%, rgba(0, 0, 0, 0.96) 100%);
  transition: opacity 0.2s;
}

#death-blackout {
  z-index: 18;
  background: #020303;
  transition: opacity 0.25s;
}

.overlay { z-index: 20; }
#map-overlay { z-index: 16; background: rgba(2, 5, 4, 0.95); }
.map-shell { background: #101612; border-color: #3b443a; box-shadow: 0 25px 90px rgba(0, 0, 0, 0.8); }
#map-canvas { background: #111711; }
.map-header, .map-footer { color: #a9b2a1; }
.map-footer span { color: #777f6b; }

body.choking #hud,
body.choking #inventory,
body.choking #crosshair,
body.choking #interaction,
body.choking #subtitle,
body.choking #controls-hint,
body.struggling #hud,
body.struggling #inventory,
body.struggling #crosshair,
body.struggling #interaction,
body.struggling #subtitle,
body.struggling #controls-hint,
body.dead #hud,
body.dead #inventory,
body.dead #crosshair,
body.dead #interaction,
body.dead #subtitle,
body.dead #controls-hint { visibility: hidden; }

#gpu-note { margin-top: 12px; font-size: 11px; line-height: 1.45; color: #d49a7a; }
#gpu-note:empty { display: none; }

#chapters { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
#chapters[hidden] { display: none; }
#chapters button { background: transparent; color: #d7b678; border: 1px solid rgba(215, 182, 120, 0.5); border-radius: 3px; padding: 8px 12px; font-size: 12px; font-weight: 700; }
#chapters button:hover { background: rgba(215, 182, 120, 0.12); }

/* hiding: looking out through closet slats, or from under a bed */
#hide-overlay { position: fixed; inset: 0; z-index: 11; pointer-events: none; opacity: 0; transition: opacity 0.25s; }
body.hiding-closet #hide-overlay {
  opacity: 1;
  background:
    linear-gradient(to right, rgba(5, 4, 3, 0.98) 0 6%, transparent 12% 88%, rgba(5, 4, 3, 0.98) 94% 100%),
    repeating-linear-gradient(to bottom, rgba(8, 6, 4, 0.93) 0 17px, rgba(8, 6, 4, 0.12) 21px 35px, rgba(8, 6, 4, 0.93) 39px),
    radial-gradient(circle at 50% 50%, transparent 30%, rgba(0, 0, 0, 0.7) 100%);
}
body.hiding-bed #hide-overlay {
  opacity: 1;
  background:
    linear-gradient(to bottom, rgba(6, 5, 4, 0.99) 0 30%, rgba(6, 5, 4, 0.6) 36%, transparent 44%),
    linear-gradient(to top, rgba(6, 5, 4, 0.7) 0 6%, transparent 16%),
    radial-gradient(circle at 50% 60%, transparent 35%, rgba(0, 0, 0, 0.75) 100%);
}
body.hiding-closet #crosshair, body.hiding-bed #crosshair { visibility: hidden; }

#hud, #interaction, #subtitle, #inventory, #controls-hint, #mobile-controls { z-index: 13; }

/* online */
#online { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(226, 231, 213, 0.12); }
.online-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#player-name, #room-code { box-sizing: border-box; width: 100%; min-width: 0; background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(226, 231, 213, 0.25); border-radius: 3px; color: #e8e8df; padding: 9px 10px; font: inherit; font-size: 13px; }
#host-button { grid-column: 1 / -1; }
#host-button, #copy-link, #lobby-start button { background: transparent; color: #d7b678; border: 1px solid rgba(215, 182, 120, 0.55); border-radius: 3px; padding: 9px 12px; font-size: 12px; font-weight: 700; }
#host-button:disabled { opacity: 0.5; }
#lobby { margin-top: 10px; font-size: 12px; color: #c9d0c7; }
#lobby[hidden], #lobby-start[hidden] { display: none; }
#lobby-link { font-family: monospace; color: #e8dcc0; word-break: break-all; margin-bottom: 6px; }
#lobby-players { margin: 8px 0; }
#lobby-start { display: flex; gap: 8px; margin: 6px 0; }
#lobby-status { color: #c9b38a; }
#roster { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); font-size: 11px; color: #c9d0c7; text-shadow: 0 1px 6px #000; z-index: 13; pointer-events: none; }
#spectate { position: fixed; bottom: 14%; left: 50%; transform: translateX(-50%); font-size: 14px; font-weight: 700; color: #e8d6c4; text-shadow: 0 2px 8px #000; z-index: 13; }
#spectate[hidden] { display: none; }
#start-button:disabled { opacity: 0.6; cursor: default; }

/* the grab: mash to wrench free */
#struggle {
  position: fixed;
  left: 50%;
  bottom: 22%;
  z-index: 14;
  width: min(380px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
  text-align: center;
  font-family: inherit;
  color: #efe4cf;
}
#struggle[hidden] { display: none; }
.struggle-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.32em;
  text-shadow: 0 0 18px rgba(160, 10, 10, 0.9), 0 2px 4px #000;
  animation: struggle-pulse 0.32s ease-in-out infinite alternate;
}
.struggle-bar {
  height: 16px;
  margin-top: 10px;
  border: 2px solid rgba(239, 228, 207, 0.8);
  background: rgba(10, 0, 0, 0.7);
}
#struggle-fill { height: 100%; width: 25%; background: linear-gradient(90deg, #7d0f0f, #e2c08c); transition: width 0.06s linear; }
.struggle-clock { height: 3px; margin-top: 6px; background: rgba(0, 0, 0, 0.5); }
#struggle-time { height: 100%; width: 100%; background: #b3261e; }
.struggle-hint { margin-top: 8px; font-size: 12px; letter-spacing: 0.24em; color: #c9bba3; }
.struggle-hint .touch { display: none; }
@media (pointer: coarse) {
  .struggle-hint .desk { display: none; }
  .struggle-hint .touch { display: inline; }
}
@keyframes struggle-pulse { from { transform: scale(1); } to { transform: scale(1.06); } }
