/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --green: #00ff41;
  --green-dim: #00cc33;
  --green-dark: #00802080;
  --green-glow: 0 0 10px #00ff4180, 0 0 20px #00ff4140, 0 0 40px #00ff4120;
  --red: #ff0040;
  --red-glow: 0 0 10px #ff004080, 0 0 20px #ff004040;
  --cyan: #00d4ff;
  --cyan-glow: 0 0 10px #00d4ff80;
  --bg: #0a0a0a;
  --bg-panel: #0d1117;
  --bg-panel-alt: #111820;
  --border: #1a2332;
  --text: #b0b0b0;
  --font-mono: 'JetBrains Mono', 'Share Tech Mono', 'Courier New', monospace;
}

html {
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--green);
  font-family: var(--font-mono);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ===== GRID BACKGROUND (CSS-only, zero CPU) ===== */
.cyber-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(0, 255, 65, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 65, 0.03) 1px, transparent 1px),
    linear-gradient(rgba(0, 255, 65, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 65, 0.015) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
  animation: grid-drift 20s linear infinite;
}

@keyframes grid-drift {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(100px, 100px);
  }
}

/* ===== SCANLINE OVERLAY ===== */
.scanline {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(0deg,
      transparent,
      transparent 2px,
      rgba(0, 255, 65, 0.015) 2px,
      rgba(0, 255, 65, 0.015) 4px);
}

/* ===== CONTAINER ===== */
.container {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== HEADER ===== */
.header {
  text-align: center;
  margin-bottom: 2rem;
}

/* Glitch effect */
.glitch {
  font-size: 3rem;
  font-weight: 700;
  text-transform: uppercase;
  position: relative;
  text-shadow: var(--green-glow);
  animation: flicker 4s infinite;
  letter-spacing: 4px;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch::before {
  color: var(--cyan);
  animation: glitch-1 2s infinite linear alternate-reverse;
  clip-path: inset(0 0 65% 0);
}

.glitch::after {
  color: var(--red);
  animation: glitch-2 3s infinite linear alternate-reverse;
  clip-path: inset(60% 0 0 0);
}

@keyframes glitch-1 {

  0%,
  100% {
    transform: translate(0);
  }

  20% {
    transform: translate(-3px, 3px);
  }

  40% {
    transform: translate(3px, -2px);
  }

  60% {
    transform: translate(-2px, 1px);
  }

  80% {
    transform: translate(1px, -3px);
  }
}

@keyframes glitch-2 {

  0%,
  100% {
    transform: translate(0);
  }

  20% {
    transform: translate(3px, -1px);
  }

  40% {
    transform: translate(-2px, 3px);
  }

  60% {
    transform: translate(1px, -2px);
  }

  80% {
    transform: translate(-3px, 2px);
  }
}

@keyframes flicker {

  0%,
  100% {
    opacity: 1;
  }

  92% {
    opacity: 1;
  }

  93% {
    opacity: 0.8;
  }

  94% {
    opacity: 1;
  }

  96% {
    opacity: 0.6;
  }

  97% {
    opacity: 1;
  }
}

.subtitle {
  color: var(--text);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  opacity: 0.7;
}

.online-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.4rem 1rem;
  border: 1px solid var(--green-dim);
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--green);
  text-shadow: var(--green-glow);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
  box-shadow: var(--green-glow);
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.3);
  }
}

/* ===== TIMER ===== */
.timer-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 1.2rem;
  gap: 0.3rem;
}

.timer-label {
  font-size: 0.7rem;
  color: var(--text);
  letter-spacing: 3px;
  opacity: 0.6;
}

.timer-value {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--cyan);
  text-shadow: var(--cyan-glow);
  letter-spacing: 4px;
  font-variant-numeric: tabular-nums;
}

.timer-value.stopped {
  color: var(--green);
  text-shadow: var(--green-glow);
  animation: glow-pulse 2s infinite;
}

/* ===== MAIN GRID ===== */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  flex: 1;
}

/* ===== PANELS ===== */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-header {
  background: var(--bg-panel-alt);
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--green-dim);
  letter-spacing: 1px;
}

.terminal-prompt {
  color: var(--cyan);
  font-weight: 700;
}

.blink {
  color: var(--red);
  animation: blink 1s infinite;
  margin-left: auto;
}

@keyframes blink {

  0%,
  50% {
    opacity: 1;
  }

  51%,
  100% {
    opacity: 0;
  }
}

.panel-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ===== INPUT PANEL ===== */
.input-group {
  margin-bottom: 1.25rem;
}

.input-group label {
  display: block;
  font-size: 0.7rem;
  color: var(--green-dim);
  margin-bottom: 0.4rem;
  letter-spacing: 2px;
}

.input-group input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: #050a10;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  letter-spacing: 2px;
}

.input-group input:focus {
  border-color: var(--green);
  box-shadow: var(--green-glow);
}

.input-group input::placeholder {
  color: #2a3a4a;
  letter-spacing: 1px;
}

/* ===== UNLOCK BUTTON ===== */
.unlock-btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #001a00, #003300);
  border: 2px solid var(--green);
  border-radius: 6px;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.3s;
  text-shadow: var(--green-glow);
  position: relative;
  overflow: hidden;
}

.unlock-btn:hover {
  background: linear-gradient(135deg, #002200, #004400);
  box-shadow: var(--green-glow), inset 0 0 30px #00ff4110;
  transform: translateY(-2px);
}

.unlock-btn:active {
  transform: translateY(0);
}

.unlock-btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

/* ===== RESULT ===== */
.result {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 2px;
  transition: all 0.3s;
}

.result.hidden {
  display: none;
}

.result.denied {
  background: #1a0000;
  border: 1px solid var(--red);
  color: var(--red);
  text-shadow: var(--red-glow);
  animation: shake 0.5s;
}

.result.granted {
  background: #001a00;
  border: 1px solid var(--green);
  color: var(--green);
  text-shadow: var(--green-glow);
  animation: glow-pulse 0.8s ease-in-out;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }

  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}

@keyframes glow-pulse {
  0% {
    box-shadow: none;
  }

  50% {
    box-shadow: 0 0 30px #00ff4140, inset 0 0 30px #00ff4120;
  }

  100% {
    box-shadow: var(--green-glow);
  }
}

/* ===== LIVE FEED ===== */
.feed-body {
  padding: 0;
  overflow: hidden;
}

.live-feed {
  overflow-y: auto;
  max-height: 450px;
  padding: 0.5rem;
}

.live-feed::-webkit-scrollbar {
  width: 4px;
}

.live-feed::-webkit-scrollbar-track {
  background: var(--bg-panel);
}

.live-feed::-webkit-scrollbar-thumb {
  background: var(--green-dark);
  border-radius: 2px;
}

.feed-empty {
  color: #2a3a4a;
  text-align: center;
  padding: 3rem 1rem;
  font-size: 0.85rem;
}

.feed-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #0d1520;
  font-size: 0.78rem;
  animation: feed-in 0.3s ease-out;
  transition: background 0.2s;
}

.feed-item:hover {
  background: #0d151f;
}

.feed-item.success {
  background: #001a0020;
  border-left: 3px solid var(--green);
}

.feed-item.fail {
  border-left: 3px solid transparent;
}

@keyframes feed-in {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.feed-time {
  color: #3a4a5a;
  font-size: 0.7rem;
  white-space: nowrap;
}

.feed-nick {
  color: var(--cyan);
  font-weight: 700;
  min-width: 80px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-arrow {
  color: #3a4a5a;
}

.feed-pass {
  color: var(--text);
  font-weight: 400;
}

.feed-status {
  margin-left: auto;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 1px;
}

.feed-status.ok {
  color: var(--green);
  text-shadow: var(--green-glow);
}

.feed-status.fail {
  color: var(--red);
  opacity: 0.6;
}

/* ===== SUCCESS OVERLAY ===== */
.success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: overlay-in 0.5s ease-out;
}

.success-overlay.hidden {
  display: none;
}

@keyframes overlay-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.success-content {
  text-align: center;
  padding: 3rem;
}

.success-glitch {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--green);
  text-shadow: var(--green-glow);
  animation: flicker 2s infinite, glitch-1 1s infinite;
  letter-spacing: 6px;
  position: relative;
}

.success-glitch::before,
.success-glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

.success-glitch::before {
  color: var(--cyan);
  animation: glitch-1 0.5s infinite linear alternate-reverse;
  clip-path: inset(0 0 65% 0);
}

.success-glitch::after {
  color: var(--red);
  animation: glitch-2 0.7s infinite linear alternate-reverse;
  clip-path: inset(60% 0 0 0);
}

.success-sub {
  color: var(--green);
  font-size: 1.2rem;
  margin-top: 1.5rem;
}

.success-cracker {
  color: var(--cyan);
  font-size: 1rem;
  margin-top: 0.75rem;
  letter-spacing: 2px;
}

.success-time {
  color: var(--green);
  font-size: 1.4rem;
  margin-top: 0.75rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-shadow: var(--green-glow);
}

.close-overlay-btn {
  margin-top: 2rem;
  padding: 0.75rem 2rem;
  background: transparent;
  border: 1px solid var(--green);
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 2px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s;
}

.close-overlay-btn:hover {
  background: #001a00;
  box-shadow: var(--green-glow);
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 1.5rem 0 0.5rem;
  font-size: 0.7rem;
  color: #2a3a4a;
  letter-spacing: 1px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .glitch {
    font-size: 1.8rem;
    letter-spacing: 2px;
  }

  .main-grid {
    grid-template-columns: 1fr;
  }

  .live-feed {
    max-height: 300px;
  }

  .success-glitch {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 1rem;
  }

  .glitch {
    font-size: 1.4rem;
  }
}