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

body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  color: #1a1a1a;
  background: #f9f7f4;
  line-height: 1.5;
}

header {
  background: linear-gradient(to bottom, #1a3a7c, #f5c518);
  color: #fff;
  text-align: center;
  padding: 1.5rem 1rem;
}

header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

header .subtitle {
  margin-top: 0.25rem;
  font-size: 1rem;
  opacity: 0.85;
}

main {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Loading / error states */
.loading {
  text-align: center;
  color: #666;
  padding: 2rem;
}

.error-banner {
  background: #fdecea;
  border: 1px solid #f5c6c2;
  color: #8b1a1a;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

/* Desktop table */
#schedule {
  width: 100%;
  border-collapse: collapse;
}

#schedule thead th {
  background: #f0ebe3;
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #d4c9b8;
}

#schedule tbody tr {
  border-bottom: 1px solid #e5ddd0;
}

#schedule tbody tr:last-child {
  border-bottom: none;
}

#schedule td {
  padding: 0.75rem;
  vertical-align: top;
}

#schedule td:first-child {
  white-space: nowrap;
  color: #555;
  font-size: 0.9rem;
  min-width: 180px;
}

#schedule td:nth-child(2) {
  white-space: pre-line;
}

/* Row states */
.row-taken td { background: #fff; }
.row-info-only td { background: #fafaf8; color: #888; font-style: italic; }
.row-open td { background: #fff; }

.sponsor-name {
  display: block;
  font-weight: 600;
}

.sponsor-comments {
  display: block;
  font-size: 0.85rem;
  color: #666;
}

/* Sponsor button */
.btn-sponsor {
  background: #1a3a7c;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn-sponsor:hover { background: #122a5e; }

/* Inline signup form */
.signup-form {
  margin-top: 0.75rem;
  background: #f5f1eb;
  border: 1px solid #d4c9b8;
  border-radius: 6px;
  padding: 1rem;
}

.form-field {
  margin-bottom: 0.75rem;
}

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

.form-field input {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid #bbb;
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
}

.form-field input:focus {
  outline: 2px solid #1a3a7c;
  border-color: #1a3a7c;
}

.form-field input[aria-invalid="true"] {
  border-color: #c0392b;
}

.required { color: #c0392b; margin-left: 2px; }
.optional { font-weight: 400; color: #888; font-size: 0.8rem; }

.field-error {
  display: block;
  font-size: 0.8rem;
  color: #c0392b;
  margin-top: 0.2rem;
  min-height: 1rem;
}

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

.btn-claim {
  background: #1a3a7c;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1.1rem;
  font-size: 0.95rem;
  cursor: pointer;
}

.btn-claim:hover { background: #122a5e; }
.btn-claim:disabled { background: #aaa; cursor: not-allowed; }

.btn-cancel {
  background: none;
  border: 1px solid #bbb;
  border-radius: 4px;
  padding: 0.5rem 0.9rem;
  font-size: 0.95rem;
  cursor: pointer;
  color: #555;
}

.btn-cancel:hover { background: #eee; }

.submit-error {
  font-size: 0.85rem;
  color: #c0392b;
}

/* Mobile: stacked cards under 600px */
@media (max-width: 599px) {
  header h1 { font-size: 1.3rem; }

  #schedule thead { display: none; }

  #schedule tbody tr {
    display: block;
    margin-bottom: 0.75rem;
    border: 1px solid #e5ddd0;
    border-radius: 6px;
    background: #fff;
    padding: 0.75rem;
  }

  #schedule td {
    display: block;
    padding: 0.2rem 0;
  }

  #schedule td:first-child {
    font-size: 0.8rem;
    color: #888;
    white-space: normal;
  }

  #schedule td:nth-child(2) {
    font-weight: 600;
  }

  .row-info-only {
    opacity: 0.65;
  }
}
