:root {
  --bg-top: #ffd764;
  --bg-bottom: #fff4d8;
  --surface: rgba(255, 252, 244, 0.78);
  --surface-strong: #fffdf7;
  --text-main: #1e1a14;
  --text-soft: rgba(30, 26, 20, 0.72);
  --accent: #f2ba07;
  --accent-strong: #b88700;
  --shadow: 0 24px 70px rgba(91, 61, 0, 0.18);
  --ring: rgba(255, 255, 255, 0.7);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Avenir Next", "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.62), transparent 32%),
    radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.48), transparent 28%),
    linear-gradient(165deg, var(--bg-top), var(--bg-bottom));
  transition:
    background 240ms ease,
    color 240ms ease;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(8px);
}

body::before {
  top: 8%;
  right: -12%;
  width: 14rem;
  height: 14rem;
  background: rgba(255, 255, 255, 0.26);
}

body::after {
  left: -10%;
  bottom: 10%;
  width: 16rem;
  height: 16rem;
  background: rgba(255, 255, 255, 0.18);
}

body[data-theme="pink"] {
  --bg-top: #ff8db7;
  --bg-bottom: #ffe5f0;
  --accent: #f04f91;
  --accent-strong: #ab2662;
  --shadow: 0 24px 70px rgba(125, 24, 70, 0.2);
}

body[data-theme="purple"] {
  --bg-top: #8e7eff;
  --bg-bottom: #eee9ff;
  --accent: #6250de;
  --accent-strong: #3f30a8;
  --shadow: 0 24px 70px rgba(59, 42, 144, 0.2);
}

.app-shell {
  position: relative;
  width: min(100%, 34rem);
  margin: 0 auto;
  padding: calc(1.5rem + env(safe-area-inset-top)) 1rem calc(1.5rem + env(safe-area-inset-bottom));
  display: grid;
  gap: 1rem;
  min-height: 100vh;
}

.hero {
  padding: 0.5rem 0.25rem 0;
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 3.4rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.hero-copy {
  margin: 0.65rem 0 0;
  max-width: 28rem;
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--text-soft);
}

.hero-legend {
  margin: 0.35rem 0 0;
  max-width: 28rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: color-mix(in srgb, var(--text-soft) 94%, white 6%);
}

.deck-switcher {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.deck-button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.24);
  color: var(--text-main);
  border-radius: 1.25rem;
  padding: 0.85rem 0.75rem;
  text-align: left;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 25px rgba(65, 48, 20, 0.08);
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.deck-button:active {
  transform: scale(0.98);
}

.deck-button.is-active {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.95);
  transform: translateY(-2px);
}

.deck-label,
.deck-count {
  display: block;
}

.deck-label {
  font-size: 0.95rem;
  font-weight: 700;
}

.deck-count {
  margin-top: 0.22rem;
  font-size: 0.76rem;
  color: var(--text-soft);
}

.card-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 17rem;
}

.card-glow {
  position: absolute;
  inset: auto;
  width: 88%;
  height: 78%;
  background: color-mix(in srgb, var(--accent) 30%, white 70%);
  opacity: 0.55;
  border-radius: 2.5rem;
  filter: blur(30px);
  transform: translateY(12px);
}

.question-card {
  position: relative;
  width: 100%;
  min-height: 17rem;
  padding: 1.2rem 1.2rem 1.35rem;
  border-radius: 2rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.78)),
    var(--surface);
  border: 1px solid var(--ring);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  transition:
    transform 220ms ease,
    box-shadow 220ms ease;
}

.question-card.is-revealed {
  animation: card-pop 320ms ease;
}

.card-tag {
  margin: 0;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, white 72%);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-strong);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-question {
  margin: 0;
  flex: 1;
  display: flex;
  align-items: center;
  font-size: clamp(1.7rem, 7.5vw, 2.6rem);
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.control-panel {
  display: grid;
  gap: 0.8rem;
  padding-bottom: 0.35rem;
}

.page-footer {
  margin-top: 4rem;
  padding: 0.5rem 0 0.75rem;
}

.page-footer p {
  margin: 0;
  text-align: center;
  font-size: 0.76rem;
  line-height: 1.5;
  color: rgba(30, 26, 20, 0.5);
}

.status-hint {
  margin: 0;
}

.status-hint {
  min-height: 1.4rem;
  text-align: center;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--text-soft);
}

.status-hint.is-warning {
  color: #8a5400;
}

.status-hint.is-error {
  color: #9c184d;
}

.draw-button,
.reset-button {
  appearance: none;
  border: none;
  border-radius: 999px;
  font: inherit;
}

.draw-button {
  min-height: 3.7rem;
  padding: 0.95rem 1.2rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: white;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 72%, white 12%), var(--accent-strong));
  box-shadow:
    0 18px 28px color-mix(in srgb, var(--accent-strong) 28%, transparent),
    0 6px 0 color-mix(in srgb, var(--accent-strong) 75%, black 5%),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.draw-button:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow:
    0 10px 14px color-mix(in srgb, var(--accent-strong) 24%, transparent),
    0 2px 0 color-mix(in srgb, var(--accent-strong) 75%, black 5%),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.draw-button:disabled {
  opacity: 0.48;
}

.reset-button {
  justify-self: center;
  background: rgba(255, 255, 255, 0.38);
  color: color-mix(in srgb, var(--text-main) 74%, white 6%);
  border: 1px solid rgba(255, 255, 255, 0.52);
  padding: 0.62rem 1rem;
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: 0 8px 16px rgba(65, 48, 20, 0.08);
  backdrop-filter: blur(10px);
  transition:
    transform 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.reset-button:active {
  transform: translateY(1px);
  box-shadow: 0 4px 8px rgba(65, 48, 20, 0.08);
}

@keyframes card-pop {
  0% {
    opacity: 0.65;
    transform: translateY(10px) rotate(-1deg) scale(0.985);
  }

  100% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

@media (min-width: 48rem) {
  .app-shell {
    padding-inline: 1.5rem;
  }

  .question-card {
    min-height: 20rem;
    padding: 1.6rem;
  }
}
