@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600&family=Work+Sans:wght@400;500;600&display=swap');

:root {
  --ink: #1b1b1b;
  --accent: #264653;
  --accent-2: #f4a261;
  --panel: #fff;
  --stroke: #d8d2c8;
  --bg: #f7f2ea;
  --ready: #e7f4ed;
}

body {
  margin: 0;
  font-family: "Work Sans", sans-serif;
  background: linear-gradient(120deg, #f7f2ea, #eef5f3);
  color: var(--ink);
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.7);
}

h1 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

main {
  padding: 10px 16px;
  display: grid;
  gap: 10px;
}

.status-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.sync-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  font-weight: 600;
}

.sync-toggle input {
  margin: 0;
}

.status {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  font-weight: 600;
}

.status.ghost {
  background: transparent;
  color: #5a564d;
}

.tab-switch {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: #f3eee6;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--accent-2);
  color: #1b1b1b;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 12px 24px rgba(27, 27, 27, 0.08);
}

.panel.ready {
  background: var(--ready);
}

.tab-panel.ready .panel {
  background: var(--ready);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.field.inline {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

label {
  font-weight: 600;
}

input, select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
}

button {
  padding: 5px 8px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
}

button.ghost {
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--ink);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button.ghost {
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--ink);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.row.compact-row {
  gap: 8px;
}

button.compact {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 8px;
}

.compact-input {
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 8px;
  width: 64px;
}

.card {
  border: 1px dashed var(--stroke);
  border-radius: 12px;
  padding: 8px;
  background: #fcf8f2;
  white-space: pre-line;
  font-size: 13px;
  line-height: 1.2;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid #ece5da;
  font-size: 13px;
}

.player-row:last-child {
  border-bottom: none;
}

.player-row.admitted {
  background: #e7f3f0;
  border-radius: 8px;
  padding: 4px 6px;
}

.player-meta {
  font-size: 11px;
  color: #5a564d;
}

#spectatorList div {
  padding: 2px 0;
}

.note {
  background: #fcf5ea;
  border: 1px dashed var(--stroke);
  border-radius: 12px;
  padding: 12px;
  white-space: pre-line;
}

.plays-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.plays-table th,
.plays-table td {
  border-bottom: 1px solid var(--stroke);
  padding: 6px 8px;
  text-align: center;
}

.panel-block {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 12px;
  background: #fffdf9;
  margin-bottom: 12px;
}

.panel-title {
  font-weight: 600;
  margin-bottom: 10px;
}

@media (max-width: 900px) {
  .panel-grid {
    grid-template-columns: 1fr;
  }
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 14px;
  }
  h1 {
    font-size: 20px;
  }
  h2 {
    font-size: 16px;
  }
  input, select, button {
    font-size: 13px;
  }
}
