* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --blue-50: #f0f4f8;
  --blue-100: #dbe4ee;
  --blue-200: #b6c8d9;
  --blue-300: #8baabe;
  --blue-400: #6b8faa;
  --blue-500: #4a6f8a;
  --blue-600: #3a5a72;
  --blue-700: #2d4559;
  --text: #2d3a45;
  --text-light: #5a6d7a;
  --text-muted: #8a9baa;
  --white: #ffffff;
  --bg: #f5f8fb;
  --card-bg: #ffffff;
  --shadow: rgba(74, 111, 138, 0.08);
  --shadow-md: rgba(74, 111, 138, 0.12);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", Meiryo, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 420px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 32px;
}

.logo {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--blue-500);
}

.tagline {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.04em;
}

.intro {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-top: 8px;
}

/* Form */
.form-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 2px 12px var(--shadow);
  overflow: hidden;
}

.form-group {
  margin-bottom: 20px;
  min-width: 0;
  overflow: hidden;
}

.form-group--icon {
  position: relative;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-light);
  margin-bottom: 6px;
}

.required {
  color: #c27a7a;
  font-size: 11px;
}

.optional {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.form-group input,
.form-group select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1.5px solid var(--blue-100);
  border-radius: 10px;
  font-size: 15px;
  color: var(--text);
  background: var(--blue-50);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-group input[type="date"],
.form-group input[type="time"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 40px;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator,
.form-group input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  cursor: pointer;
}

.input-icon {
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
}

.form-note {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
  line-height: 1.4;
}

.form-group input:focus {
  border-color: var(--blue-300);
  box-shadow: 0 0 0 3px rgba(107, 143, 170, 0.15);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--blue-500);
  color: var(--white);
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.02em;
  margin-top: 4px;
}

.btn-primary:hover {
  background: var(--blue-600);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* Result */
.result-area {
  margin-top: 28px;
  animation: fadeUp 0.5s ease;
}

.result-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 28px 24px 24px;
  box-shadow: 0 4px 20px var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.result-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue-200), var(--blue-400), var(--blue-200));
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.date-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.logo-small {
  font-size: 11px;
  color: var(--blue-300);
  font-weight: 600;
  letter-spacing: 0.06em;
}

/* Mode */
.mode-section {
  text-align: center;
  margin-bottom: 18px;
}

.mode-emoji {
  font-size: 48px;
  margin-bottom: 8px;
  line-height: 1;
}

.mode-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.mode-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* Zodiac */
.zodiac-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.zodiac-badge {
  font-size: 12px;
  color: var(--blue-500);
  background: var(--blue-50);
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 4px;
}

/* Today info */
.today-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 18px;
}

.today-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.today-moon {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-600);
  background: var(--blue-100);
  padding: 5px 16px;
  border-radius: 20px;
}

.today-day {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
}

.divider {
  height: 1px;
  background: var(--blue-100);
  margin: 0 -24px 18px;
}

/* Message */
.message-section {
  margin-bottom: 18px;
}

.message-main {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 10px;
}

.message-advice {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.7;
  padding-left: 12px;
  border-left: 2px solid var(--blue-200);
}

/* Run tip */
.run-tip {
  background: var(--blue-50);
  border-radius: 12px;
  padding: 14px 16px;
}

.tip-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--blue-400);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.tip-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
}

/* ============================
   Why パネル（常時表示）
   ============================ */
.why-panel {
  margin-top: 12px;
  background: var(--card-bg);
  border-radius: 20px;
  box-shadow: 0 4px 20px var(--shadow-md);
  padding: 24px 24px 20px;
  position: relative;
  overflow: hidden;
}

.why-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue-100), var(--blue-300), var(--blue-100));
}

.why-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--blue-500);
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}

.why-section {
  margin-bottom: 18px;
}

.why-section:last-child {
  margin-bottom: 0;
}

.why-heading {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-600);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.why-note {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--blue-50);
  border-radius: 8px;
  border-left: 3px solid var(--blue-400);
}

.why-caption {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.why-text {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 6px;
}

/* Score bars */
.score-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-label {
  font-size: 12px;
  color: var(--text-light);
  min-width: 60px;
  white-space: nowrap;
}

.score-bar-track {
  flex: 1;
  height: 8px;
  background: var(--blue-50);
  border-radius: 4px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue-300), var(--blue-500));
  border-radius: 4px;
  transition: width 0.5s ease;
  min-width: 2px;
}

.score-value {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Breakdown table */
.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.breakdown-table th {
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 8px;
  text-align: center;
  border-bottom: 1px solid var(--blue-100);
}

.breakdown-table th:first-child {
  text-align: left;
}

.breakdown-table td {
  padding: 5px 8px;
  text-align: center;
  color: var(--text-light);
  border-bottom: 1px solid var(--blue-50);
  font-variant-numeric: tabular-nums;
}

.breakdown-table td:first-child {
  text-align: left;
  color: var(--text);
  font-weight: 500;
}

/* Actions */
.actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn-copy,
.btn-reset {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  border: none;
}

.btn-copy {
  background: var(--blue-500);
  color: var(--white);
}

.btn-copy:hover {
  background: var(--blue-600);
}

.btn-reset {
  background: var(--blue-100);
  color: var(--blue-600);
}

.btn-reset:hover {
  background: var(--blue-200);
}

.btn-copy:active,
.btn-reset:active {
  transform: scale(0.97);
}

/* Toast */
.toast {
  text-align: center;
  margin-top: 12px;
  padding: 10px;
  background: var(--blue-700);
  color: var(--white);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  animation: fadeUp 0.3s ease;
}

/* Utility */
.hidden {
  display: none !important;
}

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

/* ============================
   スマホ対応 (iPhone幅)
   ============================ */
@media (max-width: 480px) {
  .container {
    max-width: 380px;
    padding: 24px 12px 40px;
  }

  .form-card {
    padding: 22px 16px;
  }

  .result-card {
    padding: 24px 16px 20px;
  }

  .result-card .divider {
    margin-left: -16px;
    margin-right: -16px;
  }

  .why-panel {
    padding: 20px 16px 16px;
  }

  .breakdown-table th,
  .breakdown-table td {
    padding: 4px 4px;
    font-size: 11px;
  }

  .form-group input,
  .form-group select {
    font-size: 16px;
  }
}
