/* /: the hero band and the category shelves.
   Hero: the online pulse with the discovery strip under it, the latest
   Origins story as a poster, and the Updates stream, in one box. Then one
   shelf per category: the category button, its count and an "All N" link
   on a title strip, and the category's first five rares in a row inside
   the box, each on the viewer's iso floor at its saved placement. The
   pulse, poster and tone rules come from home-beta.css. Below 820px the
   hero stacks and every shelf scrolls sideways. */

/* —— Hero —— */
.home-hero {
  display: grid;
  grid-template-columns: 19rem minmax(0, 1fr) 15rem;
  margin: 0 0 1rem;
  padding: 0;
  overflow: hidden;
}

.home-hero > * {
  min-width: 0;
  padding: 0.8rem 0.9rem;
}

.home-hero > * + * {
  border-left: 1px solid var(--content-box-border);
}

.home-hero-news {
  padding: 0.6rem;
}

/* The poster fills whatever height the other two columns set. */
.home-hero .home-beta-news {
  height: 100%;
  margin: 0;
}

.home-hero .home-beta-news-feature {
  display: flex;
  height: 100%;
}

.home-hero .home-beta-news-media {
  flex: 1 1 auto;
  aspect-ratio: auto;
  min-height: 11rem;
}

/* —— Lobby (lib/home_lobby.php): the online pill with the hotel split, then
   three room shelves, one per list. Each shelf is a strip of wall with the
   list's name plate and a strip of floor with five rares as furni, a value
   plaque at each one's feet and the name on hover. Plates and the hover
   name are dark in both themes, like the site header. —— */
.home-lobby {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.home-lobby-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}

.home-lobby-online {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  height: 1.4rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--success) 40%, transparent);
  background: color-mix(in srgb, var(--success) 12%, transparent);
  color: var(--success);
  font-size: 0.72rem;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.home-lobby-online::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.home-lobby-online b {
  font-weight: 700;
}

.home-lobby-online:hover,
.home-lobby-online:focus-visible {
  border-color: var(--success);
  text-decoration: none;
}

.home-lobby-online:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.home-lobby-hotels {
  display: flex;
  gap: 0.45rem;
  min-width: 0;
  overflow: hidden;
  font-size: 0.6rem;
  line-height: 1;
  color: var(--muted);
  white-space: nowrap;
}

.home-lobby-hotel {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-style: normal;
}

.home-lobby-hotel::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
}

.home-lobby-hotel--es::before {
  background: #e0a73a;
}

.home-lobby-hotel--br::before {
  background: #4fb3bf;
}

.home-lobby-hotel em {
  font-style: normal;
  color: var(--fg);
}

.home-lobby-shelves {
  display: grid;
  gap: 0.35rem;
}

.home-lobby-shelf {
  --home-lobby-line: color-mix(in srgb, var(--fg) 14%, transparent);
  position: relative;
  min-width: 0;
  border-radius: 6px;
  border: 1px solid var(--control-border);
  background-color: var(--stage-floor);
  background-image:
    linear-gradient(26.57deg, transparent 49.4%, var(--home-lobby-line) 49.4% 50.6%, transparent 50.6%),
    linear-gradient(-26.57deg, transparent 49.4%, var(--home-lobby-line) 49.4% 50.6%, transparent 50.6%);
  background-size: 32px 16px, 32px 16px;
  overflow: hidden;
}

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

.home-lobby-wall {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  height: 20px;
  padding: 0 0.4rem;
  background: color-mix(in srgb, var(--fg) 7%, var(--control-bg));
  border-bottom: 2px solid rgba(0, 0, 0, 0.28);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.1);
}

.home-lobby-plate {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  height: 14px;
  margin: 0;
  padding: 0 0.4rem;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: #1e242c;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  color: #e8eef4;
  font-size: 0.56rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: none;
  white-space: nowrap;
}

.home-lobby-live {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 5px var(--success);
}

.home-lobby-live[hidden] {
  display: none;
}

.home-lobby-more {
  flex: 0 0 auto;
  font-size: 0.56rem;
  line-height: 1;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.home-lobby-more:hover,
.home-lobby-more:focus-visible {
  color: var(--fg);
  text-decoration: none;
}

.home-lobby-more:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.home-lobby-floor {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
  padding: 0.35rem 0.15rem 0.3rem;
  list-style: none;
}

.home-lobby-stand {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.home-lobby-furni {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  border-radius: 4px;
  color: var(--fg);
  text-decoration: none;
}

.home-lobby-furni:hover,
.home-lobby-furni:focus-visible {
  text-decoration: none;
}

.home-lobby-furni:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.home-lobby-icon {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.3));
}

.home-lobby-icon--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--surface-inset);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  filter: none;
}

.home-lobby-furni:hover .home-lobby-icon,
.home-lobby-furni:focus-visible .home-lobby-icon {
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.3)) drop-shadow(0 0 3px color-mix(in srgb, var(--accent) 90%, transparent));
}

.home-lobby-plaque {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  max-width: 100%;
  margin-top: -3px;
  padding: 0 3px;
  border-radius: 3px;
  border: 1px solid var(--control-border);
  background: var(--content-box-bg, var(--surface-inset));
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  color: var(--warn);
  font-size: 0.56rem;
  line-height: 1.6;
  white-space: nowrap;
}

.home-lobby-plaque .currency-icon {
  width: 9px;
  height: 9px;
}

.home-lobby-plaque--none {
  color: var(--muted);
}

/* The name, above the furni on hover or focus. Edge stands pin it to the
   shelf's side so a long name is not cut by the shelf's overflow. */
.home-lobby-tip {
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: #1e242c;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 0.62rem;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.home-lobby-tip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  margin-left: -5px;
  border: 5px solid transparent;
  border-top-color: #1e242c;
  border-bottom: 0;
}

.home-lobby-stand:first-child .home-lobby-tip {
  left: 0;
  transform: none;
}

.home-lobby-stand:first-child .home-lobby-tip::after {
  left: 18px;
}

.home-lobby-stand:last-child .home-lobby-tip {
  left: auto;
  right: 0;
  transform: none;
}

.home-lobby-stand:last-child .home-lobby-tip::after {
  left: auto;
  right: 13px;
}

.home-lobby-furni:hover .home-lobby-tip,
.home-lobby-furni:focus-visible .home-lobby-tip {
  opacity: 1;
  visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
  .home-lobby-tip {
    transition: none;
  }
}

/* Updates: a timeline of valuation moves under day headings, filling the
   column, with a seven-day up/down strip pinned to its foot. The heading
   and the live marker are deliberately quiet (13px regular, muted). The
   list clips what does not fit, with a short fade at the cut. */
/* The column must not set the hero's height (the lobby and the news do),
   so the stream is taken out of flow and fills whatever height they leave. */
.home-hero-updates {
  position: relative;
  min-height: 0;
}

.home-hero .home-update-stream {
  position: absolute;
  inset: 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: 0;
}

.home-hero .home-update-stream-head {
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.home-hero .home-update-stream-head h2 {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--fg);
  text-shadow: none;
}

.home-hero .home-update-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 0.5625rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

.home-hero .home-update-live::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 3px;
  background: var(--success);
}

.home-hero .home-update-stream-list {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 0;
  min-height: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 14px), transparent);
  mask-image: linear-gradient(180deg, #000 calc(100% - 14px), transparent);
}

.home-hero .home-update-day {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  height: 18px;
  margin-top: 4px;
  font-size: 0.625rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.home-hero .home-update-day:first-child {
  margin-top: 0;
}

.home-hero .home-update-day-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--muted);
}

.home-hero .home-update-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 4px 0 12px;
  margin: 0 -4px 0 2px;
  border-left: 1px solid var(--content-box-border);
  border-radius: 0 6px 6px 0;
  color: var(--fg);
}

.home-hero .home-update-row:hover,
.home-hero .home-update-row:focus-visible {
  background: color-mix(in srgb, var(--fg) 5%, transparent);
}

.home-hero .home-update-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.home-hero .home-update-icon img {
  max-width: 22px;
  max-height: 22px;
  width: auto;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.home-hero .home-update-icon .home-live-clicks-fallback {
  width: 22px;
  height: 22px;
  font-size: 0.55rem;
}

.home-hero .home-update-name {
  min-width: 0;
  font-size: 0.8125rem;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-hero .home-update-name strong {
  font-weight: 400;
  color: var(--fg);
}

.home-hero .home-update-now {
  font-size: 0.625rem;
  color: var(--muted);
}

.home-hero .home-update-delta {
  font-size: 0.6875rem;
  white-space: nowrap;
}

.home-hero .home-update-delta.is-down,
.home-hero .home-update-week-copy .is-down {
  color: var(--danger);
}

.home-hero .home-update-delta.is-up,
.home-hero .home-update-week-copy .is-up {
  color: var(--success);
}

.home-hero .home-update-delta.is-sug {
  color: var(--muted);
}

.home-hero .home-update-empty {
  font-size: 0.76rem;
}

.home-hero .home-update-week {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  gap: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--content-box-border);
}

.home-hero .home-update-week-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: color-mix(in srgb, var(--fg) 8%, transparent);
}

.home-hero .home-update-week-bar .is-up {
  background: var(--success);
}

.home-hero .home-update-week-bar .is-down {
  background: var(--danger);
}

.home-hero .home-update-week-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  font-size: 0.625rem;
  color: var(--muted);
}

.home-hero .home-update-week-copy a {
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.home-hero .home-update-week-copy a:hover {
  text-decoration: underline;
}

/* —— Shelves —— */
.home-shelf {
  padding: 0;
  overflow: hidden;
}

.home-shelf + .home-shelf {
  margin-top: 0.8rem;
}

.home-shelf-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.45rem 0.7rem 0.45rem 0.55rem;
  background: var(--field-bg);
  border-bottom: 1px solid var(--content-box-border);
}

.home-shelf-head .rares-category-head-btn {
  height: 1.7rem;
  min-height: 1.7rem;
  padding: 0 0.7rem;
}

.home-shelf-head .rares-category-count {
  min-width: 0;
}

.home-shelf-all {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.home-shelf-all:hover,
.home-shelf-all:focus-visible {
  color: var(--fg);
  text-decoration: none;
}

/* Five tiles share the box: dividers between them, no card chrome. */
.rare-grid.home-shelf-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
}

.home-shelf-row .rare-tile {
  gap: 0.4rem;
  padding: 0.6rem 0.6rem 0.65rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.home-shelf-row .rare-tile + .rare-tile {
  border-left: 1px solid var(--content-box-border);
}

/* The highlight is instant and the tile does not move, as on /rares/. A
   card tile's hover (habbend.css) fades its colours, lifts 2px and grows a
   5px drop shadow over 150ms. In a shelf that put a hard shadow under a
   flat cell, animated box-shadow (which repaints past the tile's own
   layer), and ran on two tiles at once while the cursor crossed the row:
   a drag across five tiles was 204 repaints and 118 frames (traced). */
.home-shelf-row .rare-tile {
  transition: none;
}

.home-shelf-row .rare-tile:hover {
  background: var(--surface-raised);
  transform: none;
  box-shadow: none;
}

.home-shelf-row .rare-tile:active {
  transform: none;
  box-shadow: none;
}

/* On a pointer device every tile keeps the compositor layer habbend.css
   gives it, so the highlight repaints that one layer. The transform must
   be the same in every state: toggling it relays the tile out. */
@media (hover: hover) and (pointer: fine) {
  .home-shelf-row .rare-tile,
  .home-shelf-row .rare-tile:hover,
  .home-shelf-row .rare-tile:active {
    transform: translateZ(0);
  }
}

/* The stage: a framed floor instead of the square thumb, tall enough for
   the viewer's 128px cap at native pixels. */
.home-shelf-row .rare-thumb {
  aspect-ratio: auto;
  height: 8.5rem;
  border: 1px solid var(--content-box-border);
  border-radius: 6px;
}

/* Plain-image fallback only: the viewer-seated sprite below keeps its
   own size, or a tall render gets squashed to the cap. */
.rares-catalog.home-shelf-row .rare-thumb-image:not(.rare-thumb-grid) {
  padding: 0.4rem;
}

.rares-catalog.home-shelf-row .rare-thumb-image:not(.rare-thumb-grid) img {
  max-width: 80px;
  max-height: 100px;
}

.rares-catalog.home-shelf-row .rare-tile h3 {
  font-size: 0.84rem;
}

.rares-catalog.home-shelf-row .rare-tile .rare-meta {
  align-items: flex-start;
  margin-top: 0;
  padding: 0;
  border-top: 0;
}

.home-shelf-row .rare-meta > .muted {
  display: inline-flex;
  align-items: center;
  min-height: 1.5rem;
  font-size: 0.74rem;
}

/* —— Stacked: the hero in one column, each shelf a sideways scroll —— */
@media (max-width: 819px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-hero > * + * {
    border-left: 0;
    border-top: 1px solid var(--content-box-border);
  }

  .home-hero .home-beta-news-media {
    aspect-ratio: 16 / 9;
    min-height: 0;
  }

  .rare-grid.rares-catalog.home-shelf-row {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .home-shelf-row .rare-tile {
    flex: 0 0 9.5rem;
    scroll-snap-align: start;
  }

  .rares-catalog.home-shelf-row .rare-thumb {
    height: 8.5rem;
    max-height: none;
  }
}
