:root {
  --paper: #f5f6ee;
  --paper-2: #fbfbf6;
  --ink: #161513;
  --ink-soft: #3c3934;
  --muted: #5e5952;
  --line: rgba(22, 21, 19, 0.12);
  --red: #c8102e;
  --red-deep: #8e1024;
  --black: #121211;
  --cream: #f7f4ec;
  --serif: "Fraunces", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --sans: "Outfit", "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

h1, h2, p {
  margin: 0;
}

h1, h2 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.skip {
  position: absolute;
  left: 1rem;
  top: 0.75rem;
  z-index: 40;
  padding: 0.55rem 0.8rem;
  background: var(--ink);
  color: var(--cream);
  border-radius: 999px;
  transform: translateY(-160%);
}

.skip:focus {
  transform: none;
}

.wrap {
  width: min(1120px, calc(100% - 2.5rem));
  margin-inline: auto;
}

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

.brand-mark {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  background: transparent;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
}

.brand-name {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.03em;
}

/* Hero: the video's final frame as a full-bleed band (2026-10-10 splash). The image carries the logo and
   "Simulator League"; the h1 stays in the DOM, visually hidden. Focal point sits on the logo. */
.hero {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 60vh;
  background: #0e1a30;
  margin-bottom: 2.5rem; /* room for the Register button that straddles the bottom edge */
}

.hero picture,
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-img {
  object-fit: cover;
  object-position: 50% 45%;
  max-width: none;
}

/* Register straddles the bottom edge of the band: half on the image, half on the paper, clear of the lettering. */
.hero .btn-hero {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1.625rem;
  width: fit-content;
  margin-inline: auto;
  min-width: 12rem;
  min-height: 3.25rem;
  font-size: 1.05rem;
  background: var(--ink);
  color: var(--cream);
  border: 2px solid var(--cream);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.hero .btn-hero:hover {
  background: #000;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.65rem 1.2rem;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 180ms var(--ease), background 180ms var(--ease);
}

.btn:hover {
  background: #000;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-small {
  min-height: 2.5rem;
  padding: 0.4rem 0.95rem;
}

.btn-full {
  width: 100%;
  margin-top: 0.35rem;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

.panel {
  padding: 1rem 0 4rem;
}

.panel h2 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  line-height: 1;
  margin-bottom: 1.25rem;
}

.board {
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: var(--paper-2);
}

.board table {
  width: 100%;
  border-collapse: collapse;
}

.board th,
.board td {
  padding: 0.95rem 1.15rem;
  text-align: left;
  vertical-align: middle;
}

.board th {
  background: var(--black);
  color: var(--cream);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.board td {
  border-top: 1px solid var(--line);
}

.board tbody tr:first-child td {
  border-top: 0;
}

.board .place,
.board .score {
  font-variant-numeric: tabular-nums;
}

.board .place {
  width: 5.5rem;
  font-family: var(--serif);
  font-size: 1.25rem;
}

.board .score,
.board th:last-child,
.board td:last-child {
  text-align: right;
}

.board .player {
  font-weight: 500;
}

.board tr.is-first .player {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
}

.board tr.board-empty td {
  padding: 2.75rem 1.15rem;
  color: var(--muted);
  text-align: left;
}

.board-status {
  margin: 0;
  padding: 2.5rem 1.25rem;
  color: var(--muted);
}

.field {
  margin-bottom: 0.95rem;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.92rem;
  font-weight: 500;
}

.field input {
  width: 100%;
  height: 3.25rem;
  padding: 0 0.95rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-2);
  outline: none;
}

.field input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(22, 21, 19, 0.08);
}

.field input[aria-invalid="true"] {
  border-color: var(--red-deep);
}

.error {
  margin-top: 0.35rem;
  color: var(--red-deep);
  font-size: 0.9rem;
}

.form-note:empty {
  display: none;
}

.form-note {
  margin-top: 0.8rem;
  color: var(--red-deep);
  font-size: 0.92rem;
}

.thanks {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 1.5rem;
}

.thanks-box[hidden],
form[hidden] {
  display: none;
}

/* Drawers: one shared backdrop; each drawer is a section.drawer. Right slide-over on desktop, bottom sheet on phones. */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(18, 18, 17, 0.45);
  opacity: 0;
  transition: opacity 240ms var(--ease);
}

.drawer-backdrop.is-open {
  opacity: 1;
}

.drawer {
  position: fixed;
  z-index: 60;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 48px rgba(18, 18, 17, 0.16);
  transform: translateX(100%);
  transition: transform 280ms var(--ease);
  overscroll-behavior: contain;
}

.drawer.is-open {
  transform: none;
}

.drawer[hidden],
.drawer-backdrop[hidden],
.btn-pill[hidden] {
  display: none;
}

.drawer-grip {
  display: none;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 1.5rem 0.5rem;
}

.drawer-head h2 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  line-height: 1;
}

.drawer-head h2:focus {
  outline: none;
}

.drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background 180ms var(--ease);
}

.drawer-close:hover {
  background: var(--paper-2);
}

.drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.5rem calc(1.75rem + env(safe-area-inset-bottom, 0px));
}

/* Locks the page behind a drawer. The scrollbar width is held as padding so nothing shifts. */
html.drawer-open,
html.drawer-open body {
  overflow: hidden;
}

html.drawer-open body {
  padding-right: var(--sbw, 0px);
}

/* Small fixed Register pill, phones only, shown once the hero button has scrolled out of view. */
.btn-pill {
  display: none;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 1.4rem 0 1.8rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.field input:focus-visible {
  outline: none;
}

@media (max-width: 720px) {
  /* Height follows the width so "Simulator League" is never cropped at the sides (the text is about 56 percent of the frame width). */
  .hero {
    min-height: 0;
    height: min(48vh, 96vw);
    height: min(48svh, 96vw);
  }

  .hero .btn-hero {
    min-width: 11rem;
  }

  .board th:nth-child(3),
  .board td:nth-child(3) {
    display: none;
  }

  .drawer {
    top: auto;
    left: 0;
    width: 100%;
    height: 70vh;
    height: 70dvh;
    min-height: min(26rem, 100dvh);
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -14px 40px rgba(18, 18, 17, 0.18);
    transform: translateY(100%);
  }

  .drawer.is-open {
    transform: none;
  }

  .drawer-grip {
    display: block;
    width: 2.75rem;
    height: 0.3rem;
    margin: 0.65rem auto 0;
    border-radius: 999px;
    background: var(--line);
  }

  .drawer-head {
    padding: 0.9rem 1.25rem 0.25rem;
  }

  .drawer-body {
    padding: 0.75rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  }

  .btn-pill {
    position: fixed;
    z-index: 30;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    display: inline-flex;
    box-shadow: 0 8px 24px rgba(18, 18, 17, 0.22);
  }

  .btn-pill[hidden] {
    display: none;
  }

  /* Room so the pill never covers the footer. */
  .footer {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .btn,
  .drawer,
  .drawer-backdrop,
  .drawer-close {
    transition: none;
  }
}

/* Honeypot: kept off screen (not display:none, which some bots skip). People never see or fill it. */
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* The hero grid (.hero::before, inset -8vw) ran past the viewport and made the page scroll sideways
   (10 px at 375, 22 px at 1280). Clip it at the page edge; the look is unchanged. */
main {
  overflow-x: clip;
}

/* Footer: brand left, "Powered by" eG-iD credit bottom right (2026-10-10) */
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.powered {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  margin-left: auto;
  color: var(--muted, #6b6b66);
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 1rem;
  text-decoration: none;
}
.powered:hover .powered-text,
.powered:focus-visible .powered-text { text-decoration: underline; }
.powered img {
  display: block;
  height: 84px;
  width: auto;
  border-radius: 8px;
}
@media (max-width: 480px) {
  .powered img { height: 64px; }
}

/* Full-bleed footer (Eddie, 2026-10-10): the band and its content run edge to edge with a small gutter, no column. */
.footer {
  width: 100%;
  background: var(--paper, #f5f6ee);
}
.footer .wrap {
  max-width: none;
  width: 100%;
  padding-left: clamp(16px, 4vw, 44px);
  padding-right: clamp(16px, 4vw, 44px);
}
.footer-inner { justify-content: flex-end; }

/* Splash (2026-10-10): full-viewport intro video, added by site.js only when it will play. */
html.splash-on,
html.splash-on body {
  overflow: hidden;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, #0e1a30, #111c05);
  opacity: 1;
  transition: opacity 400ms ease;
  cursor: pointer;
}

.splash.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.splash-video {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: 50% 50%;
}

.splash-skip {
  position: absolute;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  min-width: 44px;
  min-height: 44px;
  padding: 0.5rem 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  background: rgba(8, 12, 18, 0.6);
  color: #fff;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.splash-skip:hover {
  background: rgba(8, 12, 18, 0.85);
}

.splash-skip:focus-visible {
  outline-color: #fff;
}
