:root {
  color-scheme: dark;
  --ink: #171b19;
  --panel: #242927;
  --paper: #f4efe4;
  --muted: #b7bcb6;
  --line: rgba(244, 239, 228, .16);
  --red: #c83e47;
  --teal: #2c9297;
  --gold: #d2a43f;
  --green: #657d49;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--ink);
}

body {
  min-height: 100svh;
  margin: 0;
  color: var(--paper);
  background-color: var(--ink);
}

a {
  color: inherit;
}

.portal-header {
  width: min(1180px, calc(100% - 40px));
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand > span:last-child {
  display: grid;
}

.brand strong {
  font-family: Georgia, serif;
  font-size: 1.22rem;
  line-height: 1;
}

.brand small,
.game-count {
  margin-top: 5px;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 850;
}

.flag-mark {
  position: relative;
  width: 34px;
  height: 25px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 2px;
  background: #f6f3eb;
  box-shadow: 0 4px 12px rgba(0,0,0,.28);
}

.flag-mark::before,
.flag-mark::after,
.flag-mark i::before,
.flag-mark i::after {
  content: "";
  position: absolute;
}

.flag-mark::before {
  inset: 0 auto 0 10px;
  width: 8px;
  background: #19558a;
}

.flag-mark::after {
  inset: 8px 0 auto;
  height: 8px;
  background: #19558a;
}

.flag-mark i::before {
  z-index: 1;
  inset: 0 auto 0 12px;
  width: 4px;
  background: var(--red);
}

.flag-mark i::after {
  z-index: 1;
  inset: 10px 0 auto;
  height: 4px;
  background: var(--red);
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 30px;
}

.portal-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.portal-intro p,
.portal-intro h1 {
  margin: 0;
}

.portal-intro p {
  color: var(--gold);
  font-size: .66rem;
  font-weight: 900;
}

.portal-intro h1 {
  font-family: Georgia, serif;
  font-size: 4rem;
  font-weight: 600;
  line-height: .95;
  letter-spacing: 0;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.portal-sponsor {
  min-height: 92px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  margin-top: 22px;
  padding: 18px 4px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.portal-sponsor > span {
  color: var(--gold);
  font-size: .62rem;
  font-weight: 900;
}

.portal-sponsor > div {
  min-width: 0;
}

.portal-sponsor strong {
  font-family: Georgia, serif;
  font-size: 1.08rem;
}

.portal-sponsor p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.4;
}

.portal-sponsor a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
  font-size: .72rem;
  font-weight: 850;
}

.portal-sponsor a b {
  color: var(--gold);
  font-size: 1.1rem;
}

.game-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 40px rgba(0,0,0,.24);
}

.game-card-link {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  text-decoration: none;
}

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

.game-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #102b31;
}

.game-media > img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 420ms ease, filter 420ms ease;
}

.strategy-media > img {
  filter: brightness(.68) saturate(.86);
}

.yarn-media > img {
  filter: brightness(.7) saturate(.82);
}

.golf-media > img {
  filter: brightness(.72) saturate(.88);
}

.game-card-link:hover .game-media > img,
.game-card-link:focus-visible .game-media > img {
  transform: scale(1.025);
  filter: brightness(.82) saturate(1);
}

#faroePreview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.game-number {
  position: absolute;
  z-index: 4;
  top: 14px;
  right: 16px;
  color: rgba(255,255,255,.72);
  font-family: Georgia, serif;
  font-size: 1rem;
  font-weight: 800;
}

.spool-preview {
  position: absolute;
  inset: auto 7% 8%;
  height: 55%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  gap: 6%;
}

.preview-spool {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  padding: 0 8% 15%;
}

.preview-spool::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 50%;
  bottom: 9%;
  width: 8%;
  height: 86%;
  transform: translateX(-50%);
  border-radius: 5px;
  background: #b17c43;
}

.preview-spool::after {
  content: "";
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 5%;
  width: 92%;
  height: 13%;
  transform: translateX(-50%);
  border: 1px solid #4e321d;
  border-radius: 50%;
  background: #89582e;
  box-shadow: inset 0 4px rgba(255,224,169,.2), 0 5px 12px rgba(0,0,0,.35);
}

.yarn {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 18%;
  margin-bottom: -2px;
  border: 2px solid rgba(0,0,0,.35);
  border-radius: 48% / 40%;
  background-image: repeating-linear-gradient(165deg, transparent 0 4px, rgba(255,255,255,.22) 5px 6px, transparent 7px 10px);
  box-shadow: inset 0 3px rgba(255,255,255,.14), 0 3px 5px rgba(0,0,0,.3);
  animation: yarn-breathe 1.8s ease-in-out infinite alternate;
}

.yarn.red { background-color: #ad3742; }
.yarn.cream { background-color: #ded3ba; }
.yarn.teal { background-color: #277985; }
.yarn.gold { background-color: #ca9731; }
.yarn.green { background-color: #55794e; }

.preview-spool:nth-child(2) .yarn { animation-delay: -500ms; }
.preview-spool:nth-child(3) .yarn { animation-delay: -950ms; }

.game-copy {
  position: relative;
  min-height: 212px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto 1fr auto;
  column-gap: 18px;
  padding: 22px 24px 24px;
}

.strategy-card .game-copy {
  border-top: 4px solid var(--teal);
}

.yarn-card .game-copy {
  border-top: 4px solid var(--red);
}

.golf-card .game-copy {
  border-top: 4px solid var(--gold);
}

.golf-preview {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.golf-preview span {
  position: absolute;
  right: 21%;
  bottom: 18%;
  width: 2px;
  height: 36%;
  background: #f4efe4;
  box-shadow: 0 2px 5px rgba(0,0,0,.55);
}

.golf-preview span::after {
  content: "";
  position: absolute;
  top: 0;
  left: 2px;
  width: 24px;
  height: 13px;
  background: var(--red);
  clip-path: polygon(0 0, 100% 48%, 0 100%);
}

.golf-preview i {
  position: absolute;
  right: 20.2%;
  bottom: 16.5%;
  width: 10px;
  height: 4px;
  border-radius: 50%;
  background: rgba(8,16,17,.9);
}

.golf-preview b {
  position: absolute;
  right: 54%;
  bottom: 24%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f5f4e9;
  box-shadow: 0 3px 8px rgba(0,0,0,.65);
  animation: golf-ball 2.8s ease-in-out infinite;
}

@keyframes golf-ball {
  0%, 14% { transform: translate(0, 0); }
  48% { transform: translate(55px, -44px); }
  78%, 100% { transform: translate(92px, -8px); }
}

.game-kind {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: .62rem;
  font-weight: 900;
}

.game-copy h2 {
  grid-column: 1 / -1;
  margin: 7px 0 9px;
  font-family: Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: 0;
}

.game-copy p {
  grid-column: 1 / -1;
  max-width: 43ch;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.5;
}

.play-command {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: .82rem;
  font-weight: 850;
}

.play-command b {
  color: var(--gold);
  font-size: 1.35rem;
  line-height: 1;
  transition: transform 180ms ease;
}

.game-card-link:hover .play-command b,
.game-card-link:focus-visible .play-command b {
  transform: translateX(5px);
}

footer {
  width: min(1180px, calc(100% - 40px));
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .58rem;
  font-weight: 800;
}

@keyframes yarn-breathe {
  from { transform: scaleX(.97); filter: brightness(.92); }
  to { transform: scaleX(1.035); filter: brightness(1.08); }
}

@media (max-width: 720px) {
  .portal-header,
  main,
  footer {
    width: min(100% - 24px, 580px);
  }

  .portal-header {
    min-height: 72px;
  }

  main {
    padding-top: 26px;
  }

  .portal-intro {
    display: block;
    margin-bottom: 18px;
  }

  .portal-intro h1 {
    margin-top: 7px;
    font-size: 2.55rem;
  }

  .game-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .portal-sponsor {
    grid-template-columns: 1fr auto;
    gap: 7px 14px;
    margin-top: 14px;
    padding: 16px 2px;
  }

  .portal-sponsor > span {
    grid-column: 1 / -1;
  }

  .portal-sponsor a {
    grid-column: 2;
    grid-row: 2;
  }

  .game-copy {
    min-height: 186px;
    padding: 18px 18px 20px;
  }

  .game-copy h2 {
    font-size: 1.62rem;
  }

  .game-copy p {
    margin-bottom: 16px;
    font-size: .82rem;
  }

  footer {
    min-height: 58px;
  }
}

@media (min-width: 721px) and (max-width: 980px) {
  .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .golf-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 390px) {
  .brand strong {
    font-size: 1.05rem;
  }

  .game-count {
    font-size: .56rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
