/* Shared by help.html and ocheplay_help.html (OCP-00529). */
.instructions-header {
  align-items: start;
  padding-bottom: 1rem;
  margin-bottom: 0.8rem;
  border-bottom: 1px solid var(--brand-divider);
}

.help-header-actions {
  display: grid;
  gap: 0.7rem;
  min-width: min(20rem, 100%);
}

.help-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.8rem;
  padding: 0 1rem;
  background: #1b1b1b;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.15;
  text-decoration: none;
  cursor: pointer;
}

.help-close-button:hover,
.help-close-button:focus-visible {
  border-color: var(--brand-lime);
  outline: none;
}

.help-nav-sticky {
  position: sticky;
  top: 0;
  z-index: 6;
  display: grid;
  gap: 0.55rem;
  padding: 0.55rem 0 0.45rem;
  background: var(--brand-black);
}

/* Where the page gradient is drawn once behind the viewport (see help-setup-picker.css), paint the same gradient behind the bar so it blends in instead of showing a black band. */
@supports (inset: 0) {
  .help-nav-sticky {
    background: linear-gradient(140deg, #050505 0%, #2b2b2b 58%, #050505 100%) fixed;
  }
}

.help-search-bar {
  display: grid;
  gap: 0.3rem;
}

.help-search-bar input[type="search"] {
  width: 100%;
  min-height: 2.8rem;
  padding: 0.65rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
}

.help-search-bar input[type="search"]:hover,
.help-search-bar input[type="search"]:focus-visible {
  border-color: var(--brand-lime);
  outline: none;
}

.help-search-status {
  margin: 0;
  min-height: 1.1rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.help-search-hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.help-nav-sticky .section-tabs {
  position: static;
  top: auto;
  background: none;
}

.summary-band.help-summary {
  align-items: start;
}

.help-meta {
  display: grid;
  gap: 0.6rem;
}

.help-meta strong,
.help-note strong,
.help-callout strong {
  color: var(--brand-lime);
}

/* OCP-00721: a heading between blocks inside a section (Scores: "What each game shows"). */
.help-section-subheading {
  margin: 1.4rem 0 0.35rem;
}

.help-section-subheading + p {
  margin: 0 0 0.8rem;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

/* Card: the one child look inside a section container. */
.help-grid > article,
.help-columns > div,
.help-callout,
.help-list-card,
.help-note,
.instruction-section > .instruction-section {
  padding: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.help-grid > article p:last-child,
.help-callout p:last-child,
.help-list-card p:last-child,
.help-note p:last-child,
.help-columns > div p:last-child {
  margin-bottom: 0;
}

.help-list,
.help-steps {
  margin: 0;
  padding-left: 1.3rem;
  display: grid;
  gap: 0.5rem;
}

.help-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.help-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.45rem 0.7rem;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
}

.help-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.help-note {
  border-color: var(--lime-border);
}

.help-divider {
  height: 1px;
  margin: 0.85rem 0;
  background: var(--border);
  border: 0;
}

.game-nav {
  margin-top: 0.8rem;
}

.section-tabs .spaces-tab {
  border-color: var(--lime-border);
  background: var(--brand-olive);
  color: var(--brand-white);
}

.section-tabs .spaces-tab:hover,
.section-tabs .spaces-tab:focus-visible {
  border-color: var(--brand-lime);
}

.game-card-grid {
  display: grid;
  gap: 0.8rem;
}

.help-list-card {
  scroll-margin-top: calc(var(--sticky-tabs-offset, 0px) + 4.75rem);
}

.help-list-card:target {
  border-color: var(--brand-lime);
  box-shadow: 0 0 0 1px rgba(166, 230, 0, 0.2), 0 1.2rem 2.4rem rgba(0, 0, 0, 0.25);
}

.mode-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.8rem;
}

/* Tile: a small block inside a card. */
.mode-meta div,
.mode-subsections article {
  padding: 0.85rem;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.mode-meta span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mode-meta strong {
  color: var(--ink);
  font-size: 1rem;
}

.mode-subsections {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.8rem;
}

.mode-subsections h4 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
  line-height: 1.15;
}

.focused-guide-note {
  display: none;
  margin-top: 0.8rem;
}

body.focused-guide .focused-guide-note {
  display: block;
}

@media (max-width: 760px) {
  .help-grid,
  .help-columns,
  .mode-meta {
    grid-template-columns: 1fr;
  }
}

/* Interface guidelines: each help section is a parent container (#2b2b2b fill, 3px lime border, 8px radius). Top-level only: a section nested inside another keeps its own look. */
.instructions-shell > .summary-band,
.instructions-shell > .instruction-section {
  background: var(--brand-divider);
  border: 3px solid var(--brand-lime);
  border-radius: 8px;
}

/* The Quick summary stacks under the heading at full width. */
.instructions-shell > .summary-band {
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

/* One gap between the children of a section, whichever card type follows which. */
.instruction-section > .help-note,
.instruction-section > .help-grid,
.instruction-section > .help-columns,
.instruction-section > .help-callout,
.instruction-section > .help-list-card,
.instruction-section > .rule-grid,
.instruction-section > .mode-subsections,
.instruction-section > .help-pills,
.instruction-section > .instruction-section {
  margin-top: 0.8rem;
}

body:not(.focused-guide) #guideStatusPanel {
  display: none;
}

/* Inside the in-game guide the app already draws the parent container, so sections drop their own container and are separated by a lime divider instead. */
body.embedded-help .instructions-shell > .summary-band,
body.embedded-help .instructions-shell > .instruction-section {
  background: none;
  border: 0;
  border-bottom: 1px solid var(--lime-border);
  border-radius: 0;
  padding-left: 0;
  padding-right: 0;
}

body.embedded-help .instructions-shell > .instruction-section:last-child {
  border-bottom: 0;
}

/* The game-mode chips sit inside a section, so they take the section's background. */
.game-nav .section-tabs {
  background: none;
}
