/*
 * Die Schirme vor dem Spiel: Startseite, Regeln, Rechtliches, Allein spielen,
 * Tisch eroeffnen, Einladung, Warteraum (siehe `src/lobby.ts`).
 *
 * Deckend, nicht durchscheinend. Wer den Tisch schon durchschimmern sieht, haelt
 * sich fuer angekommen und sucht den naechsten Knopf, statt zu lesen — und genau
 * das ging in der ersten Fassung schief.
 *
 * Farbmarken kommen aus `overlay.css`; wer dort das Thema wechselt, aendert auch
 * diese Flaeche.
 */

.fh-sheet {
  position: fixed;
  inset: 0;
  display: grid;
  /* `safe` ist hier keine Feinheit: ist die Karte hoeher als das Fenster,
     schoebe zentriertes Ausrichten ihren oberen Rand aus dem Bild, und dorthin
     kommt man auch durch Scrollen nicht zurueck. */
  place-items: safe center;
  padding: 16px;
  box-sizing: border-box;
  overflow-y: auto;
  background: var(--fh-paper);
  z-index: 60;
}

.fh-sheet-hidden {
  display: none;
}

.fh-sheet-card {
  width: min(440px, 100%);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border-radius: 18px;
  background: var(--fh-surface);
  border: 1px solid var(--fh-line);
  box-shadow: 0 20px 56px var(--fh-shadow);
  color: var(--fh-ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.fh-sheet-title {
  margin: 0;
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

/* Kleines Schild im Titel, etwa «Training». */
.fh-tag {
  display: inline-block;
  vertical-align: middle;
  padding: 2px 9px;
  border: 1px solid var(--fh-line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--fh-muted);
}

.fh-sheet-lead,
.fh-sheet-hint,
.fh-sheet-or {
  margin: 0;
  color: var(--fh-muted);
}

.fh-sheet-hint {
  font-size: 13px;
}

.fh-sheet-or {
  text-align: center;
  font-size: 13px;
}

.fh-sheet-back {
  cursor: pointer;
  align-self: flex-start;
  padding: 0;
  border: none;
  background: none;
  color: var(--fh-muted);
  font: inherit;
  font-size: 13px;
}

.fh-sheet-back:hover {
  color: var(--fh-ink);
}

/* --- Startseite: zwei grosse Entscheidungen, sonst nichts ------------------- */

.fh-choice {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  font: inherit;
  text-align: left;
}

.fh-choice-title {
  font-size: 17px;
  font-weight: 650;
}

.fh-choice-detail {
  font-size: 13px;
  opacity: 0.75;
}

.fh-choice-primary {
  background: var(--fh-ink);
  color: var(--fh-surface);
}

.fh-choice-ghost {
  background: var(--fh-paper);
  border-color: var(--fh-line);
  color: var(--fh-ink);
}

.fh-choice-ghost:hover {
  border-color: var(--fh-focus);
}

/* --- Felder und Knoepfe ---------------------------------------------------- */

.fh-sheet-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fh-sheet-row {
  display: flex;
  gap: 8px;
}

.fh-sheet-label {
  font-size: 13px;
  color: var(--fh-muted);
}

.fh-sheet-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--fh-line);
  background: var(--fh-paper);
  color: var(--fh-ink);
  font: inherit;
}

.fh-sheet-input:focus-visible {
  outline: 2px solid var(--fh-focus);
  outline-offset: 1px;
}

.fh-sheet-code {
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-weight: 650;
}

.fh-sheet-btn {
  /* Ein Knopf, der sich nicht wie einer anfuehlt, wird nicht gedrueckt. */
  cursor: pointer;
  padding: 11px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
}

.fh-sheet-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.fh-sheet-primary {
  background: var(--fh-ink);
  color: var(--fh-surface);
}

.fh-sheet-ghost {
  background: var(--fh-paper);
  border-color: var(--fh-line);
  color: var(--fh-ink);
}

.fh-sheet-quiet {
  background: none;
  border: none;
  color: var(--fh-muted);
  text-decoration: underline;
  padding: 2px 0;
  font-weight: 400;
  font-size: 13px;
  text-align: left;
}

.fh-sheet-quiet:hover {
  color: var(--fh-ink);
}

/* --- Wartezeile, Fuss, Meldung --------------------------------------------- */

.fh-sheet-wait {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--fh-paper);
  border: 1px solid var(--fh-line);
  font-size: 14px;
}

.fh-sheet-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid var(--fh-line);
  font-size: 12px;
  color: var(--fh-muted);
}

.fh-sheet-getrennt {
  color: var(--fh-warn);
}

.fh-sheet-message {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--fh-warn) 12%, var(--fh-surface));
  color: var(--fh-warn);
  font-size: 14px;
}

/* --- Links und Knoepfe als Links ------------------------------------------- */

a.fh-sheet-btn,
a.fh-choice {
  text-decoration: none;
  box-sizing: border-box;
}

a.fh-sheet-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
}

.fh-sheet-card > .fh-sheet-btn,
.fh-sheet-card > form > .fh-sheet-btn {
  min-height: 46px;
}

.fh-sheet-link {
  color: var(--fh-t1);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  padding: 6px 0;
}

.fh-sheet-link:hover {
  text-decoration: underline;
}

a.fh-sheet-back {
  text-decoration: none;
}

.fh-sheet-center {
  align-self: center;
  text-align: center;
}

.fh-sheet-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fh-sheet-kicker {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--fh-muted);
}

.fh-sheet-error {
  color: var(--fh-warn);
}

.fh-sheet-footlinks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 18px;
  padding-top: 8px;
  border-top: 1px solid var(--fh-line);
}

.fh-sheet-footlinks .fh-sheet-link {
  color: var(--fh-muted);
  font-weight: 400;
  font-size: 13px;
}

/* --- Startseite -------------------------------------------------------------- */


.fh-resume-slot:empty {
  display: none;
}

.fh-resume {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--fh-s2) 16%, var(--fh-surface));
  border: 1px solid color-mix(in srgb, var(--fh-s2) 60%, transparent);
  color: var(--fh-ink);
  text-decoration: none;
}

.fh-resume:hover {
  border-color: var(--fh-s2);
}

.fh-resume-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--fh-s2);
  flex: none;
}

.fh-resume-text {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  font-size: 13px;
  color: var(--fh-muted);
}

.fh-resume-text strong {
  font-size: 14px;
  color: var(--fh-ink);
}

.fh-resume-go {
  font-weight: 650;
  font-size: 14px;
}

/* --- Lange Seiten: Regeln, Rechtliches -------------------------------------- */

.fh-sheet-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--fh-line);
}

.fh-sheet-h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.fh-sheet-h3 {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 650;
}

.fh-sheet-text {
  margin: 0;
  font-size: 14px;
}

.fh-sheet-address {
  display: flex;
  flex-direction: column;
}

.fh-sheet-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

/* Kartenuebersicht: auf der Regelseite und im Spiel in der Seitenleiste. Die
   Farben kommen aus den Marken, die Karte selbst ist immer weiss wie eine Karte. */
.fh-rules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.fh-rule {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--fh-line);
}

.fh-rule:first-child {
  border-top: none;
}

.fh-rule-card {
  flex: none;
  box-sizing: border-box;
  width: 46px;
  height: 56px;
  padding: 4px 5px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #cfd6dc;
  box-shadow: 0 1px 3px rgba(9, 14, 19, 0.12);
  color: #12171b;
  font-weight: 750;
  font-size: 14px;
  line-height: 1.1;
  white-space: nowrap;
}

.fh-rule-card.fh-red {
  color: #b03a33;
}

.fh-rule-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 14px;
  line-height: 1.4;
}

.fh-rule-text span {
  color: var(--fh-muted);
}

/* --- Auswahl ---------------------------------------------------------------- */

.fh-sheet-group {
  margin: 0;
  padding: 0;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.fh-sheet-group > legend {
  padding: 0;
  margin-bottom: 6px;
}

.fh-sheet-segments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fh-sheet-segment {
  flex: 1 1 0;
  min-width: 72px;
  position: relative;
  cursor: pointer;
}

/* Das Radio bleibt fuer Tastatur und Vorleser da, sichtbar ist das Feld. */
.fh-sheet-segments-wide .fh-sheet-segment {
  min-width: 104px;
}

.fh-sheet-segment input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.fh-sheet-segment span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid var(--fh-line);
  background: var(--fh-paper);
  font-size: 14px;
  text-align: center;
}

.fh-sheet-segment input:checked + span {
  border-color: var(--fh-ink);
  box-shadow: 0 0 0 1px var(--fh-ink);
  font-weight: 650;
}

.fh-sheet-segment input:focus-visible + span {
  outline: 2px solid var(--fh-focus);
  outline-offset: 2px;
}

.fh-sheet-code-big {
  font-size: 28px;
  text-align: center;
  letter-spacing: 0.35em;
  padding: 12px;
}

/* --- Einladung, Fortsetzen -------------------------------------------------- */

.fh-seatdot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: none;
  background: var(--fh-muted);
}

.fh-seatdot-s0 { background: var(--fh-s0); }
.fh-seatdot-s1 { background: var(--fh-s1); }
.fh-seatdot-s2 { background: var(--fh-s2); }
.fh-seatdot-s3 { background: var(--fh-s3); }

.fh-seatdot-free {
  background: none;
  border: 2px dashed var(--fh-line);
  box-sizing: border-box;
}

.fh-invite-who,
.fh-standings {
  display: flex;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  background: var(--fh-paper);
  border: 1px solid var(--fh-line);
}

.fh-invite-who {
  align-items: center;
}

.fh-invite-dots {
  display: grid;
  grid-template-columns: repeat(2, 14px);
  gap: 6px;
  flex: none;
}

.fh-invite-dots .fh-seatdot {
  width: 14px;
  height: 14px;
}

.fh-invite-text {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: var(--fh-muted);
}

.fh-invite-text strong {
  font-size: 15px;
  color: var(--fh-ink);
}

.fh-standings {
  flex-direction: column;
  gap: 6px;
}

.fh-standings-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fh-standing {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.fh-standing-name {
  flex: 1 1 auto;
}

.fh-standing-done {
  color: var(--fh-muted);
  font-size: 13px;
}

/* --- Warteraum -------------------------------------------------------------- */

.fh-linkbox {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: var(--fh-paper);
  border: 1px solid var(--fh-line);
}

.fh-linkbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fh-linkbox-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.fh-linkbox-url {
  /* Ein Doppelklick soll den ganzen Link fassen, falls Kopieren nicht geht. */
  user-select: all;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fh-linkbox .fh-sheet-row > .fh-sheet-btn {
  flex: 1 1 0;
}

.fh-icon-btn {
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fh-qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.fh-qr {
  width: 168px;
  height: 168px;
}

/* Immer schwarz auf weiss: Kameras lesen hellen Code auf dunklem Grund schlecht. */
.fh-qr-bg { fill: #fff; }
.fh-qr-fg { fill: #000; }

.fh-code-inline {
  color: var(--fh-ink);
  letter-spacing: 0.12em;
}

.fh-team {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--fh-line);
}

.fh-team-title {
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fh-muted);
}

.fh-team-seats {
  list-style: none;
  margin: 0;
  padding: 0;
}

.fh-team-seat {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

.fh-team-who {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.fh-team-name {
  font-weight: 600;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fh-team-free {
  font-weight: 400;
  color: var(--fh-muted);
}

.fh-team-sub {
  font-size: 12px;
  color: var(--fh-muted);
}

.fh-team-seat .fh-sheet-btn {
  padding: 8px 12px;
  font-size: 13px;
}

/* --- Kartenuebersicht im Spiel ------------------------------------------------ */

.fh-help {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fh-help-more {
  color: var(--fh-t1);
  font-size: 0.84rem;
  font-weight: 600;
}

/* --- Startseite: Aufmacher --------------------------------------------------- */

.fh-hero-kicker {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a2700a;
}

.fh-hero-title {
  font-size: 32px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.fh-hero-accent {
  background: linear-gradient(95deg, #f08a2c 0%, #e2b02c 55%, #f5d36b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Der eine Knopf, der zaehlt. Warm, gross und mit leisem Atmen, damit das Auge
   dort landet — aber ohne zu blinken. */
.fh-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 60px;
  padding: 0 30px;
  border-radius: 16px;
  background: linear-gradient(100deg, #f08a2c 0%, #f2b33d 100%);
  color: #1a1206;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(240, 138, 44, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  animation: fh-breathe-glow 2.8s ease-in-out infinite;
}

.fh-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(240, 138, 44, 0.5);
}

.fh-play:active {
  transform: translateY(0);
}

.fh-play:focus-visible {
  outline: 3px solid var(--fh-focus);
  outline-offset: 3px;
}

.fh-play-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

@keyframes fh-breathe-glow {
  0%, 100% { box-shadow: 0 10px 30px rgba(240, 138, 44, 0.3); }
  50% { box-shadow: 0 10px 44px rgba(240, 138, 44, 0.6); }
}

.fh-hero-more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
}

.fh-hero-dot {
  color: var(--fh-muted);
}

/* Drei Karten, die beim Laden ausgeteilt werden und dann leise schweben. */
.fh-fan {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  gap: 18px;
}

.fh-fan-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 92px;
  text-align: center;
  animation: fh-deal 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.fh-fan-item:nth-child(1) { animation-delay: 0.15s; --fh-tilt: -7deg; }
.fh-fan-item:nth-child(2) { animation-delay: 0.3s; --fh-tilt: 0deg; }
.fh-fan-item:nth-child(3) { animation-delay: 0.45s; --fh-tilt: 7deg; }

.fh-fan-card {
  position: relative;
  box-sizing: border-box;
  width: 60px;
  height: 84px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #d5dbe0;
  box-shadow: 0 8px 20px rgba(9, 14, 19, 0.22);
  color: #12171b;
  transform: rotate(var(--fh-tilt));
  transition: transform 0.2s ease;
  animation: fh-bob 4s ease-in-out infinite;
}

.fh-fan-item:nth-child(2) .fh-fan-card { animation-delay: -1.3s; }
.fh-fan-item:nth-child(3) .fh-fan-card { animation-delay: -2.6s; }

.fh-fan-item:hover .fh-fan-card {
  transform: rotate(0deg) translateY(-8px) scale(1.06);
}

.fh-fan-card.fh-red {
  color: #b03a33;
}

.fh-fan-corner {
  position: absolute;
  top: 5px;
  left: 7px;
  font-size: 13px;
  font-weight: 800;
}

.fh-fan-big {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
}

.fh-fan-text {
  font-size: 12px;
  line-height: 1.3;
  color: var(--fh-muted);
}

@keyframes fh-deal {
  from { opacity: 0; transform: translateY(40px) rotate(-12deg); }
  to { opacity: 1; transform: none; }
}

@keyframes fh-bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -5px; }
}

@media (prefers-reduced-motion: reduce) {
  .fh-play,
  .fh-fan-item,
  .fh-fan-card {
    animation: none;
  }
}

/* --- Desktop: Spielmenue ueber dem echten Tisch --------------------------------

   Ab 900 px deckt die Seite nicht mehr ab. Das echte Brett kreist im Hintergrund
   (`main.ts`, Klasse `fh-showcase` am body) und ist nach rechts geschoben; links
   liegt ein dunkler Verlauf, darauf das Menue. Auf dem Handy bleibt alles wie
   oben: dort ist fuer Brett und Menue nebeneinander kein Platz.

   Die Farbmarken werden hier dunkel umgestellt, wie im Overlay. Alles oben
   rechnet mit ihnen und muss darum nicht doppelt geschrieben werden. */

@media (min-width: 900px) {
  .fh-sheet-menu {
    --fh-paper: rgba(255, 255, 255, 0.06);
    --fh-surface: rgba(12, 16, 20, 0.74);
    --fh-ink: #eef2f4;
    --fh-muted: #a3adb5;
    --fh-line: rgba(255, 255, 255, 0.13);
    --fh-shadow: rgba(0, 0, 0, 0.45);
    --fh-s0: #ec6d63;
    --fh-s1: #6fa8e2;
    --fh-s2: #e2b02c;
    --fh-s3: #5cbb7d;
    --fh-t1: #8dbbea;
    --fh-warn: #f0a060;
    --fh-focus: #8cbdec;

    place-items: center start;
    padding: 40px clamp(40px, 6vw, 112px);
    background:
      linear-gradient(
        90deg,
        rgba(7, 10, 31, 0.97) 0%,
        rgba(7, 10, 31, 0.92) 26%,
        rgba(9, 12, 40, 0.6) 44%,
        rgba(9, 12, 40, 0.2) 60%,
        rgba(9, 12, 40, 0) 74%
      );
  }

  .fh-sheet-menu .fh-sheet-card {
    width: min(500px, 100%);
    background: var(--fh-surface);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
    backdrop-filter: blur(18px) saturate(1.3);
    border-color: var(--fh-line);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  }

  /* Knoepfe auf Dunkel: hell mit dunkler Schrift. Die Marke `--fh-surface` ist
     hier halb durchsichtig und taugt nicht als Schriftfarbe. */
  .fh-sheet-menu .fh-choice-primary,
  .fh-sheet-menu .fh-sheet-primary {
    background: #f4f6f7;
    color: #11161a;
  }

  .fh-sheet-menu .fh-choice-primary:hover,
  .fh-sheet-menu .fh-sheet-primary:hover {
    background: #ffffff;
  }

  .fh-sheet-menu .fh-choice-ghost:hover,
  .fh-sheet-menu .fh-sheet-ghost:hover {
    border-color: rgba(255, 255, 255, 0.4);
  }

  /* Die Startseite ist kein Kasten, sondern das Menue selbst: volle Hoehe, oben
     der Name und die Links, in der Mitte der grosse Satz und die Wege ins Spiel,
     unten die Fusszeile. Das kleine Brettbild braucht es nicht — das echte
     steht daneben. */
  .fh-sheet-menu .fh-sheet-card.fh-sheet-start {
    width: min(560px, 100%);
    min-height: calc(100vh - 80px);
    padding: 0;
    gap: 14px;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
  }

  .fh-sheet-start .fh-resume-slot {
    margin-top: 8px;
  }

  .fh-sheet-start .fh-hero-kicker {
    margin-top: auto;
    color: #f2b33d;
  }

  .fh-sheet-start .fh-sheet-title {
    font-size: clamp(46px, 4.8vw, 72px);
    line-height: 0.98;
    font-weight: 800;
    letter-spacing: -0.035em;
    text-wrap: balance;
  }

  .fh-sheet-start .fh-play {
    align-self: flex-start;
    min-height: 64px;
    padding: 0 36px;
    font-size: 20px;
  }

  .fh-sheet-start .fh-fan {
    margin-top: 22px;
  }

  .fh-sheet-start .fh-fan-card {
    width: 66px;
    height: 92px;
  }

  .fh-sheet-start .fh-sheet-lead {
    font-size: 17px;
    max-width: 30em;
    margin-bottom: 12px;
  }

  .fh-sheet-start .fh-sheet-footlinks {
    margin-top: auto;
    justify-content: flex-start;
    border-top: none;
    padding-top: 0;
  }

  /* Waehrend das Menue steht, gehoert der Tisch dem Schaufenster: keine Leisten,
     keine Sitzschilder, keine Knoepfe. Das Brett rueckt nach rechts, damit es
     neben dem Menue zu sehen ist, und kehrt beim Spielstart in die Mitte zurueck. */
  body.fh-showcase .fh-ov {
    visibility: hidden;
  }

  canvas.fh-canvas {
    transition: transform 0.9s cubic-bezier(0.3, 0.7, 0.2, 1);
  }

  body.fh-showcase canvas.fh-canvas {
    transform: translateX(20vw);
    /* Ein Schein ums schwebende Brett, wie das Leuchten auf dem Poster. Der
       Schatten folgt dem Umriss, weil die Bildflaeche sonst durchsichtig ist. */
    filter: drop-shadow(0 0 36px rgba(76, 195, 255, 0.28)) drop-shadow(0 30px 40px rgba(0, 0, 0, 0.5));
  }
}

/* Flache Fenster: kleiner setzen, damit Knopf und Karten ohne Scrollen sichtbar
   bleiben. Unter 700 px Hoehe fallen die Karten weg — der Knopf ist wichtiger. */
@media (min-width: 900px) and (max-height: 880px) {
  .fh-sheet-start .fh-sheet-title {
    font-size: clamp(40px, 4.2vw, 60px);
  }

  .fh-sheet-start .fh-fan {
    margin-top: 10px;
  }

  .fh-sheet-start .fh-fan-card {
    width: 54px;
    height: 76px;
  }

  .fh-sheet-start .fh-fan-big {
    font-size: 24px;
  }
}

@media (min-width: 900px) and (max-height: 700px) {
  .fh-sheet-start .fh-fan {
    display: none;
  }
}

@media (min-width: 900px) and (prefers-reduced-motion: reduce) {
  canvas.fh-canvas {
    transition: none;
  }
}

/* Schmal brechen die Nebenwege um; ein Trennpunkt am Zeilenende sieht verloren aus. */
@media (max-width: 899px) {
  .fh-hero-dot {
    display: none;
  }

  .fh-hero-more {
    gap: 2px 18px;
  }
}

/* --- Marke: Farben und Schrift aus Logo und Poster ------------------------------

   Tiefes Weltraum-Navy als Grund, Gold wie «Doggo's», Himmelblau wie «Home»,
   dazu die leuchtenden Sitzfarben des Posters. Die Schrift ist Fredoka, rund
   und kraeftig wie der gezeichnete Schriftzug; sie liegt unter `assets/fonts`.

   Die Seiten vor dem Spiel sind jetzt auf jeder Breite dunkel. Auf dem Handy
   liegt das Poster abgedunkelt dahinter, auf dem Desktop der echte Tisch. */

@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/fredoka-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/fredoka-700.woff2') format('woff2');
}

:root {
  --dh-navy: #0b1030;
  --dh-night: #070a1f;
  --dh-gold: #ffc93c;
  --dh-orange: #f59a1b;
  --dh-gold-deep: #b8660a;
  --dh-sky: #4cc3ff;
  --dh-sky-deep: #1f74e6;
  --dh-outline: #1b1533;
  --dh-display: 'Fredoka', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
}

.fh-sheet-menu {
  --fh-paper: rgba(255, 255, 255, 0.07);
  --fh-surface: rgba(13, 17, 52, 0.78);
  --fh-ink: #f1f4fb;
  --fh-muted: #aab3cf;
  --fh-line: rgba(160, 180, 255, 0.18);
  --fh-shadow: rgba(0, 0, 0, 0.5);
  --fh-s0: #ff5a5a;
  --fh-s1: #4d8dff;
  --fh-s2: #ffd23f;
  --fh-s3: #3ddc84;
  --fh-t1: #7fd0ff;
  --fh-warn: #ffa35c;
  --fh-focus: #7fd0ff;

  color: var(--fh-ink);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(11, 16, 48, 0.2), rgba(7, 10, 31, 0.86) 70%),
    url('assets/poster-900.webp') center top / cover no-repeat,
    var(--dh-night);
}

.fh-sheet-menu .fh-sheet-card {
  background: var(--fh-surface);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border-color: var(--fh-line);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.fh-sheet-menu .fh-sheet-title,
.fh-sheet-menu .fh-sheet-h2,
.fh-sheet-menu .fh-team-title,
.fh-sheet-menu .fh-hero-kicker {
  font-family: var(--dh-display);
}

.fh-sheet-menu .fh-sheet-title {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.fh-sheet-menu .fh-sheet-btn,
.fh-sheet-menu .fh-choice-title {
  font-family: var(--dh-display);
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Knoepfe im Stil des Logos: Gold mit dunkler Schrift und einer Kante darunter,
   als waeren sie gepraegt. */
.fh-sheet-menu .fh-sheet-primary,
.fh-sheet-menu .fh-choice-primary {
  background: linear-gradient(180deg, #ffd65a 0%, var(--dh-orange) 100%);
  color: var(--dh-outline);
  border: none;
  box-shadow: 0 4px 0 var(--dh-gold-deep), 0 10px 24px rgba(245, 154, 27, 0.28);
}

.fh-sheet-menu .fh-sheet-primary:hover,
.fh-sheet-menu .fh-choice-primary:hover {
  background: linear-gradient(180deg, #ffe07a 0%, #ffa52e 100%);
}

.fh-sheet-menu .fh-sheet-primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--dh-gold-deep), 0 6px 16px rgba(245, 154, 27, 0.28);
}

.fh-sheet-menu .fh-sheet-primary:disabled {
  box-shadow: none;
}

.fh-sheet-menu .fh-sheet-ghost {
  background: rgba(76, 195, 255, 0.08);
  border-color: rgba(76, 195, 255, 0.35);
  color: var(--fh-ink);
}

.fh-sheet-menu .fh-sheet-ghost:hover {
  border-color: var(--dh-sky);
}

.fh-sheet-menu .fh-sheet-link {
  color: var(--fh-t1);
}

.fh-sheet-menu .fh-sheet-segment input:checked + span {
  border-color: var(--dh-gold);
  box-shadow: 0 0 0 1px var(--dh-gold), 0 0 16px rgba(255, 201, 60, 0.25);
  color: #fff;
}

.fh-sheet-menu .fh-sheet-input {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(160, 180, 255, 0.25);
  color: var(--fh-ink);
}

.fh-sheet-menu .fh-sheet-input::placeholder {
  color: rgba(170, 179, 207, 0.6);
}

/* --- Logo ----------------------------------------------------------------------- */

.fh-logo {
  display: block;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.fh-logo-hero {
  align-self: center;
  width: min(340px, 82%);
  margin: -4px 0 -6px;
  filter: drop-shadow(0 10px 28px rgba(76, 195, 255, 0.25));
  animation: fh-logo-in 0.8s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}

.fh-logo-small {
  width: 132px;
}

@keyframes fh-logo-in {
  from { opacity: 0; transform: translateY(-14px) scale(0.92); }
  to { opacity: 1; transform: none; }
}

/* --- Aufmacher in den Farben der Marke ----------------------------------------- */

.fh-sheet-menu .fh-hero-kicker {
  color: var(--dh-gold);
  font-weight: 600;
  letter-spacing: 0.14em;
}

.fh-sheet-menu .fh-hero-title {
  font-weight: 700;
}

.fh-sheet-menu .fh-hero-accent {
  background: linear-gradient(180deg, #8fe0ff 0%, var(--dh-sky) 45%, var(--dh-sky-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.fh-sheet-menu .fh-play {
  font-family: var(--dh-display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, #ffe07a 0%, var(--dh-gold) 40%, var(--dh-orange) 100%);
  color: var(--dh-outline);
  border: 2px solid var(--dh-outline);
  box-shadow: 0 5px 0 var(--dh-gold-deep), 0 12px 36px rgba(255, 180, 40, 0.35);
  animation: fh-play-glow 2.8s ease-in-out infinite;
}

.fh-sheet-menu .fh-play:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--dh-gold-deep), 0 16px 44px rgba(255, 180, 40, 0.5);
}

.fh-sheet-menu .fh-play:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--dh-gold-deep), 0 8px 20px rgba(255, 180, 40, 0.3);
}

@keyframes fh-play-glow {
  0%, 100% { box-shadow: 0 5px 0 var(--dh-gold-deep), 0 12px 30px rgba(255, 180, 40, 0.3); }
  50% { box-shadow: 0 5px 0 var(--dh-gold-deep), 0 12px 48px rgba(255, 180, 40, 0.6); }
}

.fh-sheet-menu .fh-fan-text {
  color: var(--fh-muted);
}

.fh-sheet-menu .fh-fan-card {
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45), 0 0 0 2px rgba(255, 201, 60, 0.35);
}

@media (min-width: 900px) {
  /* Auf dem Desktop steht der echte Tisch dahinter, nicht das Poster. */
  .fh-sheet-menu {
    background:
      linear-gradient(
        90deg,
        rgba(7, 10, 31, 0.97) 0%,
        rgba(7, 10, 31, 0.92) 26%,
        rgba(9, 12, 40, 0.6) 44%,
        rgba(9, 12, 40, 0.2) 60%,
        rgba(9, 12, 40, 0) 74%
      );
  }

  .fh-sheet-start .fh-logo-hero {
    align-self: flex-start;
    width: clamp(300px, 30vw, 440px);
    /* Das Logo ist der Kopf der Seite und steht oben links. Den freien Raum
       darunter bekommt der Aufmacher (`fh-hero-kicker`). */
    margin: -12px 0 0 -18px;
  }

  .fh-sheet-start .fh-hero-kicker {
    margin-top: auto;
  }
}

@media (min-width: 900px) and (max-height: 880px) {
  .fh-sheet-start .fh-logo-hero {
    width: clamp(220px, 20vw, 290px);
  }

  .fh-sheet-start .fh-sheet-title {
    font-size: clamp(38px, 3.8vw, 54px);
  }
}

/* Noch flacher: der Kartenfaecher weicht, Logo, Satz und Knopf bleiben. */
@media (min-width: 900px) and (max-height: 820px) {
  .fh-sheet-start .fh-fan {
    display: none;
  }

  .fh-sheet-start .fh-logo-hero {
    width: clamp(200px, 18vw, 250px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fh-logo-hero,
  .fh-sheet-menu .fh-play {
    animation: none;
  }
}

/* --- Himmel hinter dem schwebenden Brett (Desktop-Menue) ---------------------------

   Im Menue ist die Bildflaeche durchsichtig und der Tisch ausgeblendet
   (`main.ts`, `applyShowcase`). Darunter liegt dieser Himmel: Nebel in den
   Farben des Posters, zwei Lagen Sterne, die versetzt funkeln, und die vier
   Planeten des Posters, die langsam treiben. */

.fh-sky {
  display: none;
}

@media (min-width: 900px) {
  body.fh-showcase .fh-sky {
    display: block;
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    background:
      radial-gradient(ellipse 60% 50% at 72% 42%, rgba(96, 60, 190, 0.35), transparent 70%),
      radial-gradient(ellipse 45% 40% at 88% 80%, rgba(31, 116, 230, 0.28), transparent 70%),
      radial-gradient(ellipse 50% 45% at 30% 10%, rgba(40, 150, 200, 0.16), transparent 70%),
      radial-gradient(ellipse at 60% 50%, #121a4a 0%, #0b1030 45%, #070a1f 100%);
  }

  body.fh-showcase #app {
    /* Ueber dem Himmel, aber durchsichtig, wo nichts gezeichnet ist. */
    z-index: 1;
  }

  .fh-sky-stars,
  .fh-sky-stars::after {
    position: absolute;
    inset: -50%;
    background-image:
      radial-gradient(1.2px 1.2px at 20px 30px, #fff, transparent),
      radial-gradient(1px 1px at 120px 80px, rgba(255, 255, 255, 0.8), transparent),
      radial-gradient(1.5px 1.5px at 200px 160px, #ffe9a8, transparent),
      radial-gradient(1px 1px at 60px 200px, rgba(180, 210, 255, 0.9), transparent),
      radial-gradient(1.3px 1.3px at 260px 40px, #fff, transparent),
      radial-gradient(1px 1px at 300px 240px, rgba(255, 255, 255, 0.7), transparent);
    background-size: 320px 280px;
    animation: fh-twinkle 5s ease-in-out infinite alternate;
  }

  .fh-sky-stars::after {
    content: '';
    inset: 0;
    background-size: 230px 190px;
    background-position: 90px 60px;
    animation-delay: -2.5s;
    animation-duration: 3.7s;
  }

  .fh-planet {
    position: absolute;
    height: auto;
    animation: fh-drift 24s ease-in-out infinite alternate;
  }

  .fh-planet-orange {
    top: 13vh;
    right: 2vw;
    width: clamp(220px, 20vw, 360px);
    animation-duration: 26s;
  }

  .fh-planet-teal {
    top: -2vh;
    left: 40vw;
    width: clamp(150px, 13vw, 240px);
    opacity: 0.75;
    animation-duration: 31s;
    animation-delay: -8s;
  }

  .fh-planet-red {
    bottom: -4vh;
    left: 0;
    width: clamp(160px, 14vw, 250px);
    opacity: 0.55;
    animation-duration: 29s;
    animation-delay: -4s;
  }

  .fh-planet-blue {
    bottom: 0;
    right: 0;
    width: clamp(220px, 20vw, 340px);
    animation-duration: 34s;
    animation-delay: -12s;
  }

  @keyframes fh-twinkle {
    from { opacity: 0.35; }
    to { opacity: 1; }
  }

  @keyframes fh-drift {
    from { transform: translate(0, 0) rotate(0deg); }
    to { transform: translate(-14px, 10px) rotate(-2deg); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .fh-sky-stars,
  .fh-sky-stars::after,
  .fh-planet {
    animation: none;
  }
}

/* --- Profil ------------------------------------------------------------------ */

/* Oben rechts in der Ecke des Fensters, nicht der Karte: auf dem Desktop ist
   die Startkarte breiter als ihr Text, und der Link hinge sonst mitten im Bild.
   Klein und leise — der Weg zum Spielen bleibt vorn. */
.fh-start-corner {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top, 0px));
  right: calc(14px + env(safe-area-inset-right, 0px));
  z-index: 1;
}

.fh-start-corner .fh-sheet-link {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--fh-line);
  background: var(--fh-surface);
  color: var(--fh-ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.fh-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.fh-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 8px;
  border-radius: 14px;
  background: var(--fh-paper);
  border: 1px solid var(--fh-line);
}

.fh-tile-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.fh-tile-label {
  font-size: 12px;
  color: var(--fh-muted);
}

.fh-stat-num {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.fh-recent {
  gap: 12px;
}

.fh-recent-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 14px;
}

.fh-recent-item + .fh-recent-item {
  padding-top: 12px;
  border-top: 1px solid var(--fh-line);
}

.fh-recent-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.fh-result {
  font-weight: 650;
}

.fh-result-won { color: var(--fh-s3); }
.fh-result-left { color: var(--fh-warn); }
