:root {
  --banner-bg: rgba(0, 0, 0, 0.55);
  --banner-fg: #ffffff;
  --fade: 800ms; /* crossfade-tid */
}

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

html, body {
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  cursor: none; /* dölj muspekaren på en signage-skärm */
}

#stage {
  position: fixed;
  inset: 0;
  background: #000;
}

/* Två skikt som tonar in/ut för mjuka övergångar */
.layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--fade) ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}
.layer.visible { opacity: 1; }

.layer video,
.layer img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 9:16-media fyller en 9:16-skärm perfekt */
  display: block;
}

/* Banner i nederkant */
.banner {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(24px, 7vw, 80px);
  padding: clamp(14px, 3vh, 30px) clamp(12px, 4vw, 40px);
  background: linear-gradient(to top, var(--banner-bg) 30%, rgba(0,0,0,0));
  color: var(--banner-fg);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  z-index: 10;
  transition: opacity 400ms ease;
}

/* En plattform = QR-kod överst, ikon + siffra under */
.banner-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1.2vh, 12px);
}
.banner-item.hidden { display: none; }

/* QR-kod: vit ruta så den scannar bra */
.qr {
  width: clamp(80px, 13vw, 150px);
  height: clamp(80px, 13vw, 150px);
  background: #fff;
  border-radius: 10px;
  padding: clamp(4px, 0.8vw, 9px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr img {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated; /* skarpa kanter = lättare att scanna */
}
.qr:empty { display: none; }

.info {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.2vw, 12px);
}

.icon {
  width: clamp(24px, 4vw, 44px);
  height: clamp(24px, 4vw, 44px);
  fill: currentColor;
  flex: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
}

.count {
  font-size: clamp(20px, 4.5vw, 48px);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  font-variant-numeric: tabular-nums;
}

/* Liten etikett precis ovanför QR-koden – fonten krymper för att passa bredden */
.qr-label {
  width: clamp(80px, 13vw, 150px); /* samma bredd som .qr */
  text-align: center;
  font-size: 18px;               /* startvärde; justeras av JS för att passa */
  font-weight: 600;
  letter-spacing: 0.2px;
  opacity: 0.95;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
  white-space: nowrap;
  overflow: visible;
}
.qr-label:empty { display: none; }

/* Meddelanderuta */
.message {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8vw;
  color: #eee;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(18px, 4vw, 32px);
  line-height: 1.5;
  z-index: 20;
}

.start-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  cursor: pointer;
  background: rgba(255,255,255,0.12);
  border: 2px solid rgba(255,255,255,0.6);
  color: #fff;
  font-size: clamp(20px, 5vw, 40px);
  padding: 0.6em 1.4em;
  border-radius: 999px;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  backdrop-filter: blur(4px);
}

.hidden { display: none !important; }
