/* Quiet's game page: the game's picture beside its name, how to play and
   the matches waiting; then its rules beside its variants and its code;
   then the comments. */

/* The page's own column, in place of the frame's padding, so its edge is
   the navbar's at every width. */
.q-main > div:has(.q-game) {
  padding: 0;
}

.q-wrap.q-game {
  padding-top: 24px;
  padding-bottom: 72px;
}

.q-game-top {
  display: grid;
  grid-template-columns: minmax(0, 520px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.q-game-info {
  min-width: 0;
}

/* The picture: a square, until games have one (#914) a quiet placeholder. */
.q-game-cover [data-part="cover"] {
  aspect-ratio: 1;
  border: 1px solid rgb(var(--c-edge-light));
  border-radius: 8px;
}

/* Games / Chess. */
.q-game [data-part="breadcrumb"] {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  color: rgb(var(--c-muted));
}

.q-game [data-part="breadcrumb-sep"],
.q-game [data-part="breadcrumb-current"] {
  display: inline;
}

.q-game [data-part="back-link"] {
  font-size: 14px;
  color: rgb(var(--c-accent));
}

.q-game [data-part="back-link"]:hover {
  color: rgb(var(--c-accent-hover));
}

.q-game [data-part="back-link"] [data-part="link-arrow"] {
  display: none;
}

.q-game [data-part="page-title"] {
  font-size: 44px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: rgb(var(--c-heading));
}

/* The tags, right after the title's row (Quiet hides the line between). */
.q-game [data-part="page-tags"] {
  margin-top: 12px;
}

/* The facts, labeled, instead of the platform's one line. */
.q-game [data-part="page-meta"] {
  display: none;
}

.q-game [data-part="game-facts"] {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin: 16px 0 0;
  font-size: 14px;
}

.q-game [data-part="game-fact"] {
  display: flex;
  gap: 6px;
}

.q-game [data-part="game-fact"] dt {
  color: rgb(var(--c-muted));
}

.q-game [data-part="game-fact"] dd {
  margin: 0;
  font-weight: 500;
  color: rgb(var(--c-heading));
}

.q-game [data-part="page-text"] {
  margin-top: 10px;
  max-width: 680px;
  font-size: 18px;
  color: rgb(var(--c-secondary));
}

/* Play: a card with its title and the two ways to start a match (#874),
   side by side, Play a friend in the accent; each opens the match dialog. */
.q-game-play {
  margin-top: 28px;
  padding: 20px;
  border: 1px solid rgb(var(--c-edge-light));
  border-radius: 8px;
  background: rgb(var(--c-surface));
}

.q-game [data-part="start-title"] {
  display: block;
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 600;
  color: rgb(var(--c-heading));
}

.q-game-play [data-part="start-panel"] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 0;
}

.q-game [data-part="start-choice"] {
  display: flex;
  gap: 12px;
  padding: 16px;
  text-align: left;
  border: 1px solid rgb(var(--c-edge));
  border-radius: 6px;
  background: rgb(var(--c-surface));
}

.q-game [data-part="start-choice"]:hover {
  background: rgb(var(--c-surface-muted));
}

.q-game [data-part="start-choice"] [data-part="icon"] {
  width: 22px;
  height: 22px;
  margin-top: 1px;
  color: rgb(var(--c-primary));
}

/* Play a friend: the main action, in the accent. */
.q-game [data-part="start-choice"][data-visibility="invite"] {
  border-color: rgb(var(--c-accent));
  background: rgb(var(--c-accent));
}

.q-game [data-part="start-choice"][data-visibility="invite"]:hover {
  border-color: rgb(var(--c-accent-hover));
  background: rgb(var(--c-accent-hover));
}

.q-game [data-part="start-choice"][data-visibility="invite"] [data-part="icon"],
.q-game [data-part="start-choice"][data-visibility="invite"] [data-part="start-choice-title"] {
  color: rgb(var(--c-on-accent));
}

.q-game [data-part="start-choice"][data-visibility="invite"] [data-part="start-choice-hint"] {
  color: rgb(var(--c-on-accent) / 0.85);
}

.q-game [data-part="start-choice-title"] {
  font-size: 16px;
  font-weight: 600;
  color: rgb(var(--c-heading));
}

.q-game [data-part="start-choice-hint"] {
  margin-top: 2px;
  font-size: 14px;
  color: rgb(var(--c-muted));
}

.q-game-play [data-part="panel"] {
  margin: 20px 0 0;
  padding: 20px;
  border-color: rgb(var(--c-edge-light));
  border-radius: 8px;
}

/* The rules beside the variants and the code. */
.q-game-body {
  display: grid;
  grid-template-columns: minmax(0, 680px) minmax(0, 340px);
  justify-content: space-between;
  align-items: start;
  gap: 48px;
  margin-top: 56px;
}

.q-game-main,
.q-game-side {
  min-width: 0;
}

.q-game-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.q-game-comments {
  max-width: 680px;
  margin-top: 16px;
}

/* Variants, and Under the hood: cards in the aside. */
.q-game [data-part="variants"],
.q-game [data-part="game-actions"] {
  margin: 0;
  padding: 20px;
  border: 1px solid rgb(var(--c-edge-light));
  border-radius: 8px;
  background: rgb(var(--c-surface));
}

.q-game [data-part="variants"] [data-part="section-title"],
.q-game [data-part="game-actions-title"] {
  display: block;
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 600;
  color: rgb(var(--c-heading));
}

.q-game [data-part="variant-list"] > * + * {
  margin-top: 10px;
}

.q-game [data-part="variant-link"] {
  font-weight: 600;
  color: rgb(var(--c-accent));
}

.q-game [data-part="variant-text"] {
  font-size: 14px;
  color: rgb(var(--c-muted));
}

.q-game [data-part="game-actions-note"] {
  display: block;
  margin: 0 0 16px;
  font-size: 15px;
  color: rgb(var(--c-secondary));
}

.q-game [data-part="game-actions"] [data-part="page-actions"] {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.q-game [data-part="game-actions"] [data-part="button"] + [data-part="button"] {
  border-color: transparent;
  background: transparent;
}

.q-game [data-part="game-actions"] [data-part="button"] + [data-part="button"]:hover {
  background: rgb(var(--c-surface-muted));
}

/* The rules: the game's name is already the page's title. */
.q-game [data-part="about"] {
  margin-bottom: 48px;
  font-size: 16px;
  line-height: 1.5;
  color: rgb(var(--c-primary));
}

.q-game [data-part="about"] > h1:first-child {
  display: none;
}

.q-game [data-part="about"] h2 {
  margin: 32px 0 12px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: rgb(var(--c-heading));
}

.q-game [data-part="about"] h2:first-of-type {
  margin-top: 0;
}

.q-game [data-part="about"] h3 {
  margin: 24px 0 8px;
  font-size: 20px;
  font-weight: 600;
  color: rgb(var(--c-heading));
}

/* The matches waiting for an opponent: the title, then the list in a box. */
.q-game-info > [data-part="section"] {
  margin: 32px 0 0;
  padding: 0;
  background: transparent;
  border: 0;
}

.q-game-info > [data-part="section"] > [data-part="section-title"] {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 600;
  color: rgb(var(--c-heading));
}

.q-game-info [data-part="empty"] {
  margin: 0;
  font-size: 14px;
  color: rgb(var(--c-muted));
}

.q-game-info [data-part="match-list"] {
  margin: 0;
  background: rgb(var(--c-surface));
  border: 1px solid rgb(var(--c-edge-light));
  border-radius: 8px;
  overflow: hidden;
}

.q-game-info [data-part="match-list"] > [data-part="match-row"] + [data-part="match-row"] {
  margin-top: 0;
}

.q-game-info [data-part="match-row"] {
  padding: 12px 16px;
  border: 0;
  border-radius: 0;
}

.q-game-info [data-part="match-row"] + [data-part="match-row"] {
  border-top: 1px solid rgb(var(--c-edge-light));
}

.q-game-info [data-part="match-join"] {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border: 1px solid rgb(var(--c-edge));
  border-radius: 6px;
  background: rgb(var(--c-surface));
  color: rgb(var(--c-primary));
  font-size: 14px;
  font-weight: 600;
}

.q-game-info [data-part="match-join"]:hover {
  background: rgb(var(--c-surface-muted));
}

/* A waiting match: who, their side, since when; then its settings and Join. */
.q-game-info [data-part="match-row"] > div {
  align-items: center;
}

.q-game-info [data-part="match-avatar"] {
  flex: none;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgb(var(--c-accent-bg));
  color: rgb(var(--c-accent-text));
  font-size: 14px;
  font-weight: 600;
}

.q-game-info [data-part="match-name"] {
  display: block;
  margin: 0;
  font-weight: 600;
  color: rgb(var(--c-heading));
}

.q-game-info [data-part="match-side"] {
  display: block;
  margin: 0;
  font-size: 13px;
  color: rgb(var(--c-secondary));
}

.q-game-info [data-part="match-time"] {
  display: block;
  flex: none;
  font-size: 13px;
  color: rgb(var(--c-muted));
}

.q-game-info [data-part="match-players"] {
  display: none;
}

/* Watching a match: its place, until it's built (#139). */
.q-game [data-part="watch-link"] {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  font-size: 14px;
  color: rgb(var(--c-muted));
}

.q-game [data-part="watch-note"] {
  padding: 1px 8px;
  border-radius: 999px;
  background: rgb(var(--c-surface-muted));
  font-size: 12px;
}

@media (max-width: 1023px) {
  .q-game-top {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .q-game-cover {
    max-width: 360px;
  }
}

@media (max-width: 899px) {
  .q-game-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
}

@media (max-width: 639px) {
  .q-game [data-part="page-title"] {
    font-size: 34px;
  }
}

/* The layout's own column: its CSS stands alone, since it can be picked
   under another theme, whose theme.css this page loads instead. */
.q-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 639px) {
  .q-wrap {
    padding: 0 16px;
  }
}
