/* ==========================================================================
   THE MIDNIGHT GALA — Ultra-Luxury Maritime Noir Stylesheet
   Joyful Design Atelier
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;800;900&family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,900;1,400&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --color-ocean-deep: #070B19;
  --color-ocean-dark: #0A0F24;
  --color-ocean-mid: #101736;
  --color-gold-brushed: #D4AF37;
  --color-gold-light: #F7E7B4;
  --color-gold-dark: #8C701B;
  --color-crimson: #E11D48;
  --color-crimson-dark: #9F1239;
  --color-emerald: #10B981;
  --color-emerald-dark: #047857;
  --color-obsidian-glass: rgba(15, 23, 42, 0.88);
  --color-obsidian-card: rgba(11, 17, 36, 0.92);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: rgba(7, 11, 25, 0.8);
}
::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.35);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.7);
}

/* Base Body Styles */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--color-ocean-deep);
  color: #F8FAFC;
  overflow-x: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Typography Helpers */
.font-cinzel {
  font-family: 'Cinzel', Georgia, serif;
}
.font-playfair {
  font-family: 'Playfair Display', Georgia, serif;
}
.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Glassmorphism Classes */
.glass-panel {
  background: var(--color-obsidian-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(212, 175, 55, 0.18);
}

.glass-panel-gold {
  background: rgba(16, 23, 54, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(212, 175, 55, 0.45);
  box-shadow: 0 10px 30px -10px rgba(212, 175, 55, 0.15);
}

.glass-panel-subtle {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Metallic & Gold Gradients */
.text-gold-gradient {
  background: linear-gradient(135deg, #FFF0B8 0%, #D4AF37 50%, #AA820A 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.border-gold-gradient {
  border-image: linear-gradient(to right, #8C701B, #D4AF37, #F7E7B4, #8C701B) 1;
}

.bg-gold-gradient {
  background: linear-gradient(135deg, #ECC853 0%, #D4AF37 50%, #B88E18 100%);
}

.bg-gold-gradient-hover:hover {
  background: linear-gradient(135deg, #FBE07A 0%, #ECC853 50%, #D4AF37 100%);
}

/* Subtle Shimmer & Animations */
@keyframes goldShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer-gold {
  background: linear-gradient(90deg, rgba(212,175,55,0) 0%, rgba(212,175,55,0.25) 50%, rgba(212,175,55,0) 100%);
  background-size: 200% 100%;
  animation: goldShimmer 3.5s infinite;
}

@keyframes radarSweep {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.radar-sweep {
  animation: radarSweep 6s linear infinite;
  transform-origin: center center;
}

/* 3D Glowing Pins on Floor Plans */
.pin-marker {
  position: absolute;
  transform: translate(-50%, -100%);
  cursor: pointer;
  z-index: 35;
  touch-action: manipulation;
  pointer-events: auto;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.2s ease;
}

.pin-marker:hover {
  transform: translate(-50%, -115%) scale(1.15);
  filter: drop-shadow(0 0 16px rgba(212, 175, 55, 0.9));
}

@keyframes pulseEmerald {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7), 0 0 15px rgba(16, 185, 129, 0.4);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(16, 185, 129, 0), 0 0 25px rgba(16, 185, 129, 0.7);
  }
}

@keyframes pulseAmber {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7), 0 0 15px rgba(245, 158, 11, 0.4);
  }
  50% {
    box-shadow: 0 0 0 14px rgba(245, 158, 11, 0), 0 0 25px rgba(245, 158, 11, 0.7);
  }
}

@keyframes pulseGold {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.8), 0 0 20px rgba(212, 175, 55, 0.6);
  }
  50% {
    box-shadow: 0 0 0 16px rgba(212, 175, 55, 0), 0 0 35px rgba(212, 175, 55, 0.9);
  }
}

.pulse-emerald {
  animation: pulseEmerald 2.2s infinite ease-out;
}

.pulse-amber {
  animation: pulseAmber 2.2s infinite ease-out;
}

.pulse-gold {
  animation: pulseGold 2s infinite ease-out;
}

/* Suspect Eliminated Stamp */
.stamp-cleared {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-14deg);
  border: 4px double #E11D48;
  color: #E11D48;
  font-family: 'Cinzel', serif;
  font-weight: 900;
  letter-spacing: 0.18em;
  padding: 8px 18px;
  text-transform: uppercase;
  border-radius: 6px;
  pointer-events: none;
  background: rgba(225, 29, 72, 0.12);
  backdrop-filter: blur(2px);
  text-shadow: 0 0 10px rgba(225, 29, 72, 0.6);
  box-shadow: 0 0 20px rgba(225, 29, 72, 0.3), inset 0 0 15px rgba(225, 29, 72, 0.2);
  z-index: 25;
  animation: stampImpact 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes stampImpact {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-25deg) scale(2.2);
  }
  80% {
    transform: translate(-50%, -50%) rotate(-12deg) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-14deg) scale(1);
  }
}

/* Floor Plan Pan & Zoom Container */
.map-viewport {
  position: relative;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
  cursor: grab;
}

.map-viewport.is-zoomed {
  touch-action: none;
}

.map-viewport:active {
  cursor: grabbing;
}

.map-content-layer {
  transform-origin: center center;
  transition: transform 0.05s linear;
  will-change: transform;
}

/* Word Search Grid Container & Cells */
#deck2-ws-grid {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.ws-cell {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: clamp(0.75rem, 3.2vw, 1.15rem);
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  border: 1px solid rgba(212, 175, 55, 0.15);
  background: rgba(15, 23, 42, 0.7);
  color: #E2E8F0;
}

.ws-cell:hover {
  background: rgba(212, 175, 55, 0.25);
  color: #FFF;
  border-color: rgba(212, 175, 55, 0.5);
}

.ws-cell.ws-selected {
  background: #D4AF37;
  color: #070B19;
  border-color: #F7E7B4;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.8);
  font-weight: 900;
}

.ws-cell.ws-found {
  background: rgba(16, 185, 129, 0.3);
  color: #10B981;
  border-color: #10B981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.ws-cell.ws-lie {
  background: rgba(225, 29, 72, 0.35);
  color: #FDA4AF;
  border-color: #E11D48;
  box-shadow: 0 0 14px rgba(225, 29, 72, 0.6);
  animation: pulseCrime 1.2s infinite alternate;
}

@keyframes pulseCrime {
  from { filter: brightness(1); }
  to { filter: brightness(1.3); }
}

/* Logic Grid Cells */
.logic-cell {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(212, 175, 55, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.18s ease;
  border-radius: 4px;
}

@media (min-width: 640px) {
  .logic-cell {
    width: 48px;
    height: 48px;
  }
}

.logic-cell:hover {
  border-color: #D4AF37;
  background: rgba(212, 175, 55, 0.1);
}

.logic-cell.state-unknown {
  background: rgba(15, 23, 42, 0.6);
  color: #64748B;
}

.logic-cell.state-allowed {
  background: rgba(16, 185, 129, 0.25);
  color: #10B981;
  border-color: #10B981;
  box-shadow: inset 0 0 10px rgba(16, 185, 129, 0.3);
}

.logic-cell.state-denied {
  background: rgba(225, 29, 72, 0.25);
  color: #E11D48;
  border-color: #E11D48;
  box-shadow: inset 0 0 10px rgba(225, 29, 72, 0.3);
}

/* Contradiction Hotspot Marker */
.hotspot-ring {
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #D4AF37;
  background: rgba(212, 175, 55, 0.2);
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.hotspot-ring::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #D4AF37;
  animation: pulseHotspot 2s infinite ease-out;
}

@keyframes pulseHotspot {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

.hotspot-ring.active-contradiction {
  border-color: #E11D48;
  background: rgba(225, 29, 72, 0.35);
  box-shadow: 0 0 20px #E11D48;
}

.hotspot-ring.active-contradiction::after {
  border-color: #E11D48;
}

/* Modals and Overlays */
.modal-backdrop {
  background: rgba(4, 7, 18, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Print Certificate Rules */
@media print {
  body * {
    visibility: hidden;
  }
  #printable-certificate, #printable-certificate * {
    visibility: visible;
  }
  #printable-certificate {
    position: absolute;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 2.5rem;
    background: #070B19 !important;
    color: #F8FAFC !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* 100dvh Fallbacks for Mobile / Tablet Viewports */
@supports (min-height: 100dvh) {
  #screen-intro,
  #screen-doors,
  #screen-game {
    min-height: 100dvh;
  }
}

/* Mobile Bottom Navigation Safe-Area Padding */
nav.lg\:hidden,
#mobile-bottom-nav {
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

/* Mobile & Tablet Command Column Bottom-Sheet Drawer (< 1024px) */
@media (max-width: 1023px) {
  #right-command-column.mobile-drawer-open {
    position: fixed;
    inset: auto 0 56px 0;
    max-height: 78dvh;
    overflow-y: auto;
    z-index: 45;
    padding: 1rem;
    background: rgba(7, 11, 25, 0.98);
    border-top: 2px solid #D4AF37;
    border-radius: 1.25rem 1.25rem 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.85);
    animation: drawerSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
}

@keyframes drawerSlideUp {
  from {
    transform: translateY(100%);
    opacity: 0.7;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ==========================================================================
   COLD CASE SUSPECT FUNNEL UPGRADES: STYLES
   ========================================================================== */

/* 1. Polygraph ECG Waveform & Grid */
.polygraph-grid {
  background-color: #040814;
  background-image: 
    linear-gradient(rgba(16, 185, 129, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 185, 129, 0.08) 1px, transparent 1px);
  background-size: 20px 20px;
}

.polygraph-grid.deception {
  background-image: 
    linear-gradient(rgba(225, 29, 72, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(225, 29, 72, 0.12) 1px, transparent 1px);
}

.ecg-path-normal {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: ecgDash 2.4s linear infinite;
}

.ecg-path-spike {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: ecgDash 1.2s linear infinite;
}

@keyframes ecgDash {
  0% {
    stroke-dashoffset: 600;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

/* 2. Physical Evidence Locker Document Skins */
.doc-skin-memo {
  background: #0B1124;
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.doc-skin-receipt {
  background: #FDFBF7;
  color: #1A1A1A;
  font-family: 'JetBrains Mono', monospace;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  position: relative;
}
.doc-skin-receipt::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 8px;
  background: radial-gradient(circle, transparent, transparent 50%, #FDFBF7 50%, #FDFBF7 100%);
  background-size: 16px 8px;
}

.doc-skin-autopsy {
  background: #0E162F;
  border-left: 4px solid #E11D48;
  position: relative;
  overflow: hidden;
}
.doc-skin-autopsy::before {
  content: "CONFIDENTIAL FORENSICS";
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-25deg);
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 2.2rem;
  color: rgba(225, 29, 72, 0.08);
  pointer-events: none;
  white-space: nowrap;
}

.doc-skin-phone {
  background: #000000;
  border-radius: 1.5rem;
  border: 3px solid #334155;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.doc-skin-audit {
  background: #07101E;
  border: 1px solid rgba(16, 185, 129, 0.4);
  position: relative;
}

/* 3. Funnel Radar Timeline Track */
.funnel-stage-node {
  position: relative;
  transition: all 0.25s ease;
}
.funnel-stage-node::before {
  content: "";
  position: absolute;
  top: 2rem;
  bottom: -1rem;
  left: 1.25rem;
  width: 2px;
  background: rgba(212, 175, 55, 0.2);
}
.funnel-stage-node:last-child::before {
  display: none;
}

/* ==========================================================================
   HOLLYWOOD-GRADE CINEMATIC INTRO & FIELD MANUAL STYLES
   ========================================================================== */

/* 1. Ken Burns Ship Animation */
@keyframes introKenBurns {
  0% {
    transform: scale(1.03) translate(0, 0);
  }
  50% {
    transform: scale(1.08) translate(-1%, -1%);
  }
  100% {
    transform: scale(1.13) translate(1%, -1.5%);
  }
}

.intro-ken-burns {
  animation: introKenBurns 22s ease-in-out infinite alternate;
  transform-origin: center center;
}

/* 2. Maritime Searchlight Beams */
.searchlight-beam-left {
  position: absolute;
  bottom: 0;
  left: 15%;
  width: 140px;
  height: 120vh;
  background: linear-gradient(to top, rgba(247, 231, 180, 0.22) 0%, rgba(212, 175, 55, 0.08) 50%, transparent 100%);
  transform-origin: bottom center;
  transform: rotate(-35deg);
  filter: blur(18px);
  animation: searchlightSweepLeft 14s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 1;
}

.searchlight-beam-right {
  position: absolute;
  bottom: 0;
  right: 20%;
  width: 160px;
  height: 130vh;
  background: linear-gradient(to top, rgba(247, 231, 180, 0.18) 0%, rgba(212, 175, 55, 0.06) 50%, transparent 100%);
  transform-origin: bottom center;
  transform: rotate(28deg);
  filter: blur(20px);
  animation: searchlightSweepRight 17s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 1;
}

@keyframes searchlightSweepLeft {
  0% { transform: rotate(-45deg); opacity: 0.35; }
  50% { transform: rotate(-15deg); opacity: 0.75; }
  100% { transform: rotate(-30deg); opacity: 0.45; }
}

@keyframes searchlightSweepRight {
  0% { transform: rotate(38deg); opacity: 0.4; }
  50% { transform: rotate(12deg); opacity: 0.8; }
  100% { transform: rotate(25deg); opacity: 0.45; }
}

/* 3. Interactive Trailer Teaser Pill Active State */
.teaser-pill-active {
  background: linear-gradient(135deg, #ECC853 0%, #D4AF37 50%, #B88E18 100%) !important;
  color: #070B19 !important;
  font-weight: 700 !important;
  border-color: #F7E7B4 !important;
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.5) !important;
}

/* 4. Field Manual Step Cards */
.field-step-card {
  background: rgba(10, 15, 36, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.25);
  transition: all 0.2s ease;
}
.field-step-card:hover {
  border-color: rgba(212, 175, 55, 0.6);
  background: rgba(16, 23, 54, 0.95);
  transform: translateY(-2px);
}

/* 5. Gate-Opening Cinema Flash Overlay */
#cinema-flash-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none !important;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.5s ease-out;
}
.cinema-flash-active {
  opacity: 1 !important;
  background: radial-gradient(circle, rgba(247, 231, 180, 0.85) 0%, rgba(212, 175, 55, 0.4) 60%, rgba(7, 11, 25, 0.95) 100%) !important;
}


