/* Home content banners (js/lobbyBanners.js) and the Quest popup
   (js/lobbyQuests.js), GAME_SPEC §4.13. Real elements with ids and shared
   classes / data-ui-style for the UI layer tool (web-ui-style.md §6); no
   pseudo-elements, no forced priority on visual properties. Layout (grid,
   sizes) is kept apart from the look (colours, borders, shadows). */

/* ---------- Banner: layout ---------- */
.home-banner {
  position: relative;
  min-width: 0;
}

/* Arrows and dots sit inside the banner's lower right corner (under the
   picture), so they take no extra row on short phones. */
.home-banner-controls {
  position: absolute;
  z-index: 2;
  right: 8px;
  bottom: 6px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.home-banner-viewport {
  min-width: 0;
  overflow: hidden;
  /* Vertical drags scroll the page; horizontal drags move the banner. */
  touch-action: pan-y;
}

.home-banner-track {
  display: flex;
  transition: transform 280ms ease;
}

.home-banner-track.no-motion {
  transition: none;
}

.home-banner-slide {
  position: relative;
  flex: 0 0 100%;
  min-width: 0;
  height: clamp(132px, 21vh, 210px);
  overflow: hidden;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  padding: 10px 12px;
  user-select: none;
}

.home-banner-bg,
.home-banner-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.home-banner-bg {
  object-fit: cover;
  pointer-events: none;
}

.home-banner-art {
  position: absolute;
  right: 4%;
  bottom: 34px;
  height: calc(100% - 44px);
  max-width: 38%;
  object-fit: contain;
  pointer-events: none;
}

.home-banner-copy {
  position: relative;
  z-index: 1;
  width: 62%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.home-banner-title,
.home-banner-body {
  margin: 0;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

/* Japanese and Chinese have no spaces: break between characters (keep-all
   would push a single kana or the full stop onto its own line — zh 390 body
   ended in "。" alone). */
.home-banner-title:lang(ja),
.home-banner-body:lang(ja),
.home-banner-title:lang(zh),
.home-banner-body:lang(zh) {
  word-break: normal;
  line-break: strict;
}

.home-banner-dots {
  display: flex;
  justify-content: center;
  gap: 2px;
}

/* ---------- Banner: look ---------- */
.home-banner-viewport {
  border: 2px solid #e5bd6e;
  border-radius: 16px;
  box-shadow: 0 0 0 2px #ffebba, 0 0 0 4px #e5bd6e;
}

.home-banner-shade {
  background: linear-gradient(90deg, rgba(255, 250, 235, 0.94) 0%, rgba(255, 250, 235, 0.86) 52%, rgba(255, 250, 235, 0) 78%);
}

.home-banner-art {
  filter: drop-shadow(0 3px 4px rgba(60, 30, 0, 0.35));
}

.home-banner-controls {
  padding: 2px 4px;
  border-radius: 999px;
  background: rgba(255, 250, 235, 0.88);
  box-shadow: 0 1px 3px rgba(60, 30, 0, 0.3);
}

.home-banner-title {
  color: #fff;
  font-size: clamp(15px, 2.4vh, 22px);
  line-height: 1.15;
}

.home-banner-body {
  color: #683716;
  font-size: clamp(11px, 1.75vh, 15px);
  font-weight: 700;
  line-height: 1.3;
}

.home-banner-cta {
  min-height: 36px;
  margin-top: 2px;
  padding: 4px 14px;
  border: 3px solid #ffc421;
  border-radius: 12px;
  background: linear-gradient(#1686ff, #0053c5);
  color: #fff;
  font: inherit;
  font-size: clamp(13px, 1.9vh, 16px);
  font-weight: 800;
  text-shadow: var(--bp-text-outline);
  -webkit-text-stroke: var(--bp-text-stroke);
  paint-order: stroke fill;
  box-shadow: inset 0 2px 0 #fff8, 0 3px 0 #713b00;
  cursor: pointer;
}

.home-banner-slide[data-banner="daily-workout"][data-state="done"] .home-banner-cta {
  background: linear-gradient(#7eea18, #20b900);
}

.home-banner-arrow {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 3px;
  border: 2px solid #ffc421;
  border-radius: 50%;
  background: linear-gradient(#1686ff, #0053c5);
  color: #fff;
  font: inherit;
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 2px 0 #fff8, 0 2px 0 #713b00;
  cursor: pointer;
}

.home-banner-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.home-banner-dot {
  width: 24px;
  height: 24px;
  padding: 7px;
  border: 0;
  border-radius: 50%;
  background: #d9c79c;
  background-clip: content-box;
  cursor: pointer;
}

.home-banner-dot[aria-current="true"] {
  background-color: #f39a00;
}

.home-banner-cta:focus-visible,
.home-banner-arrow:focus-visible,
.home-banner-dot:focus-visible {
  outline: 3px solid #0053c5;
  outline-offset: 2px;
}

/* ---------- Quest button (lobby sub-actions) ---------- */
.hybrid-sub-button .notification-badge--alert {
  top: -8px;
  right: -6px;
}

/* ---------- Quest popup: layout ---------- */
.popup-card--quest {
  max-width: 440px;
  max-height: calc(100vh - 32px - var(--popup-safe-y));
  max-height: calc(100dvh - 32px - var(--popup-safe-y));
  gap: 10px;
}

.quest-list {
  min-height: 0;
  flex: 1 1 auto;
  margin: 0;
  padding: 2px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  text-align: left;
}

.quest-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 8px 10px;
}

.quest-row-icon {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.quest-row-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quest-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.quest-row-title,
.quest-row-desc {
  margin: 0;
  min-width: 0;
}

.quest-row-status {
  flex: 0 0 auto;
  white-space: nowrap;
}

.quest-row-progress {
  height: 10px;
  overflow: hidden;
}

.quest-row-progress-fill {
  display: block;
  height: 100%;
}

.quest-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.quest-row-action {
  flex: 1 1 auto;
  min-height: 38px;
  padding: 4px 12px;
}

/* ---------- Quest popup: look ---------- */
.quest-row {
  border: 2px solid #e5bd6e;
  border-radius: 14px;
  background: #fffaf0;
  box-shadow: inset 0 2px 0 #fff, inset 0 -2px 0 #e2c48a;
}

.quest-row[data-state="done"] {
  border-color: #8fd16a;
  background: #f2fbe8;
}

.quest-row-title {
  color: #633517;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
}

.quest-row-desc {
  color: #7a4a22;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.quest-row-status {
  padding: 2px 8px;
  border-radius: 999px;
  background: #1686ff;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  text-shadow: var(--bp-text-outline);
  -webkit-text-stroke: var(--bp-text-stroke);
  paint-order: stroke fill;
}

.quest-row-status[data-state="done"],
.quest-row-status[data-state="ready"],
.quest-row-status[data-state="stamped"] {
  background: #20b900;
}

.quest-row-status[data-state="short"] {
  background: #e0641c;
}

.quest-row-status[data-state="locked"],
.quest-row-status[data-state="none"] {
  background: #9a7442;
}

.quest-row-progress {
  border-radius: 999px;
  background: #e8dcc0;
}

.quest-row-progress-fill {
  border-radius: inherit;
  background: linear-gradient(#7eea18, #20b900);
}

.quest-row-count {
  color: #633517;
  font-size: 12px;
  font-weight: 800;
}

.quest-row-action {
  font-size: 14px;
}

@media (max-width: 360px) {
  .home-banner-copy {
    width: 66%;
  }

  .home-banner-art {
    max-width: 30%;
  }

  /* Narrow phones: smaller arrows, dots and button so the button and the
     controls never meet. These win over the short-screen sizes below. */
  .home-banner .home-banner-title {
    font-size: 14px;
  }

  .home-banner .home-banner-cta {
    padding: 2px 8px;
    font-size: 12px;
  }

  .home-banner .home-banner-arrow {
    width: 24px;
    height: 24px;
    font-size: 17px;
  }

  .home-banner .home-banner-dot {
    width: 18px;
    height: 18px;
    padding: 5px;
  }

  .home-banner-controls {
    right: 6px;
  }
}

/* A two-line title, three-line body and the button must fit the 116px slide
   (fr/id at 320x640 overflowed by 6px): tighter padding, gaps and button. */
@media (max-height: 640px) {
  .home-banner-slide {
    height: 116px;
    padding: 4px 10px;
  }

  .home-banner-copy {
    gap: 2px;
  }

  .home-banner-title {
    font-size: 15px;
  }

  .home-banner-body {
    font-size: 11px;
  }

  .home-banner-cta {
    min-height: 28px;
    margin-top: 0;
    padding: 2px 10px;
    font-size: 13px;
  }

  .home-banner-arrow {
    width: 26px;
    height: 26px;
    font-size: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-banner-track {
    transition: none;
  }
}
