/* 占いサイト専用スタイル - 神秘的で魔法的なデザイン */

/* Google Fonts - 占い専用フォントの追加 */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,400&family=Zen+Maru+Gothic:wght@400;500;700&display=swap');

/* 全体の基本設定 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* HTML要素にも背景を強制適用 */
html {
  background-color: #1a0033 !important;
  background: linear-gradient(45deg, #1a0033 0%, #2d1b45 25%, #1a0033 50%, #4a1a4a 75%, #1a0033 100%) !important;
  background-size: 400% 400% !important;
  background-attachment: fixed !important;
  min-height: 100vh !important;
}

body {
  font-family: 'Cormorant Garamond', 'Zen Maru Gothic', serif;
  color: #f0e6ff !important;
  font-size: 1.1rem;
  line-height: 1.7;
  text-align: initial;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
  /* Safari対応の強化背景設定 */
  background-color: #1a0033 !important; /* フォールバック */
  background: -webkit-linear-gradient(45deg, #1a0033 0%, #2d1b45 25%, #1a0033 50%, #4a1a4a 75%, #1a0033 100%) !important;
  background: -moz-linear-gradient(45deg, #1a0033 0%, #2d1b45 25%, #1a0033 50%, #4a1a4a 75%, #1a0033 100%) !important;
  background: linear-gradient(45deg, #1a0033 0%, #2d1b45 25%, #1a0033 50%, #4a1a4a 75%, #1a0033 100%) !important;
  background-size: 400% 400% !important;
  -webkit-background-size: 400% 400% !important;
  background-attachment: fixed !important;
  animation: mysticalGradient 20s ease infinite;
  -webkit-animation: mysticalGradient 20s ease infinite;
  position: relative;
}

/* Safari対応の強化クラス */
body.background-image {
  background-color: #1a0033 !important; /* フォールバック */
  background: -webkit-linear-gradient(45deg, #1a0033 0%, #2d1b45 25%, #1a0033 50%, #4a1a4a 75%, #1a0033 100%) !important;
  background: -moz-linear-gradient(45deg, #1a0033 0%, #2d1b45 25%, #1a0033 50%, #4a1a4a 75%, #1a0033 100%) !important;
  background: linear-gradient(45deg, #1a0033 0%, #2d1b45 25%, #1a0033 50%, #4a1a4a 75%, #1a0033 100%) !important;
  background-size: 400% 400% !important;
  -webkit-background-size: 400% 400% !important;
  background-attachment: fixed !important;
  animation: mysticalGradient 20s ease infinite;
  -webkit-animation: mysticalGradient 20s ease infinite;
  position: relative;
}

/* 星空効果の追加 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, #fff, transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 90px 40px, #fff, transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
    radial-gradient(2px 2px at 160px 30px, #fff, transparent);
  background-repeat: repeat;
  background-size: 200px 100px;
  animation: twinkle 8s linear infinite;
  z-index: -1;
  opacity: 0.7;
}

/* Safari対応のWebKitアニメーション */
@-webkit-keyframes mysticalGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes mysticalGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@-webkit-keyframes twinkle {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* ヘッダーバナー */
.banner-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem;
  box-sizing: border-box;
  text-align: center;
}

.banner-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 20px;
  box-shadow: 
    0 0 30px rgba(186, 85, 211, 0.6),
    0 0 60px rgba(138, 43, 226, 0.4),
    inset 0 0 20px rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(186, 85, 211, 0.5);
  transition: all 0.3s ease;
}

.banner-wrapper img:hover {
  transform: scale(1.02);
  box-shadow: 
    0 0 40px rgba(186, 85, 211, 0.8),
    0 0 80px rgba(138, 43, 226, 0.6);
}

/* 神秘的なガラスボックス */
.glass-box {
  max-width: 800px;
  width: calc(100% - 2rem);
  margin: 2.5rem auto;
  padding: 2.5rem;
  background: linear-gradient(135deg, 
    rgba(138, 43, 226, 0.15) 0%,
    rgba(75, 0, 130, 0.2) 50%,
    rgba(186, 85, 211, 0.15) 100%);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: 25px;
  border: 2px solid rgba(186, 85, 211, 0.3);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 20px rgba(138, 43, 226, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: #f0e6ff;
  text-align: left;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  position: relative;
  overflow: hidden;
}

.glass-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.glass-box h2, .glass-box h3 {
  font-family: 'Cinzel', serif;
  color: #e6ccff;
  text-align: center;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 10px rgba(186, 85, 211, 0.8);
  font-weight: 600;
}

.glass-box h2 {
  font-size: 2rem;
}

.glass-box h3 {
  font-size: 1.6rem;
}

/* すりガラス風ボックス（入力エリア用） */
.frosted-box {
  max-width: 700px;
  width: calc(100% - 2rem);
  margin: 2.5rem auto;
  padding: 2.5rem;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.2) 0%,
    rgba(230, 204, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.1) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 25px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    0 0 25px rgba(186, 85, 211, 0.2);
  color: #2d1b45;
  text-align: center;
  position: relative;
}

/* テキストエリア */
textarea {
  width: 100%;
  max-width: 600px;
  height: 140px;
  padding: 20px;
  font-size: 1.2rem;
  line-height: 1.6;
  font-family: inherit;
  margin-top: 1.5rem;
  border: 2px solid rgba(186, 85, 211, 0.4);
  border-radius: 15px;
  background: linear-gradient(135deg, 
    rgba(26, 0, 51, 0.8) 0%,
    rgba(45, 27, 69, 0.9) 100%);
  color: #f0e6ff;
  box-sizing: border-box;
  resize: vertical;
  transition: all 0.3s ease;
}

textarea:focus {
  outline: none;
  border-color: #ba55d3;
  box-shadow: 
    0 0 20px rgba(186, 85, 211, 0.6),
    0 0 40px rgba(138, 43, 226, 0.3);
  transform: scale(1.02);
}

textarea::placeholder {
  color: #c49ae6;
  font-weight: 400;
  opacity: 0.8;
  font-style: italic;
}

/* テーマ選択エリア */
.theme-selection-area {
  margin-top: 2.5rem;
  text-align: center;
}

#theme-prompt-message {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: #e6ccff;
  text-shadow: 0 0 15px rgba(186, 85, 211, 0.8);
  margin-bottom: 2rem;
}

.theme-button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  margin-top: 2rem;
}

.theme-button {
  background: linear-gradient(135deg, 
    rgba(138, 43, 226, 0.8) 0%,
    rgba(75, 0, 130, 0.9) 50%,
    rgba(186, 85, 211, 0.8) 100%);
  color: #f0e6ff;
  padding: 15px 25px;
  font-size: 1.1rem;
  font-weight: 500;
  border-radius: 25px;
  border: 2px solid rgba(186, 85, 211, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  position: relative;
  overflow: hidden;
}

.theme-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.theme-button:hover::before {
  left: 100%;
}

.theme-button:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 
    0 10px 25px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(186, 85, 211, 0.6);
  border-color: #ba55d3;
}

.theme-button.selected {
  background: linear-gradient(135deg, #ffd700, #ffb347);
  color: #2d1b45;
  border-color: #ffd700;
  box-shadow: 
    0 0 25px rgba(255, 215, 0, 0.8),
    0 5px 15px rgba(0, 0, 0, 0.3);
}

/* ボタン類 */
button, .btn, .btn2 {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 15px 30px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

#fortune-btn, .btn-fortune {
  background: linear-gradient(135deg, 
    #ff6b6b 0%, 
    #ee5a24 50%, 
    #ff9ff3 100%);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 5px 15px rgba(238, 90, 36, 0.4),
    0 0 20px rgba(255, 107, 107, 0.3);
}

#fortune-btn:hover, .btn-fortune:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 
    0 8px 25px rgba(238, 90, 36, 0.6),
    0 0 30px rgba(255, 107, 107, 0.5);
}

.btn-buy {
  background: linear-gradient(135deg, 
    #6c5ce7 0%, 
    #a29bfe 50%, 
    #fd79a8 100%);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-buy:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 
    0 8px 25px rgba(108, 92, 231, 0.6),
    0 0 30px rgba(162, 155, 254, 0.5);
}

/* 固定ボタン */
.fixed-btn {
  position: relative;
  display: block;
  margin: 3rem auto 0 auto;
  width: fit-content;
  background: linear-gradient(135deg, 
    #fd79a8 0%, 
    #fdcb6e 50%, 
    #6c5ce7 100%);
  color: white;
  padding: 18px 35px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.2rem;
  font-family: 'Cinzel', serif;
  box-shadow: 
    0 8px 25px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(253, 121, 168, 0.4);
  z-index: 999;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.fixed-btn:hover {
  transform: translateY(-5px) scale(1.08);
  box-shadow: 
    0 12px 35px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(253, 121, 168, 0.6);
}

/* スピナー（ローディング） */
.spinner {
  border: 4px solid rgba(186, 85, 211, 0.3);
  border-top: 4px solid #ba55d3;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
  box-shadow: 0 0 20px rgba(186, 85, 211, 0.6);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ユーザーステータス */
.user-status {
  text-align: center;
  font-weight: bold;
  font-size: 1.1rem;
  color: #e6ccff;
  margin-top: 1.5rem;
  text-shadow: 0 0 10px rgba(186, 85, 211, 0.8);
}

/* ユーザー情報パネル */
.user-info-panel {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(42, 25, 75, 0.9);
  border: 1px solid rgba(186, 85, 211, 0.5);
  border-radius: 10px;
  padding: 10px 15px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(186, 85, 211, 0.3);
  z-index: 1000;
}

.user-info-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

#user-name {
  color: #f0e6ff;
  font-weight: 500;
}

.btn-logout {
  background: linear-gradient(135deg, #8B4A8B, #B555B5);
  color: white;
  border: none;
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Zen Maru Gothic', sans-serif;
}

.btn-logout:hover {
  background: linear-gradient(135deg, #A64DA6, #D066D0);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(186, 85, 211, 0.4);
}

/* ボタン行 */
.button-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* 非表示要素 */
.hidden {
  display: none;
}

/* 鑑定例ボックス */
#love-example {
  margin-top: 2.5rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  background: linear-gradient(135deg, 
    rgba(255, 105, 180, 0.15) 0%,
    rgba(138, 43, 226, 0.2) 50%,
    rgba(75, 0, 130, 0.15) 100%);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 2px solid rgba(255, 105, 180, 0.3);
  color: #f0e6ff;
  padding: 2.5rem;
  border-radius: 25px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 25px rgba(255, 105, 180, 0.3);
}

/* リスト要素のスタイル */
ul {
  margin-left: 1.5rem;
}

li {
  margin-bottom: 0.8rem;
  color: #e6ccff;
}

li strong {
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .glass-box, .frosted-box {
    margin: 1.5rem auto;
    padding: 1.5rem;
    width: calc(100% - 1rem);
  }
  
  .theme-button-group {
    gap: 10px;
  }
  
  .theme-button {
    padding: 12px 20px;
    font-size: 1rem;
  }
  
  .banner-wrapper {
    padding: 1rem;
  }
  
  .glass-box h2 {
    font-size: 1.6rem;
  }
  
  .glass-box h3 {
    font-size: 1.3rem;
  }
}

/* 追加の魔法的効果 */
@keyframes floatAnimation {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.theme-button:hover {
  animation: floatAnimation 2s ease-in-out infinite;
}

/* カスタムスクロールバー */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: rgba(26, 0, 51, 0.8);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ba55d3, #8a2be2);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #da70d6, #9932cc);
}

/* 初回お試し価格用のpulseアニメーション */
@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(78, 205, 196, 0.7);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.7);
  }
}