/* ==========================================================
   hum n play — older "room" pages in the new look
   (Stories, Breathing exercises). Load AFTER hnp-ui.css.
   Restyled Oct 2026. Class names are unchanged from the old
   style.css so each page's script keeps working as before.
   ========================================================== */

/* ---------- page header band (Cloud, left-aligned) ---------- */
.room-head { background: var(--band); }
.room-head .wrap { padding-top: 32px; padding-bottom: 32px; }
.room-head .back { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 13px; color: inherit; text-decoration: none; padding: 10px 0; display: inline-block; }
.room-head .back:hover { text-decoration: underline; }
.room-head .eyebrow { margin-top: 14px; }
.room-head h1 { margin: 4px 0 0; font-family: 'Gloock', Georgia, serif; font-weight: 400; font-size: clamp(40px, 6vw, 64px); line-height: 1.05; letter-spacing: -0.01em; text-wrap: balance; }

/* ---------- "I want to…" chips ---------- */
.mood { padding-top: 28px; }
.mood-line { margin: 0 0 12px; font-family: 'Gloock', Georgia, serif; font-size: 24px; line-height: 1.2; }
.mood-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 10px 16px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink);
  font-family: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer;
}
.pill:hover { border-color: var(--ink); }
.pill.on { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); }

/* ---------- section headings ---------- */
.room-section { margin: 0 0 14px; font-family: 'Gloock', Georgia, serif; font-weight: 400; font-size: 28px; line-height: 1.1; }
.room-block { padding-top: 36px; }

/* ---------- tiles ---------- */
.tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tile {
  display: block; position: relative; overflow: hidden;
  color: var(--ink); text-decoration: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  transition: border-color .15s ease, transform .15s ease, opacity .2s ease;
}
a.tile:hover { border-color: var(--ink); transform: translateY(-1px); }
.tile.dim { opacity: 0.32; }
.tile.dim:hover { opacity: 1; }
.tile.hit { outline: 2px solid var(--ink); outline-offset: 3px; }

.tile-img { aspect-ratio: 4 / 3; overflow: hidden; background: var(--band); }
.tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-text { padding: 14px 16px 16px; }
.tile h2 { margin: 0; font-weight: 600; font-size: 16px; line-height: 1.3; }
.tile .tagline { margin: 2px 0 0; font-size: 14px; line-height: 1.35; color: var(--soft); }
.tile-why { margin: 6px 0 0; font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.tile-why:empty { display: none; }
.new-pill {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 11px; font-weight: 500;
  padding: 2px 8px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); color: var(--ink);
}

/* the back: sits on top of the tile, fades in on hover / focus / first tap */
.tile-back {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
  padding: 18px 20px;
  background: var(--ink); color: #fff;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.tile:hover .tile-back, .tile:focus-visible .tile-back, .tile.open .tile-back { opacity: 1; }
.tile-back .tile-count { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 13px; color: #95d8eb; }
.tile-back p { margin: 0; font-size: 14px; line-height: 1.45; color: rgba(255, 255, 255, 0.88); }
.tile-back em { font-style: italic; color: #fff; }
.tile-back .tile-go {
  align-self: flex-start; margin-top: 4px;
  padding: 7px 16px; border-radius: 999px;
  background: #fff; color: var(--ink);
  font-size: 13px; font-weight: 600;
}
@media (hover: none) { .tile.hit .tile-back { opacity: 1; } }

/* ---------- story cover tiles (Stories page) ----------
   Each story sets its own palette with --cv-* on the tile itself. */
.tile-cover { container-type: inline-size; background: var(--cv-bg); border-color: transparent; }
a.tile-cover:hover { border-color: transparent; }
.tile-cover::before { content: ""; display: block; padding-top: 75%; }
.tile-cover .cover { position: absolute; inset: 0; padding: 6cqw; display: flex; flex-direction: column; align-items: flex-start; }
.tile-cover h2 { margin: 0; font-family: 'Gloock', Georgia, serif; font-weight: 400; font-size: 13cqw; line-height: 1.02; letter-spacing: -0.01em; color: var(--cv-ink); }
.cover-art { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; display: block; }
.cover-mark { width: 13cqw; margin-top: 3cqw; display: block; }
.tile-cover .tile-why { margin-top: 3cqw; font-size: 3.6cqw; color: var(--cv-ink); }
.tile-cover.cover-emblem .cover { justify-content: space-between; }
.tile-cover.cover-emblem h2 { font-size: 12cqw; }
.cover-emblem-mark { width: 15cqw; display: block; }

/* ---------- sign-up tile (logged out) / count tile (logged in) ---------- */
.only-out, .only-in { display: none; }
body.auth-out .only-out { display: block; }
body.auth-in  .only-in  { display: block; }
html.pre-auth-in body.auth-out .only-out { display: none; }
html.pre-auth-in body.auth-out .only-in  { display: block; }

.tile-signup, .tile-streak {
  display: none; flex-direction: column; justify-content: center; align-items: flex-start;
  gap: 6px; padding: 22px; min-height: 100%;
  background: var(--band); border-color: var(--band);
}
body.auth-out .tile-signup.only-out { display: flex; }
body.auth-in  .tile-streak.only-in  { display: flex; }
html.pre-auth-in body.auth-out .tile-signup.only-out { display: none; }
html.pre-auth-in body.auth-out .tile-streak.only-in  { display: flex; }

.tile-signup h2 { margin: 0; font-family: 'Gloock', Georgia, serif; font-weight: 400; font-size: 24px; line-height: 1.15; text-wrap: balance; }
.tile-signup-sub { margin: 0; font-size: 14px; color: var(--soft); }
.tile-signup-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; margin-top: 10px; padding: 10px 24px;
  border-radius: 999px; background: var(--btn-bg); color: var(--btn-ink);
  font-weight: 600; font-size: 15px; text-decoration: none;
}
.tile-signup-alt { margin: 6px 0 0; font-size: 14px; color: var(--soft); }
.tile-signup-alt a { color: var(--ink); font-weight: 600; }

.tile-streak .streak-ic { color: #159bc3; }
.tile-streak.has-count .streak-ic { display: none; }
.streak-n { font-family: 'Gloock', Georgia, serif; font-size: 52px; line-height: 1; }
.streak-n:empty { display: none; }
.tile-streak h2 { margin: 0; font-weight: 600; font-size: 16px; }
.streak-sub { margin: 0; font-size: 14px; color: var(--soft); }

/* ---------- surprise me ---------- */
.shuffle-line { margin: 20px 0 0; }
.shuffle-line button {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 10px 20px;
  border-radius: 999px; border: 1.5px solid var(--ink);
  background: transparent; color: var(--ink);
  font-family: inherit; font-weight: 600; font-size: 15px;
  cursor: pointer;
}
.shuffle-line button:hover { background: var(--band); }

/* ---------- collapsed long-form text ---------- */
.room-more { margin-top: 40px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); }
.room-more summary {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 18px 22px; cursor: pointer; list-style: none;
  font-weight: 600; font-size: 16px;
}
.room-more summary::-webkit-details-marker { display: none; }
.room-more summary::after { content: "+"; flex: none; font-size: 22px; line-height: 1; font-weight: 400; }
.room-more[open] summary::after { content: "−"; }
.room-more .prose { padding: 0 22px 22px; max-width: 720px; }
.prose h2 { margin: 28px 0 10px; font-family: 'Gloock', Georgia, serif; font-weight: 400; font-size: 26px; line-height: 1.15; }
.room-more .prose section:first-child h2 { margin-top: 4px; }
.prose p { margin: 0 0 12px; }
.prose a { color: var(--ink); font-weight: 600; }
.faq dl { margin: 0; }
.faq dt { margin: 18px 0 4px; font-weight: 600; }
.faq dd { margin: 0; color: var(--soft); }
.note { margin-top: 28px; padding: 16px 18px; border-radius: 14px; background: var(--band); font-size: 14px; }
.note p { margin: 0 0 8px; }
.note p:last-child { margin-bottom: 0; }

/* ---------- "one of several rooms" line ---------- */
.room-note { margin: 28px 0 0; font-size: 15px; color: var(--soft); }
.room-note a { color: var(--ink); font-weight: 600; }

@media (max-width: 860px) { .tile-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
  .room-head .wrap { padding-top: 18px; padding-bottom: 26px; }
  .room-section { font-size: 24px; }
  .mood .mood-row { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 6px; scrollbar-width: none; }
  .mood .mood-row::-webkit-scrollbar { display: none; }
  .mood .pill { white-space: nowrap; }
}
@media (max-width: 560px) {
  .tile-grid { gap: 10px; }
  .tile { border-radius: 16px; }
  .tile-text { padding: 10px 12px 12px; }
  .tile h2 { font-size: 14px; }
  .tile .tagline { font-size: 12.5px; }
  .tile-cover::before { padding-top: 100%; }
  .tile-cover h2 { font-size: 16cqw; }
  .tile-cover.cover-emblem h2 { font-size: 15cqw; }
  .tile-back { padding: 11px 12px; gap: 5px; justify-content: safe center; overflow-y: auto; }
  .tile-back .tile-count { display: none; }
  .tile-back .tile-go { font-size: 12px; padding: 5px 12px; margin-top: 2px; }
  .tile-signup, .tile-streak { padding: 14px; }
  .tile-signup h2 { font-size: 18px; }
  .tile-signup-btn { min-height: 40px; padding: 8px 18px; font-size: 14px; }
  .tile-signup-alt { font-size: 12.5px; }
  .streak-n { font-size: 40px; }
  .room-more summary { padding: 16px 18px; }
  .room-more .prose { padding: 0 18px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .tile, .tile-back { transition: none; }
}
