/* omok.css */

#omokContainer,
#alkkagiContainer {
  font-family: inherit;
  color: white;
}

#omokContainer.hidden,
#alkkagiContainer.hidden {
  display: none !important;
}

.omok-hud {
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 100%;
  padding: 10px;
  background: rgba(0, 0, 0, 0.5);
  margin-bottom: auto;
}

.omok-player-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: bold;
  opacity: 0.5;
  transition: all 0.3s ease;
  padding: 4px 12px;
  border-radius: 20px;
  border: 2px solid transparent;
}

.omok-player-info.active {
  opacity: 1;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.1);
}

@keyframes myTurnPulse {
  0% { transform: scale(1); box-shadow: 0 0 0px rgba(76, 175, 80, 0); }
  50% { transform: scale(1.05); box-shadow: 0 0 15px rgba(76, 175, 80, 0.8); }
  100% { transform: scale(1); box-shadow: 0 0 0px rgba(76, 175, 80, 0); }
}

.omok-player-info.my-turn {
  border-color: #4caf50;
  animation: myTurnPulse 1.5s infinite;
}

.turn-indicator {
  display: none;
  font-size: 0.8rem;
  color: #81c784;
  margin-left: 4px;
  text-shadow: none;
}

.omok-player-info.my-turn .turn-indicator {
  display: inline-block;
  animation: turnBounce 1s infinite;
}

@keyframes turnBounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

.omok-dot {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.omok-dot.black { background: #111; }
.omok-dot.white { background: #eee; }

#omokTimerBox,
#alkkagiTimerBox {
  font-size: 1.2rem;
  font-weight: 900;
  color: #ffca28;
}

.omok-board-wrapper {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: calc(100% - 100px); /* 기본 모드에서도 양옆에 여유 공간(50px씩) 확보 */
  max-height: calc(100% - 100px); /* Leave room for HUD and surrender */
  margin: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  background: #dcba7d; /* Wood color */
  border-radius: 4px;
}

#omokCanvas,
#alkkagiCanvas {
  width: 100%;
  height: 100%;
  cursor: pointer;
  display: block;
  touch-action: none; /* 알까기 드래그 중 모바일 브라우저의 스크롤/줌 제스처가
                          끼어들어 드래그가 씹히는 문제 방지 (기존엔 #alkkagiCanvas 규칙이
                          실제 DOM에는 없는 id라 적용되지 않고 있었음) */
}

.omok-forbidden-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(30, 30, 30, 0.85);
  backdrop-filter: blur(4px);
  color: #ffb74d;
  border: 1px solid rgba(255, 183, 77, 0.3);
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.omok-forbidden-toast.show {
  opacity: 1;
}

#omokSurrenderWrap button,
#alkkagiSurrenderWrap button {
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  box-sizing: border-box;
  white-space: nowrap;
}

#omokConfirmBtn,
#alkkagiConfirmBtn {
  background: #4caf50;
  color: white;
  border: none;
}

#omokConfirmBtn.hidden,
#alkkagiConfirmBtn.hidden {
  display: none !important;
}

#omokSurrenderWrap,
#alkkagiSurrenderWrap {
  margin-top: auto;
  padding: 10px;
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

#omokSurrenderWrap.hidden,
#alkkagiSurrenderWrap.hidden {
  display: none !important;
}

#omokSurrenderBtn,
#alkkagiSurrenderBtn {
  background: rgba(255, 50, 50, 0.2);
  color: #ff8a80;
  border: none;
  box-shadow: inset 0 0 0 1px #ff8a80;
}

#omokSurrenderBtn:hover,
#alkkagiSurrenderBtn:hover {
  background: rgba(255, 50, 50, 0.4);
}

/* Landscape Mobile adjustments */
@media (orientation: landscape) and (max-height: 500px) {
  #omokContainer,
#alkkagiContainer {
    flex-direction: row;
    justify-content: center;
  }

  .omok-hud {
    flex-direction: column;
    width: 200px;
    height: 100%;
    margin: 0;
    margin-right: auto;
    background: linear-gradient(90deg, rgba(0,0,0,0.8), transparent);
  }

  #omokSurrenderWrap,
#alkkagiSurrenderWrap {
    margin-top: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
    padding: 20px;
    background: linear-gradient(-90deg, rgba(0,0,0,0.8), transparent);
  }

  .omok-board-wrapper {
    max-height: 75vh;
    max-width: 75vh;
  }
}

.omok-challenge-btn {
  margin-left: 4px;
  background: transparent;
  border: 1px solid #4caf50;
  border-radius: 10px;
  color: #4caf50;
  font-size: 10px;
  padding: 2px 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.omok-challenge-btn:hover {
  background: #4caf50;
  color: white;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

.omok-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100% !important;
  max-height: 100% !important;
  z-index: 99999 !important;
  background: rgba(0, 0, 0, 0.9) !important;
}
.omok-fullscreen .omok-board-wrapper {
  max-width: calc(100% - 32px) !important; /* 확대 모드 오목 기본 여백 (양옆 16px씩) */
}
.omok-fullscreen.is-alkkagi .omok-board-wrapper {
  max-width: calc(100% - 100px) !important; /* 알까기 모드에서 양옆에 여유 공간(50px씩) 확보하여 모서리 돌 당길 공간 마련 */
}

