/*
 * Reine HANA Lenormand App Stylesheet
 * HANA歌ルンルン・ルノルマンカード占い 専用デザイン
 */

:root {
  --hana-pink:        #e8789a;     /* ピンク */
  --hana-pink-light:  #fff0f5;     /* 極薄ピンク */
  --hana-yellow:      #f5c842;     /* イエロー */
  --hana-bg:          #fff8fb;     /* 薄いピンクホワイト */
  --hana-text:        #3a2e32;     /* 文字ブラウン */
  --hana-muted:       #8a787c;     /* ミュート色 */
  --hana-border:      #f5e1e6;     /* 枠線色 */
  --hana-shadow:      rgba(232, 120, 154, 0.15);
}

/* アプリ全体コンテナ */
.hana-lenormand-app {
  max-width: 680px;
  margin: 30px auto;
  padding: 30px 24px;
  background: #ffffff;
  border: 1px solid var(--hana-border);
  border-radius: 12px;
  box-shadow: 0 4px 24px var(--hana-shadow);
  font-family: "Noto Serif JP", serif;
  color: var(--hana-text);
  line-height: 1.6;
}

/* ヘッダー */
.hana-header {
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 2px solid var(--hana-pink-light);
  padding-bottom: 20px;
  margin-bottom: 25px;
}

.hana-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--hana-pink);
  background: var(--hana-pink-light);
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(232, 120, 154, 0.2);
}

.hana-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hana-title-area {
  display: flex;
  flex-direction: column;
}

.hana-author {
  font-size: 14px;
  color: var(--hana-pink);
  font-weight: 700;
  margin-bottom: 4px;
  font-family: "M PLUS 1", sans-serif;
  letter-spacing: 0.05em;
}

.hana-app-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--hana-text);
  margin: 0;
  font-family: "Shippori Mincho", serif;
}

/* 導入メッセージ */
.hana-intro {
  margin-bottom: 30px;
  text-align: center;
}

.hana-bubble {
  font-family: "Shippori Mincho", serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--hana-pink);
  margin: 0;
}

/* 占いゲームステージ */
.hana-game-stage {
  background: var(--hana-bg);
  border: 1px dashed var(--hana-pink);
  border-radius: 10px;
  padding: 40px 20px;
  text-align: center;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}

/* 裏向きカード配置コンテナ */
.hana-deck-draw {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 25px;
  min-height: 160px;
  position: relative;
}

@media (max-width: 540px) {
  .hana-deck-draw {
    gap: 8px;
  }
}

/* 3Dカードコンポーネント */
.hana-card-placeholder {
  width: 90px;
  height: 122px; /* 1:1.36 に完全に一致 */
  perspective: 1000px; /* 3D効果用 */
  cursor: pointer;
  position: relative;
  transition: transform 0.25s ease, opacity 0.4s ease;
}

@media (max-width: 540px) {
  .hana-card-placeholder {
    width: 65px;
    height: 88px; /* 1:1.36 に完全に一致 */
  }

  /* スマホ表示でスクショ1枚に納めるための余白・サイズコンパクト化 */
  .hana-results-container {
    margin-top: 15px;
    padding-top: 15px;
  }
  .hana-revealed-card-img {
    width: 113px; /* 126pxのさらに10%縮小 (126 * 0.9 = 113px) */
    margin: 0 auto 10px;
  }
  .hana-result-section {
    margin-bottom: 12px;
  }
  .hana-result-section .section-title {
    margin-bottom: 6px;
    font-size: 12px;
  }
  .keywords-box {
    padding: 8px 12px;
  }
  .keywords-text {
    font-size: 13px;
  }
  .hana-message {
    padding: 12px 14px;
    margin-bottom: 15px;
  }
  .hana-message-text {
    font-size: 13.5px;
  }
  .hana-avatar {
    width: 65px;
    height: 65px;
  }
  .hana-header {
    margin-bottom: 15px;
    padding-bottom: 15px;
  }
  .hana-intro {
    margin-bottom: 15px;
  }
  .hana-bubble {
    padding: 10px 14px;
    font-size: 13.5px;
  }
}

/* ホバー時の微小ポップアップ効果 */
.hana-card-placeholder:not(.selected):hover {
  transform: translateY(-8px);
}

/* アニメーション用：選ばれなかったカードのフェードアウト */
.hana-card-placeholder.fade-out {
  opacity: 0 !important;
  pointer-events: none;
  transform: scale(0.8) translateY(20px);
}

/* アニメーション用：選ばれたカードの中央移動 */
.hana-card-placeholder.selected {
  position: absolute;
  left: 50% !important;
  transform: translateX(-50%) scale(1.2);
  z-index: 10;
  cursor: default;
}

.hana-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* カード反転時のスタイル */
.hana-card-placeholder.flipped .hana-card-inner {
  transform: rotateY(180deg);
}

/* 表裏の共通面設定 */
.hana-card-back, .hana-card-front {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

/* カードの裏面：ピンク×イエローのグラデーション */
.hana-card-back {
  background: linear-gradient(135deg, var(--hana-pink), var(--hana-yellow));
  border: 3px solid #ffffff;
  border-radius: 8px; /* 裏面のみ角丸を適用 */
  box-shadow: 0 4px 12px rgba(232, 120, 154, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 裏面のシンボリックな装飾 */
.hana-card-back::after {
  content: '✨';
  font-size: 24px;
  color: #ffffff;
  opacity: 0.9;
}

/* カードの表面：白地や枠線を廃し、アセット画像をそのまま露出させる */
.hana-card-front {
  background: transparent;
  border: none;
  border-radius: 0;
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.hana-card-front img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* 指示ヒント */
.hana-instruction-hint {
  font-family: "M PLUS 1", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--hana-pink);
  animation: hana-pulse 1.8s infinite ease-in-out;
}

@keyframes hana-pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; transform: scale(1.02); }
  100% { opacity: 0.6; }
}

/* ローディング */
.hana-loading-wrapper {
  text-align: center;
  padding: 40px 0;
}

.hana-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--hana-pink-light);
  border-top: 3px solid var(--hana-pink);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: hana-spin 0.8s linear infinite;
}

.hana-loading-text {
  font-size: 14px;
  color: var(--hana-pink);
  font-weight: 700;
}

@keyframes hana-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 結果表示エリア */
.hana-results-container {
  margin-top: 30px;
  border-top: 2px solid var(--hana-pink);
  padding-top: 30px;
  animation: hana-fade-in 0.4s ease;
}

@keyframes hana-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* めくったカードの拡大表示ボックス */
.hana-card-reveal-box {
  text-align: center;
  margin-bottom: 25px;
}

.hana-revealed-card-img {
  width: 126px; /* 10% 縮小 */
  height: auto;
  margin: 0 auto 15px;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  overflow: visible;
}

.hana-revealed-card-img img {
  width: 100%;
  height: auto;
  display: block;
}

.hana-revealed-card-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--hana-text);
  margin: 0;
  font-family: "Shippori Mincho", serif;
}

/* 結果セクション共通 */
.hana-result-section {
  margin-bottom: 25px;
}

.hana-result-section .section-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--hana-pink);
  margin-bottom: 10px;
  letter-spacing: 0.03em;
  font-family: "M PLUS 1", sans-serif;
}

.keywords-box {
  background: var(--hana-pink-light);
  border: 1px solid var(--hana-border);
  border-radius: 6px;
  padding: 10px 15px;
}

.keywords-text {
  font-family: "M PLUS 1", sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--hana-text);
  margin: 0;
  text-align: center;
}

/* HANAからのメッセージ */
.hana-message {
  background: var(--hana-bg);
  border: 1px solid rgba(232, 120, 154, 0.3);
  border-radius: 12px;
  padding: 20px;
  box-shadow: inset 0 2px 6px rgba(232, 120, 154, 0.03);
}

.hana-message-text {
  font-family: 'M PLUS 1', sans-serif;
  font-size: 14px;
  line-height: 1.9;
  margin: 0;
  color: var(--hana-text);
  text-align: justify;
}

/* もう1枚引くボタン */
.hana-submit-btn-wrap {
  text-align: center;
  margin-top: 30px;
  border-top: 1px solid var(--hana-border);
  padding-top: 25px;
}

.hana-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--hana-pink), #d85c80);
  color: #ffffff;
  border: none;
  border-radius: 50px;
  padding: 12px 35px;
  font-family: "Noto Serif JP", serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(232, 120, 154, 0.25);
  transition: all 0.2s ease;
  letter-spacing: 0.05em;
}

.hana-reset-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(232, 120, 154, 0.3);
}

.hana-reset-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(232, 120, 154, 0.2);
}

/* AI鑑定誘導CTA */
.hana-cta {
  background: var(--hana-pink-light);
  border: 1px solid var(--hana-border);
  border-radius: 8px;
  padding: 24px 20px;
  text-align: center;
  margin-top: 35px;
  box-shadow: 0 2px 12px rgba(232, 120, 154, 0.05);
}

.hana-cta p {
  font-family: "Shippori Mincho", serif;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--hana-text);
}

.hana-cta-btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--hana-yellow), #e0b42f);
  color: var(--hana-text) !important;
  text-decoration: none !important;
  font-family: "Noto Serif JP", serif;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 32px;
  border-radius: 50px;
  box-shadow: 0 4px 12px rgba(245, 200, 66, 0.25);
  transition: all 0.2s ease;
}

.hana-cta-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 5px 15px rgba(245, 200, 66, 0.3);
}

/* エラー表示 */
.hana-error-wrapper {
  background: #fff8f7;
  border: 1px solid #fce8e6;
  border-radius: 6px;
  padding: 16px 20px;
  margin-top: 20px;
}

.hana-error-message {
  color: #c7362a;
  font-family: "M PLUS 1", sans-serif;
  font-size: 13.5px;
  margin: 0;
}

/* デバッグコンソール */
.hana-debug-toggle-area {
  margin-top: 12px;
  border-top: 1px solid #fce8e6;
  padding-top: 10px;
}

.hana-debug-toggle-btn {
  font-size: 11px;
  color: #a84c44;
  text-decoration: none;
  font-family: "M PLUS 1", sans-serif;
}

.hana-debug-toggle-btn:hover {
  text-decoration: underline;
}

.hana-debug-log-box {
  margin-top: 8px;
  background: #2b2b2b;
  color: #81c784;
  padding: 12px;
  border-radius: 4px;
  max-height: 250px;
  overflow-y: auto;
}

.hana-debug-log-content {
  margin: 0;
  font-family: monospace;
  font-size: 10.5px;
  white-space: pre-wrap;
  word-break: break-all;
}
