:root {
  --pine: #12372b;
  --pine-deep: #0b241c;
  --cream: #fbf6ec;
  --field: #fffdf8;
  --ink: #1f2b26;
  --muted: #5d6b64;
  --line: #e2d9c6;
  --berry: #b3282d;
  --berry-deep: #8e1c21;
  --gold: #c8a04a;
  --frost: #d9e4dd;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.55 var(--sans);
  color: var(--ink);
  background:
    radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1.6px) 0 0 / 30px 30px,
    radial-gradient(ellipse at 50% -10%, #1d5240 0%, transparent 60%),
    linear-gradient(var(--pine), var(--pine-deep));
  background-attachment: fixed;
}

.wrap {
  max-width: 34rem;
  margin: 0 auto;
  padding: 2.5rem 1rem 4rem;
}

/* Masthead sits on the dark background */

.masthead {
  text-align: center;
  color: var(--cream);
  margin-bottom: 1.75rem;
}

.mark {
  width: 2.75rem;
  height: 2.75rem;
  color: var(--gold);
}

h1 {
  margin: 0.4rem 0 0.5rem;
  font: 600 clamp(1.9rem, 7vw, 2.6rem) / 1.12 var(--serif);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.lede {
  max-width: 27rem;
  margin: 0 auto;
  color: var(--frost);
  text-wrap: pretty;
}

/* Cards */

.card {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: var(--cream);
  border-top: 3px solid var(--gold);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
}

.card h2 {
  margin: 0 0 0.6rem;
  font: 600 1.45rem/1.2 var(--serif);
}

.card p {
  margin: 0 0 0.9rem;
}

.card > :last-child,
form > :last-child {
  margin-bottom: 0;
}

/* Forms */

label {
  display: block;
  margin-bottom: 1.15rem;
  font-weight: 600;
}

.hint {
  display: block;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
}

input,
textarea {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.7rem 0.8rem;
  font: inherit;
  font-weight: 400;
  color: inherit;
  background: var(--field);
  border: 1px solid #cdc3ad;
  border-radius: 8px;
}

textarea {
  min-height: 9rem;
  resize: vertical;
}

input:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--pine);
  outline-offset: 2px;
}

button {
  font: inherit;
  cursor: pointer;
}

button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.primary,
.secondary {
  padding: 0.8rem 1.1rem;
  font-weight: 600;
  border-radius: 8px;
}

.primary {
  color: #fff;
  background: var(--berry);
  border: 1px solid var(--berry);
}

.primary:hover:not(:disabled) {
  background: var(--berry-deep);
}

form > .primary {
  width: 100%;
  font-size: 1.05rem;
}

.secondary {
  color: var(--pine);
  background: transparent;
  border: 1px solid #b9c4bc;
}

.secondary:hover:not(:disabled) {
  background: #efe8d8;
}

.secondary.danger {
  color: var(--berry-deep);
  border-color: #dcb4b1;
}

.link {
  padding: 0;
  color: var(--berry-deep);
  background: none;
  border: 0;
  text-decoration: underline;
}

.error,
.notice {
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
}

.error {
  color: var(--berry-deep);
  background: #f8e3e0;
}

.notice {
  color: #174534;
  background: #e2efe5;
}

/* Signup confirmation */

.phrase {
  padding: 0.8rem 1rem;
  font: 600 1.15rem/1.4 ui-monospace, 'Cascadia Mono', Consolas, monospace;
  text-align: center;
  overflow-wrap: anywhere;
  background: var(--field);
  border: 1px dashed var(--gold);
  border-radius: 8px;
}

/* Roster and fine print sit on the dark background */

.roster {
  margin: 2rem 0 1.5rem;
  color: var(--frost);
  text-align: center;
}

.roster h2 {
  margin: 0 0 0.75rem;
  font: 600 0.8rem/1 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.roster ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.roster li {
  padding: 0.3rem 0.85rem;
  color: var(--cream);
  border: 1px solid rgba(251, 246, 236, 0.3);
  border-radius: 999px;
  overflow-wrap: anywhere;
}

.roster p {
  margin: 0;
}

.fineprint {
  max-width: 28rem;
  margin: 0 auto;
  font-size: 0.85rem;
  text-align: center;
  color: #a9bcb1;
  text-wrap: pretty;
}

/* Reveal */

.match {
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.card .match-name {
  margin: 0 0 1.25rem;
  padding-bottom: 1.25rem;
  font: 600 clamp(2.2rem, 10vw, 3rem) / 1.1 var(--serif);
  color: var(--berry);
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--line);
}

.match h2 {
  font-size: 1.15rem;
}

.list {
  margin-bottom: 1.25rem;
  padding: 1rem;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.list a {
  color: var(--berry-deep);
}

/* Organizer */

.summary {
  font-weight: 600;
}

table {
  width: 100%;
  margin-bottom: 1rem;
  border-collapse: collapse;
}

th,
td {
  padding: 0.55rem 0.5rem 0.55rem 0;
  text-align: left;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

th {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

td:last-child {
  padding-right: 0;
  text-align: right;
  white-space: nowrap;
}

.rules {
  margin-bottom: 1.25rem;
}

.card .rules h2 {
  margin-bottom: 0.15rem;
  font-size: 1.15rem;
}

.rules ul {
  margin: 0 0 0.9rem;
  padding: 0;
  list-style: none;
}

.rules li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}

.pair-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

select {
  flex: 1 1 7rem;
  min-width: 0;
  padding: 0.65rem 0.7rem;
  font: inherit;
  color: inherit;
  background: var(--field);
  border: 1px solid #cdc3ad;
  border-radius: 8px;
}

select:focus-visible {
  outline: 2px solid var(--pine);
  outline-offset: 2px;
}

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

dialog {
  max-width: min(26rem, calc(100vw - 2rem));
  padding: 1.5rem;
  color: var(--ink);
  background: var(--cream);
  border: 0;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

dialog::backdrop {
  background: rgba(6, 20, 15, 0.6);
}

dialog p {
  margin: 0 0 1.25rem;
}
