/* GPTGenie – kleine UI-Verbesserungen (wird als letztes CSS geladen) */

/* ── Rückgängig-Button am Buchstaben-Canvas ── */
.canvas-btn-undo {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
  color: rgba(245,245,247,0.85);
  padding: 11px 14px;
}
.canvas-btn-undo:hover:not(:disabled) {
  background: rgba(255,255,255,0.11);
  border-color: rgba(255,255,255,0.22);
  transform: translateY(-1px);
}
.canvas-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none !important;
}

/* Zeichenflächen: keine Textauswahl / kein Scrollen beim Zeichnen */
#letterCanvas, #fastScanCanvas {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* ── Fast Scan: Zusatzleiste ── */
.fs-toolbar {
  display: flex;
  gap: 8px;
  justify-content: center;
  width: 100%;
}

.fs-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: -2px 0 8px;
  font-size: 12px;
  color: rgba(245,245,247,0.65);
}
.fs-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.fs-hint {
  font-size: 11px;
  color: rgba(245,245,247,0.40);
  text-align: center;
  margin-top: 8px;
}
.fs-hint kbd {
  font-family: inherit;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
}
.fs-saved-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(48,209,88,0.16);
  color: #30D158;
  border: 1px solid rgba(48,209,88,0.35);
  vertical-align: middle;
}
@media (hover: none) {
  .fs-hint { display: none; }
}

/* ── Icon-Buttons im Text-Bereich: Beschriftung per Tooltip ── */
#text-info-button, #history-button { cursor: pointer; }

/* ── Hinweis auf fehlende Buchstaben ── */
.missing-chars-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 10px 0 4px;
}
.missing-chars-list span {
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  background: rgba(255,159,10,0.12);
  border: 1px solid rgba(255,159,10,0.35);
  color: #FFB340;
}

/* ── Zeichenzähler: Wörter + Seiten-Schätzung ── */
.char-counter .text-stats { color: var(--text-3); }

/* ── Verifizierungscode: Zahlenfeld ── */
.verification-box { font-variant-numeric: tabular-nums; }



/* Bewegung reduzieren, wenn im System eingestellt */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Download-Button: Hinweis bei geändertem Text */
#download-pdf-button.pdf-outdated::after {
  content: '⟳ Text geändert';
  display: inline-block;
  margin-left: 8px;
  vertical-align: middle;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 100px;
  background: #FF9F0A;
  color: #1a1206;
  box-shadow: 0 2px 8px rgba(255,159,10,0.4);
}
html[lang="en"] #download-pdf-button.pdf-outdated::after { content: '⟳ Text changed'; }

/* Pinsel-Zeile auf dem Handy: Buttons umbrechen statt aus dem Bild laufen */
@media (max-width: 600px) {
  .brush-action-buttons { width: 100%; flex-wrap: wrap; justify-content: center; }
  .brush-action-buttons .brush-btn { flex: 1 1 auto; justify-content: center; }
  .canvas-buttons { flex-wrap: wrap; justify-content: center; }
  .canvas-btn { padding: 10px 16px; font-size: 13px; }
}

/* Fast Scan: „Zurück“ beim ersten Zeichen ausgegraut */
.nav-button:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* Schalter (Fast Scan, Buchstaben-Raster, Editor, Cookie-Hinweis): Aussehen in switch-glass.css */

/* ═══ Performance: unsichtbare Overlays wirklich ausblenden ═══
   Diese Overlays liegen mit opacity:0 und Glas-Unschärfe (backdrop-filter)
   über der ganzen Seite. Ohne visibility:hidden berechnet der Browser die
   Unschärfe bei jedem Scroll-/Zoom-Frame mit → Ruckeln und kurze weiße/leere
   Flächen. visibility wird erst NACH dem Ausblenden umgeschaltet, damit die
   Fade-Animation erhalten bleibt. */
.presets-overlay:not(.active),
#news-popup-overlay:not(.visible),
#pdf-gen-overlay:not(.active),
.feedback-overlay:not(.active),
.account-settings-dialog:not(.visible),
.background-selection-overlay:not(.active) {
  visibility: hidden;
  transition-property: opacity, visibility !important;
  transition-delay: 0s, .35s !important;
}
.presets-overlay.active,
#news-popup-overlay.visible,
#pdf-gen-overlay.active,
.feedback-overlay.active,
.account-settings-dialog.visible,
.background-selection-overlay.active {
  visibility: visible;
}
/* Endlos-Animationen in versteckten Overlays anhalten */
.presets-overlay:not(.active) *,
#news-popup-overlay:not(.visible) *,
#pdf-gen-overlay:not(.active) *,
#loading-screen.hidden * {
  animation-play-state: paused !important;
}
#cookie-banner:not(.cb-visible) { visibility: hidden; transition: transform .55s cubic-bezier(.34,1.26,.64,1), opacity .4s ease, visibility 0s linear .55s; }
#cookie-banner.cb-visible { visibility: visible; transition: transform .55s cubic-bezier(.34,1.26,.64,1), opacity .4s ease, visibility 0s; }

/* Hinweis: Strichdicke passt nicht zu den anderen Buchstaben (stroke-width.js), Zeichenfeld und Fast Scan */
.gg-width-hint {
  position: relative;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0; padding: 7px 34px 7px 12px;
  border-radius: 12px;
  background: rgba(252,211,77,0.10);
  border: 1px solid rgba(252,211,77,0.38);
  font-size: 12.5px; line-height: 1.4; text-align: left;
  color: rgba(245,245,247,0.86);
  animation: ggWidthHintIn .22s ease both;
}
.gg-width-hint[hidden] { display: none !important; }
.gg-width-hint .gg-width-msg { flex: 1 1 180px; min-width: 0; }
.gg-width-hint button {
  flex-shrink: 0; margin: 0 !important; cursor: pointer;
  font: inherit; font-size: 12px !important; font-weight: 600; line-height: 1.3;
  min-height: 0 !important; width: auto !important; box-shadow: none !important;
}
.gg-width-hint .gg-width-fix {
  padding: 5px 12px !important; border-radius: 100px !important;
  color: #1c1917 !important; background: #fcd34d !important; border: 0 !important;
}
.gg-width-hint .gg-width-fix:hover { background: #fde68a !important; }
.gg-width-hint .gg-width-close {
  position: absolute; top: 4px; right: 4px;
  padding: 3px 8px !important; border-radius: 100px !important;
  font-size: 16px !important; line-height: 1;
  color: rgba(245,245,247,0.6) !important; background: transparent !important; border: 0 !important;
}
.gg-width-hint .gg-width-close:hover { color: #fff !important; background: rgba(255,255,255,0.1) !important; }
#app-section .gg-width-hint { margin: 0 !important; }
#fast-scan-ui .gg-width-hint { margin-top: 12px; font-size: 12px; }
@keyframes ggWidthHintIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
