html {
  font-size: 62.5%;
}

* {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Arial", "メイリオ", "Quicksand";
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.8), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.7), transparent),
    radial-gradient(2px 2px at 160px 30px, rgba(255,255,255,0.5), transparent);
  background-repeat: repeat;
  background-size: 300px 200px;
  pointer-events: none;
  opacity: 0.7;
  z-index: 1;
}

.btn {
  width: 300px;
  height: 100px;
  border-radius: 20px;
  background: linear-gradient(135deg, #F9D3E3, #ff6b9d);
  font-size: 2rem;
  font-weight: 500;
  color: white;
  border: none;
  box-shadow: 0 8px 25px rgba(249, 211, 227, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(249, 211, 227, 0.6);
}

#start-screen, #quiz-screen, #dialog-screen, #result-screen {
  display: none;
}

.container {
  text-align: center;
}

/* 全体的なカードデザイン */
.section-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 40px;
  margin: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#header {
  background: linear-gradient(135deg, #ff6b9d, #F9D3E3);
  position: relative;
  overflow: hidden;
}

.s-with-heart {
  position: relative;
}

.heart {
  position: absolute;
  left: 100%; /* Sの右端から開始 */
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  margin-left: 10px; /* 少し間隔をあける */
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: translateY(-50%) scale(1); }
  50% { transform: translateY(-50%) scale(1.2); }
}

#header h1 {
  font-weight: bold;
  font-size: 3.5rem;
  padding: 30px;
  margin-bottom: 0;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 2;
}

.explanation-box {
  background-color: #FFF9EE;
  padding: 30px;
  margin-bottom: 50px ;
  border: 1px solid #333333;
  border-radius: 20px;
  box-shadow: 5px 5px 10px rgba(51, 51, 51, 0.3);
}

.explanation-box p {
  font-size: 2.4rem;
  font-weight: normal;
  line-height: 60px;
  letter-spacing: 0.5px;
}

.explanation-box p span {
  font-size: 3.2rem;
  color: #EB6D9A;
}
/*---------quiz-screen---------------*/
/* 既存のCSSに追加 */
.dialog-wrapper,
.quiz-talk {
  box-sizing: border-box;
}

.dialog-wrapper {
  border: 2px solid #ff6b9d;
  background: linear-gradient(145deg, #FFF9EE, #fff5f8);
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 8px 25px rgba(255, 107, 157, 0.2);
  max-width: 800px;
  width: 100%; /* 幅を100%に設定 */
  margin: 0 auto;
  position: relative;
}

.quiz-talk {
  background: linear-gradient(135deg, #ffffff, #fef7f7);
  border: 2px solid #ff6b9d;
  border-radius: 20px;
  padding: 25px 30px;
  margin: 20px 0; /* 左右のmarginを削除 */
  position: relative;
  box-shadow: 0 5px 15px rgba(255, 107, 157, 0.15);
  width: 100%; /* 親要素の幅に合わせる */
}

/* 吹き出しの三角部分 */
.quiz-talk::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 60px;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 12px solid #ff6b9d;
}

.quiz-talk::after {
  content: '';
  position: absolute;
  top: -8px;
  left: 62px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid #ffffff;
}

.himeka-img {
  display: block;
  width: 300px; /* 固定幅に変更 */
  height: 300px; /* 高さも指定 */
  object-fit: cover; /* 画像の縦横比を保持しつつフィット */
  margin: 20px auto; /* 上下に余白を追加 */
  border-radius: 50%; /* 円形にして可愛らしく */
  border: 3px solid #ff6b9d; /* ピンクの枠線でアクセント */
  box-shadow: 0 5px 15px rgba(255, 107, 157, 0.3); /* ピンクの影 */
  transition: transform 0.3s ease; /* ホバー効果用 */
}

.himeka-img:hover {
  transform: scale(1.05); /* ホバー時に少し拡大 */
}

.dialog-box {
  border: 1px solid #333333;
  padding: 30px;
}

.question-text {
  font-size: 2.8rem;
  font-weight: 500;
  color: #2d3436;
  line-height: 1.6;
  padding-left: 30px;
  text-shadow: 1px 1px 2px rgba(255, 107, 157, 0.1);
  text-align: left;  
  /* シンプルな表示設定 */
  white-space: normal;
  overflow: visible;
  width: 100%;
  display: block;
  min-height: 60px; /* 最小高さを確保 */
}

.question-text.typing::after {
  content: '|';
  color: #ff6b9d;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.options-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 20px;
  width: 90%;
  margin: 30px auto;
  padding: 20px;
}

.option-btn {
  background: linear-gradient(135deg, #ffeaa7, #fab1a0);
  border: none;
  padding: 20px;
  border-radius: 15px;
  font-size: 1.8rem;
  font-weight: 500;
  color: #2d3436;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.option-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.option-btn:hover::before {
  width: 300px;
  height: 300px;
}

.option-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  background: linear-gradient(135deg, #fd79a8, #fdcb6e);
}

.option-btn:active {
  transform: translateY(0);
}

.quiz-talk {
  background-color: #ffffff;
  width: 100%;
  margin: 0 auto;
}

/*---- dialog-result-screen----*/
.before-dialog-text {
  font-size: 2rem;
  padding: 30px;
}

.dialog-text {
  font-size: 2.8rem;
  padding-bottom: 30px;
  opacity: 0;
  transform: perspective(400px) rotateY(90deg);
  animation: flipIn 0.8s ease-out forwards;
  animation: flipIn 1s ease-out 2s forwards;
}

@keyframes flipIn {
  0% {
    opacity: 0;
    transform: perspective(400px) rotateY(90deg);
  }
  40% {
    transform: perspective(400px) rotateY(-10deg); /* 反対側に少し回転 */
  }
  70% {
    transform: perspective(400px) rotateY(10deg);
  }
  100% {
    opacity: 1;
    transform: perspective(400px) rotateY(0deg);
  }
}

/*----result-screen----*/
.result-wrapper {
  max-width: 800px;
  max-height: 800px;
  margin: 0 auto 30px auto;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 20px;
  padding: 30px;
  position: relative;
  overflow: hidden;
  animation: resultAppear 1s ease-out;
}

@keyframes resultAppear {
  0% {
    opacity: 0;
    transform: scale(0.8) rotateY(180deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotateY(0deg);
  }
}

.img {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 500px;
  height: 500px;
  margin: 0 auto 20px auto;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 
    0 0 20px rgba(255, 255, 255, 0.3),
    0 0 40px rgba(255, 107, 157, 0.2),
    0 0 60px rgba(255, 107, 157, 0.1);
  position: relative;
}

.img::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: rotate 3s linear infinite;
}

@keyframes rotate {
  100% { transform: rotate(360deg); }
}

#result-title {
  font-size: 4rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 30px;
  background: linear-gradient(45deg, #ff6b9d, #4ecdc4, #45b7d1, #96ceb4);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease-in-out infinite;
  text-shadow: 0 0 30px rgba(255, 107, 157, 0.5);
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.result-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  position: relative;
  z-index: 2;
}

.result-description {
  font-size: 2.4rem;
  line-height: 1.8;
  padding: 30px;
  text-align: center;
  color: white;
  margin: 20px 0;
  animation: textGlow 2s ease-in-out infinite alternate;
}

@keyframes textGlow {
  from { text-shadow: 0 0 5px rgba(255, 255, 255, 0.5); }
  to { text-shadow: 0 0 20px rgba(255, 255, 255, 0.8); }
}


/*-----レスポンシブ-----*/
@media screen and (max-width: 480px) {
  /*----header-----*/
  #header h1 {
    font-size: 2.4rem;
    padding: 20px;
  }

  .section-container {
    padding: 20px;
  }

  .explanation-box {
    padding: 20px;
    margin-bottom: 30px ;
  }

  .explanation-box p {
    font-size: 1.6rem;
    line-height: 36px;
  }
  .explanation-box p .spot-text {
    line-height: inherit;
    font-size: 1.6rem;
  }

  .btn {
    width: 100%;
    height: 100%;
    padding: 10px 0;
  }

  /*----question-screen----*/
  .himeka-img {
    width: 60vw;
    height: 60vw;
    margin: 0 auto 20px auto;
  }

  .question-text {
    font-size: 1.6rem;
    margin-bottom: 20px;
    padding: 0;
  }

  .options-container {
    display: block;
    margin: 0;
    padding: 0;
    width: 100%;
  }

  .option-btn {
    font-weight: normal;
    font-size: 1.6rem;
    width: 100%;
    height: auto;
    min-height: 30px; /* 最小高さを確保 */
    margin-bottom: 15px;
    padding: 10px 0;
  }

  .option-btn:last-child {
    margin-bottom: 0;
  }

  /*------result-dialog-screen--------*/
  .quiz-talk p {
    text-align: left;
    padding: 0;
    font-size: 1.6rem;
  }

  .before-dialog-text {
    margin-bottom: 20px;
  }

  /*------result-screen--------*/
  .result-wrapper {
    padding: 20px;
  }

  #result-title {
    font-size: 2.4rem;
    margin-bottom: 20px;
  }

  .img {
    width: 60vw;
    height: 60vw;
    max-width: 280px;
    max-height: 280px;
    margin: 0 auto 20px auto;
  }

  .result-description {
    font-size: 1.6rem;
    margin: 0;
    padding: 0;
  }
}