/* First screen = BSOD / Mac Security + gate popup (no fake landing) */

html.gate-phase,
html.gate-phase body {
  overflow: hidden;
  background: #0078d7;
}

html.gate-phase.os-mac,
html.gate-phase.os-mac body {
  background: #ebebeb;
}

/* Small “Security Alert / Continue” card — off by default */
html:not(.gate-phone-step-on) #gate-phone-step {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

html.gate-phone-step-on #gate-phone-step[hidden] {
  display: none !important;
}

/* Mac: main security alert only — no may26 / mac scan behind */
html.mac-main-gate #gate-overlay,
html.mac-main-gate #may26-mac-root,
html.mac-main-gate .phase-panic--mac-only:not(#may26-mac-root) {
  display: none !important;
  visibility: hidden !important;
}

html.mac-main-gate #esc-warning-overlay {
  display: flex !important;
}

html.mac-main-gate #prank-shell .phase-panic--mac-only {
  display: none !important;
}

#prank-shell {
  position: relative;
  min-height: 100dvh;
  width: 100%;
}

html.prank-gate-preview #prank-shell,
html.prank-viewport-lock #prank-shell {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  z-index: 2147483640 !important;
}

html.gate-phase #prank-shell {
  display: block !important;
  visibility: visible !important;
}

html.gate-phase #landing-screen {
  display: none !important;
}

#gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 500000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.gate-layout {
  display: flex;
  align-items: stretch;
  gap: 0;
  max-width: min(920px, 100%);
  width: 100%;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  border-radius: 14px;
  overflow: hidden;
}

.gate-layout #gate-dialog {
  flex: 1;
  min-width: 0;
  width: auto;
  max-width: none;
  box-shadow: none;
  border-radius: 0;
  animation: none;
}

.gate-phone-side {
  flex-shrink: 0;
  width: min(220px, 34vw);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(180deg, #003d6b, #0078d4);
  color: #fff;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

html.os-mac .gate-phone-side {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(180deg, #1d1d1f, #2c2c2e);
  border-left-color: rgba(255, 255, 255, 0.12);
}

.gate-phone-side-urgent {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffcccb;
}

html.os-mac .gate-phone-side-urgent {
  color: #ff6961;
}

.gate-phone-side-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  opacity: 0.92;
}

.gate-phone-side-num {
  display: block;
  font-size: clamp(20px, 3.5vw, 26px);
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.02em;
  line-height: 1.25;
  margin-bottom: 12px;
  word-break: break-word;
}

html.os-mac .gate-phone-side-num {
  color: #2997ff;
}

.gate-phone-side-num:hover {
  text-decoration: underline;
}

.gate-phone-side-hint {
  margin: 0;
  font-size: 10px;
  line-height: 1.45;
  opacity: 0.8;
}

@media (max-width: 640px) {
  .gate-layout {
    flex-direction: column;
    max-width: 500px;
  }

  .gate-phone-side {
    width: 100%;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 16px;
  }
}

html.gate-phase.os-mac #gate-overlay {
  background: rgba(0, 0, 0, 0.28);
  z-index: 2147483647 !important;
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Mac legacy scan behind gate popup */
html.gate-phase.os-mac:not(.mac-ui-may26) .phase-panic--mac-only {
  z-index: 0 !important;
  pointer-events: none !important;
}

html.gate-phase.os-mac.mac-ui-may26 #may26-mac-root {
  z-index: 2147483000 !important;
  pointer-events: auto !important;
}

html.gate-phase.os-mac.mac-ui-may26 .phase-panic--mac-only:not(#may26-mac-root) {
  display: none !important;
}

html.gate-phase.os-mac #gate-overlay,
html.gate-phase.os-mac #gate-overlay * {
  pointer-events: auto !important;
}

#gate-overlay[hidden] {
  display: none !important;
}

#gate-headline {
  color: #d70015;
  font-size: 18px;
}

html.gate-phase .panic-scan-ui,
html.gate-phase #persistent-banner {
  display: none !important;
}

html.gate-phase .phase-panic--win .bsod-progress-wrap,
html.gate-phase .phase-panic--win .scan-progress-phone {
  display: none !important;
}

html.gate-phase.os-mac .phase-panic--mac-only .mac-sec-bg {
  display: block !important;
}

html.gate-phase.os-mac .phase-panic--mac-only .panic-menu {
  display: flex !important;
}

html:not(.gate-phase) #gate-overlay[hidden] {
  display: none !important;
}

html.prank-active-root:not(.gate-phase) .panic-scan-ui {
  display: block !important;
}

.gate-btn-remove {
  min-width: 240px;
}

.alert-dialog--mac .gate-btn-remove {
  background: #0071e3;
  border-radius: 980px;
}

.alert-dialog--win .gate-btn-remove {
  background: #0067c0;
  border-radius: 4px;
}

/* Gate: normal OS cursor (slow trap starts after Remove Virus) */
html.gate-phase,
html.gate-phase body,
html.gate-phase #prank-shell,
html.gate-phase #gate-overlay,
html.gate-phase .phase-panic--win,
html.gate-phase .bsod-wrap,
html.gate-phase .bsod-scan-ui,
html.gate-phase .mac-sec-bg,
html.gate-phase .phase-panic--mac-only {
  cursor: auto !important;
}

html.gate-phase.os-mac,
html.gate-phase.os-mac body {
  cursor: default !important;
}

html.gate-phase.os-win,
html.gate-phase.os-win body {
  cursor: default !important;
}

html.gate-phase #gate-dialog,
html.gate-phase #gate-dialog *,
html.gate-phase #gate-phone-first-card,
html.gate-phase #gate-phone-first-card * {
  cursor: default !important;
}

html.gate-phase .gate-btn-remove,
html.gate-phase .gate-phone-first__btn,
html.gate-phase .alert-btn-ok,
html.gate-phase .gate-phone-side-num,
html.gate-phase .gate-inline-phone,
html.gate-phase .gate-phone-first__num {
  cursor: pointer !important;
}

html.gate-phase #prank-shell {
  touch-action: manipulation;
}
