@font-face {
  font-family: 'Promo Hand';
  src: url('/assets/long-cang-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0030-0039;
}

.reader-promo {
  position: relative;
  width: min(154px, 100%);
  margin: 0;
  color: #edf3ff;
}

.reader-promo-anchor {
  position: relative;
  display: flex;
  width: 100%;
  isolation: isolate;
}

.reader-promo-remaining {
  position: absolute;
  bottom: calc(100% + 2px);
  left: -2px;
  display: inline-flex;
  align-items: flex-end;
  gap: 5px;
  color: #fff;
  font: 400 15px/1.1 Inter, sans-serif;
  text-shadow: 0 1px 5px rgb(0 0 0 / .75);
  white-space: nowrap;
  pointer-events: none;
}

.reader-promo-number-slot {
  position: relative;
  display: grid;
}

.reader-promo-remaining-number {
  min-width: .8em;
  font: 400 32px/.82 'Promo Hand', cursive;
  text-align: center;
  transform: rotate(-27deg);
  transform-origin: 50% 70%;
}

.reader-promo-remaining-number.is-empty {
  color: #d74b64;
  text-shadow: 0 1px 2px rgb(39 2 11 / .95), 0 0 7px rgb(193 36 74 / .56), 0 0 15px rgb(117 15 40 / .42);
  animation: reader-promo-empty-pulse 1400ms ease-in-out 3;
}

.reader-promo-previous-number {
  position: absolute;
  inset: 0;
}

.reader-promo-previous-number.is-empty { animation: none; }

.reader-promo[data-reveal="waiting"] .reader-promo-anchor { opacity: 0; }
.reader-promo[data-reveal="visible"] .reader-promo-anchor {
  animation: reader-promo-arrive 420ms cubic-bezier(.18, .78, .24, 1) both;
}

.reader-promo-direction-link {
  position: absolute;
  left: calc(100% + 21px);
  top: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border-radius: 12px;
  pointer-events: none;
}

.reader-promo-direction-link:any-link {
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.reader-promo-direction-link:focus-visible { outline: 1px solid #aebed2; outline-offset: 2px; }
.reader-promo[data-reveal="waiting"] .reader-promo-direction-link { visibility: hidden; }

.reader-promo-direction {
  display: block;
  width: 30px;
  height: 34px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.reader-promo:is([data-reveal="visible"], [data-reveal="settled"]) .reader-promo-direction {
  animation: reader-promo-point 7200ms ease-in-out infinite;
}

.reader-promo-button {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms ease;
}

.reader-promo-surface {
  --promo-cover-top: #edf5fa;
  --promo-cover-mid: #d5e3ee;
  --promo-cover-bottom: #a9bdcf;
  position: absolute;
  inset: 2px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 13px 5px 14px;
  overflow: hidden;
  border-radius: inherit;
  background: linear-gradient(180deg, #142033, #080e18);
  box-shadow: 0 3px 10px rgb(0 0 0 / .32), 0 0 14px rgb(137 191 237 / .2);
  transition: box-shadow 220ms ease;
}

.reader-promo-surface::before,
.reader-promo-surface::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  content: '';
}

.reader-promo-surface::before {
  background: linear-gradient(180deg, var(--promo-cover-top), var(--promo-cover-mid) 49%, var(--promo-cover-bottom));
  opacity: 0;
}

.reader-promo-surface::after { box-shadow: inset 0 1px 0 rgb(239 249 255 / .46); }

.reader-promo-button:active { transform: scale(.975); }
.reader-promo-button:focus-visible { outline: 2px solid #9cbff7; outline-offset: 2px; }
@media (hover: hover) {
  .reader-promo[data-scratch="concealed"] .reader-promo-button:hover .reader-promo-surface {
    box-shadow: 0 3px 10px rgb(0 0 0 / .32), 0 0 19px rgb(153 206 249 / .32);
  }
}

.reader-promo-words { display: grid; gap: 3px; text-align: left; }
.reader-promo-label {
  grid-row: 2;
  color: #8f9baa;
  font: 400 6.5px/1.1 Inter, sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.reader-promo-code {
  grid-row: 1;
  min-height: 12px;
  color: #fff;
  font: 700 10px/1.1 'Partner Druk Wide', sans-serif;
  letter-spacing: -.025em;
  text-shadow: 0 1px 0 rgb(0 0 0 / .8);
}

.reader-promo-code.is-long { font-size: 9.25px; }

.reader-promo-cover {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* The CSS cover settles back over an expired ticket before the next reveal. */
.reader-promo[data-scratch="concealed"] .reader-promo-surface::before {
  opacity: 1;
  transition: opacity 240ms ease-out;
}

.reader-promo[data-scratch="concealed"] .reader-promo-cover,
.reader-promo[data-scratch="concealed"] .reader-promo-words,
.reader-promo[data-scratch="concealed"] .reader-promo-icon {
  visibility: hidden;
}

.reader-promo-hint {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  grid-template-columns: 24px auto;
  grid-template-rows: 12px 8px;
  align-content: center;
  align-items: center;
  justify-content: center;
  gap: 3px 8px;
  color: #192c42;
  font: 600 10.5px/1 Inter, sans-serif;
  letter-spacing: .075em;
  pointer-events: none;
  transition: opacity 90ms ease-out;
}

.reader-promo[data-scratch="concealed"] .reader-promo-hint { transition: opacity 180ms ease-out 38ms; }

.reader-promo-serial {
  grid-column: 2;
  justify-self: start;
  color: #405971;
  font: 400 6.5px/8px ui-monospace, Consolas, monospace;
  letter-spacing: .07em;
}

.reader-promo-ticket {
  grid-row: 1 / span 2;
  display: block;
  width: 24px;
  height: 24px;
  padding: 4px;
  border-radius: 8px;
  background: rgb(255 255 255 / .32);
  color: #29435f;
}

.reader-promo-brush-light {
  position: absolute;
  top: -6px;
  left: -11px;
  display: none;
  width: 22px;
  height: 12px;
  background: radial-gradient(ellipse, rgb(224 246 255 / .75), rgb(122 189 255 / .24) 38%, transparent 72%);
  opacity: 0;
  pointer-events: none;
}

.reader-promo[data-scratch="revealing"] .reader-promo-brush-light { display: block; }

.reader-promo[data-scratch="revealing"] .reader-promo-hint,
.reader-promo[data-scratch="revealed"] .reader-promo-hint { opacity: 0; }
.reader-promo[data-scratch="revealed"] .reader-promo-cover { opacity: 0; }
.reader-promo[data-scratch="revealing"] .reader-promo-surface,
.reader-promo[data-scratch="revealed"] .reader-promo-surface {
  box-shadow: inset 0 0 0 1px rgb(138 185 224 / .32), 0 0 14px rgb(94 159 216 / .2);
}

.reader-promo-button::after {
  position: absolute;
  z-index: 2;
  inset: 2px 0;
  border: 1px solid #d2ebff;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgb(225 242 255 / .3), 0 0 0 1px rgb(169 214 255 / .12), 0 0 14px rgb(125 190 245 / .34);
  opacity: var(--scratch-completion, 0);
  pointer-events: none;
  content: '';
}

.reader-promo-icon {
  position: relative;
  width: 14px;
  height: 15px;
  flex: none;
  color: #b8c6d8;
}
.reader-promo-icon::before, .reader-promo-icon::after {
  position: absolute;
  width: 9px;
  height: 11px;
  border: 1px solid currentColor;
  border-radius: 2px;
  content: '';
}
.reader-promo-icon::before { top: 0; left: 0; }
.reader-promo-icon::after { right: 0; bottom: 0; background: #080d16; }

.reader-promo-manual {
  position: absolute;
  z-index: 3;
  bottom: calc(100% + 35px);
  left: 0;
  display: grid;
  width: 180px;
  gap: 5px;
  padding: 10px;
  border: 1px solid #303c50;
  border-radius: 12px;
  background: linear-gradient(180deg, #101724, #04070c);
  color: #bdcbd8;
  font: 400 11px/1.4 Inter, sans-serif;
}
.reader-promo-manual input {
  width: 100%;
  padding: 5px 7px;
  border: 1px solid #38475d;
  border-radius: 6px;
  background: #070b13;
  color: #f1f4f8;
  font: 400 16px/1.4 Inter, sans-serif;
  user-select: text;
  -webkit-user-select: text;
}
.reader-promo-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes reader-promo-arrive {
  from { opacity: 0; transform: translateY(6px) scale(.98); }
  to { opacity: 1; transform: none; }
}

@keyframes reader-promo-empty-pulse {
  50% {
    color: #f25b71;
    text-shadow: 0 1px 2px rgb(39 2 11 / .95), 0 0 9px rgb(222 51 83 / .85), 0 0 18px rgb(167 22 58 / .58);
  }
}

@keyframes reader-promo-point {
  0%, 24%, 48% {
    transform: translateX(-3px) rotate(-2deg);
    filter: drop-shadow(0 0 0 rgb(255 255 255 / 0));
  }
  12%, 36% {
    transform: translateX(4px) rotate(1deg);
    filter: drop-shadow(0 0 0 rgb(255 255 255 / 0));
  }
  60%, 84% {
    transform: translateX(1px) rotate(0deg);
    filter: drop-shadow(0 0 0 rgb(255 255 255 / 0));
  }
  68%, 76% {
    transform: translateX(1px) rotate(0deg);
    filter: drop-shadow(0 0 3px rgb(240 248 255 / .6)) drop-shadow(0 0 7px rgb(220 237 255 / .18));
  }
  100% {
    transform: translateX(-3px) rotate(-2deg);
    filter: drop-shadow(0 0 0 rgb(255 255 255 / 0));
  }
}

@media (prefers-reduced-motion: reduce) {
  .reader-promo-remaining-number.is-empty { animation: none; }
  .reader-promo[data-reveal] .reader-promo-direction { animation: none; filter: none; transform: none; }
  .reader-promo[data-reveal] .reader-promo-anchor { opacity: 1; animation: none; }
  .reader-promo-button, .reader-promo-button:active { transition: none; transform: none; }
  .reader-promo-surface,
  .reader-promo[data-scratch="concealed"] .reader-promo-surface::before,
  .reader-promo[data-scratch="concealed"] .reader-promo-hint,
  .reader-promo-hint { transition: none; }
  .reader-promo-button::after { display: none; }
}
