/* Phone is the baseline. Each site's local stylesheet supplies its composition. */
body[data-design-site] main {
  min-width: 0;
}
.independent-reading-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding-inline: 6px;
  flex: none;
  font-size: 14px;
  white-space: nowrap;
}
body[data-design-page="home"] main > h1:not(.visually-hidden, .sr-only),
body[data-design-page="directory"] main > h1:not(.visually-hidden, .sr-only) {
  font-size: 1.1rem;
  line-height: 1.25;
  margin-block: 4px 10px;
}
body[data-design-site] .reading-home {
  margin-block: 16px;
  padding-block: 12px 0;
}
body[data-design-site] .reading-section-heading {
  gap: 12px;
  margin-bottom: 8px;
}
body[data-design-site] .reading-section-heading h2,
body[data-design-site] .reading-intro h1 {
  font-size: 1.15rem;
  line-height: 1.3;
}
body[data-design-site] .reading-card {
  min-width: 0;
  gap: 10px;
  padding-block: 12px;
}
body[data-design-site] .reading-card :is(h2, h3) {
  font-size: 16px;
  line-height: 1.35;
}
body[data-design-site] .reading-home .reading-summary {
  display: none;
}
body[data-design-site] .reading-art {
  display: block;
  position: relative;
  overflow: hidden;
  flex: none;
  border-radius: 5px;
  width: 88px;
  aspect-ratio: 4/3;
}
body[data-design-site] .reading-art img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
body[data-design-site] .reading-directory {
  margin: 0;
  padding: 0;
}
body[data-design-page="article-index"] .reading-intro {
  margin-block: 0 12px;
}
body[data-design-page="article-index"] .reading-intro > p {
  display: none;
}
body[data-design-page="article"] .reading-intro {
  margin-block: 8px 16px;
}
body[data-design-page="article"] .reading-intro > p:last-child {
  display: none;
}
body[data-design-page="article"] .reading-body > section {
  padding-block: 12px;
}
body[data-design-site] .reading-context {
  margin-bottom: 4px;
}
.complete-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.complete-heading h1 {
  font-size: 1.2rem;
}
.complete-heading > span {
  font-size: 14px;
  color: inherit;
  opacity: 0.75;
}
.complete-categories {
  display: flex;
  flex-wrap: nowrap;
  gap: 14px;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: thin;
}
.complete-categories a {
  display: inline-flex;
  flex: none;
  align-items: center;
  min-height: 44px;
}
.complete-index > section {
  margin-block: 16px 24px;
  scroll-margin-top: 12px;
}
.complete-index h2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 16px;
}
.complete-index h2 small {
  font-weight: 400;
}
.complete-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.complete-card,
.row-completion {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  text-decoration: none;
  border-radius: 5px;
  padding: 0 0 4px;
}
.complete-art,
.row-completion-art {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 5px;
}
.complete-art img,
.row-completion-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.complete-copy,
.row-completion-copy {
  display: block;
  padding: 8px 2px 0;
  min-width: 0;
}
body[data-design-site] [data-row-completion] {
  grid-column: auto !important;
  grid-row: auto !important;
}
.complete-copy strong,
.row-completion-copy strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
  font-size: 16px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.row-completion-copy small {
  display: block;
  font-size: 12px;
  margin-bottom: 3px;
}
.complete-grid > .complete-card:last-child:nth-child(odd) {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}
.complete-card:focus-visible,
.row-completion:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}
.index-rows .complete-grid {
  grid-template-columns: 1fr;
}
.index-rows .complete-card,
.index-rows .complete-grid > .complete-card:last-child:nth-child(odd) {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.index-rows .complete-art {
  aspect-ratio: 16/9;
}
.index-landscape .complete-art {
  aspect-ratio: 16/9;
}
.index-numbered .complete-grid {
  counter-reset: game-index;
}
.index-numbered .complete-copy {
  display: flex;
  gap: 8px;
  counter-increment: game-index;
}
.index-numbered .complete-copy::before {
  content: counter(game-index, decimal-leading-zero);
  font-size: 12px;
  opacity: 0.7;
  padding-top: 3px;
}
.index-contact .complete-art {
  aspect-ratio: 1;
}
[data-independent-opening][hidden] {
  display: none !important;
}
@media (min-width: 768px) {
  .complete-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .index-rows .complete-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .complete-grid > .complete-card:last-child:nth-child(odd) {
    grid-column: span 2;
  }
  .complete-grid > .complete-card:last-child:nth-child(4n + 1) {
    grid-column: 1/-1;
  }
}

/* Game61: native content and controls, with a mobile composition. */
body[data-design-page="home"] .trail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px;
  align-items: start;
  grid-template-areas: none;
}
body[data-design-page="home"] .trail-grid > * {
  min-width: 0;
  grid-area: auto !important;
  grid-column: span 1 !important;
}
body[data-design-page="home"]
  .trail-grid
  :is(a.game-link, a.game-entry, a.game-block, a.game-card-link, a.complete-card) {
  display: block;
}
body[data-design-page="home"]
  .trail-grid
  :is(
    .art,
    .notice-image,
    .entry-image,
    .paired-picture,
    .row-completion-art,
    .image-cell,
    .thumbnail,
    .candidate-picture,
    .choice-photo,
    .signpost-picture,
    .slip-picture,
    .start-preview,
    .catalogue-picture,
    .note-picture,
    .focus-picture,
    .connection-picture
  ) {
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 4/3;
}
body[data-design-page="home"] .trail-grid > :nth-child(5n + 1):not(:nth-last-child(-n + 2)) {
  grid-column: 1/-1 !important;
}
body[data-design-page="home"]
  .trail-grid
  > :nth-child(5n + 1):not(:nth-last-child(-n + 2))
  :is(
    .art,
    .notice-image,
    .entry-image,
    .paired-picture,
    .row-completion-art,
    .image-cell,
    .thumbnail,
    .candidate-picture,
    .choice-photo,
    .signpost-picture,
    .slip-picture,
    .start-preview,
    .catalogue-picture,
    .note-picture,
    .focus-picture,
    .connection-picture
  ) {
  aspect-ratio: 3/1;
}
@media (min-width: 768px) {
  body[data-design-page="home"] .trail-grid {
    column-gap: 20px;
  }
}
body[data-design-page="home"] .trail-grid :is(.entry-image, .paired-picture) {
  width: 100%;
  height: auto;
  min-height: 0;
}
body[data-design-site="Game61"] .reading-directory,
body[data-design-site="Game61"] .reading-home > ol {
  display: block;
}
body[data-design-site="Game61"] .reading-directory .reading-card {
  align-items: flex-start;
}
body[data-design-site="Game61"] .reading-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
}
body[data-design-site="Game61"] .reading-number {
  display: block;
}
body[data-design-site="Game61"] .reading-arrow {
  display: none;
}
body[data-design-site="Game61"] .reading-summary {
  display: none;
}
@media (min-width: 768px) {
  body[data-design-site="Game61"] .reading-directory {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 24px;
  }
}

/* Native category navigation: surface tokens inherit this site's own paper and ink. */
.category-panel {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 0;
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  border-radius: 8px;
}
.category-panel[open] {
  display: flex;
  flex-direction: column;
}
.category-panel .dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  margin: 0;
  gap: 12px;
}
.category-panel .dialog-heading h2 {
  font: inherit;
  font-weight: 600;
  margin: 0;
}
.category-panel .dialog-heading button {
  min-width: 44px;
  min-height: 44px;
  color: var(--ink);
  background: transparent;
  border: 0;
  padding: 8px;
}
.category-panel .category-links {
  display: grid;
  align-content: start;
  gap: 0;
  padding: 8px 14px max(12px, env(safe-area-inset-bottom));
  overflow: auto;
  overscroll-behavior: contain;
  min-height: 0;
}
.category-panel .category-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  min-width: 44px;
  padding: 8px 4px;
  margin: 0;
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  text-transform: capitalize;
  border-bottom: 1px solid var(--line);
}
.category-links a > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.category-panel small {
  font-size: 12px;
  color: var(--ink);
  opacity: 0.7;
}
.category-number {
  font:
    12px ui-monospace,
    monospace;
  opacity: 0.65;
}
.category-panel .category-links a[aria-current="page"] {
  background: color-mix(in srgb, var(--ink) 8%, var(--paper));
  box-shadow: inset 2px 0 var(--ink);
}
.category-links a:hover {
  background: color-mix(in srgb, var(--ink) 5%, var(--paper));
}
.category-links a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}
.category-navigation {
  display: flex;
  overflow-x: auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  margin: 0;
  max-width: 100%;
  scrollbar-width: none;
}
.category-navigation a {
  display: flex;
  align-items: center;
  flex: none;
  min-height: 44px;
  min-width: 44px;
  padding: 0 9px;
  font-size: 16px;
  font-weight: 400;
  text-transform: capitalize;
  color: var(--ink);
  text-decoration: none;
  border: 0;
}
.category-navigation a[aria-current="page"] {
  background: color-mix(in srgb, var(--ink) 8%, var(--paper));
  box-shadow: inset 0 -2px var(--ink);
  font-weight: 400;
}
[id^="ad-banner"][hidden] {
  display: none !important;
}
.reading-home {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  box-sizing: border-box;
}
.detail-toolbar {
  min-height: 44px;
  margin-block: 0;
  padding-block: 0;
}
.detail-toolbar [data-game-title] {
  font-size: 14px;
  font-weight: 500;
}
@media (min-width: 768px) {
  .detail-toolbar [data-game-title] {
    font-size: 15px;
  }
}
.category-panel {
  margin: 12px 12px 12px auto;
  height: calc(100dvh - 24px);
  width: min(340px, calc(100vw - 24px));
  border-radius: 0;
}
.category-panel .category-number {
  border-left: 2px solid var(--line);
  padding-left: 8px;
}

/* Current location uses paint only, so link metrics stay stable. */
.site-header .primary-navigation a[aria-current="page"],
footer a[aria-current="page"] {
  color: var(--ink);
  background: color-mix(in srgb, var(--ink) 8%, var(--paper));
  box-shadow: inset 0 -2px var(--ink);
  text-decoration: none;
  font-weight: inherit;
}
.site-header .wordmark[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}
.site-header .primary-navigation a:focus-visible,
footer a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

/* Reading is part of the existing identity row, and summaries use the fixed article text. */
.site-header .header-row {
  gap: 4px;
}
.site-header .wordmark {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-reading-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0 4px;
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
}
.header-reading-link[aria-current="page"] {
  background: color-mix(in srgb, var(--ink) 8%, var(--paper));
  box-shadow: inset 0 -2px var(--ink);
}
.header-reading-link:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}
body[data-design-site] .reading-home .reading-summary,
body[data-design-site] .reading-directory .reading-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  opacity: 0.8;
}
body[data-design-site] .reading-home {
  margin-block: 16px;
  padding: 8px 0 0;
  max-width: none;
  width: 100%;
}
body[data-design-site] .reading-section-heading {
  margin-bottom: 8px;
}
body[data-design-site] .reading-section-heading h2 {
  font-size: 17px;
}

/* Keep original article summaries in the ad-constrained reading viewport. */
body[data-design-page="article"] .reading-main {
  padding-block: 8px;
}
body[data-design-page="article"] .reading-back {
  margin-block: 0 6px;
}
body[data-design-page="article"] .reading-intro {
  margin-block: 4px 12px;
}
body[data-design-page="article"] .reading-intro .reading-context {
  display: none;
}
body[data-design-page="article"] .reading-intro h1 {
  font-size: 18px;
  line-height: 1.35;
  margin-block: 0 8px;
}
body[data-design-page="article"] .reading-intro > p:last-child {
  display: block;
  font-size: 16px;
  line-height: 1.5;
  margin-block: 4px 8px;
}

.site-header .header-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
}
.site-header .wordmark {
  margin-inline-end: auto;
}

/* Final UI addendum: quiet navigation and complete source summaries. */
.site-header .wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px !important;
  text-decoration: none;
}
.site-header .wordmark[aria-current="page"] {
  text-decoration: none;
  box-shadow: inset 0 -1px var(--ink);
}
footer nav a {
  text-decoration: none;
}
footer nav a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
body[data-design-site] :is(.reading-home, .reading-directory) .reading-summary {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}
@media (min-width: 900px) {
  body[data-design-site="Game61"] [data-home-list] {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
@media (min-width: 900px) {
  body[data-design-site="Game61"] [data-catalogue] [data-batches] {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
  body[data-design-site="Game61"] [data-catalogue] [data-batches] .thumbnail {
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 16/10 !important;
  }
}

@media (max-width: 719px) {
  body[data-design-site="Game61"][data-design-page] [data-catalogue] [data-batches] .thumbnail {
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 8/5 !important;
  }
}

/* Last cards keep the same image/title composition as the current grid. */
@media (min-width: 900px) {
  body[data-design-site="Game61"][data-design-page]
    [data-catalogue]
    [data-batches]
    > .game-card
    .game-entry {
    display: block !important;
  }
  body[data-design-site="Game61"][data-design-page]
    [data-catalogue]
    [data-batches]
    > .game-card
    .thumbnail {
    width: 100% !important;
  }
}
