/* REISRAD.leo: the rigged wheel. */
.scr-wheel {
  gap: 0;
  touch-action: manipulation;
}

.scr-wheel .scr-wheel__win {
  max-width: 500px;
}

.scr-wheel .win__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 14px 16px;
}

.scr-wheel .win__body > * + * { margin-top: 10px; }

.scr-wheel__head {
  text-align: center;
}

.scr-wheel__title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--fs-m);
  line-height: 1.15;
  letter-spacing: 0.5px;
  text-wrap: balance;
}

.scr-wheel__sponsor {
  margin: 2px 0 0;
  font-size: var(--fs-s);
  color: var(--ink-soft);
}

.scr-wheel__area {
  position: relative;
  display: flex;
  justify-content: center;
}

.scr-wheel__wheel {
  display: block;
  touch-action: manipulation; /* while it spins (or after a reload) a swipe over it scrolls the page */
  -webkit-user-select: none;
  user-select: none;
}

.scr-wheel__wheel.is-draggable {
  touch-action: none; /* she drags the wheel */
  cursor: grab;
}

.scr-wheel__build {
  position: absolute;
  inset: -8px -10px;
  pointer-events: none;
  z-index: 2;
}

.scr-wheel .textbuild {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scr-wheel .textbuild.is-out {
  animation: fade-out calc(250ms / var(--speed)) steps(3) both;
}

.scr-wheel__caption {
  position: absolute;
  left: 50%;
  bottom: 3%;
  z-index: 3;
  width: min(88%, 300px);
  margin: 0;
  transform: translateX(-50%);
  background: var(--yellow);
  font-size: var(--fs-s);
  line-height: 1.25;
  text-align: center;
  pointer-events: none;
}

.scr-wheel__caption.fx-pop {
  animation: wheel-caption-in var(--t-med) steps(4) both;
}

@keyframes wheel-caption-in {
  0% { transform: translateX(-50%) scale(0.6); opacity: 0; }
  60% { transform: translateX(-50%) scale(1.06); opacity: 1; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

.scr-wheel__controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.scr-wheel__spin {
  min-width: 180px;
}

.scr-wheel__hint {
  margin: 0;
  font-size: var(--fs-s);
  color: var(--ink-soft);
  text-align: center;
}

.scr-wheel__result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.scr-wheel__banner {
  display: block;
  position: relative;
  z-index: 2;
}

/* the boarding pass prints out from under the banner */
.scr-wheel__passslot {
  margin-top: -6px;
  width: min(100%, 300px);
  overflow: hidden;
  padding: 0 4px 4px 0;
}

.scr-wheel__pass {
  display: flex;
  align-items: stretch;
  background: var(--paper);
  border: var(--bw) solid var(--ink);
  box-shadow: 3px 3px 0 0 var(--ink);
}

.scr-wheel__pass.is-printing {
  animation: wheel-pass-print calc(700ms / var(--speed)) steps(7) both;
}

@keyframes wheel-pass-print {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

.scr-wheel .pass__stub {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  background: var(--mint);
  border-right: 3px dashed var(--ink);
}

.scr-wheel .pass__main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 5px 8px;
}

.scr-wheel .pass__main p { margin: 0; }

.scr-wheel .pass__title {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  line-height: 1.3;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* "LEONIE · AMS > DAR" on one line when it fits; on a narrow phone the route wraps to its own line and
   its dot slides into the clipped strip on the left (the inner row is shifted left by the dot's width) */
.scr-wheel .pass__line {
  overflow: hidden;
  font-family: var(--font-ui);
  font-size: var(--fs-s);
  line-height: 1.25;
}

.scr-wheel .pass__inner {
  display: flex;
  flex-wrap: wrap;
  margin-left: -1.25em;
}

.scr-wheel .pass__name,
.scr-wheel .pass__route { white-space: nowrap; }

.scr-wheel .pass__name { padding-left: 1.25em; }

.scr-wheel .pass__dot {
  display: inline-block;
  width: 1.25em;
  text-align: center;
}

.scr-wheel .pass__seat {
  display: inline-block;
  margin-top: 2px !important;
  padding: 0 6px;
  font-family: var(--font-ui);
  font-size: var(--fs-s);
  line-height: 1.3;
  background: var(--pink);
  border: 2px solid var(--ink);
}

.scr-wheel .pass__code {
  flex: none;
  width: 30px;
  margin: 6px 6px 6px 0;
  background: repeating-linear-gradient(90deg, var(--ink) 0 3px, transparent 3px 5px, var(--ink) 5px 6px, transparent 6px 9px);
}

.scr-wheel__offer {
  flex-wrap: nowrap;
  gap: 10px;
}

.scr-wheel__offer .btn {
  padding: 6px 12px;
  font-size: var(--fs-xs);
}

.scr-wheel__after {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: min(100%, 300px);
}

.scr-wheel__after .btn { font-size: var(--fs-xs); }

.scr-wheel__offerbar {
  width: min(100%, 280px);
  height: 6px;
  margin-top: 4px !important;
  background: var(--shade);
  border: 2px solid var(--ink);
}

.scr-wheel__offerbar span {
  display: block;
  height: 100%;
  background: var(--pink);
  transform-origin: left center;
}

.scr-wheel__offerbar span.is-running {
  animation: wheel-offer calc(6000ms / var(--speed)) steps(12) both;
}

@keyframes wheel-offer {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

/* Mars: the whole screen turns red for a moment */
.scr-wheel__tint {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background: var(--red);
  mix-blend-mode: multiply;
  opacity: 0;
  transition: opacity calc(240ms / var(--speed)) steps(3);
}

.scr-wheel__tint.is-on { opacity: 0.42; }

/* leaving for the zoom: everything but the wheel and the banner fades away */
.scr-wheel.is-leaving .scr-wheel__win {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  transition: background-color calc(240ms / var(--speed)) steps(3), border-color calc(240ms / var(--speed)) steps(3), box-shadow calc(240ms / var(--speed)) steps(3);
}

.scr-wheel.is-leaving :is(.win__bar, .scr-wheel__head, .scr-wheel__controls, .scr-wheel__passslot, .scr-wheel__offer, .scr-wheel__offerbar, .scr-wheel__after, .scr-wheel__caption) {
  opacity: 0;
  transition: opacity calc(240ms / var(--speed)) steps(3);
}

.scr-wheel.is-leaving .win__bar {
  border-bottom-color: transparent;
}
