/* ============================================
   運命星占い - Luxury Elegant Theme
   ============================================ */

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #0f0f0f;
  --gold: #D4AF37;
  --gold-light: #E8D48B;
  --gold-dark: #A68A2B;
  --red: #8B0000;
  --red-light: #B22222;
  --silver: #C0C0C0;
  --text-primary: #E8E0D0;
  --text-secondary: #A09880;
  --text-dim: #6B6355;
  --border-gold: 1px solid #D4AF37;
  --border-gold-dim: 1px solid rgba(212, 175, 55, 0.3);
  --font-jp: 'Noto Serif JP', 'Yu Mincho', serif;
  --font-en: 'Cormorant Garamond', 'Times New Roman', serif;
}

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-jp);
  font-weight: 400;
  line-height: 1.8;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Background subtle pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.03) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(139, 0, 0, 0.02) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Container */
.container {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 60px 24px 40px;
}

/* ============================================
   Ornamental Dividers
   ============================================ */

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 32px 0;
}

.divider-sm {
  margin: 24px 0;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.divider-star {
  color: var(--gold);
  font-size: 12px;
  line-height: 1;
  opacity: 0.8;
}

/* ============================================
   Header
   ============================================ */

.header {
  text-align: center;
  padding-bottom: 8px;
}

.ornament-top {
  color: var(--gold);
  font-size: 24px;
  margin-bottom: 24px;
  opacity: 0.6;
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

.title {
  font-family: var(--font-jp);
  font-weight: 600;
  font-size: 2rem;
  letter-spacing: 0.5em;
  color: var(--gold);
  margin-bottom: 16px;
  text-shadow: 0 0 40px rgba(212, 175, 55, 0.15);
}

.subtitle {
  font-family: var(--font-jp);
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--gold-light);
  letter-spacing: 0.3em;
  margin-bottom: 8px;
}

.description {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  line-height: 2;
}

/* ============================================
   Form Section
   ============================================ */

.form-section {
  text-align: center;
  padding: 8px 0;
}

.form-label {
  font-size: 0.8125rem;
  color: var(--silver);
  letter-spacing: 0.15em;
  margin-bottom: 24px;
}

.fortune-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.select-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  width: 100%;
}

.select-wrapper {
  position: relative;
  flex: 1;
  max-width: 140px;
}

.select-wrapper::after {
  content: '▾';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  font-size: 10px;
  pointer-events: none;
}

.select-wrapper select {
  width: 100%;
  padding: 12px 28px 12px 16px;
  background: var(--bg-secondary);
  border: var(--border-gold-dim);
  border-radius: 2px;
  color: var(--text-primary);
  font-family: var(--font-jp);
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.select-wrapper select:focus {
  outline: none;
  border-color: var(--gold);
}

.select-wrapper select option {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 48px;
  background: transparent;
  border: var(--border-gold);
  border-radius: 2px;
  color: var(--gold);
  font-family: var(--font-jp);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.5em;
  cursor: pointer;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}

.submit-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.1), transparent);
  transition: left 0.6s ease;
}

.submit-btn:hover::before {
  left: 100%;
}

.submit-btn:hover {
  background: rgba(212, 175, 55, 0.08);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.1);
}

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

.btn-ornament-left,
.btn-ornament-right {
  font-size: 8px;
  opacity: 0.6;
}

/* ============================================
   Loading
   ============================================ */

.loading {
  display: none;
  text-align: center;
  padding: 60px 0;
}

.loading.active {
  display: block;
}

.loading-star {
  font-size: 36px;
  color: var(--gold);
  animation: spin-glow 2s linear infinite;
}

@keyframes spin-glow {
  0% { transform: rotate(0deg); opacity: 0.4; }
  50% { opacity: 1; }
  100% { transform: rotate(360deg); opacity: 0.4; }
}

.loading-text {
  margin-top: 20px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  letter-spacing: 0.2em;
}

/* ============================================
   Result Section
   ============================================ */

.result-section {
  display: none;
  animation: fadeIn 0.8s ease-out;
}

.result-section.active {
  display: block;
}

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

.result-header {
  text-align: center;
  padding: 8px 0;
}

.result-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.3em;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.destiny-star-symbol {
  font-size: 56px;
  color: var(--gold);
  margin-bottom: 16px;
  text-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
  animation: pulse-glow 3s ease-in-out infinite;
}

.destiny-star-name {
  font-family: var(--font-jp);
  font-weight: 600;
  font-size: 1.75rem;
  color: var(--gold);
  letter-spacing: 0.3em;
  margin-bottom: 16px;
}

.cycle-badge {
  display: inline-block;
  padding: 6px 24px;
  border-radius: 2px;
  font-size: 0.8125rem;
  letter-spacing: 0.2em;
  font-weight: 600;
}

.cycle-badge.blessing {
  border: 1px solid var(--gold);
  color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
}

.cycle-badge.normal {
  border: 1px solid var(--silver);
  color: var(--silver);
  background: rgba(192, 192, 192, 0.05);
}

.cycle-badge.caution {
  border: 1px solid #CC8800;
  color: #CC8800;
  background: rgba(204, 136, 0, 0.05);
}

.cycle-badge.danger {
  border: 1px solid var(--red-light);
  color: var(--red-light);
  background: rgba(139, 0, 0, 0.1);
}

/* ============================================
   Fortune Bars
   ============================================ */

.fortune-bars {
  padding: 8px 0;
}

.bar-item {
  margin-bottom: 18px;
}

.bar-item:last-child {
  margin-bottom: 0;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.bar-name {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  letter-spacing: 0.15em;
}

.bar-value {
  font-family: var(--font-en);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.05em;
}

.bar-track {
  width: 100%;
  height: 3px;
  background: rgba(212, 175, 55, 0.12);
  border-radius: 1px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light));
  border-radius: 1px;
  width: 0;
  transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ============================================
   Fortune Detail
   ============================================ */

.fortune-detail,
.fortune-advice {
  padding: 8px 0;
}

.detail-title {
  font-size: 0.8125rem;
  color: var(--gold);
  letter-spacing: 0.25em;
  text-align: center;
  margin-bottom: 20px;
  font-weight: 600;
}

.detail-text {
  font-size: 0.875rem;
  color: var(--text-primary);
  line-height: 2.2;
  letter-spacing: 0.04em;
  text-align: justify;
}

/* ============================================
   Advice
   ============================================ */

.advice-items {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.advice-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border: var(--border-gold-dim);
  border-radius: 2px;
  background: rgba(212, 175, 55, 0.02);
}

.advice-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.15em;
}

.advice-value {
  font-size: 0.875rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* ============================================
   Cycle Message
   ============================================ */

.cycle-message {
  margin-top: 28px;
  padding: 20px 24px;
  border-radius: 3px;
  font-size: 0.8125rem;
  line-height: 2;
  letter-spacing: 0.06em;
  text-align: center;
}

.cycle-message.blessing {
  border: var(--border-gold-dim);
  background: rgba(212, 175, 55, 0.03);
  color: var(--gold-light);
}

.cycle-message.normal {
  border: 1px solid rgba(192, 192, 192, 0.2);
  background: rgba(192, 192, 192, 0.02);
  color: var(--silver);
}

.cycle-message.caution {
  border: 1px solid rgba(204, 136, 0, 0.3);
  background: rgba(204, 136, 0, 0.03);
  color: #CC8800;
}

.cycle-message.danger {
  border: 1px solid rgba(139, 0, 0, 0.4);
  background: rgba(139, 0, 0, 0.05);
  color: var(--red-light);
}

/* ============================================
   Retry Button
   ============================================ */

.retry-btn {
  display: block;
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  background: transparent;
  border: var(--border-gold-dim);
  border-radius: 2px;
  color: var(--text-secondary);
  font-family: var(--font-jp);
  font-size: 0.8125rem;
  letter-spacing: 0.3em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.retry-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ============================================
   Footer
   ============================================ */

.footer {
  text-align: center;
  padding-top: 20px;
  padding-bottom: 20px;
}

.footer-text {
  font-family: var(--font-en);
  font-size: 0.875rem;
  color: var(--gold);
  letter-spacing: 0.2em;
  opacity: 0.5;
  margin-bottom: 4px;
}

.footer-sub {
  font-size: 0.6875rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 480px) {
  .container {
    padding: 40px 16px 32px;
  }

  .title {
    font-size: 1.5rem;
    letter-spacing: 0.4em;
  }

  .select-group {
    gap: 8px;
  }

  .select-wrapper select {
    padding: 10px 24px 10px 12px;
    font-size: 0.8125rem;
  }

  .submit-btn {
    padding: 12px 36px;
    font-size: 0.9375rem;
  }

  .destiny-star-name {
    font-size: 1.375rem;
  }
}
