/* ===== Font Face: Source Code Pro ===== */
@font-face {
  font-family: 'Source Code Pro';
  src: url('fonts/SourceCodePro-Regular.ttf.woff2') format('woff2'),
       url('fonts/SourceCodePro-Regular.ttf.woff')  format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Source Code Pro';
  src: url('fonts/SourceCodePro-Bold.ttf.woff2') format('woff2'),
       url('fonts/SourceCodePro-Bold.ttf.woff')  format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ======= CSS-Variablen ======= */
:root {
  --clr-bg: #000;
  --clr-text: #0f0;
  --clr-success: #0f0;
  --clr-error:   #f33;
  --clr-warn:    #ff8800;
  --clr-info:    #ff0;
  --gap: 1rem;
}

html[data-theme='default'] {
  --clr-bg: #000;
  --clr-text: #0f0;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--clr-bg);
  color: var(--clr-text);
  font-family: 'Source Code Pro', monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

/* ===== CRT-Canvas ===== */
#crt-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1;
}

/* ===== Scanline-Overlay (optional) ===== */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(0,255,0,.04) 2px 4px),
    repeating-linear-gradient(90deg, transparent 0 2px, rgba(0,255,0,.04) 2px 4px);
  pointer-events: none;
}

/* ===== Flaggen-Sprachauswahl ===== */
.lang-switch {
  display: grid;
  grid-auto-flow: column;
  gap: 0.5rem;
  position: absolute;
  top: var(--gap);
  left: var(--gap);
}
.lang-switch button {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}
.lang-switch img {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
  transition: transform .2s;
}
.lang-switch button:focus img,
.lang-switch button:hover img {
  transform: scale(1.1);
}

/* ===== UI-Helfer ===== */
.reload-hint {
  position: absolute;
  top: var(--gap);
  right: var(--gap);
  font-size: .9rem;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  50% { opacity: 0.4; }
}

.loading::after {
  content: '…';
  animation: dots 1s infinite steps(3);
}
@keyframes dots {
  to { content: '  '; }
}

/* ===== Terminal-Fenster ===== */
.terminal {
  background: rgba(0,32,0,.9);
  border: 2px solid var(--clr-text);
  border-radius: 8px;
  padding: 2rem;
  margin-top: 4rem;
  text-align: center;
  box-shadow: 0 0 20px var(--clr-text), inset 0 0 20px rgba(0,255,0,.15);
  position: relative;
  max-width: 90vw;
}
.terminal::before {
  content: '● ● ●';
  position: absolute;
  top: .6rem;
  left: 1rem;
  color: #f00;
  font-size: .7rem;
  letter-spacing: .25rem;
}

/* ===== Typografie ===== */
.title {
  font-size: clamp(2rem,6vw,4rem);
  color: #0ff;
  text-shadow: 0 0 8px #0ff;
  animation: flicker 2s infinite alternate;
}
@keyframes flicker {
  50% { opacity: .8; }
}

.instruction {
  margin: .8rem 0 2rem;
  color: #fff;
  opacity: .8;
  font-size: clamp(.9rem,2vw,1.2rem);
}

/* ===== Status-Blöcke ===== */
.msg {
  display: none;
  margin: 1.2rem 0;
  padding: 1rem;
  border: 1px solid currentColor;
  border-radius: 5px;
  font-size: clamp(1.3rem,4vw,2.5rem);
  text-shadow: 0 0 6px currentColor;
  animation: slide .4s ease-out;
}
@keyframes slide {
  from { opacity: 0; transform: translateY(-1rem); }
  to   { opacity: 1; transform: none; }
}
.success {
  color: var(--clr-success);
  background: rgba(0,255,0,.07);
}
.error {
  color: var(--clr-error);
  background: rgba(255,0,0,.07);
}
.warn {
  color: var(--clr-warn);
  background: rgba(255,136,0,.07);
}
.info {
  color: var(--clr-info);
  background: rgba(255,255,0,.07);
}

/* ===== Video ===== */
.video {
  margin-top: 1rem;
  display: none;
}
.video iframe {
  width: 400px;
  height: 225px;
  max-width: 90vw;
  border: 2px solid var(--clr-text);
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(0,255,0,.3);
}
@media (max-width: 600px) {
  .video iframe {
    width: 90vw;
    height: calc(90vw * 9/16);
  }
}

/* ===== Easter-Eggs ===== */
#easter-egg {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(0,0,0,0.8);
  color: #0f0;
  padding: 1rem;
  border: 1px solid #0f0;
  border-radius: 4px;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.8rem;
  line-height: 1;
  display: none;
  z-index: 1000;
  white-space: pre;
}

#egg-error42 {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  background: rgba(0,0,0,0.8);
  color: #f33;
  padding: 1rem;
  border: 1px solid #f33;
  border-radius: 4px;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.9rem;
  line-height: 1.2;
  display: none;
  z-index: 1000;
  white-space: pre;
}

#egg-snake {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;        /* feste Pixelgröße */
  height: 200px;
  background: rgba(0,0,0,0.8);
  border: 1px solid #0f0;
  border-radius: 4px;
  display: none;
  cursor: none;
  z-index: 1000;
}
