/*@import url("https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;700;800&family=Fredoka:wght@500;700&display=swap");*/
@import url("https://fonts.googleapis.com/css2?family=Boldonse&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");

:root {
  --ink: #1f1d2b;
  --card: #ffffff;
  --line: rgba(31, 29, 43, 0.18);

  font-family: "Inter", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(
      circle at 20% 10%,
      rgba(255, 122, 136, 0.35),
      transparent 34%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(168, 219, 255, 0.4),
      transparent 38%
    ),
    radial-gradient(
      circle at 15% 85%,
      rgba(104, 255, 185, 0.27),
      transparent 36%
    ),
    linear-gradient(135deg, #fff4db, #f6f3ff 55%, #effcff);
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: "Boldonse", cursive;
  font-weight: 800;
}

.quiz-shell {
  min-height: 100vh;
  padding: 1rem 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
}

.header {
  border-radius: 22px;
  padding: 0.8rem 1rem;
  backdrop-filter: blur(6px);
  text-align: center;
}

.header h1 {
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
}

.stats {
  margin-top: 6px;
  display: flex;
  gap: 18px;
  font-size: 1rem;
  justify-content: center;
}

.progress {
  margin-top: 10px;
  height: 14px;
  width: min(90vw, 320px);
  border-radius: 999px;
  overflow: hidden;
  border: 3px solid black;
  background: rgba(255, 255, 255, 0.8);
}

.progress-bar {
  height: 100%;
  border-radius: 0;
  background-color: black;
  /*background: linear-gradient(90deg, #38dd88, #29b8ff);*/
  transition: width 0.32s ease;
}

.card-wrap {
  position: relative;
  height: min(60vh, 500px);
  max-height: min(60vh, 500px);
  min-height: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.item-card {
  width: min(86vw, 460px);
  height: 100% !important;
  border-radius: 0.5rem;
  border: 3px solid black;
  box-shadow: 0 20px 45px rgba(31, 29, 43, 0.22);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: grab;

  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: stretch;
}

.item-card .item-caption {
  width: calc(100% + 1rem);
  background: var(--card);
  border-radius: 0.5rem;
  border-top-right-radius: 0;
  border-top-left-radius: 0;
margin:-.5rem;
  margin-top: 0;
  border: 3px solid black;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  font-family: "Boldonse", cursive;
  font-size: 1.5rem;
}

.item-card:active {
  cursor: grabbing;
}

.item-card .attribution {
  text-align: end;
  font-weight: bold;
  font-size: 0.8rem;
  margin: 0.5rem;
  color: rgba(31, 29, 43, 0.9);
}

.item-card .attribution:hover {
  text-decoration: underline;
}


.btn_fancy {
  border: 2px solid rgba(31, 29, 43, 0.32);
  background: linear-gradient(135deg, #ffe39c, #8bffd6);
  color: var(--ink);
  font-family: "Boldonse", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
}

.bottom-info {
  text-align: center;
  font-size: 1rem;
  padding: 0 3rem;
  color: rgba(31, 29, 43, 0.85);
}

.result-ratio {
  font-size: 1.35rem;
  font-family: "Baloo 2", cursive;
}

@media (max-width: 820px) {
  .label-side {
    display: none;
  }
  .card-wrap {
    height: min(70vh, 540px);
  }

  .item-card {
    width: min(92vw, 440px);
    height: min(72vh, 540px);
  }
}

.feedback {
  max-width: 25rem;
  padding: 0 3rem;
  text-align: center;
}

.feedback h3 {
  font-size: clamp(1.8rem, 5vw, 2.3rem);
}

.correct-word {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.04em;
  letter-spacing: 0.05em;
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1;
}

.correct-letter {
  display: inline-block;
  transform-origin: 50% 100%;
  animation: correct-wave 0.8s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.08s);
}

.correct-message {
  margin: 10px 0 0;
  font-size: 1.1rem;
}

@keyframes correct-wave {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  25% {
    transform: translateY(-10px) rotate(-6deg);
  }

  50% {
    transform: translateY(0) rotate(0deg);
  }

  75% {
    transform: translateY(-6px) rotate(6deg);
  }
}

a {
  text-decoration: underline;
  color: black;
}

.result-card {
  align-self: center;
  justify-self: center;
  width: min(92vw, 520px);
  background: rgba(255, 255, 255, 0.84);
  border: 3px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 18px 36px rgba(31, 29, 43, 0.16);
  padding: 28px;
  text-align: center;
}

.result-card h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
}

.fancy-score {
  font-size: 3rem;
  font-family: "Boldonse", cursive;
  color: #1a804c;
}

.quiz-container {
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: center;
  padding-bottom: 2rem;
  gap: 1rem;
}

.swipe-hint {
  z-index: 10;
  position: fixed;
  top: 50vh;
  min-height: 10rem;
  border-radius: 0.5rem;
  background: white;
  border: 3px solid black;
  padding: 0.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  gap: 0.5rem;
  font-size: 1rem;
  text-transform: uppercase;
  transform: translateY(-50%);
}

.swipe-hint.left {
  left: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: none;
}

.swipe-hint.right {
  right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}

.swipe-hint .swipe-name {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.75rem;
  font-weight: bold;
}
