:root {
  --ink: #082b45;
  --ink-soft: #36536a;
  --paper: #f5f7f8;
  --surface: #ffffff;
  --line: #d9e1e5;
  --accent: #ffbd29;
  --accent-strong: #e89d00;
  --success: #12664f;
  --danger: #a93232;
  --danger-pale: #fff0ef;
  --warning: #805b00;
  --radius: 18px;
  --shadow: 0 12px 30px rgba(8, 43, 69, .08);
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% -8%, rgba(255, 189, 41, .3), transparent 24rem),
    linear-gradient(180deg, #eaf1f5 0, var(--paper) 24rem);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: #0b6385; }
a:hover { color: #064761; }
button, input, select { font: inherit; }

button, .button { -webkit-tap-highlight-color: transparent; }

.site-header {
  width: min(100% - 32px, 1040px);
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -.02em;
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--accent);
  font-size: .78rem;
  letter-spacing: 0;
}

.quiet-link, .text-button {
  border: 0;
  padding: 7px 0;
  color: var(--ink-soft);
  background: transparent;
  font-size: .9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.page-shell { width: min(100% - 32px, 820px); margin: 16px auto 48px; }

.hero {
  padding: 32px 25px;
  border-radius: 24px;
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
}

.hero-compact { padding: 25px; }
.hero h1 { max-width: 15ch; margin: 0; font-size: clamp(2rem, 7vw, 3.25rem); letter-spacing: -.055em; line-height: 1.03; }
.hero-compact h1 { max-width: 20ch; font-size: clamp(1.7rem, 5vw, 2.5rem); }
.hero p { max-width: 58ch; margin: 14px 0 0; color: #d8e5ec; }
.hero .eyebrow { color: var(--accent); }
.hero-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.hero-row .text-button { color: #d8e5ec; white-space: nowrap; }

.eyebrow { margin: 0 0 7px; color: #0b6385; font-size: .74rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }

.panel, .admin-section, .status-panel, .payment-panel, .closed-notice, .submit-panel {
  margin-top: 20px;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(8, 43, 69, .04);
}

.narrow { max-width: 470px; margin-right: auto; margin-left: auto; }
.panel h1, .panel h2, .admin-section h2, .payment-panel h2, .closed-notice h2 { margin: 0 0 8px; letter-spacing: -.035em; line-height: 1.15; }
.panel p, .admin-section > p, .payment-panel p, .closed-notice p { color: var(--ink-soft); }

label { display: block; color: var(--ink); font-size: .93rem; font-weight: 700; }
input, select {
  width: 100%;
  min-height: 47px;
  margin-top: 6px;
  border: 1px solid #aebdc6;
  border-radius: 11px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  font-weight: 500;
}

input:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(255, 189, 41, .85);
  outline-offset: 2px;
}

label + label { margin-top: 16px; }
.field-note, .optional { color: var(--ink-soft); font-size: .83rem; font-weight: 500; }
.field-note { margin: 7px 0 0; }

.button {
  display: inline-flex;
  min-height: 47px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 19px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 17px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button-primary { border-color: var(--accent-strong); color: var(--ink); background: var(--accent); }
.button-primary:hover { color: var(--ink); background: #ffcb52; }
.button-secondary { border-color: #b8c7cf; color: var(--ink); background: #fff; }
.button-secondary:hover { color: var(--ink); background: #edf3f5; }
.button-danger { border-color: #d98080; color: #812828; background: #fff5f4; }
.button-payment { border-color: #162f9e; color: #fff; background: #1a3dad; }
.button-payment:hover { color: #fff; background: #12318c; }
.button-wide { width: 100%; }
.button-small { min-height: 39px; margin: 0; padding: 8px 10px; font-size: .82rem; }

.admin-signpost { margin-top: 23px; text-align: center; font-size: .88rem; }

.alert {
  margin-top: 20px;
  border-radius: 14px;
  padding: 14px 17px;
  border: 1px solid;
}
.alert ul { margin: 8px 0 0; padding-left: 21px; }
.alert-success { border-color: #8cc5ae; color: #075039; background: #eaf8f1; }
.alert-error { border-color: #e5a2a0; color: #812828; background: var(--danger-pale); }
.alert-warning { border-color: #e5cd82; color: #6a4b00; background: #fff8df; }

.round-heading { margin: 27px 0 17px; }
.round-heading h2 { margin: 0; font-size: clamp(1.35rem, 5vw, 1.85rem); letter-spacing: -.04em; }
.fixture-list { display: grid; gap: 12px; }

.fixture-card {
  padding: 20px 17px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 6px 16px rgba(8, 43, 69, .035);
  text-align: center;
}
.fixture-team { margin: 0; color: var(--ink); font-size: 1.06rem; font-weight: 800; }
.score-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 11px 0; }
.score-row label { width: 78px; }
.score-input {
  height: 59px;
  min-height: 59px;
  margin: 0;
  padding: 5px;
  border: 2px solid #abc0cb;
  border-radius: 13px;
  text-align: center;
  font-size: 1.65rem;
  font-weight: 800;
  appearance: textfield;
  -moz-appearance: textfield;
}
.score-input::-webkit-inner-spin-button, .score-input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.score-input:focus { border-color: #0b6385; }
.score-input:disabled { opacity: .65; background: #f2f5f6; }
.score-divider { color: #6c8492; font-size: 1.55rem; font-weight: 400; }
.fixture-kickoff { margin: 13px 0 0; color: var(--ink-soft); font-size: .84rem; font-weight: 700; }

.name-panel { margin-bottom: 16px; }
.honeypot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.submit-panel { padding: 20px; text-align: center; }
.submit-panel p { margin: 0; color: var(--ink-soft); font-size: .89rem; }
.closed-notice { border-color: #ddba70; color: #684708; background: #fff7e6; }
.closed-notice p { color: #765510; }

.confirmation-list { display: grid; gap: 0; margin-top: 14px; }
.confirmation-fixture {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 54px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.confirmation-team { min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.confirmation-home { text-align: left; }
.confirmation-away { text-align: right; }
.confirmation-score { color: var(--ink); font-variant-numeric: tabular-nums; text-align: center; white-space: nowrap; }
.submitted-time { margin: 17px 0 0; color: var(--ink-soft); font-size: .88rem; }
.payment-panel { border-color: #b9c5ed; background: linear-gradient(135deg, #f2f5ff, #fff); }
.payment-panel .button { margin-top: 8px; }

.admin-nav { display: flex; gap: 6px; overflow-x: auto; margin: 20px 0 -4px; padding-bottom: 7px; }
.admin-nav a { flex: 0 0 auto; padding: 8px 11px; border-radius: 9px; color: var(--ink); background: #e5edf1; font-size: .88rem; font-weight: 800; text-decoration: none; }
.admin-nav a:hover { background: #d5e3e9; }
.status-panel { background: #eef6f8; }
.status-panel .button { margin-top: 4px; }
.admin-section { scroll-margin-top: 15px; }
.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.section-heading h2 { margin: 0 0 5px; }
.section-heading p { margin: 0; }
.section-heading .button { flex: 0 0 auto; margin: 0; }
.deadline-note { margin: 18px 0; padding: 11px 13px; border-radius: 10px; color: #305365; background: #edf4f6; font-size: .9rem; }

.fixture-toolbar {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin: 18px 0;
  padding: 14px;
  border-radius: 13px;
  background: #eef4f6;
}
.fixture-toolbar p { margin: 0; color: var(--ink-soft); font-size: .9rem; }
.fixture-toolbar .button { width: 100%; margin: 0; }
.weekend-control { margin: 0 0 16px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #f9fbfc; }
.weekend-control legend { padding: 0 5px; color: var(--ink); font-weight: 800; }
.weekend-date-guide { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 14px; }
.weekend-date-guide p { min-width: 0; margin: 0; padding: 8px 5px; border-radius: 8px; color: var(--ink-soft); background: #e9f0f3; font-size: .78rem; font-weight: 700; text-align: center; }
.weekend-date-guide p strong { color: var(--ink); }
.fixture-editor { display: grid; gap: 13px; }
.fixture-edit-card { margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 13px; }
.fixture-edit-card legend { padding: 0 5px; color: var(--ink-soft); font-size: .8rem; font-weight: 800; }
.fixture-edit-card select, .fixture-edit-card input { min-height: 44px; }
.day-time-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.day-time-fields label + label { margin-top: 0; }
.action-row { display: flex; flex-direction: column-reverse; gap: 10px; margin-top: 18px; }
.action-row .button { width: 100%; margin: 0; }

.settings-form { display: grid; gap: 15px; }
.settings-form label + label { margin-top: 0; }
.settings-form .button { margin-top: 2px; }
.team-add-form { display: grid; gap: 13px; padding: 16px; border-radius: 13px; background: #eef4f6; }
.team-add-form label + label { margin-top: 0; }
.team-add-form .button { margin: 0; }
.team-groups { display: grid; gap: 18px; margin-top: 24px; }
.team-group { padding: 16px; border: 1px solid var(--line); border-radius: 13px; }
.team-group h3 { margin: 0 0 12px; font-size: 1rem; }
.team-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 7px; align-items: end; padding: 8px 0; border-top: 1px solid #e8edef; }
.team-row:first-of-type { border-top: 0; }
.team-row input { min-height: 39px; margin: 0; padding: 7px 8px; }

.site-footer { width: min(100% - 32px, 1040px); margin: 0 auto; padding: 0 0 30px; color: #6b8491; font-size: .8rem; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

@media (min-width: 620px) {
  .page-shell { margin-top: 29px; }
  .hero { padding: 38px; }
  .hero-compact { padding: 29px 34px; }
  .fixture-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
  .fixture-card { min-height: 194px; }
  .settings-form { grid-template-columns: 1fr 1fr; }
  .settings-form .button { width: max-content; }
  .team-add-form { grid-template-columns: 1fr 2fr auto; align-items: end; }
  .team-groups { grid-template-columns: 1fr 1fr; align-items: start; }
  .fixture-toolbar { flex-direction: row; align-items: center; justify-content: space-between; }
  .fixture-toolbar p { max-width: 58ch; }
  .fixture-toolbar .button { width: auto; white-space: nowrap; }
  .fixture-edit-card { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .fixture-edit-card > label + label { margin-top: 0; }
  .day-time-fields { grid-column: 1 / -1; }
  .action-row { flex-direction: row; justify-content: flex-end; }
  .action-row .button { width: auto; }
}

@media (min-width: 800px) {
  .page-shell { width: min(100% - 48px, 950px); }
  .fixture-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fixture-card { min-height: 186px; }
  .fixture-editor { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
