html, body { min-height: 100%; }
body {
  background:
    radial-gradient(640px 460px at 50% -12%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 68%),
    radial-gradient(520px 460px at 90% 108%, color-mix(in srgb, var(--pink) 16%, transparent), transparent 64%),
    var(--bg);
}

.wrap {
  min-height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.v-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 2px 16px;
}
.ev-logo {
  height: 74px;
  width: auto;
  max-width: 86%;
  object-fit: contain;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.45));
}
.ev-logo[hidden] { display: none; }
.ev-title {
  font-weight: 800;
  font-size: 1rem;
  color: var(--accent);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qnum-sm {
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.qnum-sm[hidden] { display: none; }

.topic-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 0 auto 8px;
  padding: 10px 22px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 14%, var(--card));
  border: 1.5px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  text-align: center;
}
.topic-chip .topic-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 800;
}
.topic-chip #topic-text { font-size: 1.15rem; font-weight: 900; color: #fff; }

.panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  animation: fade 300ms ease;
}
.panel[hidden] { display: none; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }

.panel h1 { font-size: 1.6rem; font-weight: 900; margin: 0; line-height: 1.2; }
.emoji { font-size: 3.4rem; line-height: 1; }
.muted { color: var(--text-dim); margin: 0; }
.muted.sm { font-size: 0.85rem; margin-top: 8px; }
.prompt { font-size: 1.5rem; }

.options {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
.opt-btn {
  width: 100%;
  border: none;
  border-radius: var(--radius);
  padding: 30px 20px;
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  transition: transform 120ms ease, filter 120ms ease, opacity 120ms ease;
  min-height: 96px;
  touch-action: manipulation;
}
.opt-btn:active { transform: scale(0.97); filter: brightness(1.1); }
.opt-btn:disabled { opacity: 0.55; }
.opt-btn.dim { opacity: 0.28; }

.choice-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.3rem;
  color: #fff;
  padding: 14px 26px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.spinner-dots { display: flex; gap: 8px; margin-top: 6px; }
.spinner-dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--text-dim);
  animation: bounce 1.2s ease-in-out infinite;
}
.spinner-dots span:nth-child(2) { animation-delay: 0.15s; }
.spinner-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%, 100% { transform: translateY(0); opacity: 0.4; } 50% { transform: translateY(-8px); opacity: 1; } }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--danger);
  color: #fff;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 50;
  max-width: 90vw;
  text-align: center;
}
.toast[hidden] { display: none; }
