@charset "utf-8";

*,
::before,
::after {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

html {
  touch-action: manipulation;  /* ダブルタップ禁止 */
}

p {
  text-align: center;
}

body {
  font-family: 'Noto Sans JP', 'ヒラギノ角ゴ ProN', 'Hiragino Kaku Gothic ProN',
  '游ゴシック', 'Yu Gothic', sans-serif;
	user-select: none;
  -webkit-tap-highlight-color: transparent;  /* タップしても暗くならない */
}

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

h4 {
  text-align: center;
  margin-top: 10px;
}

#openModal {
  margin-top: 10px;
  padding: 5px 10px;
  font-size: 16px;
  font-family: 'Noto Sans JP', 'ヒラギノ角ゴ ProN', 'Hiragino Kaku Gothic ProN',
  '游ゴシック', 'Yu Gothic', sans-serif;
  /* font-weight: bold; */
  background: none;
  border-color: #000;
  color: #000;
  cursor: pointer;
}

#openModal:hover {
  background-color: lightgray;
}

/* モーダル背景 */
.modal {
  display: none; /* 初期は非表示 */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

/* モーダル内容 */
.modal-content {
  background-color: white;
  margin: 10% auto;
  padding: 30px 15px;
  border-radius: 10px;
  width: 90%;
  max-width: 750px;
  position: relative;
  text-align: left;
}

/* 閉じるボタン */
.close-button {
  position: absolute;
  top: 5px;
  right: 10px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}

.close-button:hover {
  color: red;
}

.center-box {
  display: flex;
  flex-direction: column;     /* 縦並び */
  align-items: center;        /* 横中央寄せ */
  padding: 10px;
  text-align: center;
}

.mark_yellow {
  background: linear-gradient(transparent 60%, #ffff00 0%);
}

.menu-board {
  width: 700px;
  margin: calc((100vh - 800px) / 2) auto;
  font-family: "Montserrat", sans-serif;
}

.sengo {
  font-family: 'Noto Sans JP', 'ヒラギノ角ゴ ProN', 'Hiragino Kaku Gothic ProN',
  '游ゴシック', 'Yu Gothic', sans-serif;
}

.top-menu,
.bottom-menu {
  width: 100%;
  height: 50px;
  font-size: 30px;
  display: flex;
}

.sengo {
  margin-top: auto;
  margin-bottom: 2px;
  margin-left: 8px;
  font-size: 20px;
}

.sengo-::before{
  border: 1px solid #2196f3;
}
.sengo-::after{
  background-color: #2196f3;
}

/* ★レベル */
.level {
  margin-top: auto;
  margin-left: 20px;
  font-size: 20px;
  display: inline-flex;
  flex-direction: row-reverse;
}

.hidden-visually {
  border: 0;
  clip: rect(1px 1px 1px 1px);
  clip: rect(1px, 1px, 1px, 1px);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.level-label {
  cursor: pointer;
  color: gray;
  padding-left: 2px;
  padding-right: 2px;
}

.level-icon::before {
  content: "★";
  font-size: 26px;
}

.level-input:hover ~ .level-label {
  color: lightgray;
}

.level-input:checked ~ .level-label {
  color: #ffbb00;
}

.cpu-lv {
  margin: auto 2px 4px 0;
}

.turn {
  margin: auto 8px 2px auto;
}

.bottom-menu {
  align-items: center;
  justify-content: center;
}

.play,
.reset {
  width: 150px;
  text-align: center;
  cursor: pointer;
}

.board {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #F1E88F;
  display: flex;
  flex-flow: column;
  justify-content: center;
}

.hexagons {
  height: 10%;
  display: flex;
  justify-content: center;
  margin: -0.8% 0;
}

.hexagon {
  position: relative;
  margin: 0 -0.96%;
	height: 100%;
  transform: rotate(90deg);
	aspect-ratio: 200000 / 173205; /* 正六角形になる比率 */
	background-color: #333;
	clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

.hexagon::after {
  position: absolute;
  inset: 0;
  margin: auto;
  content: '';
  width: 96%;
	height: 96%;
	background-color: #fff;
	clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

.hexagon.move-mass::after {
  /* animation: flash 1s linear infinite; */
  background-color: rgb(253, 224, 170);
  cursor: pointer;
}

.gray::after {
  background-color: #DCDDDD;
}

#hexagons-template,
#hexagon-template {
  display: none;
}

/* コマの描画 */
.piece {
  position: absolute;
  cursor: pointer;
}

.piece[data-state="2"],
.piece[data-state="4"] {
  inset: 0;
  margin: auto;
  z-index: 1;
  width: 54%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background-color: red;
}

.piece[data-state="1"],
.piece[data-state="3"] {
  top: 0;
  bottom: 0;
  left: 8%;
  margin: auto;
  z-index: 1;
  width: 35%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background-color: red;
}

.piece[data-state="1"]::before,
.piece[data-state="3"]::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 185%;
  margin: auto;
  height: 120%;
  aspect-ratio: 1 / 3;
  border-radius: 50%;
  background-color: red;
}

.piece[data-state="1"]::after,
.piece[data-state="3"]::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 68%;
  margin: auto;
  height: 150%;
  aspect-ratio: 100 / 124;
  transform: rotate(-90deg);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  background-color: red;
}

.piece[data-state="4"],
.piece[data-state="3"],
.piece[data-state="3"]::before,
.piece[data-state="3"]::after {
  background-color: blue;
}

/* ゲーム終了表示 */
.fin {
  width: 200px;
  height: 70px;
  text-align: center;
  line-height: 70px;
  background-color: #fff;
  font-size: 18pt;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  position: absolute;
  left: 0;
  right: 0;
  margin: auto;
  z-index: 2;
  display: none;
}

.close-btn {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 3;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background-color: red;
  cursor: pointer;
}

.close-btn::before,
.close-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 16px;
  background-color: #fff;
}

.close-btn::before {
  transform: translate(-50%,-50%) rotate(45deg);
}

.close-btn::after {
  transform: translate(-50%,-50%) rotate(-45deg);
}

/* @keyframes flash {
  0%,100% {
    opacity: 1;
  }
  50% {
    background-color: rgb(253, 224, 170);
  }
} */

@media (max-width: 700px) {

  .center-box {
    margin-top: 5px;
    position: absolute;
    width: 100vw;
    z-index: 2;
  }

  .menu-board {
    position: absolute;
    z-index: 1;
    width: 100vw;
    margin: calc((100vh - 100vw - 150px) / 2) auto;  /* safari以外 */
    margin: calc((100dvh - 100vmin - 150px) / 2) auto;
    /* margin: calc((100dvh - 100vmin - 150px) / 2) auto; */
  }

  /* モーダル内容 */
  .modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px 12px;
    border-radius: 10px;
    width: 95%;
  }

  #openModal {
    margin-top: 5px;
    padding: 3px 8px;
    font-size: 14px;
  }

  .close-button {
    top: 0px;
    right: 5px;
  }

  h4 {
    margin-top: 5px;
  }

  h4, p, ul, ol {
    font-size: 14px;
  }

  .sengo,
  .level {
    font-size: 14px;
  }

  .level {
    margin-left: 14px;
  }

  .level-icon::before {
    font-size: 20px;
  }

  .level-label {
    padding-left: 1.5px;
    padding-right: 1.5px;
  }

  .top-menu,
  .bottom-menu {
    font-size: 20px;
  }

  .play,
  .reset {
    width: 100px;
  }
}
