/* ============================================================
   HAGtech Gateway — plain CSS (no Tailwind, no build step)
   Ported straight from the original src/styles.css design.
   Colors are the neon-green CRT terminal look.
   ============================================================ */

:root {
  --glow: 0 0 6px #39ff14, 0 0 14px #39ff14, 0 0 28px rgba(57, 255, 20, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  height: 100%;
  margin: 0;
  background: #000;
  color: #39ff14;
}

body {
  font-family: "VT323", "Courier New", monospace;
  overflow: hidden;
}

/* ===== Shared screen / CRT effects ===== */
.terminal-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, #021a02 0%, #000 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scanlines {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.25) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  z-index: 100;
}

.terminal-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.7) 100%);
  pointer-events: none;
  z-index: 99;
}

/* ===== Hero text (the "HAGtech" intro) ===== */
.terminal-text {
  background: transparent;
  border: none;
  color: #39ff14;
  font-family: "Press Start 2P", "VT323", monospace;
  font-size: clamp(1.8rem, 6vw, 4.5rem);
  letter-spacing: 0.05em;
  text-shadow: var(--glow);
  padding: 1rem 2rem;
  user-select: none;
  white-space: normal;
  text-align: center;
  max-width: 90vw;
  z-index: 10;
  position: relative;
}
.terminal-text:hover {
  filter: brightness(1.3);
}

.cursor {
  display: inline-block;
  margin-left: 0.1em;
  animation: blink 1s steps(1) infinite;
}
.cursor.blink-slow {
  animation: blink 0.6s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ===== CAVE ===== */
.cave {
  background: radial-gradient(ellipse at center, #001500 0%, #000 80%);
}

.cave-intro {
  position: absolute;
  top: 6vh;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Press Start 2P", monospace;
  font-size: clamp(0.9rem, 1.6vw, 1.4rem);
  color: #39ff14;
  text-shadow: var(--glow);
  text-align: center;
  z-index: 20;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.circle-wrap {
  position: relative;
  width: 700px;
  height: 700px;
  z-index: 10;
  animation: fadein 0.7s ease-out;
}
@keyframes fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.circle-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 220px;
  height: 220px;
  border: 2px solid #39ff14;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow), inset 0 0 20px rgba(57, 255, 20, 0.3);
  background: rgba(0, 30, 0, 0.4);
  animation: pulse 1.8s ease-in-out infinite;
  cursor: pointer;
  padding: 0;
  font: inherit;
  color: inherit;
  overflow: hidden;
}
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 6px #39ff14, 0 0 14px #39ff14, inset 0 0 20px rgba(57, 255, 20, 0.3);
  }
  50% {
    box-shadow: 0 0 14px #39ff14, 0 0 40px #39ff14, inset 0 0 35px rgba(57, 255, 20, 0.5);
  }
}

.face-flash-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 50%;
}
.face-flash {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  animation: face-pop 0.28s ease-out forwards;
}
@keyframes face-pop {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.hag-glyph {
  font-size: 5rem;
  text-shadow: var(--glow);
  line-height: 1;
}
.hag-label {
  font-family: "Press Start 2P", monospace;
  font-size: 1.4rem;
  margin-top: 0.5rem;
  text-shadow: var(--glow);
  letter-spacing: 0.1em;
}
.hag-sub {
  font-size: 1rem;
  opacity: 0.7;
  margin-top: 0.25rem;
  font-family: "VT323", monospace;
}

.egg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #39ff14;
  transition: filter 0.2s;
}
.egg::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(57, 255, 20, 0.4);
  border-radius: 50%;
  background: rgba(0, 20, 0, 0.6);
  box-shadow: 0 0 8px rgba(57, 255, 20, 0.4), inset 0 0 8px rgba(57, 255, 20, 0.2);
  transition: all 0.2s;
}
.egg:hover::before {
  border-color: #39ff14;
  box-shadow: var(--glow), inset 0 0 15px rgba(57, 255, 20, 0.5);
  transform: scale(1.15);
}
.egg-symbol {
  font-size: 2rem;
  text-shadow: var(--glow);
  z-index: 2;
}
.egg-label {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  font-family: "Press Start 2P", monospace;
  font-size: 0.65rem;
  white-space: nowrap;
  color: #39ff14;
  text-shadow: var(--glow);
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #39ff14;
  padding: 4px 8px;
  letter-spacing: 0.05em;
  z-index: 50;
}
.egg-soon {
  opacity: 0.6;
}

.cave-footer {
  position: absolute;
  bottom: 4vh;
  left: 50%;
  transform: translateX(-50%);
  font-family: "VT323", monospace;
  font-size: 1.1rem;
  color: #39ff14;
  opacity: 0.7;
  text-shadow: 0 0 4px #39ff14;
  z-index: 20;
  letter-spacing: 0.1em;
  animation: fadein 1.4s ease-out;
  text-align: center;
}

.restart-btn {
  position: absolute;
  top: 3vh;
  right: 3vh;
  z-index: 50;
  background: transparent;
  border: 1px solid #39ff14;
  color: #39ff14;
  font-family: "Press Start 2P", monospace;
  font-size: 0.6rem;
  padding: 0.5rem 0.75rem;
  text-shadow: var(--glow);
  box-shadow: 0 0 6px rgba(57, 255, 20, 0.3);
  cursor: pointer;
  letter-spacing: 0.08em;
  transition: all 0.2s;
}
.restart-btn:hover {
  background: rgba(57, 255, 20, 0.15);
  box-shadow: var(--glow);
  transform: scale(1.05);
}

/* ===== WET RADIO ===== */
.wr-screen {
  position: fixed;
  inset: 0;
  background: #000;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wr-slide {
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  z-index: 5;
  animation: wr-fade-in 0.5s ease-out;
}
@keyframes wr-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.wr-fade-out {
  animation: wr-fade-away 3s ease-in forwards;
}
@keyframes wr-fade-away {
  to {
    opacity: 0;
    filter: blur(8px);
  }
}

.wr-controls {
  position: absolute;
  bottom: 2vh;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 30;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #39ff14;
  padding: 0.5rem 1rem;
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.4);
}
.wr-btn {
  background: transparent;
  border: 1px solid #39ff14;
  color: #39ff14;
  font-family: "Press Start 2P", monospace;
  font-size: 0.6rem;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  letter-spacing: 0.08em;
  text-shadow: var(--glow);
}
.wr-btn:hover:not(:disabled) {
  background: rgba(57, 255, 20, 0.2);
}
.wr-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.wr-count {
  font-family: "Press Start 2P", monospace;
  font-size: 0.6rem;
  color: #39ff14;
  text-shadow: var(--glow);
}
.wr-cue {
  position: absolute;
  top: 3vh;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Press Start 2P", monospace;
  font-size: 0.8rem;
  color: #39ff14;
  text-shadow: var(--glow);
  background: rgba(0, 0, 0, 0.7);
  padding: 0.6rem 1rem;
  border: 1px solid #39ff14;
  z-index: 30;
  animation: wr-pulse 1s ease-in-out infinite;
  white-space: nowrap;
}
@keyframes wr-pulse {
  50% {
    opacity: 0.4;
    transform: translateX(-50%) scale(1.05);
  }
}

/* Swirling alchemical symbols */
.wr-swirl-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}
.wr-symbol {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 2.5rem;
  color: #39ff14;
  text-shadow: var(--glow);
  transform-origin: 0 0;
  animation: wr-swirl 3.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}
@keyframes wr-swirl {
  0% {
    transform: rotate(var(--a)) translateX(0) rotate(calc(-1 * var(--a))) scale(0);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: rotate(calc(var(--a) + 540deg)) translateX(var(--r))
      rotate(calc(-1 * (var(--a) + 540deg))) scale(1.4);
    opacity: 0;
  }
}

/* Flames */
.wr-flames {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  z-index: 40;
  background: radial-gradient(ellipse at 15% 100%, #ff5a00 0%, transparent 55%),
    radial-gradient(ellipse at 40% 100%, #ffae00 0%, transparent 50%),
    radial-gradient(ellipse at 65% 100%, #ff2200 0%, transparent 60%),
    radial-gradient(ellipse at 90% 100%, #ffcc00 0%, transparent 50%),
    linear-gradient(to top, #1a0000 0%, transparent 100%);
  filter: blur(6px);
  animation: wr-flames 3.4s ease-in-out forwards;
}
@keyframes wr-flames {
  0% {
    height: 0;
    opacity: 0.9;
  }
  35% {
    height: 110vh;
    opacity: 1;
  }
  65% {
    height: 110vh;
    opacity: 1;
  }
  100% {
    height: 0;
    opacity: 0;
  }
}
