:root {
  --hintergrund: #08111f;
  --karte: #101b2f;
  --karte-hell: #172642;
  --text: #f7fbff;
  --gedimmt: #b9c6d8;
  --akzent: #72e6ac;
  --akzent-blau: #7ab8ff;
  --warnung: #ff7890;
  --gold: #ffd76b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #183b71, var(--hintergrund) 45%, #050910);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: var(--akzent-blau);
}

.seite {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.kopfbereich {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
}

.logo {
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 950;
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.untertitel {
  color: var(--gedimmt);
  font-size: clamp(17px, 2vw, 24px);
  max-width: 820px;
}

.karte {
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 20px 70px rgba(0,0,0,0.28);
  margin: 16px 0;
}

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

button,
.knopf {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  background: var(--akzent);
  color: #06100b;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  font-size: 16px;
  margin: 4px 6px 4px 0;
}

button.zweit,
.knopf.zweit {
  background: var(--akzent-blau);
  color: #041121;
}

button.dunkel,
.knopf.dunkel {
  background: var(--karte-hell);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.15);
}

input,
textarea,
select {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.18);
  background: #07101d;
  color: var(--text);
  padding: 14px 16px;
  font-size: 18px;
  outline: none;
}

textarea {
  min-height: 220px;
  line-height: 1.5;
}

label {
  display: block;
  margin: 14px 0 7px;
  color: var(--gedimmt);
  font-weight: 750;
}

.tabelle {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 18px;
}

.tabelle th,
.tabelle td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  text-align: left;
  vertical-align: top;
}

.tabelle th {
  color: var(--akzent);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pille {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(122,184,255,0.14);
  color: #d7eaff;
  font-weight: 800;
  margin: 3px;
}

.woerter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}

.wort {
  font-size: clamp(28px, 5vw, 58px);
  font-weight: 950;
  padding: 16px 22px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--gold), #ff9f6e);
  color: #1b1200;
  box-shadow: 0 14px 45px rgba(255,215,107,0.22);
}

.neun-woerter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  width: 100%;
}

.wort-klein {
  font-size: clamp(18px, 2.4vw, 34px);
  padding: 12px 16px;
  text-align: center;
}

.geschichte {
  font-size: clamp(24px, 3.2vw, 44px);
  line-height: 1.24;
}

.beamer .seite {
  width: min(1500px, calc(100% - 56px));
}

.beamer .karte {
  padding: 34px;
}

.beamer .wort-klein {
  font-size: clamp(24px, 2.8vw, 42px);
}

.bewertung {
  display: grid;
  grid-template-columns: 1fr repeat(5, 64px);
  gap: 10px;
  align-items: center;
  margin: 18px 0;
}

.bewertung input {
  width: auto;
  transform: scale(1.5);
}

.bewertung span {
  font-size: 22px;
  font-weight: 900;
}

.hinweis {
  color: var(--gedimmt);
}

.gross {
  font-size: clamp(18px, 2vw, 26px);
  line-height: 1.45;
}

.geschichten-block {
  min-height: 430px;
}

.geschichten-formular {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.grosses-textfeld {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.55;
}

.formular-aktionszeile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.teilnehmer-tabelle td,
.teilnehmer-tabelle th {
  font-size: clamp(16px, 1.6vw, 22px);
}

.teilnehmer-tabelle .pille {
  margin: 0;
}

.gewinner {
  font-size: clamp(30px, 4vw, 56px);
  font-weight: 950;
  color: var(--gold);
}

.klein {
  font-size: 14px;
  color: var(--gedimmt);
}

.fehler {
  color: var(--warnung);
}

@media (max-width: 720px) {
  .kopfbereich {
    display: block;
  }

  .bewertung {
    grid-template-columns: 1fr repeat(5, 36px);
  }

  .logo {
    font-size: 42px;
  }

  .neun-woerter {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .grosses-textfeld {
    min-height: 260px;
  }

  .formular-aktionszeile {
    align-items: stretch;
  }

  .formular-aktionszeile button {
    width: 100%;
  }
}

/* Nur Beamer-Ansicht: Wörter so darstellen, dass sie sauber in die Kästen passen */
.beamer .neun-woerter {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  margin: 22px 0 28px;
}

.beamer .wort-klein {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  min-height: 64px;
  padding: 10px 14px;
  font-size: clamp(20px, 1.9vw, 34px);
  line-height: 1.05;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.beamer .karte {
  overflow: hidden;
}

.beamer .geschichte {
  margin-top: 24px;
}

@media (max-width: 1100px) {
  .beamer .neun-woerter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .beamer .neun-woerter {
    grid-template-columns: 1fr;
  }

  .beamer .wort-klein {
    font-size: 22px;
  }
}

/* Saubere 9-Wörter-Darstellung für Gäste, Admin und Beamer */
.neun-woerter {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 100%;
  margin: 18px 0 22px;
}

.wort-klein {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  font-size: clamp(17px, 1.8vw, 28px);
  line-height: 1.05;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

/* Gästeansicht: Wörter etwas ruhiger und gut lesbar */
body:not(.beamer) .karte .neun-woerter {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body:not(.beamer) .karte .wort-klein {
  font-size: clamp(18px, 1.9vw, 30px);
}

/* Admin-Panel: Wörterkarte bekommt mehr Breite und keine Tabellenquetschung */
.sitzungs-raster {
  grid-template-columns: minmax(220px, 0.8fr) minmax(420px, 2fr) minmax(240px, 1fr);
  align-items: start;
}

.woerter-admin-karte {
  min-width: 0;
  overflow: hidden;
}

.gruppen-woerter-liste {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.gruppen-woerter-eintrag {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.08);
}

.gruppen-label {
  padding-top: 18px;
}

.woerter-admin-karte .neun-woerter {
  margin: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.woerter-admin-karte .wort-klein {
  min-height: 50px;
  font-size: clamp(15px, 1.35vw, 24px);
  padding: 9px 10px;
}

/* Beamer bleibt groß, aber sicher innerhalb der Karten */
.beamer .neun-woerter {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0 28px;
}

.beamer .wort-klein {
  min-height: 64px;
  font-size: clamp(20px, 1.9vw, 34px);
  padding: 10px 14px;
}

.beamer .karte {
  overflow: hidden;
}

.beamer .geschichte {
  margin-top: 24px;
}

/* Mittlere Breiten: 2 Spalten, damit nichts gequetscht wird */
@media (max-width: 1100px) {
  .neun-woerter,
  body:not(.beamer) .karte .neun-woerter,
  .woerter-admin-karte .neun-woerter,
  .beamer .neun-woerter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sitzungs-raster {
    grid-template-columns: 1fr;
  }

  .gruppen-woerter-eintrag {
    grid-template-columns: 1fr;
  }

  .gruppen-label {
    padding-top: 0;
  }
}

/* Kleine Displays: Wörter untereinander */
@media (max-width: 720px) {
  .neun-woerter,
  body:not(.beamer) .karte .neun-woerter,
  .woerter-admin-karte .neun-woerter,
  .beamer .neun-woerter {
    grid-template-columns: 1fr;
  }

  .wort-klein,
  body:not(.beamer) .karte .wort-klein,
  .woerter-admin-karte .wort-klein,
  .beamer .wort-klein {
    font-size: 21px;
    min-height: 52px;
  }
}
