:root {
  --card-back-color: #254e70;
}

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

.site-header {
  flex-shrink: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid #ffffff30;
  border-radius: 0;
  background: #052e1f;
  color: #f5fff7;
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  box-sizing: border-box;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 16px;
}

.site-brand {
  padding: 8px 0;
  color: #f5fff7;
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  box-sizing: border-box;
  padding: 8px 12px;
  border: 1px solid #ffffff50;
  border-radius: 8px;
  color: #ffe293;
  text-decoration: none;
  font-weight: 700;
}

.site-nav a:hover, .site-nav a[aria-current="page"] {
  background: #ffffff14;
}

.site-header a:focus-visible, .site-footer a:focus-visible {
  outline: 3px solid #78c8ff;
  outline-offset: 3px;
}

.site-main {
  flex: 1;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 16px 24px;
}

.site-main > .app {
  width: 100%;
  margin: 0;
  padding: 0;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 12px;
  z-index: 1000;
  transform: translateY(-200%);
  padding: 10px 14px;
  border-radius: 6px;
  background: #ffe293;
  color: #173528;
}

.skip-link:focus {
  transform: none;
}

/* Shared rule guide for both the original and the online game pages. */
section.game-rules {
  box-sizing: border-box;
  width: calc(100% - 32px);
  max-width: 1068px;
  margin: 28px auto;
  padding: 24px 28px;
  border: 1px solid #c9dfd0;
  border-radius: 16px;
  background: #f7fff9;
  color: #173528;
  box-shadow: 0 4px 16px #001e151a;
  font: 16px/1.9 system-ui, -apple-system, "Segoe UI", sans-serif;
  text-align: left;
  overflow-wrap: anywhere;
}

main > section.game-rules {
  width: 100%;
}

.game-rules h2 {
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #c9dfd0;
  color: #173528;
  font-size: clamp(21px, 3vw, 26px);
  line-height: 1.5;
}

.game-rules h3 {
  margin: 24px 0 8px;
  color: #173528;
  font-size: 18px;
  line-height: 1.6;
}

.game-rules p {
  margin: 0 0 14px;
}

.game-rules ul, .game-rules ol {
  margin: 10px 0 18px;
  padding-left: 1.6em;
}

.game-rules li + li {
  margin-top: 8px;
}

.game-rules > :last-child {
  margin-bottom: 0;
}

.game-rules a {
  color: #09643e;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.game-rules a:focus-visible {
  outline: 3px solid #207ab0;
  outline-offset: 3px;
}

footer.site-footer {
  box-sizing: border-box;
  clear: both;
  flex-shrink: 0;
  width: 100%;
  margin: 0;
  padding: 20px 16px 32px;
  color: #d6eddf;
  text-align: center;
  font: 13px/1.8 system-ui, -apple-system, "Segoe UI", sans-serif;
}

footer.site-footer a {
  color: inherit;
  text-underline-offset: 3px;
}

/* A quiet solid back keeps the card numbers readable at small sizes. */
.backs .back,
.draw-card,
.card.back,
body[data-game="hearts"] .cpu .backs,
body[data-game="concentration"] #board .card:not(.face):not(.matched) {
  background: var(--card-back-color);
  box-shadow: inset 0 0 0 3px #ffffff26, 0 2px 5px #0003;
}

@media (max-width: 600px) {
  section.game-rules {
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 18px;
    font-size: 15px;
  }
}
