.ticket-wrapper {
  perspective: 1200px; /* глубина для 3D */
  width: 100%;
  height: 150px;
  display: inline-block;
}

.ticket {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d; /* важно для 3D */
  transition: transform 0.8s cubic-bezier(0.68,-0.55,0.27,1.55);
  cursor: pointer;
    border-radius: 1rem;
}

.ticket.flipped {
  transform: rotateY(180deg);
}

/* обе стороны */
.ticket-front,
.ticket-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  backface-visibility: hidden;   /* 👈 теперь действительно скрывает невидимую сторону */
  -webkit-backface-visibility: hidden; /* для Safari */
  box-shadow: 0 6px 15px rgba(0,0,0,0.25);
}

/* лицевая */
.ticket-front {
  background: #f8f85a;
  padding: 20px 40px 20px 80px;
  font-family: Arial, sans-serif;
  color: #222;
  transform: rotateY(0deg);
  z-index: 2;
}

/* обратная */
.ticket-back {
    background: #222;
    color: #f8f85a;
    font-family: Arial, sans-serif;
    font-size: 14px;
    padding: 2em;
    padding-right: 30%;
    transform: rotateY(180deg);
    display: flex
;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    align-content: stretch;
    flex-wrap: wrap;
    flex-direction: row;
}

.ticket-back h3 {
  text-transform: uppercase;
    color: white;
    font-size:1.1em;
}

/* корешок */
.ticket-spine {
  font-family: cygre;
    position: absolute;
    top: 100%;
    left: 4%;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: left top;
    font-weight: bold;
    font-size: 25px;
    letter-spacing: 2px;
    color: #6b6b6b;
    filter: hue-rotate(45deg);
}



/* "дырки" слева */
.ticket::before {

    content: "";
    position: absolute;
    top: 6px;
    left: 20%;
    width: 32px;
    height: calc(100% - 12px);
    background-image: radial-gradient(circle at center, #ffffff 7px, rgb(0 0 0 / 6%) 10px, #00000000 10px);
    background-repeat: repeat-y;
    background-size: 27px 23px;
    z-index: 4;
}


.ticket-element {

}
.ticket-text {
    color: var(--gray);
    padding-right: 1em;
    width: 50%;
    display: inline-block;
    text-align: right;
}
.ticket-value {
    font-weight: 900;
    font-size: 1.3em;
    text-shadow: 3px 3px 4px #f8f8f8;
    display: inline-block;
    position: relative;
}


.ticket-front.first {
  background:rgb(216, 255, 138)0; /* жёлтый фон */
}

.ticket-front.last {
      background: rgb(173 240 255) 0;
} 

.first.black {
  background: #2b2b2b;
}


.ticket-back::before {
    backdrop-filter: brightness(0.5);
    content: " ";
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    /* margin-bottom: -50%; */
    z-index: -1;
}