/* ==========================================================================
   Fantascript public pages - public/css/site.css
   Loaded AFTER /css/fs/tokens.css and /css/fs/components.css on:
     - /scripts  (views/scripts.ejs, <body class="fs fs-site">)
     - /admin/login (views/login.ejs, <body class="fs fs-auth">)
   components.css owns the shared components (design-spec section 18 +
   login); this file adds the library's own layout: the two-device hero
   visual, the Android mod cards and the per-group grids.
   Owner rule: no eyebrow / kicker labels or status pills above a heading.
   ========================================================================== */

/* ---- Header: Library + Discord stay visible at every width ---------------- */
.fs .site-nav__links { display: flex; align-items: center; }
.fs .site-nav__links a { display: inline-flex; align-items: center; gap: 7px; }
.fs .site-nav__links .icon { width: 17px; height: 17px; }

/* ---- Hero ------------------------------------------------------------------ */
.fs .hero__title { max-width: none; }
.fs .hero__lead { max-width: 30em; }

/* Decorative visual (aria-hidden): a PC game window running a Roblox script
   menu, with a phone running an Android mod menu in front of it. */
.fs .hero__visual { padding: 18px 12px 8px; }
.fs .hv {
  position: relative;
  width: 100%;
  max-width: 540px;
  padding: 0 0 96px 156px;
  container-type: inline-size;
  container-name: hv;
}
.fs .hv .fanta-menu { max-width: none; }
.fs .hv .fanta-menu__body { grid-template-columns: 112px minmax(0, 1fr); min-height: 0; }
.fs .hv .fanta-menu__tabs { padding-bottom: 14px; }
.fs .hv .fanta-menu__panel { grid-template-columns: minmax(0, 1fr); padding: 14px 14px 18px; }
.fs .fanta-menu__bar b { font-weight: var(--fs-w-bold); }
.fs .fanta-menu__game { overflow: hidden; min-width: 0; text-overflow: ellipsis; white-space: nowrap; }

.fs .hv__phone {
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 1;
  width: 172px;
  height: 318px;
  padding: 7px;
  border-radius: 30px;
  background: linear-gradient(160deg, #33465f, #1a2331 60%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 0 1px rgba(148, 178, 230, 0.22),
    0 44px 80px -26px rgba(0, 0, 0, 0.95);
  animation: site-float 7s var(--fs-ease-in-out) infinite;
}
.fs .hv__screen {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  padding: 10px 10px 12px;
  overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(130% 60% at 50% 0%, var(--hue-soft, rgba(91, 156, 255, 0.16)), transparent 70%),
    radial-gradient(90% 50% at 80% 100%, rgba(91, 156, 255, 0.16), transparent 70%),
    repeating-linear-gradient(135deg, rgba(148, 178, 230, 0.035) 0 10px, transparent 10px 20px),
    #121a27;
}
.fs .hv__status { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; color: var(--fs-text-2); font-size: 10px; }
.fs .hv__status b { font-weight: var(--fs-w-semibold); }
.fs .hv__status span { display: flex; gap: 3px; }
.fs .hv__status i { width: 5px; height: 5px; border-radius: 50%; background: var(--fs-text-3); }
.fs .hv__mod {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(148, 178, 230, 0.18);
  border-radius: 14px;
  background: rgba(31, 42, 58, 0.94);
  box-shadow: 0 18px 36px -16px rgba(0, 0, 0, 0.9);
}
.fs .hv__mod-bar { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 0 2px 2px; font-size: 11.5px; }
.fs .hv__mod-bar .brand__mark { width: 20px; height: 20px; border-radius: 6px; }
.fs .hv__mod-bar .brand__mark .icon { width: 12px; height: 12px; }
.fs .hv__mod-bar b { font-weight: var(--fs-w-bold); }
.fs .hv__mod-bar span:last-child { overflow: hidden; min-width: 0; color: var(--hue-text, var(--fs-text-3)); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.fs .hv__mod .fm-row { gap: 6px; height: 30px; padding: 0 7px 0 9px; border-radius: 8px; font-size: 10.5px; }
.fs .hv__mod .fm-switch { width: 26px; height: 15px; }
.fs .hv__mod .fm-switch i { top: 2px; left: 2px; width: 11px; height: 11px; }
.fs .hv__mod .fm-switch.is-on i { left: 13px; }
.fs .hv__fab { position: absolute; right: 12px; bottom: 14px; width: 36px; height: 36px; border-radius: 50%; }
.fs .hv__fab .icon { width: 17px; height: 17px; }

/* Narrow visual column (960-1199 px desktop): icon-only tabs and a smaller
   phone, so the menu rows keep their room. Measured on the content box of
   .hv, i.e. the window width. */
@container hv (max-width: 329.98px) {
  .fs .hv .fanta-menu__body { grid-template-columns: 52px minmax(0, 1fr); }
  .fs .hv .fanta-menu__tab { justify-content: center; padding: 0; }
  .fs .hv .fanta-menu__tab > span { display: none; }
  .fs .hv__phone { left: 22px; width: 148px; height: 282px; border-radius: 26px; }
  .fs .hv__screen { border-radius: 21px; }
  .fs .hv .fm-slider { width: 52px; }
}

@keyframes site-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ---- Library: groups ------------------------------------------------------ */
.fs .lib__head { margin-bottom: 8px; }
.fs .lib-group { padding-top: 22px; }
.fs .lib-group + .lib-group { padding-top: 40px; }
.fs .lib-group__title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  color: var(--fs-text);
  font-size: var(--fs-size-18);
  font-weight: var(--fs-w-bold);
  letter-spacing: -0.012em;
}
.fs .lib-group__title .icon { width: 18px; height: 18px; color: var(--fs-text-3); }

/* Roblox: 3 per row on desktop, 2 below (components.css keeps 2 on phones). */
.fs .script-grid--roblox { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Android: 2 per row on desktop and tablets, 1 on phones. */
.fs .script-grid--mods { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---- Library: cards (shared) ---------------------------------------------- */
/* Feature chips: long feature names stay on one line and ellipsize. */
.fs .script-card__feats li { max-width: 100%; min-width: 0; }
.fs .script-card__feats li:not(.is-more) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 22px; }
.fs .script-card__title { overflow-wrap: anywhere; }

/* ---- Library: Android mod cards ------------------------------------------ */
/* Same card as Roblox, with a wider media band (2 per row) that shows the
   uploaded image whole (contain) over a blurred copy of itself, so a square
   icon and a landscape screenshot both look intended. */
/* Android mod image fills the media band edge-to-edge, exactly like the admin
   "/scripts card" preview (full-bleed cover), rather than a small centred icon. */
.fs .mod-card__media { aspect-ratio: 16 / 10; }
.fs .mod-card__shot {
  position: absolute;
  inset: 0;
  z-index: -2;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 0;
  object-fit: cover;
  box-shadow: none;
}
/* The blurred backdrop copy is redundant once the image fills the band. */
.fs .script-card--mod .script-card__bg { display: none; }
.fs .mod-card__media--empty {
  background:
    radial-gradient(300px 160px at 50% 42%, var(--hue-soft, rgba(91, 156, 255, 0.2)), transparent 72%),
    repeating-linear-gradient(135deg, rgba(148, 178, 230, 0.04) 0 12px, transparent 12px 24px),
    #172131;
}
.fs .mod-card__fallback { color: var(--hue-text, var(--fs-accent-text)); box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.1), 0 0 36px -10px var(--hue, var(--fs-accent)); }
.fs .mod-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
  color: var(--fs-text-3);
  font-size: var(--fs-size-12);
}
.fs .mod-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px 0 7px;
  border: 1px solid var(--fs-line-subtle);
  border-radius: var(--fs-r-full);
  background: rgba(148, 178, 230, 0.06);
  color: var(--fs-text-2);
  font-weight: var(--fs-w-medium);
}
.fs .mod-chip .icon { width: 13px; height: 13px; color: var(--fs-success); stroke-width: 2.2; }
.fs .mod-card__info { overflow: hidden; min-width: 0; text-overflow: ellipsis; white-space: nowrap; }
.fs .script-card--mod .script-card__desc { -webkit-line-clamp: 3; }
.fs .mod-card__dl { flex: 1; }
.fs .mod-card__dl[aria-disabled="true"] { cursor: default; }

/* Empty library (no entries at all) */
.fs .lib__none {
  margin-top: 14px;
  border: 1px dashed var(--fs-line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)), var(--fs-surface);
}
.fs .lib__empty p a { font-weight: var(--fs-w-semibold); }

/* Bottom breathing room when there is no Discord band */
.fs .site-spacer { height: 56px; }

/* ---- Library: dialogs ---------------------------------------------------- */
.fs .feat-list li > span { min-width: 0; overflow-wrap: anywhere; }
.fs .feat-list li > .icon { flex: none; }
.fs .feat-head img { object-fit: cover; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12); }
.fs .video-open { flex: none; margin-top: -4px; }
.fs .dialog__head .dialog__title { line-height: 1.35; }

@media (max-width: 959.98px) {
  .fs .script-grid--roblox { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fs .hero__visual { padding-top: 8px; }
}

@media (max-width: 639.98px) {
  .fs .site-nav__links { gap: 0; margin-left: auto; }
  .fs .site-nav__lib { display: none !important; }
  .fs .site-nav__links .site-nav__discord { justify-content: center; width: 44px; height: 44px; padding: 0; }
  .fs .site-nav__cta { margin-left: 0; }
  .fs .hero__title { font-size: 40px; line-height: 1.06; }
  .fs .lib-group { padding-top: 18px; }
  .fs .lib-group + .lib-group { padding-top: 30px; }
  .fs .lib-group__title { margin-bottom: 12px; font-size: var(--fs-size-16); }

  /* Android cards: one per row on phones, full feature chips and a labelled
     Download button (the Roblox cards keep their compact 2-up layout). */
  .fs .script-grid--mods { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .fs .script-card--mod .script-card__body { gap: 6px; padding: 12px 14px 2px; }
  .fs .script-card--mod .script-card__title { font-size: var(--fs-size-16); }
  .fs .script-card--mod .script-card__desc { font-size: 13.5px; }
  .fs .script-card--mod .script-card__feats { display: flex; }
  .fs .script-card--mod .script-card__actions { gap: 6px; padding: 12px 14px 14px; }
  .fs .script-card--mod .script-card__actions > * { flex: 0 0 auto; width: var(--btn-h); }
  .fs .script-card--mod .script-card__actions > .mod-card__dl { flex: 1 1 auto; width: auto; padding: 0 14px; }
  .fs .mod-card__fallback { width: 64px; height: 64px; border-radius: 17px; }
  .fs .mod-card__fallback .icon { width: 28px; height: 28px; }

  .fs .site-spacer { height: 32px; }
  .fs .video-open__label { display: none; }
  /* Toasts sit under the 60 px phone nav */
  .fs.fs-site .toast-region { top: 68px; right: 16px; left: 16px; width: auto; }
}

/* ---- Login (/admin/login) -------------------------------------------------- */
.fs .auth__head { display: flex; align-items: flex-start; gap: 14px; }
.fs .auth__head .auth__sub { margin-top: 4px; }
.fs .auth__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--fs-accent-soft);
  box-shadow: inset 0 0 0 1px var(--fs-accent-line), 0 0 28px -8px var(--fs-accent);
  color: var(--fs-accent);
}
.fs .auth__card { box-shadow: var(--fs-sheen), var(--fs-shadow-lg); }
.fs .auth__reveal .i-hide { display: none; }
.fs .auth__reveal[aria-pressed="true"] .i-show { display: none; }
.fs .auth__reveal[aria-pressed="true"] .i-hide { display: inline-block; }
.fs .auth__back {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 6px;
  min-height: 32px;
  color: var(--fs-text-3);
  font-size: var(--fs-size-13);
  text-decoration: none;
}
.fs .auth__back:hover { color: var(--fs-text); }

@media (prefers-reduced-motion: reduce) {
  .fs .hv__phone { animation: none; }
}

/* ---- Fixes (2026-11-29) --------------------------------------------------- */
/* 1. A very long feature name must ellipsize inside the card, never clip past
   its right edge. In the flex-wrap row the pill has to be allowed to shrink. */
.fs .script-card__feats { min-width: 0; max-width: 100%; }
.fs .script-card__feats li:not(.is-more) {
  flex: 0 1 auto;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 2. Roblox thumbnails stay a clean square whatever the source image ratio. */
.fs .script-card__icon { aspect-ratio: 1 / 1; object-fit: cover; }

/* 3. On phones the feature + video dialogs open centred (like desktop), not as
   a bottom sheet, so the YouTube embed sits in the middle of the screen. */
@media (max-width: 639.98px) {
  .fs #video-dialog,
  .fs #features-dialog {
    margin: auto;
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 32px);
    border-width: 1px;
    border-radius: var(--fs-r-2xl);
  }
  .fs #video-dialog[open],
  .fs #features-dialog[open] { animation: fs-dialog-in var(--fs-dur-3) var(--fs-ease-out); }
}

/* ---- Fixes (2026-11-29, r2) ----------------------------------------------- */
/* Bigger ROBLOX game thumbnails (desktop + mobile) with a taller media band.
   Scoped to :not(.script-card--mod) so the Android mod cards keep their own
   wider media band and their own action row (they were clipping/stretching). */
.fs .script-card:not(.script-card--mod) .script-card__media { aspect-ratio: 16 / 10; }
.fs .script-card:not(.script-card--mod) .script-card__icon,
.fs .script-card:not(.script-card--mod) .script-card__fallback { width: 150px; height: 150px; border-radius: 30px; }
.fs .script-card:not(.script-card--mod) .script-card__fallback .icon { width: 56px; height: 56px; }

@media (max-width: 639.98px) {
  .fs .script-card:not(.script-card--mod) .script-card__media { aspect-ratio: 3 / 2; }
  .fs .script-card:not(.script-card--mod) .script-card__icon,
  .fs .script-card:not(.script-card--mod) .script-card__fallback { width: 94px; height: 94px; border-radius: 22px; }
  .fs .script-card:not(.script-card--mod) .script-card__fallback .icon { width: 40px; height: 40px; }
  /* Roblox action buttons fill the row evenly but stay square 1:1. */
  /* Fixed-size action buttons (sized so 4 fill the row), CENTRED — so a card
     with 3 buttons has the same button size as one with 4 and sits centred
     rather than left-aligned with an empty gap. */
  .fs .script-card:not(.script-card--mod) .script-card__actions {
    display: flex;
    justify-content: center;
    gap: 6px;
  }
  .fs .script-card:not(.script-card--mod) .script-card__actions > * {
    flex: 0 0 auto;
    width: calc((100% - 18px) / 4);
    height: auto;
    aspect-ratio: 1 / 1;
    min-width: 0;
    padding: 0;
  }
}

/* ---- Android mod cards (2026-11-29, r3) ----------------------------------- */
/* Centre the uploaded app image in its band, and keep the Download button the
   same height as the icon buttons beside it (no oversized block). */
.fs .mod-card__shot { margin: auto; justify-self: center; align-self: center; }
.fs .mod-card__dl { height: var(--btn-h); min-height: var(--btn-h); }
