body {
  font-family: sans-serif;
  padding: 2rem;
  background: #f0f0f0;
  margin: 0;
  box-sizing: border-box;
  padding-top: 60px; /* 탭 메뉴 높이만큼 패딩 추가 */
}

.container {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  max-width: 1000px;
  margin: auto;
  margin-bottom: 3rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

h1 {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.scroll-box {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.table-wrapper {
  overflow-x: auto; /* 가로 스크롤 추가 */
  width: 100%;
  scroll-behavior: smooth;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 600px; /* 최소 너비 설정 */
}

th, td {
  border: 1px solid #ccc;
  padding: 0.5rem;
  text-align: center;
  white-space: nowrap;
  word-wrap: break-word;
}

input[type="number"] {
  width: 80px; /* 숫자 입력 칸 크기 조정 */
  padding: 0.5rem;
  text-align: center;
  font-size: 1rem;
}

input.subject-input {
  width: 100px; /* 과목 입력 칸 크기 조정 */
  text-align: center;
  font-weight: bold;
}

.ranking-title {
  margin-top: 1rem;
  font-weight: bold;
  font-size: 1.2rem;
}

.scroll-btn {
  background: #333;
  color: #fff;
  border: none;
  font-size: 1.2rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.left {
  margin-right: 0.5rem;
}

.right {
  margin-left: 0.5rem;
}

th.sticky-col, td.sticky-col {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 2;
}

#scoreInputForm {
  display: none;
}

#loadingMessage {
  text-align: center;
  font-size: 20px;
  color: #888;
}

@media (max-width: 768px) {
  /* 작은 화면에서 테이블 내용 조정 */
  table {
    min-width: 450px;
  }

  th, td {
    font-size: 0.9rem;
  }

  input[type="number"] {
    width: 60px;
    font-size: 0.9rem;
  }

  input.subject-input {
    width: 80px;
    font-size: 0.9rem;
  }
}

body {
  text-align: center;
  font-family: sans-serif;
  padding: 50px 20px 100px;
  box-sizing: border-box;
  background-color: white;  /* 배경색을 흰색으로 변경 */
}

h1 {
  font-size: 32px;
  margin-bottom: 20px;
  color: #333;
}

#game-timer {
  font-size: 120px;
  margin: 30px 0;
  color: #333;
  font-weight: bold;
}

#shot-clock {
  font-size: 100px;
  color: #e74c3c;  /* 빨간색을 좀 더 부드럽게 */
  margin-bottom: 30px;
  font-weight: bold;
}

button {
  font-size: 20px;
  margin: 5px;
  padding: 10px 20px;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.preset-buttons {
  margin-bottom: 20px;
}

.preset-buttons button {
  background-color: #3498db;
  color: white;
}

.preset-buttons button:hover {
  background-color: #2980b9;
}

.shot-clock-buttons {
  margin-bottom: 20px;
}

.shot-clock-buttons span {
  font-size: 18px;
  margin-right: 10px;
  vertical-align: middle;
  color: #333;
}

.shot-clock-set-btn {
  font-size: 18px;
  padding: 8px 16px;
  margin: 0 5px;
  border: 2px solid #3498db;
  border-radius: 8px;
  background-color: white;
  color: #3498db;
  transition: 0.2s;
}

.shot-clock-set-btn.active {
  background-color: #3498db;
  color: white;
}

.buttons {
  margin-bottom: 30px;
}

.buttons button {
  margin: 0 10px;
}

#start-btn {
  background-color: #2ecc71;
  color: white;
}

#start-btn:hover {
  background-color: #27ae60;
}

#stop-btn {
  background-color: #e74c3c;
  color: white;
}

#stop-btn:hover {
  background-color: #c0392b;
}

#reset-btn {
  background-color: #f39c12;
  color: white;
}

#reset-btn:hover {
  background-color: #d35400;
}

#possession-btn {
  background-color: #9b59b6;
  color: white;
}

#possession-btn:hover {
  background-color: #8e44ad;
}

#scoreboard {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.team {
  background-color: #f8f9fa;
  border-radius: 12px;
  padding: 25px 35px;
  min-width: 200px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.team-name {
  font-size: 1.5rem;
  font-weight: bold;
  text-align: center;
  border: none;
  background: transparent;
  width: 100%;
  margin-bottom: 15px;
  color: #333;
}

.team-name:focus {
  outline: 2px solid #3498db;
  border-radius: 4px;
}

.score {
  font-size: 48px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #2ecc71;
}

.score-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}

.score-buttons button {
  font-size: 16px;
  padding: 8px 16px;
  background-color: #3498db;
  color: white;
}

.score-buttons button:hover {
  background-color: #2980b9;
}

.foul {
  font-size: 24px;
  color: #e74c3c;
  font-weight: bold;
  margin: 15px 0;
}

#made-by {
  position: fixed;
  top: 10px;
  right: 20px;
  font-size: 14px;
  font-family: 'Arial', sans-serif;
  color: #666;
  background: white;
  padding: 8px 15px;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 1000;
}

.highlight-name {
  color: #3498db;
  font-weight: bold;
}

.foul-buttons {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-top: 15px;
  flex-wrap: wrap;
}

.foul-btn {
  font-size: 16px;
  padding: 6px 12px;
  background-color: #e74c3c;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.foul-btn:hover {
  background-color: #c0392b;
}

#foul-reset-btn-a, #foul-reset-btn-b {
  background-color: #95a5a6;
}

#foul-reset-btn-a:hover, #foul-reset-btn-b:hover {
  background-color: #7f8c8d;
}

#foul-minus-btn-a, #foul-minus-btn-b {
  background-color: #e74c3c;
}

#foul-minus-btn-a:hover, #foul-minus-btn-b:hover {
  background-color: #c0392b;
}

@media (max-width: 768px) {
  body {
    padding: 30px 10px 80px;
  }

  #game-timer {
    font-size: 80px;
  }

  #shot-clock {
    font-size: 60px;
  }

  .team {
    padding: 20px;
    min-width: 160px;
  }

  .score {
    font-size: 36px;
  }

  .foul {
    font-size: 20px;
  }

  button {
    font-size: 16px;
    padding: 8px 16px;
  }
}

/* 탭 메뉴 스타일 */
.tab-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #1a1a1a;
  display: flex;
  justify-content: center;
  padding: 10px 0;
  z-index: 1000;
}

.tab-menu a {
  color: white;
  text-decoration: none;
  padding: 10px 20px;
  margin: 0 10px;
  border-radius: 5px;
  transition: background-color 0.3s;
}

.tab-menu a:hover {
  background-color: #333;
}

.tab-menu a.active {
  background-color: #3498db;
}
