* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  /* Font family  */
  font-family: "Inter", sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  min-height: 100vh;
  /* background-color: rgb(89, 99, 89); */
  padding-bottom: 80px;
  color: #222222;
  background-image: url("../images/sport.jpg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 18px;
  background-color: rgb(89, 99, 89);
}

.auth-card {
  width: min(460px, 100%);
  padding: 28px 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.auth-subtitle {
  margin-bottom: 20px;
  color: #4a4a4a;
  line-height: 1.5;
}

.auth-form p {
  margin-bottom: 16px;
}

.auth-form input {
  width: 100%;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: #ffffff;
  color: #111111;
  font-size: 1rem;
}

.auth-submit-button {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: none;
  background: rgb(63, 73, 63);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 180ms ease;
}

.auth-submit-button:hover {
  background: rgb(51, 61, 51);
}

.admin-link {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  margin-top: 16px;
  padding: 13px 16px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  background: #ffffff;
  color: #222222;
  text-decoration: none;
  cursor: pointer;
}

.auth-error {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 222, 222, 0.9);
  color: #911b1b;
  font-size: 0.96rem;
}

@media (min-width: 640px) {
  .auth-card {
    padding: 32px 28px;
  }
}

.control-head {
  background-color: rgb(63, 73, 63);
  position: fixed;
  bottom: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 1000;
}

.add-record-button {
  width: 150px;
  height: 40px;
  font-size: 13px;
  border-radius: 5px;
  border: none;
  margin: auto;
  margin: 10px auto;
}
.nav-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
  gap: 0;
}

.nav-bar li {
  position: relative;
  list-style: none;
  border: 0.5px solid rgb(89, 99, 89);
  padding: 18px 0;
}

.nav-bar li:hover {
  background-color: rgb(80, 88, 80);
}

.nav-bar a {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(215, 215, 215);
  text-decoration: none;
  font-size: 13px;
}

/* Game results display on the main page */

.game-results {
  max-width: 520px;
  width: 92%;
  margin: 30px auto;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.14);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  border: 1px solid rgba(255, 255, 255, 0.18);

  box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.34);

  border-radius: 18px;
  padding: 32px;
}

.game-results li {
  margin-bottom: 18px;
  padding: 18px 16px;
  background-color: rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  min-height: 72px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
}

.result-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
}

.result-name {
  font-weight: 700;
  color: #111111;
}

.result-category {
  color: #222222;
  font-size: 0.95rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
}

.result-outcome {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.result-meta {
  margin-top: 12px;
  color: #1b1b1b;
  font-size: 0.92rem;
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
}

.result-icon {
  font-size: 1rem;
}

.record-edit-button {
  margin-left: auto;
  padding: 6px 10px;
  border: none;
  border-radius: 8px;
  background: rgba(27, 28, 30, 0.12);
  color: #1b1b1b;
  cursor: pointer;
  font-size: 0.9rem;
}

.record-edit-button:hover {
  background: rgba(27, 28, 30, 0.2);
}

.result-win-text {
  color: #8cf56c;
}

.result-loss-text {
  color: #ffb2b2;
}

.page-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.page-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.hidden {
  display: none !important;
}

.page-modal {
  width: 100%;
  max-width: 500px;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.08);
  transform: translateY(-26px) scale(0.96);
  opacity: 0;
  transition:
    opacity 260ms ease,
    transform 260ms ease;
}

.page-modal.open {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.page-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 18px;
}

.page-modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
  color: rgb(27, 28, 30);
}

.modal-close-button {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: rgb(27, 28, 30);
}

.page-modal-body {
  min-height: 180px;
}

.modal-form-group {
  margin-bottom: 16px;
}

.modal-form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.95rem;
  color: rgb(34, 34, 34);
}

.modal-form-select,
.modal-form-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  font-size: 0.95rem;
  color: rgb(27, 28, 30);
}

.modal-form-select:focus,
.modal-form-input:focus {
  outline: none;
  border-color: rgb(63, 73, 63);
  box-shadow: 0 0 0 3px rgba(63, 73, 63, 0.12);
}

.modal-placeholder {
  color: rgb(68, 68, 68);
  line-height: 1.7;
  font-size: 0.95rem;
}

.page-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.modal-submit-button,
.modal-cancel-button,
.modal-delete-button {
  min-width: 100px;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}

.modal-submit-button {
  background-color: rgb(63, 73, 63);
  color: #fff;
}

.modal-cancel-button {
  background-color: rgba(0, 0, 0, 0.08);
  color: rgb(27, 28, 30);
}

.modal-delete-button {
  margin-right: auto;
  background-color: #872626;
  color: #fff;
}

.modal-submit-button:hover,
.modal-cancel-button:hover,
.modal-close-button:hover {
  opacity: 0.92;
}

@media (max-width: 600px) {
  .page-modal {
    max-width: 100%;
    padding: 18px;
  }

  .page-modal-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .modal-submit-button,
  .modal-cancel-button {
    width: 100%;
  }
}

.dashboard-title {
  margin-top: 50px;
  text-align: center;
}

/* Leaderboard Styles */
.leaderboard-section {
  max-width: 820px;
  margin: 40px auto;
  padding: 20px 16px 100px;
}

.leaderboard-title {
  margin-bottom: 20px;
  color: #fafafa;
  font-size: 1.9rem;
  text-align: center;
}

.leaderboard-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.leaderboard-item {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  margin-bottom: 16px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.leaderboard-summary {
  width: 100%;
  border: none;
  background: transparent;
  padding: 18px 18px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  cursor: pointer;
  flex-wrap: nowrap;
}

.player-summary-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.player-rank {
  font-weight: 700;
  color: rgb(63, 73, 63);
}

.player-name {
  font-weight: 700;
  color: rgb(27, 28, 30);
}

.player-score {
  min-width: 120px;
  text-align: right;
  font-weight: 700;
  color: rgb(63, 73, 63);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.player-score strong {
  color: rgb(27, 28, 30);
}

.leaderboard-details {
  padding: 0 18px 18px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(249, 249, 249, 0.94);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  color: rgb(55, 55, 55);
}

.detail-summary {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.detail-title {
  margin-top: 16px;
  font-weight: 700;
  color: rgb(30, 30, 30);
}

.detail-title.wins {
  color: rgb(37, 124, 58);
}

.detail-title.defeats {
  color: rgb(184, 39, 39);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.detail-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 14px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: rgb(68, 68, 68);
}

.detail-card strong {
  color: rgb(35, 35, 35);
}

.no-players {
  text-align: center;
  color: rgb(68, 68, 68);
  font-style: italic;
  padding: 22px 12px;
}

@media (max-width: 620px) {
  .leaderboard-section {
    padding: 20px 12px 120px;
  }

  .leaderboard-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .player-score {
    width: 100%;
    text-align: left;
  }
}

/* Result List Styles */
.result-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.result-loss {
  background: rgba(255, 99, 99, 0.1);
  border-left: 4px solid rgb(255, 99, 99);
}

.result-win {
  background: rgba(100, 195, 120, 0.12);
  border-left: 4px solid rgb(46, 125, 50);
}

.result-top,
.result-middle,
.result-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: space-between;
}

.result-top {
  justify-content: flex-start;
}

.result-bottom {
  justify-content: space-between;
}

.result-index {
  font-weight: 700;
  color: rgb(36, 36, 36);
  font-size: 0.9rem;
}

.result-name {
  font-weight: 700;
  font-size: 1rem;
  color: rgb(24, 24, 24);
}

.result-category {
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.7);
  color: rgb(68, 68, 68);
  font-size: 0.92rem;
}

.result-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.result-loss-text {
  color: rgb(179, 27, 27);
  font-weight: 700;
}

.result-win-text {
  color: rgb(46, 125, 50);
  font-weight: 700;
}

.result-time {
  color: rgb(56, 56, 56);
  font-size: 0.9rem;
}

.result-bottom .record-edit-button {
  margin-left: 0;
}

.no-results {
  text-align: center;
  color: rgb(68, 68, 68);
  font-style: italic;
}
