@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Nunito', sans-serif;
}

H1 {
    font-size: 60px;
    color: darkblue;
    text-align: center;
    padding-top: 10px;
}

::selection {
    color: #fff;
    background: blue;
}

body {
    background-image: url('bg-image.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.select-box,
.play-board,
.result-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.select-box {
    background: rgb(238, 238, 115);
    padding: 20px 25px 25px;
    border-radius: 5px;
    max-width: 500px;
    width: 100%;
    height: 400px;
}

.select-box.hide {
    opacity: 0;
    pointer-events: none;
}

.select-box header {
    font-size: 40px;
    font-weight: 800;
    padding-bottom: 20px;
    border-bottom: 1px solid lightgrey;
    color: darkblue;
}

.select-box .title {
    font-size: 28px;
    font-weight: 600;
    margin: 25px 0;
    color: green;
}

.select-box .options {
    display: flex;
    width: 100%;
    padding-top: 15px;
}

.options button {
    width: 100%;
    font-size: 20px;
    font-weight: 800;
    padding: 15px 0;
    border: none;
    background: rgb(55, 133, 235);
    border-radius: 5px;
    color: black;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.options button:hover,
.btn button:hover {
    transform: scale(0.96);
}

.options button.playerT {
    margin-right: 5px;
}

.options button.playerS {
    margin-left: 5px;
}

.select-box .credit {
    text-align: center;
    margin-top: 55px;
    font-size: 25px;
    font-weight: 500;
}

.select-box .credit a {
    color: orangered;
    text-decoration: none;
}

.select-box .credit a:hover {
    text-decoration: underline;
}

.play-board {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.9);
}

.play-board.show {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.play-board .details {
    padding: 7px;
    border-radius: 5px;
    background: #fff;
}

.play-board .players {
    width: 100%;
    display: flex;
    position: relative;
    justify-content: space-between;
}

.players span {
    position: relative;
    z-index: 2;
    color: darkblue;
    font-size: 22px;
    font-weight: 500;
    padding: 10px 0;
    width: 100%;
    text-align: center;
    cursor: default;
    user-select: none;
    transition: all 0.3 ease;
}

.players.active span:first-child {
    color: orange;
}

.players.active span:last-child {
    color: darkblue;
}

.players span:first-child {
    color: orange;
}

.players .slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: darkblue;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.players.active .slider {
    left: 50%;
}

.players.active span:first-child {
    color: blue;
}

.players.active span:nth-child(2) {
    color: orange;
}

.players.active .slider {
    left: 50%;
}

.play-area {
    margin-top: 20px;
}

.play-area section {
    display: flex;
    margin-bottom: 1px;
}

.play-area section span {
    display: block;
    height: 120px;
    width: 120px;
    margin: 4px;
    color: blue;
    font-size: 40px;
    line-height: 80px;
    text-align: center;
    border-radius: 5px;
    background: yellow;
}

.result-box {
    padding: 25px 20px;
    border-radius: 5px;
    max-width: 400px;
    width: 100%;
    opacity: 0;
    text-align: center;
    background: #fff;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.9);
}

.result-box.show {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.result-box .won-text {
    font-size: 25px;
    font-weight: 500;
    display: flex;
    justify-content: center;
}

.result-box .won-text p {
    font-weight: 600;
    margin: 0 5px;
}

.result-box .btn {
    width: 100%;
    margin-top: 25px;
    display: flex;
    justify-content: center;
}

.btn button {
    font-size: 18px;
    font-weight: 500;
    padding: 8px 20px;
    border: none;
    background: rgb(51, 128, 51);
    border-radius: 5px;
    color: orange;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-box, .play-board, .result-box {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.play-area section span {
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.play-area section span:hover {
  transform: scale(1.05);
  background: #ffeb3b;
  box-shadow: 0 4px 15px rgba(255, 235, 59, 0.5);
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.select-box, .play-board, .result-box {
  animation: fadeInUp 0.6s ease;
}

.scoreboard {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 20px;
  color: #fff;
  margin-bottom: 20px;
}

@media (max-width: 600px) {
  .play-area section span {
    width: 80px;
    height: 80px;
    font-size: 30px;
  }
  h1 {
    font-size: 40px;
  }
}

.turn-indicator {
  margin-top: 20px;
  font-size: 1.2rem;
  color: #fff;
  background: rgba(255,255,255,0.2);
  padding: 8px 20px;
  border-radius: 15px;
  display: inline-block;
  box-shadow: 0 4px 15px rgba(255,255,255,0.2);
  animation: fadePulse 2s infinite;
  backdrop-filter: blur(5px);
}
@keyframes fadePulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.play-board {
  overflow: hidden;
}
.play-board::after {
  content: "";
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  border-radius: 20px;
  background: linear-gradient(45deg, #ff9a9e, #fad0c4, #fbc2eb, #a6c1ee);
  z-index: -1;
  filter: blur(10px);
  animation: spin 6s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
