/* ===== BINGO — Retro Arcade Style ===== */

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

:root {
  --blau:    #1a1aff;
  --gelb:    #ffe600;
  --teal:    #30D5C8;
  --dunkel:  #0a0a1a;
  --hell:    #f0f0ff;
  --markiert-bg:   #ffe600;
  --markiert-text: #0a0a1a;
  --feld-bg:       #1e1e3a;
  --feld-text:     #f0f0ff;
  --feld-rand:     #3a3a6a;
  --radius: 6px;
}

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

body {
  background-color: var(--dunkel);
  background-image:
    radial-gradient(circle at 20% 20%, #1a1aff22 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, #30D5C822 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;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Barlow', sans-serif;
  color: var(--hell);
}

/* ===== Seiten-Layout ===== */
.seite {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  padding: 2rem 1rem;
  width: 100%;
}

/* ===== Karte ===== */
.karte {
  background: #12122a;
  border: 2px solid #3a3a6a;
  border-radius: 16px;
  padding: 2rem;
  box-shadow:
    0 0 0 1px #ffffff08,
    0 0 60px #1a1aff30,
    0 24px 64px #00000080;
  max-width: 640px;
  width: 100%;
}

/* ===== Titel ===== */
.titel {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3.5rem, 12vw, 6rem);
  letter-spacing: 0.18em;
  text-align: center;
  margin-bottom: 1.5rem;
  line-height: 1;
  transition: color 0.4s;
}

.titel-b { color: #ff3366; }
.titel-i { color: #ff8c00; }
.titel-n { color: var(--gelb); }
.titel-g { color: #00e676; }
.titel-o { color: var(--teal); }

.titel.bingo-aktiv {
  animation: blinken 0.6s step-end infinite;
}

@keyframes blinken {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

/* ===== Tabelle ===== */
.bingo-tabelle {
  width: 100%;
  border-collapse: separate;
  border-spacing: 6px;
  table-layout: fixed;
}

.bingo-tabelle td {
  padding: 0;
}

/* ===== Felder (Buttons) ===== */
.feld {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--feld-bg);
  color: var(--feld-text);
  border: 1.5px solid var(--feld-rand);
  border-radius: var(--radius);
  font-family: 'Barlow', sans-serif;
  font-size: clamp(0.65rem, 2vw, 0.9rem);
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  padding: 0.4rem;
  text-align: center;
  word-break: break-word;
  hyphens: auto;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    transform 0.1s ease,
    box-shadow 0.15s ease;
  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(--teal);
  transform: scale(1.04);
  box-shadow: 0 0 12px #30D5C840;
}

.feld:hover::after {
  opacity: 1;
}

.feld:active {
  transform: scale(0.97);
}

/* ===== Markierter Zustand ===== */
.feld.markiert {
  background: var(--gelb);
  color: var(--markiert-text);
  border-color: var(--gelb);
  box-shadow: 0 0 16px #ffe60066;
  font-weight: 600;
}

.feld.markiert::before {
  content: '✓';
  position: absolute;
  top: 3px;
  right: 5px;
  font-size: 0.65rem;
  opacity: 0.6;
}

/* ===== Bingo-Zeile / Gewinn-Hervorhebung ===== */
.feld.gewonnen {
  background: var(--blau);
  color: #fff;
  border-color: #6699ff;
  box-shadow: 0 0 24px #1a1aff80;
  animation: puls 1s ease-in-out infinite;
}

@keyframes puls {
  0%, 100% { box-shadow: 0 0 20px #1a1aff60; }
  50%       { box-shadow: 0 0 40px #1a1affcc; }
}

/* ===== Aktionen ===== */
.aktionen {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
}

.neu-laden {
  background: transparent;
  color: var(--teal);
  border: 1.5px solid var(--teal);
  border-radius: var(--radius);
  padding: 0.55rem 1.5rem;
  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;
}

.neu-laden:hover {
  background: var(--teal);
  color: var(--dunkel);
}

.neu-laden:active {
  transform: scale(0.97);
}

/* ===== 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); }
}

/* ===== Fehlermeldung ===== */
.fehler {
  background: #2a0a0a;
  border: 1.5px solid #ff3366;
  border-radius: var(--radius);
  color: #ff8099;
  padding: 1rem 1.5rem;
  font-family: 'Barlow', sans-serif;
  font-size: 0.95rem;
  max-width: 480px;
  margin: 2rem auto;
}

/* ===== Responsiv ===== */
@media (max-width: 480px) {
  .karte {
    padding: 1rem;
    border-radius: 10px;
  }

  .bingo-tabelle {
    border-spacing: 4px;
  }
}
