/* Shell: pieces every theme shares that arrived after base.css was written
   (the room heading, the album player, the phone layout of the unranked panel,
   the save-error bar). Themes restyle them through the usual tokens. */

#app {
  position: relative;
  z-index: 1;
}

/* ---------- the list's heading at the top of the board ---------- */

.room-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 6px 8px 28px;
}

.room-heading > div {
  min-width: 0;
}

.room-heading > .btn {
  flex: none;
}

.room-heading h1 {
  font: 650 clamp(26px, 3vw, 42px) / 1.15 var(--font-display);
  letter-spacing: -0.025em;
  color: var(--ink);
  text-wrap: balance;
}

.room-heading p {
  margin-top: 10px;
  font: 500 13px/1.4 var(--font-ui);
  color: var(--ink-3);
}

/* ---------- the library's search row ---------- */

.lib-find {
  margin-bottom: 28px;
}

.lib-find .lib-search {
  width: min(100%, 540px);
  max-width: none;
  margin-left: 0;
}

@media (hover: none) {
  .list-card > .btn {
    opacity: 1;
  }
}

/* ---------- quick rank is a full-window dialog ---------- */

dialog.deck {
  width: 100%;
  height: 100%;
  /* a phone's address bar comes and goes: the dialog is as tall as what is seen */
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--ink);
}

dialog.deck::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

/* genre chips wrap instead of scrolling sideways */
.tag-row {
  flex-wrap: wrap;
  /* no bleed into the side padding: that was room for the scroll, and it sticks out of a narrow cart */
  margin-inline: 0;
  padding-inline: 0;
  overflow: visible;
  mask-image: none;
}

.tag-more {
  background: transparent;
}

.pool-filter-toggle {
  display: none;
}

/* ---------- album previews ---------- */

/* the play button of a cover: it appears under the pointer, on the selected
   album and on the one that is playing */
.item > .play,
.wiki-play {
  position: absolute;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(12 13 18 / 0.72);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.22), 0 6px 14px -4px rgb(0 0 0 / 0.6);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  backdrop-filter: blur(10px) saturate(1.4);
  cursor: pointer;
  transition: opacity 0.16s, transform 0.2s var(--ease), background-color 0.16s, color 0.16s;
}

/* measured from the top: a caption may sit under the cover */
.item > .play {
  right: 6px;
  top: calc(var(--th) * var(--k, 1) - 40px);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.86);
}

.item:is(:hover, :focus-visible, .is-playing) > .play,
.item > .play:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

/* a touch screen has no hover: there the selected album shows its button */
@media (hover: none) {
  .item.is-selected > .play {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
}

.item > .play .i,
.wiki-play .i {
  width: 16px;
  height: 16px;
}

.item > .play:hover,
.wiki-play:hover,
.item.is-playing > .play,
.wiki-play.is-playing {
  background: #fff;
  color: #0b0c12;
}

.item > .play:active,
.wiki-play:active {
  transform: scale(0.92);
}

.item > .play:focus-visible,
.wiki-play:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* waiting for the catalogue: the button breathes */
.item.is-loading > .play {
  animation: play-wait 0.9s ease-in-out infinite alternate;
}

@keyframes play-wait {
  to {
    opacity: 0.45;
  }
}

body.is-dragging .item > .play {
  opacity: 0;
  pointer-events: none;
}

/* Add items: the card and its play button share one cell */
.wiki-cell {
  position: relative;
  display: grid;
}

.wiki-play {
  left: 8px;
  top: 8px;
}

/* what is playing: a small strip at the foot of the page, or of the open dialog */
.now-playing {
  position: fixed;
  z-index: 1500;
  left: 22px;
  bottom: 22px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 4px 10px;
  width: min(420px, calc(100vw - 32px));
  padding: 8px 14px 11px 8px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--menu-bg, var(--bg-2));
  color: var(--ink);
  box-shadow: var(--shadow-2);
  font: 13px/1.3 var(--font-ui);
  animation: now-playing-in 0.28s var(--ease);
}

@keyframes now-playing-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.np-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.15s;
}

.np-btn[hidden],
.np-store[hidden] {
  display: none;
}

.np-btn .i {
  width: 18px;
  height: 18px;
}

.np-btn:hover {
  background: color-mix(in srgb, transparent, var(--ink) 12%);
}

.np-btn:active {
  transform: scale(0.94);
}

.np-stop {
  background: var(--ink);
  color: var(--bg);
}

.np-stop:hover {
  background: color-mix(in srgb, var(--ink), var(--bg) 14%);
}

.np-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.np-track,
.np-status {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.np-track {
  font-weight: 650;
  font-size: 14px;
}

.np-status {
  color: var(--ink-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* the store badge: the size and clear space its guidelines ask for */
.np-store {
  display: flex;
  flex: none;
  border-radius: 6px;
  opacity: 0.86;
  transition: opacity 0.15s;
}

.np-store:hover {
  opacity: 1;
}

.np-store img {
  display: block;
  width: auto;
  height: 28px;
  object-fit: contain;
}

.np-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: color-mix(in srgb, transparent, var(--ink) 10%);
}

.np-bar > span {
  display: block;
  height: 100%;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.12s linear;
}

/* messages appear in the same corner: while something plays, or while the
   selection bar is up, they sit above it */
body.has-selbar #toasts,
body:has(> .now-playing) #toasts {
  bottom: 96px;
}

/* inside a dialog the strip is one of its rows */
.dialog > .now-playing {
  position: relative;
  left: auto;
  bottom: auto;
  flex: none;
  width: auto;
  margin: 0 16px;
  box-shadow: none;
  background: color-mix(in srgb, transparent, var(--ink) 6%);
}

@media (prefers-reduced-motion: reduce) {
  .now-playing,
  .item.is-loading > .play {
    animation: none;
  }
}

/* ---------- one gentle settle when the library appears ---------- */

@media (prefers-reduced-motion: no-preference) {
  .lib-section {
    animation: collection-settle 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes collection-settle {
    from {
      filter: blur(3px);
      transform: translateY(7px);
    }
  }
}

/* ---------- narrow windows ---------- */

@media (max-width: 820px) {
  .ed-main {
    grid-template-rows: minmax(0, 1fr) min(48dvh, 420px);
  }

  .selbar {
    bottom: calc(min(48dvh, 420px) + 12px);
  }

  :root[data-theme] .cart-head {
    padding: 8px 12px;
    gap: 8px;
  }

  :root[data-theme] .cart-title {
    align-items: center;
    gap: 8px;
  }

  :root[data-theme] .cart-title h2 {
    font-size: 18px;
  }

  :root[data-theme] .pool-count {
    font-size: 11px;
    margin-left: auto;
    white-space: nowrap;
  }

  /* filters fold away behind one button, so a whole row of covers stays in view */
  :root[data-theme] .pool-filter-toggle {
    display: inline-flex;
    min-height: 36px;
    height: 36px;
    padding: 6px 8px;
    font-size: 12px;
  }

  :root[data-theme] .cart-head .search {
    height: 42px;
  }

  :root[data-theme] .cart:not(.filters-open) :is(.cart-tools, .tag-row) {
    display: none;
  }

  :root[data-theme] .cart.filters-open .cart-head {
    max-height: 200px;
    overflow: auto;
  }

  :root[data-theme] .cart-foot {
    padding: 8px 12px;
    gap: 4px;
  }

  :root[data-theme] .cart-hint {
    display: none;
  }

  :root[data-theme] .cart-foot > .btn {
    min-height: 46px;
  }

  :root[data-theme] .pool {
    padding-top: 12px;
  }

  /* a failed save stays on screen with its Retry button */
  .save-status[data-state='error'] {
    display: block;
    position: absolute;
    top: var(--topbar-h);
    left: 14px;
    z-index: 90;
  }

  .save-status[data-state='error'] button {
    min-height: 44px;
    padding: 8px 14px;
    color: var(--ink);
    background: var(--bg-2);
  }

  .editor[data-save-error='true'] .ed-main {
    margin-top: 44px;
  }
}

@media (max-width: 760px) {
  .lib-find .lib-search {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .room-heading {
    align-items: flex-start;
    gap: 8px;
  }

  .room-heading > .btn {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 12px;
  }

  .now-playing {
    left: 16px;
    bottom: 16px;
  }
}

/* the "/" hint in a search field is for a keyboard */
@media (hover: none), (max-width: 560px) {
  .search-kbd,
  .lib-find kbd {
    display: none;
  }
}

/* ---------- the board's second view: Insights ---------- */

.room-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

/* in Insights the board has the whole window: no unranked panel, no tiers */
.ed-main:is([data-view='insights'], [data-view='overview']) {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

/* ---------- a touch screen: one thing at a time ---------- */

.touch-tabs {
  display: flex;
  flex: none;
  gap: 6px;
  margin: 8px 12px 4px;
  padding: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}

.touch-tabs[hidden] {
  display: none;
}

.touch-tabs button {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-2);
  cursor: pointer;
  font: 650 14px / 1 var(--font-ui);
  /* the longer name takes the room it needs and never breaks inside its pill */
  white-space: nowrap;
}

.touch-tabs button small {
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.touch-tabs button[aria-selected='true'] {
  background: var(--ink);
  color: var(--bg);
}

.touch-tabs button[aria-selected='true'] small {
  color: color-mix(in srgb, var(--bg) 72%, var(--ink));
}

.touch-tabs button:focus-visible {
  outline: 2px solid var(--focus, var(--ink));
  outline-offset: 2px;
}

/* the main area is a column: the tabs, then the one thing they show */
:root[data-theme] .ed-main[data-touch] {
  display: flex;
  flex-direction: column;
  padding-right: 0;
}

:root[data-theme] .ed-main[data-touch] > .splitter,
:root[data-theme] .ed-main[data-touch='pool'] > .board,
:root[data-theme] .ed-main[data-touch='tiers'] > .cart {
  display: none;
}

:root[data-theme] .ed-main[data-touch] > :is(.board, .cart) {
  flex: 1 1 auto;
  width: auto;
  min-height: 0;
}

:root[data-theme] .ed-main[data-touch] > .cart {
  margin: 0;
  border-top: 0;
}

/* the tab already names the unranked panel */
:root[data-theme] .ed-main[data-touch] .cart-title h2 {
  display: none;
}

/* the covers fill the row: the editor cuts their scale to a whole number across (fitTouch) */
:root[data-theme] .editor.is-touch :is(.tier, .pool) {
  --k: var(--touch-k, 0.62) !important;
}

/* what is chosen, and where it can go: the tiers as buttons a thumb can hit */
.editor.is-touch > .selbar {
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  left: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(5, auto);
  align-items: center;
  gap: 8px 4px;
  max-width: none;
  padding: 10px;
  transform: none;
}

.editor.is-touch > .selbar[hidden] {
  display: none;
}

.editor.is-touch .selbar-tiers {
  display: grid;
  grid-auto-columns: minmax(54px, 1fr);
  grid-auto-flow: column;
  grid-column: 1 / -1;
  gap: 6px;
  order: -1;
  overflow-x: auto;
  scrollbar-width: none;
}

.editor.is-touch .selbar-tier {
  width: auto;
  min-width: 0;
  height: 54px;
  border-radius: 14px;
  font-size: 20px;
  font-weight: 750;
}

.editor.is-touch .selbar-count {
  padding-left: 6px;
  font-size: 13.5px;
}

.editor.is-touch .selbar .btn {
  min-width: 44px;
  min-height: 44px;
}

.editor.is-touch .selbar .btn-label {
  display: none;
}

/* the foot of the page is the bar's while something is chosen */
.editor.is-touch .board {
  scroll-padding-bottom: 150px;
}

/* a finished list: the unranked panel steps aside, as it does for Insights */
.ed-main.is-finished {
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.ed-main.is-finished > :is(.cart, .splitter),
.ed-main:is([data-view='insights'], [data-view='overview']) > .finished-strip {
  display: none;
}

.finished-strip {
  position: absolute;
  bottom: 20px;
  left: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100% - 32px);
  padding: 7px 8px 7px 18px;
  border-radius: 999px;
  background: var(--bg-2);
  box-shadow: 0 0 0 1px var(--line), 0 18px 36px -18px rgba(0, 0, 0, 0.7);
  color: var(--ink-2);
  font-size: 13.5px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.finished-strip[hidden] {
  display: none;
}

.finished-strip b {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-weight: 650;
}

.finished-strip b .i {
  width: 16px;
  height: 16px;
}

.finished-strip .btn {
  min-height: 36px;
}


/* ---------- the home page: what to go on with, and who is here ---------- */

.lib-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  gap: 16px;
  margin-top: 6px;
}

.lib-hero[hidden] {
  display: none;
}

.lib-hero.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.lib-hero > .profile-featured {
  margin: 0;
}

/* searching looks through every list: the hero steps aside and its list is a card again */
.library.is-searching .lib-hero,
.library.is-searching .lib-since {
  display: none;
}

.library:not(.is-searching) .list-card.is-continued {
  display: none;
}

.lib-you {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-2);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.3s var(--ease, ease);
}

.lib-you:hover {
  transform: translateY(-2px);
}

.lib-you:focus-visible {
  outline: 2px solid var(--focus, var(--ink));
  outline-offset: 3px;
}

.lib-you .profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  font-size: 30px;
}

.lib-you > .avatar-frame {
  margin: 6px;
}

.lib-you > div {
  display: grid;
  flex: 1;
  gap: 4px;
  min-width: 0;
}

.lib-you small {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.lib-you b {
  overflow: hidden;
  font: 650 22px / 1.15 var(--font-display);
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lib-you > div > span {
  color: var(--ink-2);
  font-size: 12.5px;
}

@media (max-width: 900px) {
  .lib-hero {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- the home page: templates on shelves by subject ---------- */

.lib-templates.is-shelved {
  display: block;
}

.tpl-shelf + .tpl-shelf {
  margin-top: 38px;
}

.tpl-shelf[hidden] {
  display: none;
}

.tpl-shelf-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin: 0 0 14px;
}

.tpl-shelf-head h3 {
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tpl-shelf-head small {
  color: var(--ink-3);
  font-size: 13px;
}

.tpl-row {
  display: grid;
  /* six to a row on a wide page: a shelf of six stands in one line */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 184px), 1fr));
  gap: 16px;
}

/* the home page: finished lists under their own heading, inside the same grid */
.lib-finished-head {
  display: flex;
  grid-column: 1 / -1;
  align-items: baseline;
  gap: 10px;
  margin: 26px 0 0;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lib-finished-head small {
  color: var(--ink-3);
  font-weight: 500;
  letter-spacing: 0;
}

.library.is-searching .lib-finished-head {
  display: none;
}

@media (max-width: 560px) {
  .finished-strip {
    gap: 10px;
    padding-left: 14px;
    font-size: 12.5px;
  }
}

.ed-main:is([data-view='insights'], [data-view='overview']) > :is(.cart, .splitter),
.board:is([data-view='insights'], [data-view='overview']) > :is(.tiers, .add-tier) {
  display: none;
}

.insights {
  display: grid;
  gap: 20px;
  max-width: 1240px;
  padding: 0 8px 40px;
}

/* the controls sit in one row above everything they change */
.ins-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

/* a long language on a narrow screen: the choices scroll, they are never cut */
.ins-controls .segmented {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.ins-controls .segmented button {
  flex: none;
  white-space: nowrap;
}

.ins-notes {
  display: grid;
  gap: 3px;
  max-width: 62ch;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.45;
}

.ins-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  color: var(--ink-2);
  font-size: 13px;
}

.ins-key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.ins-key i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.ins-legend small {
  margin-left: auto;
  color: var(--ink-3);
  font-size: 12.5px;
}

.ins-rows {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ins-head {
  display: grid;
  grid-template-columns: minmax(96px, 210px) minmax(0, 1fr) 28px 16px;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 44px;
  padding: 6px 12px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s;
}

.ins-head:hover,
.ins-row.is-open > .ins-head {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}

.ins-head:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.ins-label {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 600;
  font-size: 14.5px;
}

.ins-plot {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* one bar per value: its length is the count, its segments are the tiers, with
   a gap of the surface between them and a rounded end only where the bar ends */
.ins-bar {
  display: flex;
  flex: 0 0 calc((100% - 44px) * var(--w));
  gap: 2px;
  min-width: 6px;
  height: 16px;
}

.ins-bar i {
  min-width: 3px;
  transition: filter 0.15s;
}

.ins-bar i:last-child {
  border-radius: 0 4px 4px 0;
}

.ins-bar i:hover {
  filter: brightness(1.14);
}

.ins-count {
  color: var(--ink-2);
  font: 500 12.5px/1 var(--font-mono, ui-monospace, monospace);
  font-variant-numeric: tabular-nums;
}

.ins-avg,
.ins-tier {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  font: 650 13px/1 var(--font-display);
}

.ins-chev {
  width: 16px;
  height: 16px;
  color: var(--ink-3);
  transition: transform 0.2s;
}

.ins-row.is-open .ins-chev {
  transform: rotate(180deg);
}

.ins-detail {
  display: grid;
  gap: 10px;
  padding: 8px 12px 20px;
}

.ins-facts {
  margin: 0;
  color: var(--ink-3);
  font: 500 12.5px/1.4 var(--font-mono, ui-monospace, monospace);
}

.ins-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ins-covers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ins-cover {
  width: 52px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg-3);
  color: var(--ink-2);
  cursor: zoom-in;
  transition: transform 0.18s;
}

.ins-cover:hover {
  transform: translateY(-2px);
}

.ins-cover:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.ins-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ins-cover span {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 3px;
  overflow: hidden;
  font-size: 9px;
  line-height: 1.1;
  text-align: center;
}

.ins-empty {
  display: grid;
  gap: 10px;
  justify-items: start;
  max-width: 54ch;
  padding: 26px 8px;
}

.ins-empty h2 {
  font: 650 24px/1.15 var(--font-display);
}

.ins-empty p {
  margin: 0 0 6px;
  color: var(--ink-2);
}

/* ---------- Insights: you and the world ----------
   One row per tier; each dot is a title, placed by its public score. A dot
   is a mark of its tier's colour with a ring of the surface, so neighbours
   stay apart; the tick behind them is the tier's average. */
.ins-swarm {
  --ins-surface: var(--bg-2);
  display: grid;
  gap: 2px;
}

.ins-axis,
.ins-lane {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 62px;
  align-items: center;
  gap: 14px;
  padding: 0 12px;
}

.ins-lane {
  min-height: calc(34px + var(--depth, 0) * 26px);
}

.ins-ticks {
  position: relative;
  height: 20px;
}

.ins-ticks i,
.ins-axis-end {
  color: var(--ink-3);
  font: 500 11.5px/20px var(--font-mono, ui-monospace, monospace);
  font-variant-numeric: tabular-nums;
}

.ins-ticks i {
  position: absolute;
  left: calc(8px + (100% - 16px) * var(--x));
  transform: translateX(-50%);
}

.ins-axis-end,
.ins-lane > .ins-count {
  text-align: right;
}

.ins-axis-end {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ins-track {
  position: relative;
  align-self: stretch;
}

.ins-grid,
.ins-mean,
.ins-dot {
  position: absolute;
  left: calc(8px + (100% - 16px) * var(--x));
}

.ins-grid {
  top: 0;
  bottom: 0;
  width: 1px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}

.ins-mean {
  top: 4px;
  bottom: 4px;
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--ink) 46%, transparent);
}

.ins-dot {
  top: calc(50% + var(--lane, 0) * 13px);
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--ins-surface);
  cursor: zoom-in;
  transition: transform 0.15s;
}

/* easier to point at than an 11px mark */
.ins-dot::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
}

.ins-dot:hover {
  z-index: 2;
  transform: scale(1.55);
}

/* where you and the world part ways: two short lists side by side */
.ins-pairs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 14px 28px;
}

.ins-side h3 {
  margin: 0 0 6px;
  padding: 0 12px;
  color: var(--ink-2);
  font: 600 13.5px/1.3 var(--font-ui);
}

.ins-picks {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ins-table {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  column-gap: 28px;
}

.ins-pick {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 28px 46px 34px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 5px 12px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: zoom-in;
  transition: background-color 0.15s;
}

.ins-pick:hover {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}

.ins-pick:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.ins-thumb {
  display: block;
  width: 30px;
  max-height: 44px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg-3);
}

.ins-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ins-pick-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 600;
  font-size: 14.5px;
}

.ins-pick .ins-count {
  text-align: right;
}

/* where the title stands for the world, among the titles compared */
.ins-place {
  color: var(--ink-3);
  font: 500 12px/1 var(--font-mono, ui-monospace, monospace);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.ins-source {
  padding: 0 12px;
}

@media (max-width: 560px) {
  .room-heading {
    flex-wrap: wrap;
  }

  .ins-axis,
  .ins-lane {
    grid-template-columns: 28px minmax(0, 1fr) 52px;
    gap: 8px;
    padding: 0 8px;
  }

  .ins-pick {
    grid-template-columns: 30px minmax(0, 1fr) 28px 38px 30px;
    gap: 8px;
    padding: 5px 8px;
  }

  .ins-head {
    grid-template-columns: minmax(78px, 34%) minmax(0, 1fr) 28px 16px;
    gap: 10px;
    padding: 6px 8px;
  }

  .ins-legend small {
    margin-left: 0;
    flex-basis: 100%;
  }

  .ins-controls .segmented button {
    padding: 0 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ins-chev,
  .ins-cover,
  .ins-dot {
    transition: none;
  }
}

/* ---------- the help button: one round button in the bottom corner of the lobby pages ---------- */
.help-dock {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--bg-2);
  color: var(--ink-2);
  box-shadow: 0 0 0 1px var(--line), 0 14px 28px -14px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: color 0.18s, transform 0.25s var(--ease), box-shadow 0.25s;
}

.help-dock svg {
  width: 20px;
  height: 20px;
}

.help-dock:hover {
  color: var(--ink);
  transform: translateY(-2px);
}

.help-dock:focus-visible {
  outline: 2px solid var(--focus, var(--ink));
  outline-offset: 3px;
}

/* the light switch stands beside it (js/panels/helpdock.js); a theme that has one look only has no use for it */
.lamp-dock {
  right: 78px;
}

:root:not([data-theme='aurora']) .lamp-dock {
  display: none;
}

/* it has just come to rest here: a ring goes out from it once */
.help-dock.is-arriving::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ink) 55%, transparent);
  animation: help-ring 1.5s var(--ease) 0.8s both;
}

@keyframes help-ring {
  from {
    opacity: 0.9;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(1.9);
  }
}

@media (max-width: 560px) {
  .help-dock {
    right: 14px;
    bottom: 14px;
    width: 42px;
    height: 42px;
  }

  .lamp-dock {
    right: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .help-dock,
  .help-dock.is-arriving::after {
    transition: none;
    animation: none;
  }
}

/* ---------- a template's own page (/tier-list/films) ---------- */

.tpage-home {
  display: inline-flex;
  color: inherit;
  text-decoration: none;
}

.tpage > section,
.tpage > .tpage-rest,
.tpage > .hub-nav {
  max-width: 1120px;
  margin-right: auto;
  margin-left: auto;
}

.tpage-head {
  display: grid;
  justify-items: start;
  gap: 10px;
  margin-bottom: 40px;
}

.tpage-kind {
  order: 2;
  color: var(--ink-2);
  font: 500 15px / 1.4 var(--font-ui);
}

.tpage-head h1 {
  order: 1;
  max-width: 18ch;
  font: 650 clamp(38px, 6.4vw, 76px) / 0.98 var(--font-display);
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.tpage-sub {
  color: var(--ink-2);
  font-size: 17px;
}

.tpage-note {
  max-width: 62ch;
  color: var(--ink-3);
  font-size: 14.5px;
  line-height: 1.5;
}

.tpage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.tpage-actions .btn {
  min-height: 48px;
  padding: 0 22px;
  font-size: 16px;
}

/* the first of what there is to rank: covers in their own shape, names under them */
.tpage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 22px 14px;
}

.tpage[data-aspect='wide'] .tpage-grid {
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}

.tpage-cover {
  display: grid;
  align-content: start;
  gap: 8px;
  margin: 0;
  min-width: 0;
}

.tpage-art {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: var(--cover-fallback);
  box-shadow: 0 14px 24px -16px rgba(0, 0, 0, 0.7);
}

.tpage[data-aspect='square'] .tpage-art {
  aspect-ratio: 1;
}

.tpage[data-aspect='wide'] .tpage-art {
  aspect-ratio: 16 / 9;
}

.tpage-art img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

.tpage-art.is-loaded img { opacity: 1; }
.tpage-art.is-loaded b { visibility: hidden; }

.tpage-art b {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  padding: 12px;
  color: var(--ink-2);
}

.tpage-art b > .i { width: 32px; height: 32px; }
.tpage-art-year { font: 500 13px / 1.3 var(--font-mono); }

.tpage-cover figcaption {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.tpage > .tpage-rest {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
  color: var(--ink-3);
  font-size: 14.5px;
}

.tpage-more {
  margin-top: 64px;
}

.tpage-more h2 {
  margin-bottom: 16px;
  font: 650 22px / 1.2 var(--font-display);
  letter-spacing: -0.03em;
}

.tpage-others {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.tpage-other {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 9%, transparent);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.2s;
}

.tpage-other:is(:hover, :focus-visible) {
  background: color-mix(in srgb, var(--ink) 11%, transparent);
}

.tpage-other b {
  font: 600 15px / 1.25 var(--font-ui);
}

.tpage-other small {
  color: var(--ink-3);
  font-size: 12.5px;
}

@media (max-width: 560px) {
  .tpage-head {
    margin-bottom: 28px;
  }

  .tpage-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 10px;
  }

  .tpage[data-aspect='wide'] .tpage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tpage-actions .btn {
    flex: 1 1 auto;
  }

  .tpage-others {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.tpage-more-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

/* ---------- a link and the button that copies it ---------- */

.link-row {
  display: flex;
  gap: 8px;
}

.link-row .field {
  flex: 1 1 auto;
  min-width: 0;
}

.link-row .btn {
  flex: none;
}

/* a list read by its link: the name of the site leads home */
.shared-view .tpage-home {
  margin-right: 6px;
}

/* the head of the home page: what can be started from it */
.lib-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* a cover on a template's page that opens its title */
.tpage-cover.is-open {
  cursor: pointer;
}

.tpage-cover.is-open:focus-visible {
  outline: 2px solid var(--focus, var(--ink));
  outline-offset: 4px;
  border-radius: 8px;
}

.tpage-cover.is-open .tpage-art {
  transition: transform 0.3s var(--ease, ease);
}

.tpage-cover.is-open:hover .tpage-art {
  transform: translateY(-3px);
}

/* Discovery and a member's shelf extend Aurora's existing cover language.
   The work is the picture and name; controls stay under it, outside the art. */
.personal-shelf { margin: 24px 0 38px; }
.personal-shelf > .lib-head { margin-bottom: 12px; }
.personal-notice { margin: 0 0 16px; font-size: 14px; color: var(--ink-2); }
.personal-notice:empty { display: none; }
.personal-groups { --personal-gap: 18px; --personal-card-width: clamp(140px, calc((100vw - 2 * clamp(20px, 5vw, 76px) - 104px) / 6), 180px); display: flex; flex-wrap: wrap; gap: 28px 32px; }
.personal-group { --columns: var(--cards, 1); min-width: 0; width: min(100%, calc(var(--columns) * var(--personal-card-width) + (var(--columns) - 1) * var(--personal-gap))); }
.personal-group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.personal-group h3 { margin: 0; font: 600 17px/1.3 var(--font-display); }
.personal-group > h3 { margin-bottom: 12px; }
.personal-total { display: inline-flex; align-items: center; justify-content: flex-end; min-height: 44px; max-width: 50%; color: var(--ink-2); font-size: 13px; text-align: right; text-underline-offset: 4px; }
.personal-total:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 4px; }
.personal-cards { display: grid; grid-template-columns: repeat(var(--columns), minmax(0, 1fr)); gap: var(--personal-gap); }
.personal-start { margin: 0; color: var(--ink-2); line-height: 1.55; max-width: 65ch; }
.personal-start a { color: var(--ink); text-underline-offset: 4px; }
.personal-context { min-width: 0; margin-top: 8px; color: var(--ink-2); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.personal-context p { margin: 0; }
.personal-plan-note { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.personal-progress { height: 3px; margin-top: 7px; overflow: hidden; border-radius: 2px; background: var(--line); }
.personal-progress i { display: block; height: 100%; background: var(--ink-2); }
.personal-shelf.is-empty { margin-bottom: 26px; }
.home-member .lib-hero { margin-top: 0; margin-bottom: 30px; }
@media (max-width: 560px) {
  .personal-shelf { margin-top: 18px; }
  .personal-groups { --personal-gap: 16px; --personal-card-width: calc((100vw - 28px - 16px) / 2); gap: 28px 16px; }
  .personal-group { --columns: 2; }
  .personal-group[data-count='1'] { --columns: 1; }
  /* on a phone each group is one row of covers that scrolls, as the daily shelf does */
  .personal-groups { display: grid; gap: 22px; }
  .personal-group, .personal-group[data-count='1'] { width: 100%; }
  .personal-cards { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding-bottom: 4px; margin-inline: -14px; padding-inline: 14px; scroll-padding-inline: 14px; }
  .personal-cards::-webkit-scrollbar { display: none; }
  .personal-cards > * { flex: 0 0 31vw; max-width: 140px; scroll-snap-align: start; }
  /* on a phone a card is its cover and name: the year and the status control live in its sheet */
  .personal-cards .discover-open small, .personal-cards .discover-status { display: none; }
}
/* the open button takes the card's spare height, so the status control (or the episode strip above it) sits at the bottom of every card of a row */
.discover-title > .discover-status { margin-top: 12px; }
.discover-title > .personal-context { margin-top: 12px; }
.discover-title > .personal-context + .discover-status { margin-top: 8px; }
.hub-tools { display: contents; }
.hub-library .tb-left > a { color: inherit; text-decoration: none; }
.hub-library .tb-right { margin-right: 120px; }
.hub-tools .help-dock { top: calc(var(--gap, 12px) + 7px); bottom: auto; z-index: 35; }
[data-theme='aurora'] .hub-library > .hub-main { padding-top: calc(var(--topbar-h) + 16px); }
.hub-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; max-width: 1320px; margin: 0 auto 16px; padding: 0 0 8px; border-bottom: 1px solid var(--line); }
.hub-nav a { display: flex; align-items: center; min-height: 44px; padding: 0 6px; color: var(--ink-2); text-decoration: none; font-size: 15px; border-radius: 8px; }
.hub-nav a[aria-current='page'] { color: var(--ink); font-weight: 650; box-shadow: inset 0 -2px var(--ink); }
:root[data-theme] .topbar .btn[aria-current='page'] { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); box-shadow: inset 0 -2px var(--ink); }
.hub-nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.hub-nav a:focus-visible, .hub-all:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 4px; }
.hub-heading { max-width: 1320px; margin: 0 auto 20px; }
.hub-heading h1 { margin: 0 0 10px; font: 650 clamp(32px, 3.7vw, 48px)/1.06 var(--font-display); letter-spacing: -0.035em; text-wrap: balance; }
.hub-heading p { max-width: 65ch; margin: 0; color: var(--ink-2); font-size: 17px; line-height: 1.55; text-wrap: pretty; }
.hub-heading-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.lib-empty-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.lib-nomatch { color: var(--ink-3); }
.lib-nomatch > p { margin: 0; font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere; }
.lib-nomatch > .link-btn { min-height: 44px; color: var(--ink-3); }
.hub-main:not(.social-main) > section { max-width: 1320px; margin: 0 auto; }
.hub-all { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-underline-offset: 5px; font-size: 15px; }
.discover-controls { display: flex; align-items: center; gap: 12px; }
/* the search grows; the selects take the width of their words, so none is stretched across the page */
.discover-controls input.field { flex: 1 1 260px; min-width: 200px; width: auto; }
/* Explore and My shelf (.has-kinds; the Templates page shares the rest): the kind chips take a row of their own under the search */
.discover-controls.has-kinds { flex-wrap: wrap; gap: 14px 12px; margin-bottom: 22px; }
/* the search does not stretch across a whole desktop row */
.discover-controls.has-kinds input.field { max-width: 640px; }
/* the kinds are chips (the look of the source chips, base.css): films, series, anime, games, books, music, then "More kinds" opens the rest below */
.discover-kinds { flex: 1 1 100%; display: grid; gap: 8px; min-width: 0; }
.discover-kind-row { gap: 8px; }
.discover-kind-row[hidden] { display: none; }
.discover-kinds .src-chip.discover-kind { height: 40px; padding: 0 16px; background-image: none; font-size: 14px; cursor: pointer; }
.discover-kinds .discover-kind:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 2px; }
.discover-kind-toggle[aria-expanded='true']:not(.is-on) { color: var(--ink); }
/* on a phone the chips wrap into rows (the source chips of base.css sweep sideways there): every kind is in view, nothing widens the page */
@media (max-width: 560px) {
  :root[data-theme] .discover-kinds .discover-kind-row { flex-wrap: wrap; overflow: visible; padding-right: 0; -webkit-mask-image: none; mask-image: none; }
}
.discover-filters { display: flex; flex: 0 1 auto; align-items: center; gap: 12px; min-width: 0; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.discover-filters::-webkit-scrollbar { display: none; }
.discover-filters select.field { flex: none; width: auto; min-width: 132px; max-width: 240px; }
.discover-controls select.field, .community-trends select.field { height: 44px; border-radius: 999px; padding-inline-start: 16px; }
/* the search of discovery and the shelf is the same pill as the search of one's lists */
.discover-controls input.field { height: 44px; padding-left: 44px; border-radius: 999px; border-color: transparent; background: var(--field) no-repeat 16px 50% / 18px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='1.75' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); }
.discover-count { margin: 12px 0 16px; min-height: 24px; color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.discover-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 32px 24px; }
.discover-title { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: stretch; container-type: inline-size; }
.discover-open { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; flex: 1 1 auto; gap: 8px; width: 100%; padding: 0; border: 0; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.discover-frame { display: flex; align-items: flex-end; width: 100%; aspect-ratio: 2/3; }
.discover-art { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 2/3; overflow: hidden; border-radius: 9px; background: color-mix(in srgb, hsl(var(--hue, 220) 28% 45%) 16%, var(--bg-2)); box-shadow: 0 12px 20px -16px rgb(var(--shade, 0 0 0) / .55); transition: transform .25s var(--ease); }
.discover-art[data-aspect='square'] { aspect-ratio: 1; }
.discover-art[data-aspect='wide'] { aspect-ratio: 16/9; }
.discover-art > b { display: grid; justify-items: center; gap: 12px; padding: 18px; color: var(--ink-2); }
.discover-art > b > .i { width: 32px; height: 32px; }
.discover-art-year { font: 500 13px/1.3 var(--font-mono); }
.discover-art.is-loaded > b { visibility: hidden; }
.discover-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center top; }
.discover-art:is([data-kind='film'], [data-kind='series'], [data-kind='anime'], [data-kind='books'], [data-kind='games']) img { object-fit: cover; }
.discover-art[data-aspect='square'] img, .discover-art[data-aspect='wide'] img, .discover-art[data-fit='contain'] img { object-fit: contain; }
/* a square or wide picture in a poster frame sits in its middle, not on top of an empty tray */
.discover-art[data-fit='contain'] img { object-position: center; }
.discover-open:hover .discover-art { transform: translateY(-3px); }
.discover-open:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 5px; border-radius: 9px; }
.discover-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font: 600 16px/1.3 var(--font-display); overflow-wrap: anywhere; }
.discover-open > small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 13px; line-height: 1.4; }
.discover-status { margin-top: auto; }
/* the dropdown is the shared compact one (base.css); here it fills the card's foot and says whether the title is on the shelf */
select.field.is-compact.discover-status { width: 100%; font-weight: 600; }
select.field.discover-status[data-state='none'] { border: 1px dashed var(--line-2); background-color: transparent; box-shadow: none; color: var(--ink-3); font-weight: 500; }
select.field.discover-status[data-state='set'] { background-color: color-mix(in srgb, var(--ink) 11%, transparent); color: var(--ink); }
select.field.discover-status:disabled { cursor: wait; }
/* (themes take the outline off fields for a glow of their own; the quiet state has none, so the ring is drawn here in every theme) */
:root select.field.discover-status:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 2px; }
/* the + on the cover's bottom-right corner is the want button of the "Coming out" covers (.premiere-want, plans.css: round, 36px, a surface of its own);
   the card is the container its cover's height is measured in, and the hit area reaches 44px */
.discover-add.premiere-want { top: calc(150cqw - 44px); right: 8px; opacity: 1; }
.discover-add.premiere-want::before { content: ''; position: absolute; inset: -4px; border-radius: 50%; }
.discover-add[data-state='set'] { border-color: transparent; background: var(--ink); color: var(--bg); }
.discover-add.premiere-want:disabled { cursor: progress; }
.discover-add[aria-busy='true'] { opacity: .6; }
.discover-open > .discover-mark { color: var(--ink-3, var(--ink-2)); font-size: 12.5px; }
.discover-open > .discover-mark[hidden] { display: none; }
.discover-menu .menu-item { min-height: 44px; }
.discover-title.is-rising { animation: discover-rise .42s var(--ease) var(--rise, 0ms) both; }
@keyframes discover-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.discover-score { position: absolute; top: 6px; right: 6px; z-index: 1; display: grid; place-items: center; min-width: 26px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--bg-2); color: var(--ink); box-shadow: 0 0 0 1px var(--line); font: 650 12px/1 var(--font-mono); font-variant-numeric: tabular-nums; pointer-events: none; }
.discover-title:has(.discover-art[data-aspect='square']) .discover-score { top: calc(50cqw + 6px); }
.discover-title:has(.discover-art[data-aspect='wide']) .discover-score { top: calc(93.75cqw + 6px); }
.discover-more { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 36px 0; }
.discover-page-error { margin: 0; max-width: 60ch; text-align: center; color: var(--ink-2); }
.discover-page-error[hidden] { display: none; }
.discover-skeleton { aspect-ratio: 2/3; border-radius: 9px; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.hub-empty { grid-column: 1/-1; padding: 40px 0; }
.hub-empty h2 { margin: 0 0 12px; font: 600 26px/1.2 var(--font-display); }
.hub-empty p { color: var(--ink-2); max-width: 58ch; line-height: 1.55; }
.hub-empty .btn { margin: 10px 12px 0 0; }
.template-catalogue { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.community-trends select.field { width: auto; min-width: 132px; max-width: 240px; }
.community-trend-controls { display: flex; flex-wrap: wrap; gap: 10px; }
.community-trend-note { margin: -4px 0 24px; max-width: 68ch; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.community-trend-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.community-trend-title { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: center; color: var(--ink); text-decoration: none; }
.community-trend-art { position: relative; display: block; width: 64px; aspect-ratio: 2/3; overflow: hidden; border-radius: 6px; background: var(--bg-2); }
.community-trend-art b { display: block; padding: 8px; font-size: 11px; overflow-wrap: anywhere; }
.community-trend-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.community-trend-title > span:last-child { display: grid; gap: 7px; }
.community-trend-title small { color: var(--ink-2); font-size: 13px; }
.community-trend-title:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 5px; }
.library .lib-greet .hub-nav { margin: 0; }
[data-theme='aurora'] .onshow-by .profile-avatar { width: 24px; height: 24px; border-radius: 8px; font: 600 11px/1 var(--font-display); }
@media (max-width: 1000px) {
  .discover-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px 18px; }
  .template-catalogue { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .community-trend-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  /* the help button stands in a band of its own under the page, in the grid's last row: the third where the bar takes a row, the second in Aurora, whose bar floats */
  .hub-library.library { grid-template-rows: var(--topbar-h) minmax(0, 1fr) auto; }
  [data-theme='aurora'] .hub-library.library { grid-template-rows: minmax(0, 1fr) auto; }
  [data-theme='aurora'] .hub-library > .hub-main { padding-top: calc(var(--topbar-h) + 10px); padding-bottom: 30px; }
  .hub-library .hub-tools { grid-row: -2 / -1; display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); background: var(--glass-float, var(--bg-2)); border-top: 1px solid var(--line); }
  .hub-library .tb-right { margin-right: 0; }
  .hub-tools .help-dock { position: static; width: 44px; height: 44px; flex: 0 0 44px; }
  /* on a phone the places stand in one row that scrolls, rather than a second line */
  .hub-nav { gap: 4px 10px; min-width: 0; max-width: 100%; margin-bottom: 16px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-mask-image: var(--nav-fade); mask-image: var(--nav-fade); --nav-fade: linear-gradient(90deg, transparent, #0004 calc(var(--fade-l, 0px) / 2), #000 var(--fade-l, 0px), #000 calc(100% - var(--fade-r, 0px)), #0004 calc(100% - var(--fade-r, 0px) / 2), transparent); }
  .hub-nav.has-before { --fade-l: 32px; }
  .hub-nav.has-after { --fade-r: 32px; }
  .hub-nav::-webkit-scrollbar { display: none; }
  .hub-nav a { flex: none; }
  .hub-nav a { font-size: 14px; padding: 0 3px; }
  .hub-heading p { font-size: 16px; }
  .discover-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 16px; }
  .discover-name { font-size: 15px; }
  .template-catalogue { grid-template-columns: 1fr; }
  .community-trend-row { grid-template-columns: 1fr; }
}
/* a phone: the search is a row of its own; the kind chips wrap below it, and status and sort (My shelf) stand in a row that scrolls sideways when they do not fit */
@media (max-width: 720px) {
  .discover-controls { flex-direction: column; align-items: stretch; gap: 10px; }
  .discover-controls input.field { flex: none; width: 100%; min-width: 0; }
  .discover-controls.has-kinds { gap: 10px; }
  .discover-controls.has-kinds input.field { max-width: none; }
  .discover-kinds { flex: none; }
  .discover-kinds .src-chip.discover-kind { height: 38px; padding: 0 14px; }
  .discover-filters { gap: 8px; }
  .community-trend-controls { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .community-trend-controls select.field { flex: none; }
}
@media (prefers-reduced-motion: reduce) { .discover-art { transition: none; } .discover-title.is-rising { animation: none; } }

/* a link dressed as a button reads as a button: no underline under its words */
a.btn { text-decoration: none; }

/* under the name: its kind and size, then what it is and where it comes from, then what to do */
.tpage-sub { order: 3; }
.tpage-note { order: 4; }
.tpage-actions { order: 5; }

/* The overview is a map: the full row is the target, even when covers are tiny. */
:root[data-theme] .board[data-view='overview'] {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 24px 16px;
  overflow: auto;
}
.overview { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; gap: 12px; }
.overview-tools { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px; }
.overview-hint { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.4; }
.overview-map { flex: 1 1 0; min-height: 56px; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 3px; scrollbar-gutter: stable; }
.overview-row {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; flex: none;
  width: 100%; padding: 8px; border: 0; border-radius: 12px;
  color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent);
  font: inherit; text-align: start; cursor: pointer;
}
.overview-row:hover { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.overview-row:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 1px; }
.overview-label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.overview-label b { padding: 6px 8px; min-width: 32px; max-width: 72px; border-radius: 8px; font-size: 14px; font-weight: 650; line-height: 1.2; overflow-wrap: anywhere; }
.overview-label small { font-size: 12px; font-variant-numeric: tabular-nums; }
.overview-covers { display: flex; flex-wrap: wrap; align-content: center; gap: 3px; min-width: 0; }
.overview-cover { position: relative; display: block; width: var(--ov-cover, 24px); aspect-ratio: var(--ov-ratio, 0.6667); overflow: hidden; border-radius: 2px; background: color-mix(in srgb, var(--ink) 12%, var(--bg)); }
.overview-cover > span { display: block; padding: 2px; font-size: 9px; line-height: 1.2; overflow-wrap: anywhere; }
.overview-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.overview-foot { display: flex; flex: none; justify-content: flex-end; }
.overview-foot:has(> [hidden]) { display: none; }
:root[data-theme] .room-actions .view-switch button { min-height: 44px; }
@media (max-width: 560px) {
  :root[data-theme] .board[data-view='overview'] { padding: 8px 10px 12px; gap: 8px; }
  .overview { gap: 8px; }
  .overview-tools { align-items: flex-start; }
  .overview-tools .btn { flex: none; }
  .overview-tools .btn .btn-label { display: none; }
  .overview-row { grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
  .overview-label { gap: 4px; }
  .overview-label b { max-width: 50px; padding: 6px; }
  .overview-hint { font-size: 13px; }
}

@media (max-width: 360px) {
  .touch-tabs button small { display: none; }
}

/* ---- Aurora's category picker ---- */

/* the eight rooms: small shadow boxes, each a door to a new list of its kind */
.lobby-rooms {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px 18px;
}

.room-tile {
  display: grid;
  gap: 3px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  color: var(--ink);
  animation: lobby-rise 0.7s calc(0.15s + var(--n, 0) * 60ms) cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.room-box {
  position: relative;
  isolation: isolate;
  display: block;
  aspect-ratio: 5 / 4;
  margin-bottom: 9px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--room, #2a221c);
  box-shadow:
    inset 0 0 0 7px #1a120d,
    inset 0 0 0 8px rgba(217, 164, 65, 0.5),
    inset 0 18px 22px -8px rgba(0, 0, 0, 0.7),
    inset 12px 0 18px -12px rgba(0, 0, 0, 0.55),
    inset -12px 0 18px -12px rgba(0, 0, 0, 0.55),
    0 20px 26px -16px rgba(0, 0, 0, 0.85);
  transition: filter 0.3s;
}

.room-box::before {
  content: '';
  position: absolute;
  z-index: -1;
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: 30%;
  background: var(--floor, #3a2a1e);
  clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%);
}

.room-box::after {
  content: '';
  position: absolute;
  inset: 8px;
  z-index: 3;
  background: linear-gradient(118deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 34%);
  pointer-events: none;
}

/* the prop standing on the floor of each room */
.room-prop {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 19%;
  width: 42%;
  aspect-ratio: 1;
  translate: -50% 0;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  filter: drop-shadow(0 6px 5px rgba(0, 0, 0, 0.5));
}

.room-tile:hover .room-box,
.room-tile:focus-visible .room-box {
  filter: brightness(1.15) saturate(1.06);
}

.room-tile:hover .room-prop,
.room-tile:focus-visible .room-prop {
  transform: translateY(-6px);
}

.room-tile:active .room-prop {
  transform: translateY(-2px) scale(0.97);
}

.room-name {
  font: italic 400 17px/1.15 'Playfair Display', serif;
  transition: color 0.2s;
}

.room-kind {
  font: 600 11px/1 'Sofia Sans', sans-serif;
  letter-spacing: 0.16em;
  font-variant: small-caps;
  text-transform: lowercase;
  color: var(--brass, var(--accent));
}

.room-tile:hover .room-name {
  color: var(--brass-hi, var(--accent));
}

/* the line sign of a kind and its few words: for themes that set them on the tile */
.room-emblem,
.room-blurb {
  display: none;
}

/* as a picker (New list): the chosen room is framed, the others step back */
.lobby-rooms[role='radiogroup'] .room-tile[aria-checked='false'] .room-box {
  filter: saturate(0.55) brightness(0.8);
}

.lobby-rooms[role='radiogroup'] .room-tile[aria-checked='false']:hover .room-box {
  filter: none;
}

.lobby-rooms[role='radiogroup'] .room-tile[aria-checked='true'] .room-box {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.lobby-rooms.is-compact {
  gap: 14px 12px;
}

.lobby-rooms.is-compact .room-box {
  margin-bottom: 6px;
}

.lobby-rooms.is-compact .room-name {
  font-size: 15px;
}

/* first visit: the rooms are the way in */
.lib-first {
  max-width: 820px;
  gap: 14px;
}

.lib-first .lobby-rooms {
  margin-top: 10px;
}

/* sport: a ball on the grass */
.room-tile[data-cat='sport'] {
  --room: #1f3328;
  --floor: #2f5a3c;
}

.room-tile[data-cat='sport'] .room-prop {
  width: 34%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 30%, rgba(255, 255, 255, 0.9) 0 16%, transparent 17%),
    conic-gradient(from 20deg, #f4f1e8 0 20%, #1d1d1d 0 26%, #f4f1e8 0 46%, #1d1d1d 0 52%, #f4f1e8 0 72%, #1d1d1d 0 78%, #f4f1e8 0);
}

/* music: a record leaning on its sleeve */
.room-tile[data-cat='music'] .room-prop {
  border-radius: 50%;
  background:
    radial-gradient(circle, #ddd 0 3%, #e8b33a 3.5% 17%, #0c0c0c 17.5% 19%, transparent 19.5%),
    repeating-radial-gradient(circle, #121212 0 1.2px, #1e1e1e 1.6px 2.6px);
  box-shadow: -14px 2px 0 -2px #c2452c;
}

/* film: the screen, lit */
.room-tile[data-cat='film'] .room-prop {
  bottom: 30%;
  width: 54%;
  aspect-ratio: 16 / 9;
  border-radius: 2px;
  background: linear-gradient(180deg, #fffaf0, #f2e3c0);
  box-shadow: 0 0 0 3px #1a0607;
}

/* games: a little arcade cabinet */
.room-tile[data-cat='games'] .room-prop {
  width: 26%;
  aspect-ratio: 3 / 5;
  border-radius: 3px 3px 1px 1px;
  background:
    linear-gradient(180deg, transparent 12%, #2ee6a6 12% 44%, transparent 44%) 50% 0 / 76% 100% no-repeat,
    linear-gradient(180deg, transparent 52%, #ff3d7f 52% 60%, transparent 60%) 50% 0 / 100% 100% no-repeat,
    #1f1745;
  box-shadow: inset 0 0 0 2px #3a2e7a;
}

/* anime: a vermilion torii */
.room-tile[data-cat='anime'] .room-prop {
  width: 46%;
  aspect-ratio: 1 / 0.8;
  background:
    linear-gradient(#141018, #141018) 50% 0 / 100% 9% no-repeat,
    linear-gradient(#d8322a, #d8322a) 50% 9% / 92% 9% no-repeat,
    linear-gradient(#d8322a, #d8322a) 50% 34% / 74% 7% no-repeat,
    linear-gradient(#d8322a, #d8322a) 22% 100% / 9% 86% no-repeat,
    linear-gradient(#d8322a, #d8322a) 78% 100% / 9% 86% no-repeat;
}

/* food: a glazed donut */
.room-tile[data-cat='food'] .room-prop {
  width: 36%;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 26%, #ff7eb6 27% 58%, #d99a55 60% 70%, transparent 71%),
    radial-gradient(circle at 30% 34%, #fff 0 2%, transparent 3%),
    radial-gradient(circle at 62% 26%, #ffd23f 0 2%, transparent 3%);
  background-blend-mode: normal;
  scale: 1 0.62;
}

/* countries: a globe on its stand */
.room-tile[data-cat='countries'] .room-prop {
  width: 34%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.4), transparent 38%),
    radial-gradient(ellipse 22% 50% at 50% 50%, transparent 90%, rgba(233, 214, 160, 0.6) 92% 97%, transparent 99%),
    linear-gradient(180deg, transparent 48.5%, rgba(196, 64, 48, 0.75) 48.5% 52%, transparent 52%),
    radial-gradient(ellipse 18% 26% at 36% 36%, #e6cf98 0 90%, transparent 95%),
    radial-gradient(ellipse 14% 22% at 64% 64%, #e6cf98 0 90%, transparent 95%),
    radial-gradient(ellipse 10% 9% at 68% 30%, #e6cf98 0 90%, transparent 95%),
    #4f7f86;
  box-shadow: 0 0 0 2px #b8862b;
}

/* landmarks: a postcard with its stamp */
.room-tile[data-cat='landmarks'] .room-prop {
  width: 46%;
  aspect-ratio: 3 / 2;
  rotate: -5deg;
  background:
    linear-gradient(#ff6f61, #ff6f61) 88% 14% / 18% 26% no-repeat,
    linear-gradient(90deg, transparent 52%, rgba(45, 34, 64, 0.2) 52% 53%, transparent 53%),
    #fffaf2;
  box-shadow: 0 0 0 2px #fffaf2;
}

/* other: a framed picture on the gallery wall */
.room-tile[data-cat='other'] .room-prop {
  bottom: 34%;
  width: 34%;
  aspect-ratio: 4 / 5;
  background: linear-gradient(160deg, #c9a05a, #6f8a7a 55%, #3d4a52);
  box-shadow: 0 0 0 5px #fff, 0 0 0 7px #2a2622;
}

/* books: four bound volumes standing on the shelf, gilt bands on the spines */
.room-tile[data-cat='books'] .room-prop {
  width: 40%;
  aspect-ratio: 5 / 4;
  --band: linear-gradient(180deg, transparent 10%, #e2bd5a 10% 13%, transparent 13% 84%, #e2bd5a 84% 87%, transparent 87%);
  --round: linear-gradient(90deg, rgba(0, 0, 0, 0.4), rgba(255, 255, 255, 0.14) 38%, rgba(0, 0, 0, 0.38));
  background:
    var(--band) 5% 100% / 20% 90% no-repeat,
    var(--round) 5% 100% / 20% 90% no-repeat,
    linear-gradient(#7e1d2b, #7e1d2b) 5% 100% / 20% 90% no-repeat,
    var(--band) 33% 100% / 18% 100% no-repeat,
    var(--round) 33% 100% / 18% 100% no-repeat,
    linear-gradient(#2c3e66, #2c3e66) 33% 100% / 18% 100% no-repeat,
    var(--band) 57% 100% / 16% 82% no-repeat,
    var(--round) 57% 100% / 16% 82% no-repeat,
    linear-gradient(#23533f, #23533f) 57% 100% / 16% 82% no-repeat,
    var(--band) 86% 100% / 20% 94% no-repeat,
    var(--round) 86% 100% / 20% 94% no-repeat,
    linear-gradient(#8a5a1e, #8a5a1e) 86% 100% / 20% 94% no-repeat;
}

/* characters (Snap Rank): one card standing up, its colour lighting the black room */
.room-tile[data-cat='characters'] .room-prop {
  width: 26%;
  aspect-ratio: 5 / 7;
  border-radius: 4px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.28), transparent 40%),
    radial-gradient(circle at 50% 38%, #ffd23f 0 14%, transparent 15%),
    linear-gradient(170deg, #ff2d55, #a12bd9 60%, #3b2bd9);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5);
}

/* people: the bill on the wall, the biggest name on top */
.room-tile[data-cat='people'] .room-prop {
  bottom: 30%;
  width: 34%;
  aspect-ratio: 3 / 4;
  background:
    linear-gradient(#2a1dcb, #2a1dcb) 50% 16% / 78% 15% no-repeat,
    linear-gradient(#ff5ba7, #ff5ba7) 50% 40% / 62% 9% no-repeat,
    linear-gradient(#2a1dcb, #2a1dcb) 50% 58% / 48% 7% no-repeat,
    linear-gradient(#2a1dcb, #2a1dcb) 50% 72% / 70% 5% no-repeat,
    linear-gradient(#2a1dcb, #2a1dcb) 50% 84% / 56% 5% no-repeat,
    #ffe34d;
  box-shadow: 0 0 0 2px #fff6e6;
  rotate: 3deg;
}

/* things: boxes face-out on a white laminate shelf with a sticker */
.room-tile[data-cat='stuff'] .room-prop {
  width: 50%;
  aspect-ratio: 2 / 1;
  background:
    linear-gradient(#e7ebee, #e7ebee) 50% 100% / 100% 9% no-repeat,
    linear-gradient(#ffd23f, #ffd23f) 12% 30% / 12% 18% no-repeat,
    linear-gradient(#232c3a, #232c3a) 8% 82% / 26% 74% no-repeat,
    linear-gradient(#ff5da2, #ff5da2) 50% 82% / 24% 60% no-repeat,
    linear-gradient(#3a6ea5, #3a6ea5) 90% 82% / 26% 84% no-repeat;
}

@keyframes lobby-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

/* ---------- the rooms, in miniature ---------- */

[data-cat='music'] {
  --room: radial-gradient(70% 60% at 50% 0, rgba(255, 170, 92, 0.24), transparent 72%), linear-gradient(180deg, #2a1f18, #1a120e);
  --floor: linear-gradient(180deg, rgba(255, 228, 184, 0.35) 0 2px, transparent 2px), url('/tex/teak.webp') 0 0 / 512px, #7d4a24;
}

[data-cat='film'] {
  --room:
    repeating-linear-gradient(90deg, #5c0f18 0 7px, #8f1d2c 11px, #5c0f18 18px) left top / 16% 100% no-repeat,
    repeating-linear-gradient(90deg, #5c0f18 0 7px, #8f1d2c 11px, #5c0f18 18px) right top / 16% 100% no-repeat,
    radial-gradient(60% 70% at 50% 30%, #3a1216, #120506 80%);
  --floor: linear-gradient(180deg, #4a0b14, #2a0609);
}

[data-cat='games'] {
  --room:
    repeating-linear-gradient(180deg, transparent 0 7px, #34125a 7px 10px) 50% 46% / 104px 34px no-repeat,
    radial-gradient(circle 50px at 50% 66%, #ffd23f 0%, #ff9a3d 45%, #ff3d7f 98%, transparent 100%),
    linear-gradient(180deg, #160b3a 0%, #3b1260 66%);
  --floor:
    repeating-linear-gradient(90deg, rgba(184, 77, 255, 0.6) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(180deg, rgba(184, 77, 255, 0.6) 0 1px, transparent 1px 12px),
    #120a2b;
}

[data-cat='anime'] {
  --room:
    radial-gradient(circle at 70% 28%, #fff8e6 0 18px, rgba(255, 248, 230, 0.15) 19px 32px, transparent 33px),
    linear-gradient(180deg, #0f1233 0%, #2a2160 60%, #6b3f7c 100%);
  --floor: linear-gradient(180deg, #1a1740, #121430);
}

[data-cat='food'] {
  --room: linear-gradient(180deg, #bfe8dc, #cdeee4);
  --floor: linear-gradient(180deg, #e8ebec 0 8%, #d6283a 8% 100%);
  --room-ink: #2a6f66;
}

[data-cat='countries'] {
  --room:
    repeating-linear-gradient(90deg, rgba(47, 93, 124, 0.14) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(180deg, rgba(47, 93, 124, 0.14) 0 1px, transparent 1px 34px),
    url('/tex/paper.webp') 0 0 / 384px,
    #ead9b4;
  --floor: linear-gradient(180deg, #8a6a40, #6a4e2c);
  --room-ink: #4a3a28;
}

[data-cat='landmarks'] {
  --room:
    radial-gradient(circle at 50% 78%, #fff1c2 0 26px, rgba(255, 241, 194, 0.3) 27px 40px, transparent 41px),
    linear-gradient(180deg, #ffb48a 0%, #ff9a8b 45%, #e58fb9 80%, #a98bd6 100%);
  --floor: repeating-linear-gradient(135deg, #d62839 0 10px, #fff8f2 10px 16px, #2f5aa8 16px 26px, #fff8f2 26px 32px);
  --room-ink: #2d2240;
}

[data-cat='other'] {
  --room:
    radial-gradient(40% 80% at 50% 0%, rgba(255, 246, 225, 0.95), transparent 80%),
    #e6e1d8;
  --floor: linear-gradient(180deg, #cfc6b8, #b9ae9c);
  --room-ink: #4a453e;
}

[data-cat='books'] {
  --room:
    radial-gradient(70% 60% at 50% 0, rgba(255, 178, 96, 0.26), transparent 72%),
    linear-gradient(180deg, #1c2745, #121a30);
  --floor: linear-gradient(180deg, rgba(255, 230, 186, 0.35) 0 2px, transparent 2px), url('/tex/walnut.webp') 0 0 / 512px, #3d2314;
}

[data-cat='characters'] {
  --room: radial-gradient(46% 60% at 50% 62%, rgba(255, 45, 85, 0.34), rgba(161, 43, 217, 0.12) 55%, transparent 75%), #0b0b0f;
  --floor: linear-gradient(180deg, #1c1c1e, #0b0b0f);
}

[data-cat='people'] {
  --room: radial-gradient(60% 70% at 50% 0, rgba(255, 246, 230, 0.2), transparent 70%), linear-gradient(180deg, #2a1dcb, #1c1391);
  --floor: linear-gradient(180deg, #14105a, #0e0b40);
}

[data-cat='stuff'] {
  --room: radial-gradient(70% 60% at 50% 0, rgba(255, 255, 255, 0.16), transparent 70%), linear-gradient(180deg, #10261f, #0c1d18);
  --floor: linear-gradient(180deg, #5d6a70, #3f4a50);
}

@media (max-width: 560px) {
  .lobby-rooms {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .room-tile {
    animation: none;
  }
}
/* The list header belongs to both panels and stays outside their scroll areas. */
:root[data-theme] .editor { grid-template-rows: var(--topbar-h) auto minmax(0, 1fr); }
:root[data-theme] .editor > .editor-heading { flex: none; min-width: 0; gap: 18px; padding: 12px 28px 18px; }
:root[data-theme] .editor > .ed-main { grid-row: 3; }
:root[data-theme] .editor .room-identity { flex: 1; }
:root[data-theme] .editor-heading h1 { min-width: 0; overflow-wrap: anywhere; }
.room-title { display: block; max-width: 100%; padding: 0; border: 0; border-radius: 4px; color: inherit; background: none; font: inherit; letter-spacing: inherit; text-align: start; overflow-wrap: anywhere; cursor: pointer; }
/* a long title never eats the board: two lines at most (one on a short screen); the full title is in its name and tip */
.room-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
@media (max-height: 500px) { .room-title { -webkit-line-clamp: 1; line-clamp: 1; } }
.room-title:hover { color: var(--ink-2); }
.room-title:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 5px; }
:root[data-theme] .editor-heading .title-input { width: 100%; max-width: 100%; font: inherit; }
:root[data-theme] .editor-heading .room-actions { flex-wrap: wrap; justify-content: flex-end; }
:root[data-theme] .editor-heading .header-finish { min-height: 44px; white-space: nowrap; }
:root[data-theme] .editor-heading .header-finish[hidden] { display: none; }
:root[data-theme] .editor .touch-tabs { margin-top: 4px; }
:root[data-theme] .editor > .ed-main > .board { padding-top: 6px; }
:root[data-theme='aurora'] .editor { grid-template-rows: auto minmax(0, 1fr); }
:root[data-theme='aurora'] .editor > .editor-heading { grid-row: 1; padding-top: calc(var(--topbar-h) + 20px); }
:root[data-theme='aurora'] .editor > .ed-main { grid-row: 2; }
:root[data-theme='aurora'] .editor > .ed-main > .cart { margin-top: 0; }
@media (max-width: 820px) {
  :root[data-theme] .editor > .editor-heading { flex-direction: column; align-items: stretch; gap: 12px; padding-inline: 20px; padding-bottom: 12px; }
  :root[data-theme] .editor-heading .room-actions { justify-content: space-between; gap: 8px; }
  :root[data-theme] .editor-heading .view-switch button { padding-inline: 12px; }
  :root[data-theme] .editor-heading .header-finish { padding-inline: 14px; }
  :root[data-theme] .ed-top .tb-right > .btn:has(kbd) { display: none; }
  :root[data-theme] .editor .ed-top .tb-group { display: flex; }
}
@media (max-width: 390px) {
  :root[data-theme] .editor-heading .view-switch button { padding-inline: 10px; }
}

/* A conflicting draft stays on screen until its owner chooses a version. */
:root[data-theme] .editor[data-save-conflict='true'] {
  grid-template-rows: var(--topbar-h) auto auto minmax(0, 1fr);
}
:root[data-theme] .editor[data-save-conflict='true'] > .ed-main { grid-row: 4; }
/* The look of a notice that stays until it is dealt with: the conflict above, and the guest's ".notice-bar" below. */
:root[data-theme] .editor > .save-status[data-state='conflict'],
:root[data-theme] .notice-bar {
  display: flex;
  position: static;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 8px 20px 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--bg-2);
  color: var(--ink-2);
  font: 500 13px/1.45 var(--font-ui);
  white-space: normal;
}
.save-conflict-actions,
.notice-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.save-conflict-actions > .btn,
.notice-actions > .btn { min-height: 44px; white-space: normal; text-decoration: none; }
:root[data-theme='aurora'] .editor[data-save-conflict='true'] { grid-template-rows: auto auto minmax(0, 1fr); }
:root[data-theme='aurora'] .editor[data-save-conflict='true'] > .save-status { margin-top: calc(var(--topbar-h) + 8px); grid-row: 1; }
:root[data-theme='aurora'] .editor[data-save-conflict='true'] > .editor-heading { grid-row: 2; padding-top: 12px; }
:root[data-theme='aurora'] .editor[data-save-conflict='true'] > .ed-main { grid-row: 3; }
@media (max-width: 820px) {
  :root[data-theme] .editor > .save-status[data-state='conflict'],
  :root[data-theme] .notice-bar { margin-inline: 12px; padding: 12px; }
  .save-conflict-actions,
  .notice-actions { width: 100%; }
  .save-conflict-actions > .btn,
  .notice-actions > .btn { flex: 1 1 180px; }
}

/* The guest's notice stands before the page, on every view, and the page takes the rest of the height. It is the
   same element for the whole visit: views replace what is inside #app, never this. */
body:has(> .guest-notice) { display: flex; flex-direction: column; }
body:has(> .guest-notice) > #app { flex: 1 1 0; height: auto; min-height: 0; }
.guest-notice { flex: none; z-index: 2; }
.notice-bar > p { margin: 0; flex: 1 1 320px; min-width: 0; }
.notice-actions > .btn { height: auto; padding-block: 8px; }
/* Aurora floats its bars as glass pills: the notice is a glass card in the same family */
:root[data-theme='aurora'] .notice-bar {
  margin: var(--gap) var(--gap) 0;
  border-radius: var(--r-3);
  border-color: var(--line-2);
  background: var(--glass-float);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  color: var(--ink-2);
}
@media (max-width: 820px) {
  :root[data-theme='aurora'] .notice-bar { margin: 8px 8px 0; }
}
/* Follow every theme and phone shorthand so the page always has breathing room. */
:root[data-theme] .notice-bar.guest-notice { margin-bottom: 8px; }
/* On a phone the notice stays compact: the words on top, then the sign-up link and Export side by side, at the start,
   as the small pills they are on a desktop. The 44px touch height is the buttons' own min-height, not their look. */
@media (max-width: 600px) {
  :root[data-theme] .notice-bar.guest-notice,
  :root[data-theme='aurora'] .notice-bar.guest-notice { padding: 8px 12px; gap: 4px 8px; }
  .guest-notice > p { flex: 1 1 100%; font-size: 13px; line-height: 1.4; }
  .guest-notice .notice-actions { width: auto; max-width: 100%; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 0 8px; }
  .guest-notice .notice-actions > .btn { flex: 0 0 auto; min-height: 44px; padding-inline: 14px; font-size: 13.5px; }
}
