:root {
  color: #f8fafc;
  background: #09090b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(135deg, rgba(34, 197, 94, .16), transparent 28%),
    linear-gradient(225deg, rgba(244, 63, 94, .18), transparent 32%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 1px, transparent 1px 48px),
    #09090b;
}

button {
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

a {
  color: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.shell {
  width: min(100%, 520px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.home-shell,
.quiz-shell,
.result-shell {
  display: grid;
  align-items: center;
}

.hero-panel,
.quiz-card,
.poster {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(13, 14, 18, .86);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .42);
}

.hero-panel {
  min-height: calc(100svh - 48px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px 22px;
}

.hero-panel::before,
.quiz-card::before,
.poster::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px) 0 0 / 22px 22px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.72), transparent 82%);
}

.kicker,
.quiz-topline,
.poster-top {
  position: relative;
  z-index: 1;
  color: #bef264;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-panel h1 {
  position: relative;
  z-index: 1;
  max-width: 9em;
  margin: 18px 0 14px;
  font-size: clamp(48px, 16vw, 82px);
  line-height: .92;
  letter-spacing: 0;
}

.lead {
  position: relative;
  z-index: 1;
  max-width: 24em;
  margin: 0 0 30px;
  color: #d1d5db;
  font-size: 18px;
  line-height: 1.55;
}

.primary-button,
.ghost-button,
.option-button {
  position: relative;
  z-index: 1;
  border-radius: 8px;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.primary-button {
  width: 100%;
  min-height: 58px;
  padding: 16px 18px;
  background: #bef264;
  color: #111827;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 12px 0 #365314;
}

.portal-link {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: center;
  margin-top: 16px;
  padding: 13px 14px;
  border: 1px solid rgba(190, 242, 100, .36);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(190,242,100,.14), rgba(56,189,248,.1)),
    rgba(255,255,255,.06);
  text-decoration: none;
}

.portal-link b {
  grid-row: span 2;
  display: grid;
  min-width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  background: #38bdf8;
  color: #020617;
  font-size: 12px;
  font-weight: 950;
}

.portal-link span {
  color: #f8fafc;
  font-size: 16px;
  font-weight: 950;
}

.portal-link small {
  color: #d1d5db;
  font-size: 12px;
  font-weight: 800;
}

.primary-button:active,
.option-button:active {
  transform: translateY(2px);
}

.mini-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 28px;
}

.mini-stats span {
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  color: #fef08a;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.quiz-card {
  min-height: calc(100svh - 48px);
  padding: 22px 16px;
}

.quiz-topline,
.poster-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.progress {
  position: relative;
  z-index: 1;
  height: 8px;
  margin: 16px 0 24px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #bef264, #fef08a, #fb7185);
}

.quiz-card h2 {
  position: relative;
  z-index: 1;
  min-height: 4.7em;
  margin: 0 0 22px;
  font-size: clamp(24px, 7vw, 34px);
  line-height: 1.18;
  letter-spacing: 0;
}

.options {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
}

.option-button {
  min-height: 72px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .13);
  background: rgba(255, 255, 255, .07);
  color: #f8fafc;
  text-align: left;
  font-size: 15px;
  line-height: 1.38;
}

.option-button span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f43f5e;
  color: #fff;
  font-weight: 900;
}

.option-button:hover {
  border-color: rgba(190, 242, 100, .72);
  background: rgba(190, 242, 100, .1);
}

.quiz-footer {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.ghost-button {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  color: #e5e7eb;
  font-size: 14px;
  font-weight: 800;
}

.poster {
  width: 100%;
  min-height: calc(100svh - 118px);
  padding: 16px 16px 18px;
  background:
    linear-gradient(160deg, rgba(190, 242, 100, .18), transparent 34%),
    linear-gradient(20deg, rgba(251, 113, 133, .16), transparent 42%),
    #0c0d11;
}

.avatar-wrap {
  position: relative;
  z-index: 1;
  width: min(76vw, 330px);
  margin: 6px auto -6px;
}

.avatar-svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 28px 40px rgba(0, 0, 0, .44));
}

.result-subtitle {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #fef08a;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.poster h1 {
  position: relative;
  z-index: 1;
  margin: 4px 0 10px;
  color: #fff;
  font-size: clamp(42px, 13vw, 68px);
  line-height: .95;
  letter-spacing: 0;
  text-align: center;
  overflow-wrap: anywhere;
}

.roast {
  position: relative;
  z-index: 1;
  margin: 0 auto 14px;
  max-width: 27em;
  color: #e5e7eb;
  font-size: 15px;
  line-height: 1.48;
  text-align: center;
}

.tags {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.tags span {
  padding: 7px 10px;
  border: 1px solid rgba(190, 242, 100, .55);
  border-radius: 999px;
  background: rgba(190, 242, 100, .12);
  color: #ecfccb;
  font-size: 12px;
  font-weight: 900;
}

.detail-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.detail-grid div {
  min-height: 104px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
}

.detail-grid b {
  display: block;
  margin-bottom: 7px;
  color: #fb7185;
  font-size: 12px;
}

.detail-grid p,
.share-line {
  margin: 0;
  color: #f8fafc;
  font-size: 13px;
  line-height: 1.42;
}

.share-line {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #fef08a;
  color: #111827;
  font-weight: 900;
  text-align: center;
}

.result-actions {
  margin-top: 14px;
}

@media (max-width: 370px) {
  .shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .hero-panel h1 {
    font-size: 44px;
  }

  .quiz-card h2 {
    font-size: 22px;
  }

  .option-button {
    min-height: 66px;
    font-size: 14px;
  }

  .poster {
    padding-left: 12px;
    padding-right: 12px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}
