:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --bg: #f9fafb;
  --surface: #ffffff;
  --primary: #6c63ff;
  --text: #1f2933;
  --muted: #6b7280;
  --border: #e5e7eb;
  --pink: #ff92fa;
  --accent: #ffe066;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #eef2ff 0%, #f9fafb 45%, #f4f5f7 100%);
  color: var(--text);
  touch-action: manipulation;
  overflow-x: hidden;
}

html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body::-webkit-scrollbar {
  width: 0;
  height: 0;
}


.logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  flex-wrap: nowrap;
}

.logo-brand {
  display: flex;
  align-items: center;
  max-width: 640px;
  justify-content: space-between;
  gap: 1rem;
  background: #fff;
  padding: 0.3rem 0.8rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  flex: 1;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
  min-width: 0;
}

.logo-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.logo-brand .logo {
  text-decoration: none;
  font-weight: 700;
  font-size: 1.25rem;
  color: #111827;
}

.menu-toggle {
  border: none;
  background: #fff;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #111827;
  position: relative;
}

.menu-toggle span::before,
.menu-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: #111827;
}

.menu-toggle span::before {
  top: -6px;
}

.menu-toggle span::after {
  top: 6px;
}

main {
  display: grid;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

main > * {
  width: 100%;
  max-width: 100%;
}

.hero {
  background: linear-gradient(135deg, #6c63ff, #8f81ff);
  color: #fff;
  border-radius: 0;
  padding: clamp(1rem, 3vw, 1rem);
  display: grid;
  gap: 1rem;
}

.hero h1 {
  margin: auto;
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.hero p {
  margin: 1;
  font-size: 1.0rem;
  max-width: 60ch;
}

.animal-hero {
  background: linear-gradient(135deg, #fdd835, #f78da7);
  color: #111827;
}

.zodiac-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #151a7b, #8c52ff);
  color: #f8fafc;
}

.zodiac-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.35) 0, rgba(255, 255, 255, 0) 35%),
    radial-gradient(circle at 80% 10%, rgba(255, 255, 255, 0.25) 0, rgba(255, 255, 255, 0) 30%),
    radial-gradient(circle at 65% 75%, rgba(255, 255, 255, 0.35) 0, rgba(255, 255, 255, 0) 35%);
  opacity: 0.6;
  pointer-events: none;
}

.zodiac-hero > * {
  position: relative;
  z-index: 1;
}

.zodiac-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.zodiac-card {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  padding: 1rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(106, 90, 205, 0.08), rgba(255, 255, 255, 0.85));
  box-shadow: 0 12px 24px rgba(35, 40, 105, 0.12);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.zodiac-card button {
  all: unset;
  display: grid;
  gap: 0.4rem;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.zodiac-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 32px rgba(35, 40, 105, 0.2);
}

.zodiac-card span {
  font-size: 2rem;
}

.fortune-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.fortune-card {
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 16px;
  padding: 1rem;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(67, 56, 202, 0.08);
  display: grid;
  gap: 0.35rem;
}

.fortune-card h5 {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
}

.rating-stars {
  font-size: 0.85rem;
  color: #fbbf24;
  letter-spacing: 0.08em;
}

.overall-fortune-card {
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 18px;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(14, 165, 233, 0.1));
  box-shadow: 0 16px 28px rgba(37, 99, 235, 0.18);
}

.overall-fortune-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.overall-stars {
  font-size: 1.15rem;
  letter-spacing: 0.1em;
  color: #facc15;
  text-shadow: 0 0 8px rgba(250, 204, 21, 0.8);
}

.overall-fortune-body {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: #0f172a;
}

.fortune-meta {
  margin-top: 0.5rem;
  text-align: right;
  color: var(--muted);
}

#zodiacSymbol {
  font-size: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.85rem 1.0rem;
  border-radius: 16px;
  border: none;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, #4338ca, #7c3aed);
  color: #fff;
  box-shadow: 0px 4px 28px rgba(67, 56, 202, 0.45);
  border: 1px solid rgba(67, 56, 202, 0.4);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 20px 36px rgba(67, 56, 202, 0.55);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 10px 18px rgba(67, 56, 202, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(108, 99, 255, 0.4);
  color: var(--primary);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(108, 99, 255, 0.08);
  transform: translateY(-2px);
}

.btn-secondary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}

section {
  background: var(--surface);
  border-radius: 28px;
  padding: clamp(1rem, 3vw, 1rem);
  box-shadow:
    0 20px 45px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(15, 23, 42, 0.04);
  position: relative;
  width: 100%;
}

section h2 {
  margin-top: 0;
}

.card-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  grid-auto-rows: 1fr;
}

.card {
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: 22px;
  padding: 1.65rem;
  display: grid;
  gap: 0.6rem;
  background: #fff;
  min-height: 220px;
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.07);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 25px 45px rgba(15, 23, 42, 0.12);
}

.card h3 {
  margin: 0;
}

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

.card .btn {
  width: fit-content;
}


.promo-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.promo-slot {
  border: 1px solid transparent;
  border-radius: 22px;
  background: transparent;
  color: var(--text);
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  box-shadow: none;
  width: 100%;
}

.promo-slot small {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.promo-slot strong {
  font-size: 1.05rem;
}


.ad-inline {
  width: 100%;
  margin-bottom: 1rem;
  display: flex;
  justify-content: center;
}

.ad-inline .promo-slot {
  min-height: 0px;
  padding: 0px;
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.progress-wrapper {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  background: #fff;
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  width: 100%;
}

.progress-bar {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(135deg, #4338ca, #7c3aed);
  box-shadow: 0 6px 20px rgba(67, 56, 202, 0.35);
  transition: width 0.3s ease;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.progress-value {
  font-weight: 700;
  color: #111827;
  font-variant-numeric: tabular-nums;
}

.summary-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 1.5rem;
}

.axis-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  background: #fdfdff;
  display: grid;
  gap: 0.4rem;
}

.axis-card img {
  width: 100%;
  border-radius: 12px;
  height: 140px;
  object-fit: cover;
  background: #e5e7eb;
}

.axis-card small {
  color: var(--muted);
}

.axis-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--pink);
  overflow: hidden;
}

.axis-bar span {
  display: block;
  height: 100%;
  background: var(--primary);
}

.result-panel {
  padding: 1.0rem;
  border-radius: 18px;
  background: #eef2ff;
  display: grid;
  gap: 0.6rem;
  box-shadow: 0 20px 35px rgba(103, 114, 229, 0.2);
  width: 100%;
}

.result-panel h2 {
  margin: 1rem 0;
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  line-height: 1.3;
}

.result-panel h3 {
  margin: 1rem 0;
  font-size: clamp(1.1rem, 3vw, 1.25rem);
}

.keyword-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.keyword-badges span {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  background: rgba(67, 56, 202, 0.1);
  color: #4338ca;
  font-weight: 600;
  font-size: 0.85rem;
}

.match-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.match-gallery figure {
  margin: 0;
  text-align: center;
  background: #f9fafb;
  border-radius: 12px;
  padding: 0.5rem;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.match-gallery img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 999px;
  display: block;
  margin: 0 auto 0.4rem;
}

.match-gallery figcaption {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  background: rgba(108, 99, 255, 0.15);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
}

.tips-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.tips-list li + li {
  margin-top: 0.3rem;
}

.question-stage {
  display: grid;
  gap: 1rem;
}

.question-stage h3 {
  margin-bottom: 0;
}

.result-image {
  width: 100%;
  min-height: 220px;
  border-radius: 16px;
  background: #e0e7ff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.result-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.result-image span {
  color: var(--muted);
  font-weight: 500;
  text-align: center;
  padding: 1rem;
}

footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.note {
  display: block;
  margin-top: 0.4rem;
}

/* Test page elements */
.test-wrapper {
  display: grid;
  gap: 0;
}

.test-wrapper > * {
  width: 100%;
  max-width: 100%;
}

.test-container {
  background: var(--surface);
  border-radius: 0;
  padding: clamp(0.75rem, 3vw, 1.5rem);
  box-shadow: 0 15px 45px rgba(15, 23, 42, 0.08);
  width: 100%;
}

form {
  display: grid;
  gap: 1rem;
}

.question {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  background: #fdfdff;
}

.scale {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.scale label {
  flex: 1;
  text-align: center;
  cursor: pointer;
  border-radius: 10px;
  padding: 0.35rem 0.2rem;
  font-size: 0.9rem;
}

.scale label span {
  display: block;
  width: 100%;
  padding: 0.35rem 0;
  border-radius: 8px;
  background: #f1f3f9;
  color: var(--text);
  transition: background 0.2s ease, transform 0.2s ease;
}

.scale input {
  display: none;
}

.scale input:checked + span {
  background: rgba(108, 99, 255, 0.25);
  color: inherit;
  font-weight: 600;
  transform: translateY(-1px);
}

.submit-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  align-items: center;
  margin-top: 15px;
}

.submit-row.wrap {
  flex-wrap: wrap;
  justify-content: center;
}

.submit-row.wrap .btn {
  flex: 1 1 220px;
}

.result {
  padding: 1rem;
  border-radius: 14px;
  background: #eef2ff;
  font-weight: 600;
}

.share-box {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
}

.question-figure {
  background: #fff;
  border-radius: 18px;
  padding: 0.75rem;
  box-shadow: 0 12px 25px rgba(15, 23, 42, 0.08);
  width: 100%;
}

.question-figure img {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  min-height: 160px;
  background: #e5e7eb;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background: #fff;
  box-shadow: -10px 0 30px rgba(15, 23, 42, 0.1);
  transition: transform 0.3s ease;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  transform: translateX(110%);
  overflow-y: auto;
}

.drawer.open {
  transform: translateX(0);
}

.drawer h3 {
  margin: 0 0 0.5rem 0;
}

.drawer-close {
  border: none;
  background: transparent;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  cursor: pointer;
  padding: 0;
  color: var(--muted);
  align-self: start;
  justify-self: end;
  position: relative;
}

.drawer-close span,
.drawer-close span::before,
.drawer-close span::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 2px;
  background: #111827;
  transform-origin: center;
}

.drawer-close span {
  transform: translate(-50%, -50%) rotate(45deg);
}

.drawer-close span::before {
  transform: translate(-50%, -50%) rotate(-90deg);
}

.drawer-close span::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.drawer-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.drawer-list li a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.drawer-backdrop.visible {
  opacity: 1;
  pointer-events: all;
}

body.drawer-open {
  overflow: hidden;
}

.drawer-open .site-header {
  position: relative;
}

@media (max-width: 640px) {
  .hero .btn,
  .card .btn,
  .submit-row .btn {
    width: 100%;
  }

  .submit-row {
    margin-top: 1rem;
  }

  .scale {
    flex-direction: column;
    gap: 0.45rem;
  }

  .scale label {
    flex: 1;
    width: 100%;
  }

  .submit-row.split {
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  .submit-row.split .btn {
    flex: 1;
  }
}

@media (max-width: 400px) {

  .logo-brand {
    gap: 0.6rem;
    padding: 0.35rem 0.65rem;
  }

  .brand-mark {
    gap: 0.6rem;
  }

  .logo-brand img {
    width: 40px;
    height: 40px;
  }

  .logo-brand .logo {
    font-size: 1rem;
  }

  .menu-toggle {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .menu-toggle span,
  .menu-toggle span::before,
  .menu-toggle span::after {
    width: 20px;
  }



  .test-container,
  section {
    padding: 0.75rem;
  }

  .progress-wrapper {
    padding: 0.75rem;
  }

  .progress-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  .hero {
    padding: 1rem;
  }

  .hero h2 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .submit-row {
    flex-direction: column;
  }

  .submit-row .btn {
    width: 100%;
    min-width: 0;
  }

  .submit-row.split {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
}
