﻿:root {
  color-scheme: light;
  --ink: #1e1d22;
  --muted: #5e5a6b;
  --paper: #fff7fb;
  --card: rgba(255, 255, 255, 0.82);
  --accent: #ff9bb3;
  --accent-strong: #ff6f99;
  --accent-soft: #ffd3e1;
  --shadow: 0 30px 60px -40px rgba(36, 20, 44, 0.45);
  --radius: 28px;
  --ease-spring: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic Pro", "Yu Gothic", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #fff4fb, #f7f0ff 45%, #edf6ff 85%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 204, 221, 0.25), rgba(186, 223, 255, 0.2));
  pointer-events: none;
  z-index: 0;
}

.bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.orb {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  filter: blur(0);
  opacity: 0.8;
  animation: float 12s var(--ease-spring) infinite;
}

.orb-a {
  background: radial-gradient(circle at 30% 30%, #ffe6f1, #ffc1d5 60%, #ff9bb3 100%);
  top: -60px;
  left: -40px;
}

.orb-b {
  background: radial-gradient(circle at 70% 30%, #e7f1ff, #b9dcff 60%, #9bc4ff 100%);
  bottom: -80px;
  right: -40px;
  animation-delay: -4s;
}

.orb-c {
  background: radial-gradient(circle at 50% 50%, #fff9e9, #ffe3b0 65%, #ffd08a 100%);
  top: 20%;
  right: 10%;
  width: 220px;
  height: 220px;
  animation-delay: -7s;
}

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 56px 20px;
}

.card {
  width: min(720px, 94vw);
  background: var(--card);
  border-radius: var(--radius);
  padding: clamp(28px, 5vw, 48px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  animation: rise 0.9s var(--ease-spring) both;
}

.hero h1,
.result h1 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.4;
  margin: 0 0 12px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-strong);
  margin: 0 0 10px;
}

.sub {
  color: var(--muted);
  margin: 0 0 32px;
  font-size: 1rem;
}

.btn {
  font-family: inherit;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: 14px 32px;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s ease, background 0.2s ease;
  text-decoration: none;
}

.btn.primary {
  background: linear-gradient(140deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 14px 28px -18px rgba(255, 111, 153, 0.9);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 32px -22px rgba(255, 111, 153, 1);
}

.btn.primary:active {
  transform: translateY(1px) scale(0.98);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 22px -18px rgba(80, 80, 120, 0.6);
}

.btn.ghost:hover {
  transform: translateY(-2px);
}

.result-header {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
}

.title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.title-row h1 {
  margin: 0;
}

.fortune-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1.1rem;
  color: #5a2b3a;
  background: linear-gradient(135deg, #ffe3ec, #ffd3f0);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 12px 20px -18px rgba(255, 111, 153, 0.8);
  animation: pop 0.6s var(--ease-spring) both;
}

.fortune-badge[data-luck="大吉"] {
  background: linear-gradient(135deg, #ffe3d0, #ffd1a6);
}

.fortune-badge[data-luck="中吉"] {
  background: linear-gradient(135deg, #fff1c7, #ffe39a);
}

.fortune-badge[data-luck="小吉"] {
  background: linear-gradient(135deg, #f0ffd6, #d9f7b1);
}

.fortune-badge[data-luck="吉"] {
  background: linear-gradient(135deg, #dcf9ff, #b9e6ff);
}

.fortune-badge[data-luck="凶"] {
  background: linear-gradient(135deg, #e7e3ff, #cfc6ff);
}

.fortune-badge[data-luck="大凶"] {
  background: linear-gradient(135deg, #ffd6e7, #ffb3cf);
}

.date {
  color: var(--muted);
  margin: 0;
}

.poem {
  display: grid;
  gap: 18px;
  margin: 26px 0 32px;
}

.line {
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  margin: 0;
  padding: 16px 22px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.7s var(--ease-spring) forwards;
}

.line:nth-child(1) { animation-delay: 0.15s; }
.line:nth-child(2) { animation-delay: 0.3s; }
.line:nth-child(3) { animation-delay: 0.45s; }

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.result-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.lucky-item {
  text-align: right;
  padding: 12px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 26px -20px rgba(255, 111, 153, 0.8);
  min-width: min(240px, 60vw);
}

.lucky-label {
  margin: 0 0 6px;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.lucky-value {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.note {
  margin: 16px 0 0;
  color: #c34f6e;
  font-size: 0.9rem;
}

body.page-exit .card {
  animation: exit 0.45s ease forwards;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes float {
  0% { transform: translateY(0) translateX(0); }
  50% { transform: translateY(-24px) translateX(12px); }
  100% { transform: translateY(0) translateX(0); }
}

@keyframes exit {
  to {
    opacity: 0;
    transform: translateY(-16px) scale(0.98);
  }
}

@media (max-width: 900px) {
  .orb {
    width: 220px;
    height: 220px;
  }

  .orb-c {
    width: 180px;
    height: 180px;
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 48px 16px;
  }

  .card {
    padding: 24px 20px;
  }

  .hero h1,
  .result h1 {
    font-size: clamp(1.5rem, 6.4vw, 2rem);
  }

  .title-row {
    align-items: flex-start;
  }

  .fortune-badge {
    font-size: 1rem;
    padding: 6px 18px;
  }

  .poem {
    gap: 14px;
    margin: 20px 0 24px;
  }

  .line {
    font-size: clamp(1.05rem, 4.6vw, 1.3rem);
    padding: 14px 18px;
  }

  .result-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .result-actions {
    flex-direction: column;
    order: 2;
  }

  .lucky-item {
    text-align: left;
    width: 100%;
    min-width: 0;
    order: 1;
  }

  .btn {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .orb {
    width: 180px;
    height: 180px;
  }

  .orb-a {
    top: -80px;
    left: -60px;
  }

  .orb-b {
    bottom: -100px;
    right: -60px;
  }

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