/* ============================================================================
   CodeTree — Design-System
   Schwarz/Grün, terminal-artig, angelehnt an codecademy.com im Aufbau,
   aber eigenständig in Farbe & Typografie.
   ============================================================================ */

:root {
  --bg: #0d0d0d;
  --bg-elevated: #161616;
  --bg-card: #141414;
  --bg-card-hover: #1b1b1b;
  --border: #262626;
  --border-strong: #333333;

  --text: #e8e8e8;
  --text-dim: #9a9a9a;
  --text-faint: #6b6b6b;

  --green: #00ff88;
  --green-dim: #00b866;
  --green-glow: rgba(0, 255, 136, 0.18);
  --green-bg: rgba(0, 255, 136, 0.08);

  --red: #ff5c5c;
  --red-bg: rgba(255, 92, 92, 0.1);
  --yellow: #ffcc4d;
  --yellow-bg: rgba(255, 204, 77, 0.1);
  --blue: #6bd4ff;
  --blue-bg: rgba(107, 212, 255, 0.1);
  --purple: #b98bff;
  --purple-bg: rgba(185, 139, 255, 0.1);

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;

  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

code, pre, .mono {
  font-family: var(--font-mono);
}

::selection {
  background: var(--green-glow);
  color: var(--text);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-elevated);
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--green-dim);
}

/* ---------------------------------------------------------------------- */
/* Layout helpers                                                         */
/* ---------------------------------------------------------------------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-wide {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Supabase-artiger Punktraster-Hintergrund: dezent, mit radialem Fade zu den
   Rändern hin, damit er nicht "tapetenartig" wirkt. */
.bg-dots {
  position: relative;
}

.bg-dots::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 40%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.bg-dots > * {
  position: relative;
  z-index: 1;
}

.bg-glow-green {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--green-glow), transparent 70%);
  border-radius: 50%;
  filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}

/* ---------------------------------------------------------------------- */
/* Custom Modal & Toast (ersetzt native confirm()/alert())                */
/* ---------------------------------------------------------------------- */
.ct-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.15s ease;
  padding: 20px;
}

.ct-modal-overlay.show {
  opacity: 1;
}

.ct-modal {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  transform: translateY(8px) scale(0.98);
  transition: transform 0.15s ease;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.ct-modal-overlay.show .ct-modal {
  transform: translateY(0) scale(1);
}

.ct-modal-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--yellow-bg);
  color: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.ct-modal-icon.danger {
  background: var(--red-bg);
  color: var(--red);
}

.ct-modal-icon.success {
  background: var(--green-bg);
  color: var(--green);
}

.ct-modal-items {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ct-modal-items li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
}

.ct-modal-items li svg {
  color: var(--green);
  flex-shrink: 0;
  margin-top: 2px;
}

.ct-modal-title {
  margin: 0 0 8px;
  font-size: 17px;
}

.ct-modal-message {
  margin: 0 0 22px;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.6;
}

.ct-modal-actions {
  display: flex;
  gap: 10px;
}

.ct-modal-actions .btn {
  flex: 1;
}

.ct-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
}

.ct-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13.5px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.ct-toast.show {
  opacity: 1;
  transform: translateX(0);
}

.ct-toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ct-toast-success { border-color: rgba(0, 255, 136, 0.35); }
.ct-toast-success .ct-toast-icon { color: var(--green); }
.ct-toast-error { border-color: rgba(255, 92, 92, 0.35); }
.ct-toast-error .ct-toast-icon { color: var(--red); }
.ct-toast-info .ct-toast-icon { color: var(--blue); }

/* ---------------------------------------------------------------------- */
/* Navbar                                                                  */
/* ---------------------------------------------------------------------- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(13, 13, 13, 0.9);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-wrap: wrap;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-link {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg-elevated);
}

.nav-link.active {
  color: var(--green);
  background: var(--green-bg);
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  letter-spacing: 0.2px;
}

.plan-badge.free {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-faint);
}

.plan-badge.plus {
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.18), rgba(185, 139, 255, 0.18));
  border: 1px solid rgba(0, 255, 136, 0.4);
  color: var(--green);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.2px;
  color: var(--text);
}

.brand .bracket {
  color: var(--green);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.navbar-user {
  color: var(--text-dim);
  font-size: 14px;
  transition: color 0.15s ease;
}

.navbar-user:hover {
  color: var(--text);
}

.navbar-user strong {
  color: var(--green);
}

/* ---------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ---------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.05s ease;
  font-family: var(--font-ui);
}

.btn:hover {
  border-color: var(--green-dim);
  background: var(--green-bg);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: #06120c;
}

.btn-primary:hover {
  background: #33ffa3;
  border-color: #33ffa3;
  box-shadow: 0 0 0 4px var(--green-glow);
}

.btn-ghost {
  border-color: transparent;
  color: var(--text-dim);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: transparent;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-block {
  width: 100%;
}

.btn-danger {
  background: var(--red);
  border-color: var(--red);
  color: #2a0a0a;
}

.btn-danger:hover {
  background: #ff7a7a;
  border-color: #ff7a7a;
  box-shadow: 0 0 0 4px var(--red-bg);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 12.5px;
}

svg {
  display: inline-block;
  vertical-align: middle;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

.test-icon svg { width: 11px; height: 11px; }
.stat-tile-icon svg, .continue-card-icon svg, .how-card-icon svg { width: 18px; height: 18px; }
.sidebar-stat-icon svg { width: 14px; height: 14px; }
.level-pill-badge svg { width: 11px; height: 11px; }
.tag-pill svg { width: 11px; height: 11px; margin-right: 1px; }
.dash-eyebrow svg { width: 12px; height: 12px; }

/* ---------------------------------------------------------------------- */
/* Forms                                                                   */
/* ---------------------------------------------------------------------- */
.field {
  margin-bottom: 18px;
  text-align: left;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 600;
}

.field input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-ui);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.field-hint {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 6px;
}

.field-error {
  font-size: 12px;
  color: var(--red);
  margin-top: 6px;
}

/* ---------------------------------------------------------------------- */
/* Auth pages                                                              */
/* ---------------------------------------------------------------------- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(0, 255, 136, 0.06), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(0, 255, 136, 0.05), transparent 40%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
}

.auth-card .brand {
  justify-content: center;
  font-size: 24px;
  margin-bottom: 6px;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 0 28px;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-dim);
}

.auth-switch a {
  color: var(--green);
  font-weight: 600;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.banner {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 18px;
  display: none;
}

.banner.show {
  display: block;
}

.banner-error {
  background: var(--red-bg);
  border: 1px solid rgba(255, 92, 92, 0.35);
  color: var(--red);
}

.banner-success {
  background: var(--green-bg);
  border: 1px solid rgba(0, 255, 136, 0.35);
  color: var(--green);
}

/* ---------------------------------------------------------------------- */
/* Landing page                                                            */
/* ---------------------------------------------------------------------- */
.hero {
  min-height: calc(100vh - 65px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 255, 136, 0.08), transparent 45%),
    var(--bg);
}

.hero h1 {
  font-size: clamp(32px, 6vw, 56px);
  margin: 0 0 16px;
  font-family: var(--font-mono);
  letter-spacing: -0.5px;
}

.hero h1 .green {
  color: var(--green);
}

.hero p {
  color: var(--text-dim);
  font-size: 18px;
  max-width: 560px;
  margin: 0 0 32px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-terminal {
  margin-top: 56px;
  width: 100%;
  max-width: 620px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-align: left;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.hero-terminal .term-bar {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.hero-terminal .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #444;
}

.hero-terminal pre {
  margin: 0;
  padding: 18px 20px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-dim);
}

.hero-terminal .g { color: var(--green); }
.hero-terminal .c { color: var(--text-faint); }

/* ---------------------------------------------------------------------- */
/* About-Seite                                                             */
/* ---------------------------------------------------------------------- */
.section-block {
  padding: 60px 0;
}

.section-block.bordered {
  border-top: 1px solid var(--border);
}

.section-block .section-heading {
  justify-content: center;
  text-align: center;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 34px;
}

.section-block .section-heading p {
  max-width: 560px;
  font-size: 14.5px;
}

.mission-statement {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.5;
  color: var(--text);
  font-weight: 500;
}

.mission-statement .green {
  color: var(--green);
  font-weight: 700;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  max-width: 780px;
  margin: 40px auto 0;
}

.stat-strip-item {
  text-align: center;
  padding: 18px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat-strip-item strong {
  display: block;
  font-size: 24px;
  font-family: var(--font-mono);
  color: var(--green);
  margin-bottom: 4px;
}

.stat-strip-item span {
  font-size: 12px;
  color: var(--text-faint);
}

.about-cta {
  text-align: center;
  padding: 70px 0;
  background: radial-gradient(circle at 50% 0%, rgba(0, 255, 136, 0.08), transparent 55%);
}

.about-cta h2 {
  font-size: 26px;
  margin: 0 0 10px;
}

.about-cta p {
  color: var(--text-dim);
  margin: 0 0 26px;
}

/* ---------------------------------------------------------------------- */
/* Dashboard                                                               */
/* ---------------------------------------------------------------------- */
.dash-hero {
  padding: 44px 0 8px;
  border-bottom: 1px solid var(--border);
}

.dash-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.dash-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.page-header h1 {
  font-size: 30px;
  margin: 0 0 6px;
  letter-spacing: -0.3px;
}

.page-header p {
  color: var(--text-dim);
  margin: 0;
  font-size: 15px;
  max-width: 520px;
  line-height: 1.6;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding-bottom: 32px;
}

.stat-tile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-tile-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.stat-tile-icon.green { background: var(--green-bg); color: var(--green); }
.stat-tile-icon.blue { background: var(--blue-bg); color: var(--blue); }
.stat-tile-icon.yellow { background: var(--yellow-bg); color: var(--yellow); }
.stat-tile-icon.purple { background: var(--purple-bg); color: var(--purple); }

.stat-tile-value {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.1;
  font-family: var(--font-mono);
}

.stat-tile-label {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 2px;
}

/* Continue-learning callout */
.continue-card {
  margin: 0 0 36px;
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.08), transparent 60%), var(--bg-card);
  border: 1px solid rgba(0, 255, 136, 0.25);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.continue-card-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.continue-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green-bg);
  border: 1px solid rgba(0, 255, 136, 0.35);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.continue-card-eyebrow {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  margin-bottom: 3px;
}

.continue-card-title {
  font-size: 17px;
  font-weight: 700;
}

.continue-card-meta {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 18px;
  flex-wrap: wrap;
  gap: 8px;
}

.section-heading h2 {
  font-size: 20px;
  margin: 0;
}

.section-heading p {
  color: var(--text-faint);
  font-size: 13px;
  margin: 0;
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 20px;
  padding: 0 0 20px;
}

.lang-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.lang-card:hover {
  border-color: var(--border-strong);
}

.lang-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.lang-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: var(--green-bg);
  border: 1px solid rgba(0, 255, 136, 0.3);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.lang-card h3 {
  margin: 0;
  font-size: 19px;
}

.lang-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.2px;
}

.lang-card-desc {
  color: var(--text-dim);
  font-size: 13.5px;
  margin: 14px 0 18px;
  line-height: 1.6;
}

.progress-track {
  height: 6px;
  border-radius: 4px;
  background: var(--bg-elevated);
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-dim), var(--green));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-label {
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
}

.level-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.level-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.level-pill:hover {
  border-color: var(--green);
  color: var(--green);
  transform: translateX(2px);
}

.level-pill-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.level-pill-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  flex-shrink: 0;
  color: var(--text-faint);
}

.level-pill.done .level-pill-badge {
  background: var(--green-bg);
  border-color: var(--green);
  color: var(--green);
}

.level-pill.active .level-pill-badge {
  border-color: var(--green);
  color: var(--green);
}

.level-pill .lvl-progress {
  font-size: 11.5px;
  color: var(--text-faint);
  font-weight: 500;
  font-family: var(--font-mono);
}

.level-pill.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* How it works */
.how-it-works {
  padding: 40px 0 20px;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.how-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
}

.how-step-num {
  font-family: var(--font-mono);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.how-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--green-bg);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.how-card h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.how-card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 720px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* ---------------------------------------------------------------------- */
/* Code tree                                                               */
/* ---------------------------------------------------------------------- */
.tree-shell {
  padding-bottom: 30px;
}

.tree-header {
  padding: 36px 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.tree-header .crumbs {
  color: var(--text-faint);
  font-size: 13px;
  margin-bottom: 8px;
}

.tree-header .crumbs .g { color: var(--green); }

.tree-header h1 {
  margin: 0;
  font-size: 27px;
  letter-spacing: -0.3px;
}

.tree-header p {
  margin: 6px 0 0;
  color: var(--text-dim);
  font-size: 14px;
}

.tree-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 36px;
  align-items: start;
}

/* Sidebar */
.tree-sidebar {
  position: sticky;
  top: 88px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.ring {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(var(--green) calc(var(--pct, 0) * 3.6deg), var(--bg-elevated) 0deg);
  transition: background 0.4s ease;
}

.ring-inner {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ring-inner strong {
  font-size: 19px;
  font-family: var(--font-mono);
  color: var(--green);
}

.ring-inner span {
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 2px;
}

.sidebar-stat-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 18px 0;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.sidebar-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.sidebar-stat-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
}

.sidebar-stat span.label { color: var(--text-dim); }
.sidebar-stat strong { margin-left: auto; font-family: var(--font-mono); }

.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-faint);
  text-align: center;
  margin: 0 0 2px;
}

/* Path */
.tree-path {
  position: relative;
  padding-left: 0;
}

.tree-path::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(
    to bottom,
    var(--green) 0%,
    var(--green) var(--pct, 0%),
    var(--border-strong) var(--pct, 0%),
    var(--border-strong) 100%
  );
  z-index: 0;
}

.tree-node-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.tree-node {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  cursor: pointer;
  width: 100%;
}

.tree-node.locked {
  cursor: not-allowed;
}

.node-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
  background: var(--bg-card);
  border: 3px solid var(--border-strong);
  color: var(--text-dim);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.node-circle svg { width: 22px; height: 22px; }

.tree-node:not(.locked):hover .node-circle {
  transform: scale(1.06);
}

.tree-node.completed .node-circle {
  background: var(--green-bg);
  border-color: var(--green);
  color: var(--green);
}

.tree-node.current .node-circle {
  border-color: var(--green);
  color: var(--green);
  box-shadow: 0 0 0 6px var(--green-glow);
  animation: pulse 2s infinite;
}

.tree-node.available .node-circle {
  border-color: var(--purple);
  color: var(--purple);
}

.tree-node.locked .node-circle {
  color: var(--text-faint);
  opacity: 0.6;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 6px var(--green-glow); }
  50% { box-shadow: 0 0 0 10px transparent; }
}

.node-card {
  flex: 1;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-top: 4px;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}

.tree-node:not(.locked):hover .node-card {
  border-color: var(--green-dim);
  background: var(--bg-card-hover);
  transform: translateX(4px);
}

.tree-node.current .node-card {
  border-color: rgba(0, 255, 136, 0.4);
}

.tree-node.available .node-card {
  border-color: rgba(185, 139, 255, 0.35);
}

.node-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.node-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.tree-node.locked .node-card-title {
  color: var(--text-faint);
}

.node-card-desc {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.55;
  margin-top: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.node-status-badge {
  flex-shrink: 0;
  font-size: 10.5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.node-status-badge.completed { background: var(--green-bg); color: var(--green); }
.node-status-badge.current { background: var(--green-bg); color: var(--green); }
.node-status-badge.available { background: var(--purple-bg); color: var(--purple); }
.node-status-badge.locked { background: var(--bg-elevated); color: var(--text-faint); }

.tree-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

@media (max-width: 900px) {
  .tree-grid {
    grid-template-columns: 1fr;
  }
  .tree-sidebar {
    position: static;
    order: -1;
  }
}

/* ---------------------------------------------------------------------- */
/* Task view (3-column layout)                                             */
/* ---------------------------------------------------------------------- */
/* Eigener Flex-Wrapper statt "height: calc(100vh - Xpx)" mit geraten Werten:
   Navbar + Topbar behalten ihre natürliche Höhe, der Rest (.task-layout)
   füllt exakt den verbleibenden Platz (flex:1; min-height:0) — dadurch kann
   die Seite selbst nie scrollen, nur die einzelnen Panes intern. */
.task-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.task-page .navbar {
  flex-shrink: 0;
}

.task-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.task-topbar .crumbs {
  color: var(--text-faint);
  font-size: 13px;
}

.task-topbar .crumbs .g { color: var(--green); }

.task-actions {
  display: flex;
  gap: 10px;
}

.task-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 1.3fr) minmax(280px, 1fr);
  flex: 1;
  min-height: 0;
}

.pane {
  overflow-y: auto;
  min-width: 0;
  min-height: 0;
}

.pane-instructions {
  border-right: 1px solid var(--border);
  padding: 28px 26px;
  background: var(--bg);
}

.task-meta-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.pane-instructions h1 {
  font-size: 21px;
  margin: 0 0 4px;
}

.pane-instructions h2 {
  font-size: 17px;
  margin: 22px 0 8px;
  color: var(--green);
}

.pane-instructions p {
  line-height: 1.7;
  color: #cfcfcf;
  font-size: 14.5px;
}

.pane-instructions code {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--green);
}

.pane-instructions pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 12px 0;
}

.pane-instructions pre code {
  background: none;
  border: none;
  padding: 0;
  color: #d5d5d5;
}

.pane-instructions ul, .pane-instructions ol {
  color: #cfcfcf;
  font-size: 14.5px;
  line-height: 1.7;
  padding-left: 20px;
}

.pane-instructions blockquote {
  margin: 14px 0;
  padding: 10px 14px;
  border-left: 3px solid var(--yellow);
  background: rgba(255, 204, 77, 0.06);
  color: var(--text-dim);
  font-size: 13.5px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Tipp/Lösung Boxen */
.learn-helpers {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.learn-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-ui);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.learn-toggle:hover {
  border-color: var(--green-dim);
}

.learn-toggle .learn-toggle-icon {
  color: var(--yellow);
  flex-shrink: 0;
}

.learn-toggle.solution-toggle .learn-toggle-icon {
  color: var(--purple);
}

.learn-toggle .chevron {
  margin-left: auto;
  color: var(--text-faint);
  transition: transform 0.15s ease;
}

.learn-toggle[aria-expanded="true"] .chevron {
  transform: rotate(90deg);
}

.learn-content {
  display: none;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: -4px;
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.65;
}

.learn-content.show {
  display: block;
}

.learn-content pre {
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  overflow-x: auto;
  margin: 8px 0 0;
}

.learn-content pre code {
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 13px;
}

/* HTML-Live-Vorschau */
.html-preview-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #fff;
  min-height: 0;
}

.preview-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: center;
  padding: 20px;
}

.pane-editor {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: #0a0a0a;
  min-height: 0;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}

.reset-btn {
  color: var(--text-faint);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-ui);
  font-size: 12px;
  display: inline-block;
}

.reset-btn:hover {
  color: var(--green);
}

.theme-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: var(--font-ui);
  cursor: pointer;
}

.theme-select:focus {
  outline: none;
  border-color: var(--green);
}

.playground-layout {
  grid-template-columns: 1fr 1fr !important;
}

#editor-container {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.CodeMirror {
  height: 100%;
  font-family: var(--font-mono) !important;
  font-size: 14px;
  line-height: 1.6;
}

/* Eigenes CodeMirror-Theme "codetree" statt eines Standard-Themes, damit der
   Editor konsequent im Schwarz/Grün-Look bleibt. */
.cm-s-codetree.CodeMirror {
  background: #0a0a0a;
  color: #e8e8e8;
}
.cm-s-codetree .CodeMirror-gutters {
  background: #0a0a0a;
  border-right: 1px solid var(--border);
}
.cm-s-codetree .CodeMirror-linenumber { color: #4a4a4a; }
.cm-s-codetree .CodeMirror-cursor { border-left: 2px solid var(--green); }
.cm-s-codetree .CodeMirror-selected { background: rgba(0, 255, 136, 0.15); }
.cm-s-codetree .CodeMirror-matchingbracket {
  color: var(--green) !important;
  text-decoration: underline;
}
.cm-s-codetree .CodeMirror-activeline-background { background: rgba(255, 255, 255, 0.03); }

.cm-s-codetree .cm-keyword { color: var(--green); font-weight: 600; }
.cm-s-codetree .cm-def { color: #6bd4ff; }
.cm-s-codetree .cm-variable { color: #e8e8e8; }
.cm-s-codetree .cm-variable-2 { color: #6bd4ff; }
.cm-s-codetree .cm-variable-3 { color: #6bd4ff; }
.cm-s-codetree .cm-property { color: #e8e8e8; }
.cm-s-codetree .cm-string { color: #ffcc4d; }
.cm-s-codetree .cm-string-2 { color: #ffcc4d; }
.cm-s-codetree .cm-number { color: #ff9d7a; }
.cm-s-codetree .cm-atom { color: #ff9d7a; }
.cm-s-codetree .cm-comment { color: #6b6b6b; font-style: italic; }
.cm-s-codetree .cm-operator { color: #e8e8e8; }
.cm-s-codetree .cm-meta { color: var(--text-dim); }
.cm-s-codetree .cm-punctuation { color: var(--text-dim); }
.cm-s-codetree .cm-tag { color: var(--green); }
.cm-s-codetree .cm-attribute { color: #6bd4ff; }
.cm-s-codetree .cm-error { color: var(--red); }

.pane-output {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  min-height: 0;
}

.output-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.output-console {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.output-console .line { margin-bottom: 2px; }
.output-console .line-error { color: var(--red); }
.output-console .line-log { color: var(--text); }
.output-console .placeholder { color: var(--text-faint); font-style: italic; }

.test-results {
  border-top: 1px solid var(--border);
  padding: 14px 16px 20px;
}

.test-case {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

.test-case:last-child { border-bottom: none; }

.test-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin-top: 1px;
}

.test-case.pass .test-icon {
  background: var(--green-bg);
  color: var(--green);
}

.test-case.fail .test-icon {
  background: var(--red-bg);
  color: var(--red);
}

.test-case .test-msg {
  color: var(--text-dim);
}

.result-banner {
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  display: none;
}

.result-banner.show { display: block; }

.result-banner.success {
  background: var(--green-bg);
  border: 1px solid rgba(0, 255, 136, 0.35);
  color: var(--green);
}

.result-banner.fail {
  background: var(--red-bg);
  border: 1px solid rgba(255, 92, 92, 0.35);
  color: var(--red);
}


@media (max-width: 980px) {
  .task-page {
    height: auto;
    overflow: visible;
  }
  .task-layout {
    grid-template-columns: 1fr;
    flex: none;
  }
  .pane {
    max-height: 60vh;
  }
}

/* ---------------------------------------------------------------------- */
/* Misc                                                                    */
/* ---------------------------------------------------------------------- */
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--green);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.center-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 14px;
  gap: 10px;
}

.footer-note {
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
  padding: 30px 0;
}

.footer-note a {
  color: var(--text-dim);
}

.footer-note a:hover {
  color: var(--green);
}

/* ---------------------------------------------------------------------- */
/* Shop / Pricing                                                          */
/* ---------------------------------------------------------------------- */
.plan-status-banner {
  max-width: 760px;
  margin: 0 auto 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.plan-status-banner .label {
  font-size: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.plan-status-banner .value {
  font-size: 19px;
  font-weight: 700;
}

.plan-status-banner .value.plus {
  color: var(--green);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
}

.pricing-card.featured {
  border-color: rgba(0, 255, 136, 0.4);
  background: linear-gradient(160deg, rgba(0, 255, 136, 0.06), transparent 60%), var(--bg-card);
  position: relative;
}

.pricing-card.featured::before {
  content: "Empfohlen";
  position: absolute;
  top: -12px;
  right: 24px;
  background: var(--green);
  color: #06120c;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}

.pricing-card-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.pricing-card.featured .pricing-card-name { color: var(--green); }

.pricing-card-price {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 4px;
  font-family: var(--font-mono);
}

.pricing-card-price span {
  font-size: 14px;
  color: var(--text-faint);
  font-weight: 500;
  font-family: var(--font-ui);
}

.pricing-card-desc {
  color: var(--text-dim);
  font-size: 13.5px;
  margin: 8px 0 22px;
  line-height: 1.6;
}

.pricing-features {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
  flex: 1;
}

.pricing-features li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13.5px;
  color: var(--text);
}

.pricing-features li svg {
  color: var(--green);
  flex-shrink: 0;
  margin-top: 2px;
}

.pricing-features li.muted {
  color: var(--text-faint);
}

.pricing-features li.muted svg {
  color: var(--text-faint);
}

.redeem-section {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 28px;
  text-align: center;
}

.redeem-section .redeem-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green-bg);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.redeem-form {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.redeem-form input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  text-align: center;
  text-transform: uppercase;
}

.redeem-form input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.redeem-guest-note {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  color: var(--text-dim);
  font-size: 14px;
}

.redeem-guest-note .hero-actions {
  justify-content: center;
  margin-top: 16px;
}

/* ---------------------------------------------------------------------- */
/* Developer-Panel                                                         */
/* ---------------------------------------------------------------------- */
.dev-panel-card {
  max-width: 560px;
  margin: 0 auto 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 28px;
}

.duration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin: 18px 0 24px;
}

.duration-option {
  text-align: center;
  padding: 14px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.duration-option:hover {
  border-color: var(--green-dim);
}

.duration-option.selected {
  border-color: var(--green);
  background: var(--green-bg);
  color: var(--green);
}

.generated-code-box {
  display: none;
  margin-top: 22px;
  padding: 18px;
  background: var(--bg-elevated);
  border: 1px dashed var(--green-dim);
  border-radius: var(--radius-sm);
  text-align: center;
}

.generated-code-box.show {
  display: block;
}

.generated-code-box .code-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 1px;
  margin: 6px 0 14px;
  word-break: break-all;
}

.code-history {
  max-width: 560px;
  margin: 0 auto;
}

.code-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 13px;
}

.code-history-row .code-value {
  font-family: var(--font-mono);
  color: var(--text);
}

.code-history-row .status {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

.code-history-row .status.unused {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.code-history-row .status.used {
  background: var(--green-bg);
  color: var(--green);
}

.no-access-card {
  max-width: 480px;
  margin: 80px auto;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  color: var(--text-dim);
}

/* ---------------------------------------------------------------------- */
/* Paywall-Karte (Code-Tree für gesperrte Level)                          */
/* ---------------------------------------------------------------------- */
.paywall-card {
  max-width: 560px;
  margin: 40px auto;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid rgba(185, 139, 255, 0.3);
  border-radius: var(--radius-lg);
  padding: 40px 34px;
}

.paywall-card .paywall-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--purple-bg);
  color: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.paywall-card h2 {
  margin: 0 0 10px;
  font-size: 21px;
}

.paywall-card p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 24px;
}

.paywall-card .hero-actions {
  justify-content: center;
}

/* ---------------------------------------------------------------------- */
/* Nächste-Aufgabe-Buttons nach Erfolg                                     */
/* ---------------------------------------------------------------------- */
.result-banner .next-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------------- */
/* Zertifikat-Modal                                                        */
/* ---------------------------------------------------------------------- */
.certificate-modal {
  max-width: 640px !important;
}

.certificate-preview {
  margin: 6px 0 22px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.certificate-preview canvas {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------------------------------------------------------------------- */
/* FAQ                                                                     */
/* ---------------------------------------------------------------------- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 18px;
}

.faq-item summary {
  padding: 14px 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  color: var(--green);
  font-size: 20px;
  font-weight: 400;
  flex-shrink: 0;
  margin-left: 12px;
  transition: transform 0.15s ease;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  margin: 0 0 16px;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.65;
}

.faq-item p a {
  color: var(--green);
  text-decoration: underline;
}

/* ---------------------------------------------------------------------- */
/* Onboarding-Tour                                                         */
/* ---------------------------------------------------------------------- */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
}

.tour-highlight {
  position: fixed;
  border: 2px solid var(--green);
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.72);
  transition: top 0.25s ease, left 0.25s ease, width 0.25s ease, height 0.25s ease;
  pointer-events: none;
  z-index: 501;
}

.tour-tooltip {
  position: fixed;
  z-index: 502;
  width: 300px;
  max-width: calc(100vw - 28px);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}

.tour-step-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--green);
  font-weight: 700;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.tour-title {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--text);
}

.tour-text {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.55;
}

.tour-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
