/* ═══════════════════════════════════════════════════════════
   OVERLAYS.CSS — Image modal, auth gate, loader
   ═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════
   IMAGE MODAL
   ═══════════════════════════════════════ */
body.theme-hud .img-modal[hidden] { display: none; }

body.theme-hud .img-modal {
  position: fixed;
  inset: 0;
  z-index: 120000;
}

body.theme-hud .img-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.theme-hud .img-modal__content {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(1120px, 94vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--ui-surface), var(--ui-surface-2));
  border: 1px solid var(--ui-border);
  box-shadow: var(--ui-shadow);
  backdrop-filter: var(--ui-blur);
  -webkit-backdrop-filter: var(--ui-blur);
  overflow: hidden;
}

body.theme-hud .img-modal__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: var(--r-md);
  border: 1px solid color-mix(in srgb, var(--ui-border) 80%, transparent);
  background: color-mix(in srgb, var(--ui-surface) 75%, transparent);
}

body.theme-hud .img-modal__title {
  font-family: var(--font-title);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ui-accent) 78%, var(--ui-text));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.theme-hud .img-modal__close {
  height: 34px;
  min-width: 44px;
  padding: 0 10px;
  border-radius: var(--r-pill);
}

body.theme-hud .img-modal__img {
  width: 100%;
  max-height: 74vh;
  object-fit: contain;
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, .25);
  border: 1px solid var(--ui-border);
}

body.theme-hud .img-modal__cap {
  font-size: 12px;
  color: var(--ui-text-2);
  line-height: 1.35;
  white-space: pre-wrap;
  padding: 10px;
  border-radius: var(--r-md);
  border: 1px solid color-mix(in srgb, var(--ui-border) 80%, transparent);
  background: color-mix(in srgb, var(--ui-surface) 70%, transparent);
  overflow: auto;
  max-height: 22vh;
}

/* ── Nav arrows ── */
.img-modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(0, 0, 0, .45);
  color: #fff;
  font-size: 34px;
  line-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  z-index: 5;
}

.img-modal__nav--prev { left: 10px; }
.img-modal__nav--next { right: 10px; }
.img-modal__nav[disabled] { opacity: .35; cursor: not-allowed; }

/* ═══════════════════════════════════════
   LOADER
   ═══════════════════════════════════════ */
#hud-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #000;
  display: block;
  transition: opacity .6s ease, visibility .6s ease;
}

body.hud-loaded #hud-loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hud-loader-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #000;
}

/* ═══════════════════════════════════════
   AUTH GATE
   ═══════════════════════════════════════ */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.auth-card {
  max-width: 440px;
  width: 90vw;
  padding: 24px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--ui-surface), var(--ui-surface-2));
  border: 1px solid var(--ui-border);
  box-shadow: var(--ui-shadow);
  backdrop-filter: var(--ui-blur);
  -webkit-backdrop-filter: var(--ui-blur);
}

.auth-head { margin-bottom: 20px; }

.auth-title {
  font-family: var(--font-title);
  font-size: 16px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ui-accent);
  margin-bottom: 8px;
}

.auth-text {
  font-size: 14px;
  color: var(--ui-text-2);
}

.auth-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.auth-hint {
  font-size: 12px;
  color: var(--ui-text-dim);
  line-height: 1.4;
  margin-bottom: 12px;
}

.auth-instruction summary {
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  color: var(--ui-accent);
}

.auth-instruction summary::-webkit-details-marker { display: none; }

.auth-instruction__steps {
  margin-top: 10px;
  padding-left: 20px;
  font-size: 13px;
  color: var(--ui-text-2);
  line-height: 1.5;
}

.auth-instruction__note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ui-text-dim);
}