:root {
  --black: #000;
  --yellow: #ffd415;
  --magenta: #e5018a;
  --strike: #f70194;
  --blue: #009ae2;
  --white: #fff;
  --old: #d6d8da;
  --dots: #8a8a8a;
}

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

html,
body {
  width: 100%;
  height: 100%;
  background: var(--black);
  overflow: hidden;
  cursor: none;
}

/* Plátno pevně 1920×1080; tv.js ho jen zmenší, když je okno menší (náhled na notebooku). */
.stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  transform-origin: 0 0;
  background: var(--black);
  color: var(--white);
  overflow: hidden;
}

/* ── Pruh BLACK FRIDAY (běží doleva) ───────────────────────────── */

.hazard {
  position: absolute;
  left: 0;
  right: 0;
  top: 30px;
  height: 74px;
  overflow: hidden;
}

/* Pruhy mají vodorovnou periodu přesně 80 px a cedule 640 px, takže posun o 1920 px
   (24 pruhů, 3 cedule) navazuje bez cuknutí. */
.hazard-track {
  display: flex;
  width: 3840px;
  height: 74px;
  padding-left: 90px;
  background: repeating-linear-gradient(135deg, var(--yellow) 0 28.2843px, var(--black) 28.2843px 56.5685px);
  animation: hazard-run 48s linear infinite;
  will-change: transform;
}

@keyframes hazard-run {
  to {
    transform: translateX(-1920px);
  }
}

.plate {
  flex: none;
  display: block;
  height: 74px;
  width: 460px;
  margin-right: 180px;
  text-align: center;
  background: var(--yellow);
  color: var(--black);
  font:
    800 42px/74px 'Archivo',
    'Arial Black',
    Arial,
    sans-serif;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  /* šikmé konce ve stejném úhlu jako pruhy */
  clip-path: polygon(37px 0, 100% 0, calc(100% - 37px) 100%, 0 100%);
}

/* ── Nadpis ────────────────────────────────────────────────────── */

.title {
  position: absolute;
  top: 128px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  font:
    700 70px/1 'Polentical Neon',
    sans-serif;
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
}

.crosshair {
  width: 82px;
  height: 82px;
  flex: none;
}

/* zaměřovač stojí (Pirožek 21. 11.: bez otáčení), skleničky si jednou za čas ťuknou */
.crosshair .glass {
  transform-box: view-box;
  transform-origin: 50px 73px;
  animation: clink 9s ease-in-out infinite;
}

.crosshair:last-child .glass {
  animation-delay: 0.15s;
}

/* jednou za čas si skleničky ťuknou */
@keyframes clink {
  0%,
  88%,
  100% {
    transform: rotate(0);
  }
  92% {
    transform: rotate(-12deg);
  }
  96% {
    transform: rotate(6deg);
  }
}

/* ── Sloupce ───────────────────────────────────────────────────── */

.columns {
  position: absolute;
  top: 228px;
  left: 76px;
  right: 76px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 150px;
}

.group + .group {
  margin-top: 30px;
}

.group h2 {
  height: 56px;
  display: flex;
  align-items: center;
  font:
    700 37px/1 'Polentical Neon',
    sans-serif;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.row {
  position: relative;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}

.name {
  flex: none;
  font:
    700 43px/1 'Roboto Condensed',
    'Arial Narrow',
    sans-serif;
  text-transform: uppercase;
  transition: opacity 0.6s;
}

.leader {
  flex: 1 1 auto;
  align-self: stretch;
  min-width: 24px;
  margin-bottom: 15px;
  background: radial-gradient(circle, var(--dots) 1.8px, transparent 2.2px) 0 100% / 11px 6px repeat-x;
}

.was {
  flex: none;
  position: relative;
  font:
    700 27px/1 'Roboto Condensed',
    'Arial Narrow',
    sans-serif;
  color: var(--old);
}

.was::after {
  content: '';
  position: absolute;
  left: -4px;
  right: -4px;
  top: 52%;
  height: 3px;
  background: var(--strike);
  transform: rotate(-1.5deg);
}

.price {
  flex: none;
  width: 168px;
  text-align: right;
  font:
    700 47px/1 'Polentical Neon',
    sans-serif;
  color: var(--magenta);
  letter-spacing: 0;
  word-spacing: -5px;
}

.leader,
.was,
.price {
  transition: opacity 0.4s;
}

.price {
  transform-origin: 100% 60%;
}

/* „Slevová vlna": jednou za čas se staré ceny znovu přeškrtnou řádek po řádku
   a nová cena poskočí — jako když pokladní přelepuje cenovky. */
.row.wave .was::after {
  animation: strike 0.45s cubic-bezier(0.6, 0, 0.3, 1);
}

.row.wave .price {
  animation: pop 0.6s 0.25s ease-out;
}

@keyframes strike {
  from {
    transform: rotate(-1.5deg) scaleX(0);
    transform-origin: 0 50%;
  }
  to {
    transform: rotate(-1.5deg) scaleX(1);
    transform-origin: 0 50%;
  }
}

@keyframes pop {
  40% {
    transform: scale(1.14);
    color: #ff4fbf;
    text-shadow: 0 0 22px rgba(229, 1, 138, 0.9);
  }
}

/* Pupíček sedí na ceně — cena se pod ním trochu prohne */
.row.squashed .price {
  transform: translateY(3px) scaleY(0.92);
  transition: transform 0.25s;
}

/* ── Vyprodáno ─────────────────────────────────────────────────── */

.row .stamp {
  position: absolute;
  right: 0;
  top: 50%;
  width: 336px;
  height: 46px;
  margin-top: -23px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--yellow);
  color: var(--black);
  font:
    700 33px/1 'Polentical Neon',
    sans-serif;
  letter-spacing: 3px;
  text-transform: uppercase;
  clip-path: polygon(16px 0, 100% 0, calc(100% - 16px) 100%, 0 100%);
  opacity: 0;
  transform: rotate(-2deg) scale(1.6);
  pointer-events: none;
}

.row.sold .name {
  opacity: 0.32;
}

.row.sold .leader,
.row.sold .was,
.row.sold .price {
  opacity: 0;
}

.row.sold .stamp {
  opacity: 1;
  transform: rotate(-2deg) scale(1);
  transition:
    transform 0.35s cubic-bezier(0.2, 1.6, 0.4, 1),
    opacity 0.2s;
}

/* právě přibylo: krátké zablikání, ať si toho barmani i hosté všimnou */
.row.sold.fresh .stamp {
  animation: flash 0.5s 0.35s 3 alternate;
}

@keyframes flash {
  to {
    background: var(--magenta);
    color: var(--white);
  }
}

/* ── Pupíček ───────────────────────────────────────────────────── */

/* Bod #pupicek = místo, kde má nohy; obrázek visí nad ním. Pozici řídí pupicek.js. */
.pupicek {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  z-index: 10;
  visibility: hidden;
  will-change: transform;
}

.pupicek .flap {
  position: absolute;
  left: 0;
  bottom: 0;
  transform-origin: 50% 100%;
}

.pupicek img {
  display: block;
  position: absolute;
  bottom: 0;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55));
}

.pupicek.mirror img {
  transform: scaleX(-1);
}

/* při letu mává křídly = poskakuje a kolébá se */
.pupicek.flying .flap {
  animation: flap 0.32s ease-in-out infinite alternate;
}

@keyframes flap {
  from {
    transform: translateY(0) rotate(-4deg) scaleY(1.02);
  }
  to {
    transform: translateY(-10px) rotate(3deg) scaleY(0.97);
  }
}

/* dosednutí */
.pupicek.landed .flap {
  animation: land 0.45s cubic-bezier(0.3, 1.8, 0.5, 1);
}

@keyframes land {
  from {
    transform: scale(1.12, 0.8);
  }
}

/* s drinkem: občas si lokne */
.pupicek.landed.sip .flap {
  animation:
    land 0.45s cubic-bezier(0.3, 1.8, 0.5, 1),
    sip 2.4s 0.8s ease-in-out infinite;
}

@keyframes sip {
  0%,
  55%,
  100% {
    transform: rotate(0);
  }
  70%,
  85% {
    transform: rotate(-7deg) translateY(-3px);
  }
}

.pupicek.mirror.landed.sip .flap {
  animation-name: land, sip-mirror;
}

@keyframes sip-mirror {
  0%,
  55%,
  100% {
    transform: rotate(0);
  }
  70%,
  85% {
    transform: rotate(7deg) translateY(-3px);
  }
}

/* ── Stav spojení (jen nenápadná tečka, ať je poznat, že lístek visí) ── */

@media (prefers-reduced-motion: reduce) {
  .hazard-track,
  .crosshair .glass {
    animation: none;
  }
}

.offline {
  position: absolute;
  right: 18px;
  bottom: 12px;
  font:
    700 16px/1 'Roboto Condensed',
    sans-serif;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.offline::before {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  border-radius: 50%;
  background: #c0392b;
  vertical-align: 1px;
}
