/* =========================================================
   GLOBAL / BASE STYLE
   ========================================================= */

body {
  background: #0d1117;
}

.app-container {
  width: 85%;
  margin: 20px auto;
}

.general {
  padding: 30px;
  background: #161b22;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: white;
  margin-top: 20px;
}

h2 {
  color: white;
  background: #161b22;
  padding: 20px;
  text-align: center;
  border-radius: 10px;
}

.generalh4 {
  text-align: center;
  margin-bottom: 10px;
  color: #58a6ff;
}

.nav-tabs {
  display: none;
}

/* =========================================================
   PICK PLAYER
   ========================================================= */
.pickNprofile {
  display: flex;
  flex-direction: row;
  gap: 30px;
}

.pick-players {
  flex: 3;
}

.profiles {
  flex: 5;
}
/* Title */

/* Labels */
.pick-players label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #ffffff;
}

/* Select boxes */
.pick-players select {
  width: 100%;
  padding: 10px 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  font-size: 14px;
  transition: border 0.3s;
  background-color: #0d1117;
  color: white;
}

/* Focus effect on select */
.pick-players select:focus {
  border-color: #007bff;
  outline: none;
}

/* Submit button */
.pick-players button {
  width: 100%;
  padding: 12px;
  background-color: #5aa5f4;
  color: rgb(0, 0, 0);
  font-weight: 600;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition:
    background-color 0.3s,
    transform 0.2s;
  margin-bottom: 20px;
}

/* Button hover effect */
.pick-players button:hover {
  background-color: #0056b3;
  transform: translateY(-2px);
}

.player-compare {
  width: 70%;
  margin: 30px auto;
  border-collapse: collapse;
  font-family: "Segoe UI", sans-serif;
  background: #161b22;
  color: white;
  border-radius: 10px;
  overflow: hidden;
  table-layout: fixed;
}

.player-compare th {
  background: #0d1117;
  padding: 12px;
  font-size: 16px;
  text-align: center;
}

.player-compare td {
  padding: 12px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.player-compare tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

table th:nth-child(1),
.statistic table th:nth-child(1),
.statistic table th:nth-child(1),
table td:nth-child(3) {
  width: 40%;
}

.player-compare th:nth-child(2),
.statistic table th:nth-child(2) {
  width: 20%;
}
.player-compare img {
  border-radius: 8px;
  width: 100px;
  height: 100px;
}

/* ==============================
   MAIN SCORE CONTAINER
   ============================== */
.score {
  display: grid;
  grid-template-columns: 4fr 5fr;
  gap: 20px;
  grid-template-areas:
    "pick score"
    "result result";
}

.livescoreAll {
  grid-area: score;
}
.livescore {
  display: flex;
  flex-direction: row;
  gap: 5px;
}

.livescore h3 {
  width: 170px;
  text-align: right;
  font-weight: 600;
}

.livescore > div > p {
  font-size: 13px;
}

.livescore > div:nth-child(2) {
  margin-right: 15px;
}

.livescore > div:last-child {
  margin-left: 15px;
}

.gameside .duration_point {
  background-color: #121111;
  margin-top: -10px;
}

.livescoreAll p {
  /* margin-top: 15px; */
  font-size: 13px;
  color: #8b949e;
}

.name {
  display: flex;
  width: 300px;
}

.player_name_format {
  display: none;
}
.name .status {
  display: flex;
  flex-direction: row;
  gap: 5px;
  width: 100%;
}
.status .status_shot {
  font-size: 12px;
  padding: 5px;
  background-color: #30363d;
  color: white;
  border-radius: 5px;
}

.result {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 10px;
}

.result_name p,
.result .gameside p {
  padding: 10px;
  border-radius: 10px;
  color: black;
}

.result_name p:first-child,
.result .gameside p:first-child {
  background-color: #3fb950;
}

.result_name p:last-child,
.result .gameside p:nth-child(2) {
  background-color: #6c6aaa;
}

/* ==============================
   HOVER EFFECT (optional)
   ============================== */

label:hover {
  transform: scale(1.25);
  transition: 0.2s;
}

.livescore > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.livescore > div > p {
  background-color: #0d1117;
  border-radius: 5px;
  padding: 15px;
  text-align: center;
  font-size: 16px;
}

.livescore > div:first-child p {
  text-align: left;
}

.serve-icon {
  display: inline-block;
  width: 30px;
  text-align: center;
  background-color: transparent;
}

.serve-icon img,
.flag img {
  width: 20px;
  height: 20px;
}

/* ==============================
   CONTAINER
   ============================== */

/* ==============================
   GRID 2 PLAYER
   ============================== */
/* ==============================
   PLAYER CARD
   ============================== */
.form-point {
  display: grid;
  grid-template-columns: 1fr 1fr;
  justify-content: center;
  gap: 10px;
}

.point {
  background: #0d1117;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: 0.2s;
}

.point:hover {
  border-color: #58a6ff;
}
.score form {
  grid-area: pick;
}
/* ==============================
   PLAYER NAME
   ============================== */
.point span {
  display: grid;
  justify-content: center;
  height: 20px;
}

.point h6 {
  text-align: center;
  margin-bottom: 20px;
  color: #58a6ff;
  font-size: 16px;
}

/* ==============================
   SECTION BOX
   ============================== */
.shot {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ==============================
   RADIO BUTTON STYLE (MODERN 🔥)
   ============================== */
.shot label {
  margin: 5px 5px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #161b22;
  border: 1px solid #30363d;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13px;
  text-align: center;
}

/* hide radio default */
.shot input[type="radio"] {
  display: none;
}

/* hover */
.shot label:hover {
  background: #21262d;
}

/* checked effect */
.shot input[type="radio"]:checked + * {
  font-weight: bold;
}

.shot input[type="radio"]:checked + span,
.shot input[type="radio"]:checked {
  outline: none;
}

/* trick: highlight label when checked */
.shot input[type="radio"]:checked + label,
.shot label:has(input:checked) {
  background: #238636;
  border-color: #2ea043;
  color: white;
}

/* ==============================
   SERVE TYPE STYLE
   ============================== */
.serve_type label {
  background: #1f2937;
}

.serve_type label:has(input:checked) {
  background: #1f6feb;
}

/* ==============================
   SUBMIT BUTTON
   ============================== */
button {
  margin-top: 20px;
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #238636, #2ea043);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

button:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #2ea043, #3fb950);
}

/* ==============================
   STATISTIC CONTAINER
   ============================== */
.statistic {
  max-width: 80%;
  margin: 40px auto;
  padding: 20px;
  background: #161b22;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  color: white;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.statistic h3 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 20px;
  letter-spacing: 1px;
  color: #58a6ff;
}

/* ==============================
   TABLE BASE
   ============================== */
.statistic table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

/* HEADER */
.statistic thead th {
  padding: 12px;
  background: #0d1117;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8b949e;
  text-align: center;
}

.statistic tbody td {
  padding: 12px;
  text-align: center;
  font-size: 14px;
}

/* garis antar row */
.statistic tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* hover effect */
.statistic tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* player kiri */
.statistic tbody td:first-child {
  font-weight: 600;
  color: #3fb950; /* hijau */
  width: 40%;
}

/* player kanan */
.statistic tbody td:last-child {
  font-weight: 600;
  color: #6c6aaa; /* merah */
  width: 40%;
}

/* kolom tengah (label) */
.statistic tbody td:nth-child(2) {
  color: #c9d1d9;
  font-weight: 500;
  width: 20%;
}

/* ==============================
   SEPARATOR (TYPE ROW)
   ============================== */
.statistic .type td {
  padding: 6px;
  background: transparent;
  border-bottom: none;
}

.statistic .type td::after {
  content: "";
  display: block;
  height: 1px;
  background: linear-gradient(to right, transparent, #30363d, transparent);
  margin: 5px 0;
}

/* highlight value besar */
.statistic td strong {
  color: #ffd700;
}

/* ratio style (misal 3/5) */
.statistic td {
  letter-spacing: 0.5px;
}

table img {
  width: 120px;
  height: 120px;
  border-radius: 20px;
  padding: 0;
  margin: 0;
  margin-top: 10px;
}

tr td {
  position: relative;
}

table input {
  background-color: #3fb950;
  padding: 10px;
  border-radius: 5px;
}

table input:active {
  background-color: #120049;
}

.containerp1 {
  background-color: #3fb950;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  align-items: center;
  color: #000;
}

.containerp2 {
  background-color: #6c6aaa;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #000;
  align-items: center;
}

.last-points {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.player-points {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.player-points p {
  background-color: #0d1117;
  width: 100%;
  border-radius: 5px;
  font-size: 15px;
  padding: 15px;
}
.points_dot {
  display: flex;
  gap: 5px;
  background-color: #0d1117;
  justify-content: start;
  border-radius: 5px;
  padding: 10px;
}

.player-points span {
  text-align: start;
}

.game.winner,
.match.winner {
  font-weight: 800;
}

/* base dot */
.dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background-color: #444;
  transition: all 0.3s ease;
}

/* menang */
.dot.win {
  background-color: #00ffcc;
  box-shadow: 0 0 6px #00ffcc;
}

/* kalah */
.dot.lose {
  background-color: #555;
  opacity: 0.4;
}

.cancel_last_point button {
  background: linear-gradient(135deg, #862323, #640303);
}

/* Match Pop up */

.match-popup {
  text-align: center;
}

.match-popup .winner {
  font-size: 18px;
  font-weight: bold;
  color: #ffffff;
}

.match-popup .vs {
  margin: 5px 0;
  font-size: 14px;
}

.match-popup .score {
  background: #0d1117;
  padding: 10px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
}

.match-popup p {
  text-align: center;
}

.my-popup {
  border-radius: 15px;
}

.my-popup-bg {
  background: #151c27;
  color: #fff; /* teks tetap terbaca */
  border-radius: 15px; /* opsional, biar bulat */
}

.my-popup-title {
  padding: 20px;
}

/* Animasi */
.flash {
  animation: glowFlash 2s ease;
}

/* Popup */
/* Overlay background */
#overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

/* Popup modal */
#popup,
#popup-server,
#popup_alert {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: #fff;
  padding: 25px;
  border-radius: 12px;
  width: min(90vw, 320px);
  text-align: center;
  z-index: 1000;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  background-color: #000000;
  color: white;
  border-radius: 10px;
}

/* Popup muncul */
#popup.show,
#popup-server.show {
  transform: translate(-50%, -50%) scale(1);
}

/* Button container */
.popup-buttons {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

/* Buttons */
.btn-cancel {
  background: #0015ff;
  border: none;
  padding: 10px 15px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-confirm {
  background: #6ff64a;
  color: black;
  border: none;
  padding: 10px 15px;
  border-radius: 6px;
  cursor: pointer;
}

/* Hover efek */
.btn-confirm:hover {
  background: #00ff08;
}

@keyframes glowFlash {
  0% {
    transform: scale(1.2);
    background-color: #3fb950;
    color: #000;
    box-shadow:
      0 0 5px #3fb950,
      0 0 10px #3fb950,
      0 0 20px #3fb950;
  }

  50% {
    transform: scale(1.25);
    box-shadow:
      0 0 10px #3fb950,
      0 0 25px #3fb950,
      0 0 40px #3fb950;
  }

  100% {
    transform: scale(1);
    color: inherit;
    box-shadow: none;
  }
}

@media (min-width: 769px) {
  .tab-pane {
    display: block !important;
    opacity: 1 !important;
  }
}

@media (max-width: 768px) {
  .app-container {
    height: 100vh;
  }

  .tab-content {
    max-width: 760px;
  }

  h2 {
    font-size: 18px;
    padding: 10px;
  }

  .pickNprofile {
    flex-direction: column;
    gap: 10px;
  }

  .general {
    padding: 20px;
    margin-top: 0px;
  }

  .generalh4 {
    margin-bottom: 10px;
    font-size: 18px;
  }

  .tab-pane {
    display: none;
  }

  .tab-pane.active {
    display: block;
  }

  form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
  }

  .nav-tabs {
    margin-bottom: 15px;
    display: flex;
    flex-direction: row;
    justify-content: center;
    margin-top: -20px;
  }

  /* Judul full */
  form h4 {
    grid-column: 1 / -1;
  }

  /* Label & select default full */
  form label,
  form select,
  form button {
    grid-column: 1 / -1;
  }

  /* Khusus Player 1 & Player 2 (2 kolom) */
  form label:nth-of-type(1),
  form select:nth-of-type(1),
  form label:nth-of-type(2),
  form select:nth-of-type(2),
  #reset,
  #submit {
    grid-column: auto;
  }

  .pick-players label {
    display: none;
  }

  /* Select boxes */
  .pick-players select {
    width: 100%;
    padding: 10px 20px;
    margin-bottom: 10x;
  }

  option {
    text-align: center;
  }

  .pick-players button {
    width: 100%;
    padding: 5px;
    margin-bottom: 0;
    margin-top: 0;
  }

  .profiles h4 {
    display: none;
  }

  .player-compare {
    width: 100%;
    margin: 10px auto;
  }

  .player-compare th {
    padding: 0px;
  }

  .player-compare td {
    font-size: 13px;
  }

  .player-compare img {
    width: 75px;
    height: 75px;
    margin-bottom: 10px;
  }

  .score {
    display: flex;
    flex-direction: column;
  }
  .form-point {
    display: flex;
    flex-direction: row;
    justify-content: center;
    width: 200%;
  }

  .form-point .point {
    width: 200%;
    padding: 10px;
  }

  .shot {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
  }

  .shot label {
    margin: 5px 5px;
    padding: 5px;
    font-size: 12px;
  }

  .statistic {
    max-width: 100%;
  }

  .statistic thead th {
    padding: 10px;
    font-size: 12px;
  }

  .statistic table td {
    font-size: 12px;
  }

  table img {
    width: 75px;
    height: 75px;
    margin-top: 10px;
  }

  .statistic table th:nth-child(1),
  .statistic table td:nth-child(3) {
    width: 35%;
  }

  .statistic table th:nth-child(2) {
    width: 30%;
  }

  .name .player_name {
    font-size: 14px;
  }

  .flag img {
    width: 15px;
    height: 15px;
  }

  .livescore > div > p {
    padding: 10px;
    font-size: 14px;
  }

  .shot {
    margin-bottom: 5px;
  }

  .player-points p {
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .tab-content {
    max-width: 470px;
  }

  form {
    display: block;
  }

  .pick-players button {
    margin-top: 10px;
  }

  .player_name {
    font-size: 14px;
  }

  .player-compare th {
    font-size: 12px;
    padding: 5px;
  }

  .statistic table th:nth-child(1),
  .statistic table td:nth-child(3) {
    width: 30%;
  }

  .statistic table th:nth-child(2) {
    width: 40%;
  }

  .form-point {
    flex-direction: column;
    width: 50%;
  }

  .point {
    border-radius: 22px;
    width: 50%;
  }

  .statistic thead th {
    font-size: 10px;
  }

  .statistic img {
    width: 50px;
    height: 50px;
  }
  .livescore {
    width: 100%;
  }

  .dot {
    width: 5px;
    height: 5px;
  }

  .name {
    display: flex;
    width: 150px;
    margin-right: 0;
  }

  .name p {
    width: 100%;
    font-size: 30px;
  }
  .name p .player_name {
    font-size: 11px;
  }

  .match .flag img {
    display: none;
  }
  .serve-icon img {
    width: 5px;
    height: 5px;
  }

  .player_name {
    display: none;
  }
  .player_name_format {
    display: inline;
  }

  .set_win {
    display: none;
  }
  .country {
    display: none;
  }

  .name .status {
    flex-direction: column;
    gap: 2px;
    width: 100%;
  }

  .status_shot {
    display: none;
  }
  .livescore {
    gap: 2px;
  }

  .livescore > div:nth-child(2) {
    margin-right: 3px;
  }

  .livescore > div:last-child {
    margin-left: 1px;
  }

  .gameside .duration_point {
    margin-top: -15px;
  }

  .livescoreAll {
    padding: 5px;
  }

  .shot_winner {
    display: flex;
    flex-direction: row;
  }

  .points {
    background-color: #120049;
  }

  .points_dot {
    display: flex;
    gap: 5px;
    justify-content: center;
    border-radius: 5px;
    padding: 10px;
    height: 40px;
  }

  #cancelForm {
    margin-bottom: 10px;
    margin-top: -20px;
  }

  .result_name p {
    font-size: 13px;
  }

  .serve-icon img,
  .flag img {
    width: 20px;
    height: 20px;
  }

  .player-points p {
    font-size: 13px;
  }

  #popup,
  #popup-server,
  #popup_alert {
    padding: 12px;
    top: 40%;
  }

  .popup-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }

  .popup-buttons button {
    flex: 1;
  }
}
