/* Hero rotator. Sits inside #viewRoot's column rather than bleeding to the
   window edges, with a radius close to the video thumbnails below it — it is a
   card at the top of a page of cards.

   2.5:1 is a compromise between sources that disagree: three slides are
   natively 3:1 and the fourth is about 2.34:1 with content pinned against both
   its top and bottom edges. Every derivative is cropped to this ratio by
   assets-src/hero/build.sh, so object-fit never has to rescue a bad fit. */
.home-hero { margin-bottom: 4px; }
.home-hero__track {
  position: relative;
  aspect-ratio: 5 / 2;
  border-radius: 14px;
  overflow: hidden;
  background: var(--app-tile);
}
.home-hero__slide {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  transition: opacity .4s ease;
}
.home-hero__slide.is-active { opacity: 1; }
.home-hero__slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* The big CTA, centred near the bottom of the banner. It is a sibling of the
   slides rather than a child of one, because every slide is already an <a>.
   z-index keeps it above them no matter what order home-hero.js appends in.

   It always goes to HQ, including while the combat slide — which links to
   monster_map — is showing. That is deliberate: the button is the front door
   and should not change destination under someone mid-reach. */
.home-hero__play {
  position: absolute;
  left: 50%;
  bottom: 6%;
  transform: translateX(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 30px;
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  color: #fff;
  background: #1b5fd9;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 999px;
  /* The banner art underneath is busy and bright, so the button needs a hard
     edge and a drop shadow to separate from it rather than tint over it. */
  box-shadow: 0 6px 22px rgba(0, 0, 0, .45);
}
.home-hero__play:hover { filter: brightness(1.1); }
.home-hero__play:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.home-hero__play-icon { font-size: 15px; }

/* Buttons are 24px for the tap target; the visible pill is the pseudo-element. */
.home-hero__dots { display: flex; justify-content: center; gap: 4px; padding: 8px 0 0; }
.home-hero__dot {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  padding: 0; border: 0; background: none; cursor: pointer;
}
.home-hero__dot::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 999px;
  background: #d0d0d6;
  transition: width .2s ease, background .2s ease;
}
.home-hero__dot:hover::before { background: #b0b0b8; }
.home-hero__dot[aria-current="true"]::before { width: 20px; background: var(--app-fg); }

@media (max-width: 700px) {
  /* 1.8:1 rather than 2.5:1: on a 351px-wide phone that is a 195px banner
     instead of a 140px strip. The extra crop is horizontal and centered. */
  .home-hero__track { aspect-ratio: 9 / 5; border-radius: 10px; }
  /* 44px keeps the tap target at the platform minimum even though the banner
     is only 195px tall here. */
  .home-hero__play {
    height: 44px;
    padding: 0 20px;
    font-size: 15px;
    gap: 8px;
    border-width: 1.5px;
  }
  .home-hero__play-icon { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-hero__slide { transition: none; }
  .home-hero__dot::before { transition: none; }
}

/* Home: the video grid is the page. Shorts rail high, maps band deliberately small. */
.video-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px 16px;
  margin-bottom: 4px;
}
@media (max-width: 1500px) { .video-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1180px) { .video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px)  { .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .video-grid { grid-template-columns: 1fr; } }

/* Shorts filter: the same grid, but every cell is a 9:16 card. */
.video-grid--shorts {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
@media (max-width: 560px) {
  .video-grid--shorts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The card is a container, not a link: the thumbnail/title link and the creator
   link are siblings inside it, because an <a> inside an <a> is invalid HTML. */
.video-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  color: inherit;
}
.video-card__main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.video-card__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: var(--app-tile);
}
.video-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-card__main:hover .video-card__thumb { outline: 2px solid var(--app-accent); outline-offset: 2px; }
.video-card__dur,
.video-card__live {
  position: absolute;
  right: 7px; bottom: 7px;
  background: rgba(0, 0, 0, .82);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
}
.video-card__live { left: 7px; right: auto; background: #e0203a; display: flex; align-items: center; gap: 5px; }
.video-card__dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.video-card__title {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.32;
  margin-top: 7px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-card__sub { font-size: 13px; color: var(--app-dim); }

/* NEW badge: opposite corner from the duration, so the two never collide.
   Green because that is the app accent — the same colour "Play here" uses. */
.video-card__new {
  position: absolute;
  left: 7px; top: 7px;
  background: var(--app-accent);
  color: #06210f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 2px 7px;
  border-radius: 999px;
}

/* Creator row: small circular avatar, name beside it, its own link. */
.video-card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  column-gap: 8px;
  row-gap: 1px;
  margin-top: 4px;
}
.video-card__creator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  text-decoration: none;
  color: inherit;
}
.video-card__avatar {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--app-tile);
  color: var(--app-dim);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  user-select: none;
}
.video-card__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-card__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Only the anchor form is a link, so the <span> fallback for a video with no
   userId gets no hover affordance and no pointer. */
a.video-card__creator { cursor: pointer; }
a.video-card__creator:hover .video-card__name { color: var(--app-fg); text-decoration: underline; }
a.video-card__creator:hover .video-card__avatar { outline: 2px solid var(--app-accent); outline-offset: 1px; }

/* Shorts: 9:16, horizontal scroll, high on the page. */
.shorts-shelf[hidden] { display: none; }
.shorts-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 182px;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 8px;
  scrollbar-width: thin;
}
.short-card { text-decoration: none; color: inherit; scroll-snap-align: start; cursor: pointer; }
.short-card__thumb {
  /* Positioned so the NEW badge inside it has something to anchor to. */
  position: relative;
  display: block;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  overflow: hidden;
  background: var(--app-tile);
}
.short-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.short-card:hover .short-card__thumb { outline: 2px solid var(--app-accent); outline-offset: 2px; }
.short-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  margin-top: 7px;
  line-height: 1.3;
}
@media (max-width: 560px) { .shorts-rail { grid-auto-columns: 148px; } }

/* Maps: one small band, never a shelf. Two cards maximum. */
.maps-band[hidden] { display: none; }
.maps-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 260px));
  gap: 16px;
}
@media (max-width: 560px) { .maps-row { grid-template-columns: 1fr; } }
.map-card { text-decoration: none; color: inherit; cursor: pointer; }
.map-card__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: var(--app-tile);
  border: 1px solid var(--app-line);
}
.map-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.map-card__play {
  position: absolute;
  left: 8px; bottom: 8px;
  background: var(--app-accent);
  color: #06210f;
  font-size: 12.5px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 999px;
}
.map-card:hover .map-card__thumb { outline: 2px solid var(--app-accent); outline-offset: 2px; }
.map-card__title { display: block; font-size: 14px; font-weight: 600; margin-top: 7px; }
.maps-note { color: var(--app-dim); font-size: 12.5px; margin: 8px 0 0; }

/* Topic chip on a video card. The card itself is an <a>, so this is a <button>
   that stops the click — the same shape shareButton() already uses. */
.video-card__topic {
  align-self: flex-start;
  margin-top: 6px;
  max-width: 100%;
  padding: 3px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  color: #0a6a72;
  background: rgba(22, 200, 210, .12);
  border: 1px solid rgba(22, 200, 210, .28);
  border-radius: 999px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-card__topic:hover {
  background: rgba(22, 200, 210, .24);
  border-color: rgba(22, 200, 210, .5);
}
/* The up-next rail is a tight horizontal card; a topic chip there is noise. */
.up-next .video-card__topic { display: none; }
