/* ============================================================================
   nozilla Teleprompter — Gestaltung
   Farben, Schriften und Grundformen kommen aus dem nozilla Design System
   (dunkles Theme). Die Maße von Kopfzeile, Lesemarke und Abdunkelung sind
   aus dem Original übernommen, weil das Skript mit ihnen rechnet.
============================================================================ */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html, body { width: 100%; height: 100%; overflow: auto; }

body {
  background-color: var(--nz-c-ink-900);
  color: var(--nz-c-paper);
  font-family: var(--nz-font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Icons ─────────────────────────────────────────────────────────────── */
.ic { width: 24px; height: 24px; display: block; }

/* Zustände: das Skript tauscht die Klassen icon-play/-pause und icon-eye-open/-close */
.button.icon-play  .ic-pause,
.button.icon-pause .ic-play,
.button.icon-eye-open  .ic-eye-off,
.button.icon-eye-close .ic-eye-on { display: none; }

/* ── Kopfzeile ─────────────────────────────────────────────────────────── */
header {
  position: fixed; z-index: 10; width: 100%; height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 16px 0 24px; white-space: nowrap;
  background: var(--nz-c-ink-900);
  border-bottom: var(--nz-stroke-rule) solid var(--nz-c-paper);
}
header * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

header h1 {
  display: flex; align-items: baseline; gap: 14px;
  font-weight: 400; font-size: inherit; line-height: 1; margin: 0;
}
.brand {
  font-family: var(--nz-font-display); font-weight: 700; font-size: 24px;
  letter-spacing: -0.01em; color: var(--nz-c-paper);
}
.brand span { color: var(--nz-c-green); }
header .app { color: rgba(255, 254, 229, .64); }
.clock {
  font-family: var(--nz-font-mono); font-weight: 700; font-size: 18px; letter-spacing: .06em;
  color: var(--nz-c-paper); padding-left: 14px;
  border-left: var(--nz-stroke-hair) solid rgba(255, 254, 229, .3);
}

header nav { display: flex; align-items: center; gap: 20px; height: 64px; }

/* Farbfelder: eckig, mit Papier-Rand */
.colors { display: flex; flex-direction: column; gap: 6px; }
input[type="color"] {
  -webkit-appearance: none; appearance: none; display: block; cursor: pointer;
  width: 40px; height: 18px; padding: 0; background: none;
  border: var(--nz-stroke-hair) solid var(--nz-c-paper); border-radius: 0;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 0; }
input[type="color"]::-moz-color-swatch { border: none; border-radius: 0; }

/* Regler: Beschriftung links, Wert daneben, Schiene rechts */
.sliders { display: flex; flex-direction: column; gap: 8px; }
.sliders label {
  display: grid; grid-template-columns: 64px 5ch 120px; align-items: center; gap: 0 8px;
  font-family: var(--nz-font-mono); font-weight: 700; font-size: 11px;
  letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 254, 229, .64);
}
.sliders label > span { min-width: 5ch; color: var(--nz-c-paper); }
.sliders .slider { flex: none; width: 120px; margin-left: 4px; }

/* jQuery-UI-Slider ohne Fremd-Theme: Schiene in Papier, Füllung und Griff in Signal-Grün */
.ui-slider { position: relative; height: 4px; background: rgba(255, 254, 229, .25); }
.ui-slider-range { position: absolute; top: 0; left: 0; height: 100%; background: var(--nz-c-green); }
.ui-slider-handle {
  position: absolute; top: -6px; width: 16px; height: 16px; margin-left: -8px;
  background: var(--nz-c-green); border: var(--nz-stroke-rule) solid var(--nz-c-ink-900);
  outline: var(--nz-stroke-hair) solid var(--nz-c-green); cursor: grab; touch-action: none;
}
.ui-slider-handle:focus-visible { outline: var(--nz-stroke-strong) solid var(--nz-c-paper); outline-offset: 2px; }

/* Knöpfe */
.buttons { display: flex; align-items: center; gap: 2px; }
.button {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  color: var(--nz-c-paper); background: transparent;
  border: var(--nz-stroke-rule) solid transparent; border-radius: 0;
}
.button:hover { border-color: var(--nz-c-paper); }
.button:focus-visible { outline: var(--nz-stroke-strong) solid var(--nz-c-green); outline-offset: -2px; }
.button.small .ic { width: 22px; height: 22px; }

/* Abspielen ist die eine Aktion: Signal-Grün mit hartem Schatten */
.button.play {
  width: 52px; height: 44px; margin-left: 10px;
  background: var(--nz-c-green); color: var(--nz-c-ink);
  border-color: var(--nz-c-ink); box-shadow: 4px 4px 0 0 var(--nz-c-paper);
}
.button.play:hover { border-color: var(--nz-c-ink); transform: translate(-1px, -1px); box-shadow: 5px 5px 0 0 var(--nz-c-paper); }
.button.play:active { transform: translate(4px, 4px); box-shadow: none; }
.button.play .ic { width: 26px; height: 26px; }
/* Auf Signal-Grün würde die grüne Signatur verschwinden: dort in Tinte */
.button.play .ic { --sig: var(--nz-c-ink); }

/* ── Lesefläche ────────────────────────────────────────────────────────── */
article {
  position: relative; height: 100%; overflow: scroll;
  background-color: var(--nz-c-ink-900);
}

article .teleprompter {
  padding: 300px 50px 1000px 100px;
  font-family: var(--nz-font-body); font-size: 60px; line-height: 86px;
  z-index: 1; background-color: var(--nz-c-ink-900); color: var(--nz-c-paper);
  will-change: transform; opacity: 0; transition: opacity .25s;
  outline: none;
}
article .teleprompter.ready { opacity: 1; }
article .teleprompter p {
  padding-bottom: 15px; margin-bottom: 15px;
  border-bottom: var(--nz-stroke-hair) solid rgba(255, 254, 229, .2);
}
article .teleprompter p:last-child { border-bottom: var(--nz-stroke-heavy) solid var(--nz-c-green); }
article .teleprompter a { color: var(--nz-c-green); }

article .teleprompter.flip-x  { transform: rotateY(180deg); pointer-events: none; padding: 300px 50px 1000px 100px !important; }
article .teleprompter.flip-y  { transform: rotateX(180deg); pointer-events: none; padding: 1000px 50px 300px 100px !important; }
article .teleprompter.flip-xy { transform: rotateX(180deg) rotateY(180deg); pointer-events: none; padding: 1000px 50px 300px 100px !important; }

/* Lesemarke: grünes Dreieck auf Höhe der Lesezeile */
.marker {
  position: fixed; left: 16px; top: 222px; z-index: 100;
  width: 40px; height: 40px; fill: var(--nz-c-green); display: none;
}

/* Abdunkelung über und unter der Lesezeile — flach, ohne Verlauf */
.overlay { display: none; position: fixed; top: 64px; width: 100%; height: 100%; z-index: 100; overflow: visible; }
.overlay .top, .overlay .bottom { position: fixed; left: 0; right: 0; width: 100%; background-color: rgba(12, 12, 10, .78); z-index: 10; }
.overlay .top { top: 64px; height: 100px; border-bottom: var(--nz-stroke-hair) solid rgba(0, 255, 156, .5); }
.overlay .bottom { top: 300px; bottom: 0; overflow: hidden; border-top: var(--nz-stroke-hair) solid rgba(0, 255, 156, .5); }

/* ── Fenster (Kurzanleitung, Update-Hinweis) ───────────────────────────── */
#modal {
  position: fixed; inset: 0; z-index: 5000;
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay { position: absolute; inset: 0; background: rgba(12, 12, 10, .9); z-index: 5001; }
.modal-content { position: relative; z-index: 5002; width: 100%; max-width: 460px; }

.sheet {
  display: none; text-align: left;
  background: var(--nz-c-paper); color: var(--nz-c-ink);
  border: var(--nz-stroke-strong) solid var(--nz-c-ink); box-shadow: 8px 8px 0 0 var(--nz-c-green);
  padding: 28px;
}
.sheet .nz-label { color: rgba(0, 0, 0, .66); }
.sheet h2 { font-family: var(--nz-font-display); font-weight: 700; font-size: 34px; line-height: 1; margin: 8px 0 14px; color: var(--nz-c-ink); }
.sheet p { font-size: 16px; line-height: 1.55; margin-bottom: 16px; }
.sheet a:not(.nz-btn) { color: var(--nz-c-ink); }
.sheet .keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; align-items: center; margin: 0 0 20px; font-size: 15px; }
.sheet .keys dt { white-space: nowrap; }
.sheet .nz-kbd { background: #fff; color: var(--nz-c-ink); border-color: var(--nz-c-ink); box-shadow: 2px 2px 0 0 var(--nz-c-ink); }
.sheet .credit { font-size: 13px; color: rgba(0, 0, 0, .66); margin: 0; padding-top: 14px; border-top: var(--nz-stroke-hair) solid rgba(0, 0, 0, .2); }

.close-modal { position: absolute; top: 10px; right: 10px; z-index: 5003; width: 40px; height: 40px; color: var(--nz-c-ink); }
.close-modal:hover { border-color: var(--nz-c-ink); }
.close-modal .ic { width: 24px; height: 24px; }

/* ── Mittlere Breite: Kopf zweizeilig ──────────────────────────────────── */
@media only screen and (max-width: 1060px) {
  header { height: 130px; flex-direction: column; justify-content: center; gap: 12px; padding: 10px 16px; }
  header nav { height: auto; }
  article .teleprompter { padding: 280px 40px 500px 60px; }
  .overlay, .overlay .top { top: 130px; }
  .overlay .top { height: 60px; }
  .overlay .bottom { top: 280px; }
  .marker { top: 198px; left: 8px; width: 32px; height: 32px; }
}

/* ── Handy ─────────────────────────────────────────────────────────────── */
@media only screen and (max-width: 600px) {
  header { height: 118px; gap: 8px; padding: 8px 10px; }
  header h1 { gap: 10px; }
  .brand { font-size: 20px; }
  header .app { display: none; }
  .clock { font-size: 15px; padding-left: 10px; }
  header nav { gap: 10px; width: 100%; justify-content: space-between; }
  .colors { gap: 4px; }
  input[type="color"] { width: 28px; height: 16px; }
  .sliders { gap: 10px; }
  .sliders label { display: flex; flex-wrap: wrap; gap: 2px 6px; font-size: 9px; width: 96px; }
  .sliders label > span { min-width: 0; }
  .sliders .slider { width: 96px; margin: 4px 0 0; }
  .button { width: 32px; height: 40px; }
  .button.small .ic { width: 18px; height: 18px; }
  .button.play { width: 40px; height: 40px; margin-left: 6px; box-shadow: 3px 3px 0 0 var(--nz-c-paper); }
  .button.help-open { display: none; }
  article .teleprompter { padding: 255px 20px 500px 40px; }
  .overlay, .overlay .top { top: 118px; }
  .overlay .bottom { top: 250px; }
  .marker { top: 178px; left: 4px; width: 26px; height: 26px; }
}
