:root {
  color-scheme: light;
  --paper: #fffaf0;
  --ink: #17212b;
  --muted: #5d6670;
  --teal: #3e8f8a;
  --coral: #df7058;
  --blue: #577fc2;
  --yellow: #f3c74f;
  --green: #4ea66b;
  --red: #d94f4f;
  --shadow: 0 18px 42px rgba(23, 33, 43, 0.15);
}

* {
  box-sizing: border-box;
}

[v-cloak] {
  display: none;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(62, 143, 138, 0.16), transparent 34%),
    linear-gradient(315deg, rgba(223, 112, 88, 0.16), transparent 38%),
    var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-rounded, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.app {
  min-height: 100%;
  width: min(100%, 460px);
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
}

.screen {
  width: 100%;
  min-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
}

.is-hidden {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 4px 14px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--teal);
  color: white;
  font-weight: 900;
  font-size: 1.25rem;
  box-shadow: var(--shadow);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 1.9rem;
  line-height: 1;
}

.brand p,
.screen-done p {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 650;
}

.theme-list {
  display: grid;
  gap: 12px;
  padding-top: 12px;
}

.theme-button {
  min-height: 106px;
  width: 100%;
  display: grid;
  grid-template-columns: 74px 1fr 46px;
  align-items: center;
  gap: 12px;
  border-radius: 24px;
  padding: 14px;
  background: white;
  box-shadow: 0 10px 28px rgba(23, 33, 43, 0.1);
  text-align: left;
}

.theme-icon {
  width: 74px;
  height: 74px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--topic-color) 16%, white);
  font-size: 2.2rem;
}

.theme-title {
  display: block;
  font-size: 1.12rem;
  font-weight: 900;
  line-height: 1.1;
}

.theme-count {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 750;
}

.theme-arrow {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--topic-color);
  color: white;
  font-size: 1.35rem;
  font-weight: 900;
}

.numbers-start-button {
  background: linear-gradient(135deg, rgba(243, 199, 79, 0.55), white 72%);
}

.numbers-start-button .theme-icon {
  background: #f3c74f;
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 950;
}

.topbar {
  min-height: 58px;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 12px;
  align-items: center;
  padding: 4px 0 12px;
}

.icon-button,
.round-button,
.wide-button {
  display: grid;
  place-items: center;
  touch-action: manipulation;
}

.icon-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 8px 20px rgba(23, 33, 43, 0.1);
  font-size: 1.35rem;
}

.progress {
  height: 16px;
  border-radius: 999px;
  background: rgba(23, 33, 43, 0.1);
  overflow: hidden;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--yellow), var(--coral));
  transition: width 220ms ease;
}

.counter {
  justify-self: center;
  font-size: 1rem;
  font-weight: 900;
  color: var(--muted);
}

.hero-card {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 10px 0 12px;
}

.hero-card img {
  width: min(100%, 78vh, 390px);
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 30px;
  background: white;
  box-shadow: var(--shadow);
  user-select: none;
}

.word-chip {
  min-height: 44px;
  align-self: center;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-weight: 850;
  font-size: 1.05rem;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 18px 4px 6px;
}

.round-button {
  height: 78px;
  border-radius: 28px;
  color: white;
  font-size: 2rem;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.round-button.primary {
  background: var(--coral);
}

.round-button.secondary {
  background: var(--blue);
}

.listen-orb {
  width: 112px;
  height: 112px;
  margin: 8px auto 10px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--yellow);
  box-shadow: var(--shadow);
  font-size: 3rem;
  transform-origin: center;
  color: var(--ink);
}

.listen-orb.is-playing {
  animation: pulse 780ms ease-in-out infinite;
}

.quiz-target-word {
  min-height: 44px;
  align-self: center;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(23, 33, 43, 0.08);
}

.number-target-word {
  min-height: 48px;
  align-self: center;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  padding: 9px 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(23, 33, 43, 0.08);
}

.result-banner {
  min-height: 42px;
  margin-bottom: 10px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 1.18rem;
  font-weight: 950;
  color: white;
  opacity: 0;
  transform: translateY(6px);
  transition: 180ms ease;
}

.result-banner.is-right {
  opacity: 1;
  transform: translateY(0);
  background: var(--green);
}

.result-banner.is-wrong {
  opacity: 1;
  transform: translateY(0);
  background: var(--red);
}

.number-option-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 12px;
}

.number-option-button {
  min-height: 138px;
  border-radius: 24px;
  background: white;
  box-shadow: 0 10px 26px rgba(23, 33, 43, 0.1);
  padding: 12px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
  align-items: center;
}

.number-digit {
  display: block;
  color: var(--ink);
  font-size: 2.9rem;
  font-weight: 950;
  line-height: 1;
}

.number-dots {
  width: min(100%, 120px);
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  align-content: center;
}

.number-dots span {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--teal);
}

.number-option-button.is-right {
  outline: 7px solid rgba(78, 166, 107, 0.72);
}

.number-option-button.is-wrong {
  outline: 7px solid rgba(217, 79, 79, 0.65);
}

.option-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 12px;
}

.option-button {
  min-height: 138px;
  border-radius: 24px;
  background: white;
  box-shadow: 0 10px 26px rgba(23, 33, 43, 0.1);
  overflow: hidden;
  padding: 7px;
}

.option-button img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 18px;
  pointer-events: none;
}

.option-button.is-right {
  outline: 7px solid rgba(78, 166, 107, 0.72);
}

.option-button.is-wrong {
  outline: 7px solid rgba(217, 79, 79, 0.65);
}

.screen-done {
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 18px;
}

.done-burst {
  width: 142px;
  height: 142px;
  display: grid;
  place-items: center;
  border-radius: 40px;
  background: var(--yellow);
  color: white;
  box-shadow: var(--shadow);
  font-size: 5rem;
  animation: pop 620ms cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

.screen-done h2 {
  font-size: 2.2rem;
}

.wide-button {
  width: min(100%, 320px);
  height: 64px;
  margin-top: 8px;
  border-radius: 22px;
  background: var(--teal);
  color: white;
  font-size: 1.2rem;
  font-weight: 900;
  box-shadow: var(--shadow);
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

@keyframes pop {
  from {
    transform: scale(0.6) rotate(-8deg);
    opacity: 0;
  }

  to {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

@media (max-height: 700px) {
  .hero-card img {
    width: min(100%, 62vh, 340px);
  }

  .round-button {
    height: 64px;
  }

  .listen-orb {
    width: 86px;
    height: 86px;
    font-size: 2.3rem;
  }

  .quiz-target-word {
    min-height: 36px;
    margin-bottom: 8px;
    font-size: 1.12rem;
  }

  .number-target-word {
    min-height: 38px;
    margin-bottom: 8px;
    font-size: 1.2rem;
  }

  .option-button {
    min-height: 112px;
  }

  .number-option-button {
    min-height: 112px;
  }

  .number-digit {
    font-size: 2.25rem;
  }

  .number-dots {
    gap: 4px;
  }
}
