:root {
  --felt-0: #2c6854;
  --felt-1: #1c4a3a;
  --felt-2: #14362b;
  --cream: #f7f1e4;
  --cream-deep: #f3ecdf;
  --ivory: #fffdf8;
  --ink: #1c2822;
  --muted: #4a5850;
  --gold: #f0ddb4;
  --line: #e4d8c4;
  --shadow: 0 14px 28px rgba(7, 20, 14, 0.28);
  --serif: ui-serif, Georgia, "Liberation Serif", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --aces: #c4453c;
  --aggravation: #2a7f8c;
  --hand: #8a4b32;
  --golf: #2c7a45;
  --farkle: #c9842a;
}

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

html {
  height: 100%;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  color: var(--cream);
  font-family: var(--sans);
  background-color: var(--felt-2);
  background-image:
    radial-gradient(ellipse at 50% 38%, rgba(255, 236, 204, 0.09), transparent 46%),
    radial-gradient(ellipse at 50% 115%, rgba(0, 0, 0, 0.34), transparent 48%),
    linear-gradient(165deg, var(--felt-0) 0%, var(--felt-1) 40%, var(--felt-2) 100%);
}

.shell {
  width: min(1120px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 22px 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
}

header {
  flex: none;
  text-align: center;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

h1 {
  margin: 6px 0 0;
  font-family: var(--serif);
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.95;
}

.rule {
  width: 84px;
  height: 3px;
  margin: 12px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #e6c98a 15%, #f3e2bc 50%, #e6c98a 85%, transparent);
}

.tagline {
  margin: 10px 0 0;
  font-size: 18px;
  line-height: 1.3;
  color: rgba(247, 241, 228, 0.88);
}

.games {
  list-style: none;
  width: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.games li:nth-child(-n + 3) {
  grid-column: span 2;
}

.games li:nth-child(4) {
  grid-column: 2 / span 2;
}

.games li:nth-child(5) {
  grid-column: 4 / span 2;
}

.games li {
  display: flex;
  min-width: 0;
}

.game {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 248px;
  padding: 22px 18px 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--ivory) 0%, var(--cream-deep) 100%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.game::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 6px;
  background: var(--accent);
}

.game-aces { --accent: var(--aces); }
.game-aggravation { --accent: var(--aggravation); }
.game-hand { --accent: var(--hand); }
.game-golf { --accent: var(--golf); }
.game-farkle { --accent: var(--farkle); }

.icon {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--well);
}

.game-aces .icon { --well: #f8e4e1; }
.game-aggravation .icon { --well: #e3f2f3; }
.game-hand .icon { --well: #f6e7df; }
.game-golf .icon { --well: #e4f2e7; }
.game-farkle .icon { --well: #f8edd9; }

.icon svg {
  width: 74px;
  height: 74px;
}

.copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.name {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.blurb {
  font-size: 16px;
  line-height: 1.25;
  color: var(--muted);
  white-space: nowrap;
}

.game:focus {
  outline: none;
}

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

.game:active {
  transform: scale(0.985);
}

@media (hover: hover) and (pointer: fine) {
  .game:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 34px rgba(7, 20, 14, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }
}

@media (max-width: 860px) {
  .games {
    grid-template-columns: 1fr 1fr;
  }

  .games li,
  .games li:nth-child(-n + 3),
  .games li:nth-child(4),
  .games li:nth-child(5) {
    grid-column: auto;
  }

  .games li:last-child {
    grid-column: 1 / -1;
    width: calc(50% - 8px);
    justify-self: center;
  }

  .blurb {
    white-space: normal;
  }

  .name {
    font-size: 24px;
  }
}

@media (max-width: 680px) {
  .shell {
    justify-content: flex-start;
    padding: 22px 16px 28px;
  }

  h1 {
    font-size: 42px;
  }

  .tagline {
    font-size: 16px;
  }

  .games {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .games li:last-child {
    width: 100%;
    grid-column: auto;
    justify-self: stretch;
  }

  .game {
    flex-direction: row;
    justify-content: flex-start;
    min-height: 112px;
    padding: 14px 16px 14px 18px;
    text-align: left;
    gap: 14px;
    border-radius: 18px;
  }

  .game::before {
    top: 0;
    bottom: 0;
    left: 0;
    width: 7px;
    height: auto;
  }

  .icon {
    width: 72px;
    height: 72px;
    margin: 0;
    flex: none;
  }

  .icon svg {
    width: 60px;
    height: 60px;
  }

  .name {
    font-size: 22px;
  }

  .blurb {
    font-size: 15px;
  }
}

@media (max-height: 800px) and (min-width: 681px) {
  .shell {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  header {
    margin-bottom: 12px;
  }

  h1 {
    font-size: 44px;
  }

  .rule {
    margin-top: 8px;
  }

  .tagline {
    margin-top: 8px;
  }

  .game {
    min-height: 228px;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .icon {
    width: 80px;
    height: 80px;
    margin-bottom: 4px;
  }

  .icon svg {
    width: 66px;
    height: 66px;
  }

  .name {
    font-size: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game {
    transition: none;
  }

  .game:hover,
  .game:active {
    transform: none;
  }
}

::selection {
  background: #e6c98a;
  color: #1a2e24;
}
