:root {
  --pine-950: #050a07;
  --pine-900: #0B1510;
  --pine-800: #14251A;
  --pine-700: #1C3324;
  --moss: #7FB069;
  --leaf: #A7C957;
  --leaf-glow: rgba(167, 201, 87, 0.4);
  --sun: #E8C547;
  --bark: #8A6F4D;
  --paper: #EAF0E4;
  --paper-dim: #B8C6B0;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --display: 'Bricolage Grotesque', var(--sans);
  --radius: 12px;
}

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

html { 
  scroll-behavior: smooth; 
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: auto;
  background: var(--pine-950);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

main {
  flex: 1 0 auto; 
  display: block
}

::selection { 
  background: var(--leaf); 
  color: var(--pine-950); 
}

a { 
  color: var(--leaf); 
  transition: all 0.2s ease; 
}

a:focus-visible, 
button:focus-visible, 
input:focus-visible {
  outline: 2px solid var(--sun); 
  outline-offset: 3px; 
  border-radius: 4px;
}

/* Ambient Background Flow */
.ambient-bg {
  position: fixed; 
  top: 0; 
  left: 0; 
  width: 100vw; 
  height: 100vh;
  background-image: radial-gradient(circle at 50% 0%, var(--pine-800), transparent 70%);
  z-index: -2; 
  pointer-events: none;
}

.floating-code {
  position: fixed; 
  top: 0; 
  left: 0; 
  width: 100vw; 
  height: 100vh;
  z-index: -1; 
  pointer-events: none; 
  overflow: hidden;
}

.code-particle {
  position: absolute; 
  color: var(--pine-700); 
  font-family: var(--mono);
  font-size: 1.5rem; 
  font-weight: bold; 
  opacity: 0;
  animation: floatUp linear infinite backwards;
}

@keyframes floatUp {
  0% { 
    transform: translateY(100vh) rotate(0deg); 
    opacity: 0; 
  }
  10% { 
    opacity: 0.3; 
  }
  90% { 
    opacity: 0.3; 
  }
  100% { 
    transform: translateY(-10vh) rotate(360deg); 
    opacity: 0; 
  }
}

/* ---------- Header ---------- */
header {
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  max-width: 1100px; 
  margin: 0 auto; 
  padding: 24px;
  animation: fadeInDown 0.8s ease forwards;
  width: 100%;
}

.logo {
  font-family: var(--mono); 
  font-size: 1.1rem; 
  font-weight: 500;
  color: var(--paper); 
  text-decoration: none; 
  display: flex; 
  align-items: center; 
  gap: 8px;
}

.logo .glyph { 
  color: var(--leaf); 
  animation: pulseGlow 2s infinite alternate; 
}


/* ---------- Transpareny Page ---------- */

.transparency-layout {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.status-funnel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.status-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: rgba(5, 10, 7, 0.6);
  border: 1px solid rgba(28, 51, 36, 0.8);
}
.status-icon { font-size: 1.6rem; flex-shrink: 0; }
.status-info { flex: 1; }
.status-label { font-weight: 600; color: var(--paper); }
.status-desc { font-size: 0.85rem; color: var(--paper-dim); margin-top: 2px; }
.status-count {
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--leaf);
  min-width: 3ch;
  text-align: right;
}
.status-row.is-planted .status-count { color: var(--leaf); }
.status-row.is-sourcing .status-count { color: var(--sun); }
.status-row.is-submitted .status-count { color: var(--paper-dim); }

.transparency-note {
  font-size: 0.9rem;
  color: var(--paper-dim);
  line-height: 1.6;
  padding: 16px 20px;
  border: 1px solid rgba(28, 51, 36, 0.8);
  border-radius: var(--radius);
}

/* ---------- Navbar ---------- */

.nav {
  display: flex;
  gap: 16px; 
  align-items: center;
}

.nav a {
  text-decoration: none;
  color: #52525b; 
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 8px; 
  background-color: transparent;
  
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav a:hover {
  background-color: #f4f4f5;
  color: #18181b; 
  transform: translateY(-2px); 
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); 
}

.nav a.active {
  background-color: #10b981; 
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25); 
}

.nav a[href="#einreichen"] {
  border: 1px solid #10b981; 
  color: #10b981;
}

.nav a[href="#einreichen"]:hover {
  background-color: #10b981;
  color: #ffffff;
}

.field-readonly {
  padding: 14px 16px;
  background: rgba(11, 21, 16, 0.5);
  border: 1px solid var(--pine-700);
  border-radius: 8px;
  color: var(--paper-dim);
  font-family: var(--mono);
}

/* ---------- Hero ---------- */
.hero {
  max-width: 1100px; 
  margin: 0 auto; 
  padding: 60px 24px 80px;
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 60px; 
  align-items: center;
}

.hero-content { 
  animation: fadeInLeft 1s ease forwards; 
}

.eyebrow {
  font-family: var(--mono); 
  font-size: 0.8rem; 
  letter-spacing: 0.1em;
  color: var(--moss); 
  text-transform: uppercase; 
  margin-bottom: 20px;
  display: inline-block; 
  background: rgba(127, 176, 105, 0.1); 
  padding: 4px 12px; 
  border-radius: 20px;
  border: 1px solid rgba(127, 176, 105, 0.2);
}

h1 {
  font-family: var(--display); 
  font-weight: 800;
  font-size: clamp(2.8rem, 5vw, 4.5rem); 
  line-height: 1.1;
  letter-spacing: -0.02em; 
  margin-bottom: 24px; 
  min-height: 120px;
}

h1 em { 
  font-style: normal; 
  color: var(--leaf); 
  text-shadow: 0 0 20px var(--leaf-glow); 
}

.hero p.lead { 
  color: var(--paper-dim); 
  max-width: 90%; 
  margin-bottom: 40px; 
  font-size: 1.1rem; 
}

.btn {
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  gap: 8px;
  font-family: var(--mono); 
  font-size: 0.95rem; 
  font-weight: 500;
  padding: 16px 28px; 
  border-radius: var(--radius); 
  border: none; 
  cursor: pointer;
  text-decoration: none; 
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-primary {
  background: var(--leaf); 
  color: var(--pine-950);
  box-shadow: 0 4px 15px var(--leaf-glow);
}

.btn-primary:hover {
  background: var(--sun); 
  box-shadow: 0 6px 25px rgba(232, 197, 71, 0.4); 
  transform: translateY(-3px);
}

.btn-ghost { 
  background: transparent; 
  color: var(--paper); 
  border: 1px solid var(--pine-700); 
  backdrop-filter: blur(5px); 
}

.btn-ghost:hover { 
  border-color: var(--moss); 
  background: rgba(127, 176, 105, 0.05); 
  transform: translateY(-3px); 
}

/* ---------- Gamified Submit Button ---------- */
.gamified-btn {
  position: relative; 
  overflow: hidden; 
  background: rgba(20, 37, 26, 0.8);
  border: 2px solid var(--moss); 
  color: var(--paper); 
  font-family: var(--mono);
  font-size: 0.95rem; 
  font-weight: 600; 
  padding: 16px 32px; 
  border-radius: 50px;
  cursor: pointer; 
  display: flex; 
  align-items: center; 
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 15px rgba(127, 176, 105, 0.2); 
  backdrop-filter: blur(5px);
  width: 100%; 
  justify-content: center; 
  margin-top: 10px;
}

.gamified-btn:hover {
  transform: translateY(-3px) scale(1.02); 
  box-shadow: 0 8px 25px rgba(167, 201, 87, 0.4); 
  border-color: var(--leaf);
}

.gamified-btn .btn-bg {
  position: absolute; 
  top: 0; 
  left: 0; 
  height: 100%; 
  width: 0%; 
  background: var(--moss);
  z-index: 0; 
  transition: width 2.5s ease-in-out;
}

.gamified-btn .btn-icon, 
.gamified-btn .btn-text { 
  position: relative; 
  z-index: 1; 
}

.gamified-btn.is-watering .btn-bg { 
  width: 100%; 
}

.gamified-btn.is-watering { 
  pointer-events: none; 
  border-color: var(--sun); 
  box-shadow: 0 0 20px rgba(232, 197, 71, 0.5); 
}

.gamified-btn.is-grown { 
  background: var(--leaf); 
  color: var(--pine-950); 
  border-color: var(--leaf); 
  animation: plop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

@keyframes plop { 
  0% { transform: scale(1); } 
  50% { transform: scale(1.05); } 
  100% { transform: scale(1); } 
}

/* ---------- Floating Log ---------- */
.log-wrapper { 
  animation: fadeInRight 1s ease forwards; 
  perspective: 1000px; 
}

.log {
  background: rgba(11, 21, 16, 0.6); 
  border: 1px solid rgba(28, 51, 36, 0.8);
  border-radius: var(--radius); 
  overflow: hidden; 
  backdrop-filter: blur(16px);
  box-shadow: 0 30px 60px rgba(0,0,0,0.6); 
  transform: rotateY(-5deg) rotateX(5deg);
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.log:hover { 
  transform: rotateY(0) rotateX(0); 
  box-shadow: 0 40px 80px rgba(167, 201, 87, 0.1); 
}

.log-bar {
  display: flex; 
  align-items: center; 
  gap: 8px; 
  padding: 12px 16px; 
  border-bottom: 1px solid rgba(28, 51, 36, 0.5); 
  background: rgba(5, 10, 7, 0.8);
}

.log-bar span { 
  width: 12px; 
  height: 12px; 
  border-radius: 50%; 
  background: var(--pine-700); 
}

.log-bar span:nth-child(1) { 
  background: #FF5F56; 
}

.log-bar span:nth-child(2) { 
  background: #FFBD2E; 
}

.log-bar span:nth-child(3) { 
  background: #27C93F; 
}

.log-bar em { 
  font-family: var(--mono); 
  font-style: normal; 
  font-size: 0.75rem; 
  color: var(--paper-dim); 
  margin-left: 10px; 
}

.log-body { 
  font-family: var(--mono); 
  font-size: 0.85rem; 
  padding: 20px; 
  line-height: 2; 
}

.log-body .hash { 
  color: var(--sun); 
}

.log-body .tree { 
  animation: float 3s ease-in-out infinite; 
  display: inline-block; 
}

.log-body .msg { 
  color: var(--paper); 
}

.log-body .time { 
  color: var(--paper-dim); 
  font-size: 0.75rem; 
  float: right; 
}

.cursor { 
  color: var(--leaf); 
  animation: blink 1s step-end infinite; 
}

/* ---------- Gamification Counter ---------- */
.counter {
  border-top: 1px solid rgba(28, 51, 36, 0.5); 
  border-bottom: 1px solid rgba(28, 51, 36, 0.5);
  background: linear-gradient(90deg, rgba(11,21,16,0.8), rgba(20,37,26,0.8), rgba(11,21,16,0.8));
  backdrop-filter: blur(10px); 
  position: relative; 
  overflow: hidden;
}

.counter::before {
  content: ''; 
  position: absolute; 
  top: 0; 
  left: -100%; 
  width: 50%; 
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(167, 201, 87, 0.1), transparent);
  animation: shine 8s infinite;
}

.counter-inner {
  max-width: 1100px; 
  margin: 0 auto; 
  padding: 30px 24px;
  display: flex; 
  align-items: center; 
  gap: 40px; 
  flex-wrap: wrap;
}

.counter .num {
  font-family: var(--display); 
  font-weight: 800; 
  font-size: 2.8rem; 
  color: var(--leaf);
  text-shadow: 0 0 15px var(--leaf-glow); 
  transition: all 0.3s;
}

.num.pop { 
  transform: scale(1.2); 
  color: var(--sun); 
}

.counter .label { 
  font-family: var(--mono); 
  font-size: 0.85rem; 
  color: var(--paper-dim); 
  text-transform: uppercase; 
  letter-spacing: 0.05em; 
}

.forest { 
  display: flex; 
  gap: 8px; 
  flex: 1; 
  min-width: 200px; 
  justify-content: flex-end; 
  align-items: flex-end; 
}

.forest svg { 
  transform-origin: bottom center; 
  animation: sway 4s ease-in-out infinite alternate; 
  opacity: 0.9; 
}

.forest svg:nth-child(even) { 
  animation-delay: -2s; 
  animation-duration: 5s; 
}

/* ---------- Steps ---------- */
section { 
  max-width: 1100px; 
  margin: 0 auto; 
  padding: 100px 24px; 
  position: relative; 
  z-index: 2; 
}

h2 { 
  font-family: var(--display); 
  font-weight: 600; 
  font-size: 2.2rem; 
  letter-spacing: -0.02em; 
  margin-bottom: 16px; 
  text-align: center;         /* <-- Richtet die Überschrift mittig aus */
}

.section-intro { 
  color: var(--paper-dim); 
  max-width: 60ch; 
  margin-bottom: 60px; 
  font-size: 1.1rem; 
  text-align: center;         /* <-- Richtet den Text mittig aus */
  margin-left: auto;          /* <-- Zentriert den Text-Block auf der Horizontalen */
  margin-right: auto;         /* <-- Zentriert den Text-Block auf der Horizontalen */
}

.steps { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 30px; 
}

.step {
  background: rgba(20, 37, 26, 0.4); 
  border: 1px solid rgba(28, 51, 36, 0.5);
  backdrop-filter: blur(8px); 
  border-radius: var(--radius); 
  padding: 32px; 
  transition: transform 0.3s, border-color 0.3s; 
  position: relative; 
  overflow: hidden;
}

.step:hover { 
  transform: translateY(-5px); 
  border-color: var(--moss); 
  background: rgba(20, 37, 26, 0.8); 
}

.step .tag {
  font-family: var(--mono); 
  font-size: 0.8rem; 
  color: var(--leaf); 
  display: inline-block; 
  margin-bottom: 16px; 
  background: rgba(5, 10, 7, 0.5); 
  padding: 4px 10px; 
  border-radius: 6px; 
  border: 1px solid var(--pine-700);
}

.step h3 { 
  font-family: var(--display); 
  font-weight: 600; 
  font-size: 1.3rem; 
  margin-bottom: 12px; 
}

.step p { 
  color: var(--paper-dim); 
  font-size: 0.95rem; 
}

/* ---------- Form & Huge Dropzone ---------- */
#einreichen { 
  scroll-margin-top: 80px; 
}

.form-card {
  background: rgba(5, 10, 7, 0.6); 
  border: 1px solid rgba(28, 51, 36, 0.8);
  backdrop-filter: blur(20px); 
  border-radius: calc(var(--radius) + 8px); 
  padding: 40px; 
  max-width: 800px; 
  margin: 0 auto;             /* <-- ZENTRIERT die Form-Card perfekt */
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.form-grid {
  display: grid; 
  grid-template-columns: 1fr 1fr; 
  gap: 20px; 
  margin-bottom: 30px;
}

.field label {
  display: block; 
  font-family: var(--mono); 
  font-size: 0.85rem;
  color: var(--paper-dim); 
  margin-bottom: 8px;
}

.field input[type=text], 
.field input[type=email] {
  width: 100%; 
  padding: 14px 16px; 
  font-family: var(--sans); 
  font-size: 1rem;
  background: rgba(11, 21, 16, 0.8); 
  color: var(--paper);
  border: 1px solid var(--pine-700); 
  border-radius: 8px; 
  transition: border-color 0.2s;
}

.field input:focus { 
  border-color: var(--moss); 
  outline: none; 
}

/* The Giant Dropzone */
.dropzone-container { 
  grid-column: 1 / -1; 
  position: relative; 
  z-index: 10; 
  width: 100%;                /* <-- Garantiert die volle Breite */
}

.dropzone {
  border: 2px dashed var(--pine-700); 
  border-radius: var(--radius);
  padding: 80px 40px; 
  text-align: center; 
  cursor: pointer;
  transition: all 0.3s ease; 
  background: rgba(11, 21, 16, 0.4);
  position: relative; 
  display: block;             /* <-- Erzwingt Block-Layout für volle Weite */
  width: 100%;                /* <-- Nutzt die volle Breite der Form-Card */
  pointer-events: auto;
}

/* Der unsichtbare Klick-Bereich über die gesamte Box */
.dropzone input[type="file"] {
  position: absolute;
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%;
  opacity: 0;                 /* <-- Komplett unsichtbar aber da */
  cursor: pointer; 
  display: block !important;  /* <-- Verhindert, dass es durch display:none unklickbar wird */
}

.dropzone:hover, 
.dropzone.dragover { 
  border-color: var(--leaf); 
  background: rgba(20, 37, 26, 0.6);
  box-shadow: inset 0 0 30px rgba(167, 201, 87, 0.1);
}

.dropzone .sprout { 
  font-size: 3rem; 
  display: block; 
  margin-bottom: 16px; 
  animation: float 4s ease-in-out infinite; 
}

.dropzone strong { 
  display: block; 
  font-weight: 600; 
  font-size: 1.2rem; 
  margin-bottom: 8px; 
  color: var(--paper); 
}

.dropzone small { 
  color: var(--paper-dim); 
  font-family: var(--mono); 
  font-size: 0.85rem; 
}

.file-chosen {
  margin-top: 20px; 
  font-family: var(--mono); 
  font-size: 1rem; 
  color: var(--leaf);
  word-break: break-all; 
  display: none; 
  background: rgba(167, 201, 87, 0.1); 
  padding: 10px; 
  border-radius: 8px;
}

/* AI Review / Upload State */
.review-console {
  display: none; 
  padding: 20px; 
  background: rgba(0,0,0,0.5); 
  font-family: var(--mono); 
  font-size: 0.85rem; 
  border-radius: 8px; 
  margin-top: 20px; 
  border: 1px solid var(--pine-700);
}

.review-console p { 
  margin-bottom: 8px; 
}

.sys { 
  color: var(--sun); 
}

.success-text { 
  color: var(--leaf); 
  text-shadow: 0 0 8px rgba(167, 201, 87, 0.3); 
}

/* ---------- Tree ID Success Card ---------- */
.success-state {
  margin-top: 30px;
  animation: slideUp 0.6s ease forwards;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tree-id-card {
  background: rgba(20, 37, 26, 0.6);
  border: 2px solid var(--leaf);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 0 30px rgba(167, 201, 87, 0.2);
  backdrop-filter: blur(10px);
  text-align: center;
}

.tree-id-label {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--paper-dim);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tree-id-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tree-id-display code {
  background: rgba(11, 21, 16, 0.8);
  border: 1px solid var(--pine-700);
  padding: 12px 16px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--sun);
  word-break: break-all;
  flex: 1;
  max-width: 250px;
}

.copy-btn {
  background: var(--moss);
  color: var(--pine-950);
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(127, 176, 105, 0.3);
}

.copy-btn:hover {
  background: var(--leaf);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(167, 201, 87, 0.4);
}

.copy-btn.copied {
  background: var(--sun);
  animation: pulse 0.6s ease;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.copy-icon {
  font-size: 1rem;
}

.share-hint {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--paper-dim);
  margin-top: 12px;
  font-style: italic;
}

/* ---------- Animations ---------- */
@keyframes fadeInDown { 
  from { opacity: 0; transform: translateY(-20px); } 
  to { opacity: 1; transform: translateY(0); } 
}

@keyframes fadeInLeft { 
  from { opacity: 0; transform: translateX(-30px); } 
  to { opacity: 1; transform: translateX(0); } 
}

@keyframes fadeInRight { 
  from { opacity: 0; transform: translateX(30px); } 
  to { opacity: 1; transform: translateX(0); } 
}

@keyframes pulseGlow { 
  from { text-shadow: 0 0 10px var(--leaf-glow); } 
  to { text-shadow: 0 0 20px var(--leaf), 0 0 30px var(--moss); } 
}

@keyframes blink { 
  50% { opacity: 0; } 
}

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

@keyframes shine { 
  100% { left: 200%; } 
}

@keyframes sway { 
  0% { transform: rotate(-6deg); } 
  100% { transform: rotate(6deg); } 
}

/* ---------- Responsive ---------- */
@media (min-width: 901px) {
  .dropzone {
    padding: 120px 60px;
  }
  
  .field label {
    text-align: center;
  }
}

@media (max-width: 900px) {
  .hero { 
    grid-template-columns: 1fr; 
    gap: 40px; 
    padding-top: 40px; 
    text-align: center; 
  }
  .hero p.lead { 
    margin: 0 auto 32px; 
  }
  .steps { 
    grid-template-columns: 1fr; 
  }
  .forest { 
    display: none; 
  }
  .btn-wrapper { 
    justify-content: center; 
    display: flex; 
    gap: 16px; 
  }
  h1 { 
    min-height: auto; 
  }
}

@media (max-width: 600px) {
  .form-grid { 
    grid-template-columns: 1fr; 
  }
  .dropzone { 
    padding: 40px 20px; 
  }
  
  .tree-id-display {
    flex-direction: column;
  }
  
  .tree-id-display code {
    width: 100%;
    max-width: none;
  }
  
  .copy-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ---------- Footer Styling ---------- */
footer {
  border-top: 1px solid rgba(28, 51, 36, 0.5);
  background: var(--pine-950);
  padding: 30px 24px;
  margin-top: 60px;
  flex-shrink: 0;
  width: 100%;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--paper-dim);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-left a {
  color: var(--paper-dim);
  text-decoration: none;
}

.footer-left a:hover {
  color: var(--leaf);
}

.footer-left .separator {
  color: var(--pine-700);
}

.footer-right {
  color: var(--moss);
  font-weight: 500;
}

@media (max-width: 768px) {
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
  .footer-left {
    justify-content: center;
  }
}

  :root {
    --ide-border: rgba(127, 176, 105, 0.15);
    --ide-bg-sidebar: rgba(10, 14, 10, 0.98);
    --ide-bg-main: rgba(14, 20, 14, 0.95);
    --ide-bg-console: rgba(6, 9, 6, 0.98);
    --ide-hover: rgba(255, 255, 255, 0.05);
    --ide-active: rgba(127, 176, 105, 0.1);
    --bug-color: #e8c547;
    --chal-color: #7fb069;
  }

  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
  ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

  .ide-layout {
    display: flex;
    flex: 1;
    height: 100vh;
    width: 100vw;
    position: relative;
    z-index: 10;
    /* Etwas Platz oben für die schwebende DevBar */
    padding-top: 80px; 
    box-sizing: border-box;
  }

  /* --- LEFT SIDEBAR --- */
  .sidebar-left {
    width: 260px;
    flex-shrink: 0;
    background: var(--ide-bg-sidebar);
    border-right: 1px solid var(--ide-border);
    border-top: 1px solid var(--ide-border);
    border-top-right-radius: 8px;
    display: flex;
    flex-direction: column;
    z-index: 20;
    margin-left: 20px;
    margin-bottom: 20px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
  }

  .nav-header {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    padding: 20px 20px 10px 20px;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }

  .explorer {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
  }

  .category-btn {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--paper-dim);
    text-align: left;
    padding: 8px 20px;
    font-family: var(--mono);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s, color 0.2s;
  }
  .category-btn:hover { background: var(--ide-hover); color: #fff; }
  .category-icon { font-size: 1rem; width: 20px; text-align: center; }
  .category-chevron { margin-left: auto; font-size: 0.7rem; opacity: 0.5; transition: transform 0.2s; }
  .category-item.open .category-chevron { transform: rotate(90deg); }
  
  .task-list {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
    background: rgba(0,0,0,0.2);
  }
  .category-item.open .task-list { display: block; }
  
  .task-btn {
    width: 100%;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    text-align: left;
    padding: 8px 20px 8px 48px;
    font-family: var(--mono);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 2px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .task-btn:hover { color: #fff; background: rgba(255,255,255,0.02); }
  .task-btn.active { color: var(--leaf); background: var(--ide-active); border-left-color: var(--leaf); }
  .task-btn .status { margin-right: 6px; font-size: 0.7rem; }
  .task-btn.solved { color: rgba(255,255,255,0.4); }
  .task-btn.solved.active { color: var(--leaf); }

  .user-stats {
    padding: 15px 20px;
    border-top: 1px solid var(--ide-border);
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--leaf);
    display: flex;
    justify-content: space-between;
    background: rgba(0,0,0,0.3);
  }

  /* --- MIDDLE WORKSPACE --- */
  .workspace-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--ide-bg-main);
    border-top: 1px solid var(--ide-border);
    margin-bottom: 20px;
    min-width: 0;
  }

  .placeholder-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.3);
    font-family: var(--mono);
    font-size: 0.9rem;
  }
  .placeholder-screen .icon { font-size: 3rem; margin-bottom: 20px; opacity: 0.5; }

  .workspace-inner {
    display: none;
    flex-direction: column;
    height: 100%;
  }

  .task-header-area {
    padding: 20px 30px;
    border-bottom: 1px solid var(--ide-border);
    flex-shrink: 0;
    max-height: 30vh;
    overflow-y: auto;
  }
  .task-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
  .task-title { font-family: 'Bricolage Grotesque', sans-serif; font-size: 1.5rem; margin: 0; color: #fff; }
  
  .badge {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
  }
  .badge.easy { color: var(--leaf); border: 1px solid var(--leaf); background: rgba(127, 176, 105, 0.1); }
  .badge.medium { color: var(--bug-color); border: 1px solid var(--bug-color); background: rgba(232, 197, 71, 0.1); }
  .badge.xp { color: rgba(255,255,255,0.7); border: 1px solid rgba(255,255,255,0.2); }

  .task-desc { font-size: 0.9rem; line-height: 1.6; color: #CCC; margin: 10px 0; }
  .task-example {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    background: rgba(0,0,0,0.2);
    padding: 10px;
    border-left: 2px solid var(--leaf);
    margin: 0;
    white-space: pre-wrap;
  }

  /* Editor */
  .editor-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: transparent;
    overflow: hidden;
  }
  .editor-tabs {
    height: 35px;
    background: rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--ide-border);
  }
  .editor-tab {
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--leaf);
    border-top: 2px solid var(--leaf);
    background: rgba(255,255,255,0.03);
    gap: 8px;
  }
  
  .editor-core {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
  }
  .editor-lines {
    width: 40px;
    background: rgba(0,0,0,0.2);
    border-right: 1px solid var(--ide-border);
    padding: 15px 0;
    text-align: right;
    padding-right: 12px;
    font-family: var(--mono);
    font-size: 0.9rem;
    color: rgba(255,255,255,0.2);
    user-select: none;
    line-height: 1.6;
    overflow: hidden;
  }
  .editor-textarea {
    flex: 1;
    background: transparent;
    border: none;
    resize: none;
    outline: none;
    color: #E8E8E8;
    font-family: var(--mono);
    font-size: 0.9rem;
    padding: 15px;
    line-height: 1.6;
    tab-size: 4;
    caret-color: var(--leaf);
    white-space: pre;
    overflow: auto;
  }
  .editor-textarea::selection { background: rgba(127, 176, 105, 0.3); }

  .editor-actions {
    height: 50px;
    border-top: 1px solid var(--ide-border);
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 20px;
    gap: 12px;
    flex-shrink: 0;
  }
  .action-btn {
    border: none;
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.2s;
  }
  .action-btn:hover { opacity: 0.8; }
  .btn-ghost { background: transparent; border: 1px solid var(--ide-border); color: #fff; }
  .btn-run { background: var(--leaf); color: #000; }
  .btn-bug { background: var(--bug-color); color: #000; }
  .btn-next { background: #fff; color: #000; display: none; }

  /* --- RIGHT SIDEBAR --- */
  .sidebar-right {
    width: 320px;
    flex-shrink: 0;
    background: var(--ide-bg-console);
    border-left: 1px solid var(--ide-border);
    border-top: 1px solid var(--ide-border);
    border-top-left-radius: 8px;
    display: flex;
    flex-direction: column;
    z-index: 20;
    margin-right: 20px;
    margin-bottom: 20px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
  }
  .console-header {
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    border-bottom: 1px solid var(--ide-border);
    font-family: var(--mono);
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(0,0,0,0.3);
  }
  .console-body {
    flex: 1;
    padding: 15px;
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--paper-dim);
    overflow-y: auto;
    word-wrap: break-word;
  }
  
  .log-line { margin-bottom: 8px; line-height: 1.4; }
  .log-sys { color: rgba(255,255,255,0.4); }
  .log-success { color: var(--leaf); }
  .log-error { color: #ff6b6b; }
  .log-test { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); padding: 8px; margin-top: 6px; border-radius: 4px; }
  .log-test.pass { border-left: 2px solid var(--leaf); }
  .log-test.fail { border-left: 2px solid #ff6b6b; }

  /* =========================================
   FLOATING DEVBAR (Global Navigation)
   ========================================= */
.devbar {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 14, 10, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(127, 176, 105, 0.25);
  border-radius: 100px;
  
  /* Erzwinge horizontale Anordnung auf einer Zeile */
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  
  padding: 8px 12px 8px 24px;
  z-index: 9999;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  width: max-content !important; 
}

.devbar:hover {
  background: rgba(15, 22, 15, 0.85);
  border-color: rgba(127, 176, 105, 0.5);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(127, 176, 105, 0.15);
}

.devbar-brand {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  text-decoration: none;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  color: #fff;
  margin-right: 15px;
  white-space: nowrap !important;
}

.devbar-brand .glyph {
  color: var(--leaf, #7fb069);
  margin-right: 8px;
  font-size: 1.5rem; /* Die {} sind nun etwas größer als der Text */
  line-height: 1;
}

.devbar-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 10px;
  display: block !important;
}

.devbar-links {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 6px;
}

.devbar-link {
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 100px;
  transition: all 0.2s ease;
  display: flex !important;
  align-items: center !important;
  gap: 8px;
  white-space: nowrap !important;
}

.devbar-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.devbar-link.active {
  color: #0c140c;
  background: var(--leaf, #7fb069);
  font-weight: 600;
}

.devbar-shortcut {
  font-size: 0.65rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: inherit;
  opacity: 0.7;
}

.devbar-link.active .devbar-shortcut {
  border-color: rgba(0,0,0,0.2);
}

/* =========================================================================
   AUTH MODAL & LEADERBOARD
   Ergänzt für Login/Registrierung + "Der Semester-Fight"-Ranking.
   ========================================================================= */

/* Select- und Passwort-Felder waren bisher nicht mitgestylt -- .field
   deckte nur input[type=text]/[type=email] ab. */
   .field input[type="password"],
   .field select {
     width: 100%;
     padding: 14px 16px;
     font-family: var(--sans);
     font-size: 1rem;
     background: rgba(11, 21, 16, 0.8);
     color: var(--paper);
     border: 1px solid var(--pine-700);
     border-radius: 8px;
     transition: border-color 0.2s;
   }
   
   .field select:focus,
   .field input[type="password"]:focus {
     border-color: var(--moss);
     outline: none;
   }
   
   .field select:disabled {
     opacity: 0.5;
     cursor: not-allowed;
   }
   
   /* Login/Register-Button im Header, im Stil der übrigen .nav a Links */
   .auth-nav-btn {
     font-family: inherit;
     font-size: 0.95rem;
     font-weight: 500;
     padding: 10px 20px;
     border-radius: 8px;
     background-color: transparent;
     border: 1px solid var(--pine-700);
     color: var(--paper);
     cursor: pointer;
     transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
   }
   
   .auth-nav-btn:hover {
     border-color: var(--moss);
     background: rgba(127, 176, 105, 0.05);
     transform: translateY(-2px);
   }
   
   /* --- Auth Modal --- */
   .auth-modal {
     position: fixed;
     inset: 0;
     z-index: 1000;
     display: flex;
     align-items: center;
     justify-content: center;
     background: rgba(5, 10, 7, 0.75);
     backdrop-filter: blur(6px);
     padding: 20px;
   }
   
   .auth-modal-card {
     position: relative;
     width: 100%;
     max-width: 420px;
     background: rgba(5, 10, 7, 0.95);
     border: 1px solid rgba(28, 51, 36, 0.8);
     border-radius: calc(var(--radius) + 4px);
     padding: 32px;
     box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
     animation: fadeInDown 0.3s ease forwards;
   }
   
   .auth-modal-card h3 {
     font-family: var(--display);
     color: var(--paper);
     margin-top: 0;
     margin-bottom: 24px;
   }
   
   .auth-modal-close {
     position: absolute;
     top: 14px;
     right: 16px;
     background: none;
     border: none;
     color: var(--paper-dim);
     font-size: 1.6rem;
     line-height: 1;
     cursor: pointer;
     transition: color 0.2s;
   }
   
   .auth-modal-close:hover {
     color: var(--sun);
   }
   
   .auth-message {
     padding: 10px 14px;
     border-radius: 8px;
     margin-bottom: 20px;
     background: rgba(127, 176, 105, 0.1);
     border: 1px solid rgba(127, 176, 105, 0.2);
     font-family: var(--mono);
     font-size: 0.85rem;
     color: var(--paper);
   }
   
   .auth-switch {
     margin-top: 18px;
     font-size: 0.9rem;
     text-align: center;
     color: var(--paper-dim);
   }
   
   .auth-switch a {
     color: var(--leaf);
     text-decoration: none;
   }
   
   .auth-switch a:hover {
     text-decoration: underline;
   }
   
   /* --- Leaderboard --- */
   .leaderboard-card {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 800px;
    margin: 0 auto;
  }
  
  .leaderboard-card[hidden] {
    display: none;
  }
   
   .leaderboard-row,
   .leaderboard-empty {
     display: flex;
     align-items: center;
     gap: 16px;
     padding: 16px 20px;
     border-radius: var(--radius);
     background: rgba(5, 10, 7, 0.6);
     border: 1px solid rgba(28, 51, 36, 0.8);
     backdrop-filter: blur(10px);
     font-family: var(--mono);
   }
   
   .leaderboard-row .lb-rank {
     width: 2.2em;
     text-align: center;
     font-size: 1.15rem;
     flex-shrink: 0;
   }
   
   .leaderboard-row .lb-name {
     flex: 1;
     color: var(--paper);
   }
   
   .leaderboard-row .lb-count {
     color: var(--leaf);
     font-weight: 600;
   }
   
   .leaderboard-empty {
     justify-content: center;
     color: var(--paper-dim);
}
/* =========================================================================
   AUTH-SEITEN (login.html / registrieren.html)
   Eigenständige Seiten statt Modal — nutzt dieselben Tokens/Komponenten
   wie der Rest der Seite (.form-card, .field, .btn-primary, .auth-message).
   ========================================================================= */

.auth-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 24px 100px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  min-height: calc(100vh - 320px);
}

.auth-pitch {
  animation: fadeInLeft 1s ease forwards;
}

.auth-pitch h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.auth-pitch h1 em {
  font-style: normal;
  color: var(--leaf);
  text-shadow: 0 0 20px var(--leaf-glow);
}

.auth-pitch p.lead {
  color: var(--paper-dim);
  font-size: 1.05rem;
  max-width: 92%;
  margin-bottom: 32px;
}

.trust-points {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 36px;
}

.trust-point {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--paper);
}

.trust-point .glyph {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.mini-impact {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  background: rgba(127, 176, 105, 0.08);
  border: 1px solid rgba(127, 176, 105, 0.2);
  padding: 14px 20px;
  border-radius: var(--radius);
}

.mini-impact-num {
  font-family: var(--mono);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--leaf);
}

.mini-impact-label {
  font-family: var(--mono);
  color: var(--paper-dim);
  font-size: 0.8rem;
}

.auth-card-wrapper {
  animation: fadeInRight 1s ease forwards;
}

.form-card.auth-card {
  margin: 0;
  max-width: 460px;
}

.form-card.auth-card h3 {
  font-family: var(--display);
  font-size: 1.5rem;
  margin-bottom: 24px;
}

.form-grid-single {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.field-full {
  grid-column: 1 / -1;
}

/* Honeypot: für Menschen unsichtbar, aber im DOM/Tab-Flow vorhanden für Bots */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 40px;
    min-height: auto;
  }
  .auth-pitch p.lead {
    margin: 0 auto 32px;
  }
  .trust-points {
    align-items: center;
  }
  .form-card.auth-card {
    margin: 0 auto;
  }
}

/*AUTH DROPDOWN*/
.auth-nav-wrapper{position:relative;display:inline-block;}
  .auth-dropdown{
    position:absolute;
    right:0;
    top:calc(100% + 8px);
    min-width:190px;
    background:var(--pine-950,#0f1f16);
    border:1px solid rgba(127,176,105,0.35);
    border-radius:10px;
    padding:6px;
    box-shadow:0 12px 28px rgba(0,0,0,0.35);
    z-index:50;
  }
  .auth-dropdown-item{
    display:flex;
    align-items:center;
    gap:8px;
    width:100%;
    text-align:left;
    background:none;
    border:none;
    color:#fff;
    font:inherit;
    font-size:0.92rem;
    padding:9px 10px;
    border-radius:6px;
    cursor:pointer;
    text-decoration:none;
  }

  .auth-dropdown-item:hover{
    background:rgba(127,176,105,0.18);
  }

  .auth-dropdown-item--danger:hover{
    background:rgba(255,95,86,0.18); color:#FF8A82;
  }

/* ---------- Mobile Burger Menu ---------- */
.burger-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--leaf);
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
}

@media (max-width: 950px) {
  header {
    flex-wrap: wrap; /* Allows the menu to drop below the logo */
  }
  
  .burger-btn {
    display: block;
  }

  .nav {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    overflow: hidden;
    max-height: 0; /* Hidden by default */
    transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out;
    gap: 0;
  }

  /* This class is toggled by your existing JavaScript */
  .nav.open {
    max-height: 800px;
    padding-top: 15px;
    padding-bottom: 20px;
  }

  .nav a, .auth-nav-btn {
    width: 100%;
    text-align: left;
    padding: 15px 10px;
    border-radius: 0;
    border-bottom: 1px solid rgba(127, 176, 105, 0.2);
  }

  .nav a.active {
    background: rgba(127, 176, 105, 0.1);
    color: var(--leaf);
    box-shadow: none;
  }

  /* Overrides for the specific 'Einreichen' button */
  .nav a[href="#einreichen"] {
    border: none;
    border-bottom: 1px solid rgba(127, 176, 105, 0.2);
    color: var(--leaf);
  }

  .auth-nav-wrapper {
    width: 100%;
  }

  .auth-nav-btn {
    border: none;
    color: var(--sun);
  }
  
  /* Make the dropdown flat and inline on mobile */
  .auth-dropdown {
    position: static;
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: none;
    box-shadow: none;
    margin-top: 0;
  }
  
  .auth-dropdown-item {
    padding: 12px 20px;
  }
}