/* --- Player Settings Tabline and Color Styling (matches statistics UI) --- */
.player-settings.player-tabline {
  border-left: 3px solid var(--player-color, #00ccff);
  margin-left: 12px;
  padding-left: 16px;
}
.player-settings.p1-colored.player-tabline {
  --player-color: var(--p1-color, #00ccff);
}
.player-settings.p2-colored.player-tabline {
  --player-color: var(--p2-color, #ff6b6b);
}
.player-settings.p3-colored.player-tabline {
  --player-color: var(--p3-color, #4ecdc4);
}
.player-settings.p4-colored.player-tabline {
  --player-color: var(--p4-color, #f39c12);
}
.player-settings.player-tabline .setting-label,
.player-settings.player-tabline .number-input,
.player-settings.player-tabline .checkbox-input {
  color: var(--player-color, #00ccff) !important;
  border-color: var(--player-color, #00ccff);
}
/* Color input outline is always blue, not snake color */
.player-settings.player-tabline .color-input {
  border-color: #00ccff !important;
}
.player-settings.player-tabline .spinbox-btn {
  color: var(--player-color, #00ccff);
}
.player-settings.player-tabline .random-btn {
  color: var(--player-color, #00ccff);
}
/* Player subheading color matches player color */
.player-title {
  font-size: 16px;
  margin-bottom: 12px;
  font-weight: bold;
  text-align: left;
}
.p1-colored .player-title { color: var(--p1-color, #00ccff) !important; }
.p2-colored .player-title { color: var(--p2-color, #ff6b6b) !important; }
.p3-colored .player-title { color: var(--p3-color, #4ecdc4) !important; }
.p4-colored .player-title { color: var(--p4-color, #f39c12) !important; }
/* --- Statistics Section Styles (restored for left-aligned subheadings and tab lines) --- */
.statistics-header {
  margin-bottom: 20px;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  background: #282c34;
  padding: 24px 22px 18px 22px;
  text-align: left;
}
.statistics-header .section-title {
  /* Use the same style as .section-title for consistency */
  font-size: 24px;
  color: #00ccff;
  font-weight: bold;
  text-align: center;
  margin-bottom: 20px;
}
.stat-section {
  margin-bottom: 12px;
  text-align: left;
}
/* --- Statistics Section Styles (restored for left-aligned subheadings and tab lines) --- */
.stat-section-content {
  margin-left: 12px;
  padding-left: 16px;
  border-left: 3px solid #00ccff;
}
.stat-tabline-game {
  border-left-color: #00ccff;
}
.stat-tabline-ball {
  border-left-color: #00b8e6;
}
.stat-tabline-p1 {
  border-left-color: var(--p1-color, #00ccff);
}
.stat-tabline-p2 {
  border-left-color: var(--p2-color, #ff6b6b);
}
.stat-tabline-p3 {
  border-left-color: var(--p3-color, #4ecdc4);
}
.stat-tabline-p4 {
  border-left-color: var(--p4-color, #f39c12);
}
.stat-section-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 4px;
  margin-top: 2px;
  margin-left: 2px;
  color: #00b8e6;
  text-align: left;
}
.stat-section-player.p1-colored .stat-section-title {
  color: var(--p1-color, #00ccff);
}
.stat-section-player.p2-colored .stat-section-title {
  color: var(--p2-color, #ff6b6b);
}
.stat-section-player.p3-colored .stat-section-title {
  color: var(--p3-color, #4ecdc4);
}
.stat-section-player.p4-colored .stat-section-title {
  color: var(--p4-color, #f39c12);
}
.stat-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-size: 15px;
}
.stat-label {
  flex: 1;
  font-size: 15px;
  text-align: left;
  margin-right: 10px;
  color: #fff;
}
.stat-value {
  min-width: 40px;
  text-align: right;
  font-size: 15px;
  font-family: 'Segoe UI', monospace;
  color: #fff;
}
/* Make Game and Ball stat labels/values light blue */
.stat-tabline-game .stat-label,
.stat-tabline-game .stat-value,
.stat-tabline-ball .stat-label,
.stat-tabline-ball .stat-value {
  color: #00ccff !important;
}
/* Universal styles for all games (import in each game HTML) */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', sans-serif;
}
body {
  background-color: #23272a;
  color: #fff;
}
.navbar {
  background: #1f1f1f;
  color: #fff;
  height: 70px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1000;
}
.title {
  font-size: 28px;
  font-weight: bold;
  color: #00ccff;
  cursor: pointer;
}
/* Desktop Home button styles */
#return-home-btn {
  background: #00ccff;
  color: #1f1f1f;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 17px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,204,255,0.15);
  margin-left: 32px;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

/* Mobile navbar shrink styles */
@media (max-width: 600px) {
  .navbar {
    height: 40px;
    padding: 0 10px;
  }
  .navbar .title {
    font-size: 16px;
    line-height: 40px;
    padding: 0 2px 0 2px;
  }
  #return-home-btn {
    font-size: 13px;
    padding: 0 10px;
    margin-left: 8px;
    height: 32px;
    line-height: 32px;
    border-radius: 7px;
    box-shadow: 0 1px 4px rgba(0,204,255,0.10);
    display: flex;
    align-items: center;
    vertical-align: middle;
  }
}
#return-home-btn:hover, #return-home-btn:focus-visible {
  background: #0099cc !important;
  color: #1f1f1f !important;
  box-shadow: 0 2px 8px rgba(0,204,255,0.22) !important;
  outline: none;
}
.container {
  max-width: none;
  margin: 40px 5px 0 5px;
  padding: 0;
}
.game-header,
.statistics-header,
.settings-container {
  max-width: 700px;
  margin: 20px auto 0 auto;
  width: 100%;
  box-sizing: border-box;
  padding-left: 0;
  padding-right: 0;
}
.game-header {
  background: #282c34;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  padding: 32px 28px;
  margin-bottom: 20px;
  text-align: center;
}
.game-title {
  font-size: 36px;
  color: #00ccff;
  margin-bottom: 12px;
  font-weight: bold;
}
.game-description {
  font-size: 18px;
  color: #fff;
  line-height: 1.5;
}
.game-screen {
  border: 3px solid #00ccff;
  border-radius: 12px;
  margin: 0 auto 20px auto;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  width: fit-content;
}
#gameCanvas {
  display: block;
  background: #404040;
  margin: 0 auto;
}
.game-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.control-btn {
  background: #00ccff;
  color: #1f1f1f;
  border: none;
  border-radius: 8px;
  padding: 12px 28px;
  font-size: 18px;
  font-weight: bold;
  font-family: 'Segoe UI', sans-serif;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0,204,255,0.15);
}
.control-btn:hover,
.control-btn:focus-visible {
  background: #0099cc !important;
  color: #1f1f1f !important;
  box-shadow: 0 2px 8px rgba(204,255,255,0.22) !important;
  outline: none;
}
.control-btn:disabled {
  background: #444;
  color: #888;
  cursor: not-allowed;
  box-shadow: none;
}
.control-btn.end-btn {
  background: #e74c3c;
  box-shadow: 0 2px 8px rgba(231,76,60,0.15);
}
.control-btn.end-btn:hover {
  background: #c0392b !important;
  box-shadow: 0 2px 8px rgba(231,76,60,0.22) !important;
}
.control-btn.pause-btn {
  background: #0099ff;
  box-shadow: 0 2px 8px rgba(0,153,255,0.15);
    min-width: 110px; /* Ensures Pause/Play button width stays consistent */
}
.control-btn.pause-btn:hover {
  background: #007acc !important;
  box-shadow: 0 2px 8px rgba(0,153,255,0.22) !important;
}
.control-btn.restart-btn {
  background: #4aa30f;
  color: #1f1f1f;
  box-shadow: 0 2px 8px rgba(45,80,22,0.15);
}
.control-btn.restart-btn:hover,
.control-btn.restart-btn:focus-visible {
  background: #357a13 !important;
  color: #1f1f1f !important;
  box-shadow: 0 2px 8px rgba(45,80,22,0.22) !important;
  outline: none;
}
.settings-container {
  color: #fff;
  box-sizing: border-box;
  padding: 0;
}
.settings-wrapper {
  background: #282c34;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  padding: 32px 28px;
  margin-bottom: 20px;
  position: relative;
}
.elevated-section {
  background: #323842;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
.setting-section {
  margin-bottom: 20px;
}
.setting-section:last-child {
  margin-bottom: 0;
}
.section-title {
  font-size: 24px;
  color: #00ccff;
  margin-bottom: 20px;
  font-weight: bold;
  text-align: center;
}
.setting-subsection {
  margin-bottom: 24px;
}
.subsection-title {
  font-size: 20px;
  color: #00b8e6;
  margin-bottom: 16px;
  font-weight: bold;
  text-align: left;
}
/* (Removed duplicate .player-title, see above for new rules) */
/* Reset Player on Point checkbox outline and checkmark color */
#p1ResetOnPoint.checkbox-input {
  border-color: var(--p1-color, #00ccff);
}
#p1ResetOnPoint.checkbox-input:checked {
  background: var(--p1-color, #00ccff);
  border-color: var(--p1-color, #00ccff);
}
#p2ResetOnPoint.checkbox-input {
  border-color: var(--p2-color, #ff6b6b);
}
#p2ResetOnPoint.checkbox-input:checked {
  background: var(--p2-color, #ff6b6b);
  border-color: var(--p2-color, #ff6b6b);
}
#p3ResetOnPoint.checkbox-input {
  border-color: var(--p3-color, #4ecdc4);
}
#p3ResetOnPoint.checkbox-input:checked {
  background: var(--p3-color, #4ecdc4);
  border-color: var(--p3-color, #4ecdc4);
}
#p4ResetOnPoint.checkbox-input {
  border-color: var(--p4-color, #f39c12);
}
#p4ResetOnPoint.checkbox-input:checked {
  background: var(--p4-color, #f39c12);
  border-color: var(--p4-color, #f39c12);
}
.setting-group {
  margin-bottom: 16px;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 16px;
}
.setting-row:last-child {
  margin-bottom: 0;
}
.setting-label {
  color: #fff;
  font-size: 14px;
  flex: 1;
}
.mode-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.mode-btn {
  background: #1f1f1f;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 12px 18px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, border-radius 0.2s;
  font-size: 16px;
  font-weight: normal;
  font-family: 'Segoe UI', sans-serif;
  white-space: nowrap;
  margin: 6px;
}
.mode-btn.active {
  background: #00ccff;
  color: #1f1f1f;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,204,255,0.15);
  font-weight: bold;
}
.mode-btn.active:hover {
  background: #0099cc;
  color: #1f1f1f;
  box-shadow: 0 2px 8px rgba(204,255,255,0.22);
}
.mode-btn:hover:not(.active) {
  background: #2d2d2d;
  color: #ffffff;
  border-radius: 8px;
  font-weight: normal;
}
.color-input-container {
  display: flex;
  align-items: center;
  gap: 8px;
}
.color-input {
  width: 60px;
  height: 30px;
  border: 2px solid #00ccff;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: none;
}
.color-input::-webkit-color-swatch-wrapper {
  padding: 0;
  border: none;
  border-radius: 6px;
}
.color-input::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}
.random-btn {
  background: #1f1f1f;
  color: #00ccff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  font-family: 'Segoe UI', sans-serif;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(31,31,31,0.15);
}
.random-btn:hover {
  background: #2d2d2d;
  color: #00ccff;
  box-shadow: 0 2px 8px rgba(31,31,31,0.22);
}
.number-input-container {
  position: relative;
  display: flex;
  align-items: center;
  border: 2px solid #444;
  border-radius: 6px;
  background: #1f1f1f;
  width: 80px;
  height: 36px;
}
.number-input {
  background: transparent;
  color: #fff;
  border: none;
  padding: 8px 10px;
  width: 100%;
  font-size: 14px;
  font-family: 'Segoe UI', sans-serif;
  text-align: center;
  height: 100%;
  box-sizing: border-box;
  flex: 1;
  -webkit-appearance: none;
  -moz-appearance: textfield;
  appearance: none;
}
.number-input::-webkit-outer-spin-button,
.number-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.number-input:focus {
  outline: none;
}
.number-input-container:focus-within {
  border-color: #00ccff;
  box-shadow: 0 0 0 2px rgba(0,204,255,0.1);
}
.number-input-container:hover {
  border-color: #555;
}
.spinbox-btn {
  background: #2a2a2a;
  border: none;
  color: #00bfff;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 10px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 12px;
  border-radius: 3px;
  font-weight: bold;
}
.spinbox-btn:hover {
  background: #3a3a3a;
  color: #00ccff;
}
.spinbox-controls {
  display: flex;
  flex-direction: column;
  margin-left: 1px;
  padding-left: 1px;
  gap: 2px;
}
.checkbox-input {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #555;
  border-radius: 4px;
  background: #2c2c2c;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}
.checkbox-input:checked {
  background: var(--player-color, #00ccff);
  border-color: var(--player-color, #00ccff);
}
.checkbox-input:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ffffff;
  font-size: 14px;
  font-weight: bold;
}
.checkbox-input:hover {
  border-color: #666;
}
.checkbox-input {
  width: 18px;
  height: 18px;
  accent-color: #00ccff;
  cursor: pointer;
}
.score-display {
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  font-size: 24px;
  font-weight: bold;
  z-index: 10;
  pointer-events: none;
  padding: 0 20%;
  opacity: 0.7;
  font-family: 'Segoe UI', sans-serif;
}
.score-left {
  color: #00ccff;
  text-align: center;
}
.score-right {
  color: #ff6b6b;
  text-align: center;
}
.game-content {
  display: block;
}
.game-content.hidden {
  display: none !important;
}
