/* How to Play panel + hub. Large type for older players. Merge after tfPN9d. Do not deploy from this folder. */
:root {
  --htp-bg: #102026;
  --htp-ink: #f4f1e8;
  --htp-muted: #c9d6d3;
  --htp-line: rgba(127, 224, 214, 0.4);
  --htp-accent: #9af0e6;
  --htp-gold: #f5c542;
  --htp-btn: #1a3338;
}

.htp-panel, .htp-hub {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--htp-ink);
  background: var(--htp-bg);
}

/* tfPN9h3: a closed <dialog> must not paint. display:flex here used to
   override the UA rule dialog:not([open]){display:none}, which on iOS 26
   Safari left the title and X composited over the game after one tap on X.
   No sticky header, no backdrop-filter, no transform — those leave a
   sticky layer on iOS inside a scrolling fixed modal. flex:none on the
   head already keeps the X in view while .htp-body scrolls. */
.htp-panel {
  max-width: 40rem;
  width: min(40rem, 100%);
  max-height: min(90vh, 52rem);
  margin: auto;
  padding: 0 1.25rem 1.5rem;
  border: 1px solid var(--htp-line);
  border-radius: 16px;
  box-sizing: border-box;
  display: none;
  flex-direction: column;
  overflow: hidden;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transform: none;
}
.htp-panel[open] {
  display: flex;
}

.htp-head {
  position: relative;
  top: auto;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: none;
  margin: 0 -0.25rem 0 0;
  padding: 1.15rem 0 0.55rem;
  background: var(--htp-bg);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transform: none;
}

.htp-panel h2, .htp-hub h1 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.25;
  flex: 1 1 auto;
  min-width: 0;
  padding-right: 4px;
}

.htp-head h2 {
  margin: 0;
}

/* tfPN9h2: clear close X, always visible while the body scrolls, 48px hit, one tap. */
.htp-x {
  flex: none;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  margin: -4px -4px 0 0;
  padding: 0;
  border: 1px solid var(--htp-line);
  border-radius: 12px;
  background: var(--htp-btn);
  color: var(--htp-ink);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.htp-x:focus-visible {
  outline: 2px solid var(--htp-gold);
  outline-offset: 2px;
}

.htp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 1rem;
  flex: none;
}

.htp-tabs button {
  min-height: 48px;
  padding: 0 16px;
  font-size: 1.15rem;
  border-radius: 12px;
  border: 1px solid var(--htp-line);
  background: var(--htp-btn);
  color: var(--htp-ink);
  cursor: pointer;
}

.htp-tabs button[aria-selected="true"] {
  background: var(--htp-gold);
  color: #2a1a00;
  border-color: #fff1b5;
  font-weight: 700;
}

.htp-body {
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}

.htp-body h3 {
  margin: 1.2rem 0 0.35rem;
  font-size: 1.3rem;
}

.htp-body p, .htp-body li {
  font-size: 1.2rem;
  line-height: 1.55;
}

.htp-body ol {
  margin: 0;
  padding-left: 1.4rem;
}

.htp-set {
  margin: 0 0 0.9rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--htp-line);
  border-radius: 12px;
}

.htp-set dt {
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.htp-set dd {
  margin: 0;
  color: var(--htp-muted);
}

.htp-soon {
  display: inline-block;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: #3a2a10;
  color: var(--htp-gold);
  font-size: 0.85rem;
  font-weight: 700;
  vertical-align: middle;
}

.htp-tips li { margin: 0 0 0.5rem; }

.htp-close, .htp-tile, .htp-search, .htp-filter {
  min-height: 48px;
  font-size: 1.15rem;
}

.htp-close {
  display: block;
  width: 100%;
  margin-top: 1rem;
  border: 0;
  border-radius: 12px;
  background: var(--htp-gold);
  color: #2a1a00;
  font-weight: 700;
  cursor: pointer;
  flex: none;
}

/* One How to Play control on a Games tile, beside PLAY, not a second PLAY */
.tiles .tile { position: relative; }
.tile .htp-tile {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--htp-line);
  background: #102026;
  color: var(--htp-accent);
  text-decoration: none;
}
.tile .go { margin-right: 7.5rem; } /* keep PLAY and How to Play from overlapping */
@media (max-width: 699px) {
  /* tfPN9h4: How to Play sits in the reserved third row of the card
     (room.css .tile::after), on every phone width through 699px, with
     no orientation:portrait gate. Do not use padding-bottom as the only
     spacer — that used to let a tall description run under the button. */
  .tile .go { margin-right: 0; }
  .tiles li { position: relative; display: block; }
  .tiles li > .htp-tile,
  .tile .htp-tile {
    position: absolute;
    right: 12px;
    bottom: 12px;
    margin: 0;
    z-index: 3;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(154, 240, 230, 0.45);
    background: #102026;
    color: #9af0e6;
    font-weight: 700;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    -webkit-appearance: none;
  }
}

.htp-hub { max-width: 46rem; margin: 0 auto; padding: 24px 16px 64px; }
.htp-search {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--htp-line);
  background: #0c181c;
  color: var(--htp-ink);
}
.htp-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.htp-filter {
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--htp-line);
  background: var(--htp-btn);
  color: var(--htp-ink);
  cursor: pointer;
}
.htp-filter[aria-pressed="true"] { background: var(--htp-gold); color: #2a1a00; }
.htp-list { list-style: none; margin: 0; padding: 0; }
.htp-list a {
  display: block;
  min-height: 48px;
  padding: 12px 14px;
  margin: 0 0 8px;
  border-radius: 12px;
  border: 1px solid var(--htp-line);
  color: var(--htp-accent);
  text-decoration: none;
}
.htp-list a small { display: block; color: var(--htp-muted); font-size: 1.05rem; }
.htp-soon-game small::after { content: " (coming to the Games room)"; }

@media (prefers-reduced-motion: reduce) {
  .htp-panel, .htp-tabs button { transition: none; }
}
