body {
  margin: 0;
  font-family: Arial, sans-serif;
  position: relative;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url('kobg.png') no-repeat center center fixed;
  background-size: cover;
  opacity: 0.5;
  transition: opacity 0.4s ease;
  z-index: -1;
}

body.game-mode::before {
  opacity: 1 !important;
}

#homeOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0);
  z-index: 10;
  overflow-y: auto;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: start; 
  padding-top: 40px;
}

#homeOverlay .container {
  background: transparent;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
  display: flex;
  justify-content: center;
  margin-top: 23px;
  width: 100%;
  max-width: 420px;
}

.title {
  font-family: 'Pacifico', cursive;
  font-size: 60px;
  color: #222;
  text-align: center;
  width: 100%;
  margin-bottom: 5px;
  animation: pulseGlow 2.5s infinite ease-in-out;
}

.subtitle {
  font-family: 'Great Vibes', cursive;
  font-size: 22px;
  color: rgba(15, 15, 15);
  margin-top: 0;
  margin-bottom: 20px;
  text-align: center;
  width: 100%;
}

@keyframes pulseGlow {
  0% {
    text-shadow: 0 0 5px #007acc, 0 0 10px #00cfff, 0 0 20px #00cfff;
    transform: scale(1);
  }
  50% {
    text-shadow: 0 0 20px #0099dd, 0 0 30px #00cfff, 0 0 40px #00cfff;
    transform: scale(1.05);
  }
  100% {
    text-shadow: 0 0 5px #007acc, 0 0 10px #00cfff, 0 0 20px #00cfff;
    transform: scale(1);
  }
}

.controls {
  display: flex;
  font-family: 'Poppins', sans-serif;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 15px;
  padding: 0;                /* ✅ Remove bubble padding */
  background: transparent;   /* ✅ Make background invisible */
  border-radius: 0;          /* ✅ No bubble rounding */
  box-shadow: none;          /* ✅ No bubble shadow */
}


.controls label {
  font-size: 16px;
}

select {
  padding: 6px 12px;
  font-size: 16px;
  border-radius: 5px;
}

#startBtn, #restartBtn {
  padding: 12px 28px;
  font-size: 18px;
  background: linear-gradient(to top left, #4375bb, #66ccff);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 170, 255, 0.4);
  transition: all 0.3s ease;
}

#startBtn:hover, #restartBtn:hover {
  background: linear-gradient(to top left, #0099dd, #55bbff);
  transform: scale(1.05);
}

#gameArea.hidden {
  display: none;
}

#status {
  font-size: 18px;
  margin-bottom: 10px;
  color: #333;
}

.konane-board {
  display: grid;
  justify-content: center;
  margin: 20px auto;
  gap: 4px;
}

.tile {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  position: relative;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

.tile.light {
  background-color: #fec62b;
}

.tile.dark {
 background-color: #fef494;
}

.tile.selected {
  outline: 3px solid orange;
}

.piece {
  width: 60%;
  height: 60%;
  border-radius: 50%;
  margin: auto;
  top: 15%;
  position: relative;
}

.piece.black {
  background-color: black;
  border: 3px black;
}

.piece.white {
  background-color: white;
  border: 1px black;
}

#gameArea {
   padding: 40px 0;
    margin-top: -5px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: start;
}


#homeOverlay,
#gameArea {
  transition: all 0.4s ease;
}

.title-container {
  display: flex;
  align-items: flex-start; /* Makes the title block slightly higher than characters */
  justify-content: center;
  gap: 40px;
  margin-top: 15px;
  margin-bottom: 10px;
}

.character {
  height: 180px; /* or even 300px if you want bigger */
  width: auto;
  animation: float 2.5s ease-in-out infinite;
  object-fit: contain;
}

.character.left {
  transform: scaleX(-1);       /* Flip for symmetry */
}

@keyframes float {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-8px); }
  100% { transform: translateY(0); }
}

.title-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -15px; /* Push the title + subtitle upward */
}

.title {
  font-family: 'Pacifico', cursive;
  font-size: 60px;
  color: #222;
  animation: pulseGlow 2.5s infinite ease-in-out;
  margin: 0;
  padding: 0;
}

.subtitle {
  font-family: 'Great Vibes', cursive;
  font-size: 22px;
  color: rgba(0, 0, 0, 0.3);
  margin-top: 6px;
  margin-bottom: 0;
  text-align: center;
}

#rulesPage {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 15;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.4); /* slight white overlay */
  background-image: url('kobg.png');
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  padding: 40px 20px;
  backdrop-filter: blur(2px);
}

#rulesPage.hidden {
  display: none;
}

.rules-text {
  max-width: 600px;
  font-size: 18px;
  line-height: 1.6;
  color: #333;
  text-align: left;
}

#playGameBtn {
  margin-top: 20px;
  padding: 12px 30px;
  font-size: 16px;
  border-radius: 25px;
  background: linear-gradient(to top left, #4375bb, #66ccff);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

#playGameBtn:hover {
  transform: scale(1.05);
}

.input-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 15px;
}

.input-group label {
  font-size: 16px;
  margin-bottom: 5px;
  color: #333;
}

.input-group select {
  padding: 6px 12px;
  font-size: 16px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: white;
}

.grid-shift {
  transform: translateX(-25px); /* Adjust value as needed */
}

.hidden {
  display: none !important;
}

#homeOverlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

#homeOverlay {
  opacity: 1;
  transition: opacity 0.4s ease;
}

.rules-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 15;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;      /* center vertically */
  align-items: center;          /* center horizontally */
  background: url('kobg.png') no-repeat center center;
  background-size: cover;
  margin-bottom: 30px;
}

.rules-content {
  max-width: 650px;
  padding: 40px 30px;
  text-align: center;
  color: #222;
  background:transparent;
  border-radius: 20px;
  box-shadow: none;
  transform: translateY(-40px);
}
