/* How to play: long-form article, sheet, in-game help, library hype video.
   Tokens from tokens.css when present; fallbacks keep the sheet readable
   inside the Iron Front client, which does not load the platform shell. */

.htp-page {
  padding-bottom: var(--space-7, 2.25rem);
}

.htp-page > h1 {
  margin-bottom: var(--space-4, 1rem);
}

.htp-article {
  font-family: var(--font-body, "IBM Plex Sans", "Segoe UI", system-ui, sans-serif);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--color-chrome, #d5d2c8);
  max-width: 40rem;
  overflow-x: hidden;
}

.htp-article h2,
.htp-article h3,
.htp-article h4 {
  font-family: var(--font-display, "Space Grotesk", "Segoe UI", system-ui, sans-serif);
  color: var(--color-text, #f3f1ec);
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-wrap: balance;
}

.htp-article h2 {
  font-size: 1.2rem;
  margin: 1.75rem 0 0.7rem;
}

.htp-article h3 {
  font-size: 1.05rem;
  margin: 1.25rem 0 0.45rem;
}

.htp-article h4 {
  font-size: 0.95rem;
  margin: 1rem 0 0.35rem;
}

.htp-article p,
.htp-article ul,
.htp-article ol {
  margin: 0 0 0.85rem;
}

.htp-article ul,
.htp-article ol {
  padding-left: 1.2rem;
}

.htp-article li + li {
  margin-top: 0.28rem;
}

.htp-article strong {
  color: var(--color-text, #f3f1ec);
  font-weight: 600;
}

.htp-summary {
  font-size: 1.12rem;
  line-height: 1.5;
  color: var(--color-text, #f3f1ec);
  margin: 0 0 1.25rem;
}

.htp-video {
  position: relative;
  width: 100%;
  margin: 0 0 1.25rem;
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  background: var(--color-void, #0a0b0e);
  border: 1px solid var(--color-line, #2c3140);
  aspect-ratio: 16 / 9;
}

.htp-video video,
.htp-video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.htp-figure {
  margin: 0 0 1rem;
}

.htp-figure img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: min(70vh, 32rem);
  margin-inline: auto;
  background: none;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--color-line, #2c3140);
}

/* Opt-in cover-crop. Default figures must stay fully visible. */
.htp-figure.htp-cover img {
  width: 100%;
  object-fit: cover;
  object-position: top;
}

/* Tall phone panels: keep a device-like width on desktop instead of filling the column. */
.htp-figure.htp-portrait img {
  max-width: min(22rem, 100%);
}

/* Cropped board examples: size to the 3×3, don't letterbox in a wide max-height box. */
.htp-figure img[src*="rooftop-rise/take-"] {
  max-width: min(20rem, 100%);
  max-height: none;
  background: none;
}

.htp-figure figcaption {
  margin-top: 0.4rem;
  font-size: 0.88rem;
  color: var(--color-muted, #9a9aaa);
  text-align: center;
}

.htp-brief,
.htp-section {
  margin: 0 0 0.35rem;
}

.htp-section.is-hidden,
.htp-brief.is-hidden {
  display: none;
}

.htp-toc {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--color-line, #2c3140);
  border-radius: var(--radius-md, 8px);
  background: var(--color-glass, rgb(18 21 30 / 0.78));
}

.htp-toc-label {
  font-family: var(--font-display, "Space Grotesk", "Segoe UI", system-ui, sans-serif);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-muted, #9a9aaa);
  margin: 0 0 0.5rem;
}

.htp-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 1;
  gap: 0.2rem 1.25rem;
}

.htp-toc a {
  display: inline-block;
  padding: 0.22rem 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--color-accent, #e8a317);
  text-decoration: none;
}

.htp-toc a:hover {
  color: var(--color-text, #f3f1ec);
}

.htp-search {
  margin: 0 0 1rem;
}

.htp-search label {
  display: block;
  font-family: var(--font-display, "Space Grotesk", "Segoe UI", system-ui, sans-serif);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-muted, #9a9aaa);
  margin-bottom: 0.35rem;
}

.htp-search input[type="search"] {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--color-line-strong, #4a5164);
  border-radius: var(--radius-sm, 4px);
  background: var(--color-navy, #14171f);
  color: var(--color-text, #f3f1ec);
  font: inherit;
  font-size: 1rem;
}

.htp-search input[type="search"]:focus {
  outline: 2px solid var(--color-accent, #e8a317);
  outline-offset: 2px;
  border-color: var(--color-accent, #e8a317);
}

.htp-search-status {
  margin: 0.4rem 0 0;
  font-size: 0.88rem;
  color: var(--color-muted, #9a9aaa);
}

.htp-article .htp-roster {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.htp-article .htp-roster li {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--color-line, #2c3140);
  border-radius: var(--radius-sm, 4px);
  background: var(--color-glass, rgb(18 21 30 / 0.78));
  overflow: hidden;
}

.htp-article .htp-roster li + li {
  margin-top: 0;
}

.htp-roster-art {
  flex: none;
  width: 2.7rem;
  height: 2.2rem;
  object-fit: contain;
  object-position: center;
}

.htp-roster-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.htp-roster-name {
  font-family: var(--font-display, "Space Grotesk", "Segoe UI", system-ui, sans-serif);
  font-weight: 700;
  color: var(--color-text, #f3f1ec);
  letter-spacing: 0.02em;
}

.htp-roster-stats {
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--color-muted, #9a9aaa);
  font-variant-numeric: tabular-nums;
}

.htp-roster-role {
  font-size: 0.92rem;
  line-height: 1.4;
}

.htp-table-wrap {
  overflow-x: auto;
  margin: 0 0 1rem;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--color-line, #2c3140);
  border-radius: var(--radius-sm, 4px);
}

.htp-article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  line-height: 1.4;
}

.htp-article th,
.htp-article td {
  padding: 0.45rem 0.55rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--color-line, #2c3140);
}

.htp-article th {
  font-family: var(--font-display, "Space Grotesk", "Segoe UI", system-ui, sans-serif);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-muted, #9a9aaa);
  font-weight: 600;
  white-space: nowrap;
}

.htp-article tbody tr:last-child td {
  border-bottom: 0;
}

.htp-hit {
  background: rgb(232 163 23 / 0.28);
  color: var(--color-text, #f3f1ec);
  border-radius: 2px;
  box-decoration-break: clone;
}

.detail-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: var(--space-4, 1rem);
  max-width: none;
}

.detail-copy .detail-actions .btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  min-height: 0;
  white-space: nowrap;
  padding: 0.48rem 0.85rem;
}

.detail-copy .detail-actions .btn-ghost {
  padding: 0.4rem 0.65rem;
}

.play-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.15rem;
}

.play-title-row .eyebrow {
  margin-bottom: 0;
}

.htp-help {
  flex: none;
  width: 2rem;
  height: 2rem;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-line-strong, #4a5164);
  border-radius: 999px;
  color: var(--color-muted, #9a9aaa);
  text-decoration: none;
  font-family: var(--font-display, "Space Grotesk", "Segoe UI", system-ui, sans-serif);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  background: transparent;
  cursor: pointer;
}

.htp-help:hover,
.htp-help:focus-visible {
  color: var(--color-accent, #e8a317);
  border-color: var(--color-accent, #e8a317);
  text-decoration: none;
}

.detail-hype {
  position: relative;
  width: min(14rem, 58vw);
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  background: var(--color-void, #0a0b0e);
}

.detail-hype-video,
.detail-hype-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-hype-video {
  opacity: 0;
  transition: opacity 180ms ease;
}

.detail-hype.is-playing .detail-hype-video {
  opacity: 1;
}

.detail-hype.is-playing .detail-hype-poster {
  opacity: 0;
}

html.htp-sheet-open,
html.htp-sheet-open body {
  overflow: hidden;
}

.htp-sheet {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--color-chassis, #101218);
  color: var(--color-text, #f3f1ec);
  overflow: hidden;
  display: none;
  flex-direction: column;
  z-index: 10000;
}

.htp-sheet[open] {
  display: flex;
}

.htp-sheet::backdrop {
  background: rgb(5 6 10 / 0.72);
}

.htp-sheet-chrome {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  padding-top: max(0.75rem, env(safe-area-inset-top));
  border-bottom: 1px solid var(--color-line, #2c3140);
  background: var(--color-navy, #14171f);
}

.htp-sheet-title {
  margin: 0;
  font-family: var(--font-display, "Space Grotesk", "Segoe UI", system-ui, sans-serif);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.htp-sheet-close {
  min-height: 44px;
  min-width: 4.5rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--color-line-strong, #4a5164);
  border-radius: 4px;
  background: transparent;
  color: var(--color-text, #f3f1ec);
  font-family: var(--font-display, "Space Grotesk", "Segoe UI", system-ui, sans-serif);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.htp-sheet-close:hover {
  color: var(--color-accent, #e8a317);
}

.htp-sheet-body {
  flex: 1;
  overflow: auto;
  padding: 1.1rem 1.15rem calc(1.5rem + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

.htp-sheet-body .htp-article {
  max-width: none;
}

.fab.htp-help-fab {
  font-family: var(--font-display, "Space Grotesk", "Segoe UI", system-ui, sans-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: inherit;
}

@media (min-width: 768px) {
  .htp-toc ol {
    columns: 2;
  }

  .htp-sheet {
    width: min(44rem, calc(100vw - 2.5rem));
    height: min(90dvh, 58rem);
    margin: auto;
    border: 1px solid var(--color-line, #2c3140);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 24px 64px rgb(0 0 0 / 0.55);
  }

  .htp-sheet-chrome {
    padding-top: 0.75rem;
    border-radius: var(--radius-lg, 12px) var(--radius-lg, 12px) 0 0;
  }

  .detail-hype {
    width: 13rem;
  }

  .htp-toc a {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .detail-hype-video {
    display: none;
  }

  .detail-hype.is-playing .detail-hype-poster {
    opacity: 1;
  }
}
