@charset "UTF-8";

/*
 * こよたろ占い
 * SPEC 43節：スマートフォン最優先。最大幅720pxの中央カラム。
 * SPEC 44節：濃紺・黒・紫の背景に、星と金色系のアクセント。
 */

:root {
  --bg-deep: #0b0d1c;
  --bg-panel: rgba(24, 27, 54, 0.72);
  --bg-panel-solid: #181b36;
  --line: rgba(190, 175, 255, 0.18);
  --text: #eae8f6;
  --text-dim: #a9a6c4;
  --gold: #e6c675;
  --gold-dim: #b99f56;
  --violet: #6f5bd0;
  --violet-soft: #9d8ce8;
  --danger: #ff9b9b;
  --radius: 14px;
  --max-width: 720px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% -10%, rgba(111, 91, 208, 0.35), transparent 55%),
    radial-gradient(circle at 85% 8%, rgba(60, 40, 120, 0.30), transparent 45%),
    var(--bg-deep);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.02em;
}

/* 背景の星。動きは控えめにする */
.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(1px 1px at 68% 12%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 34% 62%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1.5px 1.5px at 82% 48%, rgba(230, 198, 117, 0.8), transparent),
    radial-gradient(1px 1px at 52% 86%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1px 1px at 8% 78%, rgba(255, 255, 255, 0.5), transparent);
  opacity: 0.9;
  z-index: 0;
}

.site-header,
.container,
.site-footer {
  position: relative;
  z-index: 1;
}

/* ------------------------------------------------------------
   ヘッダー / フッター
   ------------------------------------------------------------ */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 20px 8px;
}

/* 親サイトへの戻り口。ヘッダー右側に常に置く */
.header-back {
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-decoration: none;
  white-space: nowrap;
}

.header-back:hover {
  color: var(--text);
  border-color: var(--violet-soft);
}

.ext-mark {
  margin-left: 3px;
  font-size: 10px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  letter-spacing: 0.12em;
}

.logo-mark {
  color: var(--gold);
  font-size: 18px;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 8px 20px 48px;
}

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 20px 40px;
  border-top: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.8;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-top: 18px;
}

.footer-nav a {
  color: var(--violet-soft);
  font-size: 13px;
  text-decoration: none;
}

.footer-nav a:hover {
  text-decoration: underline;
}

.disclaimer {
  margin: 16px 0 8px;
}

.credit {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--text-dim);
}

.copyright {
  margin: 0;
  letter-spacing: 0.1em;
}

/* ------------------------------------------------------------
   共通パーツ
   ------------------------------------------------------------ */
.card-panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin: 0 0 16px;
}

.section-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--text-dim);
}

.body-text {
  margin: 0 0 12px;
  font-size: 15px;
}

.body-text:last-child {
  margin-bottom: 0;
}

.note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--text-dim);
}

.note a,
.body-text a {
  color: var(--violet-soft);
}

.lead {
  margin: 0 0 16px;
  color: var(--text-dim);
}

.alert {
  background: rgba(120, 30, 50, 0.35);
  border: 1px solid rgba(255, 155, 155, 0.4);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 0 0 16px;
  color: var(--danger);
  font-size: 14px;
}

.alert ul {
  margin: 0;
  padding-left: 1.2em;
}

/* ボタン */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border: none;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  color: #1a1730;
  box-shadow: 0 6px 20px rgba(230, 198, 117, 0.22);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-dim);
  box-shadow: none;
}

.btn-block {
  display: block;
  width: 100%;
  margin-top: 12px;
}

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

.btn:active {
  transform: translateY(0);
  opacity: 0.9;
}

.btn:focus-visible,
a:focus-visible,
input:focus-visible,
button:focus-visible {
  outline: 2px solid var(--violet-soft);
  outline-offset: 2px;
}

/* ------------------------------------------------------------
   HOME
   ------------------------------------------------------------ */
.hero {
  padding: 28px 4px 34px;
  text-align: center;
}

.hero-title {
  margin: 0 0 16px;
  font-size: 22px;
  line-height: 1.7;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.hero-text {
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--text-dim);
}

.theme-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.theme-item a {
  display: block;
  padding: 14px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  text-align: center;
  text-decoration: none;
  font-size: 14px;
}

.step-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  font-size: 14px;
}

.step-no {
  flex: 0 0 26px;
  height: 26px;
  margin-top: 4px;
  border-radius: 50%;
  background: rgba(230, 198, 117, 0.15);
  color: var(--gold);
  font-size: 13px;
  line-height: 26px;
  text-align: center;
}

/* ------------------------------------------------------------
   フォーム
   ------------------------------------------------------------ */
.form {
  margin-top: 20px;
}

.field {
  margin: 0 0 22px;
  padding: 0;
  border: none;
}

.field-label {
  padding: 0;
  margin-bottom: 10px;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

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

.date-input {
  flex: 1;
}

.date-caption {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--text-dim);
}

input[type="number"] {
  width: 100%;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 12, 28, 0.6);
  color: var(--text);
  font-size: 16px; /* iOS で拡大されないよう16px以上にする */
  text-align: center;
}

.radio-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
}

.radio-item input {
  accent-color: var(--gold);
}

/* ------------------------------------------------------------
   持ち味タイプ / 運気ごよみ
   ------------------------------------------------------------ */
.type-name,
.phase-name {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.phase-stars {
  margin: 0 0 12px;
  font-size: 18px;
  letter-spacing: 0.2em;
  color: var(--gold);
}

.type-detail {
  margin: 16px 0 0;
}

.type-detail > div {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.type-detail dt {
  margin-bottom: 4px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

.type-detail dd {
  margin: 0;
  font-size: 14px;
}

.draw-invite {
  text-align: center;
}

.invite-text {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 2;
}

/* ------------------------------------------------------------
   タロット画面
   ------------------------------------------------------------ */
.tarot-stage {
  padding: 24px 0 8px;
  text-align: center;
}

.tarot-lead {
  margin: 0 0 28px;
  font-size: 15px;
  line-height: 2;
  color: var(--text-dim);
}

.tarot-form {
  margin: 0;
}

.card-back {
  display: block;
  width: 200px;
  height: 340px;
  margin: 0 auto;
  padding: 10px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(160deg, #2a2456, #150f33 60%, #251c4d);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.6s ease, box-shadow 0.3s ease;
  transform-style: preserve-3d;
}

.card-back-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(230, 198, 117, 0.45);
  border-radius: 10px;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(230, 198, 117, 0.05) 0 6px,
      transparent 6px 12px
    );
}

.card-back-mark {
  font-size: 46px;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(230, 198, 117, 0.6);
}

.card-back:hover {
  transform: translateY(-4px);
}

.card-back.is-flipping {
  transform: rotateY(180deg) scale(0.96);
  box-shadow: 0 0 60px rgba(230, 198, 117, 0.35);
}

.tarot-hint {
  margin: 18px 0 0;
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--text-dim);
}

/* ------------------------------------------------------------
   鑑定結果
   ------------------------------------------------------------ */
.score-panel {
  margin: 0 0 16px;
  padding: 28px 20px;
  border: 1px solid rgba(230, 198, 117, 0.35);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(46, 38, 92, 0.75), rgba(20, 18, 44, 0.8));
  text-align: center;
}

.score-value {
  margin: 4px 0 10px;
  line-height: 1.2;
}

.score-number {
  font-size: 56px;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 24px rgba(230, 198, 117, 0.35);
}

.score-max {
  font-size: 16px;
  color: var(--text-dim);
}

.score-rank {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.18em;
  color: var(--gold);
}

.score-label {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--text);
}

.card-face {
  padding: 22px 16px;
  border: 1px solid rgba(230, 198, 117, 0.35);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(42, 36, 86, 0.8), rgba(21, 15, 51, 0.9));
  text-align: center;
}

.card-image {
  margin: 0 auto 18px;
  width: 260px;
  max-width: 100%;
  line-height: 0;
}

.card-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

/* 逆位置は上下を返して見せる */
.card-image.is-reversed img {
  transform: rotate(180deg);
}

.card-name-en {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.card-name-ja {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 600;
  color: var(--gold);
}

.card-orientation {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--text);
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.keyword-list li {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-dim);
}

.caution-panel {
  border-color: rgba(255, 155, 155, 0.28);
}

.lucky-panel {
  border-color: rgba(230, 198, 117, 0.35);
}

.lucky-action {
  margin: 0;
  padding: 16px;
  border-radius: 10px;
  background: rgba(230, 198, 117, 0.10);
  font-size: 16px;
  text-align: center;
}

.breakdown {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.breakdown th,
.breakdown td {
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: normal;
}

.breakdown td {
  width: 4.5em;
  text-align: right;
  color: var(--text-dim);
}

.breakdown-total th,
.breakdown-total td {
  border-bottom: none;
  color: var(--gold);
  font-weight: 600;
}

/* ------------------------------------------------------------
   結果を出すまでの演出
   JavaScript が無効なら .is-revealing が付かず、すぐ結果が出る
   ------------------------------------------------------------ */
.reveal-overlay {
  display: none;
}

.is-revealing .reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--bg-deep);
}

.is-revealing .container,
.is-revealing .site-footer {
  visibility: hidden;
}

.reveal-mark {
  font-size: 44px;
  color: var(--gold);
  text-shadow: 0 0 28px rgba(230, 198, 117, 0.55);
  animation: reveal-spin 2.4s linear infinite;
}

.reveal-text {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  animation: reveal-fade 1.6s ease-in-out infinite;
}

@keyframes reveal-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes reveal-fade {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 1; }
}

/* ------------------------------------------------------------
   画面幅の調整
   ------------------------------------------------------------ */
@media (max-width: 380px) {
  .hero-title {
    font-size: 20px;
  }

  .card-back {
    width: 168px;
    height: 286px;
  }

  .score-number {
    font-size: 48px;
  }

  .theme-list,
  .radio-list {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 600px) {
  .theme-list,
  .radio-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 動きを減らす設定にしている人には、アニメーションを止める */
@media (prefers-reduced-motion: reduce) {
  .card-back,
  .btn {
    transition: none;
  }

  .card-back.is-flipping {
    transform: none;
  }
}
