@font-face {
  font-family: 'Libre Caslon';
  src: url(fonts/libre-caslon-text-latin-400-normal.woff2) format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Libre Caslon';
  src: url(fonts/libre-caslon-text-latin-700-normal.woff2) format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --fairway: #2f6b3c;
  --forest: #24492f;
  --gold: #f5c542;
  --paper: #fbf8ef;
  --ink: #1d3b26;
  --text: #eef3e9;
  --quiet: #cddccb;
  --red: #c62828;
  --rule: #cfd8c8;
  --serif: 'Libre Caslon', Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--fairway);
}

body {
  margin: 0;
  background: var(--fairway);
  color: var(--text);
  font: 20px/1.55 var(--sans);
  -webkit-text-size-adjust: 100%;
}

a {
  color: inherit;
}

a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 700;
  color: #fff;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* The name over the drive, the drive, then what it is and the way in. */
/* The name centered between two equal sides, Sign in in the right one: they never meet (on the narrowest phones the name gives way a little). */
.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(max-content, 1fr);
  align-items: center;
  gap: 12px;
  padding: 26px 24px 20px;
}

.masthead h1,
.masthead .title {
  grid-column: 2;
  margin: 0;
  white-space: nowrap;
  font-size: clamp(40px, 6vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.film {
  position: relative;
}

.film video {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  background: var(--forest);
}

/* Over the picture, in the game's own panel. */
.again {
  position: absolute;
  right: 24px;
  bottom: 20px;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  background: rgba(12, 28, 18, 0.72);
  color: #fff;
  font: 700 18px/1 var(--sans);
  cursor: pointer;
}

.again:hover {
  background: rgba(12, 28, 18, 0.88);
}

.again:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.again[hidden] {
  display: none;
}

.intro {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 16px 0;
  text-align: center;
}

.intro .pair {
  margin: 0;
  font: 400 clamp(28px, 3.6vw, 44px) / 1.15 var(--serif);
  color: #fff;
}

.intro .line {
  margin: 14px auto 0;
  max-width: 30em;
}

.intro .devices {
  display: block;
}

.actions {
  margin: 28px 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px 28px;
}

.play {
  display: inline-block;
  padding: 16px 30px;
  border-radius: 6px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.play:hover {
  background: #ffd45e;
}

.signin {
  grid-column: 3;
  justify-self: end;
  white-space: nowrap;
  padding: 10px 18px;
  border: 2px solid var(--gold);
  border-radius: 6px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.signin:hover {
  background: var(--gold);
  color: var(--ink);
}

/* A document page's way back to the homepage, in the corner opposite Sign in. */
.home {
  grid-column: 1;
  justify-self: start;
  white-space: nowrap;
  padding: 10px 18px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.home:hover {
  background: rgba(255, 255, 255, 0.24);
}

.masthead:has(.home) {
  grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
}

/* Three reasons people come, on a mown fairway's stripes: the words, and something from the game beside them. */
.fairway {
  margin-top: 64px;
  padding: 8px 0 80px;
  background: repeating-linear-gradient(115deg, #295e34 0 150px, #2c6538 150px 300px);
}

.part {
  max-width: 1120px;
  margin: 0 auto;
  padding: 72px 24px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}

.words h2 {
  margin: 0 0 14px;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.1;
}

.words p {
  margin: 0;
  max-width: 32em;
}

.picture {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}

/* The game's club card, over the course, as it is on screen. */
.screen {
  container-type: inline-size;
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  background: url(pictures/fairway.webp) 50% 70% / cover;
  font: 700 clamp(13px, 4cqw, 22px) / 1.2 var(--sans);
  color: #fff;
}

.club-area {
  position: absolute;
  left: 5%;
  bottom: 7%;
  width: 15.5em;
  display: flex;
  flex-direction: column;
  gap: 0.3em;
}

.types {
  display: flex;
  gap: 0.3em;
}

.types span {
  flex: 1;
  padding: 0.6em 0;
  border-radius: 0.5em;
  background: rgba(12, 28, 18, 0.72);
  text-align: center;
  font-size: 0.85em;
}

.types .on {
  background: var(--gold);
  color: var(--ink);
}

.card {
  padding: 0.5em 0.9em 0.6em;
  border-radius: 0.65em;
  background: rgba(12, 28, 18, 0.72);
}

.picker {
  display: flex;
  align-items: center;
  gap: 0.4em;
  margin-bottom: 0.25em;
}

.picker .club {
  flex: 1;
  text-align: center;
  font-size: 1.3em;
}

.mini {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2em;
  height: 2em;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--gold);
}

.mini svg {
  width: 1.1em;
  height: 1.1em;
  fill: currentColor;
}

.row {
  display: flex;
  justify-content: space-between;
  height: 1.45em;
  align-items: center;
  font-weight: 600;
}

.row span:last-child {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Paper: the tee sheet and the scorecard, lying on the green. */
.sheet,
.paper {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 12px 32px rgba(10, 30, 16, 0.4);
}

.sheet {
  padding: 20px 24px 22px;
  border-radius: 14px;
}

.sheet h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 24px;
}

.sheet table {
  width: 100%;
  border-collapse: collapse;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.sheet td {
  padding: 10px 0;
  border-top: 1px solid var(--rule);
}

.sheet .where {
  color: #4f6655;
}

.sheet .time {
  text-align: right;
  font-weight: 700;
}

.scorecard {
  max-width: 1120px;
  margin: 0 auto;
  padding: 96px 24px 104px;
}

.scorecard .words {
  margin-bottom: 28px;
}

/* Two short sentences over a card as wide as the page: they can run as wide as it, the second on its own line. */
.scorecard .words p {
  max-width: none;
}

.scorecard .then {
  display: block;
}

.paper {
  border-radius: 14px;
  overflow-x: auto;
}

.paper table {
  width: 100%;
  min-width: 40em;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.paper caption {
  padding: 14px 16px 10px;
  text-align: left;
  font: 700 22px/1.2 var(--serif);
}

.paper col.names {
  width: 10em;
}

.paper col.sum {
  width: 3.4em;
}

.paper th,
.paper td {
  border: 1px solid var(--rule);
  padding: 0.4em 0.25em;
  text-align: center;
}

.paper th {
  position: sticky;
  left: 0;
  padding: 0.4em 0.7em;
  background: var(--paper);
  text-align: left;
  font-weight: 700;
  white-space: nowrap;
}

.paper .head th,
.paper .head td {
  background: var(--fairway);
  color: #fff;
  font-weight: 700;
}

.paper .head td.sum {
  background: #255731;
}

.paper .yards {
  font-size: 0.85em;
  color: #4f6655;
}

.paper .par {
  font-weight: 700;
}

.paper td.sum {
  background: #eef0e3;
  font-weight: 800;
}

.paper .to-par {
  display: block;
  font-size: 0.68em;
  font-weight: 700;
  opacity: 0.75;
}

.player th {
  box-shadow: inset 5px 0 0 var(--color);
  padding-left: calc(0.7em + 5px);
}

.player td {
  height: 2.4em;
  font-size: 1.1em;
  font-weight: 800;
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65em;
  height: 1.65em;
}

.mark.birdie {
  border: 1.5px solid var(--red);
  border-radius: 50%;
  color: var(--red);
}

.mark.bogey {
  border: 1.5px solid var(--ink);
  border-radius: 2px;
}

/* A document page (Credits, Terms, Privacy): the name over a sheet of card paper on the green. */
.masthead .title {
  font-family: var(--serif);
  font-weight: 700;
  color: #fff;
}

.masthead .title a {
  color: inherit;
  text-decoration: none;
}

.doc {
  padding: 8px 16px 80px;
}

.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 48px 44px;
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 12px 32px rgba(10, 30, 16, 0.4);
  font-size: 19px;
  line-height: 1.6;
}

.page h1,
.page h2,
.page h3 {
  color: var(--ink);
}

.page .effective {
  margin: -8px 0 24px;
  color: #4f6655;
}

.page h1 {
  margin: 0 0 16px;
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.1;
}

.page h2 {
  margin: 36px 0 8px;
  font-size: 26px;
  line-height: 1.2;
}

.page h3 {
  margin: 22px 0 6px;
  font-size: 20px;
  line-height: 1.25;
}

.page p {
  margin: 0 0 12px;
}

.page ul {
  margin: 0 0 12px;
  padding-left: 1.3em;
}

.page li {
  margin: 6px 0;
}

.page a {
  color: var(--fairway);
}

.page .licence {
  margin: 12px 0 0;
  padding: 16px 20px;
  border-radius: 10px;
  background: #eef0e3;
  font-size: 15px;
  line-height: 1.5;
}

.page .licence p:last-child {
  margin-bottom: 0;
}

.foot {
  background: var(--forest);
  padding: 48px 0 56px;
  font-size: 18px;
}

.foot .name {
  margin: 0 0 14px;
  font: 700 26px/1.2 var(--serif);
  color: #fff;
}

.foot ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
}

.foot .owner {
  margin: 24px 0 0;
  color: var(--quiet);
  font-size: 16px;
}

@media (max-width: 760px) {
  body {
    font-size: 18px;
  }

  .wrap,
  .part,
  .scorecard {
    padding-left: 16px;
    padding-right: 16px;
  }

  .masthead {
    padding: 18px 12px 14px;
  }

  .masthead h1,
  .masthead .title {
    font-size: clamp(24px, 7vw, 40px);
  }

  .doc {
    padding: 0 12px 56px;
  }

  .page {
    padding: 24px 20px 28px;
    font-size: 18px;
  }

  .signin,
  .home {
    padding: 6px 10px;
    font-size: 15px;
  }

  .film video {
    aspect-ratio: 4 / 3;
  }

  .intro {
    padding-top: 28px;
  }

  .part {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 56px;
  }

  .scorecard {
    padding-top: 72px;
    padding-bottom: 72px;
  }
}

/* A phone: Home, the name and Sign in don't fit across, so a document page keeps Home and the name. */
@media (max-width: 520px) {
  .masthead:has(.home) {
    grid-template-columns: minmax(max-content, 1fr) auto minmax(0, 1fr);
  }

  .masthead:has(.home) .signin {
    display: none;
  }
}

/* A screen wider than it is tall: the name and the drive fill it, the drive's top and bottom trimmed if need be. */
@media (min-width: 761px) and (min-height: 501px) and (min-aspect-ratio: 1/1) {
  .film video {
    max-height: calc(100vh - 46px - 1.02 * clamp(40px, 6vw, 84px));
    max-height: calc(100svh - 46px - 1.02 * clamp(40px, 6vw, 84px));
  }
}

/* A phone on its side: the picture shouldn't take the whole screen. */
@media (max-height: 500px) and (min-aspect-ratio: 1/1) {
  .masthead {
    padding: 14px 16px 12px;
  }

  .film video {
    max-height: 75vh;
  }
}
