/** ベーススタイル */
html {
  font-size: 100%; /* 通常16px相当 */
  margin: 0px; /* ブラウザのデフォルトマージンをリセット */
  touch-action: manipulation;
}

/** フォント全体設定 */
/* タイトル用フォント */
@font-face {
  font-family: "misaki_gothic_2nd";
  src: url("fonts/misaki_gothic_2nd.ttf") format("truetype");
  font-weight: bold;
  font-style: normal;
}

/* 本文用フォント */
@font-face {
  font-family: "JF-Dot-k12x10";
  src: url("fonts/JF-Dot-k12x10.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

/** ライト⇔ダークモード　カラー設定 */
/** ユーザー設定に合わせる用 */
:root {
  --bg: #e0e0e0; /*全体の背景色*/
  --fg: #4d4c4b; /*全体の文字色*/
  --nb: #f7f6f2; /*ナビゲーションの背景*/
  --a: #0077cc; /*リンク：通常時*/
  --av: #0000ff; /*リンク：訪問済み*/
  --ah: #ff0000; /*リンク：ホバー時*/
  --lb: #2d2f41; /*LBボタン背景*/
  --lf: #fff; /*LBボタン文字*/
  --lh: var(--ah); /*ボタン背景:ホバー時*/
  --dl: #423a3a; /*準備中リンク*/

  #img-top {
    content: url("image/top_light.GIF");
  }

  #iconX {
    content: url("image/X_logo-black.png");
  }
  #iconGithub {
    content: url("image/github-mark.png");
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    /*ユーザーがダークモードを使っている*/
    --bg: #2d2f41; /*全体の背景色*/
    --fg: #fff; /*全体の文字色*/
    --nb: #747796; /*ナビゲーションの背景*/
    --a: #66bfff; /*リンク：通常時*/
    --av: #00ffff; /*リンク：訪問済み*/
    --ah: #ff0000; /*リンク：ホバー時*/
    --lb: #f0f0f0; /*ボタン背景*/
    --lf: #000; /*ボタン文字*/
    --lh: var(--ah); /*ボタン背景:ホバー時*/
    --dl: #1a4058; /*準備中リンク*/

    #img-top {
      content: url("image/top_dark.GIF");
    }

    #iconX {
      content: url("image/X_logo-white.png");
    }
    #iconGithub {
      content: url("image/github-mark-white.png");
    }
  }
}

/** JS用　ボタン切替時の色切替 */
body.light-mode {
  --bg: #e0e0e0; /*全体の背景色*/
  --fg: #4d4c4b; /*全体の文字色*/
  --nb: #ffffff; /*ナビゲーションの背景*/
  --a: #0077cc; /*リンク：通常時*/
  --av: #0000ff; /*リンク：訪問済み*/
  --ah: #ff0000; /*リンク：ホバー時*/
  --lb: #2d2f41; /*LBボタン背景*/
  --lf: #fff; /*LBボタン文字*/
  --lh: var(--ah); /*ボタン背景:ホバー時*/
  --dl: #423a3a; /*準備中リンク*/

  #img-top {
    content: url("image/top_light.GIF");
  }

  #iconX {
    content: url("image/X_logo-black.png");
  }
  #iconGithub {
    content: url("image/github-mark.png");
  }
}

body.dark-mode {
  /*ユーザーがダークモードを使っている*/
  --bg: #2d2f41; /*全体の背景色*/
  --fg: #fff; /*全体の文字色*/
  --nb: #747796; /*ナビゲーションの背景*/
  --a: #66bfff; /*リンク：通常時*/
  --av: #00ffff; /*リンク：訪問済み*/
  --ah: #ff0000; /*リンク：ホバー時*/
  --lb: #f0f0f0; /*LBボタン背景*/
  --lf: #000; /*LBボタン文字*/
  --lh: var(--ah); /*ボタン背景:ホバー時*/
  --dl: #1a4058; /*準備中リンク*/

  #img-top {
    content: url("image/top_dark.GIF");
  }

  #iconX {
    content: url("image/X_logo-white.png");
  }
  #iconGithub {
    content: url("image/github-mark-white.png");
  }
}

/** 全体設定 */
body {
  font-family: "misaki_gothic_2nd", "JF-Dot-k12x10", "游ゴシック", sans-serif;
  line-height: 1.5;
  margin: 0;
  background-color: var(--bg);
  color: var(--fg);
}

/** トップ画面 */
.header {
  display: flex;
  justify-content: center; /* 横方向中央 */
  align-items: center; /* 縦方向中央 */
  height: 100dvh; /* どのデバイスでも1画面で表示 */
}

main {
  max-width: 700px; /* 最大幅を700pxに制限 */
  width: 100%; /* 横幅は可能な限り広げる（画面幅に応じて） */
  margin: 0 auto; /* 中央寄せ */
  padding: 0 1rem; /* スマホでも余白ができるように*/
  box-sizing: border-box; /*この要素の外枠全体で何pxにしたいかを素直に指定できる。*/
}

h1 {
  writing-mode: vertical-rl; /* 縦書き */
  font-size: 250%;
  padding-right: 3rem;
}

.top-block {
  display: flex;
  flex-direction: column; /* 上下に並べる */
  align-items: flex-start;
  position: relative;
  gap: 1rem;
}

#img-top {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-top: 30px solid rgb(146, 146, 146);
  border-bottom: 30px solid rgb(146, 146, 146);
}

.nav-block {
  display: flex;
  gap: 0.5rem; /* ナビとSNSの間の余白 */
  width: 100%;
  max-width: 400px; /* 画像と合わせる */
}

.nav {
  flex: 5;
  display: flex; /* 中身（ul）を中央に配置するため */
  justify-content: center; /* 横方向の中央寄せ */
  align-items: center; /* 縦方向の中央寄せ */

  width: 100%;
  max-width: 400px;
  height: 210px; /*縦幅*/
  margin: 8px;

  background-color: var(--nb); /*背景色 */
  border: 10px double rgb(167, 167, 167);
  border-radius: 10px; /* 枠線の丸み*/
}

.nav ul {
  list-style: none; /* リストのドットを消す */
  text-align: left;

  gap: 1.5rem;

  display: flex;
  flex-direction: column; /* 縦並びにする */
  margin-left: -4rem;
}

.disabledLink {
  pointer-events: none; /* クリックを無効にする */
  color: var(--dl) !important; /*文字色*/
  text-decoration: none; /*文字の装飾をなくす*/
  cursor: default; /*マウスカーソルを通常の矢印にする*/
}

/** SNSアイコンの設定 */
.snsLinks img {
  width: 30px;
  height: auto;
  display: flex;
  padding: 10px;
  margin: -2px;
}

#iconX,
#iconGithub,
#iconNote {
  flex: 3;
  display: flex; /* 中身（ul）を中央に配置するため */
  flex-direction: column; /* 縦並びにする */
  justify-content: center; /* 横方向の中央寄せ */
  align-items: center; /* 縦方向の中央寄せ */

  background-color: var(--nb); /*背景色 */
  border-radius: 50%; /* 枠線の丸み*/
  box-shadow: 0 5px 0 #acabab;
  transition: all 0.3s;
}

#iconX:hover,
#iconGithub:hover,
#iconNote:hover {
  transform: translate(0, 3px);
  box-shadow: 0 2px 0 #acabab;
}

/** ライトモードボタン */
#L-Bbutton {
  font-family: "misaki_gothic_2nd", "JF-Dot-k12x10", "游ゴシック", sans-serif;
  width: 100px; /* 横幅*/
  height: 30px; /*縦幅*/

  background-color: var(--lb); /* 背景色 */
  color: var(--lf);

  border: 2px solid rgb(255, 255, 255);
  border-radius: 20px; /* 枠線の丸み*/

  position: absolute;
  top: -10%; /* 中段よりやや上に調整 */
  right: 0%; /* 右端に近づける */
  box-shadow: 0 5px 0 #acabab;
  transition: all 0.3s;
}

#L-Bbutton:hover {
  transform: translate(0, 3px);
  box-shadow: 0 2px 0 #acabab;
}

/**　プロフィール  */

.jikosyoukai {
  display: flex;
  align-items: flex-start;
  background-color: var(--nb); /*背景色 */
  border: 10px double rgb(167, 167, 167); /* 点線のボーダー */
  border-radius: 10px; /* 枠線の丸み*/
}

#icon-small {
  width: 100px; /* 横幅*/
  height: auto; /*縦幅*/
  flex: 1;
}

.jikosyoukai p {
  flex: 6;
}

.status0 {
  display: flex;
  align-items: flex-start;
  color: #ffffff;
  margin-top: 1rem;
  background-color: rgb(0, 0, 0); /*背景色 */
  border: 10px double rgb(233, 233, 233); /* 点線のボーダー */
  border-radius: 10px; /* 枠線の丸み*/
}

.status0 p {
  line-height: 2.5;
  margin: 1rem 0rem 1rem 1rem; /*上右下左*/
}

.status1 {
  flex: 1;
  padding: 1rem;
}

.status2 {
  flex: 1;
  padding: 1rem;
}

.purpose_article {
  background-color: var(--nb);
  border-radius: 10px;
  border: 10px solid var(--nb);
}

.portfolio_article {
  background-color: var(--nb);
  border-radius: 10px;
  border: 10px solid var(--nb);
  padding: 1rem;
}

/**　文字の設定 */
/* リンク文字 */
a {
  color: var(--a);
  margin: 1rem;
  font-size: clamp(0.9rem, 2vw, 1rem);
  line-height: 1.9;
}
a:visited {
  color: var(--av);
}
a:hover,
a:visited:hover {
  color: var(--ah);
}

/* セクションタイトル */
.sectionTitle {
  margin-bottom: 2rem;
  border-bottom: 2px dotted rgb(255, 0, 0); /* 点線のボーダー */
}

article {
  text-align: left; /* 文字は左揃え */
}

/* ちょっと大きめの文字 */
h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  margin-top: 3rem;
}

h3:hover {
  color: var(--ah);
}

nav p {
  font-family: "misaki_gothic_2nd", "JF-Dot-k12x10", "游ゴシック", sans-serif;
}

/* 通常の文字 */
p   {
  font-family: "JF-Dot-k12x10", "游ゴシック", sans-serif;
  margin: 1rem;
  font-size: clamp(0.9rem, 2vw, 1rem);
  line-height: 1.9;
}

.prof1 {
  background-color: var(--lb); /* 背景色 */
  color: var(--lf);
}

.backToTop, .footer-text {
  display: block;
  text-align: center;
  margin: 2rem;
  padding: 2rem;
}

.OGP{
  display: block;
  text-align: center;
}

.OGP_img {
  width: 90%;
  max-width: 350px;
}

.OGP_img:hover {
  transform: translateY(-8px);
}

/*スマホのみ改行 */
.br-sp {
  display: none;
}
/*PCのみ改行 */
.br-pc {
  display: inline;
}

/**ゲームの画面　*/
/*画面の表示⇔非表示 */
.screen {
  display: flex;
  justify-content: center; /* 横方向中央 */
  align-items: center; /* 縦方向中央 */
  padding: 3rem 0;
}
.hidden {
  display: none;
}

.rendaBlock {
  width: 100%;
  max-width: 500px;
  height: 550px;

  background-color: var(--nb); /*背景色 */
  border: 10px double rgb(167, 167, 167);
  border-radius: 10px; /* 枠線の丸み*/
  padding: 1rem;
  box-sizing: border-box;
  text-align: center;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#rendatitle {
  font-size: clamp(1.5rem, 13vw, 4rem);
  /* clamp(最小値, 推奨値（可変）, 最大値) */
  font-family: "JF-Dot-k12x10", "游ゴシック", sans-serif;
  transform: translateY(-3rem);
}

#startBtn {
  font-family: "misaki_gothic_2nd", "JF-Dot-k12x10", "游ゴシック", sans-serif;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  width: 180px; /* 横幅*/
  height: 100px; /*縦幅*/

  background-color: var(--lb); /* 背景色 */
  color: var(--lf);

  border: 2px solid rgb(255, 255, 255);
  border-radius: 20px; /* 枠線の丸み*/
  box-shadow: 0 7px 0 #acabab;
  transition: all 0.2s;
}

#startBtn:hover {
  transform: translate(0, 7px);
  box-shadow: 0 2px 0 #acabab;
}

#readyMessage {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  margin-top: 2rem;
}

#readyTime {
  font-size: clamp(2rem, 18vw, 6rem);
}

#rendaBtn {
  font-family: "JF-Dot-k12x10", "游ゴシック", sans-serif;
  font-size: clamp(2rem, 15vw, 3.5rem);
  width: 300px; /* 横幅*/
  height: 150px; /*縦幅*/

  background-color: var(--lb); /* 背景色 */
  color: var(--lf);

  border: 2px solid rgb(255, 255, 255);
  border-radius: 20px; /* 枠線の丸み*/
  box-shadow: 0 8px 0 #acabab;

  text-align: left;
  padding-left: 4rem;
  transform: translateY(-3rem);
}

#rendaBtn:active {
  transform: translate(0, -2.5rem);
  box-shadow: 0 2px 0 #acabab;
}

#rendaEnd p{
  font-size: clamp(2rem, 10vw, 6rem);
  padding-left: 2rem;
}

#playTime,
#playScore {
  transform: translateY(-4rem);
}

#playTime,
#playScore,
#resultScore,
#rank {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
}

.playScore {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
}

#rankImg {
  width: 150px; /* 横幅*/
  height: auto; /*縦幅*/
}

#rankMessage {
  font-size: clamp(0.8rem, 1.5vw, 1rem);
}

#retryBtn {
  font-family: "misaki_gothic_2nd", "JF-Dot-k12x10", "游ゴシック", sans-serif;
  font-size: clamp(1rem, 2.5vw, 1.6rem);
  width: clamp(180px, 30vw, 250px);
  height: clamp(70px, 8vw, 80px);
  padding: 0.8rem;

  background-color: var(--lb);
  color: var(--lf);

  border: 2px solid rgb(255, 255, 255);
  border-radius: 20px;
  box-shadow: 0 5px 0 #acabab;
  transition: all 0.2s;
}

#retryBtn:hover {
  transform: translate(0, 3px);
  box-shadow: 0 2px 0 #acabab;
}

#postToX {
  font-family: "JF-Dot-k12x10", "游ゴシック", sans-serif;
}

#resultScore,
#rank,
#rankMessage,
#retryBtn {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/** スマホ時の縦並び切り替え */
@media screen and (max-width: 600px) {
  .br-sp {
    display: inline;
  }
  .br-pc {
    display: none;
  }

  .header {
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    height: auto; /* 画面幅に合わせて高さ可変に */
  }

  h1 {
    writing-mode: horizontal-tb;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-right: 0rem;
  }

  .top-block {
    align-items: center; /* 画像・ナビ・SNSを中央に寄せる */
  }

  .nav-block {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .status0 {
    flex-direction: column;
    padding: 1rem;
  }

  #img-top,
  .nav {
    width: 90vw;
    max-width: 400px;
    margin: 0 auto 1rem auto;
  }

  .snsLinks {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    width: 90vw;
    max-width: 400px;
    margin: 0 auto 1rem auto;
  }

  .snsLinks img {
    width: 30px;
    height: auto;
    padding: 10px;
    margin: 0;
  }

  #L-Bbutton {
    position: static;
    display: block;
    width: 50%;
    max-width: 160px;
    margin: 1rem auto 0 auto;
  }

  .jikosyoukai {
    flex-direction: column;
    width: 95%;
    max-width: 400px;
  }
}
