/**
 * Y888 Rewrite — Site Header + Hero Slider
 * Fresh, hand-written CSS for <site-header> and <hero-slider>.
 *
 * Reference values measured from the production build; every rule below is
 * written from scratch. All colors, spacing, radii, fonts and timings come
 * from css/tokens.css (--y888-*). No hashed class names, no compiled output.
 *
 * Sections:
 *   1. Site header — download banner
 *   2. Site header — header bar (menu toggle, logo, auth buttons)
 *   3. Hero slider — viewport, track, slides
 *   4. Hero slider — pagination dots
 *   5. Hero slider — interaction states
 *   6. Reduced motion
 *   7. Responsive notes
 */

/* ============================================================
 * 1. SITE HEADER — download banner (top strip)
 * ========================================================== */

.site-header {
  display: block;
  width: 100%;
  font-family: var(--y888-font-family);
  background: var(--y888-bg);
}

/* Custom element must be block-level for width to apply */
site-header {
  display: block;
  width: 100%;
}

/* Top promo strip: dark band with close X, promo image, CTA button */
.site-header .download-banner {
  display: flex;
  align-items: center;
  width: 100%;
  height: 0.6rem;
  padding-right: var(--y888-space-md);
  background: #181718;
  overflow: hidden;
}

.site-header .download-banner[hidden] {
  display: none;
}

.site-header .download-banner__close {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  padding: 0 var(--y888-space-lg);
  font-size: var(--y888-font-size-sm);
  line-height: 1;
  color: var(--y888-primary);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.site-header .download-banner__close:hover {
  opacity: 0.8;
}

.site-header .download-banner__close:focus-visible {
  outline: 2px solid var(--y888-primary);
  outline-offset: -2px;
}

.site-header .download-banner__content {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  min-width: 0;
}

.site-header .download-banner__image {
  display: block;
  max-width: 100%;
  max-height: 0.5rem;
  object-fit: contain;
}

.site-header .download-banner__cta {
  flex-shrink: 0;
  padding: 0.08rem 0.2rem;
  font-size: var(--y888-font-size-xs);
  font-weight: var(--y888-font-weight);
  line-height: 1.4;
  color: var(--y888-text);
  background: var(--y888-primary);
  border: 0;
  border-radius: var(--y888-radius-sm);
  white-space: nowrap;
  cursor: pointer;
}

.site-header .download-banner__cta:hover {
  filter: brightness(1.08);
}

.site-header .download-banner__cta:active {
  filter: brightness(0.94);
}

.site-header .download-banner__cta:focus-visible {
  outline: 2px solid var(--y888-text);
  outline-offset: 2px;
}

/* ============================================================
 * 2. SITE HEADER — header bar
 * ========================================================== */

.site-header .header-bar {
  display: flex;
  align-items: center;
  width: 100%;
  height: 0.9rem;
  padding-right: var(--y888-space-md);
  background: var(--y888-bg);
  border-bottom: 0.01rem solid var(--y888-border);
}

.site-header .header-bar__left,
.site-header .header-bar__right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-header .header-bar__center {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

/* Hamburger / menu toggle */
.site-header .menu-toggle {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: var(--y888-space-sm);
  font-size: var(--y888-font-size-md);
  color: var(--y888-text-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.site-header .menu-toggle:hover {
  color: var(--y888-text);
}

.site-header .menu-toggle:focus-visible {
  outline: 2px solid var(--y888-primary);
  outline-offset: 2px;
  border-radius: var(--y888-radius-sm);
}

/* Brand logo */
.site-header .site-logo {
  display: block;
  max-width: 2.3rem;
  max-height: 0.6rem;
  object-fit: contain;
}

/* ---- auth buttons ---- */

.site-header .auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.36rem;
  height: 0.52rem;
  padding: 0 var(--y888-space-xs);
  font-size: var(--y888-font-size-sm);
  font-weight: var(--y888-font-weight);
  white-space: nowrap;
  border-radius: var(--y888-radius-md);
  cursor: pointer;
  transition: filter var(--y888-transition-fast);
}

.site-header .auth-btn--login {
  margin-right: 0.15rem;
  color: var(--y888-text);
  background: var(--y888-primary);
  border: thin solid var(--y888-primary);
}

.site-header .auth-btn--register {
  color: var(--y888-primary);
  background: transparent;
  border: thin solid var(--y888-primary);
}

.site-header .auth-btn:hover {
  filter: brightness(1.08);
}

.site-header .auth-btn:active {
  filter: brightness(0.94);
}

.site-header .auth-btn:focus-visible {
  outline: 2px solid var(--y888-text);
  outline-offset: 2px;
}

/* Register promo badge pinned above the register button */
.site-header .register-wrap {
  position: relative;
  display: inline-flex;
}

.site-header .register-badge {
  position: absolute;
  top: -0.2rem;
  right: 0;
  z-index: 1;
  max-width: 1rem;
  padding: 0 0.08rem;
  font-size: var(--y888-font-size-xs);
  line-height: 0.3rem;
  color: var(--y888-text);
  background: var(--y888-success);
  border-radius: var(--y888-radius-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* ============================================================
 * 3. HERO SLIDER — viewport, track, slides
 * ========================================================== */

.hero-slider {
  position: relative;
  display: block;
  width: calc(100% - var(--y888-space-md) * 2);
  height: 2.1rem;
  margin: 0 var(--y888-space-md);
  border-radius: 0.16rem;
  overflow: hidden;
  background-color: var(--y888-bg-card);
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
}

.hero-slider:focus-visible {
  outline: 2px solid var(--y888-primary);
  outline-offset: 2px;
}

/* Sliding track — translated via inline transform by the component */
.hero-slider__track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform var(--y888-transition-slow);
  will-change: transform;
}

/* Instant jump (used when wrapping around) */
.hero-slider__track--no-transition {
  transition: none;
}

.hero-slider__slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.hero-slider__slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* ============================================================
 * 4. HERO SLIDER — pagination dots
 * ========================================================== */

.hero-slider__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.04rem;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.06rem;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}

.hero-slider__dot {
  width: 0.1rem;
  height: 0.1rem;
  padding: 0;
  border: 0;
  border-radius: 0.06rem;
  background-color: var(--y888-text);
  opacity: 0.5;
  cursor: pointer;
  pointer-events: auto;
  transition: opacity var(--y888-transition-fast);
}

.hero-slider__dot:hover {
  opacity: 0.8;
}

.hero-slider__dot--active {
  opacity: 1;
}

.hero-slider__dot:focus-visible {
  outline: 2px solid var(--y888-primary);
  outline-offset: 2px;
}

/* ============================================================
 * 5. HERO SLIDER — interaction states
 * ========================================================== */

/* Pause auto-play affordance on hover (component handles the logic) */
.hero-slider:hover .hero-slider__track {
  /* transition stays; JS pauses the timer */
}

/* Hide dots when there is only one banner */
.hero-slider__dots:only-child {
  display: none;
}

/* ============================================================
 * 6. REDUCED MOTION
 * ========================================================== */

@media (prefers-reduced-motion: reduce) {
  .hero-slider__track {
    transition: none;
  }

  .hero-slider__dot {
    transition: none;
  }

  .site-header .auth-btn {
    transition: none;
  }

  .site-header .download-banner__cta {
    transition: none;
  }
}

/* ============================================================
 * 7. RESPONSIVE NOTES
 * ========================================================== */

/*
 * The app root sets `font-size: calc(min(100vw, 56.2219vh) / 7.5)`, so every
 * rem value above scales with the letterboxed column:
 *   - 390px phones: full-bleed column, 1rem = 52px
 *   - 1920x1080 desktop: ~607px centered column, 1rem = ~80.96px
 *
 * Header bar (0.9rem) and hero height (2.1rem) therefore keep identical
 * proportions at every viewport with no breakpoints needed.
 *
 * The hero slider keeps its 0.2rem side margins inside the column; the
 * download banner and header bar span the full column width.
 */

/* ============================================================
 * 3. MARKETING BOX — 5 small promo icons row (below hero)
 * ============================================================ */
.marketing-box {
  display: block;
  width: 100%;
  padding: var(--y888-space-sm) var(--y888-space-md);
  background: var(--y888-bg);
}

.marketing-box .y888-scroll,
.marketing-box .lobby-scroll--x {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: var(--y888-space-sm);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.marketing-box .y888-scroll::-webkit-scrollbar,
.marketing-box .lobby-scroll--x::-webkit-scrollbar {
  display: none;
}

.marketing-box .y888-scroll.marketing-box-item,
.marketing-box .lobby-scroll--x.marketing-box-item {
  /* Scroll container: full width flex (not the .96rem item size) */
  display: flex;
  flex-direction: row;
  width: 100%;
  gap: var(--y888-space-sm);
  overflow-x: auto;
  overflow-y: hidden;
}

.marketing-box .y888-scroll > div,
.marketing-box .lobby-scroll--x > div {
  /* Reference: fixed small size (.96rem), not full-width flex */
  flex: 0 0 auto;
  width: 0.96rem;
  min-width: 0.96rem;
}

.marketing-box .marketing-box-item img,
.marketing-box .marketing-bg {
  display: block;
  /* Reference: image .9rem wide */
  width: 0.9rem;
  height: 0.9rem;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: var(--y888-radius-md);
}
