/* Kundendisplay — Fire TV (10-Fuß) & iPad */
html:has(body.pe-display-page),
html:has(body.pe-display-page) body,
body.pe-display-page {
  background: #05070c !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  height: 100% !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  width: 100% !important;
}
/* Admin-Bar-Offset entfernen (Bar ist ausgeblendet) */
html.wp-toolbar:has(body.pe-display-page),
body.admin-bar.pe-display-page,
body.pe-display-page.admin-bar {
  padding-top: 0 !important;
  margin-top: 0 !important;
}
body.pe-display-page #wpadminbar {
  display: none !important;
}
body.pe-display-page .pe-app,
body.pe-display-page .pe-app.pe-display,
body.pe-display-page #pe-display {
  background: #05070c !important;
  background-image: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  max-width: none !important;
  width: 100% !important;
  min-height: 100dvh !important;
  height: 100dvh !important;
  border: 0 !important;
  border-radius: 0 !important;
}
body.pe-display-page .pe-app-header,
body.pe-display-page .pe-nav,
body.pe-display-page header.site-header,
body.pe-display-page footer,
body.pe-display-page .site-footer,
body.pe-display-page .wp-block-template-part,
body.pe-display-page .entry-header,
body.pe-display-page .page-title,
body.pe-display-page .wp-block-post-title {
  display: none !important;
}
body.pe-display-page #page,
body.pe-display-page .site,
body.pe-display-page .wp-site-blocks,
body.pe-display-page .wp-block-group,
body.pe-display-page .wp-block-post-content,
body.pe-display-page .site-content,
body.pe-display-page .content-area,
body.pe-display-page main,
body.pe-display-page article,
body.pe-display-page .entry-content,
body.pe-display-page .page-content,
body.pe-display-page .wp-block-post {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  min-height: 100dvh !important;
  height: auto !important;
}

.pe-display {
  --disp-ink: #f7f9fc;
  --disp-muted: #d0d7e6;
  --disp-prep: #5eefe8;
  --disp-prep-dim: rgba(94, 239, 232, 0.22);
  --disp-ready: #f0d060;
  --disp-ready-hot: #ffe9a0;
  --disp-panel: rgba(8, 12, 22, 0.88);
  --disp-line: rgba(247, 249, 252, 0.22);
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(0.45rem, 1.1vmin, 0.9rem);
  overflow: hidden;
  color: var(--disp-ink);
  font-family: "Segoe UI Variable Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  display: flex;
  flex-direction: column;
  gap: clamp(0.35rem, 0.9vmin, 0.7rem);
  background: #05070c;
  -webkit-font-smoothing: antialiased;
}

.pe-display-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(90vmin 70vmin at 8% -5%, rgba(79, 212, 207, 0.22), transparent 58%),
    radial-gradient(95vmin 75vmin at 100% 110%, rgba(232, 197, 71, 0.2), transparent 55%),
    linear-gradient(155deg, #070a12 0%, #101827 46%, #080b13 100%);
}
.pe-display-mesh {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 35%, transparent 78%);
}
.pe-display-glow {
  position: absolute;
  width: 48vmin;
  height: 48vmin;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.4;
  animation: pe-disp-float 16s ease-in-out infinite;
}
.pe-display-glow--a {
  top: -12%;
  left: -8%;
  background: #2f9f9a;
}
.pe-display-glow--b {
  right: -10%;
  bottom: -16%;
  background: #b8960c;
  animation-delay: -7s;
}
@keyframes pe-disp-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(2.5%, -3%) scale(1.08); }
}

.pe-display-header,
.pe-display-board,
.pe-display-status {
  position: relative;
  z-index: 1;
}

.pe-display-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.75rem 1.5rem;
  flex: 0 0 auto;
  padding: 0.15rem 0.25rem clamp(0.4rem, 1vmin, 0.75rem);
  border-bottom: 1px solid var(--disp-line);
}
.pe-display-list-block {
  min-width: 0;
}
.pe-display-list-label {
  margin: 0;
  font-size: clamp(0.95rem, 2.2vmin, 1.35rem);
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--disp-ready-hot);
  text-shadow: 0 0 24px rgba(232, 197, 71, 0.35);
}
.pe-display-stand {
  margin: 0.15rem 0 0;
  font-family: Impact, "Arial Narrow", "Segoe UI", sans-serif;
  font-size: clamp(2.8rem, 8.5vmin, 6rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 0.92;
  text-transform: uppercase;
  color: var(--disp-ink);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pe-display-meta {
  text-align: right;
  flex-shrink: 0;
}
.pe-display-brand {
  margin: 0;
  font-size: clamp(0.85rem, 1.8vmin, 1.15rem);
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--disp-muted);
}
.pe-display-clock {
  display: block;
  margin-top: 0.25rem;
  font-size: clamp(1.35rem, 3.2vmin, 2.1rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: var(--disp-ink);
}

.pe-display-sound-gate {
  position: absolute;
  z-index: 40;
  left: 50%;
  bottom: clamp(1rem, 4vmin, 2.5rem);
  transform: translateX(-50%);
  margin: 0;
  padding: 0.85rem 1.6rem;
  border: 1px solid rgba(255, 228, 138, 0.45);
  border-radius: 999px;
  background: rgba(8, 12, 20, 0.88);
  color: var(--disp-ready-hot);
  font-size: clamp(1rem, 2.4vmin, 1.35rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.pe-display-sound-gate.is-gone {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(12px);
}

.pe-display-status {
  margin: 0;
  padding: 0.55rem 0.9rem;
  border-radius: 12px;
  background: rgba(232, 197, 71, 0.14);
  color: #ffe07a;
  font-size: clamp(1rem, 2.2vmin, 1.25rem);
  font-weight: 700;
}
.pe-display-status-err {
  background: rgba(255, 107, 90, 0.16);
  color: #ffc9c3;
}

.pe-display-board {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.28fr);
  gap: clamp(0.85rem, 2.2vmin, 1.75rem);
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}
.pe-display-col {
  min-width: 0;
  width: 100%;
}

.pe-display-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: clamp(0.65rem, 1.6vmin, 1.25rem);
  border-radius: clamp(14px, 2vmin, 24px);
  border: 1px solid var(--disp-line);
  background: var(--disp-panel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.pe-display-col--prep {
  border-color: rgba(79, 212, 207, 0.28);
  background:
    linear-gradient(165deg, rgba(79, 212, 207, 0.12), transparent 48%),
    var(--disp-panel);
}
.pe-display-col--ready {
  border-color: rgba(232, 197, 71, 0.42);
  background:
    linear-gradient(165deg, rgba(232, 197, 71, 0.16), transparent 48%),
    var(--disp-panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(232, 197, 71, 0.1),
    0 28px 70px rgba(0, 0, 0, 0.4);
  animation: pe-disp-ready-panel 5s ease-in-out infinite;
}
@keyframes pe-disp-ready-panel {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 0 0 1px rgba(232,197,71,.1), 0 28px 70px rgba(0,0,0,.4); }
  50% { box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 0 0 1px rgba(255,228,138,.22), 0 28px 80px rgba(232,197,71,.12); }
}

.pe-display-col-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: clamp(0.75rem, 1.8vmin, 1.25rem);
  flex: 0 0 auto;
}
.pe-display-col-head h2 {
  margin: 0;
  font-size: clamp(1.25rem, 3.4vmin, 2.15rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.pe-display-col--prep .pe-display-col-head h2 { color: var(--disp-prep); }
.pe-display-col--ready .pe-display-col-head h2 { color: var(--disp-ready-hot); }
.pe-display-count {
  margin-left: auto;
  min-width: 1.6em;
  padding: 0.2em 0.55em;
  border-radius: 999px;
  font-size: clamp(1rem, 2.4vmin, 1.45rem);
  font-weight: 800;
  text-align: center;
  background: rgba(79, 212, 207, 0.16);
  color: var(--disp-prep);
  border: 1px solid rgba(79, 212, 207, 0.3);
}
.pe-display-count--ready {
  background: rgba(232, 197, 71, 0.18);
  color: var(--disp-ready-hot);
  border-color: rgba(232, 197, 71, 0.4);
}
.pe-display-count[hidden] { display: none !important; }

.pe-display-col-pulse {
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  background: var(--disp-prep);
  box-shadow: 0 0 0 0 rgba(79, 212, 207, 0.55);
  animation: pe-disp-pulse 1.7s ease-out infinite;
}
@keyframes pe-disp-pulse {
  0% { box-shadow: 0 0 0 0 rgba(79, 212, 207, 0.55); }
  70% { box-shadow: 0 0 0 18px rgba(79, 212, 207, 0); }
  100% { box-shadow: 0 0 0 0 rgba(79, 212, 207, 0); }
}

.pe-display-numbers {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: flex-start;
  justify-content: flex-start;
  gap: clamp(0.55rem, 1.6vmin, 1.1rem);
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.pe-display-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  align-self: flex-start;
  width: max-content;
  max-width: 100%;
  box-sizing: border-box;
  font-family: Impact, "Arial Narrow", "Segoe UI", sans-serif;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.04em;
  border-radius: clamp(12px, 1.8vmin, 22px);
  animation: pe-disp-pop 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes pe-disp-pop {
  from { opacity: 0; transform: scale(0.84) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.pe-display-numbers--prep .pe-display-num {
  font-size: clamp(2.2rem, 7vmin, 4.5rem);
  min-width: 2.05em;
  padding: 0.28em 0.4em;
  text-align: center;
  color: #f2fffd;
  background: var(--disp-prep-dim);
  border: 2px solid rgba(94, 239, 232, 0.55);
}
.pe-display-numbers--ready .pe-display-num {
  font-size: clamp(2.8rem, 9vmin, 6.5rem);
  min-width: 1.95em;
  padding: 0.2em 0.34em 0.14em;
  text-align: center;
  color: #1a1504;
  background: linear-gradient(155deg, #fff1a8 0%, var(--disp-ready-hot) 38%, var(--disp-ready) 72%, #c9a227 100%);
  box-shadow: 0 14px 36px rgba(232, 197, 71, 0.32);
  animation: pe-disp-pop 0.5s cubic-bezier(0.22, 1, 0.36, 1) both, pe-disp-ready-glow 2.6s ease-in-out infinite;
  transform-origin: center center;
  will-change: transform;
}
@keyframes pe-disp-ready-glow {
  0%, 100% { box-shadow: 0 14px 36px rgba(232, 197, 71, 0.26); filter: brightness(1); }
  50% { box-shadow: 0 18px 48px rgba(255, 228, 138, 0.5); filter: brightness(1.05); }
}

/* > 2 Min. abholbereit: zwischendurch witzig bewegen, dann zurück */
.pe-display-numbers--ready {
  overflow: visible;
}
.pe-display-col--ready {
  overflow: visible;
}
.pe-display-numbers--ready .pe-display-num-nudge {
  animation:
    pe-disp-pop 0.5s cubic-bezier(0.22, 1, 0.36, 1) both,
    pe-disp-nudge-dance 7.5s cubic-bezier(0.34, 1.45, 0.64, 1) infinite;
  animation-delay: 0s, calc(var(--nudge-i, 0) * 1.6s);
  z-index: 2;
}
@keyframes pe-disp-nudge-dance {
  0%, 68%, 100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  72% {
    transform: translate(18px, -28px) rotate(-9deg) scale(1.08);
  }
  76% {
    transform: translate(-24px, 10px) rotate(11deg) scale(1.1);
  }
  80% {
    transform: translate(22px, 18px) rotate(-7deg) scale(1.06);
  }
  84% {
    transform: translate(-14px, -16px) rotate(8deg) scale(1.09);
  }
  88% {
    transform: translate(10px, 8px) rotate(-4deg) scale(1.04);
  }
  92% {
    transform: translate(-6px, -10px) rotate(3deg) scale(1.02);
  }
  96% {
    transform: translate(2px, 2px) rotate(-1deg) scale(1.01);
  }
}
/* Variante 2/3 für Abwechslung (über --nudge-i) */
.pe-display-numbers--ready .pe-display-num-nudge:nth-child(3n) {
  animation-name: pe-disp-pop, pe-disp-nudge-bounce;
}
.pe-display-numbers--ready .pe-display-num-nudge:nth-child(3n+1) {
  animation-name: pe-disp-pop, pe-disp-nudge-spin;
}
@keyframes pe-disp-nudge-bounce {
  0%, 70%, 100% { transform: translate(0, 0) scale(1); }
  74% { transform: translate(0, -36px) scale(1.12) rotate(-3deg); }
  78% { transform: translate(12px, 8px) scale(0.96) rotate(4deg); }
  82% { transform: translate(-16px, -22px) scale(1.1) rotate(-6deg); }
  86% { transform: translate(8px, 4px) scale(1.02) rotate(2deg); }
  90% { transform: translate(-4px, -8px) scale(1.04); }
  94% { transform: translate(0, 2px) scale(1); }
}
@keyframes pe-disp-nudge-spin {
  0%, 70%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
  74% { transform: translate(-20px, -12px) rotate(-18deg) scale(1.08); }
  78% { transform: translate(26px, -8px) rotate(22deg) scale(1.1); }
  82% { transform: translate(-10px, 16px) rotate(-12deg) scale(1.05); }
  86% { transform: translate(14px, -6px) rotate(8deg) scale(1.06); }
  92% { transform: translate(-4px, 2px) rotate(-2deg) scale(1.01); }
}

.pe-display-num-warn {
  outline: 3px solid #ffb020;
  outline-offset: 4px;
}
.pe-display-num-alert {
  outline: 4px solid #ff6b5a;
  outline-offset: 4px;
}
.pe-display-numbers--ready .pe-display-num-nudge.pe-display-num-alert {
  animation:
    pe-disp-pop 0.5s cubic-bezier(0.22, 1, 0.36, 1) both,
    pe-disp-nudge-dance 6s cubic-bezier(0.34, 1.45, 0.64, 1) infinite,
    pe-disp-alert 1.05s ease-in-out infinite;
  animation-delay: 0s, calc(var(--nudge-i, 0) * 1.2s), 0s;
}
@keyframes pe-disp-alert {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.14); }
}

@media (prefers-reduced-motion: reduce) {
  .pe-display-numbers--ready .pe-display-num-nudge,
  .pe-display-numbers--ready .pe-display-num-nudge.pe-display-num-alert {
    animation: pe-disp-pop 0.5s ease both, pe-disp-ready-glow 2.6s ease-in-out infinite !important;
  }
}

.pe-display-col-empty {
  margin: auto 0 0;
  padding-top: 1rem;
  color: var(--disp-muted);
  font-size: clamp(1.2rem, 3vmin, 1.75rem);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.pe-display-col-empty[hidden] { display: none !important; }

/* iPad / Tablet: kompakte Kacheln (nicht volle Balken) */
@media (max-width: 1366px) {
  .pe-display-numbers {
    gap: 0.5rem 0.55rem;
  }
  .pe-display-numbers--prep .pe-display-num {
    font-size: clamp(1.55rem, 4.8vw, 2.35rem);
    min-width: 2.75rem;
    padding: 0.42em 0.55em;
    border-radius: 12px;
  }
  .pe-display-numbers--ready .pe-display-num {
    font-size: clamp(2rem, 6.5vw, 3.25rem);
    min-width: 3.25rem;
    padding: 0.38em 0.5em;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(232, 197, 71, 0.28);
  }
  .pe-display-stand {
    font-size: clamp(1.75rem, 6.5vw, 3.2rem);
  }
  .pe-display-list-label {
    font-size: clamp(0.8rem, 2.2vw, 1.05rem);
  }
  .pe-display-col {
    padding: 0.65rem 0.75rem;
  }
  .pe-display-col-head {
    margin-bottom: 0.55rem;
  }
  .pe-display-col-head h2 {
    font-size: clamp(1rem, 3.2vw, 1.35rem);
    letter-spacing: 0.1em;
  }
}

/* iPad Hochformat */
@media (orientation: portrait) and (max-width: 1100px) {
  .pe-display-header {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .pe-display-meta { text-align: left; }
  .pe-display-board {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 0.34fr) minmax(0, 0.66fr);
    gap: 0.55rem;
  }
  .pe-display-numbers--prep .pe-display-num {
    font-size: clamp(1.45rem, 5.2vw, 2.1rem);
  }
  .pe-display-numbers--ready .pe-display-num {
    font-size: clamp(1.9rem, 7vw, 2.9rem);
  }
}

/* Nur wirklich große TVs / Fire TV — nicht iPad Pro */
@media (min-width: 1600px) and (min-height: 900px) {
  .pe-display {
    padding: clamp(0.5rem, 1.4vmin, 1.1rem);
  }
  .pe-display-stand {
    font-size: clamp(3.2rem, 9vmin, 6.5rem);
  }
  .pe-display-numbers--prep .pe-display-num {
    font-size: clamp(3.4rem, 10vmin, 6.5rem);
  }
  .pe-display-numbers--ready .pe-display-num {
    font-size: clamp(5rem, 15vmin, 11rem);
  }
  .pe-display-col-head h2 {
    font-size: clamp(1.5rem, 3.8vmin, 2.4rem);
  }
}

/* Touch / TV: kein Backdrop-Blur (Silk Performance) */
@media (hover: none) {
  .pe-display-col {
    backdrop-filter: none;
  }
  .pe-display-glow {
    filter: blur(48px);
    opacity: 0.32;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pe-display-glow,
  .pe-display-col--ready,
  .pe-display-num,
  .pe-display-col-pulse,
  .pe-display-numbers--ready .pe-display-num {
    animation: none !important;
  }
}

.pe-display-kiosk-btn {
  display: inline-flex;
  align-items: center;
  margin: 0 0 0.35rem auto;
  padding: 0.35rem 0.75rem !important;
  font-size: clamp(0.85rem, 1.8vmin, 1.05rem) !important;
  font-weight: 700 !important;
  color: #f7f9fc !important;
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  border-radius: 10px !important;
  cursor: pointer;
}
.pe-display-kiosk-btn:hover,
.pe-display-kiosk-btn:focus-visible {
  background: rgba(255, 255, 255, 0.22) !important;
  color: #fff !important;
}

/* Idle-Randwerbung (kein Vollbild) */
.pe-display {
  position: relative;
}
.pe-display-idle-ads {
  z-index: 5;
}
.pe-display-header,
.pe-display-board {
  position: relative;
  z-index: 6;
}
.pe-display-ads-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0;
}
.pe-display-ads-preview img,
.pe-display-ads-preview video {
  width: 88px;
  height: 66px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #eee;
}
