:root {
  color-scheme: light dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2937;
  background: #ffffff;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  line-height: 1.6;
}

header {
  border-bottom: 1px solid #d1d5db;
}

nav,
main,
footer {
  width: min(100% - 2rem, 64rem);
  margin-inline: auto;
}

nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 4rem;
}

.language-selector {
  position: relative;
  margin-left: auto;
}

.language-selector summary {
  padding: 0.55rem 2rem 0.55rem 0.8rem;
  border: 1px solid #d1d5db;
  border-radius: 0.4rem;
  background: #ffffff;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  list-style: none;
}

.language-selector summary::-webkit-details-marker {
  display: none;
}

.language-selector summary::after {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  border: 0.3rem solid transparent;
  border-top-color: currentColor;
  content: "";
  transform: translateY(-20%);
}

.language-selector[open] summary::after {
  transform: translateY(-70%) rotate(180deg);
}

.language-selector summary:hover {
  background: #f3f4f6;
}

.language-selector summary:focus-visible {
  outline: 3px solid #60a5fa;
  outline-offset: 2px;
}

.language-menu {
  position: absolute;
  z-index: 10;
  top: calc(100% + 0.4rem);
  right: 0;
  display: grid;
  min-width: 10rem;
  padding: 0.35rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: #ffffff;
  box-shadow: 0 0.75rem 1.5rem rgb(15 23 42 / 15%);
}

.language-menu a {
  padding: 0.45rem 0.65rem;
  font-weight: 500;
}

.language-menu a[aria-current="true"]::after {
  float: right;
  margin-left: 1rem;
  content: "\2713";
}

nav a {
  padding: 0.65rem 0.9rem;
  border-radius: 0.4rem;
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

nav a:hover {
  background: #f3f4f6;
}

nav a[aria-current="page"] {
  color: #ffffff;
  background: #2563eb;
}

@media (max-width: 40rem) {
  nav {
    flex-wrap: wrap;
    box-sizing: border-box;
    padding-block: 0.5rem;
  }

  nav a {
    padding-inline: 0.6rem;
  }
}

main {
  flex: 1;
  padding-block: 3rem;
}

h1 {
  margin: 0;
}

h2 {
  line-height: 1.3;
}

a {
  color: #1d4ed8;
}

.hero {
  max-width: 48rem;
}

.tagline {
  margin-block: 0.5rem 1.5rem;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  line-height: 1.35;
}

.play-button {
  display: inline-block;
  margin-block: 1rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  color: #ffffff;
  background: #2563eb;
  font-weight: 700;
  text-decoration: none;
}

.play-button:hover {
  background: #1d4ed8;
}

.play-button:focus-visible,
.store-badges a:focus-visible {
  outline: 3px solid #60a5fa;
  outline-offset: 3px;
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-block: 1rem 2.5rem;
}

.store-badges a {
  display: inline-flex;
  border-radius: 0.5rem;
}

.store-badges img {
  display: block;
  width: auto;
  height: 3.5rem;
}

.app-options {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  text-align: center;
}

.app-option-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.app-option-buttons a {
  display: inline-flex;
  border-radius: 0.5rem;
}

.app-option-buttons img {
  display: block;
  width: auto;
  height: 3.5rem;
}

.app-option-buttons .play-button {
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 3.5rem;
  margin: 0;
}

.how-to-play {
  max-width: 48rem;
  padding-top: 1rem;
  border-top: 1px solid #d1d5db;
}

.plain-english {
  margin-block: 1.5rem 2.5rem;
  padding: 1rem 1.25rem;
  border-left: 0.25rem solid #2563eb;
  background: #eff6ff;
}

.plain-english h2 {
  margin-top: 0;
}

.rules {
  max-width: 48rem;
}

.rules h2 {
  margin-top: 2rem;
}

.rules h3 {
  margin-top: 1.5rem;
}

.rules li + li {
  margin-top: 0.5rem;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  box-sizing: border-box;
  padding-block: 1.5rem;
  border-top: 1px solid #d1d5db;
  font-size: 0.9rem;
}

footer p {
  margin: 0;
}

.privacy-link {
  font-size: 0.8rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    color: #f3f4f6;
    background: #111827;
  }

  header {
    border-color: #374151;
  }

  nav a:hover {
    background: #1f2937;
  }

  nav a[aria-current="page"] {
    background: #3b82f6;
  }

  .language-selector summary,
  .language-menu {
    border-color: #4b5563;
    background: #111827;
  }

  .language-selector summary:hover {
    background: #1f2937;
  }

  a {
    color: #93c5fd;
  }

  .plain-english {
    border-left-color: #60a5fa;
    background: #1e293b;
  }

  .how-to-play,
  footer {
    border-color: #374151;
  }
}
