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

:root {
  --bg: #14162b;
  --bg-card: #1f2240;
  --bg-input: #2a2d52;
  --accent: #ffb830;
  --accent-dark: #e09a10;
  --text: #f0f1fa;
  --text-dim: #9ba0c4;
  --good: #4cd97b;
  --bad: #ff5d73;
  --radius: 14px;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 20% 0%, #23264a 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
}

#app {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.hidden {
  display: none !important;
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: stretch;
}

/* ---------- Typografie ---------- */
.logo {
  font-size: 3.2rem;
  text-align: center;
  letter-spacing: -1px;
  margin-top: 24px;
}
.logo span {
  color: var(--accent);
}
.tagline {
  text-align: center;
  color: var(--text-dim);
}
h2 {
  text-align: center;
  font-size: 1.6rem;
}
h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
}
.prompt {
  text-align: center;
  font-size: 1.15rem;
}
.hint {
  color: var(--text-dim);
  font-size: 0.88rem;
  text-align: center;
}
.error {
  color: var(--bad);
  text-align: center;
  font-size: 0.9rem;
}
.success {
  color: var(--good);
  text-align: center;
}
.warn {
  color: var(--accent);
  text-align: center;
  font-size: 0.9rem;
}

/* ---------- Karten & Inputs ---------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

label {
  font-size: 0.85rem;
  color: var(--text-dim);
}

input[type='text'],
input:not([type]) {
  background: var(--bg-input);
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 1rem;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}
input:focus {
  border-color: var(--accent);
}

#code-input {
  text-transform: uppercase;
  letter-spacing: 4px;
  font-weight: 700;
  text-align: center;
  width: 110px;
}

button {
  background: var(--bg-input);
  border: none;
  border-radius: 10px;
  color: var(--text);
  padding: 12px 18px;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.08s, background 0.15s;
}
button:hover:not(:disabled) {
  transform: translateY(-1px);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button.primary {
  background: var(--accent);
  color: #201a05;
  font-weight: 700;
}
button.primary:hover:not(:disabled) {
  background: var(--accent-dark);
}
button.big {
  padding: 15px 24px;
  font-size: 1.1rem;
}
.link-btn {
  background: none;
  color: var(--accent);
  text-decoration: underline;
  padding: 6px;
  font-size: 0.9rem;
}

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}
.join-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.input-row {
  display: flex;
  gap: 10px;
}
.input-row input {
  flex: 1;
}

/* ---------- Spielauswahl (Startseite) ---------- */
.game-picker {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.game-cat-title {
  margin: 0 0 8px;
  font-size: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}
.game-cat-hint {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-dim);
}
.game-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
@media (max-width: 560px) {
  .game-cat-grid {
    grid-template-columns: 1fr;
  }
}
/* Spielauswahl in der Lobby, ebenfalls nach Kategorien */
.game-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.game-group-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.game-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  padding: 14px;
  background: var(--bg-card);
  border: 2px solid transparent;
}
.game-card.active {
  border-color: var(--accent);
  background: rgba(255, 184, 48, 0.1);
}
.game-emoji {
  font-size: 1.8rem;
  line-height: 1;
}
.game-name {
  font-weight: 800;
  font-size: 1.05rem;
}
.game-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.35;
}
.game-meta {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 700;
}

/* ---------- Spielregeln ---------- */
.rules {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.rules summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
}
.rules ol {
  margin: 10px 0 2px 20px;
  font-size: 0.86rem;
  color: var(--text-dim);
  line-height: 1.45;
}
.rules li {
  margin-bottom: 6px;
}

/* ---------- Lobby ---------- */
.code-badge {
  background: var(--accent);
  color: #201a05;
  border-radius: 8px;
  padding: 2px 12px;
  letter-spacing: 3px;
  font-weight: 800;
}
.lobby-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 560px) {
  .lobby-grid {
    grid-template-columns: 1fr;
  }
}

.player-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.player-list li {
  background: var(--bg-input);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tag {
  font-size: 0.7rem;
  background: var(--accent);
  color: #201a05;
  border-radius: 6px;
  padding: 1px 7px;
  font-weight: 700;
}
.tag.you {
  background: #6c7bff;
  color: #fff;
}
.tag.ok {
  background: var(--good);
  color: #06280f;
}
.tag.wait {
  background: var(--bg);
  color: var(--text-dim);
}
.tag.offline {
  background: var(--bad);
  color: #fff;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.btn-group button {
  flex: 1;
  padding: 10px 6px;
  font-size: 0.92rem;
}
.btn-group button.active {
  background: var(--accent);
  color: #201a05;
  font-weight: 700;
}

input[type='range'] {
  width: 100%;
  accent-color: var(--accent);
}

/* ---------- Spiel ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.95rem;
}

.word-card {
  background: linear-gradient(145deg, #fff8e8, #ffe9b8);
  color: #2b2005;
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  padding: 34px 20px;
  border-radius: var(--radius);
  letter-spacing: 1px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  margin: 8px auto;
  width: 100%;
  max-width: 420px;
}
.word-card.mystery {
  background: linear-gradient(145deg, #2a2d52, #1f2240);
  color: var(--accent);
  font-size: 3rem;
}

.clue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.clue-card {
  background: #fff8e8;
  color: #2b2005;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
/* Platzhalter-Kacheln in der Tipp-Phase: gleiche Plätze wie die späteren Tipps */
.clue-card.pending {
  background: transparent;
  border: 2px dashed var(--bg-input);
  color: var(--text-dim);
}
.clue-card.pending .clue-text {
  color: var(--text-dim);
}
.clue-card.done {
  background: var(--bg-input);
  color: var(--text);
}
.clue-card.done .clue-text {
  color: var(--good);
}
.offline-tag {
  color: var(--bad);
  font-weight: 700;
}
/* Statuskachel mit grünem Verlaufsbalken im Hintergrund: zeigt, wie weit
   jemand ist (getippte Hinweise bzw. belegte Blütenblätter). */
.clue-card.status-card {
  position: relative;
  overflow: hidden;
}
.status-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, rgba(76, 217, 123, 0.22), rgba(76, 217, 123, 0.5));
  transition: width 350ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
.clue-card.status-card.done .status-fill {
  background: linear-gradient(90deg, rgba(76, 217, 123, 0.42), rgba(76, 217, 123, 0.7));
}
.status-body {
  position: relative;
}
/* Auf dem grünen Verlauf braucht es hellen Text statt Grün auf Grün */
.clue-card.status-card .clue-text,
.clue-card.status-card.done .clue-text {
  color: var(--text);
}
.clue-card.status-card .clue-meta {
  color: var(--text);
  opacity: 0.85;
}
@media (prefers-reduced-motion: reduce) {
  .status-fill {
    transition: none;
  }
}
.clue-card.removed {
  background: #3a2530;
  color: var(--text-dim);
}
.clue-card.removed .clue-text {
  text-decoration: line-through;
  color: var(--bad);
}
.clue-text {
  font-weight: 800;
  font-size: 1.1rem;
  word-break: break-word;
}
.clue-meta {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 4px;
}
.removed-tag {
  color: var(--bad);
  font-weight: 700;
}

.attempt-info {
  text-align: center;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
}
.wrong-guesses {
  text-align: center;
  color: var(--bad);
  font-size: 0.9rem;
}
.wrong-guesses span {
  text-decoration: line-through;
}

/* ---------- Wortblüte: Blüte im 3×3-Raster ---------- */
/* Zeile 1: Lücke 3 · Blatt oben · Lücke 0
   Zeile 2: Blatt links · Mitte · Blatt rechts
   Zeile 3: Lücke 2 · Blatt unten · Lücke 1 */
.flower {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.petal {
  background: linear-gradient(145deg, #fff8e8, #ffe9b8);
  color: #2b2005;
  border-radius: 20px;
  padding: 10px 6px;
  min-height: 94px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}
.petal-word {
  font-weight: 800;
  font-size: clamp(0.82rem, 3.4vw, 1.1rem);
  line-height: 1.15;
  word-break: break-word;
  hyphens: auto;
}
.petal.empty {
  background: transparent;
  border: 2px dashed var(--bg-input);
  box-shadow: none;
  color: var(--text-dim);
}
.petal.empty .petal-word {
  color: var(--text-dim);
  font-size: 1.4rem;
}
.petal.editable,
.petal.droppable {
  cursor: pointer;
}
.petal.selected {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.petal-actions {
  display: flex;
  gap: 4px;
}
.petal-mini {
  background: rgba(43, 32, 5, 0.1);
  color: #2b2005;
  border-radius: 8px;
  padding: 3px 7px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.petal-mini:hover:not(:disabled) {
  background: rgba(43, 32, 5, 0.2);
}
.petal-by {
  font-size: 0.63rem;
  opacity: 0.7;
}
.petal-wrong {
  font-size: 0.78rem;
  text-decoration: line-through;
  color: #9c2b3a;
}
.petal.result.good {
  box-shadow: 0 0 0 3px var(--good), 0 6px 16px rgba(0, 0, 0, 0.28);
}
.petal.result.bad {
  box-shadow: 0 0 0 3px var(--bad), 0 6px 16px rgba(0, 0, 0, 0.28);
}

.gap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 2px;
  text-align: center;
}
.gap-num {
  color: var(--accent);
  font-weight: 800;
  font-size: 0.9rem;
}
.gap-clue {
  font-weight: 700;
  font-size: clamp(0.72rem, 2.8vw, 0.9rem);
  word-break: break-word;
  line-height: 1.15;
}
.flower-center {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
}

/* Kartenablage beim Lösen */
.hand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 8px;
}
.hand-card {
  background: linear-gradient(145deg, #fff8e8, #ffe9b8);
  color: #2b2005;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 8px;
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.25;
}
.hand-card.selected {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.hand-card.used {
  opacity: 0.4;
}
.hand-sep {
  opacity: 0.45;
  font-weight: 400;
}
.hand-badge {
  font-size: 0.66rem;
  font-weight: 700;
  opacity: 0.75;
}

/* ---------- Wortklee: 2×2-Kartenblock mit Hinweisfeldern außen ---------- */
/* Wie beim Original liegen die vier Karten dicht beieinander; gelesen werden die
   acht Wörter an den Außenkanten. Die vier Hinweisfelder rahmen den Block:
   ① oben, ② rechts, ③ unten, ④ links. */
.flower.klee {
  max-width: 480px;
  grid-template-columns: minmax(42px, 0.58fr) 1fr 1fr minmax(42px, 0.58fr);
  grid-template-areas:
    '.  gt gt .'
    'gl f0 f1 gr'
    'gl f3 f2 gr'
    '.  gb gb .';
  gap: 6px;
  position: relative;
}
.kgap-t {
  grid-area: gt;
}
.kgap-r {
  grid-area: gr;
}
.kgap-b {
  grid-area: gb;
}
.kgap-l {
  grid-area: gl;
}
.kgap {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  min-height: 40px;
}
.kgap-l .gap-clue,
.kgap-r .gap-clue {
  font-size: clamp(0.62rem, 2.4vw, 0.82rem);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.kf0 {
  grid-area: f0;
}
.kf1 {
  grid-area: f1;
}
.kf2 {
  grid-area: f2;
}
.kf3 {
  grid-area: f3;
}
/* Kleine Plakette genau in der Mitte des Kartenblocks – nur Deko/Zähler */
.klee-hub {
  grid-row: 2 / 4;
  grid-column: 2 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}
.klee-hub .flower-center {
  background: var(--bg-card, #1b1b24);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.kcard {
  background: linear-gradient(145deg, #eefbe6, #cdefb9);
  color: #17300b;
  border-radius: 16px;
  padding: 5px;
  min-height: 122px;
  display: grid;
  grid-template-areas: '. t .' 'l c r' '. b .';
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  justify-items: center;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}
.kword {
  font-weight: 800;
  font-size: clamp(0.56rem, 2.3vw, 0.78rem);
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.45;
}
.kword.active {
  opacity: 1;
}
.kword.t {
  grid-area: t;
}
.kword.b {
  grid-area: b;
}
.kword.l {
  grid-area: l;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  max-height: 100%;
}
.kword.r {
  grid-area: r;
  writing-mode: vertical-rl;
  max-height: 100%;
}
.kcenter {
  grid-area: c;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}
.kempty {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-dim);
}
.kcard.empty {
  background: transparent;
  border: 2px dashed var(--bg-input);
  box-shadow: none;
}
.kcard.droppable {
  cursor: pointer;
}
.kcard.locked {
  outline: 3px solid var(--good);
  outline-offset: -3px;
}
.kcard.result.good {
  box-shadow: 0 0 0 3px var(--good), 0 6px 16px rgba(0, 0, 0, 0.28);
}
.kcard.result.bad {
  box-shadow: 0 0 0 3px var(--bad), 0 6px 16px rgba(0, 0, 0, 0.28);
}

/* Hinweis-Eingaben in der Bau-Phase */
.clue-inputs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.clue-input-row label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.85rem;
}
.clue-input-row .error {
  text-align: left;
  margin-top: 4px;
}

/* ---------- Wortecho: 3×3-Raster mit Bonus-Rand ---------- */
/* Drei Spalten für die Felder plus eine schmale Spalte für den Zeilenbonus;
   die letzte Zeile trägt die Spaltenboni. */
.echo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 6px;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}

.echo-cell {
  background: linear-gradient(145deg, #fff8e8, #ffe9b8);
  color: #2b2005;
  border-radius: 10px;
  padding: 8px 6px;
  min-height: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-align: center;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.echo-cell.empty {
  background: transparent;
  border: 2px dashed var(--bg-input);
  box-shadow: none;
}
.echo-cell.open {
  background: var(--bg-input);
  box-shadow: none;
  padding: 5px;
}
.echo-cell.open input {
  padding: 8px 6px;
  font-size: 0.88rem;
  text-align: center;
  background: var(--bg);
}
.echo-cell.bad input {
  border-color: var(--bad);
}
.echo-cell-error {
  font-size: 0.62rem;
  color: var(--bad);
  line-height: 1.2;
}
.echo-word {
  font-weight: 800;
  font-size: clamp(0.72rem, 3vw, 0.95rem);
  line-height: 1.15;
  word-break: break-word;
  hyphens: auto;
}
.echo-card-num {
  position: absolute;
  top: 2px;
  left: 5px;
  font-size: 0.62rem;
  opacity: 0.5;
}
.echo-mark {
  font-size: 0.72rem;
  font-weight: 800;
}
.echo-names {
  font-size: 0.6rem;
  opacity: 0.75;
  line-height: 1.15;
  word-break: break-word;
}
.echo-cell.result.hit {
  box-shadow: 0 0 0 3px var(--good), 0 4px 12px rgba(0, 0, 0, 0.25);
}
.echo-cell.result.echo {
  box-shadow: 0 0 0 3px #6c7bff, 0 4px 12px rgba(0, 0, 0, 0.25);
}
.echo-cell.result.blank {
  background: #3a2530;
  color: var(--text-dim);
  box-shadow: none;
}
.echo-cell.result.blank .echo-word {
  text-decoration: line-through;
}
/* Felder, die zu einer vollen Zeile oder Spalte gehören */
.echo-cell.result.inline::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 12px;
  border: 2px solid var(--accent);
  pointer-events: none;
}

.echo-bonus {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: 800;
  font-size: 0.8rem;
  min-width: 30px;
}
.echo-bonus.corner {
  font-size: 0.6rem;
  color: var(--text-dim);
  font-weight: 600;
}

/* Thema als Karte über dem Raster */
.topic-card {
  font-size: clamp(1.1rem, 5vw, 1.6rem);
  padding: 22px 18px;
  letter-spacing: 0;
}

.topic-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 480px) {
  .topic-options {
    grid-template-columns: 1fr;
  }
}
.topic-option {
  background: linear-gradient(145deg, #fff8e8, #ffe9b8);
  color: #2b2005;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.25;
  padding: 22px 14px;
  min-height: 96px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}
.topic-option:disabled {
  opacity: 0.55;
}

.attempt-info.ready {
  color: var(--good);
}

/* Punktestand-Listen */
.score-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.score-list li {
  background: var(--bg-input);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.score-list li.you {
  outline: 2px solid var(--accent);
}
.round-delta {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.8rem;
}

/* Auflösung: welche Antworten wurden zu welchem Thema geschrieben? */
.topic-result + .topic-result {
  margin-top: 14px;
}
.topic-result h4 {
  font-size: 0.92rem;
  color: var(--accent);
  margin-bottom: 6px;
}
.group-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.group-list li {
  background: var(--bg-input);
  border-radius: 8px;
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.85rem;
  opacity: 0.6;
}
.group-list li.matched {
  opacity: 1;
  border-left: 3px solid var(--good);
}
.group-words {
  font-weight: 700;
  word-break: break-word;
}
.group-names {
  color: var(--text-dim);
  font-size: 0.78rem;
  text-align: right;
  word-break: break-word;
}

/* ---------- Auflösung & Ende ---------- */
.result-banner {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: var(--radius);
  padding: 16px;
}
.result-banner.good {
  background: rgba(76, 217, 123, 0.15);
  color: var(--good);
}
.result-banner.bad {
  background: rgba(255, 93, 115, 0.15);
  color: var(--bad);
}
.result-banner.neutral {
  background: var(--bg-card);
  color: var(--text-dim);
}
.big-score {
  font-size: 2.6rem;
  background: var(--bg-card);
  color: var(--accent);
}

.results-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.results-list li {
  background: var(--bg-input);
  border-radius: 8px;
  padding: 8px 12px;
}
.result-points {
  color: var(--good);
  font-weight: 700;
}

/* ---------- Effekte & Animationen ---------- */
@keyframes flip-in {
  from {
    transform: perspective(600px) rotateX(90deg);
    opacity: 0;
  }
  to {
    transform: perspective(600px) rotateX(0deg);
    opacity: 1;
  }
}
.flip-in {
  animation: flip-in 0.45s ease-out both;
  backface-visibility: hidden;
}

@keyframes pop-in {
  from {
    transform: scale(0.7);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
.pop-in {
  animation: pop-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ---------- Serie (Streak) ---------- */
@keyframes streak-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}
.streak-badge {
  background: rgba(255, 184, 48, 0.15);
  color: var(--accent);
  border-radius: 6px;
  padding: 1px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-left: 8px;
  display: inline-block;
  /* Nur ein paar Mal pulsieren – eine Endlos-Animation hält die GPU dauerhaft wach */
  animation: streak-pulse 1.6s ease-in-out 3;
}
.streak-bonus {
  display: block;
  font-size: 0.95rem;
  color: var(--accent);
  margin-top: 6px;
}

/* ---------- Emoji-Reaktionen ---------- */
.reaction-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.reaction-btn {
  font-size: 1.3rem;
  padding: 8px 10px;
  border-radius: 50%;
  background: var(--bg-card);
  line-height: 1;
}
.reaction-btn:hover:not(:disabled) {
  transform: scale(1.2);
}
.reaction-btn:active {
  transform: scale(1.35);
}

@keyframes float-up {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-45vh);
    opacity: 0;
  }
}
.reaction-float {
  position: fixed;
  bottom: 18vh;
  z-index: 15;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: float-up 2.2s ease-out both;
}
.reaction-float-emoji {
  font-size: 2rem;
}
.reaction-float-name {
  font-size: 0.7rem;
  color: var(--text-dim);
  background: rgba(20, 22, 43, 0.7);
  border-radius: 6px;
  padding: 1px 6px;
}

/* ---------- Awards & Statistik ---------- */
.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.awards-grid:empty {
  display: none;
}
.award-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 184, 48, 0.35);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.award-emoji {
  font-size: 1.8rem;
}
.award-title {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
}
.award-winner {
  font-weight: 700;
  font-size: 0.95rem;
}
.award-desc {
  color: var(--text-dim);
  font-size: 0.78rem;
}

.table-wrap {
  overflow-x: auto;
}
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.stats-table th {
  color: var(--text-dim);
  font-weight: 600;
  text-align: right;
  padding: 6px 8px;
  white-space: nowrap;
}
.stats-table td {
  background: var(--bg-input);
  padding: 7px 8px;
  text-align: right;
  white-space: nowrap;
}
.stats-table th:first-child,
.stats-table td:first-child {
  text-align: left;
  border-radius: 8px 0 0 8px;
}
.stats-table td:last-child {
  border-radius: 0 8px 8px 0;
}
.stats-table tr {
  border-bottom: 3px solid var(--bg-card);
}

/* ---------- Mute-Button ---------- */
#btn-mute {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 30;
  background: none;
  font-size: 1.2rem;
  padding: 8px;
  opacity: 0.7;
}
#btn-mute:hover {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .flip-in,
  .pop-in,
  .reaction-float,
  .streak-badge {
    animation: none;
  }
}

/* ---------- Rennfieber ---------- */
.logo .logo-prefix {
  color: var(--text);
}

.bet-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-input);
  border-radius: 10px;
  padding: 8px 10px;
}
.bet-target {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.bet-emoji {
  font-size: 1.6rem;
}
.bet-name {
  font-weight: 700;
  font-size: 0.92rem;
}
.bet-lane {
  color: var(--text-dim);
  font-size: 0.72rem;
}
.bet-side-text {
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.3;
}
.bet-choice {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.bet-btn {
  padding: 8px 12px;
  font-size: 0.85rem;
  background: var(--bg);
  border-radius: 8px;
}
.bet-btn.active {
  background: var(--good);
  color: #06280f;
  font-weight: 700;
}
.bet-btn.risky.active {
  background: var(--bad);
  color: #fff;
}

.hand-card.streak-hand {
  align-items: center;
  text-align: center;
  cursor: pointer;
  border: none;
}
.streak-hand-icon {
  font-size: 1.6rem;
}

/* Rennkarte, die gerade aufgedeckt wird */
.race-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(145deg, #fff8e8, #ffe9b8);
  color: #2b2005;
  border-radius: var(--radius);
  padding: 14px 16px;
  width: 100%;
  max-width: 420px;
  min-height: 68px;
  margin: 0 auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.race-card-icon {
  font-size: 2rem;
}
.race-card-title {
  font-weight: 800;
  font-size: 1.05rem;
}
.race-card-sub {
  font-size: 0.76rem;
  opacity: 0.7;
}
.race-card-smuggled {
  margin-left: auto;
  background: #2b2005;
  color: var(--accent);
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Die Rennbahn: Raster aus Feldern, Tokens laufen absolut positioniert darüber */
.race-board {
  position: relative;
  margin: 0 auto;
}
.race-lanes {
  display: grid;
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 8px;
  overflow: hidden;
}
.race-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  background: #23264a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  color: rgba(255, 184, 48, 0.55);
}
.race-cell.startcol {
  background: #2a2d52;
}
.race-finishline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  background: repeating-linear-gradient(0deg, #f0f1fa 0 6px, #14162b 6px 12px);
  border-radius: 2px;
}
.race-podium {
  position: absolute;
  top: 0;
  display: flex;
  flex-direction: column;
}
.race-podium-slot {
  width: 60px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 6px;
  color: var(--text-dim);
  font-weight: 800;
  font-size: 0.8rem;
  border: 1px dashed var(--bg-input);
  border-radius: 6px;
}
.race-token {
  position: absolute;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  z-index: 2;
  /* Position über die eigenständige translate-Eigenschaft: läuft auf dem
     Compositor statt bei jedem Frame Layout und Repaint auszulösen.
     (Fallback für alte Browser: left/top, siehe game-streak.js) */
  left: 0;
  top: 0;
  transition: translate 0.8s ease, left 0.8s ease, top 0.8s ease;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.5));
}
.race-token.fallen {
  transform: rotate(100deg);
}
.race-token.back {
  transform: scaleX(-1);
}
.race-token.fallen.back {
  transform: scaleX(-1) rotate(100deg);
}
.race-token.dq {
  opacity: 0.35;
  filter: grayscale(1);
}
.race-token.no-anim {
  transition: none;
}

.race-ticker {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--text-dim);
}
.race-ticker li:first-child {
  color: var(--text);
}

/* Auszahlung */
.spay-player {
  background: var(--bg-input);
  border-radius: 10px;
  padding: 10px 12px;
}
.spay-player + .spay-player {
  margin-top: 8px;
}
.spay-player.you {
  outline: 2px solid var(--accent);
}
.spay-player-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
}
.spay-bets {
  list-style: none;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.83rem;
}
.spay-bets li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.spay-cash {
  text-align: left;
  margin-top: 6px;
}
.spay-doubled {
  color: var(--accent);
}
.good-txt {
  color: var(--good);
}
.bad-txt {
  color: var(--bad);
}

@media (prefers-reduced-motion: reduce) {
  .race-token {
    transition: none;
  }
}

/* ---------- Wortblüte: große Auswertung am Spielende ---------- */

/* Während der Partie steht rechts oben nur der Fortschritt, kein Punktestand */
.topbar-progress {
  color: var(--text-dim);
  font-weight: 600;
}
.stat-sub {
  color: var(--text-dim);
  font-size: 0.78em;
  font-weight: 600;
}

/* Endstand als gestapelter Balken: links die Punkte fürs Erratenwerden,
   rechts die fürs eigene Raten. Alle Balken teilen sich dieselbe Skala. */
.score-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.score-bar-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.score-bar-row.you .sb-name {
  color: var(--accent);
}
.sb-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.92rem;
}
.sb-rank {
  color: var(--text-dim);
  min-width: 1.7em;
}
.sb-name {
  font-weight: 700;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sb-total {
  font-weight: 800;
  color: var(--accent);
}
.sb-track {
  display: flex;
  height: 22px;
  border-radius: 11px;
  overflow: hidden;
  background: var(--bg-input);
}
.sb-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #16182c;
  min-width: 0;
  overflow: hidden;
  transform-origin: left center;
  animation: bar-grow 700ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.sb-seg.own {
  background: linear-gradient(90deg, #ff9ecb, #ff77b4);
}
.sb-seg.guess {
  background: linear-gradient(90deg, #6fe0ff, #45c2f0);
}
.sb-seg.speed {
  background: linear-gradient(90deg, #8ef0b4, #4cd97b);
}
.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  vertical-align: -1px;
}
.legend-dot.own {
  background: #ff77b4;
}
.legend-dot.guess {
  background: #45c2f0;
}
.legend-dot.speed {
  background: #4cd97b;
}

/* Quoten-Diagramme: ein Balken pro Person, 0–100 % */
.chart-grid {
  display: grid;
  gap: 18px;
}
@media (min-width: 620px) {
  .chart-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.quota-bars {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.quota-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 10px;
  align-items: center;
}
.q-name {
  font-size: 0.88rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quota-row.you .q-name {
  color: var(--accent);
}
.q-val {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.q-track {
  grid-column: 1 / -1;
  height: 14px;
  border-radius: 7px;
  background: var(--bg-input);
  overflow: hidden;
}
.q-fill {
  height: 100%;
  border-radius: 7px;
  transform-origin: left center;
  animation: bar-grow 700ms cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.q-fill.own {
  background: linear-gradient(90deg, #ff9ecb, #ff77b4);
}
.q-fill.guess {
  background: linear-gradient(90deg, #6fe0ff, #45c2f0);
}
.quota-empty {
  color: var(--text-dim);
  font-size: 0.85rem;
}

@keyframes bar-grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* Auflösung: eine aufklappbare Karte pro Blüte */
.flower-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.flower-detail {
  background: var(--bg-input);
  border-radius: 10px;
  overflow: hidden;
}
.flower-detail > summary {
  cursor: pointer;
  padding: 10px 12px;
  font-size: 0.9rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.flower-detail > summary::-webkit-details-marker {
  display: none;
}
.flower-detail > summary::before {
  content: '▸';
  color: var(--text-dim);
}
.flower-detail[open] > summary::before {
  content: '▾';
}
.fd-body {
  padding: 4px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fd-body .flower {
  margin: 0 auto;
}
.fd-label {
  flex: 1;
}
.fd-points {
  margin-left: auto;
  font-weight: 800;
  color: var(--accent);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  .sb-seg,
  .q-fill {
    animation: none;
  }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #201a05;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

/* ---------- Wortduell ---------- */
#setting-duell button {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: var(--bg-input);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  margin: 4px 0 6px;
}
#setting-duell button:hover {
  filter: brightness(1.15);
}

.code-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.code-card {
  position: relative;
  border: 2px solid var(--bg-input);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  min-height: 56px;
  padding: 6px 3px;
  font-weight: 700;
  font-size: 0.72rem;
  text-align: center;
  cursor: default;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.code-card.pick {
  cursor: pointer;
  background: linear-gradient(145deg, #fff8e8, #ffe9b8);
  color: #2b2005;
  border-color: #e6d3a0;
}
.code-card.pick:hover {
  filter: brightness(1.06);
}
.code-card.selected {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
}
/* Tippgeber-Sicht: verdeckte Karten mit farbiger Markierung */
.code-card.key.rot {
  border-color: #ff5d73;
  box-shadow: inset 0 0 0 100vmax rgba(255, 93, 115, 0.16);
}
.code-card.key.blau {
  border-color: #58a6ff;
  box-shadow: inset 0 0 0 100vmax rgba(88, 166, 255, 0.16);
}
.code-card.key.neutral {
  border-color: #b8a97c;
}
.code-card.key.bombe {
  border-color: #000;
  background: #101017;
}
.code-card.key.bombe::after {
  content: '💣';
  position: absolute;
  top: 1px;
  right: 3px;
  font-size: 0.7rem;
}
/* Aufgedeckte Karten in Vollfarbe */
.code-card.revealed {
  border-color: transparent;
  color: #fff;
}
.code-card.revealed .code-word {
  opacity: 0.85;
}
.code-card.revealed.rot {
  background: linear-gradient(145deg, #e0455c, #b02940);
}
.code-card.revealed.blau {
  background: linear-gradient(145deg, #3f7fd4, #2b5aa8);
}
.code-card.revealed.neutral {
  background: linear-gradient(145deg, #8d8467, #6d6650);
}
.code-card.revealed.bombe {
  background: #060609;
  border-color: #444;
}
.code-card.revealed.bombe::after {
  content: '💣';
  display: block;
  font-size: 1rem;
}

.result-banner.team-rot {
  background: rgba(255, 93, 115, 0.16);
  color: #ff8ea0;
}
.result-banner.team-blau {
  background: rgba(88, 166, 255, 0.16);
  color: #8fc1ff;
}

.code-team {
  border: 2px solid transparent;
}
.code-team.rot.active-turn {
  border-color: #ff5d73;
}
.code-team.blau.active-turn {
  border-color: #58a6ff;
}

/* Wort-Chips im Hinweis-Verlauf */
.code-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  margin: 2px 2px 0 0;
  background: var(--bg-input);
}
.code-chip.rot {
  background: rgba(255, 93, 115, 0.25);
  color: #ff8ea0;
}
.code-chip.blau {
  background: rgba(88, 166, 255, 0.25);
  color: #8fc1ff;
}
.code-chip.neutral {
  background: rgba(184, 169, 124, 0.25);
  color: #d5c9a3;
}
.code-chip.bombe {
  background: #060609;
  color: #ff5d73;
}

/* Hinweis-Eingabe: Zahl-Auswahl neben dem Textfeld */
#cclue-count {
  background: var(--bg-input);
  color: var(--text);
  border: none;
  border-radius: 10px;
  padding: 0 10px;
  font-weight: 700;
}

@media (min-width: 480px) {
  .code-card {
    font-size: 0.82rem;
    min-height: 64px;
  }
}

/* ===== Zauberstich ===== */

/* Hausregeln in der Lobby: Umschalter mit Kästchen und Erklärung */
.rule-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rule-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  background: var(--bg-input);
  border: 1px solid transparent;
  padding: 10px 12px;
  font-size: 0.9rem;
  line-height: 1.35;
}
.rule-toggle.active {
  border-color: var(--accent);
  background: rgba(255, 184, 48, 0.12);
}
.rule-box {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 5px;
  border: 2px solid var(--text-dim);
  position: relative;
}
.rule-toggle.active .rule-box {
  border-color: var(--accent);
  background: var(--accent);
}
.rule-toggle.active .rule-box::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #231a04;
  font-size: 0.85rem;
  font-weight: 900;
}
.rule-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.rule-text strong {
  color: var(--text);
}
.rule-text small {
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.4;
}

/* Spielkarten */
.z-card {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 76px;
  border-radius: 8px;
  background: #f6f4ee;
  color: #1b1b24;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  flex: 0 0 auto;
}
.z-card.red {
  color: #d22d4a;
}
.z-card .zc-corner {
  position: absolute;
  top: 3px;
  left: 5px;
  font-size: 0.8rem;
  line-height: 1;
}
.z-card .zc-corner.bot {
  top: auto;
  left: auto;
  right: 5px;
  bottom: 3px;
  transform: rotate(180deg);
}
.z-card .zc-main {
  font-size: 1.9rem;
  line-height: 1;
}
.z-card.special {
  background: linear-gradient(160deg, #2f3570, #4a2d6b);
  color: #ffe9b8;
}
.z-card.special .zc-main {
  font-size: 1.6rem;
}
.z-card.special .zc-label {
  font-size: 0.6rem;
  letter-spacing: 0.02em;
  position: absolute;
  bottom: 5px;
  left: 0;
  right: 0;
  text-align: center;
}
.z-card.special.magier {
  background: linear-gradient(160deg, #6b4ba8, #3a2170);
}
.z-card.special.titan {
  background: linear-gradient(160deg, #a8402b, #5d1c14);
}
.z-card.special.floh {
  background: linear-gradient(160deg, #2b8aa8, #14485d);
}
.z-card.special.fehlzauber {
  background: linear-gradient(160deg, #4a4a52, #22222a);
}
.z-card.special.cham {
  background: linear-gradient(160deg, #5f7fa8, #2c4660);
}
.z-card.special.verdeckt {
  background: repeating-linear-gradient(45deg, #2a2d52, #2a2d52 6px, #353a68 6px, #353a68 12px);
  color: var(--text-dim);
}
.z-card.blocked {
  opacity: 0.35;
  filter: grayscale(0.7);
}
.z-card.selected {
  outline: 3px solid var(--accent);
  transform: translateY(-6px);
}

/* Tisch mit den gespielten Karten */
.z-trick-area {
  min-height: 118px;
}
.z-table {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 14px 10px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: var(--radius);
  min-height: 112px;
  align-items: center;
}
.z-table.small .z-card {
  width: 42px;
  height: 60px;
}
.z-table.small .z-card .zc-main {
  font-size: 1.4rem;
}
.z-table.small .z-card.special .zc-label {
  display: none;
}
.z-table-empty {
  margin: 0;
}
.z-played {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.z-played-name {
  font-size: 0.72rem;
  color: var(--text-dim);
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.z-played.winner .z-card {
  outline: 3px solid var(--good);
  transform: translateY(-5px);
}
.z-played.winner .z-played-name {
  color: var(--good);
  font-weight: 700;
}

/* Eigene Hand */
.z-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.z-hand-card {
  background: none;
  border: none;
  padding: 0;
  line-height: 0;
}
.z-hand-card:disabled {
  cursor: default;
}
.z-hand-card:hover:not(:disabled) .z-card {
  transform: translateY(-5px);
}

/* Ansage */
.bid-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.z-bid-btn {
  min-width: 46px;
  font-size: 1.1rem;
  font-weight: 800;
  background: var(--bg-input);
}
.z-bid-btn.forbidden {
  text-decoration: line-through;
  opacity: 0.4;
}
.z-suit-btn {
  font-size: 1rem;
  font-weight: 700;
}
.z-suit-btn.red {
  color: #ff8fa0;
}
.warn-txt {
  color: var(--accent);
}
.z-trump-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 184, 48, 0.16);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
}

/* Ansagen- und Stichübersicht */
.z-seats {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.z-seats li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.9rem;
}
.z-seats li.you {
  outline: 1px solid var(--accent);
}
.z-seat-nums {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-dim);
}
.z-bid.hit {
  color: var(--good);
}
.z-score {
  color: var(--accent);
  font-weight: 700;
}

/* Hausregel „Hellsehen“: die Karten der anderen */
.z-foreheads {
  gap: 8px;
}
.z-forehead {
  display: flex;
  align-items: center;
  gap: 10px;
}
.z-forehead-name {
  font-weight: 700;
  min-width: 90px;
  font-size: 0.9rem;
}

.stats-table tr.you td {
  background: rgba(255, 184, 48, 0.08);
}

/* ---------- Profil: Bild, Name, Google-Konto ---------- */
.profile-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.profile-fields {
  flex: 1;
  min-width: 0;
  gap: 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.profile-fields input {
  width: 100%;
}
.link-btn.small {
  font-size: 0.8rem;
  padding: 4px 0;
}
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #6c7bff center / cover no-repeat;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  overflow: hidden;
}
.avatar-big {
  width: 64px;
  height: 64px;
  font-size: 1.6rem;
}
.avatar-btn {
  position: relative;
  padding: 0;
  background: none;
  border-radius: 50%;
  margin-top: 4px;
  flex: none;
}
.avatar-edit {
  position: absolute;
  right: -4px;
  bottom: -4px;
  background: var(--bg-input);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}
.account-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.google-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: #1f1f1f;
  font-size: 0.9rem;
  padding: 8px 14px;
}
.google-btn:hover {
  background: #f1f1f1;
}
.g-logo {
  font-weight: 800;
  color: #4285f4;
}
.account-status {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* ---------- Footer & Einwilligungsdialog ---------- */
.site-footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 0 16px 28px;
  font-size: 0.8rem;
}
.site-footer a,
.consent-links a {
  color: var(--text-dim);
}
.consent-banner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--bg-input);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  font-size: 0.9rem;
}
.consent-banner h3 {
  font-size: 1.05rem;
}
.consent-option {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.9rem;
}
.consent-option input {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}
.consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.consent-actions button {
  padding: 9px 14px;
  font-size: 0.9rem;
}

/* ---------- Startseite: Erstellen ODER Beitreten ---------- */
.home-choice {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: stretch;
}
.choice-panel {
  border: 2px solid transparent;
  transition: border-color 0.2s, opacity 0.2s;
}
.choice-panel h3 {
  margin-bottom: 2px;
}
.choice-panel .hint {
  text-align: left;
}
.choice-panel > button.big {
  margin-top: auto;
}
.choice-panel.focused {
  border-color: var(--accent);
}
.choice-panel.dimmed {
  opacity: 0.55;
}
.choice-panel.dimmed:hover,
.choice-panel.dimmed:focus-within {
  opacity: 1;
}
.choice-panel #code-input {
  width: 100%;
  font-size: 1.3rem;
}
.choice-or {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
}
.choice-or::before,
.choice-or::after {
  content: '';
  flex: 1;
  width: 2px;
  background: var(--bg-input);
}
.choice-or span {
  padding: 8px 0;
}
@media (max-width: 600px) {
  .home-choice {
    grid-template-columns: 1fr;
  }
  .choice-or {
    flex-direction: row;
  }
  .choice-or::before,
  .choice-or::after {
    width: auto;
    height: 2px;
  }
  .choice-or span {
    padding: 0 12px;
  }
}

.lobby-browser {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  padding: 0;
  margin: 0;
}
.lobby-browser li:not(.lobby-empty) {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: 'game join' 'info join';
  align-items: center;
  column-gap: 10px;
  background: var(--bg-input);
  border-radius: 10px;
  padding: 8px 10px;
}
.lobby-browser .lobby-empty {
  text-align: left;
}
.lb-game {
  grid-area: game;
  font-weight: 700;
}
.lb-info {
  grid-area: info;
  font-size: 0.82rem;
  color: var(--text-dim);
}
.lb-join {
  grid-area: join;
  padding: 8px 12px;
  font-size: 0.9rem;
  background: var(--bg-card);
}

/* ---------- Rechtliches (Impressum, Datenschutz) ---------- */
.legal {
  display: flex;
  flex-direction: column;
  gap: 12px;
  line-height: 1.55;
}
.legal h1 {
  font-size: 1.8rem;
}
.legal h2 {
  text-align: left;
  font-size: 1.25rem;
  margin-top: 18px;
}
.legal h3 {
  font-size: 1.05rem;
  margin-top: 8px;
}
.legal h4 {
  font-size: 0.95rem;
  margin-top: 4px;
}
.legal ul {
  padding-left: 1.3em;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.legal a {
  color: var(--accent);
}
.legal address {
  font-style: normal;
}
.legal code {
  background: var(--bg-input);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.85em;
  word-break: break-all;
}
.legal .eyebrow {
  color: var(--accent);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== Französisches Blatt (Skat, Doppelkopf) ===== */
.z-card.fr-card .zc-corner {
  font-size: 0.68rem;
  text-align: center;
  line-height: 1.05;
}
