:root {
  --bg-dark: #020608;
  --text-dark: #cbd5e1;
  
  --green-primary: #00ff66;
  --green-glow: rgba(0, 255, 102, 0.4);
  --green-border: rgba(0, 255, 102, 0.2);

  --white-bg: #f8fafc;
  --white-text: #0f172a;
  --white-primary: #0f172a;
  --white-border: rgba(15, 23, 42, 0.2);
  --white-glow: rgba(15, 23, 42, 0.1);

  --red-bg: #1c0508;
  --red-text: #fff;
  --red-primary: #ff3344;
  --red-border: rgba(255, 51, 68, 0.3);
  --red-glow: rgba(255, 51, 68, 0.6);

  --font-mono: 'Fira Code', monospace;
  --font-sans: 'Outfit', sans-serif;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.2s ease;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-dark);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#download-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #2563eb;
  color: #fff;
  padding: 15px 20px;
  z-index: 200;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
}
#download-banner.active {
  transform: translateY(0);
}
.download-content {
  display: flex;
  align-items: center;
  gap: 15px;
  max-width: 600px;
  margin: 0 auto;
}
.download-icon {
  font-size: 1.5rem;
  animation: bounce 1s infinite;
}
.download-text {
  font-family: var(--font-mono);
  font-weight: 700;
  flex-grow: 1;
}
.download-progress-bar {
  width: 150px;
  height: 8px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  overflow: hidden;
}
.download-progress-fill {
  width: 0%;
  height: 100%;
  background: #fff;
  transition: width 1s linear;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

#matrix-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  opacity: 0.85;
  transition: opacity 1.5s ease-out;
}

body.theme-white #matrix-canvas {
  filter: invert(1) opacity(0.2);
}

.ambient-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(circle at 50% 50%, rgba(0, 255, 102, 0.04), transparent 70%);
  transition: background 1.5s ease;
}

body.theme-white .ambient-glow {
  background: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.02), transparent 75%);
}

body.theme-red .ambient-glow {
  background: radial-gradient(circle at 50% 50%, rgba(255, 51, 68, 0.15), transparent 60%);
}

#app-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 620px;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.terminal-window {
  background: rgba(2, 8, 5, 0.85);
  border: 1px solid var(--green-border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85), 0 0 25px var(--green-glow);
  border-radius: 12px;
  width: 100%;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
  position: relative;
  transition: var(--transition-smooth);
  animation: modalEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.window-header {
  background: rgba(0, 0, 0, 0.4);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(0, 255, 102, 0.1);
  position: relative;
  z-index: 5;
}

.window-dots {
  display: flex;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.window-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #8892b0;
  letter-spacing: 1px;
  white-space: nowrap;
}

.window-body {
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  min-height: 250px;
}

.warning-icon {
  width: 60px;
  height: 60px;
  color: #ff3344;
  filter: drop-shadow(0 0 8px rgba(255, 51, 68, 0.5));
  margin-bottom: 20px;
  animation: pulseAlert 2s infinite ease-in-out;
}

.warning-title {
  font-family: var(--font-mono);
  color: #ff3344;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 4px;
  margin-bottom: 15px;
}

.warning-text {
  font-family: var(--font-mono);
  color: #e2e8f0;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 30px;
  max-width: 440px;
}

.terminal-btn {
  background: transparent;
  border: 1px solid var(--green-primary);
  color: var(--green-primary);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 2px;
  padding: 12px 36px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  transition: var(--transition-smooth);
}

.terminal-btn:hover {
  background: var(--green-primary);
  color: #030708;
  box-shadow: 0 0 20px var(--green-primary);
  transform: translateY(-2px);
}

.terminal-window.theme-white {
  background: rgba(248, 250, 252, 0.95);
  border-color: var(--white-border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 30px rgba(0,0,0,0.05);
}
.terminal-window.theme-white .window-header {
  background: rgba(226, 232, 240, 0.8);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.terminal-window.theme-white .window-title {
  color: #475569;
}
.terminal-window.theme-white #code-output {
  color: #0f172a;
}
.terminal-window.theme-white .code-keyword { color: #d97706; }
.terminal-window.theme-white .code-function { color: #2563eb; }
.terminal-window.theme-white .code-string { color: #16a34a; }
.terminal-window.theme-white .code-comment { color: #94a3b8; }
.terminal-window.theme-white .code-symbol { color: #7c3aed; }
.terminal-window.theme-white .code-number { color: #ea580c; }
.terminal-window.theme-white #code-output::after { color: #000; }

.terminal-window.theme-red {
  background: rgba(28, 5, 8, 0.9);
  border-color: var(--red-primary);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.7), 0 0 25px var(--red-glow);
}
.terminal-window.theme-red .window-header {
  background: rgba(18, 2, 4, 0.8);
  border-bottom: 1px solid var(--red-primary);
}
.terminal-window.theme-red .window-title {
  color: #fda4af;
}
.terminal-window.theme-red #code-output {
  color: #fff;
}
.terminal-window.theme-red #code-output::after {
  color: var(--red-primary);
}

.kali-logo-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50%;
  pointer-events: none;
  opacity: 0;
  z-index: 2;
  color: var(--red-primary);
  transition: opacity 1.5s ease-in-out;
}
.kali-logo-container.show {
  opacity: 0.08;
  animation: logoPulse 5s infinite alternate ease-in-out;
}

#terminal-container {
  height: 480px;
}

.code-body {
  align-items: flex-start;
  text-align: left;
  height: calc(100% - 41px);
  padding: 20px;
  overflow-y: auto;
  position: relative;
}

#code-output-container {
  height: 100%;
  overflow-y: auto;
  width: 100%;
}

#code-output {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #00ff66;
  white-space: pre-wrap;
  line-height: 1.5;
  z-index: 3;
  position: relative;
  width: 100%;
}

.code-keyword { color: #f43f5e; font-weight: 500; }
.code-function { color: #60a5fa; }
.code-string { color: #fbbf24; }
.code-comment { color: #4b5563; font-style: italic; }
.code-symbol { color: #c084fc; }
.code-number { color: #f97316; }

#code-output::after {
  content: "█";
  color: var(--green-primary);
  animation: cursorBlink 0.8s steps(2, start) infinite;
}

.terminal-popup-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  background: #030d07;
  border: 2px solid var(--green-primary);
  box-shadow: 0 0 20px var(--green-primary-glow);
  border-radius: 4px;
  z-index: 10;
  padding: 20px;
  text-align: center;
  animation: popupSlide 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.popup-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green-primary);
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.popup-divider {
  width: 100%;
  height: 1px;
  background: var(--green-primary);
  opacity: 0.3;
  margin-bottom: 15px;
}

.popup-message {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 20px;
  font-weight: bold;
}

.popup-btn {
  font-size: 0.9rem;
  padding: 8px 24px;
  border-radius: 4px;
  width: 100%;
}

.popup-btn:hover {
  background: var(--green-primary);
  color: #030d07;
}

.theme-white .terminal-btn {
  border-color: var(--white-primary);
  color: var(--white-primary);
}
.theme-white .terminal-btn:hover {
  background: var(--white-primary);
  color: #fff;
  box-shadow: 0 0 10px var(--white-glow);
}

.theme-red .terminal-btn {
  border-color: var(--red-primary);
  color: var(--red-primary);
}
.theme-red .terminal-btn:hover {
  background: var(--red-primary);
  color: #fff;
  box-shadow: 0 0 15px var(--red-primary);
}

#pixel-hands-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 50;
  background: rgba(2, 6, 8, 0.85);
  backdrop-filter: blur(12px);
  pointer-events: auto;
  overflow: hidden;
  transition: opacity 0.8s ease;
}

.pixel-hand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: top 1.2s cubic-bezier(0.25, 1, 0.5, 1), bottom 1.2s cubic-bezier(0.25, 1, 0.5, 1);
  z-index: 10;
}

.top-hand { top: -350px; }
.bottom-hand { bottom: -350px; flex-direction: column-reverse; }

#pixel-hands-overlay.active .top-hand { top: 8vh; }
#pixel-hands-overlay.active .bottom-hand { bottom: 8vh; }

.cyber-hand-svg {
  width: 140px;
  height: 140px;
  filter: drop-shadow(0 6px 15px rgba(0,0,0,0.8));
}
.top-hand .cyber-hand-svg { transform: scaleY(-1); }

.pill-button {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px;
  outline: none;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pill-button:hover { transform: scale(1.15); }

.pill-label {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 3px;
  text-shadow: 0 0 10px rgba(0,0,0,0.9);
}

.top-hand .pill-label { color: #f43f5e; order: 2; margin-top: 10px; margin-bottom: 0; }
.bottom-hand .pill-label { color: #3b82f6; order: 1; }

.pill-shape {
  width: 70px;
  height: 28px;
  border-radius: 14px;
  position: relative;
  box-shadow: 0 6px 16px rgba(0,0,0,0.8);
  border: 2px solid #0f172a;
}

.red-pill .pill-shape {
  background: linear-gradient(to right, #f43f5e 50%, #ffffff 50%);
  box-shadow: 0 0 25px rgba(244, 63, 94, 0.8);
}
.red-pill:hover .pill-shape { box-shadow: 0 0 40px rgba(244, 63, 94, 1); }

.blue-pill .pill-shape {
  background: linear-gradient(to right, #3b82f6 50%, #ffffff 50%);
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.8);
}
.blue-pill:hover .pill-shape { box-shadow: 0 0 40px rgba(59, 130, 246, 1); }

#crash-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #0000aa;
  z-index: 100;
  font-family: var(--font-mono);
  color: #fff;
  padding: 30px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#crash-scroller {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.15;
  font-size: 0.8rem;
  line-height: 1.3;
  overflow: hidden;
  padding: 10px;
  pointer-events: none;
}

.crash-dialog {
  background: #000088;
  border: 4px solid #fff;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  border-radius: 4px;
  z-index: 10;
  overflow: hidden;
}

.crash-header {
  background: #fff;
  color: #000088;
  font-weight: 700;
  padding: 8px 15px;
  font-size: 0.9rem;
}

.crash-body { padding: 25px; text-align: center; }
.crash-title {
  color: #ff5555;
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 15px;
  animation: pulseCrashTitle 1s infinite alternate steps(2);
}
.crash-text { font-size: 0.95rem; line-height: 1.5; margin-bottom: 25px; }

.crash-progress-bar {
  width: 100%;
  height: 16px;
  border: 2px solid #fff;
  background: #000;
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill { width: 0%; height: 100%; background: #ff5555; }

#shutdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 150;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: var(--font-mono);
  color: #333;
}
#shutdown-overlay.active { animation: screenTurnOff 0.5s ease-out forwards; }
.shutdown-text { font-size: 1rem; letter-spacing: 2px; opacity: 0.4; animation: textBlink 1s infinite; }

.final-choice-container {
  width: 100%;
  z-index: 10;
  position: relative;
  animation: modalEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.final-info-banner {
  background: rgba(255, 51, 68, 0.1);
  border-left: 4px solid var(--red-primary);
  padding: 15px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 20px;
  text-align: left;
}
.banner-tag { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700; color: var(--red-primary); letter-spacing: 1.5px; }
.banner-title { font-size: 1rem; font-weight: 600; color: #fff; margin-top: 5px; }

.action-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}
.action-buttons-full {
  display: grid;
  grid-template-columns: 1fr;
}

.action-card-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 15px;
  cursor: pointer;
  color: #cbd5e1;
  transition: var(--transition-fast);
  font-family: var(--font-sans);
}

.action-card-btn:hover {
  background: rgba(255, 51, 68, 0.08);
  border-color: var(--red-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(255, 51, 68, 0.15);
  color: #fff;
}

.highlight-btn {
  background: rgba(255, 51, 68, 0.1);
  border-color: var(--red-primary);
  color: #fff;
}
.highlight-btn:hover {
  background: rgba(255, 51, 68, 0.2);
}

.btn-label { font-size: 1rem; font-weight: 600; letter-spacing: 0.5px; }

.sub-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(18, 2, 4, 0.95);
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.panel-title {
  font-family: var(--font-mono);
  color: var(--red-primary);
  font-size: 1.5rem;
  margin: 15px 0;
  text-transform: uppercase;
}
.panel-content {
  flex-grow: 1;
  overflow-y: auto;
  text-align: left;
  padding: 0 15px 15px;
  margin-bottom: 15px;
}
.trait-block {
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 15px;
}
.trait-block h3 {
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 5px;
}
.trait-block p {
  color: #94a3b8;
  font-size: 0.9rem;
  line-height: 1.5;
}
.back-btn {
  margin: 0 15px 15px;
}

#post-terminal-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.85);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
.dialog-container {
  width: 90%;
  max-width: 500px;
  text-align: center;
}
.typing-text {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  line-height: 1.6;
  color: #fff;
  min-height: 100px;
}
.typing-text::after {
  content: "█";
  animation: cursorBlink 0.8s infinite;
}
#final-stage-buttons {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  animation: modalEntrance 0.5s ease forwards;
}
.final-btn {
  padding: 15px 30px;
  font-size: 1.1rem;
  width: 100%;
}
.danger-btn {
  border-color: #ef4444;
  color: #ef4444;
}
.danger-btn:hover {
  background: #ef4444;
  box-shadow: 0 0 20px #ef4444;
}
#final-joke-message {
  margin-top: 30px;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--green-primary);
  animation: slideUp 0.5s ease;
}

.hidden { display: none !important; opacity: 0; }
.fade-out { opacity: 0; transform: scale(0.96); pointer-events: none; }

@keyframes modalEntrance { from { opacity: 0; transform: translateY(20px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes popupSlide { from { opacity: 0; transform: translate(-50%, -30%); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulseAlert { 0%, 100% { transform: scale(1); opacity: 1; filter: drop-shadow(0 0 8px rgba(255, 51, 68, 0.5)); } 50% { transform: scale(1.04); opacity: 0.8; filter: drop-shadow(0 0 16px rgba(255, 51, 68, 0.7)); } }
@keyframes cursorBlink { 50% { opacity: 0; } }
@keyframes textBlink { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.8; } }
@keyframes logoPulse { 0%, 100% { opacity: 0.08; filter: drop-shadow(0 0 10px rgba(255, 51, 68, 0.3)); } 50% { opacity: 0.15; filter: drop-shadow(0 0 25px rgba(255, 51, 68, 0.7)); } }
@keyframes pulseCrashTitle { 0% { opacity: 1; } 100% { opacity: 0.3; } }
@keyframes screenTurnOff { 0% { transform: scaleY(1) scaleX(1); filter: brightness(1); } 50% { transform: scaleY(0.01) scaleX(1); filter: brightness(2); } 100% { transform: scaleY(0) scaleX(0); filter: brightness(0); } }

@media (max-width: 640px) {
  #app-container { padding: 10px; }
  .window-body { padding: 20px 15px; }
  .warning-title { font-size: 1.3rem; }
  .warning-text { font-size: 0.85rem; margin-bottom: 20px; }
  #terminal-container { height: 500px; }
  .action-buttons-grid { grid-template-columns: 1fr; gap: 10px; }
  .action-card-btn { padding: 12px; }
}
