:root {
  --bg-top: #f0fce8;
  --bg-mid: #e2f5d4;
  --surface: #f7fff2;
  --surface-deep: #eefae6;
  --border: #b5d99c;
  --border-strong: #9ccc7a;
  --text: #1e2e18;
  --muted: #5a6d52;
  --accent: #5a8f2a;
  --accent-hover: #4a7a22;
  --link: #3d6b1f;
  --success: #2e7d32;
  --error: #c62828;
  --radius: 10px;
  --font: "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: linear-gradient(165deg, var(--bg-top) 0%, var(--bg-mid) 45%, #d4edc8 100%);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(230, 250, 210, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  flex-wrap: wrap;
}

.logo {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.logo:hover {
  text-decoration: none;
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.main {
  padding: 2rem 0 3rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  font-size: 0.85rem;
}

.muted {
  color: var(--muted);
}

.lead {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

h1 {
  font-size: 1.65rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.flash-list {
  margin-bottom: 1.25rem;
}

.flash {
  padding: 0.65rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}

.flash-success {
  background: rgba(180, 230, 160, 0.55);
  border: 1px solid var(--border-strong);
  color: #1b4d1e;
}

.flash-error {
  background: rgba(255, 220, 210, 0.75);
  border: 1px solid #e8a598;
  color: #8b1c1c;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(90, 120, 60, 0.08);
}

.form-card .field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.form-card input,
.form-card select {
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fbfff7;
  color: var(--text);
  font-size: 1rem;
}

.form-card select option:disabled {
  color: var(--muted);
}

.req {
  color: var(--error);
}

.btn {
  display: inline-block;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface-deep);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
}

.btn:hover {
  background: #e4f2d8;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent-hover);
  color: #fff;
}

.btn.primary:hover {
  background: var(--accent-hover);
}

.btn.ghost {
  background: transparent;
}

.btn.small {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
}

.btn.danger {
  border-color: #e57373;
  background: #ffebee;
  color: #b71c1c;
}

.btn.danger:hover {
  background: #ffcdd2;
}

.inline-form {
  display: inline;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data-table th {
  background: #e8f5e0;
  font-weight: 600;
  color: var(--muted);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table .num {
  text-align: right;
  white-space: nowrap;
}

.data-table .actions-cell {
  white-space: nowrap;
  vertical-align: middle;
}

.data-table .actions-cell-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.delete-reg-form {
  display: inline;
  margin: 0;
}

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

.row-full {
  opacity: 0.75;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-open {
  background: rgba(160, 220, 130, 0.45);
  color: #1b4d1e;
}

.badge-full {
  background: rgba(255, 200, 190, 0.5);
  color: #8b1c1c;
}

.hint-card h2 {
  margin-top: 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.filter-form select {
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fbfff7;
  color: var(--text);
  margin-left: 0.35rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.summary-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  background: var(--surface);
}

.summary-card.full {
  border-color: rgba(200, 100, 80, 0.45);
}

.summary-title {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.summary-num {
  font-size: 1.15rem;
  font-weight: 700;
}

code {
  background: #e8f5e0;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.88em;
  border: 1px solid var(--border);
}

.form-inline-top {
  margin-bottom: 2rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

.section {
  margin-bottom: 2.25rem;
}

.section-games {
  padding: 1.25rem 1.35rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid #9ccc65;
  background: linear-gradient(180deg, #f0fff0 0%, #e4f8dc 100%);
  box-shadow: 0 2px 8px rgba(100, 140, 60, 0.1);
}

.section-masters {
  padding: 1.25rem 1.35rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid #aed581;
  background: linear-gradient(180deg, #f4ffea 0%, #e0f2cb 100%);
  box-shadow: 0 2px 8px rgba(120, 150, 70, 0.1);
}

.section-head {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  letter-spacing: 0.02em;
}

.section-games .section-title {
  color: #33691e;
}

.section-masters .section-title {
  color: #558b2f;
}

.section-desc {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.event-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.event-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.65);
}

.event-row-full {
  opacity: 0.72;
  border-style: dashed;
}

.event-main {
  flex: 1 1 220px;
  min-width: 0;
}

.event-time {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #558b2f;
  margin-bottom: 0.25rem;
}

.event-title {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  line-height: 1.4;
}

.event-spots {
  font-size: 0.88rem;
  color: var(--muted);
}

.spots-label {
  margin-right: 0.35rem;
}

.spots-num {
  color: var(--success);
  font-size: 1.05rem;
}

.event-row-full .spots-num {
  color: var(--error);
}

.spots-of {
  margin-left: 0.25rem;
}

.event-action {
  flex: 0 0 auto;
}

.event-action .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.hint-footer {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}
