/* ==========================================================================
   CYBERPUNK / SCI-FI CORE THEME (VIETNAMESE FULLY SUPPORTED)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,400;0,600;0,700;1,700&family=Be+Vietnam+Pro:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;700;800&display=swap');

:root {
  /* Sci-Fi / Cyber Typography - 100% Native Vietnamese Support */
  --font-cyber: 'Chakra Petch', 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Be Vietnam Pro', 'Chakra Petch', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Cyberpunk Neon Palette */
  --neon-cyan: #00f0ff;
  --neon-cyan-glow: rgba(0, 240, 255, 0.5);
  
  --neon-green: #00ff88;
  --neon-green-glow: rgba(0, 255, 136, 0.5);

  --neon-amber: #ffb703;
  --neon-amber-glow: rgba(255, 183, 3, 0.5);

  --neon-crimson: #ff0055;
  --neon-crimson-glow: rgba(255, 0, 85, 0.5);

  --neon-purple: #9d4edd;
  --neon-blue: #2563eb;

  /* 4 Fixed Choice Colors */
  --color-choice-a: #00ff88; /* Matrix Neon Green */
  --color-choice-b: #00f0ff; /* Cyber Cyan */
  --color-choice-c: #ffb703; /* Solar Amber */
  --color-choice-d: #ff0055; /* Laser Crimson */

  /* Deep Abyss Backgrounds */
  --bg-abyss: #030611;
  --bg-dark: #060b19;
  --bg-card: rgba(10, 18, 38, 0.85);
  --bg-card-hover: rgba(16, 28, 58, 0.9);
  --border-dim: rgba(0, 240, 255, 0.15);
  --border-bright: rgba(0, 240, 255, 0.35);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #475569;

  /* Angled Cutouts */
  --clip-chamfer: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  --clip-chamfer-lg: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-abyss);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ==========================================================================
   IMMERSIVE CYBER BACKGROUND (AURORA, PERSPECTIVE GRID & AMBIENT GLOWS)
   ========================================================================== */
.cyber-bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Atmospheric Neon Glows (Pulsing Nebulas) */
.cyber-bg-layer::before {
  content: "";
  position: absolute;
  width: 150vw;
  height: 150vh;
  top: -25vh;
  left: -25vw;
  background: 
    radial-gradient(circle at 20% 20%, rgba(0, 240, 255, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 80% 30%, rgba(157, 78, 221, 0.14) 0%, transparent 50%),
    radial-gradient(circle at 50% 80%, rgba(255, 0, 85, 0.1) 0%, transparent 55%),
    radial-gradient(circle at 75% 85%, rgba(0, 255, 136, 0.08) 0%, transparent 40%);
  filter: blur(40px);
  animation: nebula-drift 18s ease-in-out infinite alternate;
}

@keyframes nebula-drift {
  0% { transform: scale(1) translate(0, 0); }
  50% { transform: scale(1.08) translate(-2%, 2%); }
  100% { transform: scale(1.03) translate(2%, -1%); }
}

/* Tech Circuit & Perspective Grid Overlay with continuous motion */
.cyber-bg-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 100%, rgba(0, 240, 255, 0.18) 0%, transparent 70%);
  background-size: 44px 44px, 44px 44px, 100% 100%;
  animation: grid-drift 20s linear infinite;
}

@keyframes grid-drift {
  0% { background-position: 0 0, 0 0, 50% 100%; }
  100% { background-position: 0 44px, 44px 0, 50% 100%; }
}

/* Subtle Sci-Fi Scanlines with gentle flicker */
.cyber-scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.28) 50%);
  background-size: 100% 4px;
  z-index: 99;
  opacity: 0.2;
  animation: scanlines-drift 0.15s steps(2) infinite;
}

@keyframes scanlines-drift {
  0% { background-position: 0 0; }
  100% { background-position: 0 2px; }
}

/* Top Luminous Horizon Light Bar */
.cyber-horizon-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--neon-cyan) 30%, var(--neon-purple) 70%, transparent 100%);
  box-shadow: 0 0 15px var(--neon-cyan);
  z-index: 999;
}

/* Cyber Typography Utilities */
.font-cyber {
  font-family: var(--font-cyber);
  letter-spacing: 0.5px;
}

.font-mono {
  font-family: var(--font-mono);
}

/* Neon Glow Utilities */
.glow-text-cyan {
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.6), 0 0 24px rgba(0, 240, 255, 0.3);
}

.glow-text-amber {
  text-shadow: 0 0 12px rgba(255, 183, 3, 0.6), 0 0 24px rgba(255, 183, 3, 0.3);
}

/* Cyber Hologram Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-family: var(--font-cyber);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 1px solid transparent;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  backdrop-filter: blur(8px);
}

.badge-online {
  background: rgba(0, 240, 255, 0.12);
  color: var(--neon-cyan);
  border-color: rgba(0, 240, 255, 0.45);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}

.badge-online .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
  animation: cyber-pulse 1.8s infinite;
}

.badge-closed {
  background: rgba(255, 0, 85, 0.15);
  color: var(--neon-crimson);
  border-color: rgba(255, 0, 85, 0.45);
}

.badge-active {
  background: rgba(37, 99, 235, 0.2);
  color: #93c5fd;
  border-color: rgba(37, 99, 235, 0.5);
}

@keyframes cyber-pulse {
  0%, 100% { opacity: 1; transform: scale(1); filter: drop-shadow(0 0 5px var(--neon-cyan)); }
  50% { opacity: 0.3; transform: scale(0.85); filter: drop-shadow(0 0 1px var(--neon-cyan)); }
}

/* 4 Choice Colors - Holographic Cyber Glass */
.choice-a {
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.18) 0%, rgba(0, 255, 136, 0.05) 100%) !important;
  border: 1.5px solid var(--color-choice-a) !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(0, 255, 136, 0.25), inset 0 0 12px rgba(0, 255, 136, 0.1);
}
.choice-b {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.18) 0%, rgba(0, 240, 255, 0.05) 100%) !important;
  border: 1.5px solid var(--color-choice-b) !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.25), inset 0 0 12px rgba(0, 240, 255, 0.1);
}
.choice-c {
  background: linear-gradient(135deg, rgba(255, 183, 3, 0.18) 0%, rgba(255, 183, 3, 0.05) 100%) !important;
  border: 1.5px solid var(--color-choice-c) !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(255, 183, 3, 0.25), inset 0 0 12px rgba(255, 183, 3, 0.1);
}
.choice-d {
  background: linear-gradient(135deg, rgba(255, 0, 85, 0.18) 0%, rgba(255, 0, 85, 0.05) 100%) !important;
  border: 1.5px solid var(--color-choice-d) !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(255, 0, 85, 0.25), inset 0 0 12px rgba(255, 0, 85, 0.1);
}

.text-choice-a { color: var(--color-choice-a) !important; }
.text-choice-b { color: var(--color-choice-b) !important; }
.text-choice-c { color: var(--color-choice-c) !important; }
.text-choice-d { color: var(--color-choice-d) !important; }

/* Connection Banner */
.offline-banner {
  display: none;
  background: rgba(127, 29, 29, 0.95);
  color: #fecaca;
  text-align: center;
  padding: 10px 14px;
  font-family: var(--font-cyber);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  border-bottom: 2px solid var(--neon-crimson);
  box-shadow: 0 4px 25px rgba(255, 0, 85, 0.5);
  backdrop-filter: blur(8px);
}
.offline-banner.visible {
  display: block;
}

/* Cyber Language Toggle Button */
.lang-toggle-btn {
  background: rgba(11, 20, 44, 0.85);
  border: 1.5px solid var(--neon-cyan);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  padding: 5px 12px;
  font-family: var(--font-cyber);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
  transition: all 0.2s ease;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
  backdrop-filter: blur(8px);
}

.lang-toggle-btn:hover {
  background: rgba(0, 240, 255, 0.22);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.5);
  transform: translateY(-1px);
}

.lang-toggle-btn .lang-active {
  color: var(--neon-cyan);
  text-shadow: 0 0 10px var(--neon-cyan);
}

.lang-toggle-btn .lang-divider {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.lang-toggle-btn .lang-dim {
  color: var(--text-dim);
}

/* ==========================================================================
   CYBER SVG ICON UTILITIES (NO EMOJIS)
   ========================================================================== */
.icon-svg {
  width: 1.15em;
  height: 1.15em;
  display: inline-block;
  vertical-align: -0.18em;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.icon-svg-lg {
  width: 3.2rem;
  height: 3.2rem;
}

.icon-svg-xl {
  width: 4.5rem;
  height: 4.5rem;
}

/* ==========================================================================
   DYNAMIC SCENE MOTION & MATERIALIZATION ANIMATIONS
   ========================================================================== */
.scene-enter {
  animation: cyber-scene-materialize 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cyber-scene-materialize {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
    filter: blur(5px) brightness(1.2);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0px) brightness(1);
  }
}

/* Radar Sweep & Tech Glows */
@keyframes hud-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes hud-spin-reverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

/* Glitch pulse for urgent states */
@keyframes cyber-urgent-glow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(255, 0, 85, 0.4), inset 0 0 10px rgba(255, 0, 85, 0.2);
    border-color: rgba(255, 0, 85, 0.8);
  }
  50% {
    box-shadow: 0 0 35px rgba(255, 0, 85, 0.8), inset 0 0 20px rgba(255, 0, 85, 0.4);
    border-color: var(--neon-crimson);
  }
}

/* Hologram Emblem Ring */
.hologram-emblem {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.hologram-ring-outer {
  position: absolute;
  inset: 0;
  border: 2px dashed rgba(0, 240, 255, 0.5);
  border-radius: 50%;
  animation: hud-spin 18s linear infinite;
}

.hologram-ring-inner {
  position: absolute;
  inset: 10px;
  border: 1.5px dotted rgba(157, 78, 221, 0.6);
  border-radius: 50%;
  animation: hud-spin-reverse 10s linear infinite;
}

.hologram-core {
  position: relative;
  z-index: 2;
  color: var(--neon-cyan);
  filter: drop-shadow(0 0 14px var(--neon-cyan));
}

