@import url('https://fonts.bunny.net/css2?family=Share+Tech+Mono&family=Rajdhani:wght@300;400;500;600&display=swap');

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Farben ─────────────────────────────────────────────────────────────── */
:root {
  --bg:          #020610;
  --panel:       #050c1e;
  --panel-inner: #040a18;
  --led:         #e4f4ff;    /* fast weiß-blau – sehr hell */
  --led-bright:  #ffffff;
  --led-mid:     #90c8f0;    /* mittelhell – Labels & Untertitel */
  --led-dim:     #2a5a8a;    /* Akzente & Borders */
  --led-off:     #050b1a;
  --success:     #00ff88;
  --error:       #ff4455;
  --bezel:       #0c1e38;
  --bezel-light: #163055;
  --blue-rgb:    100, 180, 255;
  --glow:        rgba(100, 180, 255, 0.45);
  --glow-strong: rgba(100, 180, 255, 0.75);
  --glow-text:   0 0 8px rgba(100,180,255,0.9), 0 0 22px rgba(100,180,255,0.5);
  --glow-bright: 0 0 10px #fff, 0 0 25px rgba(100,180,255,0.8), 0 0 50px rgba(100,180,255,0.4);
  --glow-green:  0 0 8px rgba(0,255,136,0.9), 0 0 22px rgba(0,255,136,0.4);
  --glow-red:    0 0 8px rgba(255,68,85,0.9),  0 0 22px rgba(255,68,85,0.4);
  --mono:        'Share Tech Mono', 'Courier New', monospace;
  --display:     'Rajdhani', sans-serif;
}

html { scroll-behavior: smooth; }

/* ── Body ───────────────────────────────────────────────────────────────── */
body {
  font-family: var(--mono);
  background-color: var(--bg);
  color: var(--led);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1rem 5rem;
  position: relative;
  overflow-x: hidden;
}

/* Dot-matrix Hintergrund */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, #0d2040 1px, transparent 1px);
  background-size: 8px 8px;
  opacity: 0.65;
  pointer-events: none;
  z-index: 0;
}

/* Scanlines */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0,0,0,0.12) 2px,
    rgba(0,0,0,0.12) 4px
  );
  pointer-events: none;
  z-index: 999;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 4rem 1rem 2.5rem;
  max-width: 720px;
  width: 100%;
}

header::before {
  content: '';
  display: block;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--led-dim) 10%,
    var(--led-mid) 30%,
    var(--led-bright) 50%,
    var(--led-mid) 70%,
    var(--led-dim) 90%,
    transparent 100%
  );
  box-shadow: 0 0 14px var(--glow-strong), 0 0 35px var(--glow);
  margin-bottom: 2.5rem;
  animation: ledFlicker 8s ease-in-out infinite;
}

.eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  /* text-transform: uppercase; */
  color: var(--led-mid);
  margin-bottom: 1.4rem;
  animation: fadeUp 0.5s ease both;
}

h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 5.5vw, 3.6rem);
  font-weight: 600;
  line-height: 1.1;
  color: var(--led);
  text-shadow: var(--glow-text);
  letter-spacing: 0.04em;
  margin-bottom: 1.2rem;
  animation: fadeUp 0.5s 0.1s ease both;
  text-transform: uppercase;
}

h1 em {
  font-style: normal;
  color: var(--led-bright);
  text-shadow: var(--glow-bright);
}

.subtitle {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--led-mid);
  line-height: 1.7;
  letter-spacing: 0.04em;
  animation: fadeUp 0.5s 0.2s ease both;
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 2rem auto;
  animation: fadeUp 0.5s 0.25s ease both;
}
.divider::before {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--led-dim));
}
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--led-dim), transparent);
}
.divider-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--led-mid);
  box-shadow: 0 0 8px rgba(100,180,255,1), 0 0 18px var(--glow);
  animation: pulse 2s ease-in-out infinite;
}

/* ── Karte ──────────────────────────────────────────────────────────────── */
.card {
  position: relative;
  z-index: 1;
  background: var(--panel);
  border: 2px solid var(--bezel-light);
  border-radius: 4px;
  padding: 2.2rem 2.4rem;
  max-width: 640px;
  width: 100%;
  animation: fadeUp 0.5s 0.3s ease both;
  box-shadow:
    inset 0 0 40px rgba(0,0,0,0.5),
    0 0 0 1px var(--bezel),
    0 8px 40px rgba(0,0,0,0.7),
    0 0 60px rgba(100,180,255,0.06);
}
.card::before, .card::after {
  content: '◆';
  position: absolute;
  font-size: 0.5rem;
  color: var(--bezel-light);
  line-height: 1;
}
.card::before { top: 8px; left: 10px; }
.card::after  { top: 8px; right: 10px; }

.card-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--led-mid);
  margin-bottom: 1rem;
}
.card-label::before {
  content: '▶';
  color: var(--led);
  font-size: 0.55rem;
  text-shadow: var(--glow-text);
}

.hp-field {
  position: absolute;
  left: -9999px; top: -9999px;
  opacity: 0;
  pointer-events: none;
}

/* ── Textarea ───────────────────────────────────────────────────────────── */
textarea {
  width: 100%;
  min-height: 110px;
  text-align: center;
  resize: vertical;
  border: 1px solid var(--bezel-light);
  border-radius: 2px;
  padding: 0.9rem 1rem;
  font-family: var(--mono);
  font-size: 3rem;
  color: var(--led);
  background: var(--led-off);
  caret-color: var(--led-bright);
  outline: none;
  line-height: 1.6;
  transition: border-color 0.2s, box-shadow 0.2s;
  letter-spacing: 0.03em;
}
textarea::placeholder { color: var(--led-dim); opacity: 0.9; }
textarea:focus {
  border-color: var(--led-mid);
  box-shadow: 0 0 0 1px var(--led-mid), inset 0 0 20px rgba(100,180,255,0.05), var(--glow-text);
}

/* ── Counter ────────────────────────────────────────────────────────────── */
.counter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.8rem;
  gap: 1rem;
}
.char-counter {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--led-mid);
  letter-spacing: 0.12em;
  transition: color 0.25s, text-shadow 0.25s;
}
.char-counter.warn {
  color: var(--led);
  text-shadow: var(--glow-text);
}
.char-counter.over {
  color: var(--error);
  text-shadow: var(--glow-red);
}

/* ── Button ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.8rem;
  background: transparent;
  color: var(--led);
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid var(--led-mid);
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s;
  text-shadow: var(--glow-text);
  box-shadow: 0 0 12px rgba(100,180,255,0.2), inset 0 0 12px rgba(100,180,255,0.04);
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--led-mid);
  opacity: 0;
  transition: opacity 0.15s;
}
.btn:hover {
  color: var(--bg);
  text-shadow: none;
  box-shadow: 0 0 20px var(--glow-strong), 0 0 40px var(--glow);
}
.btn:hover::before { opacity: 1; }
.btn:hover .btn-text,
.btn:hover .spinner { position: relative; z-index: 1; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; box-shadow: none; }

.spinner {
  width: 12px; height: 12px;
  border: 1.5px solid rgba(100,180,255,0.3);
  border-top-color: var(--led-mid);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.btn.loading .spinner { display: block; }
.btn.loading .btn-text { opacity: 0.5; }

/* ── Feedback ───────────────────────────────────────────────────────────── */
.feedback {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 2px;
  font-size: 0.85rem;
  line-height: 1.5;
  letter-spacing: 0.06em;
  display: none;
  font-family: var(--mono);
}
.feedback::before { margin-right: 0.5rem; }
.feedback.success {
  background: rgba(0,255,136,0.06);
  border: 1px solid var(--success);
  color: var(--success);
  text-shadow: var(--glow-green);
  box-shadow: 0 0 20px rgba(0,255,136,0.1);
  display: block;
}
.feedback.success::before { content: '▶ OK:'; }
.feedback.error {
  background: rgba(255,68,85,0.06);
  border: 1px solid var(--error);
  color: var(--error);
  text-shadow: var(--glow-red);
  box-shadow: 0 0 20px rgba(255,68,85,0.1);
  display: block;
}
.feedback.error::before { content: '▶ ERR:'; }

/* ── Stats ──────────────────────────────────────────────────────────────── */
.stats {
  position: relative;
  z-index: 1;
  margin-top: 2.5rem;
  text-align: center;
  animation: fadeUp 0.5s 0.45s ease both;
}
.stats-display {
  display: inline-block;
  background: var(--led-off);
  border: 2px solid var(--bezel-light);
  border-radius: 3px;
  padding: 0.8rem 2.2rem;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5), 0 0 30px rgba(100,180,255,0.08);
}
.stats-number {
  font-family: var(--mono);
  font-size: 3rem;
  color: var(--led-bright);
  text-shadow: var(--glow-bright);
  line-height: 1;
  letter-spacing: 0.12em;
}
.stats-label {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--led-mid);
  margin-top: 0.5rem;
}

/* ── Preview ────────────────────────────────────────────────────────────── */
.preview {
  position: relative;
  z-index: 1;
  max-width: 640px;
  width: 100%;
  margin-top: 3rem;
  animation: fadeUp 0.5s 0.5s ease both;
}
.preview-title {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--led-mid);
  margin-bottom: 1.2rem;
}
.preview-title::before {
  content: '■';
  color: var(--led-mid);
  font-size: 0.5rem;
  text-shadow: var(--glow-text);
  animation: pulse 1.5s ease-in-out infinite;
}
.preview-list { display: flex; flex-direction: column; gap: 0.6rem; }
.preview-item {
  text-align: center;
  background: var(--panel-inner);
  border: 1px solid var(--bezel);
  border-left: 2px solid var(--led-dim);
  border-radius: 2px;
  padding: 0.9rem 1.1rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--led);
  line-height: 1.6;
  letter-spacing: 0.03em;
  transition: border-left-color 0.2s, text-shadow 0.2s;
}
.preview-item::before { content: '» '; color: var(--led-mid); }
.preview-item:hover {
  border-left-color: var(--led-mid);
  text-shadow: 0 0 8px rgba(100,180,255,0.5);
}
.preview-empty {
  text-align: center;
  color: var(--led-dim);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  padding: 2rem;
  border: 1px dashed var(--bezel-light);
  border-radius: 2px;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
footer {
  position: relative;
  z-index: 1;
  margin-top: 4rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  color: var(--led-dim);
  text-align: center;
  text-transform: uppercase;
}
footer::before {
  content: '';
  display: block;
  width: 60px;
  height: 1px;
  background: var(--led-dim);
  margin: 0 auto 1rem;
}

/* ── Animationen ────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}
@keyframes ledFlicker {
  0%, 100%  { opacity: 1; }
  92%        { opacity: 1; }
  93%        { opacity: 0.55; }
  94%        { opacity: 1; }
  97%        { opacity: 0.8; }
  98%        { opacity: 1; }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .card { padding: 1.4rem 1.2rem; }
  h1 { font-size: clamp(1.6rem, 7vw, 2.4rem); }
  .stats-number { font-size: 2.4rem; }
}
