/* ============================================
   SIDE-QUESTS POLISH (side-quests.html only; loads after side-quests.css)
   A. the top section: wheel + photo as one centred, scaled pair; phone label and music button
   B. the lore highlight
   C. On Repeat: form and grid edges, the list fade
   E. Playlists I made
   (the page's container, curtain reveal and game styling are shared: css/layout-tokens.css, css/games.css)
============================================ */

/* ---------- A. top section, 900px and up ----------
   --su is one scale for the whole group, worked out from the viewport's width AND height (1 at 1512x860, capped at the
   1920x950 size; see the small script in the head of the page). Everything below is the 1512x860 layout times --su. */
@media (min-width: 900px) {
  .sqw-pin { min-height: min(100svh, calc(860px * var(--su, 1))); }   /* stops growing with the screen; the content stays centred in it */
  .sqw-grid {
    --S: calc(511px * var(--su, 1));          /* the wheel */
    --P: calc(348px * var(--su, 1));          /* the photo card (3:4) */
    --gap: calc(106px * var(--su, 1));        /* wheel to photo */
    --G: calc(100px * var(--su, 1));          /* SIDE to the group, and the group to QUESTS: the same on both sides */
    --vis: calc(24.6px * var(--su, 1));         /* the wheel's pictures start this far inside its box */
    grid-template-columns: var(--S) var(--P);
    column-gap: var(--gap);
    justify-content: center;
    left: calc(var(--vis) / -2);              /* centres what you actually see: from the wheel's left to the photo's right */
  }
  .sqw-left { justify-self: start; }
  .sqw-stage { width: var(--S); }
  .sqw-detail { width: var(--P); justify-self: start; }
  .sqw-photo { width: min(calc(464px * var(--su, 1) * var(--ar)), calc(464px * var(--su, 1))); }
  .sqw-name { font-size: calc(32px * var(--su, 1)); }
  .sqw-side { font-size: calc(57.6px * var(--su, 1)); }
  .sqw-side--l { right: calc(100% - var(--vis) + var(--G)); left: auto; }
  .sqw-photo-wrap > .sqw-side--photo { left: calc(100% + var(--G)); transform: translateY(-50%); }
}

/* ---------- A. phones and stacked layouts: the picture's name sits under the picture ---------- */
@media (max-width: 899px) {
  .sqw-name { order: -1; }   /* the picture's name sits between the wheel and the picture */
}

/* ---------- B. the lore highlight wraps cleanly ---------- */
.sq2-story-kicker { text-wrap: balance; line-height: 1.7; }
.sq2-story-kicker mark {
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;      /* each wrapped line gets its own full highlight, never a stray bit */
}

/* ---------- C. On Repeat ---------- */
/* the suggestion box is exactly as wide as the cards below it, edge to edge */
.rot-suggest { max-width: none; width: 100%; margin-left: 0; margin-right: 0; }
.rot-suggest-row { grid-template-columns: minmax(0, 1.5fr) minmax(190px, 1fr) auto; }
@media (max-width: 720px) { .rot-suggest-row { grid-template-columns: 1fr; } .rot-submit { width: 100%; } }
/* two equal columns */
@media (min-width: 960px) { .rot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* the song list fades out at the bottom while there is more to scroll to */
.rot-list.is-scrollable:not(.is-end) {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 56px), transparent);
}

/* ---------- E. Playlists I made ---------- */
.sq2-playlists { background: #fff; padding: 0 0 clamp(64px, 9vw, 100px); overflow-x: clip; }
.pl-row {
  list-style: none;
  margin: clamp(32px, 5vw, 52px) 0 0;
  padding: 10px 0 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));      /* laptops and PCs: one straight row */
  gap: 24px;
}
@media (max-width: 1099px) { .pl-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }          /* tablets: 2 x 2 */
@media (max-width: 639px) {                                                                            /* phones: a swipeable row, the next card peeking */
  .pl-row {
    display: flex; gap: 16px;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: 24px;
    margin-inline: -24px; padding-inline: 24px;
    scrollbar-width: none;
  }
  .pl-row::-webkit-scrollbar { display: none; }
  .pl-item { flex: 0 0 min(72vw, 290px); scroll-snap-align: start; }
}
.pl-item { position: relative; min-width: 0; display: flex; }
.pl-item:hover, .pl-item:focus-within { z-index: 3; }
.pl-item--yellow { --accent: var(--sq-yellow); }
.pl-item--coral  { --accent: var(--sq-coral); }
.pl-item--lime   { --accent: var(--sq-lime); }
.pl-item--violet { --accent: var(--sq-violet); --ink: #fff; }

/* (the site's general rule for links that open in a new tab adds an arrow and an inline layout: not for these cards) */
a.pl-card[target="_blank"]::after { content: none; display: none; }
a.pl-card[target="_blank"] { display: flex; }
.pl-card {
  --ink: var(--navy);
  --e1: color-mix(in srgb, var(--accent) 60%, #fff);          /* the 3D layer: lighter sides ... */
  --e2: color-mix(in srgb, var(--accent) 72%, var(--navy));   /* ... and a deeper outer edge, the same on all four sides */
  position: relative;
  display: flex; flex-direction: column; align-items: stretch; gap: 14px;
  flex: 1 1 auto; width: 100%; min-width: 0;
  padding: 16px 16px 18px;
  border-radius: var(--card-radius, 20px);
  background: var(--accent);
  color: var(--pl-ink, var(--navy));
  text-decoration: none;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.5),
    0 0 0 1px var(--e1), 0 0 0 2px var(--e1), 0 0 0 3px var(--e2),
    0 16px 26px -8px rgba(12, 0, 84, 0.3);
  transition: transform 0.35s cubic-bezier(0.2, 1.2, 0.4, 1), box-shadow 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
.pl-item--violet .pl-card { --pl-ink: #fff; }
.pl-card:focus-visible { outline: 3px solid var(--blue); outline-offset: 7px; }

/* the sleeve: the cover on top, a vinyl record tucked behind it */
.pl-sleeve { position: relative; flex: none; width: 100%; aspect-ratio: 1; }
.pl-cover {
  position: absolute; inset: 0; z-index: 2;
  display: block; overflow: hidden;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 45%, #fff);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.75), 0 10px 20px -8px rgba(12, 0, 84, 0.5);
}
.pl-cover img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.pl-cover img[hidden] { display: none; }
.pl-cover.no-art::after { content: "\266B"; position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(2.4rem, 6vw, 4rem); color: rgba(12, 0, 84, 0.45); }
.pl-vinyl {
  position: absolute; z-index: 1;
  top: 4%; left: 3%; width: 92%; aspect-ratio: 1;
  border-radius: 50%;
  background:
    conic-gradient(from 20deg, rgba(255, 255, 255, 0.2), transparent 22%, rgba(255, 255, 255, 0.14) 48%, transparent 72%, rgba(255, 255, 255, 0.2)),
    radial-gradient(circle, #fff 0 2.5%, var(--accent) 3% 17%, #14141f 17.5% 19%, transparent 19.5%),
    repeating-radial-gradient(circle, #0b0b13 0 2px, #1c1c2b 2px 3px);
  box-shadow: 0 6px 14px -4px rgba(0, 0, 0, 0.45);
  translate: 0 0;
  transition: translate 0.55s cubic-bezier(0.2, 1.1, 0.35, 1);
}
.pl-name {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  height: 2.12em; min-height: 2.12em; align-self: stretch; text-align: left;
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.15rem, 1.55vw, 1.5rem); line-height: 1.06;
  overflow-wrap: anywhere;
}
.pl-pill {
  align-self: flex-start; margin-top: auto;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: var(--navy); color: #fff;
  font-size: 0.8rem; font-weight: 600; line-height: 1;
}
.pl-spot { width: 22px; height: 22px; flex: none; display: block; }

/* hover (mouse): the card lifts, the record slides half way out to the right and turns slowly */
@media (hover: hover) {
  .pl-card:hover, .pl-card:focus-visible { transform: translateY(-6px); }
  .pl-card:hover .pl-vinyl, .pl-card:focus-visible .pl-vinyl { translate: 46% 0; animation: pl-spin 3.4s linear infinite; }
}
@keyframes pl-spin { to { rotate: 360deg; } }
/* touch: no hover, so the record just peeks out, still */
@media (hover: none) { .pl-vinyl { translate: 16% 0; } }
@media (prefers-reduced-motion: reduce) {
  .pl-card, .pl-vinyl { transition: none; }
  .pl-card:hover, .pl-card:focus-visible { transform: none; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7), 0 0 0 1px var(--e1), 0 0 0 2px var(--blue), 0 0 0 3px var(--blue), 0 16px 26px -8px rgba(0, 82, 255, 0.4); }
  .pl-card:hover .pl-vinyl, .pl-card:focus-visible .pl-vinyl { translate: 0 0; animation: none; }
  .pl-vinyl { translate: 0 0 !important; }
}

/* while the names and covers load */
.pl-card.is-loading .pl-cover { background: linear-gradient(100deg, rgba(255, 255, 255, 0.35) 30%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 0.35) 70%) 0 0 / 300% 100%; animation: pl-shimmer 1.3s linear infinite; }
.pl-card.is-loading .pl-name { color: transparent; border-radius: 8px; background: linear-gradient(100deg, rgba(255, 255, 255, 0.3) 30%, rgba(255, 255, 255, 0.65) 50%, rgba(255, 255, 255, 0.3) 70%) 0 0 / 300% 100%; animation: pl-shimmer 1.3s linear infinite; }
@keyframes pl-shimmer { to { background-position: -150% 0; } }
@media (prefers-reduced-motion: reduce) { .pl-card.is-loading .pl-cover, .pl-card.is-loading .pl-name { animation: none; } }

/* the music button pops in with a small bounce shortly after the page loads (the same as on the other pages) */
@keyframes sqFabPop { 0% { scale: 0; opacity: 0; } 55% { scale: 1.22; opacity: 1; } 78% { scale: 0.92; } 100% { scale: 1; opacity: 1; } }
body > .sq2-music { animation: sqFabPop 0.7s 0.7s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
@media (prefers-reduced-motion: reduce) { body > .sq2-music { animation: none; } }

/* ---------- phones: more air between the wheel and the picture card ---------- */
@media (max-width: 899px) { .sqw-grid { row-gap: 34px; } }
