/* ==========================================================================
   PGI Winter Portal — 3D Ice Wall Gate Overlay & HUD
   Brand Palette:
   - Midnight Navy: #101D35
   - Winter Blue:   #B9DDF5
   - Ice White:     #F5FAFF
   - Frost Blue:    #DCEEFF
   - Plant Green:   #2A6636
   ========================================================================== */

html.pgi-gate-lock,
html.pgi-gate-lock body {
  overflow: hidden !important;
  height: 100%;
}

.pgi-ice-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at 50% 42%, #193055 0%, #101D35 62%, #091120 100%);
  color: #F5FAFF;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  user-select: none;
  -webkit-user-select: none;
  opacity: 1;
  transition: opacity 0.55s ease;
}

.pgi-ice-gate.is-exiting {
  opacity: 0;
  pointer-events: none;
}

.pgi-ice-gate.is-shattering {
  transition: opacity 1.2s ease;
}

.pgi-ice-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: manipulation;
}

.pgi-ice-gate.is-3d-active .pgi-ice-stage {
  cursor: none;
}

.pgi-ice-gate.is-canvas-fallback .pgi-ice-stage {
  cursor: url('/static/images/hammer-cursor.png') 18 22, crosshair;
}

.pgi-ice-stage canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* Top thin loading progress bar */
.pgi-ice-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(185, 221, 245, 0.16);
  z-index: 4;
  transition: opacity 0.4s ease;
}

.pgi-ice-progress.is-done {
  opacity: 0;
  pointer-events: none;
}

.pgi-ice-progress-fill {
  height: 100%;
  width: 6%;
  background: linear-gradient(90deg, #B9DDF5 0%, #F5FAFF 65%, #2A6636 100%);
  box-shadow: 0 0 12px rgba(185, 221, 245, 0.75);
  transition: width 0.2s ease-out;
}

/* HUD Layout */
.pgi-ice-hud {
  position: relative;
  z-index: 3;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: max(20px, env(safe-area-inset-top, 20px)) max(22px, env(safe-area-inset-right, 22px)) max(24px, env(safe-area-inset-bottom, 24px)) max(22px, env(safe-area-inset-left, 22px));
  pointer-events: none;
}

.pgi-ice-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.pgi-ice-brand-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pgi-ice-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #B9DDF5;
}

.pgi-ice-brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2A6636;
  box-shadow: 0 0 0 3px rgba(42, 102, 54, 0.35), 0 0 12px rgba(185, 221, 245, 0.65);
}

.pgi-ice-title {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.5rem, 3.2vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #F5FAFF;
  text-shadow: 0 2px 18px rgba(16, 29, 53, 0.85);
}

.pgi-ice-hint {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 500;
  color: #DCEEFF;
  text-shadow: 0 1px 10px rgba(16, 29, 53, 0.85);
}

/* 5 Ice Crystal Icons */
.pgi-ice-crystals {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(16, 29, 53, 0.56);
  border: 1px solid rgba(185, 221, 245, 0.34);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.pgi-crystal-icon {
  width: 22px;
  height: 22px;
  color: rgba(220, 238, 255, 0.38);
  transition: transform 0.25s ease, color 0.25s ease, filter 0.25s ease;
}

.pgi-crystal-icon polygon.pgi-crystal-core {
  fill: rgba(185, 221, 245, 0.08);
  stroke: currentColor;
  stroke-width: 1.5;
  transition: fill 0.25s ease;
}

.pgi-crystal-icon.is-filled {
  color: #F5FAFF;
  transform: scale(1.12);
  filter: drop-shadow(0 0 8px rgba(185, 221, 245, 0.85));
}

.pgi-crystal-icon.is-filled polygon.pgi-crystal-core {
  fill: #B9DDF5;
}

/* Bottom Controls */
.pgi-ice-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pgi-ice-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(185, 221, 245, 0.38);
  background: rgba(16, 29, 53, 0.68);
  color: #F5FAFF;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.pgi-ice-btn:hover {
  background: rgba(42, 102, 54, 0.82);
  border-color: #B9DDF5;
  transform: translateY(-1px);
}

.pgi-ice-btn:focus-visible {
  outline: 3px solid #B9DDF5;
  outline-offset: 3px;
}

.pgi-ice-btn[aria-pressed="true"] {
  background: rgba(42, 102, 54, 0.88);
  border-color: #B9DDF5;
}

.pgi-ice-skip {
  margin-left: auto;
  border-color: rgba(245, 250, 255, 0.45);
}

.pgi-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .pgi-ice-top {
    flex-direction: column;
    align-items: flex-start;
  }
  .pgi-ice-crystals {
    padding: 7px 11px;
    gap: 6px;
  }
  .pgi-crystal-icon {
    width: 18px;
    height: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pgi-ice-gate,
  .pgi-crystal-icon,
  .pgi-ice-btn {
    transition: opacity 0.2s ease !important;
  }
}
