/* =========================================
   星詠み占い — style.css
   配置先: public/assets/css/style.css
   ========================================= */

:root {
  --ink: #0a0612;
  --deep: #110c24;
  --purple: #1e1040;
  --gold: #c9a84c;
  --gold-light: #e8cc88;
  --gold-pale: #f5e8c0;
  --silver: #b8c4d8;
  --mist: #8896b8;
  --star: #fff8e7;
  --rose: #c97070;
  --aqua: #5ba8c4;
}

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

body {
  background: var(--ink);
  color: var(--star);
  font-family: 'Noto Serif JP', serif;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── 星空背景 ── */
.cosmos {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, #1a0a3a 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 80%, #0d1a3a 0%, transparent 50%),
    radial-gradient(ellipse 100% 100% at 50% 50%, #0e0820 0%, #04020d 100%);
  z-index: 0;
}

.stars-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.star-dot {
  position: absolute;
  border-radius: 50%;
  background: white;
  animation: twinkle var(--d, 3s) ease-in-out infinite var(--delay, 0s);
}

@keyframes twinkle {
  0%, 100% { opacity: var(--min, 0.2); transform: scale(1); }
  50%       { opacity: var(--max, 1);   transform: scale(1.4); }
}

.nebula {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
  z-index: 1;
  animation: drift 20s ease-in-out infinite alternate;
}
.nebula-1 { width: 600px; height: 400px; background: #6020c0; top: -100px; left: -150px; }
.nebula-2 { width: 500px; height: 500px; background: #1060c0; bottom: -100px; right: -100px; animation-delay: -8s; }
.nebula-3 { width: 300px; height: 300px; background: #c04060; top: 40%; left: 60%; animation-delay: -4s; opacity: 0.07; }

@keyframes drift {
  from { transform: translate(0, 0) rotate(0deg); }
  to   { transform: translate(30px, 20px) rotate(5deg); }
}

/* ── レイアウト ── */
.page {
  position: relative;
  z-index: 10;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* ── ヘッダー ── */
.site-header {
  text-align: center;
  padding: 60px 0 40px;
  animation: fadeDown 1.2s ease both;
}

.site-crown {
  font-size: 28px;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin-bottom: 8px;
  display: block;
  animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% { text-shadow: 0 0 20px rgba(201,168,76,0.4); }
  50%       { text-shadow: 0 0 40px rgba(201,168,76,0.9), 0 0 80px rgba(201,168,76,0.3); }
}

.site-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(28px, 6vw, 48px);
  color: var(--gold-light);
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-shadow: 0 0 60px rgba(201,168,76,0.5);
}

.site-subtitle {
  margin-top: 10px;
  color: var(--mist);
  font-size: 13px;
  letter-spacing: 0.25em;
  font-style: italic;
}

/* ── 星座選択 ── */
.zodiac-selector {
  margin: 20px 0 40px;
  animation: fadeUp 1.2s 0.3s ease both;
}

.selector-label {
  text-align: center;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.3em;
  margin-bottom: 18px;
}

.zodiac-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

@media (max-width: 500px) {
  .zodiac-grid { grid-template-columns: repeat(4, 1fr); }
}

.zodiac-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 12px;
  padding: 10px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--silver);
  font-family: 'Noto Serif JP', serif;
  font-size: 11px;
}

.zodiac-btn:hover {
  background: rgba(201,168,76,0.1);
  border-color: rgba(201,168,76,0.5);
  color: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(201,168,76,0.15);
}

.zodiac-btn.active {
  background: rgba(201,168,76,0.12);
  border-color: var(--gold);
  color: var(--gold-light);
  box-shadow: 0 0 20px rgba(201,168,76,0.2);
}

.zodiac-btn .z-symbol {
  font-size: 22px;
  display: block;
  margin-bottom: 4px;
}

.zodiac-btn .z-name {
  font-size: 10px;
  opacity: 0.8;
}

/* ── 占い結果カード ── */
.fortune-card {
  background: linear-gradient(160deg, rgba(30,16,64,0.9) 0%, rgba(14,8,32,0.95) 100%);
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(201,168,76,0.08) inset,
    0 40px 80px rgba(0,0,0,0.6),
    0 0 60px rgba(100,50,200,0.1);
  animation: fadeUp 1.2s 0.5s ease both;
}

.card-top-line {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.6;
}

/* ── カードヘッダー ── */
.card-header {
  padding: 40px 40px 30px;
  text-align: center;
  position: relative;
  border-bottom: 1px solid rgba(201,168,76,0.12);
}

.date-badge {
  display: inline-block;
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 20px;
  padding: 5px 18px;
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 0.15em;
  margin-bottom: 20px;
}

.zodiac-hero { margin: 10px 0; }

.zodiac-symbol {
  font-size: 72px;
  display: block;
  animation: float 6s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(201,168,76,0.4));
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.zodiac-name-jp {
  font-size: 28px;
  color: var(--gold-light);
  margin: 8px 0 4px;
  letter-spacing: 0.1em;
}

.zodiac-name-en {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  color: var(--mist);
  font-size: 18px;
  letter-spacing: 0.08em;
}

/* ── 総合運 ── */
.overall-fortune {
  padding: 30px 40px;
  border-bottom: 1px solid rgba(201,168,76,0.1);
  background: rgba(201,168,76,0.03);
}

.section-tag {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.section-tag .tag-icon { font-size: 18px; }

.section-tag .tag-text {
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--gold);
}

.section-tag::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(201,168,76,0.3), transparent);
}

.stars-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.star-rating { display: flex; gap: 4px; }

.star-rating .s {
  font-size: 18px;
  transition: transform 0.2s;
}

.star-rating .s.lit { color: var(--gold); filter: drop-shadow(0 0 4px rgba(201,168,76,0.6)); }
.star-rating .s.dim { color: rgba(201,168,76,0.2); }

.rating-label {
  color: var(--mist);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.fortune-text {
  color: #c8d0e0;
  line-height: 2.0;
  font-size: 14.5px;
  font-weight: 300;
}

.fortune-text p { margin-bottom: 14px; }
.fortune-text p:last-child { margin-bottom: 0; }

/* ── カテゴリセクション ── */
.categories {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

@media (max-width: 540px) {
  .categories { grid-template-columns: 1fr; }
}

.cat-section {
  padding: 28px 32px;
  border-bottom: 1px solid rgba(201,168,76,0.08);
  border-right: 1px solid rgba(201,168,76,0.08);
  transition: background 0.3s;
}

.cat-section:hover { background: rgba(201,168,76,0.025); }
.cat-section:nth-child(2n) { border-right: none; }
.cat-section:nth-last-child(-n+2) { border-bottom: none; }

.cat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.cat-title {
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 0.2em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cat-stars { display: flex; gap: 2px; }
.cat-stars .s { font-size: 12px; }
.cat-stars .s.lit { color: var(--gold); }
.cat-stars .s.dim { color: rgba(201,168,76,0.2); }

.cat-text {
  color: #a8b4cc;
  font-size: 13px;
  line-height: 1.9;
  font-weight: 300;
}

/* ── ラッキー要素 ── */
.lucky-section {
  padding: 32px 40px;
  border-top: 1px solid rgba(201,168,76,0.12);
  background: rgba(100,60,200,0.04);
}

.lucky-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 20px;
}

@media (max-width: 540px) {
  .lucky-grid { grid-template-columns: repeat(3, 1fr); }
  .card-header,
  .overall-fortune,
  .lucky-section { padding-left: 24px; padding-right: 24px; }
  .cat-section { padding: 22px 20px; }
}

.lucky-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
  transition: all 0.3s;
}

.lucky-item:hover {
  background: rgba(201,168,76,0.07);
  border-color: rgba(201,168,76,0.4);
  transform: translateY(-2px);
}

.lucky-emoji  { font-size: 22px; display: block; margin-bottom: 6px; }
.lucky-label  { font-size: 9px; color: var(--mist); letter-spacing: 0.15em; display: block; margin-bottom: 4px; }
.lucky-value  { font-size: 11px; color: var(--gold-light); font-weight: 500; }

/* ── アドバイス ── */
.advice-section {
  padding: 32px 40px 40px;
  border-top: 1px solid rgba(201,168,76,0.12);
  text-align: center;
}

.advice-ornament {
  color: var(--gold);
  font-size: 20px;
  letter-spacing: 0.5em;
  display: block;
  margin-bottom: 20px;
  opacity: 0.6;
}

.advice-text {
  color: #c0cce0;
  line-height: 2.0;
  font-size: 14px;
  max-width: 560px;
  margin: 0 auto;
  font-style: italic;
}

.advice-sign {
  margin-top: 24px;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.3em;
  opacity: 0.6;
}

/* ── フッター ── */
.site-footer {
  text-align: center;
  padding: 40px 0 20px;
  color: rgba(140,150,180,0.4);
  font-size: 11px;
  letter-spacing: 0.2em;
  animation: fadeUp 1.2s 0.8s ease both;
}

/* ── アニメーション ── */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-30px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

.result-fade {
  animation: fadeUp 0.8s ease both;
}

/* ── ローディング ── */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4,2,13,0.85);
  z-index: 100;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
}

.loading-overlay.show { display: flex; }

.loading-crystal {
  font-size: 48px;
  animation: spin 2s linear infinite;
  filter: drop-shadow(0 0 20px rgba(201,168,76,0.6));
}

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

.loading-text {
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.3em;
}
