/* Hafenmeister: Oberfläche im Pixel-Stil, für alle Geräte gleich
 *
 * Von Grund auf neu (12.11.2026). Gerüst und Pixel-Grafiken baut web/js/ui/oberflaeche.js,
 * hier stehen Aussehen und Anordnung. ui-pc.css, ui-tablet.css, ui-phone.css stellen nur Größen ein.
 * Konzept, Daumenzonen und Quellen: docs/ui/oberflaeche.md.
 *
 *   oben links    .hm-status     Kasse, Ruf
 *   oben rechts   .hm-werkzeuge  Übersicht, Menü
 *   links         #hm-seite      Wetter, Tagesziele, Ziel der nächsten Stufe
 *   unten links   #hm-zeit       Tag, Tagesbalken, Tempo (Pause, 1x, 3x, 8x)
 *   unten Mitte   #btn-collect   Kassieren
 *   unten rechts  #btn-build     Bauen
 *
 * Alle Regeln beginnen mit .hm-neu (Klasse am body), damit sie die Stile schlagen, die einzelne
 * Module zur Laufzeit in den <head> schreiben.
 */

/* Alles in Pixelify Sans, auch Ziffern und Euro (Jorven 14.11.: "Rückgängig 8 s" stand in der Systemschrift).
 * Vorher kamen Ziffern über unicode-range aus der Systemschrift; das sah wie ein Ladefehler aus.
 * Damit Zahlen lesbar bleiben, stehen sie nie unter 14 px (Regeln unten bei "Ziffern").
 * index.html lädt die drei Schnitte vorab (preload), main.js wartet kurz auf sie, bevor Module
 * Texte in Canvas zeichnen; font-display: block statt swap, damit nie kurz die Systemschrift erscheint. */
@font-face {
  font-family: "Pixelify Sans";
  src: url("../fonts/pixelify-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: block;
}
@font-face {
  font-family: "Pixelify Sans";
  src: url("../fonts/pixelify-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: block;
}
@font-face {
  font-family: "Pixelify Sans";
  src: url("../fonts/pixelify-sans-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: block;
}

:root {
  --hm-tinte: #24364a;
  --hm-tinte-2: #5a6a7c;
  --hm-papier: #fffaf0;
  --hm-mulde: #e9dfca;
  --hm-meer: #23897d;
  --hm-koralle: #ee6454;
  --hm-gold: #f2c14e;
  --hm-pixel: "Pixelify Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hm-text: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Größen: Geräte-Dateien überschreiben sie */
  --hm-px: 2px;               /* ein Pixel der Rahmen */
  --hm-knopf: 48px;           /* Knöpfe oben, Statusleiste */
  --hm-tempo: 44px;           /* Tempo-Knöpfe */
  --hm-chip: 40px;
  --hm-bauen: 60px;
  --hm-schrift: 15px;
  --hm-rand: 12px;
  --hm-luecke: 8px;
  --hm-symbol: 24px;          /* Vielfaches von 12 bleibt scharf */
  --hm-karte-breite: 380px;
  --hm-oben: calc(var(--hm-safe-top) + var(--hm-rand));
  --hm-links: calc(var(--hm-safe-left) + var(--hm-rand));
  --hm-rechts: calc(var(--hm-safe-right) + var(--hm-rand));
  --hm-unten: calc(var(--hm-safe-bottom) + var(--hm-rand));
  --hm-rahmen-breite: calc(var(--hm-px) * 3) calc(var(--hm-px) * 3) calc(var(--hm-px) * 4);
}

/* Schriftgröße mit Faktor aus den Einstellungen (P50): body.hm-gross */
body.hm-neu { --hm-s: calc(var(--hm-schrift) * var(--hm-gross, 1)); }
body.hm-neu.hm-gross { --hm-gross: 1.2; }
html:has(body.hm-gross) { font-size: 118%; }
body.hm-neu { font: 400 var(--hm-s)/1.4 var(--hm-pixel); color: var(--hm-tinte); letter-spacing: 0.01em; }
/* Alles in Pixelschrift, auch Fließtext und was Module mit system-ui in den <head> schreiben.
 * Ziffern und Euro gehören dazu (siehe @font-face). */
.hm-neu, .hm-neu *:not(canvas) { font-family: var(--hm-pixel) !important; }
.hm-neu button { font: inherit; color: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.hm-neu button:focus-visible { outline: 3px dashed var(--hm-gold); outline-offset: 3px; }
.hm-neu .spacer { display: none; }

/* ------------------------------------------------------------ Pixel-Rahmen */
.hm-neu .hm-px,
.hm-neu #hm-seite .hm-px,
.hm-neu #card,
.hm-neu .hm-tipp,
.hm-neu #event-banner,
.hm-neu #hud-goal.done,
.hm-neu .hm-einfahren,
.hm-neu .bau-schild,
.hm-neu .bau-tipp,
.hm-neu #hm-audio-popover .hm-audio-panel,
.hm-neu #hm-audio-popover.hm-audio-panel,
.hm-neu #card .hud-btn,
.hm-neu .hm-knopf,
.hm-neu .hm-tempo-knopf {
  border-style: solid;
  border-color: transparent;
  border-width: var(--hm-rahmen-breite);
  border-image-source: var(--rahmen-papier);
  border-image-slice: 3 3 4 3 fill;
  border-image-width: var(--hm-rahmen-breite);
  border-image-repeat: stretch;
  border-radius: 0;
  background: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.hm-neu button.hm-px:active, .hm-neu #card .hud-btn:active:not(:disabled), .hm-neu .hm-knopf:active, .hm-neu .hm-tempo-knopf:active { transform: translateY(var(--hm-px)); }
.hm-neu button.hm-px { cursor: pointer; }

/* Pixel-Symbol: Maske in der Textfarbe */
.hm-neu .hm-sym {
  display: inline-block;
  flex: none;
  width: var(--hm-symbol);
  height: var(--hm-symbol);
  background: currentColor;
  -webkit-mask: var(--sym) center / contain no-repeat;
  mask: var(--sym) center / contain no-repeat;
  font-style: normal;
}

/* ------------------------------------------------------------ Oben */
.hm-neu #hud-top {
  position: absolute;
  z-index: 20;
  top: var(--hm-oben);
  left: var(--hm-links);
  right: var(--hm-rechts);
  bottom: auto;
  width: auto;
  height: auto;
  transform: none;
  display: flex;
  align-items: flex-start;
  gap: var(--hm-luecke);
  padding: 0;
  margin: 0;
  background: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
  pointer-events: none;
}
.hm-neu #hud-top > * { pointer-events: auto; }

.hm-neu .hm-status {
  display: flex;
  align-items: center;
  height: var(--hm-knopf);
  padding: 0 2px;
  font-family: var(--hm-pixel);
}
.hm-neu .hm-status .stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  font-size: calc(var(--hm-s) + 4px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--hm-tinte);
  background: none;
  box-shadow: none;
}
.hm-neu .hm-status .stat + .stat { border-left: var(--hm-px) dotted rgba(36, 54, 74, 0.35); }
.hm-neu #money::before, .hm-neu #rep::before {
  content: "";
  width: var(--hm-symbol);
  height: var(--hm-symbol);
  background: var(--px-muenze) center / contain no-repeat;
}
.hm-neu #rep::before { background-image: var(--px-stern); }

.hm-neu .hm-werkzeuge { display: flex; gap: var(--hm-luecke); margin-left: auto; }
.hm-neu .hm-rund {
  display: grid;
  place-items: center;
  width: var(--hm-knopf);
  height: var(--hm-knopf);
  min-width: 0;
  min-height: 0;
  padding: 0;
  color: var(--hm-tinte);
  font-size: 0;
  line-height: 0;
  overflow: hidden;
}
.hm-neu .hm-rund::after { content: none !important; }
.hm-neu #btn-menu[aria-expanded="true"] { border-image-source: var(--rahmen-tinte); color: var(--hm-papier); }

/* ------------------------------------------------------------ Menü */
.hm-neu #hm-menue {
  position: absolute;
  z-index: 40;
  top: calc(var(--hm-oben) + var(--hm-knopf) + 6px);
  right: var(--hm-rechts);
  display: grid;
  gap: 2px;
  min-width: 240px;
  padding: 4px;
  animation: hm-auf 0.12s steps(3);
}
.hm-neu #hm-menue[hidden] { display: none; }
.hm-neu .hm-zeile {
  position: static;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  height: auto;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--hm-tinte);
  font-family: var(--hm-pixel);
  font-size: calc(var(--hm-s) + 2px);
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  opacity: 1;
  box-shadow: none;
  cursor: pointer;
}
.hm-neu .hm-zeile::after { content: none !important; }
.hm-neu .hm-zeile:hover, .hm-neu .hm-zeile:active { background: var(--hm-mulde); }
.hm-neu #btn-sound.hm-audio-off .hm-sym { --sym: var(--px-stumm) !important; }

.hm-neu #hm-audio-popover {
  position: absolute;
  z-index: 40;
  top: calc(var(--hm-oben) + var(--hm-knopf) + 6px);
  right: var(--hm-rechts);
  max-width: calc(100vw - 2 * var(--hm-rand));
  border-radius: 0;
  box-shadow: none;
}
.hm-neu .hm-audio-panel { padding: 10px 12px; }
.hm-neu .hm-audio-mute { border-radius: 0; background: var(--hm-mulde); color: var(--hm-tinte); font-family: var(--hm-pixel); font-weight: 600; }
.hm-neu .hm-audio-stumm .hm-audio-mute { background: var(--hm-koralle); color: #fff; }
.hm-neu .hm-audio-row input[type="range"] { accent-color: var(--hm-meer); }

/* ------------------------------------------------------------ Links: Wetter, Tagesziele, Ziel */
.hm-neu #hm-seite {
  position: absolute;
  z-index: 15;
  top: calc(var(--hm-oben) + var(--hm-knopf) + 8px);
  left: var(--hm-links);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: min(300px, calc(100vw - 2 * var(--hm-rand) - var(--hm-safe-left) - var(--hm-safe-right)));
  pointer-events: none;
}
.hm-neu #hm-seite > * { pointer-events: auto; }
.hm-neu #hm-seite > .hm-tafel,
.hm-neu #hm-seite > .hm-ziel { position: static; inset: auto; margin: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; font: inherit; }
.hm-neu #hm-seite [hidden] { display: none !important; }

.hm-neu .hm-chip,
.hm-neu #hm-seite .hm-chip {
  position: static;
  inset: auto;
  transform: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  min-height: var(--hm-chip);
  height: var(--hm-chip);
  margin: 0;
  padding: 0 10px 0 6px;
  color: var(--hm-tinte);
  font-family: var(--hm-pixel);
  font-size: calc(var(--hm-s) + 1px);
  font-weight: 600;
  white-space: nowrap;
  --hm-symbol: 18px;
}
.hm-neu #weather-chip svg { width: 22px; height: 22px; flex: none; }
.hm-neu #hm-seite #weather-chip.has-news { border-image-source: var(--rahmen-gold); }
.hm-neu .hm-tafel-knopf::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  background: var(--hm-meer);
  -webkit-mask: var(--px-ziele) center / contain no-repeat;
  mask: var(--px-ziele) center / contain no-repeat;
}
.hm-neu .hm-ziel-knopf .hm-sym { color: var(--hm-koralle); }
.hm-neu #hm-seite .hm-chip[aria-expanded="true"] { border-image-source: var(--rahmen-tinte); color: var(--hm-papier); }
.hm-neu .hm-chip[aria-expanded="true"] .hm-sym { color: inherit; }
.hm-neu .hm-chip[aria-expanded="true"]::before { background: currentColor; }
.hm-neu .hm-chip-zahl { padding: 0 6px; background: var(--hm-mulde); color: var(--hm-tinte); font-size: 0.9em; }
.hm-neu .hm-ziel.fertig .hm-ziel-knopf { border-image-source: var(--rahmen-gold); }
.hm-neu .hm-tafel.jubel > button { animation: hm-hupf 0.5s steps(4); }

/* Aufgeklappte Tafeln */
.hm-neu .hm-tafel-px,
.hm-neu #hm-seite .hm-tafel-px {
  position: static;
  inset: auto;
  transform: none;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  max-height: 46vh;
  overflow-y: auto;
  margin: 0;
  padding: 8px 10px;
  color: var(--hm-tinte);
  font-size: var(--hm-s);
  animation: hm-auf 0.12s steps(3);
}
.hm-neu #hm-menue.hm-tafel-px { position: absolute; width: auto; max-height: none; overflow: visible; padding: 4px; }
/* Nie höher als der Bildschirm: notfalls scrollen statt Einträge unerreichbar abschneiden */
.hm-neu #hm-menue.hm-tafel-px { max-height: calc(100dvh - var(--hm-oben) - var(--hm-knopf) - 14px); overflow-y: auto; overscroll-behavior: contain; }
/* Weitere Zeilen unterhalb: Streifen am unteren Rand (oberflaeche.js setzt hm-mehr) */
.hm-neu #hm-menue.hm-mehr::after {
  content: '▼ weiter unten';
  position: sticky;
  bottom: -4px;
  grid-column: 1 / -1;
  margin: -14px -4px -4px;
  padding: 16px 0 4px;
  text-align: center;
  font-size: 0.8em;
  color: var(--hm-tinte-2);
  background: linear-gradient(to bottom, rgba(255, 250, 240, 0), var(--hm-papier) 55%);
  pointer-events: none;
}
.hm-neu #hm-seite .hm-tafel li { padding: 6px 0; border-top: var(--hm-px) dotted rgba(36, 54, 74, 0.25); }
.hm-neu #hm-seite .hm-tafel li:first-child { border-top: 0; }
.hm-neu #hm-seite .hm-tafel li.erledigt { color: var(--hm-meer); }
.hm-neu #weather-panel .wp-row { border-top: var(--hm-px) dotted rgba(36, 54, 74, 0.25); }
.hm-neu .hm-klapp-kopf { margin: 0 0 6px; font-family: var(--hm-pixel); font-weight: 600; font-size: calc(var(--hm-s) + 1px); }
.hm-neu .hm-balken-zeile { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 4px 0; }
.hm-neu .hm-balken-wert { font-variant-numeric: tabular-nums; color: var(--hm-tinte-2); }
.hm-neu .hm-balken-zeile.ok .hm-balken-wert { color: var(--hm-meer); font-weight: 700; }
.hm-neu .hm-balken { grid-column: 1 / -1; height: calc(var(--hm-px) * 4); background: var(--hm-mulde); box-shadow: inset 0 0 0 var(--hm-px) rgba(36, 54, 74, 0.3); }
.hm-neu .hm-balken > i { display: block; height: 100%; background: var(--hm-gold); box-shadow: inset 0 calc(var(--hm-px) * -1) 0 rgba(0, 0, 0, 0.15); }
.hm-neu .hm-balken-zeile.ok .hm-balken > i { background: var(--hm-meer); }
.hm-neu .hm-tafel-px .hm-knopf { width: 100%; margin-top: 6px; }

/* Abschlussziel aus hud.js: die Zeile steckt im Ziel-Schild, nur die Erfolgsmeldung bleibt */
.hm-neu #hud-goal:not(.done) { display: none !important; }
.hm-neu #hud-goal.done {
  top: calc(var(--hm-oben) + var(--hm-knopf) + 12px);
  bottom: auto;
  padding: 8px 16px;
  border-image-source: var(--rahmen-meer);
  color: #fff;
  font-family: var(--hm-pixel);
  font-size: calc(var(--hm-s) + 2px);
  z-index: 35;
}

.hm-neu #event-banner { top: calc(var(--hm-oben) + var(--hm-knopf) + 8px); z-index: 25; }
.hm-neu #event-banner strong { font-family: var(--hm-pixel); font-weight: 600; font-size: calc(var(--hm-s) + 2px); }

/* ------------------------------------------------------------ Unten: Zeit, Kassieren, Bauen */
.hm-neu #hud-bottom {
  position: absolute;
  z-index: 20;
  top: auto;
  left: var(--hm-links);
  right: var(--hm-rechts);
  bottom: var(--hm-unten);
  width: auto;
  height: auto;
  transform: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: var(--hm-luecke);
  padding: 0;
  margin: 0;
  background: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;
  transition: transform 0.2s steps(4), opacity 0.2s;
}
.hm-neu #hud-bottom > * { pointer-events: auto; }
.hm-neu #hud-bottom > #queue { display: none; }
.hm-neu #hm-zeit { grid-column: 1; grid-row: 1; justify-self: start; }
.hm-neu #btn-collect { grid-column: 2; grid-row: 1; justify-self: center; }
.hm-neu #btn-build { grid-column: 3; grid-row: 1; justify-self: end; }

/* Zeit */
.hm-neu #hm-zeit { display: grid; gap: 4px; padding: 2px 3px 1px; }
.hm-neu .hm-zeit-kopf { display: flex; align-items: center; gap: 8px; padding: 0 3px; min-height: 26px; }
.hm-neu #hm-zeit #day {
  flex: none;
  padding: 0;
  height: auto;
  background: none;
  box-shadow: none;
  font-family: var(--hm-pixel);
  font-size: calc(var(--hm-s) + 1px);
  font-weight: 600;
  white-space: nowrap;
  color: var(--hm-tinte);
}
.hm-neu #hm-zeit #day::after, .hm-neu #hm-zeit #day::before { content: none; }
.hm-neu .hm-himmel {
  --anteil: 0;
  position: relative;
  flex: 1 1 auto;
  min-width: 48px;
  height: calc(var(--hm-px) * 7);
  background: #9fd6e8;
  box-shadow: inset 0 0 0 var(--hm-px) var(--hm-tinte), inset 0 calc(var(--hm-px) * -3) 0 #7cc0d8;
}
.hm-neu .hm-abendteil {
  position: absolute;
  top: var(--hm-px);
  bottom: var(--hm-px);
  right: var(--hm-px);
  background: #f2a46a;
  box-shadow: inset 0 calc(var(--hm-px) * -2) 0 #de8350;
}
.hm-neu .hm-himmel.abend { background: #6f86b5; box-shadow: inset 0 0 0 var(--hm-px) var(--hm-tinte), inset 0 calc(var(--hm-px) * -3) 0 #5a6f9c; }
.hm-neu .hm-gestirn {
  position: absolute;
  top: 50%;
  left: calc(var(--anteil) * (100% - 24px));
  width: 24px;
  height: 24px;
  margin-top: -12px;
  background: var(--px-sonne) center / contain no-repeat;
}
.hm-neu .hm-gestirn.mond { background-image: var(--px-mond); }

.hm-neu .hm-tempo { display: flex; gap: 3px; }
.hm-neu .hm-tempo-knopf {
  display: grid;
  place-items: center;
  width: var(--hm-tempo);
  height: var(--hm-tempo);
  min-width: 0;
  min-height: 0;
  padding: 0;
  border-image-source: var(--rahmen-mulde);
  color: var(--hm-tinte-2);
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  --hm-symbol: 18px;
}
.hm-neu .hm-tempo-knopf::after { content: none !important; }
.hm-neu .hm-tempo-knopf:hover { color: var(--hm-tinte); }
.hm-neu .hm-tempo-knopf[aria-pressed="true"] { border-image-source: var(--rahmen-meer); color: #fff; }
.hm-neu .hm-tempo-knopf[data-tempo="pause"][aria-pressed="true"] { border-image-source: var(--rahmen-koralle); }
.hm-neu.paused:not(.building) #stage { filter: saturate(0.65) brightness(0.96); }

/* Kassieren */
.hm-neu #btn-collect {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--hm-bauen);
  min-height: 0;
  padding: 0 14px 0 10px;
  border-image-source: var(--rahmen-gold);
  color: #3b2a07;
  font-family: var(--hm-pixel);
  font-size: calc(var(--hm-s) + 4px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  animation: hm-hupf 2.4s steps(1) infinite;
}
.hm-neu #btn-collect::before {
  content: "";
  flex: none;
  width: var(--hm-symbol);
  height: var(--hm-symbol);
  background: var(--px-muenze) center / contain no-repeat;
}
.hm-neu #btn-collect::after { content: none !important; }

/* Bauen */
.hm-neu #btn-build {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-width: 0;
  height: var(--hm-bauen);
  min-height: 0;
  padding: 0 18px 0 14px;
  border-image-source: var(--rahmen-koralle);
  color: #fff;
  font-family: var(--hm-pixel);
  font-size: calc(var(--hm-s) + 5px);
  font-weight: 700;
  text-shadow: 0 var(--hm-px) 0 rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}
.hm-neu.building #btn-build,
.hm-neu #btn-build[aria-pressed="true"] { border-image-source: var(--rahmen-tinte); }
.hm-neu.building #btn-build .hm-sym { --sym: var(--px-zu) !important; }
.hm-neu #btn-build.bau-punkt::after {
  content: "";
  position: absolute;
  top: calc(var(--hm-px) * -6);
  right: calc(var(--hm-px) * -6);
  width: calc(var(--hm-px) * 7);
  height: calc(var(--hm-px) * 7);
  margin: 0;
  padding: 0;
  border: var(--hm-px) solid var(--hm-tinte);
  border-radius: 0;
  background: var(--hm-gold);
  box-sizing: border-box;
  animation: hm-blink 1.2s steps(1) infinite;
}
.hm-neu #btn-build:not(.bau-punkt)::after { content: none; }

/* "Als Nächstes" (bauen.js) */
.hm-neu .bau-tipp { padding: 6px 12px; }
.hm-neu .bau-tipp::after { display: none; }
.hm-neu .bau-tipp-titel { color: var(--hm-meer); font-family: var(--hm-pixel); letter-spacing: 0.04em; }
.hm-neu.card-open .bau-tipp { display: none; }

/* Knopf "Einfahren" am Boot (gesten.js) */
.hm-neu .hm-einfahren { border-image-source: var(--rahmen-meer); color: #fff; font-family: var(--hm-pixel); font-size: calc(var(--hm-s) + 2px); padding: 0 14px; min-height: 44px; }

/* Preisschilder über Bauplätzen (bauen.js) */
.hm-neu .bau-schild { padding: 2px 8px; font-family: var(--hm-pixel); font-size: 13px; }
/* Zeiger im Pixel-Stil: Treppendreieck in Tinte, zeigt auf den Bauplatz (--zeiger-x setzt bauen.js) */
.hm-neu .bau-schild::after {
  content: '';
  position: absolute;
  left: var(--zeiger-x, 50%);
  top: calc(100% + var(--hm-px) * 2);
  bottom: auto;
  width: 14px;
  height: 8px;
  margin-left: -7px;
  border: 0;
  background: var(--hm-tinte);
  clip-path: polygon(0 0, 14px 0, 14px 2px, 12px 2px, 12px 4px, 10px 4px, 10px 6px, 8px 6px, 8px 8px, 6px 8px, 6px 6px, 4px 6px, 4px 4px, 2px 4px, 2px 2px, 0 2px);
}
.hm-neu .bau-schild.empfohlen::after { background: #b8862a; }
/* Punkt (Schild ohne Platz für Text): kein Zeiger, dafür 40 px Trefferfläche um den 22-px-Punkt (Zusammenspiel 2) */
.hm-neu .bau-schild.punkt::after { left: -9px; top: -9px; right: -9px; bottom: -9px; width: auto; height: auto; margin: 0; background: none; clip-path: none; transform: none; }
.hm-neu .bau-schild.unten::after { top: calc(-8px - var(--hm-px) * 3); transform: rotate(180deg); border: 0; }
.hm-neu .bau-schild.empfohlen { outline: 0; border-image-source: var(--rahmen-gold); }
.hm-neu .bau-schild-preis { color: var(--hm-meer); }

/* ------------------------------------------------------------ Karte */
.hm-neu #card {
  position: absolute;
  z-index: 30;
  box-sizing: border-box;
  min-width: 0;
  padding: 12px 14px 10px;
  color: var(--hm-tinte);
  font-size: var(--hm-s);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.hm-neu #card h2 { margin: 0 0 2px; font-family: var(--hm-pixel); font-size: calc(var(--hm-s) + 7px); font-weight: 700; line-height: 1.15; }
.hm-neu #card p { margin: 0 0 10px; color: var(--hm-tinte-2); opacity: 1; }
.hm-neu #card .card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.hm-neu #card .card-actions .hud-btn { flex: 1 1 120px; }
.hm-neu #card .hud-btn,
.hm-neu .hm-knopf {
  min-width: 0;
  min-height: 48px;
  padding: 4px 10px;
  color: var(--hm-tinte);
  font-family: var(--hm-pixel);
  font-size: calc(var(--hm-s) + 2px);
  font-weight: 600;
  line-height: 1.15;
  cursor: pointer;
}
.hm-neu #card .hud-btn::after { content: none !important; }
.hm-neu #card .hud-btn:disabled { opacity: 0.5; cursor: default; }
.hm-neu #card .hm-primaer:not(:disabled),
.hm-neu .hm-knopf.hm-primaer,
.hm-neu #card .bau-ja:not(:disabled) { border-image-source: var(--rahmen-meer) !important; background: none !important; color: #fff !important; }
.hm-neu #card .hm-gefahr { border-image-source: var(--rahmen-hell); color: #b8473a; }
.hm-neu #card .card-note { color: #b8473a; font-weight: 650; }

/* Bootskarte */
.hm-neu .hm-karte-kopf { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.hm-neu .hm-karte-kopf > div { flex: 1 1 auto; min-width: 0; }
.hm-neu .hm-karte-kopf .card-boatname { margin: 2px 0 0; }
.hm-neu .hm-karte-kopf .card-geschichte { margin: 4px 0 0; font-style: italic; line-height: 1.25; opacity: 0.9; }
.hm-neu .hm-zu {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-width: 0;
  min-height: 0;
  margin: -4px -4px 0 0;
  padding: 0;
  border: 0;
  background: var(--hm-mulde);
  color: var(--hm-tinte);
  font-size: 0;
  cursor: pointer;
}
.hm-neu .hm-zu::before {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: var(--px-zu) center / contain no-repeat;
  mask: var(--px-zu) center / contain no-repeat;
}
.hm-neu .hm-fakten { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 10px; padding: 0; list-style: none; }
.hm-neu .hm-fakten li {
  padding: 2px 8px;
  background: var(--hm-mulde);
  font-family: var(--hm-pixel);
  font-size: var(--hm-s);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hm-neu .hm-fakten li.groesse { background: var(--hm-tinte); color: var(--hm-papier); }
.hm-neu .hm-fakten li.wunsch { background: #fde8b0; }
.hm-neu .hm-fakten li.wunsch.voll { background: #f6c3bd; color: #8c2d24; }
.hm-neu #card .card-hint { color: var(--hm-tinte); }

/* Bauen-Karte (bauen.js) */
.hm-neu #card.bau-karte { display: flex; flex-direction: column; gap: 8px; }
.hm-neu #card.bau-karte > * { flex-shrink: 0; }
.hm-neu #card.bau-karte > .bau-liste { flex-shrink: 1; }
.hm-neu .bau-kasse { font-family: var(--hm-pixel); color: var(--hm-tinte-2); opacity: 1; }
.hm-neu .bau-rat { border-radius: 0; background: #e2f2ee; box-shadow: inset 0 0 0 var(--hm-px) rgba(35, 137, 125, 0.4); }
.hm-neu .bau-reiter { border-radius: 0; padding: 3px; gap: 3px; background: var(--hm-mulde); flex-wrap: wrap; }   /* P60: fünf Reiter, am Handy zwei Zeilen */
.hm-neu .bau-reiter::-webkit-scrollbar { display: none; }
.hm-neu .bau-tab { flex: 1 1 auto; min-width: max-content; border-radius: 0; padding: 4px 6px; gap: 5px; font-family: var(--hm-pixel); font-size: var(--hm-s); color: var(--hm-tinte); }
.hm-neu .bau-tab[aria-selected="true"] { background: var(--hm-papier); box-shadow: inset 0 calc(var(--hm-px) * -2) 0 var(--hm-meer); }
.hm-neu .bau-zahl { border-radius: 0; background: var(--hm-meer); flex: none; }
.hm-neu .bau-zeile { border-radius: 0; border: var(--hm-px) solid rgba(36, 54, 74, 0.22); background: #fff; }
.hm-neu .bau-zeile:hover { border-color: var(--hm-meer); }
.hm-neu .bau-zeile-kopf { font-family: var(--hm-pixel); font-weight: 600; font-size: calc(var(--hm-s) + 1px); }
.hm-neu .bau-zeile-preis { color: var(--hm-meer); }
.hm-neu .bau-zeile.teuer .bau-zeile-preis { color: #b8473a; }
.hm-neu .bau-zeile.gesperrt { border-style: dashed; }
.hm-neu .bau-marke, .hm-neu .bau-balken, .hm-neu .bau-bedarf { border-radius: 0; }
.hm-neu .bau-balken > span { border-radius: 0; background: var(--hm-meer); }

/* Breit (PC, Tablet quer): Seitenkarte rechts unter den Knöpfen */
@media (min-width: 900px) and (min-height: 500px) {
  .hm-neu #card {
    left: auto;
    right: var(--hm-rechts);
    top: calc(var(--hm-oben) + var(--hm-knopf) + 8px);
    bottom: auto;
    width: var(--hm-karte-breite);
    max-height: calc(100% - var(--hm-oben) - var(--hm-knopf) - var(--hm-unten) - var(--hm-bauen) - 28px);
    transform: none;
    animation: hm-auf 0.15s steps(3);
  }
  .hm-neu #card[hidden] { display: none; }
  .hm-neu #card::before { content: none; }
  .hm-neu #card.bau-karte .bau-liste { max-height: none; flex: 1 1 auto; min-height: 120px; }
}

/* Schmal (Handy, Tablet hochkant): Blatt von unten */
@media not ((min-width: 900px) and (min-height: 500px)) {
  .hm-neu #card {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: auto;
    max-width: none;
    max-height: 62dvh;
    padding: 14px calc(var(--hm-safe-right) + 14px) calc(var(--hm-safe-bottom) + 10px) calc(var(--hm-safe-left) + 14px);
    border-bottom-width: 0;
    transform: translateY(105%);
    visibility: hidden;
    animation: none;
    transition: transform 0.2s steps(5), visibility 0s linear 0.2s;
  }
  .hm-neu #card[hidden] { display: block; }
  .hm-neu #card:not([hidden]) { transform: none; visibility: visible; transition: transform 0.2s steps(5); }
  .hm-neu #card::before { content: none; }
  .hm-neu #card.bau-karte .bau-liste { max-height: none; flex: 1 1 auto; min-height: 0; }
  .hm-neu.card-open #hud-bottom { transform: translateY(150%); opacity: 0; pointer-events: none; }
  .hm-neu.card-open #hm-seite { opacity: 0; }
  .hm-neu.card-open #hm-seite * { pointer-events: none !important; }
  .hm-neu.card-open .hm-tipp { display: none; }
}

/* Schleppleine: Karte aus dem Weg */
.hm-neu.hm-leine #card { visibility: hidden; pointer-events: none; }
/* Einfahren steht groß in der Bootskarte */
.hm-neu.card-boat .hm-einfahren { display: none !important; }

/* Einstieg-Blase */
.hm-neu .hm-tipp { padding: 10px 14px 8px; z-index: 18; }
.hm-neu .hm-tipp .titel { font-family: var(--hm-pixel); font-weight: 600; font-size: calc(var(--hm-s) + 3px); }
.hm-neu .hm-tipp .zaehler { font-family: var(--hm-pixel); font-weight: 400; }
.hm-neu .hm-tipp button { border-radius: 0; font-family: var(--hm-pixel); font-size: var(--hm-s); }
.hm-neu .hm-tipp .weiter { background: var(--hm-meer); box-shadow: inset 0 calc(var(--hm-px) * -2) 0 rgba(0, 0, 0, 0.2); }

/* Fotomodus: alles weg außer der Fotoleiste */
.hm-neu.foto #hm-seite, .hm-neu.foto #hm-menue, .hm-neu.foto #hud-bottom { display: none !important; }

@keyframes hm-auf { from { opacity: 0; transform: translateY(-4px); } }
@keyframes hm-hupf { 0%, 85%, 100% { transform: none; } 90% { transform: translateY(calc(var(--hm-px) * -2)); } }
@keyframes hm-blink { 50% { background: #fff3cf; } }

@media (prefers-reduced-motion: reduce) {
  .hm-neu #card, .hm-neu #hud-bottom, .hm-neu #hm-menue, .hm-neu .hm-tafel-px, .hm-neu #btn-collect, .hm-neu #btn-build.bau-punkt::after { transition: none !important; animation: none !important; }
}

/* Kompass aus ui/kamera.js: in den Werkzeugen, ausgeblendet ohne Lücke */
.hm-neu #btn-kompass[hidden] { display: none; }
.hm-neu #btn-kompass svg { width: 70%; height: 70%; }
.hm-neu .hm-leise { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* Aufgeklappte Tafel links liegt über Zeit, Kassieren und Bauen */
.hm-neu #hm-seite:has([aria-expanded="true"]) { z-index: 36; }
/* "Als Nächstes" (bauen.js) ruht, solange der Einstieg spricht oder abends Kassieren unten steht */
.hm-neu:has(.hm-tipp:not([hidden])) .bau-tipp,
.hm-neu:has(#btn-collect:not([hidden])) .bau-tipp { display: none; }

/* ------------------------------------------------------------ Einstellungen (P50) */
.hm-neu #hm-einstellungen {
  position: absolute;
  z-index: 41;
  top: calc(var(--hm-oben) + var(--hm-knopf) + 6px);
  right: var(--hm-rechts);
  width: min(360px, calc(100vw - var(--hm-links) - var(--hm-rechts)));
  max-height: calc(100dvh - var(--hm-oben) - var(--hm-knopf) - var(--hm-unten) - 12px);
  overflow-y: auto;
  display: grid;
  gap: 6px;
  padding: 10px 12px 12px;
}
.hm-neu #hm-einstellungen[hidden] { display: none; }
.hm-neu #hm-einstellungen .hm-karte-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hm-neu #hm-einstellungen .hm-klapp-kopf { margin: 0; font-size: calc(var(--hm-s) + 3px); }
.hm-neu .hm-schalter {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 8px 10px;
  border: var(--hm-px) solid rgba(36, 54, 74, 0.22);
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.hm-neu .hm-schalter:hover { border-color: var(--hm-meer); }
.hm-neu .hm-schalter-text { flex: 1; display: grid; gap: 1px; }
.hm-neu .hm-schalter-text strong { font-family: var(--hm-pixel); font-weight: 600; }
.hm-neu .hm-schalter-text span { color: var(--hm-tinte-2); font-size: 0.94em; line-height: 1.3; }
/* Schiebeschalter im Pixel-Stil: Mulde mit Klotz, an = Meer und Klotz rechts */
.hm-neu .hm-schalter-griff {
  position: relative;
  flex: none;
  width: calc(var(--hm-px) * 22);
  height: calc(var(--hm-px) * 12);
  background: var(--hm-mulde);
  box-shadow: inset 0 0 0 var(--hm-px) var(--hm-tinte);
}
.hm-neu .hm-schalter-griff::after {
  content: '';
  position: absolute;
  top: calc(var(--hm-px) * 2);
  left: calc(var(--hm-px) * 2);
  width: calc(var(--hm-px) * 8);
  height: calc(var(--hm-px) * 8);
  background: var(--hm-papier);
  box-shadow: inset 0 0 0 var(--hm-px) var(--hm-tinte);
  transition: transform 0.1s steps(2);
}
.hm-neu .hm-schalter[aria-checked="true"] .hm-schalter-griff { background: var(--hm-meer); }
.hm-neu .hm-schalter[aria-checked="true"] .hm-schalter-griff::after { transform: translateX(calc(var(--hm-px) * 10)); }
.hm-neu.foto #hm-einstellungen { display: none !important; }

/* Weniger Bewegung: nichts springt, blinkt oder gleitet */
.hm-neu.hm-ruhig *, .hm-neu.hm-ruhig *::before, .hm-neu.hm-ruhig *::after {
  animation-duration: 0s !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0s !important;
  scroll-behavior: auto !important;
}

/* Linkshänder (Touch): Bauen unten links, Zeit unten rechts */
.hm-neu.hand-links #hm-zeit { grid-column: 3; justify-self: end; }
.hm-neu.hand-links #btn-build { grid-column: 1; justify-self: start; }

.hm-neu .hm-wahl { display: grid; gap: 6px; padding: 8px 10px; border: var(--hm-px) solid rgba(36, 54, 74, 0.22); background: #fff; }
.hm-neu .hm-wahl-stufen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; background: var(--hm-mulde); }
.hm-neu .hm-wahl-stufen button { min-height: 40px; border: 0; background: transparent; font-family: var(--hm-pixel); font-weight: 600; cursor: pointer; }
.hm-neu .hm-wahl-stufen button[aria-checked="true"] { background: var(--hm-papier); box-shadow: inset 0 calc(var(--hm-px) * -2) 0 var(--hm-meer); }

/* Farbe nie allein (Einstellung "Schilder mit Form"): Gold bekommt ein Zeichen */
.hm-neu.hm-formen .bau-schild.empfohlen:not(.rand)::before {
  content: '';
  position: absolute;
  top: -9px;
  left: -9px;
  width: 18px;
  height: 18px;
  background: var(--hm-tinte) var(--px-stern) center / 12px 12px no-repeat;
}
.hm-neu.hm-formen #hm-seite #weather-chip.has-news::after {
  content: '';
  flex: none;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  background: var(--px-hinweis) center / 12px 12px no-repeat, var(--hm-tinte);
}

/* ------------------------------------------------------------ Reste im Pixel-Stil (Symbole neu, Runde 3)
 * Alles, was andere Module mit eigener Schrift, runden Ecken oder Zeichen wie ✓ ← zeichnen,
 * bekommt hier Pixelrahmen und Pixel-Symbole aus ui/pixel-symbole.js. IDs und Klassen bleiben.
 */

/* Wetter- und Ereignisbilder: Pixelraster bleiben scharf (nur ganze Vielfache von 12 px) */
.hm-neu .hm-pixelbild { image-rendering: pixelated; flex: none; }
.hm-neu #weather-chip svg { width: 24px; height: 24px; }
.hm-neu #weather-panel svg, .hm-neu #event-banner svg { width: 24px; height: 24px; flex: none; }

/* Tagesziele: Kreis und Haken statt ○ ✓ */
.hm-neu .hm-tafel li .haken {
  width: 18px; height: 18px; font-size: 0; color: transparent; align-self: center;
  background: var(--hm-tinte-2);
  -webkit-mask: var(--px-kreis) center / 18px 18px no-repeat;
  mask: var(--px-kreis) center / 18px 18px no-repeat;
}
.hm-neu .hm-tafel li.erledigt .haken {
  background: var(--hm-meer);
  -webkit-mask-image: var(--px-haken); mask-image: var(--px-haken);
}

/* Bauen: Pfeile am Rand (Bauplatz außerhalb des Bildes) als Pixelpfeil im Tintenschild statt ← ↑ → ↓.
 * ::after ist das Tintenquadrat, ::before der Pfeil (Maske), gedreht in 90-Grad-Schritten, damit er scharf bleibt. */
.hm-neu .bau-schild.rand { --pf: var(--px-pfeil); --dreh: 0deg; }
.hm-neu .bau-schild.rand[data-pfeil="↓"] { --dreh: 90deg; }
.hm-neu .bau-schild.rand[data-pfeil="←"] { --dreh: 180deg; }
.hm-neu .bau-schild.rand[data-pfeil="↑"] { --dreh: 270deg; }
.hm-neu .bau-schild.rand:is([data-pfeil="↓→"], [data-pfeil="↓←"], [data-pfeil="↑←"], [data-pfeil="↑→"]) { --pf: var(--px-pfeilschraeg); }
.hm-neu .bau-schild.rand[data-pfeil="↓←"] { --dreh: 90deg; }
.hm-neu .bau-schild.rand[data-pfeil="↑←"] { --dreh: 180deg; }
.hm-neu .bau-schild.rand[data-pfeil="↑→"] { --dreh: 270deg; }
.hm-neu .bau-schild.rand::after {
  content: "";
  display: block;
  position: absolute; left: -10px; top: -12px; width: 20px; height: 20px; margin: 0;
  border: 0; transform: none; clip-path: none;
  background: var(--hm-tinte);
}
.hm-neu .bau-schild.rand::before {
  content: "";
  position: absolute; z-index: 1; left: -10px; top: -12px; width: 20px; height: 20px;
  border-radius: 0; font-size: 0;
  background: var(--hm-papier);
  -webkit-mask: var(--pf) center / 12px 12px no-repeat;
  mask: var(--pf) center / 12px 12px no-repeat;
  transform: rotate(var(--dreh));
}

/* Spielstand-Fenster (save/save-panel.js) */
.hm-neu .hm-save-backdrop { background: rgba(20, 32, 48, 0.5); }
.hm-neu .hm-save {
  border-style: solid; border-color: transparent; border-radius: 0; box-shadow: none; background: none;
  border-width: var(--hm-rahmen-breite);
  border-image: var(--rahmen-papier) 3 3 4 3 fill / var(--hm-rahmen-breite) stretch;
  color: var(--hm-tinte);
  font: 500 var(--hm-s)/1.4 var(--hm-text);
}
/* Handy quer: das Fenster ist höher als der Bildschirm, also scrollen statt oben abschneiden */
.hm-neu .hm-save { max-height: calc(100dvh - 32px); overflow-y: auto; box-sizing: border-box; }
.hm-neu .hm-save-backdrop { overflow-y: auto; }
.hm-neu .hm-save h2 { font-family: var(--hm-pixel); font-weight: 600; font-size: calc(var(--hm-s) + 5px); }
.hm-neu .hm-save .hm-info { color: var(--hm-tinte-2); }
.hm-neu .hm-save button {
  border-style: solid; border-color: transparent; border-radius: 0;
  border-width: var(--hm-rahmen-breite);
  border-image: var(--rahmen-meer) 3 3 4 3 fill / var(--hm-rahmen-breite) stretch;
  background: none; color: #fff;
  font-family: var(--hm-pixel); font-weight: 600; font-size: calc(var(--hm-s) + 1px);
}
.hm-neu .hm-save button.zweit { border-image-source: var(--rahmen-papier); color: var(--hm-tinte); }
.hm-neu .hm-save button:active { transform: translateY(var(--hm-px)); }
.hm-neu .hm-banner {
  border-style: solid; border-color: transparent; border-radius: 0; background: none;
  border-width: var(--hm-rahmen-breite);
  border-image: var(--rahmen-tinte) 3 3 4 3 fill / var(--hm-rahmen-breite) stretch;
  color: #fff; font: 500 var(--hm-s)/1.4 var(--hm-text);
}
.hm-neu .hm-banner button {
  border-style: solid; border-color: transparent; border-radius: 0;
  border-width: var(--hm-rahmen-breite);
  border-image: var(--rahmen-gold) 3 3 4 3 fill / var(--hm-rahmen-breite) stretch;
  background: none; color: var(--hm-tinte); font-family: var(--hm-pixel); font-weight: 600;
}
.hm-neu .hm-banner button.zu { border-image: none; border-color: transparent; color: #fff; }

/* Fotomodus-Leiste (ui/fotomodus.js) */
.hm-neu .hm-foto-leiste {
  border-style: solid; border-color: transparent; border-radius: 0; box-shadow: none; background: none;
  border-width: var(--hm-rahmen-breite);
  border-image: var(--rahmen-papier) 3 3 4 3 fill / var(--hm-rahmen-breite) stretch;
  padding: 4px;
}
.hm-neu .hm-foto-leiste button {
  border-style: solid; border-color: transparent; border-radius: 0;
  border-width: var(--hm-rahmen-breite);
  border-image: var(--rahmen-tinte) 3 3 4 3 fill / var(--hm-rahmen-breite) stretch;
  background: none; color: #fff; font-family: var(--hm-pixel); font-weight: 600; font-size: var(--hm-s);
}
.hm-neu .hm-foto-leiste button[aria-pressed="true"] { border-image-source: var(--rahmen-koralle); background: none; }
.hm-neu .hm-foto-leiste button:active { transform: translateY(var(--hm-px)); }

/* PC: Tastenhilfe und Hinweis am Mauszeiger (ui/input-pc.js) */
.hm-neu .pc-help { background: rgba(20, 32, 48, 0.5); }
.hm-neu .pc-help-box {
  border-style: solid; border-color: transparent; border-radius: 0; box-shadow: none; background: none;
  border-width: var(--hm-rahmen-breite);
  border-image: var(--rahmen-papier) 3 3 4 3 fill / var(--hm-rahmen-breite) stretch;
  color: var(--hm-tinte);
}
.hm-neu .pc-help-box h2 { font-family: var(--hm-pixel); font-weight: 600; font-size: calc(var(--hm-s) + 5px); }
.hm-neu .pc-help-box dt { font-family: var(--hm-pixel); font-weight: 600; }
.hm-neu .pc-help-box dd { color: var(--hm-tinte-2); }
.hm-neu kbd, .hm-neu .pc-help-box kbd {
  border-radius: 0;
  border: var(--hm-px) solid var(--hm-tinte);
  border-bottom-width: calc(var(--hm-px) * 2);
  background: var(--hm-papier);
  box-shadow: none;
  font-family: var(--hm-pixel); font-weight: 600;
}
.hm-neu .pc-help-box .hud-btn {
  border-style: solid; border-color: transparent; border-radius: 0; box-shadow: none; background: none;
  border-width: var(--hm-rahmen-breite);
  border-image: var(--rahmen-meer) 3 3 4 3 fill / var(--hm-rahmen-breite) stretch;
  color: #fff; font-family: var(--hm-pixel); font-weight: 600;
}
.hm-neu .pc-tooltip {
  border-style: solid; border-color: transparent; border-radius: 0; box-shadow: none; background: none;
  border-width: var(--hm-rahmen-breite);
  border-image: var(--rahmen-tinte) 3 3 4 3 fill / var(--hm-rahmen-breite) stretch;
  font-family: var(--hm-pixel); font-weight: 600;
}

/* Ton-Fenster: Regler als Pixelbalken mit eckigem Griff */
.hm-neu .hm-audio-row { font-family: var(--hm-pixel); font-weight: 600; }
.hm-neu .hm-audio-row input[type="range"] { -webkit-appearance: none; appearance: none; background: none; height: var(--tap, 44px); }
.hm-neu .hm-audio-row input[type="range"]::-webkit-slider-runnable-track {
  height: calc(var(--hm-px) * 4); background: var(--hm-mulde); box-shadow: inset 0 0 0 var(--hm-px) rgba(36, 54, 74, 0.4);
}
.hm-neu .hm-audio-row input[type="range"]::-moz-range-track {
  height: calc(var(--hm-px) * 4); background: var(--hm-mulde); box-shadow: inset 0 0 0 var(--hm-px) rgba(36, 54, 74, 0.4);
}
.hm-neu .hm-audio-row input[type="range"]::-moz-range-progress { height: calc(var(--hm-px) * 4); background: var(--hm-meer); }
.hm-neu .hm-audio-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 24px; margin-top: calc(var(--hm-px) * 2 - 12px);
  border: var(--hm-px) solid var(--hm-tinte); border-radius: 0;
  background: var(--hm-gold); box-shadow: 0 var(--hm-px) 0 var(--hm-tinte);
}
.hm-neu .hm-audio-row input[type="range"]::-moz-range-thumb {
  width: 14px; height: 20px; border: var(--hm-px) solid var(--hm-tinte); border-radius: 0;
  background: var(--hm-gold); box-shadow: 0 var(--hm-px) 0 var(--hm-tinte);
}

/* Pixelschrift auch im Fließtext (Nachprüfung PR 157): kleine Texte etwas größer, damit Pixelify am Handy lesbar bleibt.
 * Untergrenze etwa 13 px; vorher standen dort bis zu 0,68 rem (11 px) in der Systemschrift. */
.hm-neu :is(.bau-tipp-titel, .bau-marke, .bau-zahl) { font-size: 0.8rem; letter-spacing: 0.02em; }
.hm-neu :is(.bau-zeile-text, .bau-fortschritt, .bau-tab) { font-size: 0.9rem; }
.hm-neu .hm-tipp .zaehler { font-size: 13px; }
.hm-neu :is(#weather-panel, #event-banner) :is(small, .wp-sub, p) { font-size: max(13px, 0.875rem); }
.hm-neu kbd, .hm-neu .pc-help-box kbd { font-size: max(13px, 0.9em); padding: 1px 6px; line-height: 1.3; }

/* ------------------------------------------------------------ Weniger Spielfläche verdecken
 * Messung je Gerät und Menü: docs/ui/verdeckung.md. Am Handy zählt jede Zeile, denn
 * Boote, Stege und Bojen liegen hinter jeder Tafel. */

/* Knöpfe der Karte bleiben sichtbar, auch wenn der Inhalt scrollt (Handy quer schnitt sie ab) */
.hm-neu #card:not(.bau-karte) .card-actions {
  position: sticky;
  bottom: calc(-1 * (var(--hm-safe-bottom) + 10px));
  z-index: 1;
  margin: 4px -4px calc(-1 * (var(--hm-safe-bottom) + 10px));
  padding: 4px 4px calc(var(--hm-safe-bottom) + 10px);
  background: var(--hm-papier);
}

@media (max-width: 599px), (max-height: 499px) {
  /* Bootskarte flach: kleinere Schilder, Anleitung ("Zieh das Boot hin") erklärt der Einstieg */
  .hm-neu #card { padding-top: 10px; }
  .hm-neu #card h2 { font-size: calc(var(--hm-s) + 4px); }
  .hm-neu .hm-karte-kopf { margin-bottom: 2px; }
  .hm-neu .hm-karte-kopf .card-boatname { margin: 0; font-size: calc(var(--hm-s) - 2px); }
  .hm-neu .hm-karte-kopf .card-geschichte { margin: 2px 0 0; font-size: calc(var(--hm-s) - 3px); }
  .hm-neu #card .hm-fakten { gap: 3px; margin: 2px 0 6px; }
  .hm-neu #card .hm-fakten li { padding: 0 6px; font-size: calc(var(--hm-s) - 2px); }
  .hm-neu #card p { margin-bottom: 4px; }
  .hm-neu #card .card-wie { display: none; }
  .hm-neu #card:not(.bau-karte) .card-actions .hud-btn { min-height: 44px; font-size: var(--hm-s); white-space: nowrap; }
}
/* Handy quer: die Bootskarte ist nur so hoch wie ihr Inhalt, statt die ganze rechte Hälfte zu füllen */
@media (max-height: 499px) and (orientation: landscape) {
  .hm-neu #card:not(.bau-karte) { bottom: auto; max-height: calc(100dvh - var(--hm-oben) - var(--hm-knopf) - 12px); border-bottom-width: calc(var(--hm-px) * 4); }
  .hm-neu #card:not(.bau-karte) .card-actions { bottom: -10px; margin-bottom: -10px; padding-bottom: 10px; }
}

/* Baukarte: das Kreuz oben gibt es nur am Handy (dort fällt die Zeile "Schließen" unten weg) */
.hm-neu .bau-kopf .bau-zu { display: none; }

@media (max-width: 599px), (max-height: 499px) {
  .hm-neu #card .bau-kopf { align-items: center; }
  .hm-neu #card .bau-kopf .bau-zu { display: grid; margin: -2px -4px -2px 0; }
  .hm-neu #card.bau-karte > .bau-unten { display: none; }

  /* "Als Nächstes" über Bauen: schmal und klein, es ist ein Hinweis, keine Tafel */
  .hm-neu .bau-tipp { max-width: min(230px, calc(100vw - 32px)); padding: 4px 10px 5px; font-size: calc(var(--hm-s) - 3px); line-height: 1.25; }
  .hm-neu .bau-tipp-titel { font-size: calc(var(--hm-s) - 5px); }

  /* Aufgeklappte Tafeln links (Wetter, Tagesziel, Ausbau): engere Zeilen, kleinere Schrift */
  .hm-neu #hm-seite .hm-tafel-px { padding: 6px 8px; font-size: calc(var(--hm-s) - 2px); line-height: 1.25; }
  .hm-neu #hm-seite .hm-klapp-kopf { margin-bottom: 2px; font-size: calc(var(--hm-s) - 1px); }
  .hm-neu #hm-seite .hm-balken-zeile { padding: 2px 0; gap: 0 8px; }
  .hm-neu #hm-seite .hm-tafel-px .hm-knopf { min-height: 40px; margin-top: 4px; font-size: var(--hm-s); }
  .hm-neu #hm-seite .hm-tafel li { padding: 3px 0; }
  .hm-neu #hm-seite .hm-tafel .tz-klein { margin-top: 0; font-size: calc(var(--hm-s) - 3px); }
  .hm-neu #hm-seite .hm-tafel .tz-balken { margin-top: 2px; }
  /* Wetter: vier Tage als Raster zwei mal zwei statt vier Zeilen untereinander */
  .hm-neu #weather-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
  .hm-neu #weather-panel[hidden] { display: none; }
  .hm-neu #weather-panel .wp-head { grid-column: 1 / -1; padding: 0 2px 2px; }
  .hm-neu #weather-panel .wp-row { gap: 6px; padding: 4px 2px; align-items: center; }
  .hm-neu #weather-panel .wp-row.event { grid-column: 1 / -1; }
  .hm-neu #weather-panel .wp-row svg { width: 20px; height: 20px; }
  .hm-neu #weather-panel .wp-row strong { font-size: inherit; }
}
/* Handy hochkant: das Baumenü endet in der Bildmitte, darüber bleiben Bauplätze und Preisschilder frei */
@media (max-width: 599px) and (orientation: portrait) {
  .hm-neu #card.bau-karte { max-height: 52dvh; }
  .hm-neu #hm-seite .hm-tafel .tz-klein { font-size: calc(var(--hm-s) - 2px); }
}

/* Einstellungen am Handy: Zeilen ohne Kästen, Beschreibung klein, damit fast alles ohne Scrollen passt */
@media (max-width: 599px), (max-height: 499px) {
  .hm-neu #hm-einstellungen { gap: 0; padding: 6px 10px 8px; }
  .hm-neu #hm-einstellungen .hm-klapp-kopf { font-size: calc(var(--hm-s) + 1px); }
  .hm-neu #hm-einstellungen .hm-karte-kopf { margin-bottom: 2px; }
  .hm-neu #hm-einstellungen > .hm-knopf { min-height: 40px; margin: 0 0 4px; font-size: var(--hm-s); }
  .hm-neu .hm-schalter { min-height: 44px; padding: 4px 2px; gap: 8px; border: 0; border-top: var(--hm-px) dotted rgba(36, 54, 74, 0.25); background: none; }
  .hm-neu .hm-schalter-text strong { font-size: calc(var(--hm-s) - 1px); }
  .hm-neu .hm-schalter-text span { font-size: calc(var(--hm-s) - 4px); line-height: 1.2; }
  .hm-neu .hm-wahl { gap: 3px; padding: 4px 2px; border: 0; border-top: var(--hm-px) dotted rgba(36, 54, 74, 0.25); background: none; }
  .hm-neu .hm-wahl-stufen button { min-height: 40px; }   /* Fingergröße (Zusammenspiel 2), vorher 36 */
}
@media (max-height: 499px) and (orientation: landscape) {
  .hm-neu #hm-einstellungen { width: min(560px, calc(100vw - var(--hm-links) - var(--hm-rechts))); grid-template-columns: 1fr 1fr; column-gap: 12px; }
  .hm-neu #hm-einstellungen > .hm-karte-kopf, .hm-neu #hm-einstellungen > .hm-knopf { grid-column: 1 / -1; }
}
@media (max-width: 599px) and (orientation: portrait) {
  .hm-neu #card.bau-karte { max-height: 48dvh; }
}

/* "Als Nächstes" als eine Zeile (Jorven 14.11.: verdeckte zu viel); steht nur kurz, danach Punkt am Bauen-Knopf */
.hm-neu .bau-tipp { display: block; max-width: min(300px, calc(100vw - 32px)); padding: 3px 10px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: calc(var(--hm-s) - 2px); line-height: 1.3; }
.hm-neu .bau-tipp-titel { display: inline; margin-right: 6px; font-size: calc(var(--hm-s) - 4px); }
@media (max-width: 599px), (max-height: 499px) {
  .hm-neu .bau-tipp { max-width: min(220px, calc(100vw - 32px)); padding: 2px 8px 3px; font-size: calc(var(--hm-s) - 3px); }
}

/* ------------------------------------------------------------ Meldeplatz (ui/meldungen.js)
 * Ein Platz für alle kurzen Meldungen: Ankündigung, Dauerplatz, Morgen-Zettel, Bewertung.
 * Immer nur eine steht, ein Zähler (+2) zeigt die wartenden. Unten über den Knöpfen (Handy hochkant)
 * oder oben in der Mitte (Lage und Breite setzt ui/meldungen.js über --hm-mp-*).
 * Die Module setzen ihre alte Lage noch als Inline-Stil; !important schlägt sie hier. */
.hm-neu #hm-meldeplatz {
  position: absolute;
  z-index: 26;
  left: var(--hm-mp-mitte, 50%);
  top: var(--hm-mp-oben, calc(var(--hm-oben) + var(--hm-knopf) + 8px));
  transform: translateX(-50%);
  width: max-content;
  max-width: var(--hm-mp-breite, min(440px, calc(100% - 24px)));
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
.hm-neu #hm-meldeplatz.unten { top: auto; bottom: var(--hm-mp-unten, 140px); }
body.foto #hm-meldeplatz, body.hm-feier-an #hm-meldeplatz, body.building #hm-meldeplatz { display: none !important; }
.hm-neu #hm-meldeplatz > :not(.hm-meldeplatz-zahl) {
  position: relative !important;
  inset: auto !important;
  transform: none !important;
  margin: 0 !important;
  width: auto !important;
  max-width: 100% !important;
  box-sizing: border-box;
  pointer-events: auto;
}
.hm-neu #hm-meldeplatz > :is([hidden], .zurueck) { display: none !important; }
/* Eine Meldung: Symbol, fette Zeile, höchstens vier Zeilen Text */
.hm-neu #hm-meldeplatz :is(#event-banner, #dauer-hinweis) {
  display: flex; gap: 10px; align-items: center;
  padding: 6px 12px; min-height: 44px; border-left: 0; border-radius: 0;
  animation: hm-mp-rein 0.24s steps(4, end);
}
.hm-neu #hm-meldeplatz :is(#event-banner, #dauer-hinweis) :is(svg, img) { flex: none; width: 24px; height: 24px; }
.hm-neu #hm-meldeplatz :is(#event-banner, #dauer-hinweis) strong { font-size: var(--hm-s); font-weight: 600; line-height: 1.25; }
.hm-neu #hm-meldeplatz :is(#event-banner, #dauer-hinweis) span {
  font-size: max(14px, calc(var(--hm-s) - 1px)); line-height: 1.3; opacity: 0.85; margin-top: 1px;
  /* Bis zu vier Zeilen: Ankündigungen und Erklärungen sollen ganz lesbar sein (Abnahme 30.11.: auf dem
     iPhone wurden 10 von 18 Texten mitten im Satz abgeschnitten). tests/specs/meldetexte.spec.mjs prüft das. */
  display: -webkit-box !important; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden;
}
.hm-neu #hm-meldeplatz #event-banner.leaving { opacity: 0; transition: opacity 0.4s steps(3); }
.hm-neu #hm-meldeplatz #hm-ta-zettel { animation: hm-mp-rein 0.24s steps(4, end); }
/* Bewertungen: nur die neueste, die anderen verfallen still */
.hm-neu #hm-meldeplatz #hm-gb-meldungen { display: flex; align-items: center; pointer-events: none; }
.hm-neu #hm-meldeplatz #hm-gb-meldungen > .hm-gb-meldung:not(:first-child) { display: none; }
.hm-neu #hm-meldeplatz #hm-gb-meldungen > .hm-gb-meldung { max-width: 100%; }
/* Zähler: wie viele Meldungen noch warten */
.hm-neu .hm-meldeplatz-zahl {
  position: absolute; right: -6px; top: -10px; z-index: 1;
  min-width: 22px; height: 22px; padding: 0 5px; box-sizing: border-box;
  display: grid; place-items: center;
  background: var(--hm-koralle); color: #fff;
  border: var(--hm-px) solid var(--hm-tinte);
  box-shadow: 0 var(--hm-px) 0 var(--hm-tinte);
  font-size: 14px; font-weight: 700; line-height: 1;
}
.hm-neu .hm-meldeplatz-zahl[hidden] { display: none; }
.hm-neu #hm-meldeplatz.unten .hm-meldeplatz-zahl { top: -12px; }
@keyframes hm-mp-rein { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .hm-neu #hm-meldeplatz > * { animation: none !important; }
}
/* "Als Nächstes" im Meldeplatz: ohne Pfeil, eine Zeile Titel, eine Zeile Text */
.hm-neu #hm-meldeplatz #bau-tipp { padding: 5px 12px; text-align: left; animation: none; }
.hm-neu #hm-meldeplatz #bau-tipp::after { display: none; }
/* Tipps beim ersten Mal (features/einstieg.js, Klasse .hinweis): liegt der Meldeplatz unten (Handy hochkant),
 * stehen sie an derselben Stelle, kurz und flach: Titel, Kurztext, "Verstanden" daneben. Die Meldungs-Ordnung
 * sorgt dafür, dass nie zugleich eine andere Meldung dort steht. */
body.hm-neu[data-hm-meldeplatz="unten"] .hm-tipp.hinweis {
  top: auto !important; bottom: var(--hm-mp-unten, 140px) !important;
  left: var(--hm-mp-mitte, 50%) !important; right: auto !important; transform: translateX(-50%) !important;
  width: var(--hm-mp-breite, calc(100% - 24px)) !important; max-width: none !important; box-sizing: border-box;
  display: grid; grid-template-columns: 1fr auto; column-gap: 10px; align-items: center;
  padding: 6px 8px 6px 12px; font-size: max(14px, calc(var(--hm-s) - 1px));
}
body.hm-neu[data-hm-meldeplatz="unten"] .hm-tipp.hinweis[hidden] { display: none; }
body.hm-neu[data-hm-meldeplatz="unten"] .hm-tipp.hinweis :is(.zaehler, .lang) { display: none; }
body.hm-neu[data-hm-meldeplatz="unten"] .hm-tipp.hinweis .titel { grid-column: 1; font-size: var(--hm-s); margin: 0; line-height: 1.25; }
body.hm-neu[data-hm-meldeplatz="unten"] .hm-tipp.hinweis .kurz { display: block; grid-column: 1; line-height: 1.3; opacity: 0.85; }
body.hm-neu[data-hm-meldeplatz="unten"] .hm-tipp.hinweis .knoepfe { grid-column: 2; grid-row: 1 / span 3; margin: 0; }
body.hm-neu[data-hm-meldeplatz="unten"] .hm-tipp.hinweis button { min-height: 40px; padding: 0 12px; }

/* Handy quer (Feature-Test PR 261/267): Einstellungen und Hilfe sind Fenster. Statt halb über Zeit, Status und Bauen
 * zu liegen, nutzen sie die ganze Höhe; die übrige Oberfläche tritt so lange zurück (nichts liegt halb verdeckt).
 * Passt der Inhalt nicht, zeigt ein Verlauf unten, dass es weitergeht. */
@media (max-height: 499px) and (orientation: landscape) {
  .hm-neu #hm-einstellungen { top: calc(var(--hm-safe-top) + 6px) !important; }
  .hm-neu #hm-einstellungen, .hm-neu #hm-hilfe { max-height: calc(100dvh - var(--hm-safe-top) - var(--hm-safe-bottom) - 12px) !important; overflow-y: auto; }
  .hm-neu #hm-einstellungen::after {
    content: ""; grid-column: 1 / -1; position: sticky; bottom: -8px; display: block; height: 18px; margin-top: -18px;
    background: linear-gradient(rgba(255, 250, 240, 0), var(--hm-papier)); pointer-events: none;
  }
  body.hm-neu:has(#hm-einstellungen:not([hidden])) :is(#hud-bottom, #hm-seite, #hm-meldeplatz, .hm-status),
  body.hm-neu:has(#hm-hilfe:not([hidden])) :is(#hud-bottom, #hm-seite, #hm-meldeplatz, .hm-status) { visibility: hidden; }
}

/* Tablet hochkant (Schichttest 15.11.): Die Bootskarte steht als Blatt ÜBER Zeit und Bauen, statt die ganze untere
 * Leiste zu ersetzen. Tempo und Bauen bleiben erreichbar, die Karte ist schmaler und gerahmt.
 * --hm-knopfkante setzt ui/meldungen.js (Oberkante der unteren Knöpfe). */
@media (min-width: 600px) and (max-width: 899px) and (min-height: 500px) {
  .hm-neu #card {
    left: 50%; right: auto;
    bottom: calc(var(--hm-knopfkante, 110px) + 8px);
    width: min(560px, calc(100% - var(--hm-links) - var(--hm-rechts)));
    max-height: calc(100dvh - var(--hm-knopfkante, 110px) - var(--hm-oben) - var(--hm-knopf) - 24px);
    padding: 12px 14px 10px;
    border-bottom-width: calc(var(--hm-px) * 4);
    transform: translate(-50%, 30px);
  }
  .hm-neu #card:not([hidden]) { transform: translate(-50%, 0); }
  .hm-neu.card-open #hud-bottom { transform: none; opacity: 1; pointer-events: none; }
  .hm-neu.card-open #hud-bottom > * { pointer-events: auto; }
  .hm-neu.card-open #hm-meldeplatz { visibility: hidden; }
  .hm-neu #card:not(.bau-karte) .card-actions { position: static; margin: 4px 0 0; padding: 0; }
  /* Baumenü höchstens halb so hoch, sonst deckt die lange Liste den ganzen Hafen mit den Bauplätzen zu (Zusammenspiel 2) */
  .hm-neu #card.bau-karte { max-height: min(50dvh, calc(100dvh - var(--hm-knopfkante, 110px) - var(--hm-oben) - var(--hm-knopf) - 24px)); }
}
