* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  font-family: Inter, ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
  color: #1f2937;
  background: #fff7e8;
}

html, body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,.95), transparent 35%),
    linear-gradient(180deg, #fff7e8 0%, #f7fbff 100%);
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
}

button {
  font: inherit;
}

.app-shell {
  width: min(100%, 480px);
  min-height: 100dvh;
  margin: 0 auto;
  padding:
    max(14px, env(safe-area-inset-top))
    18px
    max(12px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto auto auto minmax(190px, 1fr) auto auto;
  gap: clamp(10px, 1.6dvh, 18px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
}

.eyebrow {
  margin: 0 0 3px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  color: #7c3aed;
}

h1 {
  margin: 0;
  font-size: clamp(20px, 3.2dvh, 28px);
  line-height: 1;
}

.icon-btn {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 16px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 8px 24px rgba(31,41,55,.08);
  cursor: pointer;
  font-size: 20px;
}

.bank-card {
  min-height: 96px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(31,41,55,.09);
}

.coin {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ffd84d;
  border: 5px solid #f5b800;
  font-size: 31px;
  font-weight: 950;
  color: #7a4c00;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.6);
}

.bank-label,
.streak-box span {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #6b7280;
}

.balance {
  display: block;
  margin-top: 2px;
  font-size: clamp(30px, 5dvh, 42px);
  line-height: 1;
  color: #0f766e;
}

.streak-box {
  min-width: 64px;
  text-align: center;
  padding: 8px 10px;
  border-radius: 16px;
  background: #f5f3ff;
}

.streak-box strong {
  display: block;
  margin-top: 2px;
  color: #7c3aed;
  font-size: 24px;
}

.progress-wrap {
  padding: 0 2px;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 800;
  color: #4b5563;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31,41,55,.09);
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
  transition: width .35s ease;
}

.question-card {
  min-height: 190px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(31,41,55,.10);
  padding: clamp(16px, 2.5dvh, 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.question-number {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 900;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.question {
  text-align: center;
  font-size: clamp(46px, 9dvh, 72px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: -.04em;
  color: #111827;
}

.feedback {
  min-height: 28px;
  margin-top: 14px;
  font-size: clamp(16px, 2.4dvh, 20px);
  font-weight: 900;
  color: #6b7280;
}

.feedback.correct {
  color: #047857;
}

.feedback.wrong {
  color: #b91c1c;
}

.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.answer-btn {
  min-height: clamp(70px, 11dvh, 92px);
  border: 0;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(31,41,55,.09);
  color: #111827;
  font-size: clamp(30px, 5.5dvh, 44px);
  font-weight: 950;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
}

.answer-btn:active {
  transform: scale(.97);
}

.answer-btn.correct {
  background: #d1fae5;
  box-shadow: 0 0 0 4px #34d399 inset;
}

.answer-btn.wrong {
  background: #fee2e2;
  box-shadow: 0 0 0 4px #f87171 inset;
}

.answer-btn:disabled {
  cursor: default;
}

.footer {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
}

.level-up {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17,24,39,.48);
  backdrop-filter: blur(5px);
}

.level-up[hidden] {
  display: none;
}

.level-up-card {
  width: min(100%, 360px);
  border-radius: 30px;
  padding: 28px;
  text-align: center;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0,0,0,.22);
}

.celebrate {
  font-size: 64px;
}

.level-up-card h2 {
  margin: 8px 0;
  font-size: 36px;
}

.level-up-card p {
  margin: 0 0 22px;
  color: #6b7280;
  font-weight: 800;
}

.level-up-card button {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 18px;
  background: #7c3aed;
  color: white;
  font-size: 19px;
  font-weight: 900;
  cursor: pointer;
}

@media (max-height: 670px) {
  .app-shell {
    gap: 8px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .bank-card {
    min-height: 78px;
    padding: 10px 14px;
  }

  .coin {
    width: 48px;
    height: 48px;
    font-size: 25px;
    border-width: 4px;
  }

  .question-card {
    min-height: 150px;
  }

  .question {
    font-size: clamp(40px, 8dvh, 60px);
  }

  .answer-btn {
    min-height: 64px;
  }

  .footer {
    display: none;
  }
}
