/* ISSON · Spiele · Flatterflug
   Eigene Regeln des Spiels. Farben, Schriften und Briefkopf kommen aus
   /mediathek/spiele/gemeinsam/spiele.css (Stil „Lieferschein“). */

* { box-sizing: border-box; }

body {
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.app {
  max-width: 620px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 40px) clamp(16px, 4vw, 24px) 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ---------- Kopfzeile: Titel und Feldblock ---------- */

.app__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--tinte);
}

.app__title {
  margin: 0;
  font-family: var(--schrift-titel);
  font-size: clamp(1.75rem, 5vw, 2.4rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--tinte);
}

.app__meta {
  display: flex;
  flex-wrap: wrap;
}

.meta__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 72px;
  padding: 0 14px;
  border-left: 1px solid var(--linie);
}

.meta__item:first-child { padding-left: 0; border-left: 0; }
.meta__item:last-child { padding-right: 0; }

.meta__label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--text-leise);
}

.meta__value {
  font-family: var(--schrift-text);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  color: var(--tinte);
}

/* ---------- Spielbildschirm ---------- */

.board { display: flex; justify-content: center; }

.board__frame {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 480 / 640;
  background: var(--bildschirm);
  border: 1px solid var(--tinte);
  border-radius: 0;
}

#board {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--bildschirm);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  color: var(--bildschirm-text);
  background: rgba(0, 0, 0, 0.84);
}

.overlay[hidden] { display: none; }

.overlay__title {
  margin: 0;
  font-family: var(--schrift-titel);
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--bildschirm-text);
}

.overlay__hint {
  margin: 0;
  max-width: 34ch;
  font-size: 0.95rem;
  color: var(--bildschirm-leise);
}

/* ---------- Knöpfe ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  font: 600 0.95rem/1.2 var(--schrift-text);
  color: var(--papier);
  background: var(--tinte);
  border: 2px solid var(--tinte);
  border-radius: 0;
  cursor: pointer;
  transition: background-color 180ms var(--ease), color 180ms var(--ease);
}

.button:hover { background: var(--papier); color: var(--tinte); }
.button[hidden] { display: none; }

/* Auf dem schwarzen Bildschirm ist der Knopf weiss. */
.overlay .button {
  margin-top: 8px;
  color: var(--tinte);
  background: var(--papier);
  border-color: var(--papier);
}

.overlay .button:hover { background: transparent; color: var(--papier); }
.overlay :focus-visible { outline-color: var(--papier); }

/* ---------- Tastenlegende ---------- */

.legend {
  font-feature-settings: "cv11" 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 24px;
  padding-top: 12px;
  border-top: 1px solid var(--linie);
}

.legend__group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  color: var(--text-leise);
}

.legend__copyright {
  flex-basis: 100%;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-leise);
}

kbd {
  display: inline-block;
  min-width: 24px;
  padding: 2px 6px;
  font-family: var(--schrift-text);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--tinte);
  background: var(--papier);
  border: 1px solid var(--tinte);
  border-radius: 0;
}

/* ---------- Touch-Steuerung (nur auf Touch-Geräten sichtbar) ---------- */

.touch { display: none; }

@media (hover: none) and (pointer: coarse) {
  .touch { display: grid; }
}

html.hat-touch .touch { display: grid; }

.touch__knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 56px;
  padding: 0;
  font: 600 0.95rem/1.2 var(--schrift-text);
  color: var(--papier);
  background: var(--tinte);
  border: 2px solid var(--tinte);
  border-radius: 0;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.touch__knopf svg { width: 26px; height: 26px; }
.touch__knopf.is-aktiv,
.touch__knopf:active { background: var(--papier); color: var(--tinte); }

@media (max-width: 480px) {
  .app { gap: 20px; }
  .meta__item { min-width: 60px; padding: 0 10px; }
  .meta__value { font-size: 1.2rem; }
  .legend { gap: 8px 14px; }
}

