:root {
  --cream: #FBF3E4;
  --teal: #1F4B4C;
  --teal-dark: #163636;
  --raspberry: #C1443C;
  --mustard: #E2A63B;
  --sage: #8FA998;
  --charcoal: #2B2620;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--charcoal);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

h1, h2 {
  font-family: 'Fraunces', Georgia, serif;
  color: var(--teal-dark);
  line-height: 1.15;
  margin: 0 0 0.4em;
}

h1 { font-size: 2rem; font-weight: 600; }
h2 { font-size: 1.25rem; font-weight: 600; margin-top: 0; }

a { color: var(--raspberry); }

/* Bunting strip: a row of alternating colored triangles across the top */
.bunting {
  display: flex;
  height: 18px;
  width: 100%;
}
.bunting span {
  flex: 1;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  margin: 0 2px;
}
.bunting span:nth-child(5n+1) { background: var(--raspberry); }
.bunting span:nth-child(5n+2) { background: var(--mustard); }
.bunting span:nth-child(5n+3) { background: var(--teal); }
.bunting span:nth-child(5n+4) { background: var(--sage); }
.bunting span:nth-child(5n+5) { background: var(--raspberry); }

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid rgba(31, 75, 76, 0.15);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.brand {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--teal-dark);
  text-decoration: none;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.95rem;
}
.site-header nav a { color: var(--charcoal); text-decoration: none; }
.site-header nav a:hover { color: var(--raspberry); }

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.card {
  background: #fff;
  border: 1px solid rgba(31, 75, 76, 0.12);
  border-radius: 6px;
  padding: 2rem;
}
.card.narrow { max-width: 420px; margin: 0 auto; }
.card.wide { max-width: 700px; margin: 0 auto; }

.lede {
  color: rgba(43, 38, 32, 0.75);
  max-width: 56ch;
  margin-bottom: 1.5rem;
}

.stack-form { display: flex; flex-direction: column; gap: 1.1rem; }
.stack-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.stack-form .hint { font-weight: 400; font-size: 0.8rem; color: rgba(43, 38, 32, 0.6); }

input, select {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid rgba(31, 75, 76, 0.3);
  border-radius: 4px;
  background: var(--cream);
  color: var(--charcoal);
}
input:focus, select:focus, button:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.btn-primary, .btn-secondary {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.65rem 1.3rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  width: fit-content;
}
.btn-primary { background: var(--raspberry); color: #fff; }
.btn-primary:hover { background: #a63930; }
.btn-secondary { background: var(--teal); color: #fff; }
.btn-secondary:hover { background: var(--teal-dark); }

.link-button {
  background: none;
  border: none;
  color: var(--charcoal);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.link-button.danger { color: var(--raspberry); }

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

.form-error {
  background: rgba(193, 68, 60, 0.1);
  border: 1px solid rgba(193, 68, 60, 0.3);
  color: var(--raspberry);
  padding: 0.7rem 0.9rem;
  border-radius: 4px;
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}

.form-footnote { margin-top: 1.5rem; font-size: 0.9rem; }

/* Bracket prediction list */
.bracket-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  border-top: 1px solid rgba(31, 75, 76, 0.12);
}
.bracket-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(31, 75, 76, 0.12);
}
.bracket-label {
  flex: 0 0 150px;
  font-size: 0.9rem;
  color: rgba(43, 38, 32, 0.7);
}
.bracket-row select { flex: 1; }
.bracket-row:last-child .bracket-label { color: var(--raspberry); font-weight: 600; }

.row-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1.2rem;
}
.row-form input, .row-form select { flex: 1; min-width: 140px; }

.admin-section {
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(31, 75, 76, 0.12);
}
.admin-section:last-child { border-bottom: none; padding-bottom: 0; }

.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(31, 75, 76, 0.08);
  font-size: 0.95rem;
}

.board {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.board th, .board td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid rgba(31, 75, 76, 0.12);
}
.board th {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  color: var(--teal-dark);
}

@media (max-width: 480px) {
  .bracket-row { flex-direction: column; align-items: flex-start; }
  .bracket-label { flex: none; }
  .bracket-row select { width: 100%; }
}
