/* =========================
   Reset & Base Styles
   ========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: #181a1b;
  color: #f1f1f1;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =========================
   Header & Navigation
   ========================= */
header {
  max-width: 900px;
  margin: 1em auto 0em;
  background: #23272a;
  border-radius: 8px;
  box-shadow: 0 2px 8px #000a;
  padding: 2em;
}

nav ul {
  display: flex;
  justify-content: center;
  gap: 2rem;
  list-style: none;
}

nav a {
  color: #ffd700;
  font-weight: 500;
  transition: color 0.2s;
  text-decoration: underline;
}

nav a:hover,
nav a:focus {
  color: #fff;
}

/* =========================
   Tabs
   ========================= */
.tabs {
  display: flex;
  gap: 3em;
  justify-content: center;
  padding: 0 0 1em;
  flex-wrap: wrap;
}

.tabs button {
  background: #282c34;
  border: none;
  padding: 0.5em 1.2em;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.2rem;
  color: #f1f1f1;
  transition: background 0.2s, color 0.2s;
}

.tabs button.active {
  background: #ffd700;
  color: #222;
}

/* =========================
   Main Content Container
   ========================= */
main {
  max-width: 900px;
  margin: 2em auto;
  background: #23272a;
  border-radius: 8px;
  box-shadow: 0 2px 8px #000a;
  padding: 2em;
}

/* =========================
   Footer
   ========================= */
footer {
  background: #23272a;
  color: #fff;
  text-align: center;
  padding: 1rem 0;
  font-size: 0.95rem;
  margin-top: auto;
}

footer a {
  color: #ffd700;
  text-decoration: underline;
}

footer a:visited {
  color: #ffd700;
}

footer a:hover {
  color: #fff;
}

/* =========================
   Section Titles & Text
   ========================= */
.section-title {
  font-size: 1.3em;
  margin: 1em 0 0.5em;
  font-weight: 600;
  color: #ffd700;
}

.section-text {
  font-size: 1.2em;
  margin: 1.2em 1.5em;
  font-weight: 600;
  color: #ffd700;
}

/* =========================
   Player Stats Bar
   ========================= */
.player-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1em 1.5em;
  background: #2c2f36;
  color: #ffd700;
  border-radius: 6px;
  margin-bottom: 1em;
  border: 2px solid #ffd700;
  box-shadow: 0 2px 8px #0003;
}

.player-stats-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 0;
  min-width: 120px;
}

.player-stats-center {
  flex: 2 1 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.player-stats-name {
  font-size: 2em;
  font-weight: bold;
  color: #ffd700;
  text-align: center;
}

.player-stats-main {
  font-size: 1.5em;
  font-weight: bold;
  color: #ffd700;
}

.player-stats-label {
  font-size: 0.95em;
  color: #bbb;
  margin: 0.2em 0;
}

.player-stats-rank {
  font-size: 1em;
  color: #ffd700;
}

/* =========================
   Player Totals Table
   ========================= */
.player-totals-row {
  display: flex;
  gap: 2em;
  margin-bottom: 2em;
  justify-content: space-between;
  flex-wrap: wrap;
}

.player-totals-col {
  flex: 1 1 200px;
  background: #23272a;
  border-radius: 8px;
  padding: 1em;
  min-width: 200px;
  box-shadow: 0 1px 4px #0002;
}

.player-totals-title {
  font-weight: 600;
  color: #ffd700;
  margin-bottom: 0.5em;
  font-size: 1.1em;
}

.player-totals-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.98em;
}

.player-totals-list li {
  margin-bottom: 0.2em;
  color: #bbb;
}

.player-totals-count {
  color: #ffd700;
  font-weight: 500;
}

/* =========================
   Score Table
   ========================= */
.score-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2em;
  font-size: 1rem;
  background: #23272a;
}

.score-table th,
.score-table td {
  padding: 0.5em 1em;
  border-bottom: 1px solid #333;
  text-align: left;
}

.score-table th {
  background: #282c34;
  color: #ffd700;
  font-weight: 600;
}

/* In-table player and round links */
.score-table a.player-link,
.score-table a.round-link {
  color: #ffd700;
  text-decoration: underline;
  font-weight: 500;
  transition: color 0.2s;
}

.score-table a.player-link:hover,
.score-table a.round-link:hover {
  color: #fff;
}


/* =========================
   Round Info Bar
   ========================= */
   .round-info-bar--stacked {
  display: flex;
  flex-direction: column;
  padding: 0.7em 1em;
  gap: 0.5em;
  background: #23272a;
  color: #ffd700;
  border-radius: 6px 6px 0 0;
  border-bottom: 2px solid #ffd700;
  font-size: 1.2em;
}

.round-info-title {
  text-align: center;
  font-size: 1.5em;
}

.round-info-stats {
  display: flex;
  justify-content: space-between;
  width: 100%;
}



/* =========================
   Player & Round Lists
   ========================= */
.player-list,
.round-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin-bottom: 1em;
}

.player-list button,
.round-list button {
  background: #282c34;
  border: none;
  padding: 0.4em 1em;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  color: #f1f1f1;
  transition: background 0.2s, color 0.2s;
}

.player-list button.active,
.round-list button.active {
  background: #ffd700;
  color: #222;
}

/* =========================
   Player Avatar
   ========================= */
.player-avatar {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #ffd700;
  margin-right: 0.5em;
  vertical-align: middle;
  background: #23272a;
  box-shadow: 0 1px 4px #0004;
}

/* =========================
   Rules List
   ========================= */
.rules-list {
  margin: 1em 2em;
  font-size: 1.1em;
  color: #fff;
  list-style: none;
  counter-reset: rules;
  list-style-position: inside;
}

.rules-list li {
  color: #fff;
  margin-bottom: 0.7em;
  line-height: 1.5;
  position: relative;
  padding-left: 2.2em;
}

.rules-list li::before {
  counter-increment: rules;
  content: counter(rules) " - ";
  position: absolute;
  left: 0;
  color: #ffd700;
  font-weight: bold;
}

.rules-note {
  display: block;
  margin: 0.3em 0 0.7em 1.5em;
  font-size: 0.98em;
  color: #bbb;
  font-style: italic;
}

/* =========================
   Tooltip
   ========================= */

.nickname-tooltip {
  color: #ffd700;
  border-bottom: 1px dotted #ffd700;
  cursor: pointer;
  font-weight: 600;
  transition: color 0.2s;
}
.nickname-tooltip:hover,
.nickname-tooltip.active {
  color: #fff;
  border-bottom: 1px solid #ffd700;
}

.tooltip-content {
  display: none;
  position: absolute;
  left: 0;
  top: 1.5em;
  background: #23272a;
  color: #ffd700;
  padding: 0.7em 1em;
  border-radius: 6px;
  box-shadow: 0 2px 8px #000a;
  z-index: 100;
  min-width: 200px;
  max-width: 90vw;
  font-size: 0.95em;
  white-space: normal;
}
.nickname-tooltip.active .tooltip-content {
  display: block;
}
.tooltip-player-row {
  margin-bottom: 0.5em;
}
.tooltip-player-row:last-child {
  margin-bottom: 0;
}

/* =========================
   Remove Default Link Styling
   ========================= */
a {
  text-decoration: none;
}

/* =========================
   Mobile Page
   ========================= */
@media (max-width: 900px) {
  nav ul {
    flex-direction: column;
    gap: 1rem;
  }
  main {
    margin: 0.5em;
    padding: 0.5em 0;
  }
  .tabs {
    gap: 0.5em;
    /*justify-content: flex-start;*/
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 0 0.5em 1em;
    -webkit-overflow-scrolling: touch;
  }
  .tabs button {
    flex: 0 0 auto;
    font-size: 1em;
    padding: 0.5em 0.8em;
  }
  .section-title,
  .section-text {
    margin: 0.5em 0 0.3em;
    font-size: 1em;
  }
    .player-stats-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.7em 0.3em;
    font-size: 0.95em;
  }
  .player-stats-center {
    order: 0;
    justify-content: center;
    align-items: center;
    display: flex;
    margin-bottom: 0.5em;
  }
  .stats-left {
    order: 1;
  }
  .stats-right {
    order: 2;
  }
    .player-stats-col.stats-right {
    border-top: none;
    position: relative;
    padding-top: 1.5em;
    margin-top: 0.5em;
  }
  .player-stats-col.stats-right::before {
    content: "";
    display: block;
    position: absolute;
    top: 0.5em;
    left: 25%;
    width: 50%;
    height: 2px;
    background: #ffd700;
    border-radius: 1px;
  }
  .player-stats-cols-row {
    display: flex;
    flex-direction: row;
    gap: 1em;
    width: 100%;
  }
  .player-stats-col {
    min-width: 0;
    flex: 1 1 0;
    align-items: center;
    display: flex;
    flex-direction: column;
  }




  .score-table th,
  .score-table td {
    padding: 0.3em 0.5em;
    font-size: 0.95em;
  }
  .player-totals-row {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 1em;
    font-size: 0.92em;
  }

  .player-totals-col {
    min-width: 0;
    flex: 1 1 0;
    font-size: 0.92em;
  }

  .player-totals-title,
  .player-totals-list,
  .player-totals-list li,
  .player-totals-count {
    font-size: 0.92em;
  }
  .player-totals-title {
    font-size: 1em;
  }
  .score-table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    border-radius: 0;
    margin-left: 0;
    margin-right: 0;
  }
  .rules-list {
    margin: 0.5em 0.5em;
    font-size: 1em;
  }
  .rules-list li {
    padding-left: 1.2em;
  }
}
