:root {
  color-scheme: dark;
  --bg: #140f1f;
  --bg-soft: #21162f;
  --card: rgba(255, 255, 255, 0.1);
  --card-strong: rgba(255, 255, 255, 0.16);
  --text: #fff8ec;
  --muted: rgba(255, 248, 236, 0.68);
  --accent: #ffcf5a;
  --accent-strong: #ff7a90;
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 207, 90, 0.28), transparent 28rem),
    radial-gradient(circle at 80% 20%, rgba(255, 122, 144, 0.22), transparent 24rem),
    linear-gradient(160deg, #120d1b 0%, #1f1330 55%, #111827 100%);
}

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

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

.hero {
  padding: 16px 4px 18px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 10px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.08);
}

h1 {
  margin: 0;
  font-size: clamp(34px, 10vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.subtitle {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.fortune-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.07)),
    var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.fortune-card::before {
  position: absolute;
  inset: -20% auto auto 45%;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: rgba(255, 207, 90, 0.18);
  content: "";
  filter: blur(8px);
}

.card-topline,
.spirit,
.fortune-list,
.advice {
  position: relative;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  color: #2a1600;
  font-weight: 700;
  background: var(--accent);
}

.spirit {
  margin-top: 24px;
}

.spirit-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.spirit strong {
  display: block;
  min-height: 88px;
  font-size: clamp(30px, 9vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.fortune-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 24px 0 0;
}

.fortune-list div {
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
}

dt {
  color: var(--muted);
  font-size: 12px;
}

dd {
  margin: 8px 0 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

.advice {
  margin: 18px 0 0;
  padding: 14px;
  border-left: 4px solid var(--accent-strong);
  border-radius: 16px;
  color: rgba(255, 248, 236, 0.86);
  line-height: 1.55;
  background: rgba(255, 122, 144, 0.12);
}

.actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: 18px;
  padding: 12px 0 4px;
  background: linear-gradient(180deg, rgba(20, 15, 31, 0), rgba(20, 15, 31, 0.95) 22%);
}

.primary-button {
  width: 100%;
  min-height: 58px;
  border-radius: 999px;
  color: #2a1600;
  font-size: 18px;
  font-weight: 900;
  background: linear-gradient(135deg, #ffdc6f, #ff8ba1);
  box-shadow: 0 16px 42px rgba(255, 122, 144, 0.28);
}

.primary-button:active,
.secondary-actions button:active {
  transform: translateY(1px) scale(0.99);
}

.secondary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.secondary-actions button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.secondary-actions button[hidden] {
  display: none;
}

.install-tip {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
}

.install-tip strong {
  color: var(--accent);
}

.install-tip p,
.footer-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.footer-note {
  padding: 10px 4px 0;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 4;
  width: max-content;
  max-width: calc(100% - 36px);
  padding: 10px 14px;
  border-radius: 999px;
  color: #20121d;
  font-weight: 800;
  background: var(--accent);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 360px) {
  .shell {
    padding-inline: 14px;
  }

  .fortune-card {
    padding: 18px;
    border-radius: 26px;
  }

  .fortune-list {
    grid-template-columns: 1fr;
  }
}
