:root {
  color-scheme: light dark;
  --border: #ccc;
  --accent: #2a6f97;
  --bg-subtle: #f5f5f5;
}

* { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  margin: 0;
  line-height: 1.4;
}

.site-header {
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.site-title {
  font-weight: bold;
  font-size: 1.2rem;
  text-decoration: none;
  color: inherit;
}

.site-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
}

.muted { color: #777; font-size: 0.9em; }

.game-list {
  list-style: none;
  padding: 0;
}
.game-list li {
  padding: 0.4rem 0;
}

h1 { margin-top: 0; }

section.form-section {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

section.form-section > h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.section-description {
  color: #666;
  font-size: 0.9em;
  margin-top: -0.5rem;
}

.field {
  margin-bottom: 0.9rem;
}

.field > label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.field .help {
  color: #777;
  font-size: 0.85em;
  margin-top: 0.15rem;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  max-width: 480px;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font: inherit;
}

textarea { min-height: 4.5rem; }

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}
.checkbox-group label {
  font-weight: normal;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.repeat-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.repeat-item {
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  position: relative;
}

.repeat-item .remove-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

table.dsl-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}
table.dsl-table th,
table.dsl-table td {
  border: 1px solid var(--border);
  padding: 0.35rem 0.5rem;
  text-align: left;
}
table.dsl-table input,
table.dsl-table select {
  width: 100%;
  max-width: none;
  padding: 0.25rem 0.35rem;
}

button {
  font: inherit;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
  border-radius: 4px;
  cursor: pointer;
}
button.secondary {
  background: white;
  color: var(--accent);
}
button.danger {
  background: #b3261e;
  border-color: #b3261e;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}

#submit-feedback {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
}
#submit-feedback.success {
  background: #e6f4ea;
  border: 1px solid #34a853;
}
#submit-feedback.error {
  background: #fce8e6;
  border: 1px solid #b3261e;
}
#submit-feedback pre {
  white-space: pre-wrap;
  margin: 0.5rem 0 0;
}

.computed-preview {
  background: var(--bg-subtle);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  font-family: monospace;
}
