/* ==========================================================================
   ZERO INTRODUCTION SEQUENCE — 2D TACTICAL GAME TRANSMISSION INTERFACE
   Aesthetic: Code Geass Military / Tactical Mecha Comms Interface
   Layout:
   ┌──────────────────────────────────────────┐
   │                                          │
   │   [ ZERO IMAGE ]   │   [ZERO]: message   │
   │   ZERO             │                     │
   │   COMMANDER        │   dialogue...       │
   │                    │                     │
   │                    │              ENTER  │
   └──────────────────────────────────────────┘
   LEFT HALF  = zero_new.png portrait + ZERO / COMMANDER directly underneath
   CENTER     = 1px thin vertical divider
   RIGHT HALF = [ZERO]: message + dialogue typewriter + ENTER control
   Typography = Geist Pixel for ALL text elements
   ========================================================================== */

@font-face {
  font-family: 'Geist Pixel';
  src: url('../fonts/GeistPixel-Square.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  font-synthesis: none;
}

@font-face {
  font-family: 'GeistPixel-Square';
  src: url('../fonts/GeistPixel-Square.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  font-synthesis: none;
}

/* Atmospheric Backdrop Vignette (Game remains visible & paused underneath) */
.zero-intro-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 45%, rgba(5, 7, 14, 0.72) 0%, rgba(2, 3, 7, 0.94) 100%);
  touch-action: manipulation;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.15s ease;
}

.zero-intro-layer.is-hidden {
  display: none !important;
}

/* Global pixel typography lock for intro overlay */
.zero-intro-layer,
.zero-intro-layer * {
  box-sizing: border-box;
  font-family: 'Geist Pixel', 'GeistPixel-Square', monospace;
  font-synthesis: none;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  text-rendering: pixelated;
  image-rendering: pixelated;
}

/* Short monitor flicker on game launch */
.zero-screen-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: #ffffff;
  opacity: 0;
  z-index: 2000;
}

.zero-screen-flash.is-flashing {
  animation: zeroFlashAnim 0.10s steps(2) forwards;
}

@keyframes zeroFlashAnim {
  0% {
    opacity: 0.95;
    background: #ffffff;
  }
  35% {
    opacity: 0.5;
    background: #b91c1c;
  }
  70% {
    opacity: 0.85;
    background: #ffffff;
  }
  100% {
    opacity: 0;
  }
}

/* ==========================================================================
   UNIFIED TRANSMISSION CONSOLE PANEL — TRUE 50/50 TWO-COLUMN LAYOUT
   ========================================================================== */
.zero-intro-container {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(94vw, 420px);
  background: rgba(6, 9, 16, 0.96);
  border: 1px solid #1c2636;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.92), 0 0 0 1px rgba(255, 255, 255, 0.02);
  padding: 10px;
  overflow: hidden;
  cursor: pointer;
  animation: zeroConsoleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* VIEW 1: ZERO DIALOGUE TRANSMISSION (50/50 Layout) */
.zero-view-dialogue {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 10px;
  align-items: stretch;
  width: 100%;
}

.zero-view-dialogue.is-hidden {
  display: none !important;
}

@keyframes zeroConsoleIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Extremely faint scanline overlay across console */
.zero-intro-container::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 25;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.14) 2px,
    rgba(0, 0, 0, 0.14) 4px
  );
}

/* Tiny red accent highlight across bottom edge when transmission finishes typing */
.zero-intro-container::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent 5%, #ef4444 30%, #ef4444 70%, transparent 95%);
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  transition: opacity 0.25s ease;
}

.zero-intro-container.is-ready::before {
  opacity: 0.75;
}

/* ==========================================================================
   LEFT HALF: ZERO PORTRAIT + NAME/TITLE DIRECTLY UNDERNEATH
   ========================================================================== */
.zero-col-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
}

.zero-portrait-frame {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #020408;
  border: 1px solid #16202e;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* 4 Corner Reticles inside the portrait frame */
.zero-portrait-frame::before {
  content: '';
  position: absolute;
  inset: 2px;
  pointer-events: none;
  z-index: 10;
  background:
    linear-gradient(to right, #ef4444 5px, transparent 5px) top left / 5px 1px no-repeat,
    linear-gradient(to bottom, #ef4444 5px, transparent 5px) top left / 1px 5px no-repeat,
    linear-gradient(to left, #ef4444 5px, transparent 5px) bottom right / 5px 1px no-repeat,
    linear-gradient(to top, #ef4444 5px, transparent 5px) bottom right / 1px 5px no-repeat;
}

/* zero_new.png Portrait */
.zero-portrait {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: contrast(1.05) saturate(1.05);
  animation: zeroPortraitFade 0.4s ease-out forwards;
}

@keyframes zeroPortraitFade {
  from {
    opacity: 0;
    filter: brightness(1.3);
  }
  to {
    opacity: 1;
    filter: brightness(1);
  }
}

/* Name/Title directly underneath portrait on left side */
.zero-speaker-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  gap: 2px;
  padding: 2px 0 0 2px;
}

/* ZERO: Strongest visual presence */
.zero-callsign {
  font-family: 'Geist Pixel', 'GeistPixel-Square', monospace;
  font-size: 14px;
  font-weight: 400;
  color: #ef4444;
  letter-spacing: 1px;
  line-height: 1.1;
}

/* COMMANDER: Noticeably smaller and quieter */
.zero-rank {
  font-family: 'Geist Pixel', 'GeistPixel-Square', monospace;
  font-size: 9px;
  font-weight: 400;
  color: #64748b;
  letter-spacing: 0.8px;
  line-height: 1.1;
}

/* ==========================================================================
   CENTER: THIN VERTICAL DIVIDER
   ========================================================================== */
.zero-divider {
  width: 1px;
  background: #1c2636;
  align-self: stretch;
}

/* ==========================================================================
   RIGHT HALF: DIALOGUE + ENTER
   ========================================================================== */
.zero-col-right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: 2px 0 2px 2px;
}

/* Dialogue Text Body: Main readable transmission text */
.zero-dialogue-body {
  font-family: 'Geist Pixel', 'GeistPixel-Square', monospace;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  color: #f8fafc;
  letter-spacing: 0.25px;
  word-break: break-word;
  flex: 1;
}

/* Speaker Label in brackets before dialogue text: [ZERO]: */
.zero-speaker-prefix {
  display: inline;
  font-family: 'Geist Pixel', 'GeistPixel-Square', monospace;
  font-size: 13px;
  font-weight: 400;
  color: #ef4444;
  letter-spacing: 0.5px;
  margin-right: 4px;
  user-select: none;
  -webkit-user-select: none;
}

.zero-text {
  display: inline;
}

/* Blinking Pixel Cursor */
.zero-cursor {
  display: inline-block;
  color: #ef4444;
  font-family: 'Geist Pixel', 'GeistPixel-Square', monospace;
  font-size: 12px;
  margin-left: 2px;
  animation: zeroCursorBlink 0.55s steps(2, start) infinite;
}

@keyframes zeroCursorBlink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* ==========================================================================
   VIEW 2: HOW TO PLAY SCREEN (Tactical Comms Guide)
   ========================================================================== */
.zero-view-guide {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  animation: zeroGuideFade 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes zeroGuideFade {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.zero-view-guide.is-hidden {
  display: none !important;
}

.zero-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1c2636;
  padding-bottom: 6px;
}

.zero-guide-title {
  font-family: 'Geist Pixel', 'GeistPixel-Square', monospace;
  font-size: 13px;
  font-weight: 400;
  color: #ef4444;
  letter-spacing: 1.5px;
  line-height: 1.1;
  text-transform: uppercase;
}

.zero-guide-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.zero-guide-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(14, 20, 32, 0.5);
  border: 1px solid #16202e;
  padding: 4px 8px;
}

.zero-guide-input {
  font-family: 'Geist Pixel', 'GeistPixel-Square', monospace;
  font-size: 11px;
  font-weight: 400;
  color: #94a3b8;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.zero-guide-action {
  font-family: 'Geist Pixel', 'GeistPixel-Square', monospace;
  font-size: 11px;
  font-weight: 400;
  color: #f8fafc;
  letter-spacing: 1.2px;
  line-height: 1.2;
}

.zero-guide-desktop {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-top: 1px solid #16202e;
  padding-top: 5px;
  margin-top: 2px;
}

.zero-guide-desktop-header {
  font-family: 'Geist Pixel', 'GeistPixel-Square', monospace;
  font-size: 9px;
  font-weight: 400;
  color: #64748b;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.zero-guide-desktop-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-family: 'Geist Pixel', 'GeistPixel-Square', monospace;
  font-size: 10.5px;
  color: #cbd5e1;
  letter-spacing: 0.4px;
}

.zero-guide-desktop-item {
  font-family: 'Geist Pixel', 'GeistPixel-Square', monospace;
  font-size: 10.5px;
  color: #cbd5e1;
}

.zero-guide-sep {
  color: #ef4444;
  font-size: 9px;
  user-select: none;
}

/* ==========================================================================
   BOTTOM ACTION (ENTER TO INITIATE GAMEPLAY)
   ========================================================================== */
.zero-action-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 6px;
  min-height: 24px;
}

.zero-btn-enter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(185, 28, 28, 0.16);
  color: #ef4444;
  border: 1px solid #ef4444;
  font-family: 'Geist Pixel', 'GeistPixel-Square', monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1.5px;
  padding: 3px 10px;
  border-radius: 0;
  cursor: pointer;
  outline: none;
  text-transform: uppercase;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: all 0.1s ease;
  animation: zeroEnterPulse 1.8s ease-in-out infinite;
}

@keyframes zeroEnterPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
  50% {
    box-shadow: 0 0 8px 1px rgba(239, 68, 68, 0.35);
  }
}

.zero-btn-enter:hover,
.zero-btn-enter:focus-visible {
  background: #ef4444;
  color: #ffffff;
}

.zero-btn-enter:active {
  background: #dc2626;
  color: #ffffff;
}

/* ==========================================================================
   RESPONSIVE SIZING: 50/50 TWO-COLUMN & HOW TO PLAY ACROSS VIEWPORTS
   ========================================================================== */

/* Desktop (>= 768px): Refined tactical console */
@media (min-width: 768px) {
  .zero-intro-container {
    width: 480px;
    padding: 12px;
  }

  .zero-view-dialogue {
    gap: 14px;
  }

  .zero-callsign {
    font-size: 15px;
  }

  .zero-speaker-prefix {
    font-size: 13.5px;
  }

  .zero-dialogue-body {
    font-size: 13.5px;
  }

  .zero-guide-title {
    font-size: 14px;
  }

  .zero-guide-input,
  .zero-guide-action {
    font-size: 12px;
  }

  .zero-guide-desktop-items {
    font-size: 11.5px;
    gap: 8px;
  }
}

/* Narrow mobile (<= 360px): Keeps 50/50 horizontal two-column comfortably inside viewport */
@media (max-width: 360px) {
  .zero-intro-container {
    width: 96vw;
    padding: 6px;
  }

  .zero-view-dialogue {
    gap: 6px;
  }

  .zero-callsign {
    font-size: 13px;
  }

  .zero-rank {
    font-size: 8.5px;
  }

  .zero-speaker-prefix {
    font-size: 11.5px;
  }

  .zero-dialogue-body {
    font-size: 11.5px;
  }

  .zero-guide-title {
    font-size: 12px;
  }

  .zero-guide-input,
  .zero-guide-action {
    font-size: 10px;
  }

  .zero-guide-desktop-items {
    font-size: 9.5px;
    gap: 4px;
  }
}
