/* 
 * praise_habits.css
 * 人を褒める習慣 - プレミアムデザイン
 */

:root {
  --praise-primary: #f87171; /* Soft coral/red */
  --praise-secondary: #fbbf24; /* Golden yellow */
  --praise-accent: #38bdf8; /* Sky blue */
  --praise-bg-soft: #fff7ed; /* Very light orange/peach */
  --praise-text: #334155;
  --praise-text-light: #64748b;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.4);
}

/* Background Atmosphere */
.praise-bg-atmosphere {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: linear-gradient(135deg, #fffcf5 0%, #fff7f7 100%);
  overflow: hidden;
}

.light-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: orb-float 20s infinite alternate ease-in-out;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--praise-secondary);
  top: -100px;
  left: -100px;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: var(--praise-primary);
  bottom: -150px;
  right: -100px;
  animation-delay: -5s;
}

@keyframes orb-float {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(50px, 100px) scale(1.2);
  }
}

/* Hero Header */
.hero-header {
  text-align: center;
  padding: 4rem 1rem;
  margin-bottom: 2rem;
}

.hero-symbol {
  font-size: 3rem;
  color: var(--praise-primary);
  margin-bottom: 1.5rem;
  animation: float-y 3s infinite ease-in-out;
}

.hero-badge {
  display: inline-block;
  padding: 0.4rem 1.2rem;
  background: rgba(248, 113, 113, 0.1);
  color: var(--praise-primary);
  border-radius: 20px;
  font-family: "Outfit", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.magic-title-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.title-main-text {
  font-family: "Kaisei Opti", serif;
  font-size: 3.5rem;
  font-weight: 700;
  background: linear-gradient(
    to right,
    var(--praise-primary),
    var(--praise-secondary)
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--praise-text-light);
  margin-top: 1rem;
  font-family: "Zen Kurenaido", sans-serif;
}

/* --- Premium Atmosphere --- */

body::before {
  content: "";
  position: fixed;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  background:
    radial-gradient(
      circle at 10% 20%,
      rgba(251, 113, 133, 0.04) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 90% 80%,
      rgba(251, 191, 36, 0.04) 0%,
      transparent 40%
    );
  pointer-events: none;
  z-index: -1;
  animation: aura-shift 25s ease-infinite alternate;
}

/* Boxes & Cards - Glass Style */
.content-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(0px);
  padding: 4rem;
  border-radius: 40px;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.02),
    0 0 0 1px rgba(0, 0, 0, 0.01);
  margin-bottom: 4rem;
  transition:
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    backdrop-filter 0.6s ease;
  position: relative;
  overflow: visible;
  will-change: transform;
}

.content-card:hover {
  transform: translateY(-12px);
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
  box-shadow:
    0 40px 100px rgba(251, 113, 133, 0.08),
    0 0 40px rgba(255, 255, 255, 0.5);
}

.content-card h2 {
  position: relative;
  font-family: "Kaisei Opti", serif;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 2.5rem;
  padding-bottom: 1.2rem;
  background: linear-gradient(
    135deg,
    var(--praise-primary),
    var(--praise-secondary),
    var(--praise-primary)
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  animation: shine-text 8s linear infinite;
  white-space: nowrap; /* Prevents wrapping within the card width */
}

@keyframes shine-text {
  to {
    background-position: 200% center;
  }
}

.content-card h2 i {
  -webkit-text-fill-color: var(--praise-primary);
  margin-right: 0.8rem;
  font-size: 1.8rem;
  vertical-align: middle;
  filter: drop-shadow(0 0 5px rgba(248, 113, 113, 0.2));
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.content-card:hover h2 i {
  transform: rotate(12deg) scale(1.15);
}

.content-card h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(
    to right,
    var(--praise-primary),
    var(--praise-secondary)
  );
  border-radius: 10px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.content-card:hover h2::after {
  width: 100%;
}

.soul-reflection-box {
  background: linear-gradient(to right, #ffffff, #fffafa);
  padding: 2.5rem;
  border-radius: 24px;
  border-left: 8px solid var(--praise-secondary);
  box-shadow: 0 15px 40px rgba(248, 113, 113, 0.05);
  margin: 3rem 0;
  font-style: italic;
  color: #4b5563;
  position: relative;
  line-height: 2;
}

.soul-reflection-box::before {
  content: "\f21e"; /* Heartbeat icon */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  right: 2rem;
  bottom: 1rem;
  font-size: 3.5rem;
  color: rgba(248, 113, 113, 0.04);
  pointer-events: none;
}

.focus-box {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 245, 245, 0.9) 100%
  );
  padding: 2rem; /* Slightly reduced padding */
  border-radius: 24px;
  border: 1px solid rgba(248, 113, 113, 0.2);
  box-shadow: 0 15px 35px rgba(248, 113, 113, 0.1);
  margin: 1.5rem 0; /* Tighter margin */
}

.focus-box h2 {
  color: var(--praise-primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.quote-card {
  text-align: center;
  padding: 3.5rem 2.5rem;
  background: linear-gradient(135deg, #fffdf5 0%, #fffcf0 100%);
  border-radius: 40px;
  box-shadow:
    0 15px 45px rgba(251, 191, 36, 0.08),
    inset 0 0 30px rgba(255, 255, 255, 0.9);
  margin: 3.5rem 0;
  border: 1px solid rgba(251, 191, 36, 0.15);
  position: relative;
}

.quote-card::before {
  content: "\f10d"; /* Quote left */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  top: 1.5rem;
  left: 2rem;
  font-size: 2.5rem;
  color: rgba(251, 191, 36, 0.1);
}

.quote-card p {
  font-size: 1.5rem;
  font-family: "Kaisei Opti", serif;
  color: #92400e;
  line-height: 2.2;
  margin: 0;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* Magic Comparison */
.praise-magic-section h2 {
  margin-bottom: 3rem;
}

/* 3D Flip Container */
.magic-comparison-perspective {
  perspective: 1500px;
  margin: 3rem 0;
}

.magic-comparison-inner {
  position: relative;
  width: 100%;
  transition: transform 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-style: preserve-3d;
  height: 320px; /* コンテンツが収まるように高さを拡張 */
}

/* フリップ実行クラス（縦回転） */
.magic-comparison-inner.is-flipped {
  transform: rotateX(180deg);
}

.magic-comparison-front,
.magic-comparison-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible; /* はみ出し防止のためvisibleに */
}

/* --- フロント面（数式） --- */
.magic-comparison-front {
  background: var(--praise-bg-soft);
  gap: 1.5rem;
  padding: 0 2rem;
  /* z-index: 2; /* 念のため */
}

/* アニメーション用初期状態 */
.magic-item,
.magic-plus,
.magic-equals,
.magic-result {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

/* 親要素が visible になったら表示（Innerにis-visibleをつける想定） */
.magic-comparison-inner.is-visible .magic-item,
.magic-comparison-inner.is-visible .magic-plus,
.magic-comparison-inner.is-visible .magic-equals,
.magic-comparison-inner.is-visible .magic-result {
  opacity: 1;
  transform: translateY(0);
}

/* 順番にディレイをかける（ゆったりとしたリズム） */
.magic-comparison-inner.is-visible .smile {
  transition-delay: 0.2s;
}
.magic-comparison-inner.is-visible .magic-plus {
  transition-delay: 0.7s;
}
.magic-comparison-inner.is-visible .praise {
  transition-delay: 1.2s;
}
.magic-comparison-inner.is-visible .magic-equals {
  transition-delay: 1.7s;
}
.magic-comparison-inner.is-visible .magic-result {
  transition-delay: 2.3s;
}

/* --- バック面（メッセージ） --- */
.magic-comparison-back {
  background: linear-gradient(135deg, #fffcf0 0%, #fff7ed 100%);
  transform: rotateX(180deg);
  border: 4px solid var(--praise-secondary);
  box-shadow: 0 20px 50px rgba(251, 191, 36, 0.15);
}

.back-content {
  text-align: center;
  padding: 2rem;
}

.magic-icon {
  font-size: 2.5rem;
  color: var(--praise-secondary);
  margin-bottom: 1rem;
  display: block;
}

.final-magic-message {
  font-family: "Kaisei Opti", serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #92400e;
  line-height: 1.6;
}

.ultra-highlight {
  position: relative;
  display: inline-block;
  color: #f59e0b;
  font-size: 2rem;
  margin: 0 4px;
  background: linear-gradient(to right, #f87171, #fbbf24);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.magic-item {
  text-align: center;
}

.magic-visual {
  width: 90px;
  height: 90px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.05),
    inset 0 -5px 10px rgba(0, 0, 0, 0.02);
  margin-bottom: 0.8rem;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.magic-item:hover .magic-visual {
  transform: scale(1.1) rotate(5deg);
}

.smile .magic-visual i {
  color: #fbbf24;
}
.praise .magic-visual i {
  color: #f87171;
}

.magic-plus,
.magic-equals {
  font-size: 2rem;
  font-weight: 300;
  color: #cbd5e1;
}

.magic-result {
  background: linear-gradient(135deg, var(--praise-secondary), #f59e0b);
  color: white;
  padding: 1.2rem 2.5rem;
  border-radius: 60px;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow:
    0 15px 35px rgba(251, 191, 36, 0.3),
    0 0 0 4px rgba(251, 191, 36, 0.1);
  white-space: nowrap;
}

.highlight-pulse {
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
  50% {
    transform: scale(1.2);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
  }
  100% {
    transform: scale(1);
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
}

.impact-text {
  text-align: center;
  font-weight: 700;
  color: var(--praise-primary);
  font-size: 1.2rem;
  margin-top: 1.5rem !important;
}

/* Loop Box */
.loop-effect-box {
  background: #f1f5f9;
  padding: 2rem;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  margin: 2rem 0;
}

.loop-effect-box h4 {
  color: #475569;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Psychology Box */
.psychology-box {
  background: white;
  padding: 2.5rem;
  border-radius: 28px;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
}

/* --- Phrase Palette (Updated with Popup) --- */
.praise-phrase-palette {
  margin-top: 5rem;
  padding: 4rem 2rem;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50px;
  border: 1px solid rgba(251, 191, 36, 0.2);
  position: relative;
  overflow: visible; /* バッジがはみ出せるように */
}

/* 操作ガイドを表示 */
.praise-phrase-palette::after {
  content: "Click or Tap Phrase!";
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--praise-secondary);
  color: white;
  padding: 4px 15px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  box-shadow: 0 4px 10px rgba(251, 191, 36, 0.3);
  z-index: 5;
}

.palette-title {
  font-family: "Kaisei Opti", serif;
  font-size: 1.8rem;
  color: #92400e;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.palette-subtitle {
  text-align: center;
  color: var(--praise-text-light);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.tap-here-instruction {
  text-align: center;
  color: #d97706; /* 濃いめの落ち着いたゴールド */
  font-family: "Kaisei Opti", serif;
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
  letter-spacing: 0.05em;
  animation: small-bounce 2s infinite ease-in-out;
}

@keyframes small-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.phrase-chips-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.phrase-chip {
  padding: 1.2rem 2.2rem;
  border-radius: 24px;
  border: none;
  background: white;
  color: #4b5563;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.05),
    inset 0 -4px 0 rgba(0, 0, 0, 0.03);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 180px;
}

.phrase-chip i {
  font-size: 1.4rem;
  color: var(--praise-secondary);
  margin-bottom: 0.2rem;
}

.phrase-chip:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 15px 35px rgba(251, 191, 36, 0.15);
  background: linear-gradient(to bottom, #ffffff, #fffdf0);
}

.phrase-chip:active {
  transform: translateY(2px) scale(0.98);
}

/* --- Pop-up Overlay (Strict word_vault style Full Screen) --- */
.praise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.98); /* 真っ白に近い全画面表示 */
  backdrop-filter: blur(15px);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  padding: 2rem;
  text-align: center;
}

.praise-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.overlay-card {
  max-width: 800px;
  width: 100%;
  position: relative;
  padding: 4rem 2rem;
}

.overlay-message {
  font-size: 2.2rem;
  color: #1e293b;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 2rem;
  font-family: "Kaisei Opti", serif;
}

.overlay-author {
  font-size: 1.25rem;
  color: var(--accent-color);
  font-family: "Outfit", sans-serif;
  font-weight: 700;
}

.overlay-quote-icon {
  font-size: 4rem;
  color: var(--accent-glow);
  position: absolute;
  opacity: 0.3;
}

.overlay-quote-icon.top {
  top: 0;
  left: 0;
}

.overlay-quote-icon.bottom {
  bottom: 0;
  right: 0;
}

.close-hint {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  letter-spacing: 2px;
  color: #94a3b8;
  font-weight: 700;
}

/* Coffee Simulation */
.coffee-sim-section {
  padding: 4rem 0;
}

.sim-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

/* Magic Keywords */
.magic-word {
  position: relative;
  display: inline-block;
  color: var(--praise-primary);
  font-weight: 800;
  cursor: pointer;
  z-index: 10;
  padding: 0 4px;
  transition: all 0.3s ease;
}

.magic-word::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 30%;
  background: linear-gradient(
    to right,
    rgba(251, 113, 133, 0.1),
    rgba(251, 191, 36, 0.1)
  );
  z-index: -1;
  transition: height 0.3s ease;
}

.magic-word:hover {
  transform: scale(1.2) translateY(-5px);
  text-shadow: 0 5px 15px rgba(248, 113, 113, 0.3);
}

.magic-word:hover::before {
  height: 100%;
}

.sim-card {
  background: white;
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.sim-card:hover {
  transform: translateY(-10px);
}

.sim-header {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--praise-text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.chat-bubble {
  padding: 1rem 1.5rem;
  border-radius: 18px;
  max-width: 90%;
  font-size: 0.95rem;
  line-height: 1.5;
}

.chat-bubble.left {
  align-self: flex-start;
  background: #f1f5f9;
  border-bottom-left-radius: 2px;
}

.chat-bubble.right {
  align-self: flex-end;
  background: var(--praise-accent);
  color: white;
  border-bottom-right-radius: 2px;
}

.chat-bubble.highlight {
  background: var(--praise-primary);
  cursor: pointer;
  position: relative;
}

.click-hint {
  position: absolute;
  top: -20px;
  right: 0;
  font-size: 0.7rem;
  background: var(--praise-secondary);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
}

.sim-footer {
  margin-top: auto;
  padding-top: 1rem;
  color: var(--praise-text-light);
  font-size: 0.9rem;
  text-align: center;
  position: relative;
}

.heart-container {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.sim-insight {
  margin-top: 3rem;
  padding: 1rem 0;
}

.sim-insight p {
  line-height: 1.8;
  color: var(--text-main);
}

/* Science Box */
.science-box {
  background: #fafafa;
  padding: 2.5rem;
  border-radius: 24px;
  border: 1px dashed #cbd5e1;
  margin-bottom: 2.5rem;
}

.science-box h3 {
  color: #334155;
  margin-bottom: 1.5rem;
}

/* Energy Loop */
.energy-loop-section {
  margin: 5rem 0;
  position: relative;
}

.energy-canvas-container {
  width: 100%;
  height: 400px;
  background: linear-gradient(
    135deg,
    #fff1f2 0%,
    #ffe4e6 100%
  ); /* Ethereal Pastel Rose */
  border-radius: 30px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

#energy-loop-canvas {
  width: 100%;
  height: 100%;
}

.energy-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 80%;
  color: #9f1239; /* Deep Rose Text for readability */
  z-index: 2;
  pointer-events: none;
}

.energy-overlay h3 {
  color: #881337;
  margin-bottom: 1rem;
}
.energy-overlay p {
  color: #be123c;
  margin-bottom: 1rem;
}
.highlight-text {
  font-weight: 700;
  color: #e11d48;
  font-size: 1.2rem;
}

/* Conclusion */
.conclusion-block {
  text-align: center;
}

.final-question-card {
  background: white;
  padding: 3rem;
  border-radius: 30px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
  margin-top: 4rem;
  border: 2px solid var(--praise-secondary);
}

.final-question-card h3 {
  color: var(--praise-secondary);
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 900px) {
  .sim-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .title-main-text {
    font-size: 2.5rem;
  }
  .magic-comparison {
    flex-wrap: wrap;
  }
}

/* JS-Driven Reveal Helpers */
.reveal-hidden {
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-active {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
}

/* Section Badge */
.section-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.section-badge.silver {
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
}
