:root {
  --bg: #0c0f14;
  --panel: #161b22;
  --accent: #4fd1ff;
  --text: #e6edf3;
  --muted: #8b949e;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* Used on the TV scoreboard page so everything fits on one screen with no scrolling */
body.scoreboard-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.scoreboard-page .board-grid {
  flex: 1 1 auto;
  min-height: 0;
}

body.scoreboard-page header {
  flex: 0 0 auto;
}

header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 16px 24px;
  background: var(--panel);
  border-bottom: 1px solid #232a34;
}

header h1 {
  margin: 0;
  font-size: 1.4rem;
  text-align: center;
  justify-self: center;
}

.admin-link {
  justify-self: end;
}

.logo {
  height: 48px;
  width: auto;
  justify-self: start;
}

.admin-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  border: 1px solid var(--accent);
  padding: 6px 12px;
  border-radius: 6px;
}

.admin-link:hover {
  background: var(--accent);
  color: #0c0f14;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 12px;
  min-width: 0;
  overflow: hidden;
}

@media (max-width: 900px) {
  .board-grid {
    grid-template-columns: 1fr;
  }
}

.board-card {
  background: var(--panel);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #232a34;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.board-card h2 {
  flex: 0 0 auto;
  margin: 0;
  padding: 6px 12px;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid #232a34;
}

.crop-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)),
    url("background.jpg") center / cover no-repeat,
    #000;
}

.crop {
  background: #000;
}

.empty-msg {
  text-align: center;
  color: var(--muted);
  padding: 40px;
}

/* Admin page */
.admin-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
}

.admin-wrap h2 {
  border-bottom: 1px solid #232a34;
  padding-bottom: 8px;
}

.board-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.board-inputs label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: var(--muted);
  gap: 4px;
}

input[type="text"],
input[type="number"],
input[type="range"] {
  background: var(--panel);
  border: 1px solid #2d3744;
  border-radius: 6px;
  color: var(--text);
  padding: 8px;
}

.crop-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.crop-controls label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: var(--muted);
  gap: 4px;
}

.crop-controls output {
  color: var(--accent);
  font-weight: bold;
}

.preview {
  margin: 20px 0;
}

.preview .crop {
  max-width: 400px;
  border: 1px solid #2d3744;
  border-radius: 12px;
}

button {
  background: var(--accent);
  color: #0c0f14;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

button:hover {
  opacity: 0.85;
}

.save-msg {
  color: #4fffb0;
  margin-left: 12px;
}
