:root {
  --bg-app: #0b1532;
  --bg-card: #16294e;
  --bg-input: #1c2f58;
  --accent: #a78bfa;
  --accent-deep: #442d99;
  --text-main: #f5f6fc;
  --text-sub: #9aa6cc;
  --border: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-app);
  color: var(--text-main);
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", -apple-system, BlinkMacSystemFont, sans-serif;
  position: relative;
  overflow-x: hidden;
}

.stars-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,255,255,.5) 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 70% 65%, rgba(255,255,255,.4) 50%, transparent 100%),
    radial-gradient(1px 1px at 40% 80%, rgba(255,255,255,.4) 50%, transparent 100%),
    radial-gradient(1px 1px at 85% 20%, rgba(255,255,255,.4) 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 55% 45%, rgba(255,255,255,.3) 50%, transparent 100%),
    radial-gradient(1px 1px at 10% 60%, rgba(255,255,255,.4) 50%, transparent 100%),
    radial-gradient(1px 1px at 92% 80%, rgba(255,255,255,.3) 50%, transparent 100%);
  background-repeat: repeat;
  background-size: 400px 400px;
}

.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 56px 20px 80px;
}

.back-to-top {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--text-sub);
  font-size: 13px;
  text-decoration: none;
  transition: color .15s ease;
}

.back-to-top:hover {
  color: var(--accent);
}

.page-header {
  text-align: center;
  margin-bottom: 32px;
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.2em;
  font-size: 12px;
  color: var(--accent);
}

.page-header h1 {
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 700;
  color: var(--text-main);
}

.lead {
  margin: 0 auto;
  max-width: 440px;
  color: var(--text-sub);
  font-size: 14px;
  line-height: 1.7;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}

.birth-form {
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}

.birth-form label {
  display: block;
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 8px;
}

.person-label {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.field:first-child .person-label {
  padding-top: 0;
  border-top: none;
}

.required {
  color: var(--accent);
  font-size: 11px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
}

.field {
  margin-bottom: 18px;
}

.field input,
.field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background-color: var(--bg-input);
  color: var(--text-main);
  font-size: 15px;
}

.field input:focus,
.field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.date-select-row {
  display: flex;
  gap: 10px;
}

.date-select-row select,
.date-select-row input {
  width: auto;
  flex: 1 1 0;
  min-width: 0;
}

.datalist-select-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%239aa6cc' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 38px !important;
}

.field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-sub);
}

.radio-field {
  margin-top: -6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-main);
  cursor: pointer;
}

.radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.birth-form > button {
  width: 100%;
  padding: 14px 22px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(120deg, #c9a3ff, var(--accent));
  color: #1b1240;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform .15s ease, opacity .15s ease;
}

.birth-form > button:hover { opacity: 0.9; }
.birth-form > button:active { transform: scale(0.98); }

.form-note {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.6;
}

.result {
  max-width: 520px;
  margin: 40px auto 0;
}

.edit-conditions-btn {
  display: block;
  margin: 0 auto 16px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-sub);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}

.edit-conditions-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.compat-result-card {
  text-align: center;
}

.compat-gauge-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 4px auto 8px;
}

.compat-gauge {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.compat-gauge-track {
  fill: none;
  stroke: var(--bg-input);
  stroke-width: 14;
}

.compat-gauge-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 14;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s cubic-bezier(.22,.9,.35,1);
}

.compat-gauge-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compat-score {
  font-size: 44px;
  font-weight: 700;
  color: var(--text-main);
}

.compat-score-unit {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-sub);
  margin-left: 2px;
}

.compat-tier {
  margin: 4px 0 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.compat-summary {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-sub);
}

.page-footer {
  margin-top: 40px;
  text-align: center;
  font-size: 12px;
  color: var(--text-sub);
}

@media (max-width: 480px) {
  .page-header h1 { font-size: 26px; }
}
