* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: #101828;
  background: #f3f5f9;
}

main {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 28px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

header p {
  margin: 0 0 6px;
  color: #1746a2;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

h3 {
  margin: 18px 0 0;
}

a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 6px;
  color: white;
  font-weight: 800;
  text-decoration: none;
  background: #e3273f;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  color: white;
  font: inherit;
  font-weight: 800;
  background: #1746a2;
  cursor: pointer;
}

label {
  display: grid;
  gap: 7px;
  color: #475467;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d9dfeb;
  border-radius: 6px;
  padding: 0 12px;
  color: #101828;
  font: inherit;
  background: white;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

article,
.panel {
  border: 1px solid #d9dfeb;
  border-radius: 8px;
  background: white;
}

article {
  padding: 22px;
}

article span {
  display: block;
  font-size: 42px;
  font-weight: 900;
  color: #09245c;
}

article p {
  margin: 4px 0 0;
  color: #667085;
}

.panel {
  margin-top: 18px;
  padding: 20px;
}

.match-tools,
.vote-close-tools,
.match-form,
.result-form {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}

.match-form {
  grid-template-columns: repeat(5, 1fr) auto;
  align-items: end;
}

.vote-close-tools {
  grid-template-columns: 1fr auto;
}

.result-form {
  grid-template-columns: repeat(2, 160px) auto;
}

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

.match-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #e5e9f2;
  border-radius: 8px;
  background: #f8fafc;
}

.match-row strong {
  display: block;
}

.match-row span {
  color: #667085;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 99px;
  color: white;
  font-size: 13px;
  font-weight: 900;
  background: #12b76a;
}

.score-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.score-item {
  display: grid;
  grid-template-columns: 110px 1fr 60px 60px;
  align-items: center;
  gap: 12px;
}

.score-item em {
  color: #1746a2;
  font-style: normal;
  font-weight: 800;
}

.bar {
  height: 12px;
  border-radius: 99px;
  background: #e8edf7;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: #1746a2;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 16px;
}

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

th,
td {
  padding: 12px;
  border-bottom: 1px solid #e5e9f2;
  text-align: left;
}

th {
  color: #667085;
  font-size: 13px;
}

@media (max-width: 720px) {
  main {
    padding: 18px;
  }

  header,
  .stats,
  .match-tools,
  .vote-close-tools,
  .match-form,
  .result-form,
  .match-row {
    grid-template-columns: 1fr;
    display: grid;
  }
}

.admin-help ol {
  margin: 14px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.admin-help li,
.subtle {
  color: var(--ink-soft);
}

.subtle {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 600;
}

.match-form-head {
  grid-column: 1 / -1;
}

.inline-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.admin-message {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.admin-message.error {
  color: #b43a3a;
}

.match-tools {
  grid-template-columns: 1fr auto auto;
}

.vote-close-tools {
  grid-template-columns: 1fr auto;
}

.match-form {
  grid-template-columns: repeat(5, 1fr);
}

.match-row {
  grid-template-columns: 1fr auto;
  gap: 16px;
}

.match-row-main,
.match-row-head,
.match-row-actions {
  display: grid;
  gap: 10px;
}

.match-row-head {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.match-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.match-row-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: var(--pill);
  background: rgba(0, 0, 0, 0.05);
}

.match-row-actions {
  grid-auto-flow: column;
  align-self: center;
}

.score-chip {
  color: var(--accent);
  font-weight: 800;
}

.is-light {
  color: var(--ink);
  background: white;
}

.is-danger {
  background: #b43a3a;
}

#cancelEditButton {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.08);
}
