/* Binaercode -- Farben und Formensprache wie die uebrigen
   Jg6-Tools (vgl. evaBlackbox.css, morseCode.css). */

:root {
  --bc-primary: #4a6cf7;
  --bc-primary-dark: #3a5be0;
  --bc-ink: #2f3542;
  --bc-bg: #eef2f7;
  --bc-right: #2ecc71;
  --bc-wrong: #ff4a4a;
  --bc-gold: #ffd24a;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bc-bg);
  color: #333;
}

.bc-screen {
  display: none;
  max-width: 860px;
  margin: 0 auto;
  padding: 30px 24px 60px 24px;
}

.bc-screen.bc-active { display: block; }

.bc-title {
  margin: 0 0 10px 0;
  font-size: 2rem;
  color: var(--bc-ink);
  text-align: center;
}

.bc-subtitle {
  margin: 0 auto 26px auto;
  max-width: 640px;
  text-align: center;
  line-height: 1.55;
  color: #555;
}

/* ---------- Auswahl ---------- */

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

.bc-wahlcard {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 18px;
  background: var(--bc-ink);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bc-wahlcard:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.bc-wahlcard__icon { font-size: 2.2rem; line-height: 1; }

.bc-wahlcard__name {
  font-size: 1.15rem;
  font-weight: bold;
  color: var(--bc-gold);
}

.bc-wahlcard__text {
  font-size: 0.9rem;
  line-height: 1.45;
  color: #dfe4ec;
  text-align: center;
}

/* ---------- Stellenwertkarten ----------
   Die Karte zeigt oben den Stellenwert und unten das Bit. Beides
   ist gleichzeitig sichtbar -- genau darum geht es. */

.bc-kartenreihe {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.bc-karte {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 84px;
  height: 108px;
  padding: 0;
  border: 3px solid #c7d0e0;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.bc-karte:hover { transform: translateY(-3px); border-color: var(--bc-primary); }

.bc-karte__wert {
  font-size: 1.5rem;
  font-weight: bold;
  color: #99a1b3;
  line-height: 1;
}

.bc-karte__bit {
  font-family: "Courier New", monospace;
  font-size: 1.9rem;
  font-weight: bold;
  color: #c7d0e0;
  line-height: 1;
}

.bc-karte--an {
  border-color: var(--bc-primary);
  background: var(--bc-primary);
}

.bc-karte--an .bc-karte__wert { color: #d7e0ff; }
.bc-karte--an .bc-karte__bit  { color: #fff; }

/* ---------- Summenanzeige ---------- */

.bc-summe {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0 auto 22px auto;
  padding: 16px 30px;
  width: max-content;
  max-width: 100%;
  background: var(--bc-ink);
  border-radius: 14px;
}

.bc-summe__rechnung {
  font-size: 1.05rem;
  color: #aeb6c4;
  text-align: center;
  overflow-wrap: anywhere;
}

.bc-summe__wert {
  font-size: 2.8rem;
  font-weight: bold;
  color: var(--bc-gold);
  line-height: 1.1;
}

.bc-summe__label {
  font-size: 0.72rem;
  color: #aeb6c4;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- Karten und Felder ---------- */

.bc-card {
  margin: 0 auto 16px auto;
  max-width: 660px;
  padding: 18px 22px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.bc-card--mitte { text-align: center; }

.bc-card__title {
  margin: 0 0 12px 0;
  font-size: 1.05rem;
  color: var(--bc-ink);
}

.bc-zeile {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 1.05rem;
  color: var(--bc-ink);
}

.bc-zahlfeld {
  width: 96px;
  height: 44px;
  padding: 0 8px;
  border: 2px solid #c7d0e0;
  border-radius: 8px;
  background: #fff;
  color: var(--bc-ink);
  font-size: 1.2rem;
  text-align: center;
}

.bc-textfeld {
  width: 220px;
  height: 46px;
  padding: 0 12px;
  border: 2px solid #c7d0e0;
  border-radius: 8px;
  background: #fff;
  color: var(--bc-ink);
  font-family: "Courier New", monospace;
  font-size: 1.25rem;
  text-align: center;
  letter-spacing: 0.08em;
}

.bc-breitfeld {
  width: 100%;
  height: 50px;
  padding: 0 12px;
  border: 2px solid #c7d0e0;
  border-radius: 8px;
  background: #fff;
  color: var(--bc-ink);
  font-size: 1.25rem;
}

.bc-zahlfeld:focus,
.bc-textfeld:focus,
.bc-breitfeld:focus { outline: none; border-color: var(--bc-primary); }

/* ---------- Knoepfe ---------- */

.bc-btn-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 10px 0 6px 0;
}

.bc-btn {
  padding: 12px 22px;
  border: none;
  border-radius: 8px;
  background: var(--bc-primary);
  color: #fff;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.bc-btn:hover:enabled { background: var(--bc-primary-dark); transform: translateY(-2px); }
.bc-btn:disabled { opacity: 0.45; cursor: default; }

.bc-btn--secondary { background: #99a1b3; }
.bc-btn--secondary:hover:enabled { background: #808a9e; }

/* ---------- Selbsttest ---------- */

.bc-fortschritt {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  max-width: 660px;
  margin: 0 auto 12px auto;
  font-size: 0.95rem;
  color: #555;
}

.bc-punkte { font-weight: bold; color: var(--bc-ink); }

.bc-frage {
  margin-bottom: 10px;
  font-size: 1.05rem;
  color: #555;
}

.bc-aufgabe {
  margin: 0 0 20px 0;
  padding: 18px 10px;
  border-radius: 10px;
  background: var(--bc-ink);
  color: var(--bc-gold);
  font-family: "Courier New", monospace;
  font-size: 2rem;
  font-weight: bold;
  letter-spacing: 0.12em;
}

.bc-eingabezeile {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.bc-feedback {
  min-height: 1.6em;
  margin-top: 14px;
  font-size: 1.02rem;
  font-weight: bold;
  line-height: 1.5;
}

.bc-feedback--right { color: #1f9d55; }
.bc-feedback--wrong { color: #d63a3a; }

.bc-feedback--ende {
  padding: 14px 18px;
  border-left: 5px solid var(--bc-gold);
  border-radius: 8px;
  background: #fff7dc;
  color: #5c4b12;
  font-weight: normal;
}

/* ---------- Hilfetabelle ---------- */

.bc-hilfe {
  max-width: 660px;
  margin: 6px auto 10px auto;
  padding: 10px 16px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.bc-hilfe summary { cursor: pointer; font-size: 0.95rem; color: var(--bc-primary); }

.bc-hilfetabelle {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.bc-hilfezelle {
  min-width: 54px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f6f8fb;
  text-align: center;
  font-size: 1.05rem;
  font-weight: bold;
  color: var(--bc-ink);
}

/* ---------- Buchstaben ---------- */

.bc-zeichenliste {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bc-zeichen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f6f8fb;
}

.bc-zeichen__buchstabe {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--bc-ink);
  line-height: 1;
}

.bc-zeichen__nummer { font-size: 0.85rem; color: #99a1b3; }

.bc-zeichen__bits {
  font-family: "Courier New", monospace;
  font-size: 0.95rem;
  color: var(--bc-primary);
  letter-spacing: 0.06em;
}

.bc-leer { margin: 0; color: #99a1b3; font-style: italic; }

@media (prefers-reduced-motion: reduce) {
  .bc-wahlcard:hover, .bc-btn:hover:enabled, .bc-karte:hover { transform: none; }
}
