body {
  font-family: var(--mp-font-sans);
  color: var(--mp-creme);
  background: var(--mp-seitenhintergrund);
  background-attachment: fixed;
}

@media (min-width: 1025px) {
  .app {
    grid-template-rows: 60px minmax(0, 1fr);
  }

  .table-layout {
    height: calc(100vh - 78px);
  }

  .center-table {
    height: calc(100% - 8px);
    margin-bottom: 0;
    background: #075437;
  }

  #table-message:not(.matchende-message) {
    top: 36%;
  }
}

.mehrspieler-topbar {
  border-radius: 0;
  border-bottom: 1px solid var(--mp-linie);
  background: var(--mp-kopfzeile);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.mehrspieler-topbar h1 {
  color: var(--mp-creme);
  line-height: 1.05;
}

.mehrspieler-topbar h1::after {
  content: "Mehrspieler";
  display: block;
  margin-top: 3px;
  color: var(--mp-seitentext);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.player.active {
  background: #326855;
  border-color: var(--mp-focus);
  outline-color: var(--mp-focus);
}

.mehrspieler-topbar .raum-anzeige {
  margin-left: auto;
  color: var(--mp-gold-hell);
  white-space: nowrap;
}

.mehrspieler-topbar .raum-anzeige strong {
  color: var(--mp-gold);
  font-family: var(--mp-font-code);
  letter-spacing: .1em;
}

.mehrspieler-topbar .help-link { margin-left: 0; }
.mehrspieler-topbar .doku-link {
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--mp-seitentext);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.mehrspieler-topbar .doku-link:hover,
.mehrspieler-topbar .doku-link:focus-visible { color: var(--mp-gold); background: rgba(240, 200, 90, .08); }
.mehrspieler-topbar .lobby-button {
  min-height: 40px;
  padding: 7px 13px;
  border: 1px solid rgba(240, 200, 90, .48);
  border-radius: 9px;
  color: var(--mp-creme);
  background: rgba(7, 29, 23, .72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}
.mehrspieler-topbar .lobby-button:hover,
.mehrspieler-topbar .lobby-button:focus-visible {
  border-color: var(--mp-gold);
  color: var(--mp-gold);
  background: rgba(11, 43, 34, .95);
  text-decoration: none;
  outline: none;
}

.tisch-wasserzeichen {
  position: absolute;
  left: 50%;
  top: 52%;
  z-index: 0;
  width: clamp(190px, 28%, 390px);
  height: auto;
  opacity: .07;
  pointer-events: none;
  user-select: none;
  transform: translate(-50%, -50%);
}

#table {
  z-index: 1;
  pointer-events: none;
}

#trumpf-modal .trumpf-btn {
  color: #172017;
  -webkit-text-fill-color: #172017;
}

.spieler-status { font-size: .72em; font-weight: 700; }
.spieler-status.ki-aktiv { color: var(--mp-gold-hell); }
.spieler-status.getrennt { color: var(--mp-team-rot); }
.raumleitung-badge {
  display: inline-block;
  margin-left: 5px;
  padding: 2px 5px;
  border: 1px solid rgba(255, 215, 0, .75);
  border-radius: 5px;
  color: var(--mp-focus);
  background: rgba(25, 45, 20, .88);
  font-size: .55em;
  line-height: 1.2;
  letter-spacing: .03em;
  text-transform: uppercase;
  vertical-align: middle;
}

@media (min-width: 1025px) {
  .player-left h2,
  .player-right h2 {
    display: flex;
    align-items: center;
    gap: 5px;
    writing-mode: horizontal-tb;
  }

  .player-left h2 > .spieler-bezeichnung,
  .player-left h2 > .spieler-status,
  .player-left h2 > .raumleitung-badge {
    writing-mode: vertical-rl;
    text-orientation: mixed;
  }

  .player-right h2 > .spieler-bezeichnung,
  .player-right h2 > .spieler-status,
  .player-right h2 > .raumleitung-badge {
    writing-mode: vertical-lr;
    text-orientation: mixed;
  }

  .player-left h2 > .raumleitung-badge,
  .player-right h2 > .raumleitung-badge {
    margin-left: 0;
  }

  .player-top h2,
  .player-bottom h2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .player-top h2 > .raumleitung-badge,
  .player-bottom h2 > .raumleitung-badge {
    order: -1;
    margin-left: 0;
  }

  .table-layout {
    grid-template-columns: 210px minmax(760px, 1fr) 210px;
  }

  .info-box {
    padding: 16px;
    border: 1px solid var(--mp-linie);
    border-radius: var(--mp-radius-panel);
    background: var(--mp-panel);
    box-shadow: var(--mp-schatten-klein);
  }

  .info-box h2 {
    margin-bottom: 15px;
    color: var(--mp-creme);
    font-size: 18px;
  }

  #status,
  #score {
    padding: 0;
    border-radius: 0;
    color: rgba(255, 248, 223, .9);
    background: transparent;
    font-size: 13px;
    line-height: 1.38;
    overflow-wrap: anywhere;
  }
}

.info-gruppe,
.punkte-team,
.gesamt-team {
  display: grid;
  gap: 3px;
}

.info-gruppe,
.punkte-team {
  margin-bottom: 11px;
}

.info-runde {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 248, 223, .16);
}

.info-zeile {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.info-zeile-mehrzeilig {
  display: block;
  margin-top: 7px;
  margin-bottom: 9px;
}

.info-zeile-mehrzeilig > strong,
.info-zeile-mehrzeilig > span {
  display: block;
}

.info-zeile-mehrzeilig > span {
  margin-top: 2px;
}

.info-ueberschrift {
  margin-top: 22px;
  margin-bottom: 9px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 248, 223, .16);
  color: rgba(255, 248, 223, .72);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.team-marke {
  font-weight: 800;
}

.team-gruen-info .team-marke,
.team-marke.team-gruen-info {
  color: var(--mp-team-gruen);
}

.team-rot-info .team-marke,
.team-marke.team-rot-info {
  color: var(--mp-team-rot);
}

.punkte-team,
.gesamt-team {
  padding: 8px 9px;
  border: 1px solid rgba(255, 248, 223, .1);
  border-left-width: 3px;
  border-radius: 9px;
  background: rgba(0, 0, 0, .14);
}

.punkte-team.team-gruen-info,
.gesamt-team.team-gruen-info {
  border-left-color: var(--mp-team-gruen);
  background: linear-gradient(100deg, rgba(48, 128, 82, .2), rgba(0, 0, 0, .12));
}

.punkte-team.team-rot-info,
.gesamt-team.team-rot-info {
  border-left-color: var(--mp-team-rot);
  background: linear-gradient(100deg, rgba(128, 55, 55, .2), rgba(0, 0, 0, .12));
}

.gesamt-team + .gesamt-team {
  margin-top: 13px;
}

.info-am-zug {
  margin-top: 13px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, .18);
}

.verbindungsstatus {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--mp-seitentext);
  background: transparent;
  font-size: 13px;
  white-space: nowrap;
}

.verbindungsstatus.online::before,
.verbindungsstatus.offline::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--mp-team-gruen);
  box-shadow: 0 0 0 4px rgba(105, 219, 145, .12);
}

.verbindungsstatus.offline::before { background: #ff7b72; }

.player.team-gruen h2 .team-name,
.mobile-opponent.team-gruen { color: var(--mp-team-gruen); }

.player.team-rot h2 .team-name,
.mobile-opponent.team-rot { color: var(--mp-team-rot); }

.karte.mp-gesperrt {
  cursor: not-allowed;
  pointer-events: none;
}

.karte.mp-erlaubt { cursor: pointer; }

.gegnerkarte { pointer-events: none; }

.slalom-stichmodus { color: inherit; }

.zug-hinweis {
  position: absolute;
  left: 50%;
  top: 31%;
  z-index: 85;
  width: max-content;
  max-width: min(430px, 74%);
  padding: 9px 16px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 12px;
  background: rgba(3, 25, 18, .9);
  box-shadow: 0 5px 16px rgba(0, 0, 0, .3);
  color: #fff;
  text-align: center;
  line-height: 1.25;
  pointer-events: none;
}

.zug-hinweis strong {
  display: block;
  margin-bottom: 2px;
  color: var(--mp-gold-hell);
  font-size: clamp(13px, 1.5vw, 18px);
}

.zug-hinweis span {
  display: block;
  font-size: clamp(11px, 1.15vw, 14px);
}

.zug-hinweis.ist-eigen {
  border-color: var(--mp-focus);
  background: rgba(31, 91, 45, .96);
  box-shadow: 0 0 0 3px rgba(255, 212, 0, .14), 0 5px 18px rgba(0, 0, 0, .36);
}

.zug-hinweis.ist-eigen strong { color: var(--mp-gold-hell); }
.zug-hinweis.zeitwarnung {
  border-color: #ff9c9c;
  background: rgba(88, 32, 28, .95);
  box-shadow: 0 0 0 3px rgba(255, 156, 156, .13), 0 5px 18px rgba(0, 0, 0, .4);
}
.zug-hinweis.beendet { border-color: rgba(255, 212, 0, .65); }
.zug-hinweis.phase-rundenende,
.zug-hinweis.phase-matchende { top: 8%; }

.zug-hinweis.hat-aktion { pointer-events: auto; }

.zug-hinweis button {
  min-height: 40px;
  margin-top: 9px;
  padding: 8px 14px;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(180deg, var(--mp-gold-hell), var(--mp-gold));
  color: #172017;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.zug-hinweis button:hover,
.zug-hinweis button:focus-visible {
  filter: brightness(1.06);
}

#table-message:not(:empty) {
  display: flex;
}

#table-message.rundenende-message {
  box-sizing: border-box;
  width: min(300px, 72%);
  min-height: 0;
  padding: 14px 18px;
}

#table-message.rundenende-message .table-message-text {
  margin: 0;
  font-size: 11px;
  line-height: 1.25;
}

#table-message .runden-fortsetzen-button { display: none; }

#table-message button {
  min-height: 40px;
  margin-top: 8px;
  padding: 7px 14px;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(180deg, var(--mp-gold-hell), var(--mp-gold));
  color: #172017;
  font-weight: 800;
  cursor: pointer;
}

#table-message.matchende-message .matsch-hinweis {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--mp-focus);
  font-size: clamp(17px, 2vw, 24px);
}

#table-message.matchende-message .matsch-detail {
  color: #d8ffd8;
  font-size: 12px;
}

#table-message.spielstart-message .table-message-text {
  margin-bottom: 0;
  text-align: center;
}

.spiel-meldung {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 21000;
  max-width: min(390px, calc(100vw - 32px));
  padding: 11px 14px;
  border-radius: 10px;
  background: #132d24;
  border: 1px solid rgba(255, 255, 255, .3);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .4);
}

.spiel-meldung.fehler { border-color: #ff7b72; }

.spiel-meldung.wichtig {
  left: 50%;
  right: auto;
  top: 50%;
  bottom: auto;
  box-sizing: border-box;
  width: min(580px, calc(100vw - 32px));
  max-width: none;
  padding: clamp(22px, 4vw, 36px);
  transform: translate(-50%, -50%);
  border: 2px solid var(--mp-gold);
  border-radius: 16px;
  background: rgba(3, 34, 24, .97);
  box-shadow: 0 0 0 5px rgba(240, 200, 90, .12), 0 20px 60px rgba(0, 0, 0, .65);
  color: var(--mp-creme);
  font-size: clamp(19px, 3vw, 28px);
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}

#table-message.trumpf-ansage-message {
  width: min(430px, 78%);
  min-height: 0;
  padding: 18px 22px;
}

.trumpf-meldung-inhalt {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  text-align: center;
}

.trumpf-meldung-inhalt strong,
.trumpf-meldung-inhalt span { display: inline-flex; align-items: center; gap: 5px; }
.trumpf-meldung-inhalt strong { font-size: clamp(15px, 1.8vw, 21px); }
.trumpf-meldung-inhalt .trumpf-status-symbol { width: 28px; height: 28px; }
.trumpf-meldung-schieben { width: 100%; justify-content: center; color: var(--mp-creme); }

.spielverwaltung-modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(1, 16, 11, .76);
  backdrop-filter: blur(5px);
}

.spielverwaltung-modal.modal-hidden { display: none; }

.spielverwaltung-dialog {
  width: min(92vw, 470px);
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px;
  border: 2px solid var(--mp-focus);
  border-radius: var(--mp-radius-panel);
  color: var(--mp-creme);
  background: var(--mp-panel);
  box-shadow: 0 0 0 5px rgba(255, 215, 0, .12), 0 24px 60px rgba(0, 0, 0, .62);
}

.spielverwaltung-dialog h2 { margin: 0 0 8px; color: var(--mp-gold-hell); }
.spielverwaltung-dialog p { margin: 0 0 20px; color: rgba(255, 248, 223, .72); line-height: 1.45; }
.spielverwaltung-dialog label { display: block; margin: 0 0 6px; color: var(--mp-gold-hell); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.spielverwaltung-dialog select { width: 100%; min-height: 42px; margin-bottom: 12px; padding: 8px 10px; border: 1px solid rgba(240, 200, 90, .5); border-radius: var(--mp-radius-bedienung); color: var(--mp-creme); background: #092b20; }
.verwaltung-button,
.verwaltung-abbrechen { width: 100%; min-height: 42px; margin-top: 9px; padding: 9px 12px; border: 1px solid rgba(240, 200, 90, .42); border-radius: var(--mp-radius-bedienung); color: var(--mp-creme); background: rgba(0, 0, 0, .2); font: inherit; font-weight: 800; cursor: pointer; }
.verwaltung-button.primaer { border-color: var(--mp-gold); color: #162117; background: linear-gradient(var(--mp-gold-hell), var(--mp-gold)); }
.verwaltung-button.gefahr { border-color: rgba(255, 123, 114, .7); color: #ffc1bc; }
.bestaetigungs-dialog { width: min(92vw, 430px); }
.bestaetigungs-dialog h2 { color: #ffc1bc; }
.verwaltung-button.gefahr-bestaetigen {
  border-color: #ff8e88;
  color: #29100f;
  background: linear-gradient(180deg, #ffaaa4, #e8716b);
}
.verwaltung-button:disabled { opacity: .38; cursor: not-allowed; }
.verwaltung-abbrechen { border-color: transparent; color: rgba(255, 248, 223, .65); background: transparent; }
.verwaltung-button:hover:not(:disabled),
.verwaltung-button:focus-visible,
.verwaltung-abbrechen:hover { filter: brightness(1.1); }

@media (max-width: 700px) {
  .mehrspieler-topbar { gap: 8px; }
  .mehrspieler-topbar h1 { font-size: 16px; }
  .mehrspieler-topbar .raum-anzeige { font-size: 12px; }
  .mehrspieler-topbar .help-link { font-size: 0; padding: 6px; }
  .mehrspieler-topbar .help-link::after { content: "Lobby"; font-size: 12px; }
  .mehrspieler-topbar .doku-link { font-size: 0; padding: 6px 3px; }
  .mehrspieler-topbar .doku-link::after { content: "Hilfe"; font-size: 12px; }
  .verbindungsstatus { font-size: 0; padding: 7px; }
  .verbindungsstatus::before { margin-right: 0 !important; }
  .modal-content { min-width: 0; width: min(92vw, 420px); padding: 18px; }
  .zug-hinweis {
    top: 8px;
    max-width: calc(100% - 20px);
    padding: 7px 12px;
  }
  .tisch-wasserzeichen {
    top: 55%;
    width: min(46vw, 210px);
    opacity: .065;
  }
  .zug-hinweis.phase-rundenende,
  .zug-hinweis.phase-matchende { top: 8px; }
  .spielverwaltung-dialog { padding: 19px; }
}

@media (max-width: 1024px) {
  .mehrspieler-topbar .lobby-button,
  .zug-hinweis button,
  #table-message button,
  .verwaltung-button,
  .verwaltung-abbrechen {
    min-height: 44px;
  }

  #table-area {
    background-color: #0b5d3b;
  }

  /* Hält den oberen Meldungsbereich auf kleinen Bildschirmen frei. */
  #table {
    transform: translateY(clamp(34px, 8vw, 44px));
  }

  #table-area:has(#table-message.rundenende-message) {
    height: 340px;
  }

}

/* Gemeinsame Spielinformationen für Mobile und Desktop. */
  #mobile-game-info {
    display: grid;
    gap: 9px;
    padding: 10px;
    border: 1px solid rgba(255, 248, 223, .16);
    background: var(--mp-panel);
    box-shadow: var(--mp-schatten-klein);
  }

  #mobile-score-line {
    font-size: 13px;
    line-height: 1.25;
  }

  #mobile-status-line {
    display: grid;
    gap: 9px;
    color: rgba(255, 248, 223, .92);
    font-size: 13px;
    line-height: 1.3;
  }

  .mobile-gesamtzeile,
  .mobile-rundenzeile,
  .mobile-punktezeile {
    display: flex;
    align-items: stretch;
    gap: 7px;
  }

  .mobile-gesamtzeile {
    align-items: center;
    padding-bottom: 9px;
    border-bottom: 1px solid rgba(255, 248, 223, .22);
  }

  .mobile-gesamt-team {
    display: inline-flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid rgba(255, 248, 223, .12);
    border-radius: 7px;
  }

  .mobile-gesamt-team.team-gruen-info,
  .mobile-punkte-team.team-gruen-info {
    border-color: rgba(126, 231, 135, .18);
    border-left: 3px solid var(--mp-team-gruen);
    background: rgba(48, 128, 82, .24);
  }

  .mobile-gesamt-team.team-rot-info,
  .mobile-punkte-team.team-rot-info {
    border-color: rgba(255, 142, 142, .18);
    border-left: 3px solid var(--mp-team-rot);
    background: rgba(128, 55, 55, .24);
  }

  .mobile-gesamt-team.team-gruen-info span,
  .mobile-punkte-team.team-gruen-info .team-marke {
    color: var(--mp-team-gruen);
  }

  .mobile-gesamt-team.team-rot-info span,
  .mobile-punkte-team.team-rot-info .team-marke {
    color: var(--mp-team-rot);
  }

  .mobile-rundenzeile {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    justify-content: space-between;
    padding: 0 2px;
    border-bottom: 0;
  }

  .mobile-runden-titel {
    color: var(--mp-creme);
  }

  .mobile-rundenzeile span:nth-child(2) {
    text-align: center;
  }

  .mobile-trumpfblock {
    display: grid;
    gap: 4px;
  }

  .mobile-trumpfblock .team-marke {
    white-space: nowrap;
  }

  .mobile-punkte-team {
    display: grid;
    grid-template-columns: 1fr auto;
    flex: 1 1 0;
    gap: 2px 8px;
    min-width: 0;
    padding: 7px 9px;
    border: 1px solid rgba(255, 248, 223, .12);
    border-radius: 8px;
    text-align: left;
  }

  .mobile-punkte-team .team-marke {
    grid-column: 1 / -1;
    margin-bottom: 2px;
  }

  .mobile-punkte-team b {
    text-align: right;
  }

  .mobile-zugstatus {
    padding-top: 7px;
    border-top: 1px solid rgba(255, 248, 223, .16);
    color: var(--mp-gold-hell);
    font-weight: 700;
  }

@media (max-width: 1024px) {
  #mobile-opponents {
    gap: 7px;
  }

  .mobile-opponent {
    min-width: 0;
    padding: 8px 5px;
    border-color: rgba(255, 248, 223, .18);
    border-radius: 9px;
    background: linear-gradient(145deg, rgba(12, 67, 49, .76), rgba(5, 29, 22, .9));
    box-shadow: 0 6px 14px rgba(0, 0, 0, .16);
    line-height: 1.25;
  }

  .mobile-opponent.active {
    border: 2px solid #ffe386;
    background: linear-gradient(145deg, rgba(74, 91, 38, .72), rgba(19, 49, 31, .94));
    box-shadow: 0 0 0 3px rgba(255, 227, 134, .12), 0 7px 18px rgba(0, 0, 0, .2);
  }

  .mobile-opponent.active.team-gruen { color: var(--mp-team-gruen); }
  .mobile-opponent.active.team-rot { color: var(--mp-team-rot); }

  .player-local-human .karte {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
    line-height: 0;
  }

  .player-local-human .karte .kartenbild {
    display: block;
  }

  .mobile-host-badge {
    display: block;
    width: max-content;
    max-width: 100%;
    margin: 4px auto 0;
    padding: 2px 5px;
    border: 1px solid rgba(240, 200, 90, .45);
    border-radius: 5px;
    color: var(--mp-gold);
    font-size: 8px;
    line-height: 1.1;
    text-transform: uppercase;
  }

  #table-message:not(:empty) {
    border-width: 2px;
    border-radius: 14px;
    background: linear-gradient(155deg, rgba(12, 67, 49, .98), rgba(3, 25, 18, .99));
    box-shadow: 0 0 0 4px rgba(255, 248, 223, .08), 0 16px 34px rgba(0, 0, 0, .45);
  }

  /* Nicht über die erst nach dem Bildladen bekannte Boxhöhe zentrieren. */
  #table-message.trumpf-ansage-message,
  #table-message.stoeck-message {
    top: 10px;
    transform: translateX(-50%);
  }

  #table-message.stoeck-message .stoeck-karte {
    width: 48px;
    height: 86px;
    object-fit: contain;
  }

  #table-message.weis-message .weis-karte {
    aspect-ratio: 1323 / 2362;
    display: block;
  }

  #table-message.rundenende-message {
    top: 10px;
    width: min(calc(100% - 28px), 340px);
    padding: 13px 16px;
    transform: translateX(-50%);
    align-items: center;
    justify-content: center;
  }

  #table-message.rundenende-message .rundenende-titel {
    display: inline-block;
    margin-bottom: 5px;
    color: var(--mp-creme);
    font-size: 18px;
  }

  #table-message.rundenende-message .table-message-text {
    width: 100%;
    margin: 0;
    text-align: center;
    font-size: 11px;
    line-height: 1.18;
  }

  .zug-hinweis.phase-rundenende,
  .zug-hinweis.phase-matchende {
    top: auto;
    bottom: 8px;
  }
}

/* Muss nach allen allgemeinen und mobilen Zughinweis-Regeln stehen, damit
   die Karten auf Desktop wirklich durch die Meldung sichtbar bleiben. */
@media (min-width: 701px) {
  /* Bei geringer Desktophöhe würde der getrennte Aktionshinweis von der
     Rundenwertung verdeckt. Die Aktion sitzt deshalb direkt in der Meldung. */
  .zug-hinweis.phase-rundenende.hat-aktion { display: none; }

  #table-message .runden-fortsetzen-button {
    display: block;
    width: 100%;
    margin-top: 12px;
  }

  .zug-hinweis {
    background: rgba(3, 25, 18, .12);
    border-color: rgba(255, 255, 255, .58);
    box-shadow: 0 2px 7px rgba(0, 0, 0, .14);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 1);
  }

  .zug-hinweis.ist-eigen {
    background: rgba(31, 91, 45, .18);
    box-shadow: 0 0 0 2px rgba(255, 212, 0, .1),
      0 2px 7px rgba(0, 0, 0, .16);
  }
}


/* Desktop: volle Tischbreite und dieselbe Spielinfo wie auf Mobile. */
@media (min-width: 1025px) {
  .app { height: auto; min-height: 100vh; grid-template-rows: 60px auto; }
  .table-layout {
    min-width: 0;
    height: auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(620px, 1fr);
    grid-template-areas: "spielinfo" "table";
    gap: 12px;
  }
  .info-current, .info-total { display: none; }
  #mobile-game-info { grid-area: spielinfo; border-radius: 14px; padding: 12px 16px; }
  .center-table {
    width: 100%;
    height: max(620px, calc(100dvh - 400px));
    min-height: 620px;
    margin: 0;
    box-sizing: border-box;
    --hand-laenge: 420px;
    --hand-tiefe: 170px;
  }
  .player-top, .player-bottom { width: var(--hand-laenge); height: var(--hand-tiefe); }
  .player-left, .player-right { width: var(--hand-tiefe); height: var(--hand-laenge); }
  .player-top { top: 16px; }
  .player-bottom { bottom: 16px; }
  .player-left { left: 16px; }
  .player-right { right: 16px; }
  .player .karte { width: 60px; }
  .player-bottom h2 { top: 6px; bottom: auto; }
  .player-top h2, .player-bottom h2 { flex-direction: row; gap: 6px; font-size: 14px; }
  .player-top h2 > .raumleitung-badge, .player-bottom h2 > .raumleitung-badge { order: 0; }
  .player-top .player-hand, .player-bottom .player-hand { top: 15px; height: calc(100% - 15px); }
  /* 16px oberer Rand + Spielerhöhe + 12px Abstand. */
  .zug-hinweis:not(.phase-rundenende):not(.phase-matchende) {
    top: calc(16px + var(--hand-tiefe) + 12px);
  }
}

.spiel-melden-button { display: block; width: auto; margin: 12px auto 4px; padding: 7px 14px; border: 1px solid var(--mp-gold); border-radius: 8px; background: transparent; color: var(--mp-gold); font: inherit; cursor: pointer; }
.spiel-melden-hinweis { display: block; max-width: 240px; margin: 0 auto 10px; font-size: 11px; line-height: 1.3; opacity: .8; }

#table-message .spiel-melden-button { display: inline-block; width: auto; min-height: 0; margin: 8px auto 2px; padding: 3px 6px; border: 0; background: transparent; box-shadow: none; color: #afc4b9; font-size: 11px; font-weight: 400; text-decoration: underline; text-underline-offset: 3px; }
#table-message .spiel-melden-button:hover { color: #fff4d6; }
.spiel-melden-hinweis:empty { display: none; }
#spielmeldung-dialog { width: min(420px, calc(100vw - 32px)); box-sizing: border-box; max-height: 90dvh; overflow: auto; padding: 22px; border: 1px solid #68816d; border-radius: 16px; background: #0b2c20; color: #fff4d6; }
#spielmeldung-dialog::backdrop { background: #00120bb3; }
#spielmeldung-dialog h2 { margin: 0 0 18px; font-size: 20px; }
#spielmeldung-dialog label { display: block; margin-bottom: 8px; }
#spielmeldung-dialog textarea { width: 100%; box-sizing: border-box; padding: 10px; border: 1px solid #68816d; border-radius: 8px; background: #061e16; color: white; font: inherit; resize: vertical; }
.spielmeldung-aktionen { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
#spielmeldung-dialog button { width: auto; padding: 9px 12px; border: 1px solid #68816d; border-radius: 8px; background: transparent; color: #fff4d6; cursor: pointer; }
#spielmeldung-dialog button[type="submit"] { background: #e4c477; color: #15241a; }
#spielmeldung-dialog button:disabled { opacity: .5; cursor: wait; }
.spielmeldung-status { font-size: 13px; line-height: 1.4; }

.spiel-melden-zeile { display: block; width: 100%; text-align: center; }

.trumpf-zusatz-schalter { appearance: none; display: inline; width: auto; min-height: 0; padding: 3px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: inherit; font: inherit; font-weight: 700; cursor: pointer; opacity: .45; }
.trumpf-zusatz-schalter:hover, .trumpf-zusatz-schalter[aria-expanded="true"], .trumpf-zusatz-schalter:focus-visible { opacity: 1; }
.trumpf-zusatz-schalter:focus-visible { outline: 2px solid var(--mp-gold); outline-offset: 2px; }
.trumpf-zusatz-wert[hidden] { display: none !important; }

#mobile-status-line .mobile-rundenzeile, #mobile-score-line .mobile-rundenzeile { display: flex; justify-content: flex-start; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; }
.mobile-rundenzeile > span { white-space: nowrap; }
#mobile-status-line .mobile-trumpfblock, #mobile-score-line .mobile-trumpfblock { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.mobile-trumpfblock > .trumpf-zusatz { display: inline-block; white-space: nowrap; }

#mobile-score-line:empty, .info-total:has(#score:empty) { display: none; }
.punkte-spiel-label { padding-left: 12px; }
.punkte-detail-label { padding-left: 12px; }

#mobile-status-line .mobile-trumpfblock, #mobile-score-line .mobile-trumpfblock { display: block; }
.mobile-trumpfblock > div:first-child { display: inline; }
.mobile-trumpfblock > .trumpf-zusatz { display: inline; margin-left: 12px; white-space: nowrap; }

/* Zusatzpunkte bündig zum rechten Rand der Spielbeschriftung. */
.mobile-punkte-team .punkte-spiel-label, .mobile-punkte-team .punkte-detail-label { padding-left: 0; justify-self: start; width: 8.5em; max-width: 100%; text-align: right; }
.mobile-punkte-team .punkte-detail-label + b { font-weight: 400; }
.punkte-team .punkte-spiel-label, .punkte-team .punkte-detail-label { padding-left: 0; width: 8.5em; max-width: 100%; text-align: right; }
.punkte-team .punkte-detail-label + strong { font-weight: 400; }

.mobile-punkte-team .punkte-spiel-label + b, .punkte-team .punkte-spiel-label + strong { font-weight: 400; }

/* Trumpfname auf derselben Textgrundlinie wie die umgebenden Angaben. */
.mobile-trumpfblock .trumpf-status-anzeige, .info-trumpf .trumpf-status-anzeige { display: inline; vertical-align: baseline; }
.mobile-trumpfblock .trumpf-status-anzeige > .trumpf-status-symbol, .info-trumpf .trumpf-status-anzeige > .trumpf-status-symbol { vertical-align: middle; margin-right: 4px; }

.mobile-trumpfblock .mobile-ansage { margin-left: 12px; }

/* Matchaktionen für Sieg und Niederlage direkt in der Meldung. */
.zug-hinweis.phase-matchende { display: none !important; }
#table-message.matchende-message { max-height: 90dvh; overflow-y: auto; box-sizing: border-box; }
#table-message .matchende-aktionen { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
#table-message .matchende-aktionen button { display: inline-flex; align-items: center; justify-content: center; width: auto; min-width: 0; height: 40px; margin: 0; padding: 0 14px; border: 1px solid #d5b65f; border-radius: 8px; background: #f1d16e; color: #142b20; font: 700 14px/1 system-ui; cursor: pointer; }
#table-message .matchende-warten { margin: 14px 0 0; font: 400 14px/1.4 system-ui; }
