:root {
  color-scheme: light;
  font-family: Georgia, "Times New Roman", serif;
  color: #111;
  background: #e8e8e8;
}

* { box-sizing: border-box; }

body { margin: 0; }

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: min(100% - 2rem, 74rem);
  margin: 1rem auto;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.form-actions a { color: #064f3e; font-weight: 700; }

.form-actions a:focus-visible,
.match-form-table-scroll:focus-visible {
  outline: 3px solid #c56d13;
  outline-offset: 3px;
}

.match-form-shell {
  width: min(100% - 2rem, 74rem);
  margin: 0 auto 2rem;
}

.match-form-paper {
  padding: 1rem;
  border: 1px solid #222;
  background: #fff;
  box-shadow: 0 .3rem 1.25rem rgb(0 0 0 / 18%);
}

.match-form-header {
  display: grid;
  grid-template-columns: minmax(18rem, 1fr) minmax(18rem, 1fr);
  align-items: center;
  gap: .45rem 1rem;
  margin-bottom: .6rem;
}

.match-form-header img { display: block; max-width: 100%; height: auto; }
.tkw-logo { grid-row: 1 / 4; }
.vbv-logo { justify-self: center; }

.match-form-title {
  margin: 0;
  font-size: 1.2rem;
  font-variant: small-caps;
  font-weight: 700;
  line-height: 1.2;
}

.match-form-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.match-form-meta div {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  padding: .35rem;
  border: 2px solid #111;
}

.match-form-meta div + div { border-left: 0; }
.match-form-meta dt, .match-form-meta dd { margin: 0; }
.match-form-meta dd { font-weight: 700; }

.match-form-table-scroll { max-width: 100%; overflow-x: auto; }

.match-form-table {
  width: 100%;
  border: 2px solid #111;
  border-collapse: collapse;
  background: #fff;
  font-size: .8rem;
}

.match-form-table th,
.match-form-table td {
  padding: .25rem .18rem;
  border: 1px solid #111;
  text-align: center;
  white-space: nowrap;
}

.match-form-table .team-headings th { font-size: 1.1rem; }
.match-form-table .player-name { text-align: left; }
.match-form-table .percentage { text-align: right; }
.match-form-table .total-row th,
.match-form-table .total-row td { font-weight: 700; }

@media (max-width: 48rem) {
  .form-actions, .match-form-shell { width: min(100% - 1rem, 74rem); }
  .match-form-header { grid-template-columns: 1fr; }
  .tkw-logo { grid-row: auto; }
  .match-form-header img { max-height: 8rem; margin-inline: auto; }
  .match-form-title { text-align: center; }
  .match-form-meta { grid-template-columns: 1fr; }
  .match-form-meta div + div { border-top: 0; border-left: 2px solid #111; }
}

@page { size: A4 landscape; margin: 10mm; }

@media print {
  :root { background: #fff; }
  .form-actions { display: none; }
  .match-form-shell { width: auto; margin: 0; }
  .match-form-paper { padding: 0; border: 0; box-shadow: none; }
  .match-form-header { grid-template-columns: 48% 52%; gap: 1.5mm 4mm; margin-bottom: 2mm; }
  .tkw-logo { grid-row: 1 / 4; }
  .match-form-title { font-size: 11pt; }
  .match-form-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); font-size: 8pt; }
  .match-form-meta div { padding: 1mm; }
  .match-form-meta div + div { border-top: 2px solid #111; border-left: 0; }
  .match-form-table-scroll { overflow: visible; }
  .match-form-table { min-width: 0; font-size: 7.5pt; }
  .match-form-table th, .match-form-table td { padding: 1.2mm .8mm; }
  .match-form-table .team-headings th { font-size: 10pt; }
}
