@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Orbitron:wght@400;700;900&display=swap');

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

:root {
  --green: #00ff41;
  --green-dim: #00cc33;
  --green-dark: #009922;
  --green-glow: rgba(0, 255, 65, 0.3);
  --bg: #0a0a0a;
  --bg-light: #111;
  --bg-card: #141414;
  --red: #ff3333;
  --gold: #ffd700;
  --white: #e0e0e0;
}

body {
  background-color: var(--bg);
  color: var(--green);
  font-family: 'Share Tech Mono', monospace;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

.matrix-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.03;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 255, 65, 0.03) 2px,
      rgba(0, 255, 65, 0.03) 4px
    );
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 1;
}

h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  text-align: center;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 20px var(--green-glow), 0 0 40px var(--green-glow);
  letter-spacing: 2px;
}

h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--green-dim);
}

.subtitle {
  text-align: center;
  color: var(--green-dim);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--green-dark);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.05);
}

.card:hover {
  border-color: var(--green-dim);
  box-shadow: 0 0 25px rgba(0, 255, 65, 0.1);
}

.story-text {
  color: var(--white);
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.7;
}

.challenge-box {
  background: #0d1117;
  border: 1px dashed var(--green-dark);
  border-radius: 6px;
  padding: 1.2rem;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.code-block {
  background: #000;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 1rem;
  font-family: 'Share Tech Mono', monospace;
  color: var(--green);
  overflow-x: auto;
  margin: 0.5rem 0;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-all;
}

.input-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.input-group input {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1rem;
  background: #000;
  border: 1px solid var(--green-dark);
  border-radius: 4px;
  color: var(--green);
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

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

.input-group input::placeholder {
  color: var(--green-dark);
}

.btn {
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--green-dim);
  border-radius: 4px;
  background: transparent;
  color: var(--green);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn:hover {
  background: var(--green);
  color: var(--bg);
  box-shadow: 0 0 20px var(--green-glow);
}

.btn-primary {
  background: var(--green-dark);
  color: #000;
  font-weight: bold;
}

.btn-primary:hover {
  background: var(--green);
}

.btn-danger {
  border-color: var(--red);
  color: var(--red);
}

.btn-danger:hover {
  background: var(--red);
  color: #fff;
}

.btn-hint {
  border-color: var(--gold);
  color: var(--gold);
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
}

.btn-hint:hover {
  background: var(--gold);
  color: #000;
}

.hint-area {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.level-badge {
  font-family: 'Orbitron', sans-serif;
  display: inline-block;
  background: var(--green-dark);
  color: #000;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.level-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.progress-bar-container {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid var(--green-dark);
  border-radius: 10px;
  height: 20px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green-dark), var(--green));
  border-radius: 10px;
  transition: width 0.5s ease;
  box-shadow: 0 0 10px var(--green-glow);
}

.progress-text {
  text-align: center;
  font-size: 0.8rem;
  color: var(--green-dim);
  margin-bottom: 0.5rem;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.level-card {
  background: var(--bg-card);
  border: 1px solid var(--green-dark);
  border-radius: 8px;
  padding: 1.2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  color: var(--green);
  display: block;
}

.level-card:hover {
  border-color: var(--green);
  box-shadow: 0 0 20px var(--green-glow);
  transform: translateY(-2px);
}

.level-card.completed {
  border-color: var(--green);
  background: rgba(0, 255, 65, 0.05);
}

.level-card.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.level-card .level-num {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.8rem;
  font-weight: 900;
  display: block;
  margin-bottom: 0.3rem;
}

.level-card .level-title {
  font-size: 0.75rem;
  color: var(--green-dim);
}

.level-card .level-status {
  margin-top: 0.5rem;
  font-size: 0.7rem;
}

.success-message {
  display: none;
  background: rgba(0, 255, 65, 0.1);
  border: 1px solid var(--green);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  margin-top: 1rem;
  animation: fadeIn 0.5s ease;
}

.success-message.show {
  display: block;
}

.error-message {
  color: var(--red);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  display: none;
}

.error-message.show {
  display: block;
  animation: shake 0.3s ease;
}

/* Prost Modal */
.prost-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.prost-overlay.show {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.prost-modal {
  background: var(--bg-card);
  border: 3px solid var(--gold);
  border-radius: 16px;
  padding: 2.5rem;
  text-align: center;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.3);
  animation: popIn 0.4s ease;
}

.prost-emoji {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.prost-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.prost-text {
  color: var(--white);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.prost-close {
  padding: 0.6rem 2rem;
  background: var(--gold);
  color: #000;
  border: none;
  border-radius: 4px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  cursor: pointer;
  font-weight: bold;
}

.prost-close:hover {
  background: #ffed4a;
}

/* SQL Injection specific */
.login-form {
  background: #0d1117;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1rem 0;
}

.login-form label {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--green-dim);
  font-size: 0.85rem;
}

.login-form input {
  width: 100%;
  padding: 0.6rem;
  background: #000;
  border: 1px solid var(--green-dark);
  border-radius: 4px;
  color: var(--green);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  outline: none;
}

.login-form input:focus {
  border-color: var(--green);
  box-shadow: 0 0 8px var(--green-glow);
}

/* PIN input */
.pin-container {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 1.5rem 0;
}

.pin-digit {
  width: 60px;
  height: 70px;
  text-align: center;
  font-size: 2rem;
  font-family: 'Orbitron', sans-serif;
  background: #000;
  border: 2px solid var(--green-dark);
  border-radius: 8px;
  color: var(--green);
  outline: none;
}

.pin-digit:focus {
  border-color: var(--green);
  box-shadow: 0 0 15px var(--green-glow);
}

/* Final page */
.trophy {
  font-size: 5rem;
  text-align: center;
  margin: 1rem 0;
}

.congrats-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.5rem;
  text-align: center;
  color: var(--gold);
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
  margin-bottom: 1rem;
}

/* Solution guide */
.solution-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.solution-table th,
.solution-table td {
  border: 1px solid var(--green-dark);
  padding: 0.75rem;
  text-align: left;
  font-size: 0.85rem;
}

.solution-table th {
  background: var(--green-dark);
  color: #000;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
}

.solution-table tr:nth-child(even) {
  background: rgba(0, 255, 65, 0.02);
}

/* Navigation */
.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--green-dark);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.nav-brand {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  color: var(--green);
  text-decoration: none;
}

.nav-brand:hover {
  text-shadow: 0 0 10px var(--green-glow);
}

.nav-links {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
}

.nav-links a {
  color: var(--green-dim);
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--green);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

.typing-effect {
  overflow: hidden;
  white-space: nowrap;
  animation: typing 2s steps(40, end);
}

/* Hidden elements for Level 4 */
.geheim-versteckt {
  color: #0a0a0a;
  font-size: 1px;
  position: absolute;
  left: -9999px;
  user-select: all;
}

.ultra-hidden {
  display: none;
}

/* Responsive */
@media (max-width: 600px) {
  h1 { font-size: 1.5rem; }
  .container { padding: 1rem; }
  .pin-digit { width: 50px; height: 60px; font-size: 1.5rem; }
  .congrats-title { font-size: 1.8rem; }
  .level-grid { grid-template-columns: repeat(2, 1fr); }
}
