:root {
  --bg: #05060b;
  --panel: #0c1021;
  --accent: #5df27a;
  --accent-2: #1be7ff;
  --text: #e8f5e9;
  --muted: #7dd9a7;
  --danger: #ff5c8d;
  --border: rgba(93, 242, 122, 0.35);
  --grid: rgba(93, 242, 122, 0.1);
  --shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
  font-family: 'VT323', 'Space Mono', monospace;
}

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

body {
  background:
    repeating-linear-gradient(0deg, transparent, transparent 50px, rgba(93, 242, 122, 0.02) 50px, rgba(93, 242, 122, 0.02) 51px),
    repeating-linear-gradient(90deg, transparent, transparent 50px, rgba(93, 242, 122, 0.02) 50px, rgba(93, 242, 122, 0.02) 51px),
    radial-gradient(circle at 20% 20%, rgba(27, 231, 255, 0.1), transparent 25%),
    radial-gradient(circle at 80% 0%, rgba(93, 242, 122, 0.15), transparent 30%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 2.2rem clamp(1rem, 3vw, 2.2rem);
  overflow-x: hidden;
}

.container {
  width: min(1100px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 1.25rem;
  position: relative;
  z-index: 1;
}

main {
  display: grid;
  gap: 1.25rem;
}

p {
  line-height: 1.6;
}

.scanlines,
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.08;
  z-index: 0;
}

.scanlines {
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 50%, transparent 50%);
  background-size: 100% 3px;
}

.noise {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.7" numOctaves="2" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23n)" opacity="0.18"/></svg>');
  animation: flicker 0.15s infinite;
}

@keyframes flicker {

  0%,
  100% {
    opacity: 0.08;
  }

  50% {
    opacity: 0.06;
  }
}

.hero {
  position: relative;
  padding: 2.2rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, rgba(12, 16, 33, 0.9), rgba(12, 16, 33, 0.7));
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle, rgba(93, 242, 122, 0.22), transparent 55%);
  filter: blur(70px);
  z-index: 0;
}

.hero * {
  position: relative;
  z-index: 1;
}

.hero-title {
  display: grid;
  gap: 0.5rem;
  flex: 1 1 380px;
  min-width: 300px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent);
  font-family: 'Space Mono', monospace;
  text-transform: lowercase;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(93, 242, 122, 0.08);
}

.glitch {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-family: 'VT323', monospace;
  text-transform: uppercase;
  position: relative;
  color: var(--text);
  letter-spacing: 1px;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  overflow: hidden;
  clip: rect(0, 900px, 0, 0);
}

.glitch::before {
  text-shadow: -2px 0 var(--accent-2);
  animation: glitch 2s infinite linear alternate-reverse;
}

.glitch::after {
  text-shadow: 2px 0 var(--accent);
  animation: glitch 2.5s infinite linear alternate;
}

@keyframes glitch {
  0% {
    clip: rect(5px, 999px, 20px, 0);
  }

  20% {
    clip: rect(10px, 999px, 30px, 0);
  }

  40% {
    clip: rect(15px, 999px, 10px, 0);
  }

  60% {
    clip: rect(25px, 999px, 40px, 0);
  }

  80% {
    clip: rect(0px, 999px, 20px, 0);
  }

  100% {
    clip: rect(10px, 999px, 30px, 0);
  }
}

.tagline {
  margin-top: 0.4rem;
  color: var(--muted);
  max-width: 800px;
  letter-spacing: 0.2px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.progress {
  display: grid;
  gap: 0.35rem;
  min-width: 260px;
}

.progress-bar {
  height: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(93, 242, 122, 0.45);
  transition: width 0.4s ease;
}

.btn {
  background: linear-gradient(135deg, rgba(93, 242, 122, 0.15), rgba(27, 231, 255, 0.12));
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1.2rem;
  border-radius: 12px;
  font-family: 'VT323', monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.info {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.terminal-block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.terminal-header {
  background: rgba(255, 255, 255, 0.04);
  padding: 0.7rem 1rem;
  font-family: 'VT323', monospace;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.terminal-body {
  min-height: 120px;
  max-height: 220px;
  overflow-y: auto;
  padding: 1rem;
  font-family: 'Share Tech Mono', monospace;
  display: grid;
  gap: 0.35rem;
}

.rules {
  background: linear-gradient(135deg, rgba(93, 242, 122, 0.06), rgba(27, 231, 255, 0.05));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.rules h2 {
  margin-bottom: 0.7rem;
  font-family: 'VT323', monospace;
  letter-spacing: 0.5px;
}

.rules ul {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
}

.rules li {
  line-height: 1.4;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.door {
  position: relative;
  background: linear-gradient(135deg, rgba(12, 16, 33, 0.95), rgba(5, 6, 11, 0.9));
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  min-height: 150px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow), inset 0 0 30px rgba(93, 242, 122, 0.03);
}

.door::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(93, 242, 122, 0.03) 2px, rgba(93, 242, 122, 0.03) 4px),
    repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(93, 242, 122, 0.03) 2px, rgba(93, 242, 122, 0.03) 4px);
  pointer-events: none;
  opacity: 0.4;
}

.door:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 15px 40px rgba(27, 231, 255, 0.2), 0 0 30px rgba(93, 242, 122, 0.3), inset 0 0 40px rgba(93, 242, 122, 0.08);
  animation: doorGlitch 0.3s ease-in-out;
}

@keyframes doorGlitch {

  0%,
  100% {
    transform: translateY(-6px) scale(1.02);
  }

  25% {
    transform: translateY(-6px) scale(1.02) skewX(2deg);
  }

  75% {
    transform: translateY(-6px) scale(1.02) skewX(-2deg);
  }
}

.door:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

.door::after {
  content: '🔒';
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 1.2rem;
  opacity: 0.4;
  filter: grayscale(1);
  transition: all 0.3s ease;
  text-shadow: 0 0 10px rgba(255, 92, 141, 0.5);
}

.door:hover::after {
  opacity: 0.7;
  transform: scale(1.2) rotate(10deg);
  box-shadow: 0 0 15px var(--neon-green);
}

.door.locked {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: #555;
  box-shadow: none;
}

.door.locked:hover {
  transform: none;
  box-shadow: none;
}

.door.locked h3,
.door.locked p {
  color: #888;
}

.door.locked .status {
  color: #ff4444;
  border-color: #ff4444;
}

/* Snow Effect */
.snow-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.snow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(2px 2px at 20px 30px, #fff, transparent),
    radial-gradient(2px 2px at 40px 70px, #fff, transparent),
    radial-gradient(2px 2px at 50px 160px, #fff, transparent),
    radial-gradient(2px 2px at 90px 40px, #fff, transparent),
    radial-gradient(2px 2px at 130px 80px, #fff, transparent),
    radial-gradient(2px 2px at 160px 120px, #fff, transparent);
  background-size: 200px 200px;
  animation: snow 4s linear infinite;
  opacity: 0.9;
}

.snow-2 {
  background-image:
    radial-gradient(3px 3px at 50px 60px, #fff, transparent),
    radial-gradient(3px 3px at 100px 140px, #fff, transparent),
    radial-gradient(3px 3px at 150px 20px, #fff, transparent),
    radial-gradient(3px 3px at 200px 100px, #fff, transparent);
  background-size: 300px 300px;
  animation: snow 8s linear infinite;
  opacity: 0.7;
}

.snow-3 {
  background-image:
    radial-gradient(4px 4px at 80px 40px, #fff, transparent),
    radial-gradient(4px 4px at 160px 120px, #fff, transparent),
    radial-gradient(4px 4px at 240px 200px, #fff, transparent);
  background-size: 400px 400px;
  animation: snow 12s linear infinite;
  opacity: 0.5;
}

@keyframes snow {
  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(100vh);
  }
}

.door-number {
  font-size: 1.5rem;
  color: var(--accent);
  font-family: 'VT323', monospace;
  margin-bottom: 0.5rem;
}

.door h3 {
  margin-bottom: 0.35rem;
  font-size: 1.1rem;
  letter-spacing: 0.2px;
}

.door p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.door .short-desc {
  font-size: 0.85rem;
  color: var(--accent-2);
  margin-top: 0.5rem;
  padding: 0.3rem 0.5rem;
  background: rgba(27, 231, 255, 0.08);
  border-left: 2px solid var(--accent-2);
  border-radius: 4px;
  font-style: italic;
}

.door .status {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}

.door.completed {
  border-color: var(--accent);
  box-shadow: 0 14px 36px rgba(93, 242, 122, 0.25), 0 0 40px rgba(93, 242, 122, 0.2), inset 0 0 50px rgba(93, 242, 122, 0.1);
  background: linear-gradient(135deg, rgba(12, 16, 33, 0.95), rgba(93, 242, 122, 0.08));
}

.door.completed::after {
  content: '🔓';
  opacity: 0.8;
  filter: grayscale(0);
  color: var(--accent);
  animation: unlock 0.5s ease-out;
}

@keyframes unlock {
  0% {
    transform: scale(0.5) rotate(-90deg);
    opacity: 0;
  }

  50% {
    transform: scale(1.3) rotate(10deg);
  }

  100% {
    transform: scale(1) rotate(0deg);
    opacity: 0.8;
  }
}

.door.completed .status {
  color: var(--accent);
  border-color: rgba(93, 242, 122, 0.6);
  background: rgba(93, 242, 122, 0.15);
  box-shadow: 0 0 10px rgba(93, 242, 122, 0.3);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 10;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: #0a0f1e;
  border: 1px solid var(--border);
  border-radius: 18px;
  width: min(960px, 100%);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
  position: relative;
  overflow: hidden;
  max-height: 90vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.modal-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(27, 231, 255, 0.08), rgba(93, 242, 122, 0.08));
  opacity: 0.6;
  pointer-events: none;
}

.close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
}

.modal-header {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.modal-day {
  background: rgba(93, 242, 122, 0.15);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-family: 'VT323', monospace;
  color: var(--accent);
  min-width: 70px;
  text-align: center;
}

.modal-body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.lesson {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  display: grid;
  gap: 0.65rem;
}

.lesson h4 {
  font-family: 'VT323', monospace;
  color: var(--accent);
}

.lesson ul {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
}

.lesson .use {
  color: var(--muted);
  font-style: italic;
}

.lesson .deep {
  color: var(--text);
}

.lesson h5 {
  font-family: 'VT323', monospace;
  color: var(--accent-2);
  font-size: 1.05rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.tools-section {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(27, 231, 255, 0.05);
  border: 1px solid rgba(27, 231, 255, 0.2);
  border-radius: 8px;
}

.tools-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tool-tag {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  background: rgba(93, 242, 122, 0.12);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--accent);
  font-family: 'Space Mono', monospace;
  transition: all 0.2s ease;
}

.tool-tag:hover {
  background: rgba(93, 242, 122, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(93, 242, 122, 0.2);
}

.real-world-section {
  margin-top: 1rem;
  padding: 0.75rem;
  background: rgba(255, 92, 141, 0.06);
  border: 1px solid rgba(255, 92, 141, 0.2);
  border-radius: 8px;
}

.real-world-section p {
  color: var(--text);
  font-weight: 500;
}

.game {
  background: #050914;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
  min-height: 240px;
}

.choices {
  display: grid;
  gap: 0.5rem;
}

.game h4 {
  color: var(--accent-2);
  font-family: 'VT323', monospace;
}

.game .prompt {
  color: var(--muted);
}

.game button,
.game .choice {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'VT323', monospace;
}

.choice:hover,
.game button:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.choice.correct {
  border-color: var(--accent);
  color: var(--accent);
}

.choice.wrong {
  border-color: var(--danger);
  color: var(--danger);
}

.token-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.token {
  padding: 0.5rem 0.65rem;
  border: 1px dashed var(--border);
  background: rgba(93, 242, 122, 0.08);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  font-family: 'VT323', monospace;
}

.answer-line {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  flex-wrap: wrap;
}

input,
select,
textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  color: var(--text);
  font-family: 'VT323', monospace;
  width: 100%;
}

.log-list {
  display: grid;
  gap: 0.35rem;
}

.log-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.log-item label {
  flex: 1;
  color: var(--muted);
  cursor: pointer;
}

.feedback {
  font-family: 'VT323', monospace;
  color: var(--accent);
}

@media (max-width: 960px) {
  .info {
    grid-template-columns: 1fr;
  }

  .modal-body {
    grid-template-columns: 1fr;
    max-height: 70vh;
    overflow-y: auto;
  }
}

@media (max-width: 700px) {
  body {
    padding: 1.5rem 1rem;
  }

  .hero {
    padding: 1.5rem;
  }

  .calendar {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}
