@import url("./styles/shared-components.css");

* {
  box-sizing: border-box;
}
body {
  font-family: Arial, sans-serif;
  margin: 20px;
  background-color: #1a1a1a;
  color: #e0e0e0;
}
h1,
h2 {
  color: #ffffff;
}
form {
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
form div {
  display: inline-block;
}
input {
  margin: 5px;
  padding: 5px;
  background-color: #2d2d2d;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 4px;
}
textarea {
  margin: 5px;
  padding: 8px;
  width: 100%;
  background-color: #2d2d2d;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 4px;
  resize: vertical;
}
textarea:focus {
  outline: none;
  border-color: #0d7377;
  background-color: #333;
}
input:focus {
  outline: none;
  border-color: #0d7377;
  background-color: #333;
}
input.error {
  border: 2px solid #d32f2f;
  background-color: #3e1f1f;
}
button {
  padding: 5px 10px;
  background-color: #0d7377;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}
button:hover {
  background-color: #14919b;
}
.error-message {
  color: #ff6b6b;
  font-size: 12px;
  margin-top: 2px;
  margin-left: 5px;
  display: none;
}
.error-message.show {
  display: block;
}
textarea.error {
  border: 2px solid #d32f2f;
  background-color: #3e1f1f;
}
label {
  color: #e0e0e0;
}
select {
  background-color: #2d2d2d;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 5px;
  margin: 5px;
}
.tabs {
  margin-bottom: 10px;
}
.tabs button {
  margin-right: 10px;
  padding: 8px 16px;
  border: 1px solid #444;
  background: #2d2d2d;
  color: #e0e0e0;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s;
}
.tabs button:hover {
  background-color: #3d3d3d;
}
.tabs button.active {
  background: #0d7377;
  color: #ffffff;
}
.season-filter {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.season-filter button {
  padding: 8px 16px;
  border: 1px solid #555;
  background: #2d2d2d;
  color: #e0e0e0;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.season-filter button:hover {
  background-color: #3d3d3d;
}
.season-filter button.active {
  background: #0d7377;
  border-color: #20b2aa;
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(13, 115, 119, 0.35);
}
.chart-controls {
  margin-bottom: 10px;
}
.chart-controls label {
  margin-right: 15px;
}
.charts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.chart-container {
  display: block;
  background-color: #2d2d2d;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #444;
}
canvas {
  max-width: 100%;
}
.metrics-section {
  background-color: #2d2d2d;
  border: 1px solid #444;
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
}
.metrics-toggle {
  width: 100%;
  padding: 12px 15px;
  background-color: #2d2d2d;
  color: #e0e0e0;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-weight: bold;
  transition: background-color 0.2s;
}
.metrics-toggle:hover {
  background-color: #3d3d3d;
}
.metrics-content {
  padding: 15px;
  border-top: 1px solid #444;
}
.metrics-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  color: #e0e0e0;
  font-size: 13px;
}
.metrics-table th {
  background-color: #1a1a1a;
  padding: 8px;
  text-align: left;
  word-wrap: break-word;
  border-bottom: 1px solid #444;
  color: #0d7377;
}
.metrics-table td {
  padding: 8px;
  border-bottom: 1px solid #333;
}
.metrics-table td:nth-child(2) {
  text-align: left;
}
.metrics-table td:nth-child(3) {
  text-align: left;
  min-width: 80px;
}
.metrics-table tr:hover {
  background-color: #333;
}

.admin-controls,
.admin-form {
  margin-bottom: 15px;
}
.admin-form > div {
  margin-bottom: 10px;
}
.admin-form label {
  display: block;
  margin-bottom: 5px;
  color: #e0e0e0;
}
.admin-form input,
.admin-form select {
  background-color: #1a1a1a;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 8px;
  margin-right: 10px;
}
.admin-form input:focus,
.admin-form select:focus {
  outline: none;
  border-color: #0d7377;
  background-color: #2d2d2d;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  color: #e0e0e0;
}
.admin-table th {
  background-color: #1a1a1a;
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #444;
  color: #0d7377;
  position: sticky;
  top: 0;
}
.admin-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #333;
}
.admin-table tr:hover {
  background-color: #333;
}
.admin-table button {
  padding: 4px 8px;
  margin-right: 5px;
  background-color: #0d7377;
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
}
.admin-table button:hover {
  background-color: #14919b;
}
.admin-table .delete-btn {
  background-color: #d32f2f;
}
.admin-table .delete-btn:hover {
  background-color: #f44336;
}
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-content {
  display: none;
  position: absolute;
  background-color: #2d2d2d;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.5);
  z-index: 1;
  border: 1px solid #444;
  border-radius: 4px;
}
.dropdown-content label {
  display: block;
  padding: 8px;
  color: #e0e0e0;
  cursor: pointer;
}
.dropdown-content label:hover {
  background-color: #3d3d3d;
}
.dropdown-content input {
  margin: 0 5px 0 0;
}
#modalOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
#modalContent {
  background-color: #2d2d2d;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 20px;
  max-width: 500px;
  width: 90%;
  color: #e0e0e0;
}
#modalTitle {
  margin-top: 0;
  color: #0d7377;
}
#modalInput {
  width: 100%;
  padding: 8px;
  background-color: #1a1a1a;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 4px;
  box-sizing: border-box;
}
#modalCancel {
  padding: 8px 16px;
  background-color: #666;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
#modalCancel:hover {
  background-color: #777;
}
#modalConfirm {
  padding: 8px 16px;
  background-color: #0d7377;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
#modalConfirm:hover {
  background-color: #14919b;
}
.teammate-form {
  background-color: #2d2d2d;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  position: relative;
}
.teammate-form h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #0d7377;
  font-size: 16px;
}
.teammate-form .remove-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #d32f2f;
  padding: 5px 10px;
  font-size: 12px;
}
.teammate-form .remove-btn:hover {
  background-color: #f44336;
}
.teammate-form input {
  margin: 5px;
  padding: 5px;
  background-color: #1a1a1a;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 4px;
}
.dropdown-content a {
  display: block;
  padding: 8px;
  color: #e0e0e0;
  text-decoration: none;
  cursor: pointer;
}
.dropdown-content a:hover {
  background-color: #3d3d3d;
}
.metrics-card {
  background-color: #2d2d2d;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
}

.metrics-card h3 {
  margin-top: 0;
  color: #0d7377;
}

.metrics-card ul {
  margin: 0;
  padding-left: 18px;
}

.metrics-card li {
  margin: 4px 0;
}
/* Submit + Add Player row */
.form-actions {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.player-count {
  color: #999;
  font-size: 12px;
}

/* ===== Auth Page Utilities ===== */
.auth-shell {
  max-width: 520px;
}

.auth-shell-wide {
  max-width: 900px;
}

.auth-help-text {
  color: #999;
  display: block;
  margin-top: 4px;
}

.auth-checkbox-row {
  margin: 15px 0;
}

.auth-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #bbb;
}

.auth-checkbox {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}

.auth-note {
  background-color: #2d2d2d;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid #444;
}

.auth-note-text {
  color: #bbb;
  margin: 0;
}

.password-strength {
  margin-top: 8px;
  font-size: 12px;
}

.password-strength-meter {
  height: 6px;
  background: #444;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 5px;
}

.password-strength-bar {
  height: 100%;
  width: 0%;
  background: #999;
  transition: width 0.3s, background-color 0.3s;
  border-radius: 3px;
}

.password-strength-text {
  color: #999;
}

.auth-success-message {
  display: none;
  color: #0d7377;
  margin-top: 10px;
  padding: 10px;
  background-color: #1a3a3a;
  border-radius: 4px;
}

.auth-links {
  margin-top: 20px;
}

.auth-link-row {
  color: #bbb;
  margin: 0;
}

.auth-link-row + .auth-link-row {
  margin-top: 12px;
}

.auth-link {
  color: #0d7377;
}

/* ===== Site-Wide Page Layout ===== */
.site-page {
  max-width: 1720px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

.app-page {
  max-width: 1920px;
}

.landing-page .landing-auth-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.landing-page .landing-auth-buttons .dropbtn {
  margin: 0;
}

.landing-page .landing-highscore-grid,
.landing-page .landing-global-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}

.landing-page .landing-chart-shell {
  min-width: 0;
}

.app-page .app-header-row,
.profile-page .profile-header-row {
  margin-bottom: 20px;
}

.app-page .app-header-title {
  margin: 0;
}

.app-page #graphsControlsStack {
  gap: 14px;
}

.app-page #graphsControlsStack .controls-block {
  padding: 16px 18px;
  border: 1px solid #333;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.app-page .app-intro-section {
  max-width: min(1400px, 100%);
}

.app-page .app-search-wrap {
  position: relative;
  width: min(460px, 100%);
}

.app-page .app-search-wrap .input-search {
  width: 100%;
  max-width: none;
  margin: 0;
}

.app-page .app-search-wrap .dropdown-list {
  width: 100%;
  max-width: none;
}

.app-page .app-teammate-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.app-page .app-teammate-row label {
  margin: 0;
}

.app-page .app-teammate-select {
  margin: 0;
  min-width: 220px;
  max-width: 100%;
}

.app-page #appSelectedUsers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.app-page #appSelectedUsers [data-remove-user] {
  margin: 0 !important;
  min-height: 38px;
}

.app-page .chart-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
}

.profile-page .profile-search-wrap {
  position: relative;
  max-width: 460px;
}

.profile-page .profile-search-input {
  width: 100%;
  max-width: none;
  margin: 0;
}

.profile-page .profile-search-dropdown {
  max-width: none;
}

.profile-page .profile-alias-history-dropdown summary {
  cursor: pointer;
  font-weight: 600;
}

.profile-page .profile-alias-history-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-page .profile-alias-history-item {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

#graphsControlsStack .controls-block > label {
  display: block;
  margin-bottom: 8px;
}

#graphsControlsStack .controls-row label {
  margin-right: 0;
}

.radio-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.radio-inline input {
  margin: 0;
}
/* ===== Chart sizing fix ===== */
.chart-container {
  position: relative;
  min-height: 260px; /* adjust: 220-320 works well */
}

.chart-container canvas {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.radar-chart-shell {
  width: 100% !important;
  max-width: 640px !important;
  height: 430px;
  margin: 0 auto 30px !important;
  overflow: hidden;
}

.radar-chart-shell canvas {
  width: 100% !important;
  height: 100% !important;
}

.radar-layout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: flex-start;
  flex-wrap: wrap;
  max-width: 1020px;
  margin: 0 auto;
}

.radar-settings-panel {
  border: 1px solid #3f3f3f;
  border-radius: 8px;
  background: #232323;
  padding: 12px;
  margin: 0 0 30px;
  width: 340px;
  max-width: 100%;
}

.radar-settings-header {
  font-weight: 700;
  margin-bottom: 8px;
}

.radar-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 12px;
  margin-bottom: 8px;
}

.radar-targets {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.radar-target-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.radar-target-label {
  font-size: 12px;
  color: #d0d0d0;
  font-weight: 600;
  padding-bottom: 6px;
}

.radar-target-row label {
  min-width: 0;
}

.radar-target-row input {
  width: 100%;
  box-sizing: border-box;
}

.radar-layout .radar-chart-shell {
  flex: 1 1 620px;
  max-width: 620px !important;
  height: 430px;
  margin: 0 0 30px !important;
}

.radar-layout .radar-settings-panel {
  flex: 0 0 340px;
}

.radar-settings-panel label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #bdbdbd;
}

.radar-settings-panel input,
.radar-settings-panel select {
  padding: 6px 8px;
  border: 1px solid #555;
  border-radius: 4px;
  background: #1b1b1b;
  color: #e3e3e3;
}

.radar-settings-note {
  margin-top: 8px;
  font-size: 12px;
  color: #9f9f9f;
}

.radar-settings-actions {
  margin-top: 8px;
}

@media (max-width: 980px) {
  .radar-layout {
    flex-direction: column;
    align-items: stretch;
  }

  .radar-settings-panel,
  .radar-chart-shell {
    width: 100% !important;
    max-width: 640px !important;
    margin-left: auto;
    margin-right: auto;
  }
}
.badge-img {
  display: block;
  width: 100%;
  height: auto;
}
/* ===== Graph controls layout (stacked) ===== */
#graphsControlsStack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

#graphsControlsStack .controls-block {
  width: 100%;
}

#graphsControlsStack .controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap; /* lets radios wrap nicely */
}

/* Keep labels from looking cramped */
#graphsControlsStack label {
  margin-right: 10px;
}

/* Optional: keep the headings from wrapping weird */
#graphsControlsStack strong {
  white-space: nowrap;
}
/* Player section styling */
.player-section {
  border: 1px solid #444;
  border-radius: 4px;
  padding: 15px;
  margin: 10px 0;
  background-color: #252525;
}

.player-section div {
  display: block;
  margin-bottom: 10px;
}

.player-section label {
  display: block;
  margin-bottom: 5px;
  color: #b0b0b0;
  font-size: 14px;
}

.player-section input {
  width: 100%;
  padding: 8px;
  box-sizing: border-box;
}

/* Dashboard Add Session layout */
#newSessionForm {
  display: block;
}

#newSessionForm > div {
  display: block;
}

#addSessionForm #playersContainer {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 20px;
}

#addSessionForm #additionalPlayers {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 12px;
}

#addSessionForm .player-section {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  align-items: start;
  gap: 10px 12px;
  width: 100%;
  max-width: none;
  margin: 0;
  overflow: visible;
  padding: 14px;
  position: relative;
  z-index: 0;
}

#addSessionForm .player-section:focus-within {
  z-index: 20;
}

#addSessionForm .player-section > div {
  margin: 0;
  min-width: 0;
}

#addSessionForm .player-section > div:first-child {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  position: static;
  background-color: transparent;
}

#addSessionForm .player-section > div:not(:first-child) {
  display: block;
}

#addSessionForm .player-section .player-username-wrap {
  position: relative;
  margin: 0;
  z-index: 0;
}

#addSessionForm .player-section:focus-within .player-username-wrap {
  z-index: 25;
}

#addSessionForm .player-section .player-username-wrap .dropdown-list {
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-width: none;
  z-index: 30;
  background-color: #232323;
  border-color: #505050;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.55);
}

#addSessionForm .player-section .player-username-wrap .dropdown-list .dropdown-list-item {
  background-color: #232323;
}

#addSessionForm .player-section label {
  display: block;
}

#addSessionForm .player-section input {
  margin: 0;
  width: 100%;
  min-width: 0;
}

#addSessionForm .player-section .playerUsername {
  width: 100%;
}

@media (max-width: 1200px) {
  #addSessionForm .player-section {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }
}

@media (max-width: 900px) {
  #addSessionForm .player-section {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

@media (max-width: 560px) {
  #addSessionForm .player-section {
    grid-template-columns: 1fr;
  }
}

.remove-player-btn {
  background-color: #d32f2f;
  padding: 6px 12px;
  font-size: 12px;
  margin-top: 10px;
}

#addSessionForm .remove-player-btn {
  margin-top: 0;
  white-space: nowrap;
}

.remove-player-btn:hover {
  background-color: #f57c00;
}

/* Hamburger Menu */
.hamburger-menu {
  position: relative;
  display: inline-block;
}

/* Keep shared auth menu pinned to top-right even with local .hamburger-menu rules. */
.hamburger-menu.global-auth-hamburger {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1200;
}

.hamburger-btn {
  background-color: #0d7377;
  color: white;
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 18px;
  transition: background-color 0.2s;
}

.hamburger-btn:hover {
  background-color: #14919b;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 6px;
  background-color: #2d2d2d;
  min-width: 200px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
  z-index: 1;
  border-radius: 4px;
  border: 1px solid #444;
}

.dropdown-menu a {
  color: #e0e0e0;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  transition: background-color 0.2s;
}

.dropdown-menu a:hover {
  background-color: #3d3d3d;
  color: #0d7377;
}

.dropdown-menu a:first-child {
  border-radius: 4px 4px 0 0;
}

.dropdown-menu a:last-child {
  border-radius: 0 0 4px 4px;
}

/* Leaderboard Table Styling */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #2d2d2d;
  border: 1px solid #444;
  border-radius: 4px;
  overflow: hidden;
}

.leaderboard-table thead {
  background-color: #0d7377;
}

.leaderboard-table th {
  padding: 10px;
  text-align: left;
  color: #ffffff;
  font-weight: bold;
  border-bottom: 1px solid #444;
}

.leaderboard-table td {
  padding: 10px;
  border-bottom: 1px solid #444;
  color: #e0e0e0;
}

.leaderboard-table tbody tr:hover {
  background-color: #3d3d3d;
}

.leaderboard-table tbody tr:last-child td {
  border-bottom: none;
}

/* ===== Navigation & Links ===== */
a.dropbtn {
  text-decoration: none;
  display: inline-block;
}

a.dropbtn.logout-btn {
  background-color: #0d7377;
}

a.dropbtn.admin-btn {
  background-color: #d97706;
  display: none;
}

/* ===== Flex & Layout Utilities ===== */
.flex-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.flex-row.flex-space-between {
  justify-content: space-between;
}

.flex-row.flex-wrap {
  flex-wrap: wrap;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

/* ===== Dropdown & Autocomplete ===== */
.dropdown-list {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #2d2d2d;
  border: 1px solid #444;
  border-radius: 4px;
  max-width: 300px;
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
  display: none;
  z-index: 1000;
  margin-top: 4px;
}

.dropdown-list.search-dropdown {
  max-height: 150px;
  width: 100%;
}

.dropdown-list.show {
  display: block;
}

.dropdown-list-item {
  padding: 8px;
  color: #e0e0e0;
  cursor: pointer;
}

.dropdown-list-item:hover {
  background-color: #3d3d3d;
}

/* ===== Modal Styles ===== */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-box {
  background: #2d2d2d;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 30px;
  max-width: 400px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.modal-box-large {
  max-width: 500px;
}

.account-settings-modal {
  width: min(92vw, 680px);
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
}

.account-sessions-list {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 6px;
}

@media (max-width: 768px) {
  .account-settings-modal {
    max-height: 88vh;
    padding: 20px;
  }

  .account-sessions-list {
    max-height: 220px;
  }
}

.modal-title {
  margin-top: 0;
  color: #0d7377;
}

.modal-message {
  color: #e0e0e0;
  margin: 15px 0;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.modal-btn-cancel {
  padding: 8px 16px;
  background-color: #666;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.modal-btn-cancel:hover {
  background-color: #777;
}

.modal-btn-confirm {
  padding: 8px 16px;
  background-color: #0d7377;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.modal-btn-confirm:hover {
  background-color: #14919b;
}

.modal-input-group {
  margin-bottom: 20px;
}

.modal-input-label {
  color: #e0e0e0;
  display: block;
  margin-bottom: 5px;
}

.modal-input {
  width: 100%;
  padding: 8px;
  background: #444;
  color: #e0e0e0;
  border: 1px solid #666;
  border-radius: 4px;
  box-sizing: border-box;
}

.modal-input:readonly {
  background: #444;
}

.modal-hr {
  border-color: #444;
  margin: 20px 0;
}

.modal-error {
  color: #ff6b6b;
  margin-bottom: 15px;
}

.modal-backdrop.show {
  display: flex;
}

/* ===== Experimental/OCR Modal ===== */
.ocr-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.ocr-modal.show {
  display: flex;
}

.ocr-modal-content {
  background-color: #1a1a1a;
  border: 2px solid #ff9800;
  border-radius: 8px;
  padding: 20px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.ocr-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.ocr-modal-title {
  margin: 0;
  color: #ff9800;
}

.ocr-modal-close {
  background: none;
  border: none;
  color: #ff9800;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
}

.ocr-modal-description {
  color: #999;
  font-size: 13px;
  margin: 0 0 15px 0;
}

.ocr-screenshot-input {
  width: 100%;
  padding: 8px;
  background-color: #2d2d2d;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 10px;
}

.ocr-mode-row {
  margin-bottom: 12px;
}

.ocr-flow-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.ocr-task-card {
  padding: 12px;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
}

.ocr-task-card-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.ocr-task-card-step {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #ffb347;
}

.ocr-task-card-title {
  margin: 0;
  font-size: 16px;
  color: #f2f2f2;
}

.ocr-task-card-copy {
  margin: 0 0 10px 0;
  color: #bdbdbd;
  font-size: 13px;
  line-height: 1.45;
}

.ocr-section-label {
  display: block;
  margin-bottom: 4px;
  color: #e0e0e0;
  font-weight: 600;
}

.ocr-inline-hint {
  margin: 6px 0 0 0;
}

.ocr-task-card.is-hidden {
  display: none;
}

.ocr-mode-row label {
  display: block;
  margin-bottom: 4px;
  color: #e0e0e0;
  font-weight: 600;
}

.ocr-mode-select {
  width: 100%;
  padding: 8px;
  background-color: #2d2d2d;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 4px;
}

.ocr-batch-section {
  border: 1px solid #3a3a3a;
  background: rgba(255, 152, 0, 0.06);
}

.ocr-batch-list {
  margin-top: 8px;
  max-height: 150px;
  overflow-y: auto;
  font-size: 12px;
  color: #bbb;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  padding: 6px 8px;
  background: #1d1d1d;
}

.ocr-batch-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ocr-batch-item:last-child {
  border-bottom: none;
}

.ocr-batch-item-ok {
  color: #00cc7a;
}

.ocr-batch-item-skipped {
  color: #ffcc66;
}

.ocr-batch-item-failed {
  color: #ff6b6b;
}

.ocr-batch-json {
  margin-top: 8px;
  width: 100%;
  box-sizing: border-box;
  min-height: 120px;
  resize: vertical;
  font-family: "Courier New", Consolas, monospace;
  font-size: 12px;
  background-color: #1a1a1a;
  color: #d8d8d8;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 8px;
}

.ocr-batch-review-modal-content {
  width: min(1180px, 96vw);
  max-width: min(1180px, 96vw);
  border-color: #14919b;
}

.ocr-batch-review-preview-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
  background-color: #111;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 8px;
}

.ocr-batch-review-image {
  max-width: 100%;
  max-height: 220px;
  border-radius: 4px;
  border: 1px solid #444;
}

.ocr-batch-review-diagnostics {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #3a4d50;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(20,145,155,.12), rgba(20,145,155,.04));
}

.ocr-batch-review-diagnostics-header {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #8dd7dc;
  margin-bottom: 6px;
}

.ocr-batch-review-diagnostics-body {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  font-size: 12px;
  color: #d7e4e5;
}

.ocr-batch-review-diagnostics-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background-color: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  color: inherit;
}

.ocr-batch-review-diagnostics-pill.is-warning {
  background-color: rgba(255, 179, 71, .12);
  border-color: rgba(255, 179, 71, .28);
  color: #ffd18a;
}

.ocr-batch-review-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.ocr-batch-review-controls label {
  display: block;
  margin-bottom: 4px;
  color: #bbb;
  font-size: 12px;
  font-weight: 600;
}

.ocr-batch-review-controls select {
  width: 100%;
  margin: 0;
  padding: 8px;
  background-color: #2d2d2d;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 4px;
}

.ocr-batch-review-table-wrap {
  margin-bottom: 10px;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  background-color: #151515;
  overflow: auto;
  max-height: 320px;
}

.ocr-batch-review-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 12px;
  color: #ddd;
}

.ocr-batch-review-table th,
.ocr-batch-review-table td {
  border-bottom: 1px solid #2c2c2c;
  padding: 6px;
  text-align: left;
  vertical-align: middle;
}

.ocr-batch-review-table th {
  position: sticky;
  top: 0;
  background-color: #1f1f1f;
  color: #ffcc66;
  z-index: 1;
}

.ocr-batch-review-table td:first-child {
  white-space: nowrap;
  color: #999;
}

.ocr-batch-review-table input {
  width: 100%;
  margin: 0;
  padding: 6px;
  background-color: #202020;
  color: #f2f2f2;
  border: 1px solid #3f3f3f;
  border-radius: 4px;
}

.ocr-batch-review-notes {
  margin: 0 0 8px 0;
}

.ocr-batch-review-error {
  min-height: 16px;
  margin: 0 0 8px 0;
  font-size: 12px;
  display: none;
}

.ocr-batch-review-error.show {
  display: block;
}

.ocr-preview-section {
  display: none;
  margin-top: 10px;
}

.ocr-preview-section.show {
  display: block;
}

.ocr-preview-image {
  max-width: 100%;
  max-height: 300px;
  border-radius: 4px;
  margin-bottom: 10px;
  border: 1px solid #444;
}
.ocr-preview-wrapper {
  position: relative;
  display: inline-block;
  max-width: 100%;
}
.ocr-preview-overlay {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
.ocr-preview-overlay.is-editable {
  pointer-events: auto;
  cursor: crosshair;
  touch-action: none;
}
.ocr-preview-controls {
  margin-bottom: 8px;
}

.ocr-answer-key-details {
  margin-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
}

.ocr-answer-key-details summary {
  cursor: pointer;
  color: #d8d8d8;
  font-weight: 600;
}

.ocr-answer-key-details[open] summary {
  margin-bottom: 6px;
}
.ocr-overlay-toggle {
  font-size: 12px;
  color: #bbb;
  user-select: none;
}
.ocr-overlay-toggle input {
  margin-right: 6px;
}

.ocr-preview-actions {
  display: flex;
  gap: 10px;
}

.ocr-preview-actions button {
  flex: 1;
}

.ocr-status {
  display: none;
  margin-bottom: 15px;
  padding: 10px;
  background-color: #2d2d2d;
  border-radius: 4px;
  color: #ff9800;
}

.ocr-status.show {
  display: block;
}

.ocr-status-text {
  margin: 0;
  font-size: 13px;
}

.ocr-progress-bar {
  width: 100%;
  height: 4px;
  background-color: #444;
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.ocr-progress-fill {
  width: 0%;
  height: 100%;
  background-color: #ff9800;
  transition: width 0.3s;
}

.ocr-results {
  display: none;
  margin-bottom: 15px;
  padding: 10px;
  background-color: #1a3a3a;
  border-left: 3px solid #00cc00;
  border-radius: 4px;
  color: #00cc00;
  font-size: 12px;
}

.ocr-results.show {
  display: block;
}

.ocr-error {
  display: none;
  margin-bottom: 15px;
  padding: 10px;
  background-color: #3a1a1a;
  border-left: 3px solid #ff6b6b;
  border-radius: 4px;
  color: #ff6b6b;
  font-size: 12px;
}

.ocr-error.show {
  display: block;
}

/* ===== Button Variants ===== */
.btn-orange {
  background-color: #ff9800;
}

.btn-orange:hover {
  background-color: #e68900;
}

.btn-danger {
  background-color: #ef4444;
}

.btn-danger:hover {
  background-color: #f57c00;
}

.btn-secondary {
  background-color: #666;
}

.btn-secondary:hover {
  background-color: #777;
}

.btn-wide {
  width: 100%;
}

.btn-small {
  padding: 8px 12px;
}

/* ===== Input Variants ===== */
.input-search {
  padding: 8px;
  background-color: #1a1a1a;
  color: #e0e0e0;
  border: 1px solid #444;
  border-radius: 4px;
  flex: 1;
  max-width: 300px;
}

.input-comparison {
  width: 100%;
  padding: 8px;
  border-radius: 4px;
  background-color: #2d2d2d;
  color: #fff;
  border: 1px solid #444;
  box-sizing: border-box;
}

/* ===== Notification Styles ===== */
.notification-section {
  margin-bottom: 20px;
  padding: 20px;
  background-color: #fee2e2;
  border-left: 4px solid #ef4444;
  border-radius: 4px;
}

.notification-section.hidden {
  display: none;
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.notification-title {
  margin: 0 0 10px 0;
  color: #991b1b;
}

.notification-message {
  margin: 0;
  color: #7f1d1d;
  margin-bottom: 10px;
}

.notification-checkbox-group {
  margin-bottom: 10px;
}

.notification-checkbox-label {
  margin-left: 15px;
  color: #bbb;
}

/* ===== Admin Section Variants ===== */
.admin-section-danger {
  border-left: 4px solid #ef4444;
  background-color: rgba(239, 68, 68, 0.05);
}

.admin-section-danger h3 {
  color: #ef4444;
}

/* ===== Section Headers ===== */
.section-title {
  margin-top: 40px;
}

/* ===== Utility Spacing ===== */
.mt-10 {
  margin-top: 10px;
}

.mt-15 {
  margin-top: 15px;
}

.mt-20 {
  margin-top: 20px;
}

.mb-10 {
  margin-bottom: 10px;
}

.mb-15 {
  margin-bottom: 15px;
}

.mb-20 {
  margin-bottom: 20px;
}

/* ===== Badge Styles ===== */
.notification-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  background-color: #ef4444;
  color: white;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.notification-badge.hidden {
  display: none;
}

/* ===== Chart Container Variants ===== */
.chart-container-centered {
  max-width: 500px;
  margin: 0 auto;
  margin-bottom: 30px;
}

/* ===== Text Utilities ===== */
.text-hint {
  color: #999;
}

.text-danger {
  color: #ff6b6b;
}

.text-success {
  color: #00cc00;
}

.text-warning {
  color: #ff9800;
}

/* ===== Responsive Defaults (Non-Dashboard Pages) ===== */
@media (max-width: 1200px) {
  .site-page:not(.dashboard-page) .charts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-page .landing-highscore-grid,
  .landing-page .landing-global-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body {
    margin: 14px 12px;
  }

  h1 {
    font-size: clamp(30px, 8vw, 42px);
  }

  h2 {
    font-size: clamp(24px, 6vw, 32px);
  }

  .site-page:not(.dashboard-page) .admin-section,
  .site-page:not(.dashboard-page) .metrics-card {
    padding: 16px;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .tabs button {
    margin-right: 0;
    width: 100%;
  }

  .chart-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
  }

  .chart-controls label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 0;
  }

  #graphsControlsStack .controls-row {
    gap: 10px;
  }

  .season-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .season-filter button {
    width: 100%;
  }

  .form-actions {
    align-items: stretch;
  }

  .form-actions .dropbtn,
  .form-actions button {
    flex: 1 1 calc(50% - 5px);
    margin: 0;
  }

  .auth-shell,
  .auth-shell-wide {
    max-width: 100%;
  }

  .modal-box,
  .modal-box-large,
  #modalContent {
    width: min(94vw, 560px);
    padding: 18px;
  }

  .modal-actions {
    flex-wrap: wrap;
  }

  .modal-actions .modal-btn-cancel,
  .modal-actions .modal-btn-confirm,
  #modalCancel,
  #modalConfirm {
    flex: 1 1 calc(50% - 5px);
  }

  .app-page .app-header-row,
  .profile-page .profile-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .app-page #graphsControlsStack .controls-block {
    padding: 14px 16px;
  }

  .app-page .app-teammate-row {
    flex-direction: column;
    align-items: stretch;
  }

  .app-page .app-search-wrap {
    width: 100%;
  }

  .app-page .app-teammate-select {
    width: 100%;
  }

  .profile-page .profile-search-wrap {
    max-width: none;
  }

  .site-page:not(.dashboard-page) .admin-section {
    overflow-x: auto;
  }

  .site-page:not(.dashboard-page) .admin-section .admin-table,
  .site-page:not(.dashboard-page) .admin-section .metrics-table {
    min-width: 640px;
  }
}

@media (max-width: 768px) {
  .site-page:not(.dashboard-page) .charts {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .site-page:not(.dashboard-page) .chart-container {
    min-height: 220px;
    padding: 12px;
  }

  .landing-page .landing-highscore-grid,
  .landing-page .landing-global-grid {
    grid-template-columns: 1fr;
  }

  .landing-page .landing-auth-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .landing-page .landing-auth-buttons .dropbtn {
    width: 100%;
    text-align: center;
  }

  .tabs {
    grid-template-columns: 1fr;
  }

  .chart-controls {
    grid-template-columns: 1fr;
  }

  .app-page .chart-controls {
    gap: 10px;
  }

  .season-filter {
    grid-template-columns: 1fr;
  }

  #graphsControlsStack .controls-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .app-page #graphsControlsStack .controls-block {
    padding: 12px;
    border-radius: 10px;
  }

  .app-page #graphsControlsStack .controls-row > .dropbtn,
  .app-page .app-teammate-row > .dropbtn {
    width: 100%;
    min-height: 42px;
  }

  .radar-settings-grid {
    grid-template-columns: 1fr;
  }

  .radar-target-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .radar-target-label {
    padding-bottom: 0;
  }

  .radar-chart-shell,
  .radar-layout .radar-chart-shell {
    height: 360px;
  }

  .modal-actions .modal-btn-cancel,
  .modal-actions .modal-btn-confirm,
  #modalCancel,
  #modalConfirm,
  .form-actions .dropbtn,
  .form-actions button {
    flex: 1 1 100%;
    width: 100%;
  }
}

@media (max-width: 560px) {
  body {
    margin: 10px 8px;
  }

  h1 {
    font-size: clamp(28px, 9vw, 36px);
  }

  h2 {
    font-size: clamp(22px, 7vw, 28px);
  }

  .site-page:not(.dashboard-page) .admin-section,
  .site-page:not(.dashboard-page) .metrics-card {
    padding: 14px;
    border-radius: 6px;
  }

  .app-page #graphsControlsStack {
    gap: 10px;
  }

  .app-page #graphsControlsStack .controls-block {
    padding: 10px;
  }

  .app-page #appSelectedUsers [data-remove-user] {
    width: 100%;
    justify-content: center;
  }

  .app-page .chart-container {
    min-height: 200px;
  }
}

/* ===== Dashboard Layout ===== */
.dashboard-page {
  max-width: 100%;
}

.dashboard-page .dashboard-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.dashboard-page .dashboard-title-group h1,
.dashboard-page .dashboard-title-group h2 {
  margin-left: 0;
}

.dashboard-page .dashboard-user-info {
  max-width: 720px;
  margin-bottom: 20px;
}

.dashboard-page .dashboard-section-toggle {
  margin-bottom: 15px;
  width: 100%;
  text-align: left;
  font-size: 18px;
  font-weight: bold;
}

.dashboard-page .dashboard-section-content {
  margin-top: 0;
}

.dashboard-page .dashboard-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

.dashboard-page .dashboard-action-row .dropbtn {
  margin: 0;
}

.dashboard-page .dashboard-table-host {
  margin-top: 15px;
  min-width: 0;
}

.dashboard-page .dashboard-table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #3f3f3f;
  border-radius: 8px;
  background-color: #1f1f1f;
}

.dashboard-page .dashboard-table-scroll .admin-table {
  width: 100%;
  margin: 0;
}

.dashboard-page .dashboard-sessions-table {
  min-width: 0;
  table-layout: fixed;
}

.dashboard-page .dashboard-sessions-table col.dashboard-sessions-col {
  width: 10%;
}

.dashboard-page .dashboard-comparison-table {
  min-width: 640px;
}

.dashboard-page .dashboard-comparison-table th,
.dashboard-page .dashboard-comparison-table td {
  white-space: nowrap;
}

.dashboard-page .sessions-actions-cell {
  min-width: 140px;
}

.dashboard-page .dashboard-sessions-table th,
.dashboard-page .dashboard-sessions-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  padding: 8px 6px;
  font-size: 12px;
  vertical-align: middle;
  text-align: center;
}

.dashboard-page .sessions-action-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.dashboard-page .btn-compact {
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.2;
}

.dashboard-page .sessions-pagination {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.dashboard-page .sessions-pagination-summary {
  color: #bbb;
}

.dashboard-page .sessions-pagination-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-page .sessions-page-indicator {
  color: #bbb;
  display: flex;
  align-items: center;
  padding: 0 6px;
}

.dashboard-page .sessions-filters {
  margin-top: 15px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.dashboard-page .sessions-limit-control {
  color: #bbb;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-page .sessions-select {
  padding: 8px;
  border-radius: 4px;
  background-color: #2d2d2d;
  color: #fff;
  border: 1px solid #444;
}

.dashboard-page .sessions-apply-btn {
  min-height: 38px;
}

.dashboard-page .dashboard-add-session {
  margin-top: 20px;
}

.dashboard-page .players-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.dashboard-page .player-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.dashboard-page .player-header-row h4 {
  margin: 0;
  color: #0d7377;
}

.dashboard-page .dashboard-session-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.dashboard-page .dashboard-teammate-btn {
  background-color: #14919b;
}

.dashboard-page .dashboard-submit-actions {
  margin-top: 20px;
}

.dashboard-page .comparison-controls {
  margin-bottom: 15px;
}

.dashboard-page .comparison-help {
  color: #bbb;
  display: block;
  margin-bottom: 8px;
}

.dashboard-page .comparison-season-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.dashboard-page .comparison-season-label {
  color: #bbb;
  font-size: 14px;
}

.dashboard-page .comparison-season-row .season-filter {
  margin: 0;
}

.dashboard-page .comparison-input-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  position: relative;
}

.dashboard-page .comparison-input-wrap {
  flex: 1 1 260px;
  min-width: 0;
  position: relative;
}

.dashboard-page .comparison-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #2d2d2d;
  border: 1px solid #444;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 150px;
  overflow-y: auto;
  display: none;
  z-index: 1000;
}

.dashboard-page .comparison-compare-btn {
  background-color: #0d7377;
}

.dashboard-page .comparison-selected-users {
  color: #bbb;
  font-size: 14px;
}

.comparison-user-link {
  color: #0d7377;
  text-decoration: none;
}

.comparison-user-link:hover {
  text-decoration: underline;
}

.dashboard-page .tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dashboard-page .tabs button {
  margin-right: 0;
}

.dashboard-page .chart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.dashboard-page .chart-controls label {
  margin-right: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dashboard-page .ocr-overlay-toggle-manual {
  margin-left: 12px;
}

.dashboard-page .ocr-reset-btn {
  margin-left: 8px;
}

@media (max-width: 1200px) {
  .dashboard-page .charts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-page .dashboard-action-row .dropbtn {
    flex: 1 1 180px;
  }
}

@media (max-width: 900px) {
  .dashboard-page {
    margin: 14px 10px;
  }

  .dashboard-page .admin-section {
    padding: 16px;
  }

  .dashboard-page .dashboard-header-row {
    margin-bottom: 16px;
  }

  .dashboard-page .dashboard-section-toggle {
    font-size: 17px;
  }

  .dashboard-page #addSessionForm .player-section {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 10px 12px;
    padding: 12px;
  }

  .dashboard-page #addSessionForm .player-section > div:first-child {
    grid-column: 1 / -1;
    flex: 0 0 auto;
    position: static;
    left: auto;
    background-color: transparent;
    padding-right: 0;
  }

  .dashboard-page #addSessionForm .player-section > div:not(:first-child) {
    display: block;
  }

  .dashboard-page #addSessionForm .player-section label {
    display: block;
  }

  .dashboard-page #addSessionForm .player-section input,
  .dashboard-page #addSessionForm .player-section .playerUsername {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .dashboard-page .charts {
    grid-template-columns: 1fr;
  }

  .dashboard-page .metrics-content {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dashboard-page .metrics-table {
    min-width: 620px;
    table-layout: fixed;
  }

  .dashboard-page .metrics-table th,
  .dashboard-page .metrics-table td {
    padding: 8px 10px;
  }

  .dashboard-page .metrics-table th:first-child,
  .dashboard-page .metrics-table td:first-child {
    width: 42%;
    min-width: 220px;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .dashboard-page .metrics-table th:not(:first-child),
  .dashboard-page .metrics-table td:not(:first-child) {
    width: 19.333%;
    min-width: 130px;
    text-align: right;
    white-space: nowrap;
  }

  .dashboard-page .chart-container {
    min-height: 220px;
    padding: 12px;
  }

  .dashboard-page .tabs button {
    flex: 1 1 calc(50% - 6px);
    min-width: 120px;
  }

  .dashboard-page #graphsControlsStack .controls-row {
    gap: 10px;
  }

  .dashboard-page #dashWinLossFilterSection .controls-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .dashboard-page .chart-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
  }

  .dashboard-page .dashboard-action-row .dropbtn,
  .dashboard-page .dashboard-session-form-actions .dropbtn,
  .dashboard-page .sessions-pagination-controls .dropbtn,
  .dashboard-page .sessions-filters .dropbtn,
  .dashboard-page .sessions-filters select,
  .dashboard-page .comparison-input-row .dropbtn {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }

  .dashboard-page .comparison-input-wrap {
    flex: 1 1 100%;
  }

  .dashboard-page .sessions-limit-control {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  .dashboard-page .dashboard-table-scroll {
    border-radius: 6px;
  }

  .dashboard-page .dashboard-sessions-table {
    min-width: 980px;
    table-layout: auto;
  }

  .dashboard-page .dashboard-sessions-table th,
  .dashboard-page .dashboard-sessions-table td {
    white-space: nowrap;
    overflow-wrap: normal;
  }

  .dashboard-page .dashboard-comparison-table {
    min-width: 560px;
  }

  .dashboard-page .ocr-preview-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .dashboard-page .ocr-task-card-header {
    flex-direction: column;
    gap: 4px;
  }

  .dashboard-page .ocr-batch-review-controls {
    grid-template-columns: 1fr;
  }

  .dashboard-page .ocr-batch-review-modal-content {
    width: min(96vw, 920px);
    max-width: min(96vw, 920px);
  }

  .dashboard-page .ocr-overlay-toggle-manual,
  .dashboard-page .ocr-reset-btn {
    margin-left: 0;
  }
}

@media (max-width: 560px) {
  .dashboard-page .dashboard-header-row h1 {
    font-size: 30px;
    margin-bottom: 8px;
  }

  .dashboard-page .dashboard-header-row h2 {
    font-size: 24px;
    line-height: 1.1;
  }

  .dashboard-page #addSessionForm .player-section {
    grid-template-columns: 1fr;
  }

  .dashboard-page .tabs button,
  .dashboard-page .dashboard-action-row .dropbtn,
  .dashboard-page .dashboard-session-form-actions .dropbtn,
  .dashboard-page .sessions-pagination-controls .dropbtn,
  .dashboard-page .sessions-filters .dropbtn,
  .dashboard-page .sessions-filters select,
  .dashboard-page .comparison-input-row .dropbtn {
    flex: 1 1 100%;
    width: 100%;
  }

  .dashboard-page .chart-controls {
    grid-template-columns: 1fr;
  }

  .dashboard-page .sessions-pagination {
    align-items: stretch;
  }

  .dashboard-page .sessions-pagination-controls {
    width: 100%;
  }

  .dashboard-page .sessions-page-indicator {
    padding: 0;
  }
}
