/* Dart-Turnier – Gestaltung. Dunkel als Grundstimmung (Kellerbar), Hell umschaltbar. */

:root {
  --bg: #0e1116;
  --bg2: #141a22;
  --flaeche: #19212b;
  --flaeche2: #202a36;
  --linie: #2b3744;
  --text: #e9eef5;
  --gedimmt: #93a3b6;
  --gruen: #46c06a;
  --rot: #e8595e;
  --gold: #e8bd4a;
  --akzent: #5aa9f7;
  --schatten: 0 2px 10px rgba(0,0,0,.35);
  --rund: 12px;
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --zahl: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

:root[data-thema="hell"] {
  --bg: #f3f5f8;
  --bg2: #e9edf3;
  --flaeche: #ffffff;
  --flaeche2: #f1f4f8;
  --linie: #d3dae3;
  --text: #16202b;
  --gedimmt: #5d6b7c;
  --gruen: #1d8a42;
  --rot: #c62a30;
  --gold: #9a7312;
  --akzent: #1b6fc4;
  --schatten: 0 2px 10px rgba(20,30,45,.10);
}

* { box-sizing: border-box; }

/* Muss vor allen display-Regeln stehen: eine Klasse wie .modal { display: grid }
   schlaegt sonst das display:none, das das hidden-Attribut mitbringt. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  /* Als App auf dem Telefon: kein Gummiband-Scrollen, kein Blaublitzen beim Tippen,
     keine Textauswahl beim Halten eines Knopfes. */
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

button, .dart, .slot, .match, .tabs button {
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}


h1, h2, h3 { line-height: 1.25; margin: 0 0 .6rem; }
h2 { font-size: 1.1rem; letter-spacing: .01em; }
h3 { font-size: .95rem; color: var(--gedimmt); text-transform: uppercase; letter-spacing: .06em; margin-top: 1.2rem; }
p { margin: .4rem 0; }

/* ----------------------------------------------------------- Kopf */
.kopf {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .7rem 1rem;
  background: var(--bg2);
  border-bottom: 1px solid var(--linie);
  position: sticky; top: 0; z-index: 30;
}
.marke { font-size: 1.05rem; display: flex; align-items: center; gap: .45rem; }
.marke .scheibe { display: inline-block; }
.marke strong { letter-spacing: .02em; }

.tabs { display: flex; gap: .25rem; flex: 1 1 auto; flex-wrap: wrap; }
.tabs button {
  background: transparent; color: var(--gedimmt); border: 1px solid transparent;
  padding: .4rem .8rem; border-radius: 999px; cursor: pointer; font: inherit;
}
.tabs button:hover { color: var(--text); background: var(--flaeche); }
.tabs button[aria-current="true"] { color: var(--text); background: var(--flaeche2); border-color: var(--linie); }

.kopf-rechts { display: flex; align-items: center; gap: .5rem; }
.uhr { font-family: var(--zahl); color: var(--gedimmt); font-variant-numeric: tabular-nums; }
.symbol {
  background: var(--flaeche); border: 1px solid var(--linie); color: var(--text);
  width: 2rem; height: 2rem; border-radius: 8px; cursor: pointer; font-size: .9rem; line-height: 1;
}
.symbol[aria-pressed="false"] { opacity: .45; }
.speicher { font-size: .75rem; color: var(--gruen); min-width: 5.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.speicher.fehler { color: var(--rot); }

.warnung {
  background: #5a1d1f; color: #ffe9e9; padding: .6rem 1rem; font-size: .9rem;
  border-bottom: 1px solid #7a2a2d;
}

main { padding: 1.1rem; max-width: 1500px; margin: 0 auto; }
.ansicht { display: none; }
.ansicht.aktiv { display: block; }

/* ----------------------------------------------------------- Bausteine */
.gitter { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1rem; align-items: start; }

.karte {
  background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: var(--rund); padding: 1rem; box-shadow: var(--schatten);
}

.feld { display: block; margin: .55rem 0; font-size: .85rem; color: var(--gedimmt); }
.feld input, .feld select, .modal-fenster input, .modal-fenster select {
  display: block; width: 100%; margin-top: .25rem;
  background: var(--bg); color: var(--text); border: 1px solid var(--linie);
  border-radius: 8px; padding: .5rem .6rem; font: inherit;
}
.haken { display: flex; align-items: center; gap: .5rem; margin: .5rem 0; font-size: .9rem; cursor: pointer; }
.haken input { accent-color: var(--gruen); width: 1rem; height: 1rem; }

.zeile { display: flex; gap: .5rem; align-items: center; }
.zeile-wickel { flex-wrap: wrap; margin-top: .6rem; }
.zeile input[type="text"] { flex: 1 1 auto; background: var(--bg); color: var(--text); border: 1px solid var(--linie); border-radius: 8px; padding: .5rem .6rem; font: inherit; }

button { font: inherit; }
button.prim, button.gross {
  background: var(--gruen); color: #06240f; border: 0; border-radius: 8px;
  padding: .5rem .9rem; font-weight: 650; cursor: pointer;
}
:root[data-thema="hell"] button.prim, :root[data-thema="hell"] button.gross { color: #fff; }
button.gross { padding: .8rem 1.6rem; font-size: 1.05rem; border-radius: 10px; }
button.prim:hover, button.gross:hover { filter: brightness(1.08); }
button.klein {
  background: var(--flaeche2); color: var(--text); border: 1px solid var(--linie);
  border-radius: 8px; padding: .35rem .7rem; cursor: pointer; font-size: .85rem;
}
button.klein:hover { border-color: var(--gedimmt); }
button.gefahr-text { color: var(--rot); }
button:disabled { opacity: .4; cursor: not-allowed; }

.aktionen { display: flex; justify-content: center; gap: .8rem; margin: 1.4rem 0 .6rem; flex-wrap: wrap; }
.hinweis { font-size: .8rem; color: var(--gedimmt); }
.box { background: var(--bg); border: 1px solid var(--linie); border-radius: 8px; padding: .7rem; font-size: .85rem; margin-top: .6rem; }
.box strong { color: var(--text); }
.box .gut { color: var(--gruen); }
.box .schlecht { color: var(--rot); }

.spielerliste { list-style: none; counter-reset: s; margin: .6rem 0 0; padding: 0; }
.spielerliste li {
  counter-increment: s; display: flex; align-items: center; gap: .6rem;
  background: var(--flaeche2); border: 1px solid var(--linie);
  border-radius: 8px; padding: .4rem .5rem .4rem .3rem; margin-bottom: .35rem;
}
.spielerliste li::before {
  content: counter(s); font-family: var(--zahl); font-size: .75rem; color: var(--gedimmt);
  background: var(--bg); border-radius: 6px; width: 1.5rem; height: 1.5rem;
  display: grid; place-items: center; flex: 0 0 auto;
}
.spielerliste li .sname { flex: 1 1 auto; }
.spielerliste li.mischen { animation: wackeln .35s ease; }
@keyframes wackeln { 50% { transform: translateX(6px) rotate(.6deg); } }

.laeuft-hinweis {
  background: var(--flaeche2); border: 1px solid var(--linie); border-left: 3px solid var(--gold);
  border-radius: 8px; padding: .7rem .9rem; margin-bottom: 1rem;
  display: flex; gap: .8rem; align-items: center; flex-wrap: wrap;
}

/* ----------------------------------------------------------- Turnierkopf */
.turnierkopf { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: .8rem; }
.turnierkopf h1 { font-size: 1.3rem; margin: 0; }
.plaketten { display: flex; gap: .4rem; flex-wrap: wrap; }
.plakette {
  font-size: .78rem; background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: 999px; padding: .2rem .6rem; color: var(--gedimmt);
}
.plakette b { color: var(--text); font-weight: 600; }
.fortschritt { height: 6px; background: var(--flaeche2); border-radius: 999px; overflow: hidden; margin: .5rem 0 1rem; }
.fortschritt > i { display: block; height: 100%; background: var(--gruen); transition: width .4s ease; }

.banner {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--flaeche2), var(--flaeche));
  border: 1px solid var(--linie); border-left: 3px solid var(--gruen);
  border-radius: var(--rund); padding: .7rem .9rem; margin-bottom: 1rem;
}
.banner .gross-text { font-size: 1.05rem; font-weight: 600; }
.banner.sieg { border-left-color: var(--gold); }

/* ----------------------------------------------------------- Baum */
.baum-huelle { overflow-x: auto; padding-bottom: .6rem; }
.baum { display: flex; gap: 1.6rem; align-items: stretch; min-width: min-content; }
.runde { display: flex; flex-direction: column; min-width: 215px; }
.runde-kopf {
  display: flex; align-items: baseline; gap: .4rem; justify-content: space-between;
  padding-bottom: .4rem; margin-bottom: .2rem; border-bottom: 1px solid var(--linie);
}
.runde-kopf h3 { margin: 0; font-size: .8rem; color: var(--text); }
.runde-kopf select { background: var(--bg); color: var(--gedimmt); border: 1px solid var(--linie); border-radius: 6px; font-size: .72rem; padding: .1rem .2rem; }
.runde-matches { display: flex; flex-direction: column; justify-content: space-around; flex: 1 1 auto; gap: .5rem; }

.match {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px;
  padding: .45rem; position: relative; cursor: pointer; transition: border-color .15s, transform .15s;
}
.match:hover { border-color: var(--akzent); transform: translateY(-1px); }
.match.nicht-klickbar { cursor: default; opacity: .72; }
.match.nicht-klickbar:hover { border-color: var(--linie); transform: none; }
.match.dran { border-color: var(--gruen); box-shadow: 0 0 0 2px rgba(70,192,106,.18); }
.match.fertig { background: var(--flaeche2); }
.match-meta { display: flex; justify-content: space-between; font-size: .68rem; color: var(--gedimmt); padding: 0 .2rem .25rem; font-variant-numeric: tabular-nums; }
.slot { display: flex; align-items: center; gap: .4rem; padding: .3rem .4rem; border-radius: 6px; font-size: .9rem; }
.slot + .slot { margin-top: .15rem; }
.slot .nam { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .legs { font-family: var(--zahl); font-size: .85rem; color: var(--gedimmt); }
.slot.sieger { background: rgba(70,192,106,.14); }
.slot.sieger .nam { font-weight: 650; }
.slot.sieger .legs { color: var(--gruen); }
.slot.offen .nam { color: var(--gedimmt); font-style: italic; }
.slot .scheibe-nr { font-size: .65rem; color: var(--gedimmt); }
.freilos-text { font-size: .7rem; color: var(--gedimmt); text-align: center; padding-top: .2rem; }

.begegnungen {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: .6rem; margin-top: .5rem;
}

.platz3 { margin-top: 1.4rem; display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.platz3 .runde { min-width: 230px; }

.treppe { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-top: 1rem; }
.treppe .rang {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: .6rem .8rem;
  display: flex; align-items: center; gap: .6rem;
}
.treppe .rang .medaille { font-size: 1.4rem; }
.treppe .rang.gold { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }

/* ----------------------------------------------------------- Tabellen */
table.liste { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.liste th, table.liste td { text-align: right; padding: .4rem .5rem; border-bottom: 1px solid var(--linie); }
table.liste th:first-child, table.liste td:first-child { text-align: left; }
table.liste th { color: var(--gedimmt); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
table.liste td { font-variant-numeric: tabular-nums; font-family: var(--zahl); }
table.liste td:first-child { font-family: var(--schrift); }
table.liste tbody tr:hover { background: var(--flaeche2); }
.tabelle-huelle { overflow-x: auto; }

.rekorde { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.rekord { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: .7rem .8rem; }
.rekord .wert { font-family: var(--zahl); font-size: 1.5rem; color: var(--gold); line-height: 1.1; }
.rekord .was { font-size: .72rem; color: var(--gedimmt); text-transform: uppercase; letter-spacing: .05em; }
.rekord .wer { font-size: .85rem; }

.verlauf { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; font-size: .85rem; }
.verlauf li { display: flex; gap: .6rem; padding: .3rem 0; border-bottom: 1px solid var(--linie); }
.verlauf time { color: var(--gedimmt); font-family: var(--zahl); font-size: .78rem; flex: 0 0 auto; }

/* ----------------------------------------------------------- Modal / Scorer */
.modal {
  position: fixed; inset: 0; background: rgba(4,7,11,.72); z-index: 60;
  display: grid; place-items: center; padding: 1rem;
  backdrop-filter: blur(3px);
}
.modal-fenster {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px;
  padding: 1rem; width: min(860px, 100%); max-height: 92vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.modal-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .6rem; }
.modal-kopf h2 { margin: 0; }
.modal-fuss { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1rem; flex-wrap: wrap; }

.tafel { display: grid; grid-template-columns: 1fr auto 1fr; gap: .5rem; align-items: stretch; margin-bottom: .7rem; }
.tafel .seite {
  background: var(--bg); border: 1px solid var(--linie); border-radius: 10px; padding: .6rem; text-align: center;
}
.tafel .seite.aktiv { border-color: var(--gruen); box-shadow: 0 0 0 2px rgba(70,192,106,.2); }
.tafel .seite .sp-name { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tafel .seite .rest { font-family: var(--zahl); font-size: 2.6rem; line-height: 1.05; }
.tafel .seite.aktiv .rest { color: var(--gruen); }
.tafel .seite .klein-info { font-size: .72rem; color: var(--gedimmt); font-variant-numeric: tabular-nums; }
.tafel .mitte { display: grid; place-items: center; gap: .2rem; padding: 0 .4rem; }
.tafel .mitte .legs-stand { font-family: var(--zahl); font-size: 1.4rem; }
.tafel .mitte .legs-text { font-size: .68rem; color: var(--gedimmt); text-align: center; }
.tafel .seite .anwurf { font-size: .65rem; color: var(--gold); }

.finish-weg { text-align: center; font-size: .85rem; color: var(--gedimmt); min-height: 1.6rem; margin-bottom: .5rem; }
.finish-weg b { color: var(--gold); font-family: var(--zahl); letter-spacing: .03em; }

.eingabe-anzeige {
  font-family: var(--zahl); font-size: 2rem; text-align: center;
  background: var(--bg); border: 1px dashed var(--linie); border-radius: 10px;
  padding: .3rem; margin-bottom: .5rem; min-height: 2.9rem;
}
.eingabe-anzeige.bust { color: var(--rot); border-color: var(--rot); }
.tasten { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; }
.tasten button {
  background: var(--flaeche2); border: 1px solid var(--linie); color: var(--text);
  border-radius: 10px; padding: .75rem .2rem; font-size: 1.1rem; cursor: pointer; font-family: var(--zahl);
}
.tasten button:hover { border-color: var(--akzent); }
.tasten button.ok { background: var(--gruen); color: #06240f; border: 0; font-weight: 700; }
:root[data-thema="hell"] .tasten button.ok { color: #fff; }
.tasten button.weg { background: var(--flaeche); color: var(--rot); }
.tasten button.fix { font-size: .9rem; color: var(--gedimmt); }
.wuerfe { margin-top: .7rem; font-size: .8rem; color: var(--gedimmt); }
.wuerfe-reihe { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .25rem; }
.wurf-chip { background: var(--flaeche2); border: 1px solid var(--linie); border-radius: 6px; padding: .1rem .4rem; font-family: var(--zahl); font-size: .78rem; }
.wurf-chip.bust { color: var(--rot); }
.wurf-chip.hoch { color: var(--gold); }

.schnell-tasten { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.schnell-tasten button { padding: 1.4rem .6rem; font-size: 1.05rem; border-radius: 12px; background: var(--flaeche2); border: 1px solid var(--linie); color: var(--text); cursor: pointer; }
.schnell-tasten button:hover { border-color: var(--gruen); }

.umschalter { display: flex; gap: .3rem; background: var(--bg); border: 1px solid var(--linie); border-radius: 999px; padding: .15rem; }
.umschalter button { background: transparent; border: 0; color: var(--gedimmt); padding: .25rem .7rem; border-radius: 999px; cursor: pointer; font-size: .8rem; }
.umschalter button[aria-pressed="true"] { background: var(--flaeche2); color: var(--text); }

/* ----------------------------------------------------------- Dartfeld */

.aufnahme-reihe {
  display: flex; align-items: center; gap: .4rem; margin-bottom: .6rem;
}
.wurf-slot {
  flex: 1 1 0; height: 2.5rem; border-radius: 8px;
  border: 1px dashed var(--linie); background: var(--bg);
  display: grid; place-items: center;
  font-family: var(--zahl); font-size: 1.05rem; color: var(--gedimmt);
}
.wurf-slot.voll { border-style: solid; border-color: var(--gruen); color: var(--text); }
.aufnahme-summe {
  flex: 0 0 4rem; text-align: right; font-family: var(--zahl);
  font-size: 1.5rem; color: var(--gold);
}

.dartfeld { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; }
.dartfeld.unten { grid-template-columns: repeat(3, 1fr); margin-top: .4rem; }

.dart {
  position: relative; height: 64px; overflow: hidden; cursor: pointer;
  background: var(--flaeche2); border: 1px solid var(--linie); color: var(--text);
  border-radius: 10px; font-family: var(--zahl);
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.dart .z {
  position: absolute; left: 0; right: 0; top: 0; bottom: 30%;
  display: grid; place-items: center; font-size: 1.3rem;
}
.dart.breit { height: 48px; }
.dart.breit .z { bottom: 0; font-size: .95rem; }
.dart .mod {
  position: absolute; bottom: 0; height: 30%; width: 50%;
  display: grid; place-items: center; font-size: .75rem; color: var(--gedimmt);
  border-top: 1px solid var(--linie);
}
.dart .mod.d { left: 0; border-right: 1px solid var(--linie); }
.dart .mod.t { right: 0; }
.dart:active, .dart .mod:active { background: var(--gruen); color: #06240f; }
.dart:hover { border-color: var(--akzent); }
.dart .mod:hover { background: var(--gruen); color: #06240f; }

/* Mit Maus erscheinen D und T erst beim Überfahren, auf dem Touchgerät
   stehen sie dauerhaft da – dort gibt es kein Hovern. */
@media (hover: hover) {
  .dart .mod { opacity: 0; transition: opacity .12s ease; }
  .dart:hover .mod, .dart:focus-within .mod { opacity: 1; }
}
@media (hover: none) {
  .dart .mod { opacity: .6; }
}

.zaehlart {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; margin-top: .7rem; flex-wrap: wrap;
}

/* ----------------------------------------------------------- Konfetti, Toasts */
#konfetti { position: fixed; inset: 0; pointer-events: none; z-index: 80; display: none; }
#konfetti.an { display: block; }

.toast-huelle { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: .4rem; align-items: center; }
.toast {
  background: var(--flaeche2); border: 1px solid var(--linie); color: var(--text);
  border-radius: 999px; padding: .45rem .9rem; font-size: .85rem; box-shadow: var(--schatten);
  animation: hoch .25s ease;
}
.toast.gut { border-color: var(--gruen); }
.toast.schlecht { border-color: var(--rot); }
@keyframes hoch { from { opacity: 0; transform: translateY(8px); } }

.jubel {
  position: fixed; inset: 0; display: grid; place-items: center; z-index: 85; pointer-events: none;
  font-size: clamp(3rem, 18vw, 11rem); font-weight: 900; color: var(--gold);
  text-shadow: 0 6px 30px rgba(0,0,0,.6); animation: knall 1.5s ease forwards;
}
@keyframes knall {
  0% { transform: scale(.3) rotate(-8deg); opacity: 0; }
  25% { transform: scale(1.15) rotate(2deg); opacity: 1; }
  70% { transform: scale(1) rotate(0); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* ----------------------------------------------------------- Klein & Druck */
@media (max-width: 620px) {
  main { padding: .7rem; }
  .modal { padding: .4rem; }
  .modal-fenster { padding: .7rem; border-radius: 12px; }
  .tafel { gap: .3rem; margin-bottom: .5rem; }
  .tafel .seite { padding: .35rem .2rem; }
  .tafel .seite .rest { font-size: 2rem; }
  .tafel .seite .sp-name { font-size: .78rem; }
  .tafel .seite .klein-info { font-size: .65rem; }
  .tasten button { padding: .9rem .2rem; font-size: 1.2rem; }
  .dartfeld { gap: .3rem; }
  .dart { height: 58px; }
  .dart .z { font-size: 1.15rem; }
  .kopf { gap: .5rem; padding: .5rem .7rem; }
  .marke { font-size: .95rem; }
}

@media print {
  .kopf, .aktionen, .banner, #baum-kopf .plaketten, .toast-huelle { display: none !important; }
  body { background: #fff; color: #000; }
  .ansicht { display: none !important; }
  .ansicht.aktiv { display: block !important; }
  .baum-huelle { overflow: visible; }
  .match, .karte, .runde { border-color: #999 !important; background: #fff !important; }
}

/* ----------------------------------------------------------- Als App auf dem iPhone
   Muss am Ende stehen: diese Regeln überschreiben die Polster von weiter oben,
   und bei gleicher Spezifität gewinnt die spätere Regel. */
.kopf {
  padding-top: calc(.7rem + env(safe-area-inset-top));
  padding-left: calc(1rem + env(safe-area-inset-left));
  padding-right: calc(1rem + env(safe-area-inset-right));
}
main {
  padding-bottom: calc(1.1rem + env(safe-area-inset-bottom));
  padding-left: calc(1.1rem + env(safe-area-inset-left));
  padding-right: calc(1.1rem + env(safe-area-inset-right));
}
.modal {
  padding-top: calc(.6rem + env(safe-area-inset-top));
  padding-bottom: calc(.6rem + env(safe-area-inset-bottom));
}
.toast-huelle { bottom: calc(1rem + env(safe-area-inset-bottom)); }

@media (max-width: 620px) {
  main {
    padding-left: calc(.7rem + env(safe-area-inset-left));
    padding-right: calc(.7rem + env(safe-area-inset-right));
    padding-bottom: calc(.7rem + env(safe-area-inset-bottom));
  }
}

/* Der Zähler auf dem Telefon: volle Höhe, Tafel oben, Tasten unten.
   Dazwischen schrumpft der Verlauf, statt alles aus dem Bild zu schieben. */
@media (max-width: 620px) {
  .modal-fenster {
    display: flex; flex-direction: column;
    height: 100%; max-height: 100%; width: 100%;
  }
  .modal-fenster > * { order: 5; flex: 0 0 auto; }
  .modal-fenster > .modal-kopf { order: 1; }
  .modal-fenster > .tafel { order: 2; }
  .modal-fenster > .finish-weg { order: 3; }
  .modal-fenster > .wuerfe {
    order: 4; flex: 1 1 auto; overflow-y: auto; min-height: 0;
    margin-top: 0; padding-top: .3rem;
  }
  .modal-fenster > .zaehlart { order: 8; }
  .modal-fenster > .modal-fuss { order: 9; margin-top: .5rem; }
  .modal-fenster > p.hinweis { display: none; }
  .dart { height: 54px; }
  .wurf-slot { height: 2.2rem; }
}
