.hero-visual-aw {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(100%, 520px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-self: center;
}

.section-hero-with-widget {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: clamp(32px, 7vw, 112px);
  align-items: center;
}

.section-hero-copy {
  min-width: 0;
}

.section-hero-widget {
  width: min(100%, 520px);
}

.widget-wrapper,
#btn-show-answer,
#eval-controls,
#scheduler-info {
  width: 100%;
}

.widget-card-container {
  perspective: 1000px;
  width: 100%;
  height: auto;
  aspect-ratio: 1.28;
  cursor: pointer;
  position: relative;
}

.widget-card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.widget-card.is-flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border: 1px solid rgba(218, 242, 226, 0.12);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(18, 35, 27, 0.86), rgba(8, 16, 12, 0.9));
  padding: clamp(28px, 2.4vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 28px 80px rgba(0, 0, 0, 0.44);
}

.card-face.front {
  background: linear-gradient(135deg, #16221c 0%, #0c120f 100%);
  border-left: 5px solid var(--green);
}

.card-face.back {
  background: linear-gradient(135deg, #0c120f 0%, #16221c 100%);
  transform: rotateY(180deg);
  border-right: 4px solid var(--green);
}

.card-face h4 {
  margin: 0;
  color: var(--green);
  font-size: clamp(12px, 1vw, 20px);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.card-face p.question,
.card-face p.answer {
  flex-grow: 1;
  margin: 12px 0 0;
  color: #ffffff;
  font-size: clamp(20px, 1.6vw, 32px);
  font-weight: 800;
  line-height: 1.5;
}

.card-face p.answer {
  color: #c9ded1;
}

.card-footer-tip,
#scheduler-info {
  color: rgba(196, 209, 201, 0.62);
}

.card-footer-tip {
  font-size: 11px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 10px;
}

.widget-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

#btn-show-answer {
  margin-top: 12px;
  min-height: clamp(54px, 4.7vw, 72px);
}

#eval-controls {
  display: none;
  gap: 6px;
  margin-top: 12px;
}

#eval-controls button {
  flex: 1;
  padding: 10px 0;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #19241f;
  color: #ffffff;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

#eval-controls button span {
  font-size: 9px;
  opacity: 0.6;
}

#eval-controls button:hover {
  transform: translateY(-2px);
}

#eval-controls button.btn-again:hover {
  background: #c84f3a;
  border-color: transparent;
  color: white;
}

#eval-controls button.btn-hard:hover {
  background: #b46d20;
  border-color: transparent;
  color: white;
}

#eval-controls button.btn-good:hover {
  background: #2f6f4e;
  border-color: transparent;
  color: white;
}

#eval-controls button.btn-easy:hover {
  background: #245d8f;
  border-color: transparent;
  color: white;
}

#scheduler-info {
  font-size: 11px;
}

#scheduler-info .badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

#scheduler-info .badge.new { background: rgba(58, 211, 113, 0.12); color: var(--green); }
#scheduler-info .badge.learning { background: rgba(200, 79, 58, 0.12); color: var(--coral); }
#scheduler-info .badge.review { background: rgba(36, 93, 143, 0.12); color: #4fa0ea; }

.fly-interval-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  background: var(--green);
  color: #0b0f0d;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: 30px;
  box-shadow: 0 10px 30px rgba(58, 211, 113, 0.6);
  pointer-events: none;
  font-size: 16px;
  opacity: 0;
  z-index: 10;
  transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fly-interval-label.fly {
  animation: flyUp 0.8s ease forwards;
}

@keyframes flyUp {
  0% { transform: translate(-50%, -20%) scale(0.6); opacity: 0; }
  30% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
  100% { transform: translate(-50%, -100%) scale(1); opacity: 0; }
}

.confetti-spark {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 99;
}

@media (max-width: 960px) {
  .hero-visual-aw {
    width: min(100%, 520px);
    justify-self: start;
    margin-top: 0;
  }

  .section-hero-with-widget {
    grid-template-columns: 1fr;
  }

  .section-hero-widget {
    justify-self: start;
  }
}

@media (max-width: 520px) {
  .hero-visual-aw {
    width: 100%;
  }

  .widget-wrapper {
    gap: 12px;
  }

  .widget-card-container {
    aspect-ratio: 1.52;
  }

  .card-face {
    border-radius: 16px;
    padding: 20px;
  }

  .card-face h4 {
    font-size: 10px;
  }

  .card-face p.question,
  .card-face p.answer {
    font-size: clamp(15px, 4.7vw, 19px);
    line-height: 1.45;
  }

  .card-footer-tip {
    font-size: 10px;
  }

  #btn-show-answer {
    min-height: 48px;
  }

  #scheduler-info {
    font-size: 10px;
  }
}
