/*すべてのページに適応される設定*/
* {
  font-size: 18px;
  font-family: "Kaisei Decol", serif;
  font-weight: 400;
  font-style: normal;
  line-height: 1.8;
}

body {
  background-image: url(/img/AwakeAge/back.png);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #383838;
}

main {
  max-width: 500px;
  margin: 0 auto;
}

/**********タイトル画像**********/
.title {
  text-align: center;
  opacity: 0;
  animation: fadeIn 1s ease-in-out 0.3s forwards;
}

/* フェードインアニメーション */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.title img {
  width: 100%;
  height: auto;
}

/**********トップ説明とおじさん例**********/
.top_content {
  text-align: center;
  padding: 0 0.5em;
}

.top_content h1 {
  font-size: 1.3em;
  font-weight: bold;
  padding: 1em 0;
  opacity: 0;
  animation: fadeIn 1s ease-in-out 0.8s forwards;
}

.top_content_image {
  position: relative;
}

.top_content_image img {
  opacity: 0;
  animation: fadeIn 1s ease-in-out 1.3s forwards;
  width: 100%;
  height: auto;
}

/**********ショートスリーパーとロングスリーパーと比較タイトル**********/
.break {
  display: flex;
  justify-content: center;
}
.break h2 {
  text-align: center;
  font-size: 1.3em;
  font-weight: bold;
  margin: 2em 0 1em;
  padding: 1em;
}

/**********スクロールダウンボタン**********/
.arrow-area {
  position: relative;
  height: 0.5em;
}

/* アニメーション設定 */
.arrowWrap {
  position: absolute;
  top: 0;
  left: 50%;
}

.arrow1 {
  width: 15px;
  margin: 0 auto;
  -webkit-animation: arrow1 2s linear 0s infinite normal;
  animation: arrow1 2s linear 0s infinite normal;
}

.arrow2 {
  width: 15px;
  margin: 0 auto;
  -webkit-animation: arrow2 2s linear 0s infinite;
  animation: arrow2 2s linear 0s infinite;
}

.arrow1 span,
.arrow2 span {
  position: relative;
  display: block;
  left: 50%;
}

.arrow1 span {
  margin-top: -10px;
}

.arrow1 span:before,
.arrow2 span:before {
  content: "";
  width: 15px;
  height: 15px;
  border: 0;
  border-top: solid 2px #333;
  border-right: solid 2px #333;
  -webkit-transform: rotate(135deg);
  transform: rotate(135deg);
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  margin: auto;
  box-sizing: border-box;
}

@keyframes arrow1 {
  0% {
    -webkit-transform: translate3d(-50%, 0, 0);
    transform: translate3d(-50%, 0, 0);
  }

  20% {
    -webkit-transform: translate3d(-50%, 0, 0);
    transform: translate3d(-50%, 0, 0);
  }

  40% {
    -webkit-transform: translate3d(-50%, 10px, 0);
    transform: translate3d(-50%, 10px, 0);
  }

  60% {
    -webkit-transform: translate3d(-50%, 10px, 0);
    transform: translate3d(-50%, 10px, 0);
  }

  80% {
    -webkit-transform: translate3d(-50%, 0, 0);
    transform: translate3d(-50%, 0, 0);
  }

  100% {
    -webkit-transform: translate3d(-50%, 0, 0);
    transform: translate3d(-50%, 0, 0);
  }
}

@keyframes arrow2 {
  0% {
    -webkit-transform: translate3d(-50%, 10px, 0);
    transform: translate3d(-50%, 10px, 0);
  }

  20% {
    -webkit-transform: translate3d(-50%, 20px, 0);
    transform: translate3d(-50%, 20px, 0);
  }

  40% {
    -webkit-transform: translate3d(-50%, 20px, 0);
    transform: translate3d(-50%, 20px, 0);
  }

  60% {
    -webkit-transform: translate3d(-50%, 20px, 0);
    transform: translate3d(-50%, 20px, 0);
  }

  80% {
    -webkit-transform: translate3d(-50%, 10px, 0);
    transform: translate3d(-50%, 10px, 0);
  }

  100% {
    -webkit-transform: translate3d(-50%, 10px, 0);
    transform: translate3d(-50%, 10px, 0);
  }
}

/***********睡眠時間を入力するセクション***********/
.input_section {
  text-align: center;
  margin: 2em 1em;
  background: #d5e7f6;
  padding: 1em 0.5em 2.5em;
  border-radius: 10px;
}

.input_form h2 {
  text-align: center;
  margin: 1em 0;
  font-size: 1.3em;
}

/* 入力フォーム */
.input_form p {
  padding: 0.5em 0;
}

/* 年齢入力 */
#input_age {
  width: 3em;
  margin: 0 0.3em;
}
/* 睡眠時間入力 */
#input_sleepTime {
  width: 3em;
  margin: 0 0.3em;
}

/* 送信ボタン */

button#input_btn {
  display: block;
  text-align: center;
  margin: 2em auto 0;
  padding: 0.5em 1.8em;
  font-weight: bold;
  border-radius: 100vh;
  border: none;
  border-bottom: 7px solid #036a8e;
  background: #2daed9;
  color: #ffffff;
}
button#input_btn:hover {
  transform: translateY(4px);
  box-shadow: none;
}

/***********結果セクション***********/
.result_section {
  text-align: center;
  margin: 2em 1em;
  background: #d5e7f6;
  padding: 1em 0.5em 2.5em;
  border-radius: 10px;
  display: none;
}

.result_section h2 {
  text-align: center;
  margin: 1em 0;
  font-size: 1.3em;
}

p.result_age {
  font-size: 1.1em;
}

p.result_age span {
  font-size: 1.5em;
  font-weight: bold;
}

/* 円グラフのスタイリング */
#myPieChart {
  width: 100%;
  max-width: 300px;
  height: 300px;
  margin: 2em auto 1em;
  display: block;
  border-radius: 10px;
}

/* グラフが読み込まれていない場合のフォールバック表示 */
.chart-fallback {
  text-align: center;
  padding: 20px;
  background: #f0f0f0;
  border-radius: 10px;
  margin: 20px 0;
}

.chart-fallback h3 {
  margin-bottom: 15px;
  color: #333;
}

.chart-fallback p {
  font-size: 18px;
  margin: 10px 0;
  color: #666;
}

/* 人生の何%が夢の中か */
#result_percent {
  font-size: 1.2em;
  font-weight: bold;
  padding: 0 0.2em;
}

.result_year {
  margin: 1em 0;
}

#result_year {
  font-size: 1.2em;
  font-weight: bold;
  padding: 0 0.2em;
}

/* ショートスリーパーとロングスリーパーと比較するセクション */
.result_comparison {
  margin: 2em 0;
}

.result_comparison_title {
  position: relative;
  margin: 2em 1em 1em;
  font-size: 1.1em;
  font-weight: bold;
  z-index: 2;
}

.result_comparison_title:before {
  content: "";
  position: absolute;
  background: #a6ddb0a1;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
}

#short_sleeper_age {
  font-size: 1.2em;
  font-weight: bold;
  padding: 0 0.2em;
}

.short_sleeper_image {
  position: relative;
  margin: 1em 0;
}

.short_sleeper_image img {
  width: 100%;
  height: auto;
}

.short_sleeper_image p {
  position: absolute;
  top: 68%;
  border-radius: 40px;
  left: 27%;
  color: #252323;
  font-weight: bold;
  display: inline-block;
  background: linear-gradient(to right, #f7e471, transparent);
  padding: 0.2em 1em;
  text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff, -1px 1px 0 #fff,
    1px -1px 0 #fff, 0px 1px 0 #fff, 0 -1px 0 #fff, -1px 0 0 #fff, 1px 0 0 #fff;
}

#short_sleeper_img_age {
  font-size: 1.5em;
  font-weight: bold;
}

.long_sleeper {
  margin: 3em 0 1em;
}

#long_sleeper_age {
  font-size: 1.2em;
  font-weight: bold;
  padding: 0 0.2em;
}

.long_sleeper_image {
  position: relative;
  margin: 1em 0;
}

.long_sleeper_image img {
  width: 100%;
  height: auto;
}

.long_sleeper_image p {
  position: absolute;
  top: 68%;
  border-radius: 40px;
  left: 52%;
  color: #252323;
  font-weight: bold;
  display: inline-block;
  background: linear-gradient(to right, #0395c8, transparent);
  padding: 0.2em 1em;
  text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff, -1px 1px 0 #fff,
    1px -1px 0 #fff, 0px 1px 0 #fff, 0 -1px 0 #fff, -1px 0 0 #fff, 1px 0 0 #fff;
}

#long_sleeper_img_age {
  font-size: 1.5em;
  font-weight: bold;
}

/* SNSシェアセクション */
.sns_share {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1em;
}

button#shareButton {
  display: block;
  text-align: center;
  margin: 2em auto 0;
  padding: 0.5em 1.8em;
  font-weight: bold;
  border-radius: 100vh;
  border: none;
  border-bottom: 7px solid #036a8e;
  background: #2daed9;
  color: #ffffff;
}
button#shareButton:hover {
  transform: translateY(4px);
  box-shadow: none;
}

/**********睡眠の豆知識セクション**********/
.info {
  position: relative;
  margin: 3em auto 2em;
  padding: 1em 35px 3em 25px;
  width: 90%;
  background-color: #d3e4f3;
  color: #666666;
  box-shadow: 4px 4px 1px #0686b2;
}

.info::before {
  position: absolute;
  content: "";
  top: -15px;
  right: 10px;
  height: 55px;
  width: 15px;
  border: 3px solid #c0c0c0; /*クリップ色 */
  background-color: none;
  border-radius: 12px;
  box-shadow: 1px 1px 2px #ccc; /*クリップ影*/
  transform: rotate(10deg);
  z-index: 1;
}
.info::after {
  position: absolute;
  content: "";
  top: 0px;
  width: 10px;
  right: 20px;
  border: solid 5px #d3e4f3;
  z-index: 2;
}

/* 睡眠の豆知識セクションのタイトル */
.info h2 {
  position: relative;
  color: #158b2b;
  font-size: 1.3em;
  padding: 10px 0;
  text-align: center;
  margin: 1.5em 0;
}
.info h2:before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 150px;
  height: 73px;
  border-radius: 50%;
  border: 5px solid #a6ddb0;
  border-left-color: transparent;
  border-right-color: transparent;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
}

/* 睡眠の豆知識セクションのh3 */
.info h3 {
  position: relative;
  padding: 2em 0 1em;
  font-size: 1.1em;
  font-weight: bold;
  z-index: 2;
}

.info h3:before {
  content: "";
  position: absolute;
  background: #a6ddb0a1;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  top: 50%;
  left: 5px;
  transform: translateY(-50%);
  z-index: -1;
}

/**********footer**********/
footer {
  text-align: center;
  margin-top: 2em;
  padding: 1em;
}

footer p {
  text-align: center;
  margin: 1em 0;
}
