:root {
  /* Legacy hues, modern values */
  --brand-blue: #1e40af;
  --brand-blue-dark: #17307f;
  --identity-green: #22b563;
  --title-red: #d92c2c;
  --alert-yellow: #fbe94b;
  --paper: #f4f5f7;
  --ink: #17202e;
  --muted: #5b6472;
  --line: #d9dee6;

  /* Hub card palette - softened versions of the legacy card colors */
  --card-cyan: #c6ecf0;
  --card-cyan-title: #1740c7;
  --card-teal: #c3dcdc;
  --card-amber: #f6d78a;
  --card-orange: #f7bd7f;
  --card-olive: #d3d268;
  --card-mint: #b8f2d9;
  --card-magenta: #f0b3f0;
  --card-blue: #2a52be;
  --card-red: #d95050;

  /* Game grid column cycle */
  --game-mustard: #e6c14f;
  --game-yellow: #ece75f;
  --game-lime: #b5dd63;
  --game-aqua: #62e0bb;
  --tiebreak-magenta: #f28df5;

  /* Compare result colors, straight from the legacy sheet, gently softened */
  --result-wrong: #f5928d;
  --result-right: #8fe88f;
  --result-bonus: #ffc835;
  --result-unscored: #f2f8f2;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.45;
}

/* ---- The stacked bands ---- */

.band {
  width: 100%;
  text-align: center;
  padding: 0.55rem 1rem;
  font-weight: 700;
}

.band-brand {
  background: linear-gradient(180deg, #2450c8, var(--brand-blue));
  color: #fff;
  font-size: 1.45rem;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 6px rgba(23, 48, 127, 0.35);
}

.band-identity {
  background: var(--identity-green);
  color: #08351c;
  font-size: 1rem;
}

.band-title {
  background: var(--title-red);
  color: #fff;
  font-size: 1.2rem;
}

.band-alert {
  background: var(--alert-yellow);
  color: #33290a;
  font-size: 0.98rem;
}

.band-alert-success { background: #c9f3d6; color: #0c5227; }

.page {
  max-width: 68rem;
  margin: 1.2rem auto;
  padding: 0 1rem 2rem;
}

h1 { font-size: 1.4rem; }
h2 { font-size: 1.15rem; margin-top: 1.6rem; }

/* ---- Hub cards (the menu, as the legacy tillerpool.php was) ---- */

.hub-utility {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.hub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin: 0.8rem 0;
}

.hub-card {
  border-radius: 10px;
  padding: 1rem 1.1rem;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 1px 3px rgba(20, 30, 50, 0.12);
}

.hub-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-style: italic;
}

.hub-card p { margin: 0.3rem 0; font-size: 0.92rem; }

.hub-card form { margin: 0.5rem 0 0; }

.hub-card select { width: auto; min-width: 8rem; margin: 0 0.4rem; }

.hub-card .button, .hub-card button { margin-top: 0.6rem; }

.hub-cyan { background: var(--card-cyan); }
.hub-cyan h3 { color: var(--card-cyan-title); }
.hub-teal { background: var(--card-teal); }
.hub-amber { background: var(--card-amber); }
.hub-orange { background: var(--card-orange); }
.hub-olive { background: var(--card-olive); }
.hub-mint { background: var(--card-mint); }
.hub-mint h3 { color: var(--card-cyan-title); }
.hub-magenta { background: var(--card-magenta); }
.hub-blue { background: var(--card-blue); color: #fff; }
.hub-blue h3 { color: #fff; }
.hub-red { background: var(--card-red); color: #fff; }
.hub-red h3 { color: #fff; }

.admin-divider {
  background: #ffe93b;
  color: #000;
  text-align: center;
  font-weight: 700;
  font-style: italic;
  font-size: 1.2rem;
  padding: 0.5rem;
  border-radius: 8px;
  margin: 1.6rem 0 0.8rem;
}

.ready-yes { color: #0c7a35; font-weight: 700; }
.ready-no { color: #c21807; font-weight: 700; }

/* ---- The pick/score/spread game grid: 4 per row, colored columns ---- */

.game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
  margin: 0.9rem 0;
}

.game-cell {
  border-radius: 10px;
  padding: 0.7rem 0.6rem;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: 0 1px 3px rgba(20, 30, 50, 0.12);
  font-size: 0.95rem;
}

.game-cell .kickoff { font-size: 0.85rem; }

.game-cell .matchup { margin: 0.3rem 0 0.45rem; }

.game-cell select { width: auto; padding: 0.3rem 0.4rem; font-size: 0.92rem; }

.cell-mustard { background: var(--game-mustard); }
.cell-yellow { background: var(--game-yellow); }
.cell-lime { background: var(--game-lime); }
.cell-aqua { background: var(--game-aqua); }

.early-tag {
  background: var(--title-red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  white-space: nowrap;
}

.tiebreak-band {
  background: var(--tiebreak-magenta);
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  text-align: center;
  padding: 0.9rem;
  margin: 0.9rem 0;
}

.tiebreak-band select { width: auto; margin: 0 0.4rem; }

.submit-bar {
  display: block;
  width: 100%;
  background: var(--title-red);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.8rem;
  margin: 0.9rem 0;
  cursor: pointer;
}

.submit-bar:hover { background: #b82222; }

/* ---- Login frame ---- */

.login-hero {
  background: linear-gradient(180deg, #2450c8, var(--brand-blue));
  color: #fff;
  text-align: center;
  font-size: 2.1rem;
  font-weight: 800;
  padding: 1.4rem 1rem;
  border-radius: 12px 12px 0 0;
}

.login-frame {
  border: 6px solid var(--brand-blue);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  max-width: 52rem;
  margin: 1.5rem auto;
  box-shadow: 0 4px 14px rgba(23, 48, 127, 0.25);
}

.login-halves { display: flex; }

.login-half {
  flex: 1;
  padding: 1.3rem 1.5rem 1.7rem;
  text-align: center;
}

.login-half h2 { margin-top: 0.2rem; }

.login-half + .login-half { border-left: 3px solid var(--brand-blue); }

.login-half input { text-align: left; }

.forgot-row {
  text-align: center;
  margin: 1rem 0;
}

/* ---- Forms, tables, buttons ---- */

form.card, .card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem;
  max-width: 26rem;
}

label { display: block; font-weight: 600; margin: 0.8rem 0 0.25rem; }

input[type="text"], input[type="password"], input[type="email"],
input[type="number"], input[type="datetime-local"], select {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 1rem;
  background: #fff;
}

button, .button {
  margin-top: 0.4rem;
  background: var(--brand-blue);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 0.55rem 1.1rem;
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

button:hover, .button:hover { background: var(--brand-blue-dark); }

.button-quiet { background: #5b6472; }
.button-quiet:hover { background: #444c58; }

table {
  border-collapse: collapse;
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

th, td { padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--line); text-align: left; }

th { background: #e8ecf2; }

tr:nth-child(even) td { background: #f7f9fb; }

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

.flash { padding: 0.7rem 1rem; border-radius: 6px; margin: 1rem 0; }
.flash-success { background: #c9f3d6; color: #0c5227; }
.flash-error { background: #fae0dd; color: #a12318; }

.bottom-strip {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  max-width: 68rem;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}

.bottom-strip .button:last-child { margin-left: auto; }

/* ---- Compare grid result colors (legacy palette) ---- */

td.result-wrong { background: var(--result-wrong) !important; }
td.result-right { background: var(--result-right) !important; }
td.result-bonus { background: var(--result-bonus) !important; }
td.result-unscored { background: var(--result-unscored) !important; }

/* ---- Legacy-styled results tables ---- */

.section-title {
  background: var(--card-orange);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  text-align: center;
  font-style: italic;
  padding: 0.45rem;
}

table.legacy-table {
  border: 3px solid var(--brand-blue);
  border-radius: 8px;
}

table.legacy-table th {
  background: var(--brand-blue);
  color: #fff;
  text-align: center;
}

table.legacy-table td { text-align: center; }

/* ---- Blocking modal ---- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 18, 32, 0.62);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem 1.7rem;
  max-width: 30rem;
  box-shadow: 0 10px 34px rgba(10, 16, 30, 0.45);
  text-align: center;
}

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

.modal-card form { display: flex; gap: 0.7rem; justify-content: center; }

/* ---- Responsive ---- */

@media (max-width: 900px) {
  .game-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .hub-grid { grid-template-columns: 1fr; }
  .game-grid { grid-template-columns: 1fr; }
  .login-halves { flex-direction: column; }
  .login-half + .login-half { border-left: 0; border-top: 3px solid var(--brand-blue); }
}
