/* Vokabelbingo – Gemeinsames Styling */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Barlow:wght@400;600;700&display=swap');

:root {
  --gruen:    #00e676;
  --gruen-d:  #00c853;
  --gelb:     #ffe600;
  --rot:      #ff3366;
  --dunkel:   #0a0a1a;
  --hell:     #f0f0ff;
  --karte:    #12122a;
  --rand:     #3a3a6a;
  --feld-bg:  #1e1e3a;
  --radius:   8px;
}

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

body {
  background-color: var(--dunkel);
  background-image:
    radial-gradient(circle at 15% 15%, #00e67622 0%, transparent 50%),
    radial-gradient(circle at 85% 85%, #00c85322 0%, transparent 50%),
    repeating-linear-gradient(0deg,  transparent, transparent 39px, #ffffff06 39px, #ffffff06 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, #ffffff06 39px, #ffffff06 40px);
  min-height: 100vh;
  font-family: 'Barlow', sans-serif;
  color: var(--hell);
}

/* ===== Karte ===== */
.karte {
  background: var(--karte);
  border: 2px solid var(--rand);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 0 60px #00e67618, 0 24px 64px #00000080;
  width: 100%;
  max-width: 700px;
}

.karte.breit { max-width: 960px; }
.karte.schmal { max-width: 480px; }

/* ===== Titel ===== */
.titel {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.5rem, 9vw, 5rem);
  letter-spacing: 0.15em;
  text-align: center;
  line-height: 1;
  margin-bottom: 0.25rem;
  color: var(--gruen);
  text-shadow: 0 0 40px #00e67630;
}

.untertitel {
  text-align: center;
  font-size: 0.82rem;
  color: #7878a8;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

/* ===== Navigation ===== */
.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.nav-back {
  color: var(--rand);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.15s;
}
.nav-back:hover { color: var(--gruen); }

/* ===== Formular ===== */
.feld-gruppe {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
}

label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #9090c0;
}

input[type="text"] {
  background: #0a0a20;
  border: 1.5px solid var(--rand);
  border-radius: var(--radius);
  color: var(--hell);
  font-family: 'Barlow', sans-serif;
  font-size: 0.95rem;
  padding: 0.65rem 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
input[type="text"]:focus {
  outline: none;
  border-color: var(--gruen);
  box-shadow: 0 0 12px #00e67625;
}

/* ===== Sprachen-Zeile ===== */
.sprachen-zeile {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.sprachen-pfeil {
  color: var(--gruen);
  font-size: 1.25rem;
  padding-bottom: 0.65rem;
  text-align: center;
}

/* ===== Vokabel-Tabelle (Lehrer) ===== */
.vokabel-tabelle {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.vokabel-tabelle thead th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #9090c0;
  padding: 0 0.5rem 0.6rem;
  text-align: left;
}

.vokabel-zeile {
  display: contents;
}

.vokabel-zeile td {
  padding: 3px 0.35rem 3px 0;
}

.vokabel-zeile td:last-child {
  padding-right: 0;
  width: 2.5rem;
}

.vokabel-nr {
  font-size: 0.7rem;
  color: var(--rand);
  font-weight: 600;
  min-width: 1.5rem;
  text-align: right;
  padding-right: 0.5rem !important;
  vertical-align: middle;
}

.btn-zeile-loeschen {
  background: none;
  border: none;
  color: var(--rand);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
  width: 100%;
}
.btn-zeile-loeschen:hover { color: var(--rot); background: #ff336615; }

/* ===== Fortschritt ===== */
.fortschritt-wrap { margin-bottom: 1.1rem; }
.fortschritt-info {
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.05em; color: #7878a8;
  margin-bottom: 0.35rem; text-align: right;
}
.fortschritt-leiste {
  width: 100%; height: 4px;
  background: #2a2a4a; border-radius: 99px; overflow: hidden;
}
.fortschritt-balken {
  height: 100%; background: var(--gruen); border-radius: 99px;
  transition: width 0.25s ease;
}
.fortschritt-balken.komplett { background: var(--gelb); }

/* ===== Bingo-Spielfeld ===== */
.karten-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 1.25rem;
}

.karten-feld {
  aspect-ratio: 1;
  background: var(--feld-bg);
  border: 1.5px solid var(--rand);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  user-select: none;
  padding: 4px;
}
.karten-feld:active { transform: scale(0.96); }
.karten-feld.aktiv  { border-color: var(--gruen); box-shadow: 0 0 0 2px #00e67630; }
.karten-feld.hat-wert { border-color: #3a5a3a; }

.feld-anzeige {
  font-family: 'Barlow', sans-serif;
  font-size: clamp(0.6rem, 2.2vw, 0.9rem);
  font-weight: 600;
  color: var(--gruen);
  text-align: center;
  line-height: 1.25;
  word-break: break-word;
  hyphens: auto;
  pointer-events: none;
}
.feld-anzeige.leer { color: #3a3a6a; font-size: clamp(0.8rem, 3vw, 1.1rem); font-weight: 400; }

/* ===== Spielfeld (Spielphase) ===== */
.bingo-tabelle { width: 100%; border-collapse: separate; border-spacing: 6px; table-layout: fixed; }
.bingo-tabelle td { padding: 0; }

.feld {
  width: 100%; aspect-ratio: 1;
  background: var(--feld-bg); color: var(--hell);
  border: 1.5px solid var(--rand); border-radius: var(--radius);
  font-family: 'Barlow', sans-serif;
  font-size: clamp(0.6rem, 1.8vw, 0.85rem); font-weight: 600;
  line-height: 1.3; cursor: pointer; padding: 0.4rem;
  text-align: center; word-break: break-word; hyphens: auto;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
  position: relative; overflow: hidden;
}
.feld::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at center, #ffffff18 0%, transparent 70%);
  opacity: 0; transition: opacity 0.2s;
}
.feld:hover { border-color: var(--gruen); transform: scale(1.04); box-shadow: 0 0 12px #00e67630; }
.feld:hover::after { opacity: 1; }
.feld:active { transform: scale(0.97); }

.feld.markiert {
  background: var(--gruen); color: #0a0a1a;
  border-color: var(--gruen); box-shadow: 0 0 16px #00e67666;
}
.feld.markiert::before { content: '✓'; position: absolute; top: 3px; right: 5px; font-size: 0.65rem; opacity: 0.6; }

.feld.gewonnen {
  background: var(--gelb); color: #0a0a1a;
  border-color: var(--gelb); box-shadow: 0 0 24px #ffe60080;
  animation: puls 1s ease-in-out infinite;
}
@keyframes puls { 0%,100%{box-shadow:0 0 20px #ffe60060} 50%{box-shadow:0 0 40px #ffe600cc} }

.feld.gesperrt {
  opacity: 0.28; cursor: not-allowed;
  border-color: #2a2a5a; color: #5a5a8a;
}
.feld.gesperrt:hover { transform: none; box-shadow: none; border-color: #2a2a5a; }

/* ===== Buttons ===== */
.aktionen { display: flex; gap: 0.75rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }

.btn-primaer {
  background: var(--gruen); color: #0a0a1a;
  border: none; border-radius: var(--radius);
  padding: 0.65rem 2rem; min-height: 48px;
  font-family: 'Barlow', sans-serif; font-size: 1rem; font-weight: 700;
  letter-spacing: 0.06em; cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 0 20px #00e67630;
}
.btn-primaer:hover { background: var(--gelb); box-shadow: 0 0 30px #ffe60040; }
.btn-primaer:active { transform: scale(0.97); }
.btn-primaer:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-sekundaer {
  background: transparent; color: var(--gruen);
  border: 1.5px solid var(--gruen); border-radius: var(--radius);
  padding: 0.55rem 1.5rem; min-height: 44px;
  font-family: 'Barlow', sans-serif; font-size: 0.9rem; font-weight: 600;
  letter-spacing: 0.05em; cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.btn-sekundaer:hover { background: var(--gruen); color: var(--dunkel); }
.btn-sekundaer:active { transform: scale(0.97); }

/* ===== Meldungen ===== */
.fehler-box {
  margin-top: 0.75rem;
  background: #2a0a12; border: 1.5px solid var(--rot);
  border-radius: var(--radius); color: #ff8099;
  padding: 0.7rem 1rem; font-size: 0.82rem; text-align: center;
}
.fehler-box.versteckt { display: none; }

.modus-badge {
  text-align: center; font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.06em; color: #5050a0;
  margin-top: -0.75rem; margin-bottom: 1rem;
}
.modus-badge.versteckt { display: none; }

/* ===== Bingo-Banner ===== */
.bingo-banner {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2rem, 8vw, 3.5rem);
  letter-spacing: 0.15em; color: var(--gelb);
  text-shadow: 0 0 30px #ffe60099;
  text-align: center;
  animation: einblenden 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.bingo-banner.versteckt { display: none; }
@keyframes einblenden {
  from { opacity: 0; transform: scale(0.6) translateY(20px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

/* ===== Vokabelliste (Schülerseite) ===== */
.vokabel-panel {
  background: #0e0e22;
  border: 1.5px solid var(--rand);
  border-radius: var(--radius);
  padding: 1rem;
  height: 100%;
  overflow-y: auto;
}

.vokabel-panel-titel {
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: #9090c0; margin-bottom: 0.75rem;
}

.vokabel-liste {
  list-style: none;
  display: flex; flex-direction: column; gap: 0.35rem;
}

.vokabel-eintrag {
  background: #12122a;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.85rem;
}

.vokabel-wort {
  color: var(--hell);
  font-weight: 600;
  min-width: 90px;
}

.vokabel-pfeil { color: var(--rand); font-size: 0.75rem; }

.vokabel-platzhalter {
  color: #4a4a7a;
  font-style: italic;
  font-size: 0.82rem;
}

/* ===== Layout Befüllen ===== */
.befuellen-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 640px) {
  .befuellen-layout { grid-template-columns: 1fr; }
  .vokabel-panel { max-height: 200px; }
}

/* ===== Eingabe-Overlay ===== */
.eingabe-overlay {
  position: fixed; inset: 0;
  background: #00000070;
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.eingabe-overlay.versteckt { display: none; }

.eingabe-panel {
  background: #12122e;
  border-top: 1.5px solid #3a3a7a;
  border-radius: 18px 18px 0 0;
  padding: 1.5rem 1.5rem 2rem;
  width: 100%; max-width: 480px;
  box-shadow: 0 -8px 40px #00000080;
}

.eingabe-prompt {
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: #9090c0; margin-bottom: 0.5rem;
}

.eingabe-wort {
  font-size: 1.3rem; font-weight: 700;
  color: var(--hell); margin-bottom: 1rem;
}

.eingabe-feld {
  width: 100%;
  background: #1e1e42;
  border: 1.5px solid #3a3a7a;
  border-radius: 10px;
  color: var(--gruen);
  font-family: 'Barlow', sans-serif;
  font-size: 1.2rem; font-weight: 600;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  transition: border-color 0.15s;
}
.eingabe-feld:focus { outline: none; border-color: var(--gruen); }

.eingabe-aktionen { display: flex; gap: 0.75rem; }

.eingabe-aktionen button {
  flex: 1; min-height: 48px;
  border-radius: var(--radius);
  font-family: 'Barlow', sans-serif; font-size: 0.95rem; font-weight: 700;
  cursor: pointer; border: 1.5px solid;
  transition: background 0.12s, transform 0.08s;
}
.eingabe-aktionen button:active { transform: scale(0.97); }

.btn-abbrechen { background: #1a1a35; color: #8080b0; border-color: #3a3a6a; }
.btn-ok        { background: var(--gruen); color: #0a0a1a; border-color: var(--gruen); }

/* ===== Zahlen-Badge ===== */
.code-badge {
  display: inline-block;
  background: #ffe60015; border: 1.5px solid var(--gelb);
  border-radius: var(--radius); padding: 0.3rem 0.8rem;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem; letter-spacing: 0.2em; color: var(--gelb);
}

/* ===== Lader ===== */
.lader {
  display: inline-block; width: 1rem; height: 1rem;
  border: 2px solid transparent; border-top-color: currentColor;
  border-radius: 50%; animation: drehen 0.6s linear infinite;
}
@keyframes drehen { to { transform: rotate(360deg); } }

/* ===== Responsive Schülerseite ===== */
@media (max-width: 480px) {
  .karte { padding: 1rem; }
  .karten-grid { gap: 4px; }
  .bingo-tabelle { border-spacing: 4px; }
}
