#gameplay-root #hud,
#gameplay-root #player-list,
#gameplay-root .banner,
#gameplay-root #inventory,
#gameplay-root .inventory-modal,
#gameplay-root .dialogue-modal,
#gameplay-root .help-modal,
#gameplay-root .interaction-prompt {
  pointer-events: auto;
}

#gameplay-root #damage-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 14;
  --damage-vignette-opacity: 0;
  background:
    radial-gradient(circle at top left, rgba(185, 8, 20, calc(var(--damage-vignette-opacity, 0) * 0.95)) 0%, rgba(185, 8, 20, calc(var(--damage-vignette-opacity, 0) * 0.48)) 16%, transparent 34%),
    radial-gradient(circle at top right, rgba(185, 8, 20, calc(var(--damage-vignette-opacity, 0) * 0.95)) 0%, rgba(185, 8, 20, calc(var(--damage-vignette-opacity, 0) * 0.48)) 16%, transparent 34%),
    radial-gradient(circle at bottom left, rgba(185, 8, 20, calc(var(--damage-vignette-opacity, 0) * 0.95)) 0%, rgba(185, 8, 20, calc(var(--damage-vignette-opacity, 0) * 0.48)) 16%, transparent 34%),
    radial-gradient(circle at bottom right, rgba(185, 8, 20, calc(var(--damage-vignette-opacity, 0) * 0.95)) 0%, rgba(185, 8, 20, calc(var(--damage-vignette-opacity, 0) * 0.48)) 16%, transparent 34%),
    linear-gradient(90deg, rgba(150, 0, 10, calc(var(--damage-vignette-opacity, 0) * 0.42)) 0%, transparent 14%, transparent 86%, rgba(150, 0, 10, calc(var(--damage-vignette-opacity, 0) * 0.42)) 100%);
}

#gameplay-root #damage-vignette.active {
  animation: damage-vignette-flash 420ms ease-out forwards;
}

@keyframes damage-vignette-flash {
  0% {
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

#gameplay-root #hud {
  position: fixed;
  top: 16px;
  left: 16px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 10px 12px;
  border-radius: 8px;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, background 120ms ease;
}

#gameplay-root #hud:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

#gameplay-root #hud:focus-visible {
  outline: none;
  border-color: rgba(30, 91, 191, 0.42);
  box-shadow: 0 0 0 4px rgba(30, 91, 191, 0.12), 0 10px 24px rgba(0, 0, 0, 0.12);
}

#gameplay-root #hud .hud-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#gameplay-root #hud .hint {
  font-size: 12px;
  opacity: 0.7;
}

#gameplay-root .time-display {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  opacity: 0.85;
}

#gameplay-root .hud-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#gameplay-root .coords-display {
  font-size: 11px;
  letter-spacing: 0.35px;
  opacity: 0.72;
}

#gameplay-root .hud-capture-stop,
#gameplay-root .hud-fullscreen-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-left: 2px;
  border: 0;
  border-radius: 6px;
  background: #9b1c1c;
  color: #fff6f6;
  font-size: 11px;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(130, 19, 24, 0.28);
  cursor: pointer;
}

#gameplay-root .hud-fullscreen-toggle {
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 10px rgba(10, 18, 30, 0.24);
}

#gameplay-root .hud-fullscreen-toggle:hover {
  background: rgba(255, 255, 255, 0.24);
}

#gameplay-root .hud-capture-stop:hover {
  background: #b91c1c;
}

#gameplay-root .hud-capture-stop.hidden {
  display: none;
}

#gameplay-root .health-bar {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

#gameplay-root .health-heart {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

#gameplay-root .health-heart.filled {
  background: #ff5a5a;
  border-color: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 6px rgba(255, 90, 90, 0.6);
}

#gameplay-root #player-list {
  position: fixed;
  top: 96px;
  left: 16px;
  margin-top: 8px;
  background: rgba(20, 20, 20, 0.7);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 160px;
  max-width: 220px;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#gameplay-root #player-list .player-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
}

#gameplay-root .player-entries {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

#gameplay-root .player-row {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}

#gameplay-root .player-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

#gameplay-root .player-self {
  margin-left: auto;
  font-size: 10px;
  opacity: 0.6;
}

#gameplay-root .banner {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#gameplay-root .banner.hidden {
  display: none;
}

#gameplay-root .banner-card {
  background: rgba(20, 20, 20, 0.85);
  color: rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  padding: 18px 20px;
  min-width: 220px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
  text-align: center;
}

#gameplay-root .banner-title {
  font-size: 18px;
  font-weight: 700;
}

#gameplay-root .banner-text {
  font-size: 14px;
  opacity: 0.7;
}

#gameplay-root #inventory {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 11;
}

#gameplay-root .inventory-bar {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

#gameplay-root .inventory-slot {
  width: 58px;
  min-height: 74px;
  padding: 8px 7px 6px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(6px);
}

#gameplay-root .inventory-slot.filled {
  background: rgba(255, 255, 255, 0.88);
}

#gameplay-root .inventory-slot.selected {
  border-color: rgba(26, 115, 232, 0.7);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.16), 0 12px 28px rgba(0, 0, 0, 0.18);
}

#gameplay-root .inventory-slot.armed {
  border-color: rgba(232, 166, 26, 0.72);
  box-shadow: 0 0 0 3px rgba(232, 166, 26, 0.16), 0 12px 28px rgba(0, 0, 0, 0.18);
}

#gameplay-root .inventory-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.22);
}

#gameplay-root .inventory-label {
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
}

#gameplay-root .inventory-count {
  font-size: 11px;
  opacity: 0.72;
}

#gameplay-root .inventory-overflow-button {
  width: 58px;
  min-height: 74px;
  padding: 8px 7px 6px;
  border-radius: 14px;
  border: 1px solid rgba(17, 20, 28, 0.18);
  background: rgba(19, 23, 30, 0.82);
  color: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
}

#gameplay-root .inventory-overflow-button:hover {
  background: rgba(26, 31, 40, 0.9);
}

#gameplay-root .inventory-modal {
  position: fixed;
  inset: 0;
  z-index: 16;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#gameplay-root .inventory-modal.hidden {
  display: none;
}

#gameplay-root .inventory-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 15, 0.62);
}

#gameplay-root .inventory-modal-card {
  position: relative;
  width: min(820px, 100%);
  max-height: min(82vh, 900px);
  overflow: auto;
  background: rgba(251, 247, 239, 0.98);
  border: 1px solid rgba(19, 24, 32, 0.12);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.24);
}

#gameplay-root .inventory-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

#gameplay-root .inventory-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #17202e;
}

#gameplay-root .inventory-modal-subtitle {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(23, 32, 46, 0.68);
}

#gameplay-root .inventory-modal-close {
  border: 1px solid rgba(27, 41, 65, 0.14);
  background: rgba(255, 255, 255, 0.9);
  color: #17202e;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
}

#gameplay-root .inventory-modal-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#gameplay-root .inventory-modal-section-title {
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(25, 33, 47, 0.66);
  font-weight: 700;
}

#gameplay-root .inventory-grid {
  display: grid;
  gap: 10px;
}

#gameplay-root .inventory-grid-hotbar {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

#gameplay-root .inventory-grid-backpack {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#gameplay-root .inventory-modal .inventory-slot {
  width: auto;
  min-width: 0;
}

#gameplay-root .storage-modal {
  position: fixed;
  inset: 0;
  z-index: 17;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#gameplay-root .storage-modal.hidden {
  display: none;
}

#gameplay-root .storage-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 15, 0.68);
}

#gameplay-root .storage-modal-card {
  position: relative;
  width: min(980px, 100%);
  max-height: min(84vh, 920px);
  overflow: auto;
  background: rgba(247, 241, 230, 0.98);
  border: 1px solid rgba(19, 24, 32, 0.12);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.24);
}

#gameplay-root .storage-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

#gameplay-root .storage-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #17202e;
}

#gameplay-root .storage-modal-subtitle {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(23, 32, 46, 0.68);
}

#gameplay-root .storage-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#gameplay-root .storage-modal-close,
#gameplay-root .storage-access-toggle,
#gameplay-root .storage-blueprint-button {
  border: 1px solid rgba(27, 41, 65, 0.14);
  background: rgba(255, 255, 255, 0.9);
  color: #17202e;
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  cursor: pointer;
}

#gameplay-root .storage-modal-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#gameplay-root .storage-modal-section-title {
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(25, 33, 47, 0.66);
  font-weight: 700;
}

#gameplay-root .storage-grid {
  display: grid;
  gap: 10px;
}

#gameplay-root .storage-grid-chest,
#gameplay-root .storage-grid-inventory {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#gameplay-root .storage-slot {
  min-height: 70px;
  border-radius: 14px;
  border: 1px solid rgba(27, 41, 65, 0.14);
  background: rgba(255, 255, 255, 0.86);
  color: #17202e;
  padding: 12px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

#gameplay-root .storage-slot:hover,
#gameplay-root .storage-blueprint-button:hover,
#gameplay-root .storage-modal-close:hover,
#gameplay-root .storage-access-toggle:hover {
  background: rgba(248, 205, 108, 0.18);
}

#gameplay-root .storage-slot-empty {
  color: rgba(23, 32, 46, 0.46);
}

#gameplay-root .storage-slot-item,
#gameplay-root .storage-slot-blueprint-ref {
  font-weight: 600;
}

#gameplay-root .storage-blueprint-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#gameplay-root .catalog-launcher {
  position: fixed;
  right: 18px;
  bottom: 98px;
  z-index: 2100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#gameplay-root .catalog-launcher-button {
  border: 1px solid rgba(27, 41, 65, 0.18);
  background: rgba(251, 247, 239, 0.94);
  color: #17202e;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
}

#gameplay-root .catalog-launcher-button:hover {
  background: rgba(248, 205, 108, 0.22);
}

#gameplay-root .catalog-modal {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

#gameplay-root .catalog-modal.hidden {
  display: none;
}

#gameplay-root .catalog-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 15, 0.68);
}

#gameplay-root .catalog-modal-card {
  position: relative;
  width: min(820px, 100%);
  max-height: calc(100vh - 40px);
  margin: auto 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  background: rgba(251, 247, 239, 0.98);
  border: 1px solid rgba(19, 24, 32, 0.12);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.24);
}

#gameplay-root .catalog-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

#gameplay-root .catalog-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #17202e;
}

#gameplay-root .catalog-modal-subtitle {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(23, 32, 46, 0.68);
}

#gameplay-root .catalog-modal-close,
#gameplay-root .catalog-row-action {
  border: 1px solid rgba(27, 41, 65, 0.14);
  background: rgba(255, 255, 255, 0.9);
  color: #17202e;
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  cursor: pointer;
}

#gameplay-root .catalog-modal-close:hover,
#gameplay-root .catalog-row-action:hover {
  background: rgba(248, 205, 108, 0.18);
}

#gameplay-root .catalog-modal-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#gameplay-root .catalog-modal-section-title {
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(25, 33, 47, 0.66);
  font-weight: 700;
}

#gameplay-root .catalog-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#gameplay-root .catalog-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(27, 41, 65, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  padding: 12px 14px;
}

#gameplay-root .catalog-row-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

#gameplay-root .catalog-row-title {
  font-size: 14px;
  font-weight: 700;
  color: #17202e;
}

#gameplay-root .catalog-row-meta,
#gameplay-root .catalog-list-empty {
  font-size: 12px;
  color: rgba(23, 32, 46, 0.66);
}

#gameplay-root .interaction-prompt {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 20, 20, 0.8);
  color: rgba(255, 255, 255, 0.92);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12px;
  letter-spacing: 0.4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  z-index: 12;
}

#gameplay-root .interaction-prompt.hidden {
  display: none;
}

#gameplay-root .dialogue-modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 15, 0.56);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
}

#gameplay-root .dialogue-modal.hidden {
  display: none;
}

#gameplay-root .dialogue-card {
  width: min(720px, 100%);
  background: rgba(251, 247, 239, 0.98);
  border: 1px solid rgba(19, 24, 32, 0.12);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.24);
}

#gameplay-root .dialogue-speaker {
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(25, 33, 47, 0.66);
  font-weight: 700;
}

#gameplay-root .dialogue-text {
  font-size: 15px;
  line-height: 1.7;
  color: #17202e;
}

#gameplay-root .dialogue-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#gameplay-root .dialogue-choice {
  border: 1px solid rgba(27, 41, 65, 0.14);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  cursor: pointer;
}

#gameplay-root .dialogue-choice:hover {
  background: rgba(248, 205, 108, 0.18);
}

#gameplay-root .dialogue-close {
  align-self: flex-end;
  border: 1px solid rgba(27, 41, 65, 0.14);
  background: rgba(16, 20, 28, 0.92);
  color: white;
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  cursor: pointer;
}

#gameplay-root .dialogue-empty {
  color: rgba(23, 31, 43, 0.66);
}

#gameplay-root .help-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 10, 15, 0.56);
  z-index: 16;
}

#gameplay-root .help-modal.hidden {
  display: none;
}

#gameplay-root .help-card {
  width: min(520px, 100%);
  background: rgba(251, 247, 239, 0.98);
  border: 1px solid rgba(19, 24, 32, 0.12);
  border-radius: 18px;
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.24);
  text-align: center;
}

#gameplay-root .help-kicker {
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(25, 33, 47, 0.66);
  font-weight: 700;
}

#gameplay-root .help-title {
  font-size: 24px;
  font-weight: 700;
  color: #17202e;
}

#gameplay-root .help-list {
  display: grid;
  gap: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: #17202e;
}

#gameplay-root .help-close {
  align-self: center;
  border: 1px solid rgba(27, 41, 65, 0.14);
  background: rgba(16, 20, 28, 0.92);
  color: white;
  border-radius: 12px;
  padding: 10px 18px;
  font: inherit;
  cursor: pointer;
}
