/* HouseSerif and HouseDisplay are declared once in type.css (self-hosted, OFL). */

:root {
  color-scheme: dark;
  font-family: var(--font-body);
  font-weight: var(--weight-body);
  color: #eddfc5;
  background: #080a0a;
  --paper: #e8d6b2;
  --ink: #2b1c10;
  --muted-ink: #5e472c;
  --paper-edge: #85653c;
  --wax: #65191b;
  --hairline: #80633e45;
}

* { box-sizing: border-box; }
html { min-width: 280px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100svh; isolation: isolate; line-height: 1.55; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 20%, #080a0a22 5%, #030505b8 95%),
    linear-gradient(#080c0db3, #080a0ae8),
    url("./rooms/gate/plate.jpg") center 35% / cover no-repeat;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  box-shadow: inset 0 0 160px 36px #0009;
}

a { color: inherit; text-underline-offset: 5px; text-decoration-thickness: 1px; }
button, input, summary { font: inherit; font-family: var(--font-control); }
button, input { font-weight: var(--weight-control); letter-spacing: var(--tracking-control); }
button, input { min-height: 46px; border-radius: 3px; }
button {
  padding: 10px 18px;
  border: 1px solid #76592e;
  color: var(--ink);
  background: #d6bd8e55;
  box-shadow: inset 0 0 0 2px #f2dfb83d;
  cursor: pointer;
  letter-spacing: .025em;
  transition: background-color .16s ease, border-color .16s ease;
}
button:hover:not(:disabled) { background: #cbae784d; border-color: #4f361c; }
button:disabled { opacity: .6; cursor: wait; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--wax);
  outline-offset: 5px;
}
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 16px;
  z-index: 10;
  padding: 10px 16px;
  min-height: 44px;
  color: var(--ink);
  background: var(--paper);
  transform: translateY(-180%);
}
.skip-link:focus { transform: none; }

.masthead {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 20px;
  min-height: 90px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid #c6aa7440;
}
.brand {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: .025em;
  font-weight: 400;
  text-decoration: none;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.brand h1 { margin: 0; font: inherit; letter-spacing: inherit; }
.site-identity { min-width: 0; }
.site-subtitle { margin: -3px 0 0; color: #c7bda8; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.page-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.page-nav a, .page-footer a, .text-link {
  font-family: var(--font-control);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  font-size: 15px;
  letter-spacing: .035em;
  text-decoration: none;
}
.masthead a:hover, .page-nav a:hover, .page-footer a:hover, .text-link:hover {
  text-decoration: underline;
}
.masthead a:focus-visible { outline-color: #edcf96; }
.page-nav [aria-current="page"] { text-decoration: underline; }

.parchment {
  color-scheme: light;
  position: relative;
  width: min(980px, calc(100% - 48px));
  margin: 40px auto 48px;
  padding: 44px 48px 24px;
  color: var(--ink);
  background-color: var(--paper);
  background-image: linear-gradient(110deg, #edddbd55, #b7935830), url("./ui/parchment.png");
  background-size: 100% 100%;
  border: 1px solid #947443;
  border-radius: 3px;
  box-shadow: inset 0 0 30px #75522638, 0 5px 0 -2px #a78a5f, 0 18px 70px #000b;
}
.parchment::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid #8a693c55;
  border-radius: 1px;
  pointer-events: none;
}
.wax-seal {
  position: absolute;
  width: 68px;
  height: 68px;
  top: -27px;
  right: 36px;
  transform: rotate(-12deg);
  filter: drop-shadow(0 3px 2px #0005);
  pointer-events: none;
}
.page-heading { margin-bottom: 24px; }
.heading-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: var(--weight-display); }
h1 { margin: 0; font-size: clamp(34px, 3.6vw, 46px); line-height: 1.15; letter-spacing: .01em; }
.document-title { margin: 0; font-size: clamp(34px, 3.6vw, 46px); line-height: 1.15; letter-spacing: .01em; }
h2 { margin: 0 0 12px; font-size: 25px; line-height: 1.25; letter-spacing: .01em; }
h3 { margin: 0 0 8px; font-size: 20px; line-height: 1.3; }
p { margin: 10px 0; overflow-wrap: anywhere; }
.contest-copy { margin-top: 20px; }
.contest-copy #prize { font-size: 18px; max-width: 710px; }
.contest-copy #verification, .contest-copy .recording-note { font-size: 15px; color: var(--muted-ink); }
#close-date { font-size: 14px; color: var(--muted-ink); margin: 12px 0 0; }
.contest-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap; }
.contest-meta .text-link { font-size: 14px; text-decoration: underline; }
.quiet-button { background: transparent; box-shadow: none; flex-shrink: 0; font-size: 15px; }

.standings-table { border-top: 2px solid #6d4e2c88; border-bottom: 1px solid #80633e66; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; text-align: left; font-size: 16px; }
th { font-weight: 400; font-size: 14px; color: var(--muted-ink); padding: 16px 10px; border-bottom: 1px solid #80633e66; }
td { padding: 17px 10px; vertical-align: top; border-bottom: 1px solid #80633e30; }
tbody tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { width: 8%; padding-left: 0; }
th:nth-child(2) { width: 29%; }
th:nth-child(3) { width: 17%; }
th:nth-child(4) { width: 16%; }
th:last-child { width: 30%; }
td:nth-child(2) { overflow-wrap: anywhere; }
td:first-child, td:nth-child(3), td:nth-child(4) { font-variant-numeric: lining-nums tabular-nums; }
td:first-child { font-size: 19px; color: #6b2420; }
td:last-child { color: var(--muted-ink); font-size: 14px; padding-right: 0; }
td[colspan] { width: auto; padding: 30px 0; color: var(--muted-ink); font-size: 16px; text-align: center; }
tbody tr:not(:has(td[colspan])):hover { background: #b28b460a; }
.table-note { font-size: 13px; color: var(--muted-ink); margin: 14px 0 0; }
#leaderboard-state { margin: 14px 0 0; }
#leaderboard-state p { margin: 5px 0; font-size: 15px; }
#leaderboard-state a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; margin: 6px 0 0 16px; }

.claim-section { padding-top: 28px; margin-top: 28px; border-top: 1px solid var(--hairline); }
.claim-section p { max-width: 690px; color: var(--muted-ink); font-size: 15px; }
#claim-form { margin-top: 20px; max-width: 540px; }
#claim-form label { display: block; margin-bottom: 8px; font-size: 15px; }
.claim-fields { display: flex; gap: 10px; align-items: stretch; }
.claim-fields input {
  width: 100%;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid #8b6f45;
  background: #fff5dd80;
  color: var(--ink);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .055em;
}
input::placeholder { color: #80694b; opacity: 1; }
.claim-fields button { flex-shrink: 0; color: #f9e8c6; background: linear-gradient(#60421f, #3e2913); }
.claim-fields button:hover:not(:disabled) { color: #fff6df; background: #3e2913; }
#claim-result { margin: 12px 0 0; min-height: 24px; color: var(--ink); font-size: 15px; overflow-wrap: anywhere; }
.rules-disclosure { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--hairline); }
.rules-disclosure summary { cursor: pointer; min-height: 44px; padding: 10px 0; font-size: 17px; letter-spacing: .025em; }
.rules-disclosure summary:hover { text-decoration: underline; text-underline-offset: 5px; }
#rules p { white-space: pre-line; max-width: 720px; color: var(--muted-ink); font-size: 15px; }

.rules-page { width: min(860px, calc(100% - 48px)); padding-bottom: 24px; }
.rules-page .page-heading { padding-bottom: 22px; border-bottom: 1px solid #80633e66; margin-bottom: 26px; }
.rules-copy { max-width: 680px; font-size: 17px; line-height: 1.65; }
.rules-copy section { margin: 0 0 26px; }
.rules-copy p { margin: 0 0 14px; }
.rules-copy .rule-lines p { margin-bottom: 8px; }
.rules-copy .privacy-note { color: var(--muted-ink); font-size: 15px; }
.page-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  border-top: 1px solid #80633e66;
  margin-top: 28px;
  padding-top: 12px;
}
.page-footer a { min-width: 44px; }
.load-warning { padding: 12px 0; color: #6b281d; font-size: 15px; }
noscript p { padding: 12px 0; color: #6b281d; }

@media (max-width: 700px) {
  .masthead { width: calc(100% - 32px); padding: 16px 0; min-height: 80px; gap: 16px; }
  .brand { font-size: 18px; max-width: 220px; }
  .page-nav { gap: 16px; flex-wrap: nowrap; }
  .page-nav a { font-size: 14px; }
  .parchment, .rules-page { width: calc(100% - 24px); margin-top: 32px; margin-bottom: 28px; padding: 34px 22px 18px; }
  .wax-seal { width: 54px; height: 54px; top: -23px; right: 25px; }
  h1, .document-title { font-size: 34px; }
  h2 { font-size: 23px; }
  .contest-copy #prize { font-size: 17px; }
  .contest-copy #verification, .contest-copy .recording-note { font-size: 14px; }
  .quiet-button { padding: 9px 13px; font-size: 14px; }
  .rules-copy { font-size: 16px; line-height: 1.65; }
  .table-note { font-size: 13px; }
}

@media (max-width: 580px) {
  .standings-table table, .standings-table tbody { display: block; }
  .standings-table thead {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    clip: rect(0, 0, 0, 0); overflow: hidden; white-space: nowrap;
  }
  .standings-table tbody tr {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px 12px;
    padding: 19px 0;
    border-bottom: 1px solid #80633e45;
  }
  .standings-table tbody tr:last-child { border-bottom: 0; }
  .standings-table td { width: auto; min-width: 0; padding: 0; border: 0; font-size: 16px; }
  .standings-table td:not([colspan])::before { display: block; color: var(--muted-ink); font-size: 12px; letter-spacing: .025em; margin-bottom: 1px; }
  .standings-table td:first-child:not([colspan]) { grid-column: 1; grid-row: 1 / 4; font-size: 23px; line-height: 1.4; }
  .standings-table td:first-child:not([colspan])::before { content: "Rank"; }
  .standings-table td:nth-child(2) { grid-column: 2 / 4; grid-row: 1; font-size: 18px; line-height: 1.35; }
  .standings-table td:nth-child(2)::before { content: "Display name"; }
  .standings-table td:nth-child(3) { grid-column: 2; grid-row: 2; }
  .standings-table td:nth-child(3)::before { content: "Time"; }
  .standings-table td:nth-child(4) { grid-column: 3; grid-row: 2; }
  .standings-table td:nth-child(4)::before { content: "Penalties"; }
  .standings-table td:nth-child(5) { grid-column: 2 / 4; grid-row: 3; font-size: 13px; }
  .standings-table td:nth-child(5)::before { content: "Finished (MST)"; display: inline; margin-right: 7px; }
  .standings-table td[colspan] { grid-column: 1 / -1; padding: 8px 0; }
  .claim-fields { display: grid; grid-template-columns: 1fr; }
  .claim-fields button { justify-self: start; }
  #leaderboard-state a { margin-left: 0; margin-right: 16px; }
  #leaderboard-state button { margin-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
