/* Tauernwetter-Chrome fuer die Wind-Partikelkarte (Prototyp, keine externen Abhaengigkeiten) */
:root {
  --bg: #0e1620;
  --bar: #131e2b;
  --div: #24313f;
  --ink: #e8edf3;
  --muted: #7b8ca0;
  --accent: #2563eb;
}
.wrap * { box-sizing: border-box; }
/* Dunkles Kartendesign NUR im Kartenbereich - Kopf- und Fusszeile der Website
   behalten ihre eigenen Farben (Davids Vorgabe 21.08.). */
.wrap {
  max-width: 1180px; margin: 0 auto; padding: 18px 16px 28px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1f2937;                      /* helle Seite wie der Rest von tauernwetter.at */
}
/* Seitenkopf im Stil der uebrigen Modellseiten (kein zweites Logo) */
.pk-hero { margin: 0 0 14px; }
.pk-kicker { margin: 0; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: #2563eb; font-weight: 700; }
.pk-hero h1 { margin: 2px 0 4px; font-size: 1.9rem; line-height: 1.2; color: #111827; font-weight: 800; }
.pk-sub { margin: 0; color: #4b5563; font-size: .95rem; line-height: 1.5; }
.pk-modelinfo { margin: 6px 0 0; color: #6b7280; font-size: .82rem; }
/* Bedienelemente und Legende auf hellem Grund */
.layers button { background: #eef2f7; color: #1f2937; border: 1px solid #d5dde7; }
.layers button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.layers .chk { color: #374151; }
.ctrl button.ghost { background: #eef2f7; color: #1f2937; border: 1px solid #d5dde7; }
.legend .cap, .foot, .times .lbl { color: #6b7280; }
.stage { border-radius: 12px; overflow: hidden; }

.head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.head .logo {
  width: 34px; height: 34px; flex-shrink: 0;
}
.head h1 { font-size: 1.15rem; font-weight: 800; margin: 0; letter-spacing: .01em; }
.head .sub { font-size: .8rem; color: var(--muted); margin: 2px 0 0; }
.head .spacer { flex: 1 1 auto; }
.head .modelinfo { font-size: .78rem; color: var(--muted); text-align: right; line-height: 1.5; }
.head .modelinfo b { color: var(--ink); font-weight: 600; }

.stagewrap { position: relative; }
.stage {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #0b1119;
  box-shadow: 0 8px 26px rgba(0,0,0,.35);
  aspect-ratio: 5.8 / 3.5;   /* wird nach dem Laden exakt gesetzt */
}
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#cv-map { z-index: 1; }
#cv-wind { z-index: 2; }
#cv-top { z-index: 3; pointer-events: none; }

.stamp {
  position: absolute; z-index: 4; left: 12px; top: 10px;
  color: var(--ink);                      /* helle Schrift auf dunklem Kasten */
  background: rgba(11,17,25,.85);
  border: 1px solid var(--div);
  border-radius: 8px;
  padding: 7px 11px;
  font-size: .78rem; line-height: 1.45;
}
.stamp .t { font-weight: 700; font-size: .92rem; color: #fff; }
.stamp .m { color: var(--muted); }

/* Hinweis auf einen frisch geladenen Modelllauf - liegt in .stage, also auch im Vollbild sichtbar */
.toast {
  position: absolute; z-index: 6; left: 50%; top: 14px;
  transform: translate(-50%, -10px);
  background: rgba(37,99,235,.92); color: #fff;
  border: 1px solid rgba(255,255,255,.25); border-radius: 999px;
  padding: 7px 16px; font-size: .8rem; font-weight: 600;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
  opacity: 0; pointer-events: none;
  transition: opacity .35s ease, transform .35s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

.pausehint { display: none; }   /* Hinweis entfaellt, auch am Desktop (David 21.08.) */

.ctrl { display: flex; align-items: center; gap: 12px; margin: 12px 2px 0; flex-wrap: wrap; }
.ctrl button {
  background: var(--accent); border: none; color: #fff; border-radius: 8px;
  padding: 7px 14px; font-size: .82rem; font-weight: 600; cursor: pointer;
}
.ctrl button.ghost { background: #1d2b3d; color: var(--ink); }
.ctrl button:disabled { opacity: .45; cursor: default; }
.ctrl input[type=range] { flex: 1 1 240px; accent-color: var(--accent); }
.ctrl .step { font-size: .8rem; color: var(--muted); min-width: 148px; }

.times { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 2px 0; align-items: center; }
.times .lbl { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-right: 2px; }
.times button {
  background: #1d2b3d; border: 1px solid var(--div); color: var(--ink);
  border-radius: 999px; padding: 6px 13px; font-size: .82rem; cursor: pointer;
}
.times button[aria-pressed=true] { background: var(--accent); border-color: var(--accent); font-weight: 700; }
.times select {
  background: #1d2b3d; border: 1px solid var(--div); color: var(--ink);
  border-radius: 8px; padding: 6px 10px; font-size: .82rem;
}


/* --- Ebenenwahl --- */
.layers { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 2px 10px; }
.layers button {
  background: #1d2b3d; border: 1px solid var(--div); color: var(--ink);
  border-radius: 999px; padding: 7px 16px; font-size: .84rem; cursor: pointer;
}
.layers button[aria-pressed=true] { background: var(--accent); border-color: var(--accent); font-weight: 700; }
.layers .chk { font-size: .8rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; cursor: pointer; }
.layers .chk input { accent-color: var(--accent); }

.note { font-size: .72rem; color: var(--muted); margin: 10px 2px 0; }

.legend { margin-top: 16px; }
.legend .bar { height: 14px; border-radius: 7px; }
.legend .ticks {
  position: relative; height: 16px;
  font-size: .72rem; color: var(--muted); margin-top: 5px;
}
.legend .cap { font-size: .78rem; color: var(--muted); margin-bottom: 6px; letter-spacing: .01em; }

.foot { margin-top: 14px; font-size: .72rem; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.foot a { color: var(--muted); }

/* Handy: die beiden Einblendungen ueberlappen sonst; Hinweis ausblenden, Zeitstempel kleiner */
@media (max-width: 700px) {
  .pausehint { display: none; }
  /* Handy: Zeitstempel und Vollbild-Knopf duerfen die Karte nicht verdecken.
     Der Zeitstempel wandert unter die Karte, der Knopf wird klein und dezent. */
  .stamp {
    position: static; background: none; border: 0; padding: 6px 2px 0;
    color: #374151; font-size: .8rem; display: flex; gap: 8px; align-items: baseline;
    flex-wrap: wrap;
  }
  .stamp .t { font-size: .86rem; color: #111827; }
  .stamp .m { color: #6b7280; }
  .zreset { right: 5px; bottom: 5px; padding: 6px 9px; font-size: .72rem; opacity: .9; }
  .times button, .times select { padding: 7px 12px; font-size: .8rem; }
  .ctrl button { flex: 1 1 auto; }
  .layers button { padding: 7px 13px; font-size: .8rem; }
  /* Handy: Zeile 1 = drei Ebenen, Zeile 2 = beide Modelle + Haekchen rechts daneben */
  .layers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; align-items: center; }
  .layers > button[data-layer] { grid-row: 1; }
  .layers .models { grid-row: 2; grid-column: 1 / 3; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .layers .chk {
    grid-row: 2; grid-column: 3; justify-self: end;
    display: flex; align-items: center; gap: 6px; font-size: .74rem; line-height: 1.15; text-align: right;
  }
  .layers .chk input { width: 18px; height: 18px; flex-shrink: 0; }
}


/* --- Modellwahl, Tempo, Vollbild --- */
.layers .sep {
  width: 1px; height: 22px; background: var(--div); margin: 0 4px; display: inline-block;
}
.layers .models { display: inline-flex; gap: 6px; }

.ctrl .speed {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; color: var(--muted);
}
.ctrl .speed select {
  background: #1d2b3d; color: var(--ink); border: 1px solid var(--div);
  border-radius: 7px; padding: 4px 7px; font: inherit; font-size: .78rem;
}

.fsbtn {
  position: absolute; z-index: 4; left: 12px; bottom: 12px;
  width: 34px; height: 34px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(11,17,25,.72); border: 1px solid var(--div);
  border-radius: 8px; color: var(--ink); cursor: pointer;
}
.fsbtn svg { width: 18px; height: 18px; }
.fsbtn:hover { background: rgba(37,99,235,.85); border-color: transparent; }

/* Vollbild: nur die Karte, keine Bedienelemente */
.stage.fs {
  position: fixed; inset: 0; z-index: 9999;
  width: 100vw; height: 100vh; max-width: none;
  border-radius: 0; aspect-ratio: auto !important;
  background: #0b1119;
}
.stage.fs .stamp { left: max(12px, env(safe-area-inset-left)); top: max(12px, env(safe-area-inset-top)); }
.stage.fs .pausehint { display: none; }
.stage.fs .toast { top: max(14px, env(safe-area-inset-top)); }   /* Hinweis bleibt im Vollbild sichtbar */
.stage.fs .fsbtn { left: max(12px, env(safe-area-inset-left)); bottom: max(12px, env(safe-area-inset-bottom)); }
.stage.fs .zreset { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
body.fs-lock { overflow: hidden; overscroll-behavior: none; }

/* --- Zoomen und Verschieben ---
   Der Browser-Zoom greift auf einer Vollflaeche nicht (Chrome sperrt die Geste im
   Vollbild ganz), deshalb zoomt die Karte selbst. touch-action steuert, was der
   Browser abfangen darf: normal bleibt das senkrechte Seiten-Scrollen erhalten,
   im Vollbild und im gezoomten Zustand gehoeren alle Gesten der Karte. */
/* Ausserhalb des Vollbilds NICHTS abfangen: Zwei-Finger-Geste zoomt die ganze Seite
   samt Karte, wie bei jeder normalen Webseite. (Davids Vorgabe 21.08.) */
.stage { touch-action: auto; }
.stage.fs { touch-action: none; }
.stage.zoomed { cursor: grab; }
.stage.zoomed.dragging { cursor: grabbing; }

.zreset {
  position: absolute; z-index: 4; right: 12px; bottom: 12px;
  padding: 7px 11px; font: inherit; font-size: .76rem;
  background: rgba(11,17,25,.78); border: 1px solid var(--div);
  border-radius: 8px; color: var(--ink); cursor: pointer;
}
.zreset:hover { background: rgba(37,99,235,.85); border-color: transparent; }
.zreset[hidden] { display: none; }

/* Vollbild: der Zeitstempel liegt ausserhalb der Karte -> fest ueber der Karte einblenden */
body.fs-lock .stamp {
  position: fixed; z-index: 60;
  left: max(12px, env(safe-area-inset-left)); top: max(12px, env(safe-area-inset-top));
  background: rgba(11,17,25,.72); border: 1px solid var(--div); border-radius: 8px;
  padding: 7px 11px; color: var(--ink);
}
body.fs-lock .stamp .t { color: #fff; }
body.fs-lock .stamp .m { color: var(--muted); }

/* Schnellauswahl Tag + Uhrzeit */
.jump { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0 0; }
.jump .jl { font-size: .78rem; color: #6b7280; }
.jump .days { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.jump .days button {
  background: #eef2f7; color: #1f2937; border: 1px solid #d5dde7;
  border-radius: 8px; padding: 6px 12px; font-size: .82rem; cursor: pointer;
}
.jump .days button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.jump select {
  background: #eef2f7; color: #1f2937; border: 1px solid #d5dde7;
  border-radius: 8px; padding: 6px 10px; font-size: .82rem;
}
@media (max-width: 700px) {
  /* Handy: Tag + Uhrzeit in EINE Zeile - Beschriftungen weg, Tage kompakt */
  .jump { flex-wrap: nowrap; gap: 6px; align-items: center; }
  .jump .jl { display: none; }
  .jump .days { flex-wrap: nowrap; gap: 5px; flex: 1 1 auto; min-width: 0; }
  .jump .days button {
    padding: 7px 8px; font-size: .78rem; flex: 1 1 0; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .jump select { padding: 7px 8px; font-size: .78rem; flex: 0 0 auto; max-width: 44%; }
}

/* Beschriftung des Wind-Haekchens: lang am Desktop, kurz am Handy */
.chk .lbl-short { display: none; }
@media (max-width: 700px) {
  .chk .lbl-long { display: none; }
  .chk .lbl-short { display: inline; white-space: nowrap; font-weight: 700; }
  .layers .chk { font-size: .78rem; text-align: left; }
}

/* Querverweis auf die Modellkarten */
.pk-more { margin: 22px 0 4px; padding: 18px 20px; background: #f3f6fa; border: 1px solid #e2e8f0; border-radius: 12px; }
.pk-more h2 { margin: 0 0 6px; font-size: 1.15rem; font-weight: 800; color: #111827; }
.pk-more p { margin: 0 0 12px; color: #4b5563; font-size: .92rem; line-height: 1.55; max-width: 70ch; }
.pk-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pk-links a {
  display: inline-block; padding: 8px 14px; border-radius: 999px; text-decoration: none;
  background: #fff; border: 1px solid #d5dde7; color: #1f2937; font-size: .86rem; font-weight: 600;
}
.pk-links a:hover { border-color: #2563eb; color: #2563eb; }
.pk-links a.chip {
  border: 1.5px solid transparent; border-radius: 999px; padding: 6px 13px;
  font-size: .8rem; font-weight: 700; letter-spacing: .01em;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.pk-links a.chip:hover {
  filter: brightness(.96); transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(15, 23, 42, .13);
}
.note a.plainref {
  color: inherit; text-decoration: none; cursor: inherit;
  border: 0; background: none; font: inherit;
}
.note a.plainref:hover, .note a.plainref:focus {
  color: inherit; text-decoration: none;
}
.pk-links a.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.pk-links a.primary:hover { background: #1d4ed8; color: #fff; }
@media (max-width: 700px) {
  .pk-more { padding: 15px 16px; }
  .pk-links a { padding: 8px 12px; font-size: .82rem; }
  .pk-links a.chip { padding: 6px 12px; font-size: .78rem; }
}

/* Handy: Vollbild-Knopf dichter in die Ecke links unten.
   Muss am Dateiende stehen - die Grundregel .fsbtn kommt weiter oben und
   wuerde eine frueher notierte Media-Regel sonst ueberschreiben. */
@media (max-width: 700px) {
  .fsbtn { width: 28px; height: 28px; left: 2px; bottom: 2px; opacity: .82; }
  .fsbtn svg { width: 15px; height: 15px; }
}
