/* Non-Human OS Theme - Orange/Yellow SLUSHBOYZ Style */

@font-face {
  font-family: 'Franklin Gothic Medium Cond';
  src: url('/Franklin Gothic Medium Cond Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Dazzle Unicase';
  src: url('/fonnts.com-Dazzle_Unicase_Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Dazzle Unicase';
  src: url('/fonnts.com-Dazzle_Unicase_Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
}

:root {
  --bg-gradient: radial-gradient(ellipse at center, #1a0a00 0%, #0a0500 50%, #000000 100%);
  --primary: #f74408;
  --secondary: #f74408;
  --accent: #ff5c1a;
  --glow: #f74408;
  --text: #f74408;
  --text-dim: #ff5c1a;
  --yellow: #f1b309;
  --panel-bg: linear-gradient(135deg, rgba(247, 68, 8, 0.2) 0%, rgba(247, 68, 8, 0.1) 100%);
  --panel-border: rgba(247, 68, 8, 0.5);
  --dark-panel: rgba(10, 5, 0, 0.9);

  /* global cockpit scale (0.70–0.95 feels good) */
  --cockpit-scale: .85;
  --ui-font-scale: .85; /* 0.75–0.90 to tighten copy without 8px unreadability */

  /* Galaxy orbit variables (from galaxy-final.md) */
  --size: 500px;
  --color: #e45428;
  --stroke: 4px;
  --sun-size: 64px;
  --planet-size: 20px;
  --planet-color: #d81b60;
  --pink-color: #f052c2;

  /* Position + scale controls for the whole galaxy */
  --galaxy-scale: 0.375;
  --galaxy-top: 1rem;
  --galaxy-left: 1rem;

  /* Pink arc controls */
  --arc-rotate: -28deg;
  --arc-length: 1000;
  --arc-gap: 600;
  --arc-offset: 350;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Oxygen Mono", monospace;
  font-size: calc(80% * var(--ui-font-scale));
}

#root {
  width: 100%;
  height: 100%;
}

#os-container {
  width: 100vw;
  height: 100vh;
  background: #000000;
  position: relative;
  overflow: hidden;
}

/* Starfield canvas - override library z-index */
#os-container > canvas {
  pointer-events: none;
  z-index: 0 !important;
  position: absolute !important;
}

/* Grid overlay */
.grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  background-image:
    linear-gradient(rgba(247, 68, 8, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247, 68, 8, 0.03) 1px, transparent 1px),
    radial-gradient(circle at center, transparent 0%, rgba(247, 68, 8, 0.02) 50%, transparent 100%);
  background-size: 50px 50px, 50px 50px, 100% 100%;
  pointer-events: none;
  animation: gridPulse 4s ease-in-out infinite;
}

/* Earth Globe */
#earthGlobe {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  pointer-events: auto;
  background: transparent !important;
}

/* Ensure the canvas inside earthGlobe has no background */
#earthGlobe canvas {
  background: transparent !important;
}

/* Galaxy Orbit Map */
#solarSystemMap {
  position: absolute;
  bottom: calc(100% - 490px);
  right: -580px;
  width: clamp(440px, 56vw, 720px);
  height: clamp(440px, 56vw, 720px);
  z-index: 100;
  overflow: visible;
  pointer-events: none;
}

/* Galaxy Wrapper - for positioning + scaling (from galaxy-final.md) */
.galaxy-wrapper {
  position: absolute;
  top: var(--galaxy-top);
  left: var(--galaxy-left);
  transform: scale(var(--galaxy-scale));
  transform-origin: top left;
  pointer-events: none;
}

/* Galaxy Container */
.galaxy {
  position: relative;
  width: var(--size);
  height: var(--size);
  overflow: visible;
}

/* Orbit Arms */
.galaxy .arm {
  position: absolute;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--color);
  stroke-width: var(--stroke);
  filter: drop-shadow(0 0 10px var(--color));
  z-index: 1;
  overflow: visible;
}

/* All three orange arms share same rotation */
.galaxy > .arm:nth-of-type(1),
.galaxy > .arm:nth-of-type(2),
.galaxy > .arm:nth-of-type(3) {
  transform: rotate(-30deg);
}

/* Pink group rotation */
.galaxy .arm.pink-full {
  transform: rotate(var(--arc-rotate));
  z-index: 2;
}

/* Pink ellipse arc (controlled by dasharray) */
.galaxy .arm.pink-full .pink-ellipse {
  fill: none;
  stroke: var(--pink-color);
  stroke-width: var(--stroke);
  filter: drop-shadow(0 0 10px var(--pink-color));
  stroke-dasharray: var(--arc-length) var(--arc-gap);
  stroke-dashoffset: var(--arc-offset);
}

/* Sun */
.galaxy .sun {
  position: absolute;
  width: var(--sun-size);
  height: var(--sun-size);
  background: #ffeb11;
  border-radius: 50%;
  top: 38%;
  left: 41%;
  transform: translate(-50%, -50%);
  z-index: 10;
}

/* Two-piece inner ellipse */
.galaxy .behind {
  z-index: 5;
  transform: rotate(-30deg);
}

.galaxy .front {
  z-index: 15;
  transform: rotate(-30deg);
}

/* Planets */
.galaxy .planet {
  position: absolute;
  width: var(--planet-size);
  height: var(--planet-size);
  background: var(--planet-color);
  border-radius: 50%;
  z-index: 5;
  filter: drop-shadow(0 0 5px var(--planet-color));
}

/* Individual planet overrides */
.galaxy .planet1 {
  --planet-size: 15px;
  --planet-color: #e45428;
}

.galaxy .planet2 {
  --planet-size: 25px;
  --planet-color: #1f8aff;
}

.galaxy .planet3 {
  --planet-size: 21px;
  --planet-color: #ee252d;
}

.galaxy .planet4 {
  --planet-size: 18px;
  --planet-color: #e45428;
}

/* Yellow ship (triangle) */
.galaxy .ship {
  position: absolute;
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 46px solid #ffe94a;
  top: 29%;
  left: 95%;
  transform: translate(-50%, -50%) rotate(180deg);
  z-index: 20;
  filter: drop-shadow(0 0 6px #ffe94a);
}

/* Responsive sizing for smaller screens */
@media (max-width: 768px) {
  #solarSystemMap {
    top: 100px;
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: clamp(300px, 70vw, 480px);
    height: clamp(300px, 70vw, 480px);
  }

  .galaxy-wrapper {
    transform: scale(0.75);
  }
}

@media (max-width: 480px) {
  #solarSystemMap {
    top: 85px;
    bottom: auto;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: clamp(280px, 85vw, 400px);
    height: clamp(280px, 85vw, 400px);
  }

  :root {
    --galaxy-scale: 0.6;
  }
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

@keyframes pulse {
  0% {
    box-shadow:
      0 0 20px rgba(247, 68, 9, 1),
      0 0 40px rgba(247, 68, 9, 1),
      0 0 0 0 rgba(247, 68, 9, 0.7),
      0 0 0 0 rgba(247, 68, 9, 0.4),
      inset 0 0 10px rgba(255, 121, 0, 0.8),
      inset 0 0 20px rgba(255, 121, 0, 0.8);
  }
  40% {
    box-shadow:
      0 0 20px rgba(247, 68, 9, 1),
      0 0 40px rgba(247, 68, 9, 1),
      0 0 0 15px rgba(247, 68, 9, 0),
      0 0 0 0 rgba(247, 68, 9, 0.4),
      inset 0 0 10px rgba(255, 121, 0, 0.8),
      inset 0 0 20px rgba(255, 121, 0, 0.8);
  }
  80% {
    box-shadow:
      0 0 20px rgba(247, 68, 9, 1),
      0 0 40px rgba(247, 68, 9, 1),
      0 0 0 15px rgba(247, 68, 9, 0),
      0 0 0 30px rgba(247, 68, 9, 0),
      inset 0 0 10px rgba(255, 121, 0, 0.8),
      inset 0 0 20px rgba(255, 121, 0, 0.8);
  }
  100% {
    box-shadow:
      0 0 20px rgba(247, 68, 9, 1),
      0 0 40px rgba(247, 68, 9, 1),
      0 0 0 0 rgba(247, 68, 9, 0),
      0 0 0 30px rgba(247, 68, 9, 0),
      inset 0 0 10px rgba(255, 121, 0, 0.8),
      inset 0 0 20px rgba(255, 121, 0, 0.8);
  }
}

/* Logo */
.slushboyz-logo {
  position: absolute;
  bottom: 152px;
  left: max(5%, calc((100vw - 870px) / 2));
  z-index: 200;
}

.slushboyz-logo img {
  height: 59px;
  width: auto;
  filter: brightness(0) saturate(100%) invert(84%) sepia(52%) saturate(714%) hue-rotate(359deg) brightness(103%) contrast(101%) drop-shadow(0 0 20px rgba(255, 211, 61, 0.6));
  transform: skewY(-5deg);
}

/* Countdown Text */
.countdown-text {
  position: absolute;
  top: 30px;
  left: 30px;
  z-index: 100;
  font-family: 'Share Tech Mono', monospace;
  font-size: 14px;
  color: var(--primary);
  line-height: 15px;
  letter-spacing: 0.5px;
  text-shadow: 0 0 10px rgba(247, 68, 8, 0.8);
}

.countdown-text div {
  margin-bottom: 4px;
}

/* Reset Globe Button */
.reset-globe-btn {
  position: absolute;
  top: 80px;
  left: 30px;
  z-index: 100;
  padding: 6px 16px;
  background: #f74408;
  border: 2px solid #f74408;
  border-radius: 20px;
  color: #000000;
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.5px;
  text-shadow: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.reset-globe-btn:hover {
  background: #ff5c1a;
  border-color: #ff5c1a;
  text-shadow: none;
  box-shadow: 0 0 20px rgba(247, 68, 8, 0.6);
}

/* Sound FX Toggle Button */
.sound-fx-toggle-btn {
  position: absolute;
  top: 115px;
  left: 30px;
  z-index: 100;
  width: 40px;
  height: 40px;
  padding: 0;
  background: #f74408;
  border: 2px solid #f74408;
  border-radius: 50%;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.sound-fx-toggle-btn:hover {
  background: #ff5c1a;
  border-color: #ff5c1a;
  box-shadow: 0 0 20px rgba(247, 68, 8, 0.6);
}

.sound-fx-toggle-btn .speaker-icon {
  width: 20px;
  height: 20px;
}

.sound-fx-toggle-btn.off {
  background: transparent;
  border-color: #f74408;
  color: #f74408;
}

.sound-fx-toggle-btn.off:hover {
  background: rgba(247, 68, 8, 0.1);
  border-color: #ff5c1a;
  box-shadow: 0 0 20px rgba(247, 68, 8, 0.4);
}

.sound-fx-toggle-btn.off .sound-waves {
  display: none;
}

/* Status Text */
.status-text {
  position: absolute;
  bottom: 155px;
  left: max(calc(5% + 300px), calc((100vw - 1000px) / 2 + 300px));
  z-index: 100;
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  color: var(--primary);
  line-height: 13px;
  letter-spacing: 0.5px;
  text-shadow: 0 0 10px rgba(247, 68, 8, 0.8);
}

.status-text div {
  margin-bottom: 4px;
}

.status-text .status-ok {
  color: var(--yellow);
  text-shadow: 0 0 10px rgba(241, 179, 9, 1);
}

/* Terminal Typing Animation */
@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.typing-cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background-color: var(--primary);
  margin-left: 2px;
  animation: blink 0.7s infinite;
}

/* Chat Input Container */
.chat-input-container {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 900px;
  z-index: 100;
}

.chat-input-row {
  display: flex;
  flex-direction: row;
  gap: 0;
  align-items: center;
  position: relative;
  width: 100%;
}

/* Audio Visualizer */
.audio-visualizer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 240px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  z-index: 5;
  pointer-events: none;
}

.visualizer-bar {
  flex: 1;
  height: 30%;
  background: linear-gradient(to top, #f74408 0%, rgba(247, 68, 8, 0.8) 20%, rgba(247, 68, 8, 0.5) 40%, rgba(247, 68, 8, 0.3) 60%, rgba(247, 68, 8, 0.1) 80%, rgba(247, 68, 8, 0) 100%);
  border-radius: 0;
  transition: height 0.1s ease-out;
  opacity: 0.9;
}

/* OS Input/Button Components */
.os-input {
  flex: 1;
  padding: 18px 25px;
  padding-right: 220px;
  background: transparent;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid #f74409;
  border-radius: 50px;
  color: var(--yellow);
  font-size: 16px;
  outline: none;
  letter-spacing: 1px;
  font-family: 'Space Grotesk', sans-serif;
  text-transform: uppercase;
  box-shadow:
    inset 0 0 30px rgba(247, 68, 8, 1),
    inset 0 0 20px rgba(247, 68, 8, 0.5),
    inset 0 0 10px rgba(247, 68, 8, 0.5);
  transition: all 0.3s ease;
}

.os-input:focus {
  background: transparent;
  border: 2px solid #f74409;
  box-shadow: none;
}

.os-input::placeholder {
  color: var(--yellow);
  opacity: 0.6;
  text-transform: uppercase;
}

.os-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 46px;
  background: #f74408;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: none;
  border-radius: 50px;
  color: #000000;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0;
  font-size: 16px;
  font-family: 'Stack Sans', sans-serif;
  text-transform: uppercase;
  transition: all 0.3s ease;
  box-shadow:
    0 0 15px rgba(247, 68, 9, 1),
    0 0 30px rgba(247, 68, 9, 1),
    inset 0 0 10px rgba(255, 121, 0, 0.8),
    inset 0 0 20px rgba(255, 121, 0, 0.8);
  flex-shrink: 0;
  width: auto;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.os-btn.primary-btn {
  background: #f74408;
}

.os-btn:hover {
  background: #f74408;
  box-shadow:
    0 0 20px rgba(247, 68, 9, 1),
    0 0 40px rgba(247, 68, 9, 1),
    inset 0 0 10px rgba(255, 121, 0, 0.8),
    inset 0 0 20px rgba(255, 121, 0, 0.8);
  animation: pulse 1.5s ease-out infinite;
}

.os-btn:active {
  background: #f74408;
  box-shadow:
    0 0 15px rgba(247, 68, 9, 1),
    0 0 30px rgba(247, 68, 9, 1),
    inset 0 0 10px rgba(255, 121, 0, 0.8),
    inset 0 0 20px rgba(255, 121, 0, 0.8);
  transform: translateY(-50%) scale(0.98);
}

.os-select {
  flex: 1;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(247, 68, 8, 0.2);
  border-radius: 12px;
  color: var(--text);
  font-size: 12px;
  outline: none;
  letter-spacing: 1px;
  font-family: inherit;
  cursor: pointer;
  box-shadow:
    inset 0 0 40px rgba(247, 68, 8, 0.08),
    inset 0 0 20px rgba(247, 68, 8, 0.05);
}

.os-select option {
  background: #0a0500;
  color: var(--text);
}

.os-slider {
  width: 200px;
  height: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(247, 68, 8, 0.2);
  border-radius: 8px;
  outline: none;
  appearance: none;
  cursor: pointer;
  box-shadow:
    inset 0 0 20px rgba(247, 68, 8, 0.08);
}

.os-slider::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(247, 68, 8, 0.8) 0%, rgba(247, 68, 8, 0.6) 100%);
  cursor: pointer;
  box-shadow:
    0 0 15px rgba(247, 68, 8, 0.6),
    inset 0 0 10px rgba(247, 68, 8, 0.3);
  border: 2px solid rgba(247, 68, 8, 0.5);
  transition: all 0.2s ease;
}

.os-slider::-webkit-slider-thumb:hover {
  box-shadow:
    0 0 20px rgba(247, 68, 8, 0.8),
    inset 0 0 15px rgba(247, 68, 8, 0.4);
  transform: scale(1.1);
}

.os-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.8) 0%, rgba(255, 69, 0, 0.6) 100%);
  cursor: pointer;
  box-shadow:
    0 0 15px rgba(255, 107, 53, 0.6),
    inset 0 0 10px rgba(255, 107, 53, 0.3);
  border: 2px solid rgba(255, 107, 53, 0.5);
  transition: all 0.2s ease;
}

.os-slider::-moz-range-thumb:hover {
  box-shadow:
    0 0 20px rgba(255, 107, 53, 0.8),
    inset 0 0 15px rgba(255, 107, 53, 0.4);
  transform: scale(1.1);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.6) 0%, rgba(255, 69, 0, 0.4) 100%);
  border-radius: 10px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  box-shadow:
    0 0 10px rgba(255, 107, 53, 0.4),
    inset 0 0 10px rgba(255, 107, 53, 0.2);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.8) 0%, rgba(255, 69, 0, 0.6) 100%);
  box-shadow:
    0 0 15px rgba(255, 107, 53, 0.6),
    inset 0 0 15px rgba(255, 107, 53, 0.3);
}

/* Responsive - Mobile */
@media (max-width: 768px) {
  /* Simplify grid overlay */
  .grid-overlay {
    background-size: 30px 30px;
  }

  /* Ensure body and root are visible */
  body, html, #root, #os-container {
    min-height: 100vh;
    min-height: -webkit-fill-available;
  }

  /* Logo mobile */
  .slushboyz-logo {
    top: 30px;
    bottom: auto;
    right: 35px;
    left: auto;
  }

  .slushboyz-logo img {
    height: 52px;
  }

  /* Countdown text mobile */
  .countdown-text {
    top: 20px;
    left: 20px;
    font-size: 11px;
    line-height: 12px;
  }

  /* Reset globe button mobile */
  .reset-globe-btn {
    top: 65px;
    left: 20px;
    font-size: 9px;
    padding: 5px 14px;
  }

  /* Sound FX toggle button mobile */
  .sound-fx-toggle-btn {
    top: 100px;
    left: 20px;
    width: 36px;
    height: 36px;
  }

  .sound-fx-toggle-btn .speaker-icon {
    width: 18px;
    height: 18px;
  }

  /* Status text mobile */
  .status-text {
    bottom: 240px;
    left: 20px;
    font-size: 11px;
    line-height: 12px;
  }

  /* Earth globe mobile - move up 50px */
  #earthGlobe {
    top: calc(50% - 50px);
  }

  /* Adjust rotating hand size and position */
  .rotating-hand {
    top: calc(50% - 50px);
  }

  .rotating-hand img {
    width: 180px;
  }

  /* Audio visualizer mobile */
  .audio-visualizer {
    height: 160px;
    gap: 0;
  }

  /* Chat input mobile - ensure fully visible */
  .chat-input-container {
    bottom: 180px;
    width: 92%;
  }

  .chat-input-row {
    flex-direction: column-reverse;
    gap: 0;
  }

  .os-input {
    padding: 18px 24px;
    padding-right: 24px;
    font-size: 16px; /* Prevent zoom on iOS */
    width: 100%;
  }

  .os-btn {
    padding: 14px 40px;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -0.025em;
    margin-bottom: 15px;
    align-self: flex-end;
    width: auto;
    position: static;
    transform: none;
  }
}

/* Responsive - Small Mobile */
@media (max-width: 480px) {
  .slushboyz-logo {
    top: 25px;
    bottom: auto;
    right: 30px;
    left: auto;
  }

  .slushboyz-logo img {
    height: 44px;
  }

  .countdown-text {
    top: 15px;
    left: 15px;
    font-size: 10px;
    line-height: 11px;
  }

  .reset-globe-btn {
    top: 58px;
    left: 15px;
    font-size: 8px;
    padding: 4px 12px;
  }

  .status-text {
    font-size: 10px;
    bottom: 220px;
    left: 15px;
    line-height: 11px;
  }

  /* Earth globe mobile - move up 50px */
  #earthGlobe {
    top: calc(50% - 50px);
  }

  .rotating-hand {
    top: calc(50% - 50px);
  }

  .rotating-hand img {
    width: 150px;
  }

  /* Audio visualizer small mobile */
  .audio-visualizer {
    height: 140px;
    gap: 0;
  }

  .chat-input-container {
    bottom: 160px;
    width: 94%;
  }

  .chat-input-row {
    flex-direction: column-reverse;
    gap: 0;
  }

  .os-input {
    padding: 16px 20px;
    padding-right: 20px;
    font-size: 16px;
    width: 100%;
  }

  .os-btn {
    padding: 12px 35px;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.025em;
    margin-bottom: 12px;
    align-self: flex-end;
    width: auto;
    position: static;
    transform: none;
  }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Accessibility - Focus Styles */
.os-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(247, 68, 8, 0.5),
    inset 0 0 60px rgba(247, 68, 8, 0.3),
    inset 0 0 30px rgba(247, 68, 8, 0.2);
}

.os-input:focus-visible {
  outline: none;
  box-shadow: none;
}

/* Full-Screen Glitch Effect */
@keyframes glitch-anim-1 {
  0% {
    clip-path: inset(40% 0 61% 0);
    transform: translate(0) skew(0deg);
  }
  10% {
    clip-path: inset(15% 0 70% 0);
    transform: translate(-15px, 10px) skew(2deg);
  }
  20% {
    clip-path: inset(92% 0 1% 0);
    transform: translate(-20px, 5px) skew(-3deg);
  }
  30% {
    clip-path: inset(5% 0 85% 0);
    transform: translate(18px, -8px) skew(1deg);
  }
  40% {
    clip-path: inset(43% 0 1% 0);
    transform: translate(15px, -15px) skew(-2deg);
  }
  50% {
    clip-path: inset(78% 0 12% 0);
    transform: translate(-12px, 12px) skew(3deg);
  }
  60% {
    clip-path: inset(25% 0 58% 0);
    transform: translate(-18px, -10px) skew(-1deg);
  }
  70% {
    clip-path: inset(60% 0 25% 0);
    transform: translate(20px, 8px) skew(2deg);
  }
  80% {
    clip-path: inset(54% 0 7% 0);
    transform: translate(12px, 15px) skew(-3deg);
  }
  90% {
    clip-path: inset(8% 0 88% 0);
    transform: translate(-10px, -12px) skew(1deg);
  }
  100% {
    clip-path: inset(58% 0 43% 0);
    transform: translate(0) skew(0deg);
  }
}

@keyframes glitch-anim-2 {
  0% {
    clip-path: inset(65% 0 31% 0);
    transform: translate(0) skew(0deg);
  }
  10% {
    clip-path: inset(30% 0 55% 0);
    transform: translate(12px, -15px) skew(-2deg);
  }
  20% {
    clip-path: inset(44% 0 26% 0);
    transform: translate(18px, -10px) skew(3deg);
  }
  30% {
    clip-path: inset(88% 0 5% 0);
    transform: translate(-15px, 12px) skew(-1deg);
  }
  40% {
    clip-path: inset(13% 0 80% 0);
    transform: translate(-20px, 8px) skew(2deg);
  }
  50% {
    clip-path: inset(50% 0 40% 0);
    transform: translate(15px, 18px) skew(-3deg);
  }
  60% {
    clip-path: inset(80% 0 15% 0);
    transform: translate(10px, 10px) skew(1deg);
  }
  70% {
    clip-path: inset(20% 0 70% 0);
    transform: translate(-18px, -15px) skew(2deg);
  }
  80% {
    clip-path: inset(12% 0 71% 0);
    transform: translate(-12px, -8px) skew(-2deg);
  }
  90% {
    clip-path: inset(70% 0 18% 0);
    transform: translate(20px, -12px) skew(3deg);
  }
  100% {
    clip-path: inset(76% 0 20% 0);
    transform: translate(0) skew(0deg);
  }
}

@keyframes glitch-anim-flash {
  0%, 100% {
    opacity: 1;
    filter: none;
  }
  10% {
    opacity: 0.9;
    filter: hue-rotate(90deg);
  }
  20% {
    opacity: 1;
    filter: none;
  }
  30% {
    opacity: 0.85;
    filter: hue-rotate(-90deg);
  }
  40% {
    opacity: 1;
    filter: none;
  }
  50% {
    opacity: 0.95;
    filter: invert(0.1);
  }
  60% {
    opacity: 1;
    filter: none;
  }
  70% {
    opacity: 0.9;
    filter: hue-rotate(45deg);
  }
  80% {
    opacity: 1;
    filter: none;
  }
}

@keyframes glitch-rgb-split {
  0% {
    text-shadow:
      0.05em 0 0 rgba(255, 0, 0, 0.75),
      -0.025em -0.05em 0 rgba(0, 255, 0, 0.75),
      0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
  }
  14% {
    text-shadow:
      0.05em 0 0 rgba(255, 0, 0, 0.75),
      -0.025em -0.05em 0 rgba(0, 255, 0, 0.75),
      0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
  }
  15% {
    text-shadow:
      -0.05em -0.025em 0 rgba(255, 0, 0, 0.75),
      0.025em 0.025em 0 rgba(0, 255, 0, 0.75),
      -0.05em -0.05em 0 rgba(0, 0, 255, 0.75);
  }
  49% {
    text-shadow:
      -0.05em -0.025em 0 rgba(255, 0, 0, 0.75),
      0.025em 0.025em 0 rgba(0, 255, 0, 0.75),
      -0.05em -0.05em 0 rgba(0, 0, 255, 0.75);
  }
  50% {
    text-shadow:
      0.025em 0.05em 0 rgba(255, 0, 0, 0.75),
      0.05em 0 0 rgba(0, 255, 0, 0.75),
      0 -0.05em 0 rgba(0, 0, 255, 0.75);
  }
  99% {
    text-shadow:
      0.025em 0.05em 0 rgba(255, 0, 0, 0.75),
      0.05em 0 0 rgba(0, 255, 0, 0.75),
      0 -0.05em 0 rgba(0, 0, 255, 0.75);
  }
  100% {
    text-shadow: none;
  }
}

body.glitching::before,
body.glitching::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: inherit;
  z-index: 9999;
  pointer-events: none;
}

body.glitching::before {
  animation: glitch-anim-1 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
  background: var(--bg-gradient);
  mix-blend-mode: screen;
  opacity: 0.9;
  box-shadow: -5px 0 0 rgba(255, 0, 0, 0.5);
}

body.glitching::after {
  animation: glitch-anim-2 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) reverse both infinite;
  background: var(--bg-gradient);
  mix-blend-mode: screen;
  opacity: 0.9;
  box-shadow: 5px 0 0 rgba(247, 68, 8, 0.5);
}

body.glitching {
  animation: glitch-anim-flash 0.3s steps(1, end) infinite;
}

body.glitching * {
  animation: glitch-rgb-split 0.3s steps(1, end) infinite;
}

/* Fuel Gauge */
.fuel-gauge-container {
  position: absolute;
  top: 165px;
  left: 30px;
  z-index: 100;
  width: 40px;
  height: 200px;
}

.fuel-gauge {
  position: relative;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid var(--primary);
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    inset 0 0 20px rgba(247, 68, 8, 0.3),
    0 0 15px rgba(247, 68, 8, 0.4);
}

.fuel-liquid {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg,
    #f74407 0%,
    #f74407 75%,
    rgba(247, 68, 7, 0.95) 80%,
    rgba(247, 68, 7, 0.85) 85%,
    rgba(247, 68, 7, 0.6) 90%,
    rgba(247, 68, 7, 0.3) 95%,
    rgba(247, 68, 7, 0) 100%);
  transform-origin: bottom;
  transition: transform 1s ease-out;
  overflow: hidden;
  animation: fuelSlosh 8s ease-in-out infinite;
}

.fuel-liquid::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at center,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0.1) 30%,
    transparent 70%);
  animation: fuelWave 3s ease-in-out infinite;
}

.fuel-liquid::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom,
    rgba(255, 255, 255, 0.2) 0%,
    transparent 50%,
    rgba(0, 0, 0, 0.2) 100%);
}

@keyframes fuelWave {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(-10%, 5%) rotate(1deg);
  }
  50% {
    transform: translate(0, -5%) rotate(0deg);
  }
  75% {
    transform: translate(10%, 5%) rotate(-1deg);
  }
}

@keyframes fuelSlosh {
  0%, 100% {
    clip-path: polygon(
      0% 100%,
      0% 2.5%,
      10% 0.5%,
      20% 2%,
      30% 3.2%,
      40% 2.5%,
      50% 0.5%,
      60% 2%,
      70% 3%,
      80% 1.8%,
      90% 0.5%,
      100% 2.5%,
      100% 100%
    );
  }
  25% {
    clip-path: polygon(
      0% 100%,
      0% 0.5%,
      10% 2.8%,
      20% 4.8%,
      30% 4%,
      40% 2.8%,
      50% 3.5%,
      60% 4.5%,
      70% 3.8%,
      80% 2.8%,
      90% 3.2%,
      100% 2%,
      100% 100%
    );
  }
  50% {
    clip-path: polygon(
      0% 100%,
      0% 2.2%,
      10% 0.5%,
      20% 3.2%,
      30% 4%,
      40% 3%,
      50% 2.2%,
      60% 3%,
      70% 4%,
      80% 3.2%,
      90% 2.2%,
      100% 3%,
      100% 100%
    );
  }
  75% {
    clip-path: polygon(
      0% 100%,
      0% 3.2%,
      10% 4%,
      20% 2.2%,
      30% 0.5%,
      40% 2.2%,
      50% 3%,
      60% 1.8%,
      70% 0.5%,
      80% 2.5%,
      90% 3.2%,
      100% 2.2%,
      100% 100%
    );
  }
}

.fuel-gauge-label {
  position: absolute;
  top: 50%;
  left: calc(50% + 30px);
  transform: translate(-50%, -50%) rotate(-90deg);
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: #f74407;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(247, 68, 7, 0.8);
  z-index: 10;
  pointer-events: none;
  mix-blend-mode: normal;
  white-space: nowrap;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
  .fuel-gauge-container {
    top: 145px;
    left: 25px;
    width: 36px;
    height: 180px;
  }

  .fuel-gauge-label {
    font-size: 9px;
  }
}

@media (max-width: 480px) {
  .fuel-gauge-container {
    top: 145px;
    left: 20px;
    width: 30px;
    height: 150px;
  }

  .fuel-gauge-label {
    font-size: 8px;
  }
}
