/* --------------- */
/* img          */
/* --------------- */
.board-img {
  max-width: 100%;
  margin-bottom: 20px;
}

/* --------------- */
/* overlay         */
/* --------------- */

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0);
  z-index: 1001;
  display: none;
  overflow: hidden;
}

#popup-overlay {
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
}

#move-overlay {
  z-index: 1001;
}

#board-overlay {
  z-index: 1002;
  position: absolute;
  inset: 0;
}

#nav-overlay {
  background: rgba(0, 0, 0, 0.4);
  z-index: 1003;
}

/* --------------- */
/* Button          */
/* --------------- */

/* Menu button */
.menu-btn-div.column-div,
.menu-btn-div .column-div {
  gap: 3px;
}

.menu-btn-div label {
  font-size: 0.6rem;
  text-align: center;
  line-height: 1.0;
  width: 42px;
}

.menu-btn {
  width: 42px;
  height: 42px;
  padding: 6px;

  border: none;
  border-radius: 12px;
  cursor: pointer;
  background-color: transparent;

  display: flex;
  align-items: center;
  justify-content: center;

  transition: background-color 0.25s ease, transform 0.1s ease;
}

.menu-btn.blue {
  background-color: var(--color-blue);
  color: var(--color-white);
}

.menu-btn.orange {
  background-color: var(--color-orange);
}

.menu-btn.red {
  background-color: var(--color-red);
}

.menu-btn.white {
  background-color: var(--color-beige-light);
}

.menu-btn.gray {
  background-color: var(--color-gray);
}

.menu-btn.beige {
  background-color: var(--color-beige-medium);
}


/* スマホ用（画面幅768px以下） */
@media (max-width: 768px) {
  .menu-btn-div label {
    width: 30px;
  }

  /* 上書き NEWサイズ調整 */
  .menu-btn {
    font-size: 0.7rem;
  }
}


/* disabled */
.menu-btn:disabled {
  background-color: var(--color-gray);
  cursor: not-allowed;
  opacity: 0.6;
}

/* hover */
.menu-btn:hover {
  transform: scale(1.07);
}

/* img */
.menu-btn img {
  width: 70%;
  height: 70%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.menu-btn.img-100 img {
  width: 100%;
  height: 100%;
}

/* スマホ用（画面幅768px以下） */
@media (max-width: 768px) {
  .menu-btn {
    width: 30px;
    height: 30px;
  }
}


/* Play Now button */
.play-now-div {
  width: fit-content;
  margin: 30px auto 0;
}

.play-now-div a {
  text-decoration: none;
  color: var(--color-white);
  font-weight: bold;
}

.play-now-btn {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: 20px;
  border-radius: 30px;
  height: 15px;
  width: 150px;
  background-color: var(--color-orange);
}

/* --------------- */
/* Navigate Button */
/* --------------- */
#button-navigate {
  display: flex;
  flex-direction: row;
  justify-content: center;
  margin: 30px 0;
  gap: 10px;
}

#playback-btn {
  color: var(--color-white);
  font-size: 1.2rem;
}

@media (max-width: 768px) {
  #playback-btn {
    font-size: 0.7rem;
    ;
  }
}

/* --------------- */
/* Popup           */
/* --------------- */

/* Message PopUp    */
#message-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 10px;
  background: var(--color-white);
  padding: 20px 24px;
  width: min(70vmin, 300px);
  text-align: center;
  z-index: 1101;
  display: none;
}

#message-text {
  margin-bottom: 2px;
  font-size: 14px;
  font-weight: normal;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

#redirect-message {
  display: none;
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.6;
  white-space: normal;
  word-break: break-word;
}

.message-btn-div {
  margin: 20px auto 0;
  justify-content: center;
  align-self: center;
}

#message-yesno {
  display: none;
}

#message-close {
  display: none;
}

.message-btn {
  text-align: center;
  margin: 0 auto;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  width: 80px;
  height: 42px;
}

.message-btn.blue {
  background-color: var(--color-blue);
  color: var(--color-white);
}

.message-btn.dark-blue {
  background-color: var(--color-blue-dark);
  color: var(--color-white);
}

.message-btn.white {
  background-color: var(--color-white);
}

.message-btn.gray {
  background-color: var(--color-gray);
  color: var(--color-white);
}

.message-btn.orange {
  background-color: var(--color-orange);
  color: var(--color-white);
}


/* Select Game PopUp */
#select-game-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 10px;
  background: var(--color-white);
  padding: 20px 24px;
  width: min(70vmin, 300px);
  text-align: center;
  z-index: 1101;
  display: none;
  max-height: 90vh;
}

#select-game-text {
  margin-bottom: 2px;
  font-size: 14px;
  font-weight: normal;
  line-height: 1.6;
  word-break: break-word;
}

#user-game-list {
  width: 80%;
  max-height: 70vh;
  overflow-x: hidden;
  overflow-y: auto;
  margin: 10px auto;
  padding: 0 20px;

  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-game-btn {
  width: 100%;
  align-items: center;
  padding: 10px 0;
  gap: 5px;
  background: var(--color-white);
  border: 1px solid var(--color-blue-dark);
  cursor: pointer;
  border-radius: 8px;
}

.user-game-btn span {
  line-height: 1;
}

.game-name {
  color: var(--color-blue-dark);
  font-weight: bold;
}

.game-active {
  color: var(--color-orange);
}

.game-player {
  font-weight: bold;
  color: var(--color-blue-dark);
}

.game-detail,
.game-date {
  gap: 10px;
}

.game-date {
  font-size: 0.8rem;
  margin: 5px auto;
  color: var(--color-beige-dark);
}



/* --------------- */
/* Bot Thinking Spinner */
/* --------------- */
.hidden {
  display: none !important;
}

/* common/parts/bot_thinking_spinner.html。対局画面(#engine-spinner)と解析画面(#analyzing-overlay)で共用 */
.spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  color: #fff;
  z-index: 1200;
}

/* .bot-thinking をぐるぐるの中央に置くための基準 */
.spinner-ring {
  position: relative;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 5px solid var(--color-gray);
  border-top-color: var(--color-orange);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.bot-thinking {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  /* アイコンサイズ */
  height: 32px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  /* クリック透過 */
}

.spinner-text,
.spinner-progress {
  margin: 0 auto;
}

.spinner-message.column-div {
  gap: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}