:root {
  --bg: #f6f1e8;
  --surface: #fffdf8;
  --ink: #17202a;
  --muted: #64706f;
  --line: #ded5c8;
  --navy: #12315b;
  --gold: #f0b429;
  --green: #5f7f34;
  --red: #c62828;
  --blue: #0f7fb3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    linear-gradient(135deg, rgba(18, 49, 91, 0.09), transparent 34%),
    linear-gradient(315deg, rgba(240, 180, 41, 0.12), transparent 38%),
    var(--bg);
  color: var(--ink);
}

.container {
  width: min(1080px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 36px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0 14px;
}

.eyebrow,
.clock,
.muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.eyebrow {
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 2px 0 0;
  font-size: 2rem;
  line-height: 1.05;
}

h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.lookup-panel,
.section-block {
  background: rgba(255, 253, 248, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(36, 29, 18, 0.08);
}

.section-block {
  margin-top: 16px;
}

.controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

input,
select {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid #c9c0b2;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
}

input:focus,
select:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(15, 127, 179, 0.18);
}

.result {
  margin-top: 14px;
}

.person-card {
  display: grid;
  gap: 10px;
}

.selected-person {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.selected-person strong {
  color: var(--ink);
}

.person-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.person-head > div:empty {
  display: none;
}

.person-head h3 {
  margin: 0;
  font-size: 1.2rem;
}

.team-pill {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}

.sunday-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.sunday-status span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sunday-status strong {
  font-size: 1rem;
}

.sunday-status small {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

.sunday-status-on {
  border-color: rgba(95, 127, 52, 0.35);
  background: rgba(95, 127, 52, 0.1);
}

.sunday-status-off {
  border-color: rgba(198, 123, 0, 0.28);
  background: rgba(240, 180, 41, 0.12);
}

.next-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
}

.next-label {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
}

.next-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.next-date {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.1;
}

.next-hour {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
}

.arrival {
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(240, 180, 41, 0.18);
  color: #ffe7a6;
  font-weight: 700;
}

.next-list {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.compact-title {
  margin: 12px 0 8px;
  font-size: 1rem;
}

.mini-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.mini-row strong {
  display: block;
}

.mini-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.mini-time {
  text-align: right;
  font-weight: 800;
  color: var(--navy);
}

.empty-result {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.match-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.match-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  padding: 9px 10px;
  cursor: pointer;
}

.match-button:focus,
.match-button:hover {
  border-color: var(--blue);
  outline: 3px solid rgba(15, 127, 179, 0.16);
}

.hidden {
  display: none;
}

.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.team-box {
  border-radius: 8px;
  padding: 10px;
  color: #fff;
}

.team-box h3 {
  margin: 0 0 8px;
  font-size: 0.98rem;
}

.team-box ul {
  margin: 0;
  padding-left: 18px;
}

.team-box li {
  margin: 3px 0;
}

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

table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid #e7dfd4;
  padding: 10px;
  text-align: center;
}

th {
  background: var(--navy);
  color: #fff;
  font-size: 0.9rem;
}

tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 560px) {
  .topbar {
    display: block;
  }

  .clock {
    margin-top: 8px;
  }

  .person-head {
    display: flex;
    align-items: start;
  }

  .sunday-status {
    display: grid;
  }

  .sunday-status small {
    text-align: left;
  }

  .team-pill {
    width: fit-content;
  }
}

@media (min-width: 760px) {
  .container {
    padding-top: 24px;
  }

  .lookup-panel,
  .section-block {
    padding: 18px;
  }

  .next-main {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
}
