/* The tile of the role-play stories in the lobby (template/espace/lobby.php, docs/JEUX_DE_ROLE.md, lot 5, the board
   « Le salon, piste B »): the poster of their shelf in smaller (static/css/space-stories.css draws the big one). The
   roadside of « L'auto-stop » that lives (template/espace/partials/histoire-art.php, bord-de-route), the title by hand
   in neon, « Nouveau », the trailer in a bubble, the button on its cream sheet. Nothing moves while it is off screen
   (« is-playing », static/js/espace/lobby-now.js), nor with reduced motion (the first line of the trailer stays). */

.lc-scard {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 28px -4px 0;
  overflow: hidden;
  border-radius: 26px;
  background: #5a2160;
  box-shadow: 0 6px 0 rgba(51, 11, 134, .45), 0 22px 40px rgba(51, 11, 134, .3);
  color: #ffffff;
  text-decoration: none;
  isolation: isolate;
  transition: transform .12s ease, box-shadow .12s ease;
}

.lc-scard:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 rgba(51, 11, 134, .45), 0 14px 30px rgba(51, 11, 134, .3);
}

.lc-scard:focus-visible {
  outline: 3px solid #ffd6e4;
  outline-offset: 3px;
}

/* The decor, under a veil that turns to plum. */
.lc-scard__art {
  position: relative;
  display: block;
  flex: none;
  height: 298px;
  overflow: hidden;
  background: #702a71;
}

.lc-scard__decor {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.lc-scard__veil {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 56%;
  background: linear-gradient(180deg, rgba(112, 42, 113, .94) 0%, rgba(176, 18, 138, .6) 48%, rgba(176, 18, 138, 0) 100%);
}

/* « Nouveau », the title by hand in neon, its line. */
.lc-scard__head {
  position: absolute;
  top: 16px;
  right: 16px;
  left: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  pointer-events: none;
}

.lc-scard__new {
  padding: 3px 10px;
  border-radius: 999px;
  background: #fe5759;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: .1em;
  line-height: 1.35;
  text-transform: uppercase;
}

.lc-scard__name {
  position: relative;
  margin-top: 1px;
  color: #fff3f8;
  font-family: "Caveat", "Bradley Hand", "Segoe Print", cursive;
  font-size: 50px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 0 4px #ffffff, 0 0 12px #f460b7, 0 0 28px #f460b7;
  transform: rotate(-4deg);
  transform-origin: 0 100%;
}

/* Its glow breathes: a second writing of the title, laid over it, whose light comes and goes. */
.lc-scard__name::after {
  content: attr(data-glow);
  content: attr(data-glow) / "";
  position: absolute;
  inset: 0;
  color: transparent;
  text-shadow: 0 0 10px #ffffff, 0 0 26px #f460b7, 0 0 50px #f460b7;
  opacity: 0;
}

.lc-scard.is-playing .lc-scard__name::after {
  animation: lc-scard-glow 3.2s ease-in-out infinite;
}

@keyframes lc-scard-glow {
  50% { opacity: .9; }
}

.lc-scard__hook {
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.35;
}

/* The trailer: three lines by hand in a bubble over the car, one every four seconds. The sign of the hitchhiker stays
   in sight: it stands past three fifths of the tile. */
.lc-scard__line {
  position: absolute;
  bottom: calc(30% + 10px);
  left: 16px;
  max-width: calc(61% - 26px);
  padding: 7px 14px 9px;
  border-radius: 18px 18px 18px 4px;
  background: #fbf8ef;
  box-shadow: 0 8px 18px rgba(74, 14, 46, .3);
  color: #a50c3a;
  font-family: "Caveat", "Bradley Hand", "Segoe Print", cursive;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.05;
  opacity: 0;
}

.lc-scard__line.is-first {
  opacity: 1;
}

.lc-scard.is-playing .lc-scard__line {
  animation: lc-scard-line 12s ease infinite both;
}

@keyframes lc-scard-line {
  0% { opacity: 0; transform: translateY(8px) scale(.92); }
  3%, 29% { opacity: 1; transform: none; }
  33%, 100% { opacity: 0; transform: translateY(-6px); }
}

/* A phone under 360 pixels: a smaller title and a smaller bubble, whose lines stay two, under the line of the tile. */
@media (max-width: 359px) {
  .lc-scard__name {
    font-size: 46px;
  }

  .lc-scard__line {
    max-width: calc(64% - 22px);
    padding: 6px 12px 8px;
    font-size: 20px;
  }
}

/* The cream sheet over the foot of the decor, its button crossed by a light now and then. */
.lc-scard__foot {
  position: relative;
  z-index: 1;
  display: flex;
  margin-top: -26px;
  padding: 12px 16px 14px;
  border-radius: 24px 24px 0 0;
  background: #fbf8ef;
}

.lc-scard__go {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 50px;
  overflow: hidden;
  border-radius: 999px;
  background: #c4285b;
  box-shadow: 0 8px 18px rgba(165, 12, 58, .3);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.lc-scard__go > span:last-child {
  position: relative;
}

.lc-scard__sheen {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 22%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .38) 50%, rgba(255, 255, 255, 0) 100%);
  transform: translateX(-160%) skewX(-20deg);
}

.lc-scard.is-playing .lc-scard__sheen {
  animation: lc-scard-sheen 4.6s ease-in-out infinite;
}

@keyframes lc-scard-sheen {
  0% { transform: translateX(-160%) skewX(-20deg); }
  22%, 100% { transform: translateX(520%) skewX(-20deg); }
}

/* The decor that lives, as on the poster of the shelf: the halo of the sun, two clouds, the poppies, the car with its
   engine running, the sign that sways, and, in time with the trailer, the plane and the snail. */
.lc-scard.is-playing .st-fx-sun {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: lc-scard-sun 4s ease-in-out infinite;
}

@keyframes lc-scard-sun {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(1.2); }
}

.lc-scard.is-playing .st-fx-cloud {
  animation: lc-scard-cloud 46s linear -14s infinite;
}

.lc-scard.is-playing .st-fx-cloud--2 {
  animation-duration: 64s;
  animation-delay: -40s;
}

@keyframes lc-scard-cloud {
  from { transform: translateX(-360px); }
  to { transform: translateX(720px); }
}

.lc-scard.is-playing .st-fx-poppy {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: lc-scard-poppy 2.8s ease-in-out infinite;
}

.lc-scard.is-playing .st-fx-poppy--2 {
  animation-duration: 3.3s;
  animation-delay: -1s;
}

.lc-scard.is-playing .st-fx-poppy--3 {
  animation-duration: 3s;
  animation-delay: -2s;
}

.lc-scard.is-playing .st-fx-poppy--4 {
  animation-duration: 2.6s;
  animation-delay: -.6s;
}

@keyframes lc-scard-poppy {
  0%, 100% { transform: rotate(-7deg); }
  50% { transform: rotate(7deg); }
}

.lc-scard.is-playing .st-fx-car {
  animation: lc-scard-idle 1.3s ease-in-out infinite;
}

@keyframes lc-scard-idle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.8px); }
}

.lc-scard.is-playing .st-fx-thumb {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: lc-scard-sway 3.2s ease-in-out infinite;
}

@keyframes lc-scard-sway {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

.lc-scard.is-playing .st-fx-plane {
  animation: lc-scard-plane 12s linear infinite;
}

@keyframes lc-scard-plane {
  0%, 30% { transform: translate(-300px, 8px); }
  68%, 100% { transform: translate(340px, -12px); }
}

.lc-scard.is-playing .st-fx-snail {
  animation: lc-scard-snail 12s linear infinite;
}

@keyframes lc-scard-snail {
  from { transform: translate(-297px, 22px); }
  to { transform: translate(153px, -12px); }
}

/* Japanese: the title and the trailer in the font of the site, bold and smaller (Caveat does not have its letters), as on
   the poster of the shelf (static/css/space-stories.css). */
.lc-scard:lang(ja) .lc-scard__name {
  font-family: inherit;
  font-size: 32px;
  font-weight: 900;
  line-height: 1.15;
}

.lc-scard:lang(ja) .lc-scard__line {
  padding: 8px 13px 9px;
  word-break: keep-all;
  overflow-wrap: anywhere;
  font-family: inherit;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
}

@media (prefers-reduced-motion: reduce) {
  .lc-scard,
  .lc-scard.is-playing [class*="st-fx-"],
  .lc-scard.is-playing .lc-scard__name::after,
  .lc-scard.is-playing .lc-scard__line,
  .lc-scard.is-playing .lc-scard__sheen {
    animation: none;
    transition: none;
  }
}
