:root {
  --club: #c8102e;
  --club-2: #9b0d24;
  --gold: #e8d48b;
  --gold-deep: #c4a35a;
  --cream: #faf6eb;
  --paper: #fffdf8;
  --ink: #1a1a1a;
  --muted: #5c5c5c;
  --line: #e4d9c4;
  --error: #8b1e1e;
  --ok: #215c3a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background: var(--cream);
  color: var(--ink);
}

.topbar {
  background: var(--club);
  color: white;
  border-bottom: 4px solid var(--gold);
  padding: 0.85rem 1.5rem 0.95rem;
}

.topbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.topbar-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.crest {
  height: 58px;
  width: auto;
  flex-shrink: 0;
  display: block;
}

.topbar .button,
.topbar button {
  background: white;
  color: var(--club);
}

.topbar p {
  margin: 0.2rem 0 0;
  opacity: 0.9;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
}

h1 {
  font-size: 1.7rem;
}

h2 {
  font-size: 1.25rem;
  color: var(--club);
  margin-bottom: 0.75rem;
}

.grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.1fr);
  gap: 1.25rem;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.1rem 1.2rem 1.25rem;
  box-shadow: 0 1px 0 rgba(200, 16, 46, 0.06);
}

label,
.select-row {
  display: block;
  font-family: "Segoe UI", sans-serif;
}

.select-row {
  margin-bottom: 1rem;
}

select,
input[type="number"],
input[type="text"],
input[type="password"],
input[type="date"],
input[type="file"],
textarea {
  font-size: 1.15rem;
  padding: 0.45rem 0.55rem;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  font-family: "Segoe UI", sans-serif;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.meta {
  color: var(--muted);
  margin: 0 0 1rem;
  font-family: "Segoe UI", sans-serif;
}

.score-row {
  display: grid;
  grid-template-columns: 1fr 7.5rem;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.65rem;
}

.score-row span {
  font-size: 1.15rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

button,
.button {
  font-family: "Segoe UI", sans-serif;
  font-size: 1.05rem;
  border: 0;
  border-radius: 6px;
  padding: 0.65rem 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

button[type="submit"],
.primary {
  background: var(--club);
  color: white;
}

button.secondary,
.secondary {
  background: white;
  color: var(--club);
  border: 1px solid var(--club-2);
}

button.danger {
  background: white;
  color: var(--error);
  border: 1px solid var(--error);
}

.banner {
  margin: 0 0 1rem;
  padding: 0.7rem 0.85rem;
  border-radius: 6px;
  font-family: "Segoe UI", sans-serif;
}

.banner.ok {
  background: #e5f3ea;
  color: var(--ok);
}

.email-done {
  margin: 0 0 0.6rem;
  padding: 0.7rem 0.85rem;
  border-radius: 6px;
  background: #e5f3ea;
  color: var(--ok);
  font-family: "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
}

.banner.error,
.banner.warn {
  background: #f8eaea;
  color: var(--error);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Segoe UI", sans-serif;
}

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

th {
  color: var(--club);
  font-size: 0.9rem;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.scramble-calc td {
  font-variant-numeric: tabular-nums;
  color: var(--club);
  font-weight: 600;
}

.confirm {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 0.8rem 0 0;
  font-family: "Segoe UI", sans-serif;
}

.backup-list {
  margin: 0.6rem 0 1rem;
  padding-left: 1.2rem;
}

.backup-list a {
  word-break: break-all;
}

.standings {
  margin-top: 1.25rem;
}

.table-scroll {
  overflow-x: auto;
}

.admin-narrow {
  max-width: 420px;
}

.admin-form .card {
  margin-bottom: 1.25rem;
}

.repeat-row {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr auto;
  gap: 0.6rem;
  align-items: end;
  margin-bottom: 0.75rem;
}

#rounds .repeat-row {
  grid-template-columns: 1.2fr 0.8fr 1fr 1fr auto;
}

.cards-panel {
  margin-top: 1.25rem;
}

.card > h2:not(:first-child) {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.admin-form {
  margin-bottom: 0;
}

.card-upload {
  margin-bottom: 1rem;
}

.missing {
  color: var(--error);
  font-size: 0.85rem;
  margin-left: 0.35rem;
}

.meta-inline {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.tick {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin: 0;
  font-size: 0.95rem;
}

.tick input {
  width: auto;
}

.clear-scores {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.visually-hidden {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.access-code {
  -webkit-text-security: disc;
  text-security: disc;
}

.repeat-row label {
  margin: 0;
}

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