.fd-card-design {
  /* The reference composition is 320px wide; cqw keeps every layer in scale. */
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  overflow: visible;
  container-type: inline-size;
  perspective: 375cqw;
  isolation: isolate;
}

.fd-card-design__flipper {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.fd-card-design__face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  color: #fff;
  backface-visibility: hidden;
}

.fd-card-design__front {
  user-select: none;
}

.fd-card-design .font-super-water {
  font-family: "Super Water", "Segoe UI", sans-serif;
  font-weight: 400;
  letter-spacing: 0;
}

@property --fd-card-progress-angle {
  syntax: "<angle>";
  inherits: true;
  initial-value: 0deg;
}

.fd-card-design__back {
  overflow: hidden;
  transform: rotateY(180deg);
}

.fd-card-design__artwork {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.fd-card-design__tier-badge {
  position: absolute;
  z-index: 2;
  top: 4%;
  left: 6%;
  display: grid;
  width: 21.25cqw;
  height: 21.25cqw;
  place-items: center;
  border: 0.9375cqw solid #e7ffff;
  border-radius: 50%;
  color: #fff;
  font-size: 8.75cqw;
  line-height: 1;
  box-shadow: 0 0.625cqw 1.5625cqw rgb(16 89 104 / 35%);
}

.fd-card-design__group-image {
  position: absolute;
  z-index: 2;
  top: calc(4% + 2.625cqw);
  left: calc(6% + 23.125cqw - 2px);
  display: block;
  width: 16cqw;
  height: 16cqw;
  pointer-events: none;
  object-fit: contain;
  filter: drop-shadow(0 0.625cqw 1.25cqw rgb(16 89 104 / 28%));
}

.fd-card-design__copy-scale {
  position: absolute;
  inset: 0;
  transform: scale(var(--fd-card-content-scale, 1));
  transform-origin: 50% 50%;
}

.fd-card-design__term,
.fd-card-design__translation {
  position: absolute;
  left: 50%;
  width: 68%;
  overflow: visible;
  margin: 0;
  transform: translateX(-50%);
  text-align: center;
  font-family: var(--font-manrope, Manrope, "Segoe UI", sans-serif);
}

.fd-card-design__term {
  top: calc(30% - 14.0625cqw);
  color: #102d49;
  font-size: 15cqw;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.01em;
}

.fd-card-design__translation {
  top: calc(42.5% - 14.0625cqw);
  color: #173653;
  font-size: 9.1cqw;
  font-weight: 600;
  line-height: 1.2;
}

.fd-card-design [data-single-line-fit-container] {
  display: block;
  width: 100%;
  overflow-x: clip;
  overflow-y: visible;
  text-align: center;
}

.fd-card-design [data-single-line-fit-content] {
  display: inline-block;
  transform-origin: center;
  white-space: nowrap;
}

.fd-card-design [data-single-line-fit-container][data-single-line-fit-centered] {
  position: relative;
  display: block;
  height: 1.2em;
  text-align: left;
}

.fd-card-design [data-single-line-fit-centered] > [data-single-line-fit-content] {
  position: absolute;
  top: 0;
  left: 50%;
  width: max-content;
}

.fd-card-design__pronunciation {
  position: absolute;
  top: calc(49% - 4px);
  left: 50%;
  display: flex;
  width: fit-content;
  max-width: 72%;
  height: 9.5%;
  min-height: 9.5cqw;
  align-items: center;
  justify-content: center;
  gap: 2.2cqw;
  overflow: hidden;
  padding: 0 2.8cqw;
  transform: translateX(-50%);
  border-radius: 999px;
  color: #fff;
  font-size: 6.8cqw;
  font-weight: 600;
  line-height: 1;
  box-shadow: inset 0 0.3125cqw 0.3125cqw rgb(255 255 255 / 30%);
}

.fd-card-design__pronunciation[data-pronunciation-matches-translation="true"] {
  height: calc(9.5% + 2px);
  min-height: calc(9.5cqw + 2px);
}

.fd-card-design__pronunciation--speaking {
  animation: fd-card-pronunciation-wiggle 280ms ease-in-out infinite alternate;
  transform-origin: center;
  will-change: transform;
}

@keyframes fd-card-pronunciation-wiggle {
  from { transform: translateX(-50%) rotate(-4deg); }
  to { transform: translateX(-50%) rotate(4deg); }
}

.fd-card-design__speak {
  display: inline-flex;
  width: 7.5cqw;
  height: 7.5cqw;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: rgb(255 255 255 / 90%);
  background: transparent;
  cursor: pointer;
}

.fd-card-design__speak:hover { color: #fff; }
.fd-card-design__speak:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.fd-card-design__speaker-icon {
  width: 6cqw;
  height: 6cqw;
  fill: currentColor;
}

.fd-card-design__pronunciation[data-pronunciation-matches-translation="true"] .fd-card-design__speaker-icon {
  width: 7.5cqw;
  height: 7.5cqw;
}

.fd-card-design__speaker-icon path:not(:first-child) { fill: none; }

.fd-card-design__pronunciation-text {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.fd-card-design__divider {
  position: absolute;
  top: 60%;
  left: 16%;
  width: 68%;
  height: 0.3125cqw;
  background: #b6a984;
}

.fd-card-design__progress {
  position: absolute;
  z-index: 2;
  top: 4%;
  right: 6%;
  display: grid;
  width: 21.25cqw;
  height: 21.25cqw;
  place-items: center;
  overflow: hidden;
  border: 0.9375cqw solid #e7ffff;
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 0.625cqw 1.5625cqw rgb(16 89 104 / 35%);
}

.fd-card-design__progress-circle {
  background-color: color-mix(in srgb, var(--fd-card-progress-filled-color) 34%, white);
}

.fd-card-design__learned-medal {
  position: absolute;
  z-index: 2;
  top: 4%;
  right: 6%;
  display: block;
  width: 21.25cqw;
  height: 21.25cqw;
  pointer-events: none;
  overflow: visible;
  opacity: 1;
  visibility: visible;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  object-fit: contain;
  box-shadow: none;
}

.fd-card-design__progress-indicator {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(
    from -90deg,
    var(--fd-card-progress-filled-color) 0deg var(--fd-card-progress-angle),
    transparent var(--fd-card-progress-angle) 360deg
  );
  transition: --fd-card-progress-angle 300ms ease;
}

.fd-card-design__progress-slice-dividers {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: repeating-conic-gradient(
    from -90deg,
    transparent 0deg calc(var(--fd-card-progress-slice-angle) - 6deg),
    #fff calc(var(--fd-card-progress-slice-angle) - 6deg),
    #fff var(--fd-card-progress-slice-angle)
  );
  pointer-events: none;
}

.fd-card-design__progress-indicator--animating {
  transition-duration: 900ms;
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

.fd-card-design__progress-indicator-overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(
    from -90deg,
    var(--fd-card-progress-animation-start, #ffe34a) 0deg,
    var(--fd-card-progress-animation-middle, #ffae00) calc(var(--fd-card-progress-angle) * 0.55),
    var(--fd-card-progress-animation-end, #ff6a00) var(--fd-card-progress-angle),
    transparent var(--fd-card-progress-angle) 360deg
  );
  opacity: 0;
  pointer-events: none;
}

@keyframes fd-card-progress-complete-pulse {
  0%,
  100% {
    transform: scale(1);
  }

  42% {
    transform: scale(1.26);
  }
}

.fd-card-design__progress[data-progress-complete="true"] {
  animation: fd-card-progress-complete-pulse 460ms cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-origin: center;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .fd-card-design__pronunciation--speaking {
    animation: none;
  }

  .fd-card-design__progress[data-progress-complete="true"] {
    animation: none;
  }
}

.fd-card-design__progress-count {
  position: relative;
  z-index: 1;
  font-size: 5.25cqw;
  font-family: "Super Water", "Segoe UI", sans-serif;
  line-height: 1;
  white-space: nowrap;
}

.fd-card-design__front-fox {
  position: absolute;
  z-index: 0;
  top: 80%;
  left: 50%;
  width: 20%;
  height: 11%;
  transform: translate(-50%, -2.8125cqw);
}

.fd-card-design__front[data-example-line-count="3"] .fd-card-design__front-fox {
  display: none;
}

.fd-card-design__example {
  position: absolute;
  z-index: 1;
  top: 64.5%;
  right: 16%;
  left: 16%;
  margin: 0;
  color: #173653;
  font-family: var(--font-manrope, Manrope, "Segoe UI", sans-serif);
  font-size: calc(6.8cqw * var(--fd-card-example-font-scale, 1));
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  white-space: pre-line;
  max-height: calc(3 * 1.35em);
  overflow: hidden;
  overflow-wrap: anywhere;
}

.fd-card-design__example[data-example-breaks-collapsed] {
  white-space: normal;
}

.fd-card-design__back-content {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5%;
  font-family: var(--font-manrope, Manrope, "Segoe UI", sans-serif);
}

.fd-card-design__back-tier-circle {
  position: relative;
  display: grid;
  width: 34%;
  min-width: 17.5cqw;
  aspect-ratio: 1;
  place-items: center;
  border: 0.9375cqw solid rgb(255 255 255 / 95%);
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 0.625cqw 1.5625cqw rgb(15 45 57 / 22%), inset 0 0.3125cqw 0.625cqw rgb(255 255 255 / 22%);
}

.fd-card-design__back-tier-text {
  position: relative;
  top: 2.1875cqw;
  color: #fff;
  font-size: 13cqw;
  font-weight: 700;
  line-height: 1;
  filter: drop-shadow(0 0.3125cqw 0.625cqw rgb(31 61 77 / 25%));
}

.fd-card-design__back-fox {
  position: absolute;
  z-index: 1;
  bottom: 6%;
  left: 50%;
  width: 28%;
  height: 15.5%;
  transform: translate(-50%, -4.375cqw);
}

@media (prefers-reduced-motion: reduce) {
  .fd-card-design__flipper { transition: none; }
}
