:root {
  --primary-color: #1C352D;
  --primary-dark: #064232;
  --accent-color: #F2B705;
  --bg-color: #F8F9FA;
  --card-bg: #FFFFFF;
  --text-color: #333;
  --error-color: #D9534F;
  --shadow: 0 4px 10px rgba(0,0,0,0.05);
  --radius: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  text-align: center;
  padding: 2rem 1rem;
}
header h1 {
  font-size: 2rem;
}
header p {
  margin-top: 0.5rem;
  font-size: 1rem;
  opacity: 0.9;
}

/* Main Layout */
main {
  flex: 1;
  width: 100%;
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Section Cards */
section {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 2rem;
}
section h2 {
  margin-bottom: 1rem;
  color: var(--primary-dark);
}

/* Tournament List */
.tournament-list {
  list-style: none;
}
.tournament-list li {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0.75rem;
  border-bottom: 1px solid #eee;
}
.tournament-list li:last-child {
  border-bottom: none;
}
.tournament-list .tournament-name {
  font-weight: bold;
}
.open-tournament-btn {
  background: var(--accent-color);
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
}
.open-tournament-btn:hover {
  background: #e0a800;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}
input[type="text"], input[type="file"], input[type="number"], textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  font-size: 1rem;
}
button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  margin-top: 0.5rem;
}
button:hover {
  background: var(--primary-dark);
}
.error {
  color: var(--error-color);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Teams Input */
.team-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.team-name-input {
  flex: 1 1 200px;
}
.team-logo-input {
  flex: 1 1 150px;
}
.remove-team-btn {
  background: var(--error-color);
}

/* Team Logo */
.team-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: white;
  padding: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Schedule */
#scheduleContainer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Scoreboard */
.scoreboard-wrapper {
  width: 100%;
  overflow-x: auto; /* Prevents overflow on mobile */
}
#scoreboardTable {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px; /* Ensures table keeps structure */
}
#scoreboardTable th, #scoreboardTable td {
  padding: 0.5rem;
  border: 1px solid #ddd;
  text-align: center;
  font-size: 0.9rem;
}
#scoreboardTable th {
  background: var(--accent-color);
  color: white;
  font-weight: bold;
}

/* Footer */
footer {
  background: var(--primary-color);
  color: white;
  text-align: center;
  padding: 1rem;
}
.social-buttons {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.social-button {
  width: 40px;
  height: 40px;
  background: white;
  color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}
.social-button:hover {
  background: var(--accent-color);
  color: white;
  transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.5rem;
  }
  main {
    margin: 1rem auto;
  }
  .tournament-list li {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
  button, input, textarea {
    font-size: 0.9rem;
  }
}
