/* ==========================================================================
   GaugePlay /feed — page layer on top of DS v1.0 (tokens · base · components).
   Rules: DS tokens only (no new hues or fonts), 390px first, nothing drawn in
   front of a YouTube player (YouTube RMF) — YouTube cards lay UI *around* the
   player box; only our own play cards use reel-style overlays.
   ========================================================================== */

:root {
  --app-h: 100vh;
  --bar-top: var(--safe-t);      /* where the app bar starts inside the screen */
  --bar-h: 52px;
  --foot-pad: max(14px, var(--safe-b));
  --rail-w: 56px;
}
@supports (height: 100dvh) { :root { --app-h: 100dvh; } }

html, body.feed-body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.feed-body { min-height: 0; background: var(--bg); }

.feed-nav, .feed-intro, .feed-live { display: none; }
.feed-app { height: var(--app-h); }
.feed-stagewrap { height: 100%; display: flex; justify-content: center; }

/* ---------------------------------------------------------------- device */
/* Mobile: the phone frame collapses into a plain full-screen viewport. */
@media (max-width: 1023.98px) {
  .feed-device.gp-phone {
    width: 100%; max-width: 560px; height: var(--app-h);
    aspect-ratio: auto; padding: 0; border-radius: 0;
    background: var(--bg); box-shadow: none;
  }
  .feed-device.gp-phone::before, .feed-device.gp-phone::after { content: none; }
  .feed-device .feed-screen { border-radius: 0; background: var(--bg); }
  .feed-only-desk { display: none; }
}
@media (min-width: 561px) and (max-width: 1023.98px) {
  body.feed-body { background: var(--light-top), var(--tex-grid), var(--bg); }
  .feed-device.gp-phone { border-inline: 1px solid var(--line); }
}

.feed-screen { position: relative; overflow: hidden; background: var(--bg); }

/* ----------------------------------------------------------------- app bar */
.feed-bar {
  position: absolute; z-index: 30; top: 0; left: 0; right: 0;
  height: calc(var(--bar-top) + var(--bar-h));
  padding: var(--bar-top) 12px 0;
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(180deg, rgba(11, 16, 18, .92) 0%, rgba(11, 16, 18, .6) 70%, rgba(11, 16, 18, 0) 100%);
  pointer-events: none;
}
.feed-bar > * { pointer-events: auto; }
/* QA-12: logo link reaches a 44px tap height without changing the bar */
.feed-bar__logo { font-size: 1.0625rem; gap: 7px; min-height: 44px; padding-inline: 2px 6px; margin-left: -2px; }
.feed-nav .gp-logo { min-height: 44px; }
.feed-bar__logo .gp-icon { --icon: 22px; }
.feed-bar__spacer { flex: 1; }
.feed-bar__mode { flex: none; }
@media (max-width: 374px) { .feed-bar__logo span { display: none; } }

.feed-chip {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  height: 44px; padding: 0 12px;
  border-radius: var(--r-pill); border: 1px solid var(--line-2);
  background: var(--glass); color: var(--ink);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-family: var(--font-pixel); font-size: var(--fs-px-1); line-height: 1; letter-spacing: 0;
  transition: border-color var(--dur-fast), box-shadow var(--dur-base);
}
.feed-chip__dot { width: 8px; height: 8px; background: var(--secondary); animation: gp-blink 1.2s steps(1) infinite; }
[data-track-mode="live"] .feed-chip__dot { background: var(--primary); }
.feed-chip__text { width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: 12px; text-align: left; }
.feed-chip__count { font-family: var(--font-num); font-weight: 400; font-size: var(--fs-num-1); color: var(--primary); min-width: 1ch; }
.feed-chip.is-tick { border-color: var(--primary-a60); box-shadow: var(--glow-1); }
.feed-chip.is-tick[data-kind="store"] { border-color: var(--secondary); box-shadow: var(--glow-coral); }
.feed-chip.is-tick[data-kind="store"] .feed-chip__count { color: var(--secondary); }

.feed-iconbtn {
  position: relative; display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: var(--r-4);
  border: 1px solid var(--line-2); background: var(--glass); color: var(--ink);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-instant);
}
.feed-iconbtn:active { transform: scale(.94); }
.feed-iconbtn[aria-pressed="true"] { color: var(--primary); border-color: var(--primary-a60); }
@media (hover: hover) { .feed-iconbtn:hover { border-color: var(--muted); } }
.feed-iconbtn--lg { width: 48px; height: 48px; }
/* First-visit hint: sound starts muted (autoplay rule). One control per screen (D-11): the active
   card's rail "소리" pulses lime until first use (in-app browsers: until the first tap). */
.is-sound-hint .feed-card.is-active .yt-rail__btn[data-act="sound"] {
  color: var(--primary); border-color: var(--primary); background: var(--primary-a08);
  animation: feed-hint 1.4s var(--ease-in-out) infinite;
}
@keyframes feed-hint { 50% { box-shadow: 0 0 0 6px var(--primary-a16); } }

/* ---------------------------------------------------------------- scroller */
.feed-scroller {
  position: absolute; inset: 0; z-index: 1;
  overflow-y: auto; overflow-x: hidden;
  scroll-snap-type: y mandatory; overscroll-behavior-y: contain;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.feed-scroller::-webkit-scrollbar { display: none; }
@media (prefers-reduced-motion: no-preference) { .feed-scroller { scroll-behavior: smooth; } }

.feed-card {
  position: relative; height: 100%; overflow: hidden; isolation: isolate;
  scroll-snap-align: start; scroll-snap-stop: always;
  background: var(--bg);
  container: card / size; /* the horizontal-clip title card adapts to the card's real height */
}
.feed-card:focus-visible { outline: 2px solid var(--focus); outline-offset: -4px; border-radius: var(--r-5); }
.feed-card__inner {
  position: relative; z-index: 1; height: 100%;
  display: flex; flex-direction: column; gap: 10px;
  padding: calc(var(--bar-top) + var(--bar-h) + 2px) 12px var(--foot-pad);
}
.feed-card--loading .feed-card__inner { gap: 14px; justify-content: center; }
.feed-skel-box { flex: 1; max-height: 70%; border-radius: var(--r-4); }

/* Blurred thumbnail behind everything (it sits *behind* the player, never on top) */
.feed-card__backdrop {
  position: absolute; z-index: 0; inset: -12%; width: 124%; height: 124%; max-width: none;
  object-fit: cover; filter: blur(34px) saturate(1.35) brightness(.5);
  opacity: 0; transition: opacity var(--dur-slow) var(--ease-out);
}
.feed-card.is-landscape .feed-card__backdrop { filter: blur(26px) saturate(1.4) brightness(.62); }
.feed-card__backdrop.is-loaded { opacity: 1; }
.feed-card--yt::after, .feed-card--slot::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(11, 16, 18, .7) 0%, rgba(11, 16, 18, .25) 30%, rgba(11, 16, 18, .35) 62%, rgba(11, 16, 18, .94) 100%), var(--tex-grid);
}

/* ------------------------------------------------------------ YouTube card */
.yt-head { display: flex; align-items: center; gap: 8px; min-height: 26px; min-width: 0; }
.yt-head__game { display: flex; align-items: baseline; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; }
.yt-head__game b { font-size: 15px; font-weight: var(--fw-heavy); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; }
.yt-head__game span { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--muted); }

.yt-mid { flex: 1; min-height: 0; display: flex; gap: 8px; align-items: stretch; }
.yt-stage { flex: 1; min-width: 0; min-height: 0; container-type: size; display: grid; place-items: center; }
.yt-box {
  position: relative; overflow: hidden;
  width: min(100cqw, 100cqh * 9 / 16); aspect-ratio: 9 / 16;
  min-width: 200px; min-height: 200px; /* RMF: player viewport >= 200x200 */
  background: var(--void); border-radius: var(--r-4);
  box-shadow: 0 0 0 1px var(--line-2), var(--sh-3);
}
.feed-card.is-active .yt-box { box-shadow: 0 0 0 1px var(--primary-a32), var(--sh-3), 0 0 60px -18px rgba(198, 255, 61, .35); }
.yt-box__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.yt-box > iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 1;
  opacity: 0; transition: opacity var(--dur-slow) var(--ease-out);
}
.feed-card.is-player-ready .yt-box > iframe { opacity: 1; }
/* While a sheet covers the feed the (paused) players are hidden, never overlaid. */
.feed-screen.is-overlay .yt-box > iframe { visibility: hidden; }
.yt-box__fallback {
  position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: 12px;
  padding: 20px; text-align: center; font-size: var(--fs-sm); color: var(--ink-2);
  background: linear-gradient(180deg, rgba(11, 16, 18, .5), rgba(11, 16, 18, .88));
}

/* ---------------------------------------------- horizontal clip (D-02)
   Player pinned under the app bar, then progress + an action row, then the game as a title card
   (kicker · big name · genre tags · big external view count), then the CTA. No dead backdrop.
   Order: head 0 · player 1 · progress 2 · actions 3 · title card 4 · foot 5. */
.yt-head__orient { flex: none; color: var(--ink-2); border-color: var(--line-2); background: var(--on-media); }
.yt-head__orient[hidden] { display: none; }
.yt-info { display: none; }

.feed-card.is-landscape .yt-mid { display: contents; }
.feed-card.is-landscape .yt-stage { order: 1; flex: none; display: block; container-type: inline-size; }
.feed-card.is-landscape .yt-box {
  width: 100%; aspect-ratio: auto; min-width: 200px;
  height: max(200px, calc(100cqw * 9 / 16)); /* RMF: >= 200px tall even on 320px screens */
}
.feed-card.is-landscape .yt-progress { order: 2; margin-top: -4px; }
.feed-card.is-landscape .yt-rail { order: 3; flex: none; flex-direction: row; width: auto; gap: 8px; }
.feed-card.is-landscape .yt-rail__btn {
  flex: 1 1 0; min-width: 0; width: auto; min-height: 44px; padding: 0 8px;
  grid-auto-flow: column; gap: 6px; font-size: var(--fs-xs);
}
.feed-card.is-landscape .yt-rail__btn .gp-icon { --icon: 18px; }
.feed-card.is-landscape .yt-head__game { display: none; } /* the name moves to the title card */

.feed-card.is-landscape .yt-info {
  order: 4; flex: 1; min-height: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
  padding: 4px 2px;
}
.feed-card.is-landscape .yt-foot { order: 5; }
.feed-card.is-landscape .yt-foot__stat { display: none; } /* shown big in the title card */
.feed-card.is-landscape .yt-foot__cta .gp-btn { --btn-h: 56px; }
/* Narrow cards (the desktop phone frame, small phones): the verb goes, the full label stays in aria-label */
@container card (max-width: 379px) { .yt-cta-verb { display: none; } }

.yt-info__kicker { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.yt-info__game {
  font-size: clamp(2rem, 1.2rem + 4.2cqw, 2.75rem); font-weight: var(--fw-heavy);
  line-height: 1.04; letter-spacing: var(--tr-display); color: var(--ink); text-wrap: balance;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.yt-info__tags { display: flex; flex-wrap: wrap; gap: 6px; max-height: 64px; overflow: hidden; }
.yt-tag {
  display: inline-flex; align-items: center; height: 28px; padding: 0 11px;
  font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: 1; white-space: nowrap;
  color: var(--ink-2); background: rgba(11, 16, 18, .55); border: 1px solid var(--line-2); border-radius: var(--r-pill);
}
.yt-tag:first-child { color: var(--primary); border-color: var(--primary-a60); background: var(--primary-a08); }
.yt-info__stat { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; }
.yt-info__num { display: inline-flex; align-items: baseline; gap: 4px; line-height: 1; }
.yt-info__num .gp-num { font-size: var(--fs-num-3); color: var(--ink); text-shadow: 0 0 24px rgba(198, 255, 61, .18); }
.yt-info__num small { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--muted); }
.yt-info__stat .gp-src { flex-basis: 100%; font-size: var(--fs-2xs); }

/* Tall phones: the title card grows instead of leaving air */
@container card (min-height: 800px) {
  .feed-card.is-landscape .yt-info { gap: 14px; }
  .yt-info__game { font-size: clamp(2.25rem, 1.2rem + 6cqw, 3.25rem); }
  .yt-info__num .gp-num { font-size: var(--fs-num-4); }
  .yt-tag { height: 32px; padding: 0 13px; font-size: var(--fs-sm); }
}
/* Short cards (in-app browsers, small phones, the desktop phone frame): drop detail, keep the name */
@container card (max-height: 760px) {
  .yt-info__num .gp-num { font-size: var(--fs-num-2); }
  .yt-info__stat .gp-src { flex-basis: auto; }
}
@container card (max-height: 690px) {
  .feed-card.is-landscape .yt-info__stat { display: none; }
  .feed-card.is-landscape .yt-foot__stat { display: flex; }
  .feed-card.is-landscape .yt-foot__cta .gp-btn { --btn-h: 48px; }
}
@container card (max-height: 600px) {
  .feed-card.is-landscape .yt-info__tags { display: none; }
  .yt-info__game { font-size: 1.75rem; }
}
@container card (max-height: 520px) {
  .feed-card.is-landscape .yt-info { display: none; }
  .feed-card.is-landscape .yt-head__game { display: flex; }
}

.yt-rail { flex: none; width: var(--rail-w); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; }
.yt-rail__btn {
  display: grid; justify-items: center; align-content: center; gap: 4px;
  width: 52px; min-height: 56px; padding: 6px 0;
  border-radius: var(--r-4); border: 1px solid var(--line-2);
  background: rgba(11, 16, 18, .55); color: var(--ink);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-size: var(--fs-2xs); font-weight: var(--fw-bold); line-height: 1; text-decoration: none;
  transition: border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-instant), background-color var(--dur-fast);
}
.yt-rail__btn .gp-icon { --icon: 22px; }
.yt-rail__btn[aria-pressed="true"] { color: var(--primary); border-color: var(--primary-a60); }
.yt-rail__btn:active { transform: scale(.94); }
@media (hover: hover) { .yt-rail__btn:hover { border-color: var(--muted); background: var(--surface-3); } }
.feed-card.is-playing [data-act="toggle"] { color: var(--primary); }

.yt-progress { position: relative; height: 4px; margin-top: -2px; background: repeating-linear-gradient(90deg, var(--line-2) 0 10px, transparent 10px 12px); border-radius: 1px; overflow: hidden; }
.yt-progress::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, var(--primary) 0 10px, transparent 10px 12px);
  clip-path: inset(0 calc((1 - var(--p, 0)) * 100%) 0 0);
  transition: clip-path 250ms linear;
}
.feed-card:not(.is-playing) .yt-progress::after { background: repeating-linear-gradient(90deg, var(--muted) 0 10px, transparent 10px 12px); }

/* minmax(0, 1fr): a nowrap CTA label must never widen the column past the card */
.yt-foot { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; min-width: 0; }
.yt-foot__channel { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--fs-sm); font-weight: var(--fw-heavy); }
/* QA-12: 44px tap height via line-height; negative margins keep the 22px visual line */
.yt-foot__channel a {
  position: relative; z-index: 1; display: inline-block; line-height: 44px; margin-block: -11px; padding-inline: 2px; margin-inline: -2px;
  color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none;
}
.yt-foot__channel a:hover { text-decoration: underline; text-underline-offset: 3px; }
.yt-foot__via { flex: none; font-size: var(--fs-2xs); font-weight: var(--fw-semibold); color: var(--muted); padding: 2px 6px; border: 1px solid var(--line-2); border-radius: var(--r-2); }
.yt-foot__title {
  font-size: var(--fs-sm); line-height: 1.45; font-weight: var(--fw-semibold); letter-spacing: 0; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-wrap: pretty;
}
.yt-foot__stat { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: var(--fs-xs); color: var(--ink-2); }
.yt-foot__stat .gp-src { font-size: var(--fs-2xs); }
.yt-foot__cta { display: flex; gap: 8px; margin-top: 2px; }
.yt-foot__cta .gp-btn { min-width: 0; --btn-px: 16px; }
.yt-foot__cta [data-act="play"] { flex: 1 1 auto; }
.yt-foot__cta [data-act="play"] span { overflow: hidden; text-overflow: ellipsis; }
.yt-foot__cta [data-act="store"] { flex: none; }
.yt-foot__cta .gp-btn--block { flex: 1; }

/* ------------------------------------------------- slot card (?only=play)
   "게임사 쇼츠 자리(예시)": the same frame as a YouTube card, so it reads as "a short goes here",
   drawn as a dashed placeholder outline. The clip is our own recorded gameplay, so (unlike a
   YouTube player) our own controls may sit on it: tap the clip to pause, a glyph shows when held. */
.feed-card--slot .yt-box {
  width: min(100cqw - 16px, (100cqh - 16px) * 9 / 16); /* room for the outline inside the stage */
  outline: 2px dashed var(--primary-a60); outline-offset: 6px;
}
.feed-card--slot.is-active .yt-box { outline-color: var(--primary); }
.slot-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--void); }
.slot-hit {
  position: absolute; inset: 0; z-index: 1; display: grid; place-items: center;
  padding: 0; border: 0; background: transparent; color: var(--ink); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.slot-glyph {
  display: grid; place-items: center; width: 68px; height: 68px; border-radius: var(--r-pill);
  background: rgba(11, 16, 18, .62); border: 1px solid var(--line-2); box-shadow: var(--sh-3);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transform: scale(.86); transition: opacity var(--dur-fast), transform var(--dur-base) var(--ease-pop);
}
.slot-glyph .gp-icon { --icon: 30px; color: var(--primary); }
.feed-card--slot.is-active.is-held:not(.is-playing) .slot-glyph { opacity: 1; transform: none; }
.slot-channel { color: var(--ink); }
.slot-title { color: var(--ink); font-weight: var(--fw-heavy); }
/* Narrow cards (desktop phone frame, small phones): keep the game name and "60초 해보기" whole */
@container card (max-width: 379px) {
  .slot-cta-obj, .feed-card--slot .yt-head__game span { display: none; }
}

/* ------------------------------------------------------------- play card */
.feed-card--play {
  background:
    radial-gradient(120% 55% at 50% 30%, var(--primary-a16), transparent 62%),
    var(--light-bottom), var(--tex-grid), var(--bg);
}
.feed-card--play::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(11, 16, 18, 0) 45%, rgba(11, 16, 18, .9) 82%);
}
.play-art {
  position: absolute; z-index: 0; left: 0; right: 0;
  top: calc(var(--bar-top) + var(--bar-h) + 34px); bottom: 42%;
  display: grid; place-items: center; align-content: center; gap: 18px;
  pointer-events: none;
}
.play-inner { gap: 12px; }
.play-top { display: flex; flex-wrap: wrap; gap: 6px; }
.play-badge-us { color: var(--primary); border-color: var(--primary-a60); }
.play-spacer { flex: 1; }
.play-body { position: relative; display: grid; gap: 10px; }
.play-title { font-size: clamp(2rem, 1.6rem + 2vw, 2.5rem); font-weight: var(--fw-heavy); line-height: 1.05; letter-spacing: var(--tr-display); }
.play-tagline { font-size: .9375rem; line-height: 1.55; color: var(--ink-2); max-width: 36ch; }
.play-sdk { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: var(--fs-xs); color: var(--muted); }
.play-sdk code { font-size: 12px; color: var(--primary); background: var(--primary-a08); border: 1px solid var(--primary-a32); padding: 3px 7px; border-radius: var(--r-2); }
.play-cta { display: flex; gap: 8px; margin-top: 4px; }
.play-cta [data-act="play"] { flex: 1; }
.play-cta .gp-btn--ghost { flex: none; }

/* Game art: pure CSS, tokens only; animates only on the active card */
.play-art .gp-hud, .art__hud { font-family: var(--font-pixel); font-size: var(--fs-px-1); color: var(--primary); letter-spacing: var(--tr-px); display: flex; gap: 10px; align-items: center; }
.art__hud--right { color: var(--secondary); }
.art__combo { font-family: var(--font-pixel); font-size: var(--fs-px-2); color: var(--secondary); text-shadow: 0 0 18px rgba(255, 122, 89, .5); }
.art__hint { font-family: var(--font-pixel); font-size: var(--fs-px-1); color: var(--muted); letter-spacing: var(--tr-px); animation: gp-blink 1.2s steps(1) infinite; }
.feed-card:not(.is-active) .play-art *, .feed-card:not(.is-active) .play-art *::before, .feed-card:not(.is-active) .play-art *::after { animation-play-state: paused; }

.art-gauge {
  position: relative; display: grid; grid-template-columns: repeat(16, 1fr); gap: 4px;
  width: min(84%, 320px); padding: 6px;
  background: var(--bg); border: 2px solid var(--line-2); border-radius: var(--r-2);
  box-shadow: 0 0 40px -10px rgba(198, 255, 61, .35);
}
.art-gauge__cell { height: 56px; background: var(--surface-3); border-radius: 1px; }
.art-gauge__cell.is-zone { background: var(--primary); box-shadow: 0 0 18px var(--primary-a60); }
.art-gauge__sweep { position: absolute; inset: -12px 8px; }
.art-gauge__needle {
  position: absolute; top: 0; bottom: 0; left: 0; width: 5px; margin-left: -2px;
  background: var(--ink); border-radius: 1px; box-shadow: 0 0 14px rgba(245, 247, 245, .7);
  animation: art-needle 1.7s var(--ease-in-out) infinite alternate;
}
@keyframes art-needle { from { left: 0; } to { left: 100%; } }

.art-stack { display: flex; flex-direction: column-reverse; align-items: center; gap: 4px; width: min(70%, 240px); }
.art-stack__block {
  height: 28px; width: calc(var(--w) * 100%); transform: translateX(var(--x));
  background: var(--surface-3); border: 2px solid var(--line-2); border-radius: 2px;
}
.art-stack__block:nth-child(even) { background: var(--primary-a16); border-color: var(--primary-a60); }
.art-stack__block.is-top { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 22px var(--primary-a60); animation: art-slide 1.5s var(--ease-in-out) infinite alternate; }
@keyframes art-slide { from { transform: translateX(-56px); } to { transform: translateX(56px); } }
.art-stack__ground { width: min(78%, 270px); height: 4px; background: repeating-linear-gradient(90deg, var(--line-2) 0 8px, transparent 8px 12px); }

.art-road { position: relative; width: min(78%, 280px); height: clamp(170px, 32vh, 290px); perspective: 240px; overflow: hidden; border-radius: var(--r-3); }
.art-road__plane {
  position: absolute; inset: -60% 0 0; transform: rotateX(56deg); transform-origin: 50% 100%;
  background:
    linear-gradient(90deg, var(--secondary-a24) 0 2px, transparent 2px calc(33.33% - 1px), var(--line-2) calc(33.33% - 1px) calc(33.33% + 1px), transparent calc(33.33% + 1px) calc(66.66% - 1px), var(--line-2) calc(66.66% - 1px) calc(66.66% + 1px), transparent calc(66.66% + 1px) calc(100% - 2px), var(--secondary-a24) calc(100% - 2px)),
    repeating-linear-gradient(180deg, var(--primary-a16) 0 3px, transparent 3px 40px),
    var(--bg-2);
  animation: art-road 0.7s linear infinite;
}
@keyframes art-road { from { background-position: 0 0, 0 0, 0 0; } to { background-position: 0 0, 0 40px, 0 0; } }
.art-road__obst {
  position: absolute; top: 0; left: calc(var(--lane) * 33.33% + 8%); width: 17%; height: 9%;
  background: var(--secondary); border-radius: 2px; box-shadow: 0 0 18px rgba(255, 122, 89, .6);
  animation: art-obst 2.1s linear infinite;
}
.art-road__obst:nth-child(2) { animation-delay: -.7s; }
.art-road__obst:nth-child(3) { animation-delay: -1.4s; }
@keyframes art-obst { from { transform: translateY(0); opacity: 0; } 10% { opacity: 1; } to { transform: translateY(1100%); opacity: 1; } }
.art-road__car {
  position: absolute; bottom: 10px; left: calc(50% - 16px); width: 32px; height: 42px;
  background: var(--primary); border-radius: 4px 4px 2px 2px; box-shadow: 0 0 24px var(--primary-a60), 0 4px 0 var(--primary-press);
  animation: art-car 2.1s steps(1) infinite;
}
@keyframes art-car { 0% { translate: -66px 0; } 33% { translate: 0 0; } 66% { translate: 66px 0; } }
.art-generic { width: 120px; height: 120px; color: var(--primary); shape-rendering: crispEdges; }

/* ----------------------------------------------------------- empty card */
.empty-inner { justify-content: center; }
.empty-inner .gp-empty { margin: auto 0; }

/* --------------------------------------------------------------- game sheet */
.feed-sheet {
  position: absolute; inset: 0; z-index: 40;
  display: flex; flex-direction: column;
  background: var(--bg);
  transform: translateY(100%);
  transition: transform var(--dur-slow) var(--ease-out);
}
.feed-sheet.is-open { transform: translateY(var(--drag, 0px)); }
.feed-sheet.is-dragging { transition: none; }
.feed-sheet__top {
  flex: none; display: grid; gap: 6px;
  grid-template-columns: minmax(0, 1fr); /* a long game name never widens the bar past the screen */
  padding: calc(var(--bar-top)) 14px 12px;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
  touch-action: none; cursor: grab;
}
.feed-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.feed-sheet__name { display: grid; gap: 4px; min-width: 0; }
.feed-sheet__name .gp-kicker { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
/* F-03: kicker + the card's affiliation label. The kicker ends with the clip's game name, so a long
   name is what the ellipsis cuts; the label (flex: none) is never cut. When both do not fit on one
   line the label wraps under the kicker instead of squeezing the name to one letter. */
.feed-sheet__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; margin: 0; }
.feed-sheet__meta .gp-kicker { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.feed-sheet__aff { flex: none; }

/* Store CTA in the sheet: verb + destination + affiliation note (sheet.js setStoreText).
   The destination name may truncate, the note never does. */
.feed-store-text, .feed-store-dest { display: flex; align-items: baseline; min-width: 0; }
.feed-store-dest { gap: .3em; }
.feed-store-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-store-aff { flex: none; font-size: inherit; font-weight: inherit; letter-spacing: 0; white-space: nowrap; }
/* Result strip: two lines — "스토어로" / "FC 모바일 · 제휴 아님" (the strip is narrow, inside the phone at 1440) */
.feed-done__store .feed-store-text { flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; }
.feed-done__store .feed-store-dest { max-width: 100%; font-size: 11.5px; font-weight: var(--fw-bold); color: var(--muted); letter-spacing: 0; }
.feed-done__store .feed-store-aff:not(:first-child)::before { content: "· "; }
/* Empty state: one line — "스토어로 · FC 모바일 (제휴 아님)" */
.feed-sheet__empty .gp-btn { max-width: 100%; }
.feed-sheet__empty .feed-store-text { gap: .3em; }
.feed-sheet__empty .feed-store-text > .feed-store-verb:not(:last-child)::after { content: " ·"; }
.feed-sheet__empty .feed-store-aff { font-size: .82em; opacity: .85; }
.feed-sheet__empty .feed-store-aff::before { content: "("; }
.feed-sheet__empty .feed-store-aff::after { content: ")"; }
.feed-sheet__title { font-size: 1.25rem; font-weight: var(--fw-heavy); letter-spacing: -.02em; line-height: 1.2; }
.feed-sheet__timer .gp-gauge__value { font-size: var(--fs-num-1); }
.feed-sheet__timer .gp-gauge__value small { font-size: var(--fs-2xs); font-family: var(--font-sans); }
.feed-sheet__stage { position: relative; flex: 1; min-height: 0; background: var(--void); }
.feed-sheet__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; visibility: hidden; background: var(--bg); }
.feed-sheet__frame.is-ready { visibility: visible; }
.feed-sheet__loading {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px;
  font-size: var(--fs-sm); color: var(--muted); background: var(--bg);
}
.feed-charge { --cell: 14px; }
.feed-charge > i { animation: feed-charge 1.2s steps(1) infinite; }
.feed-charge > i:nth-child(2) { animation-delay: -1s; }
.feed-charge > i:nth-child(3) { animation-delay: -.8s; }
.feed-charge > i:nth-child(4) { animation-delay: -.6s; }
.feed-charge > i:nth-child(5) { animation-delay: -.4s; }
@keyframes feed-charge { 0%, 40% { background: var(--line); } 41%, 100% { background: var(--primary); } }
.feed-sheet__empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: var(--bg); overflow-y: auto; }
.feed-sheet__empty .gp-empty { width: 100%; max-width: 360px; }

/* Result strip in the sheet bar (the game's own end screen stays visible below) */
.feed-done {
  display: grid; gap: 6px; padding: 8px 10px 8px 12px; margin-top: 2px;
  grid-template-columns: minmax(0, 1fr); /* the store CTA shrinks (its name truncates) instead of overflowing */
  border-radius: var(--r-4); border: 1px solid var(--primary-a32);
  background: linear-gradient(180deg, var(--primary-a08), transparent 80%);
  box-shadow: var(--glow-1);
  animation: feed-pop var(--dur-slow) var(--ease-pop);
}
@keyframes feed-pop { from { transform: translateY(-8px) scale(.97); } }
.feed-done__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.feed-done__result { display: grid; gap: 4px; min-width: 0; }
.feed-done__score { display: inline-flex; align-items: baseline; gap: 4px; line-height: 1; }
.feed-done__score .gp-num { font-size: var(--fs-num-2); color: var(--primary); text-shadow: 0 0 22px rgba(198, 255, 61, .35); }
.feed-done__score small { font-size: var(--fs-xs); color: var(--muted); font-weight: 700; }
.feed-done__store { flex: 0 1 auto; min-width: 0; max-width: 62%; margin-bottom: 3px; border-color: var(--secondary); }
.feed-done__store .feed-store-verb, .feed-done__store .feed-store-dest { line-height: 1.15; }
.feed-done__result .gp-kicker { white-space: nowrap; }
.feed-done .feed-journey-mini__cell::before { height: 8px; }
/* QA2-F1: a round /report does not count. Neutral strip (no lime glow), grey score, and the reason on
   its own row under score + CTA, so it never narrows the store CTA (F-03). */
.feed-done__note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; font-size: var(--fs-2xs); color: var(--muted); }
.feed-done__flag { flex: none; color: var(--ink-2); border-color: var(--line-2); background: var(--surface-2); white-space: nowrap; }
.feed-done.is-unrecorded { border-color: var(--line-2); background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 80%); box-shadow: none; }
.feed-done.is-unrecorded .feed-done__score .gp-num { color: var(--muted); text-shadow: none; }

.feed-journey-mini { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.feed-journey-mini__cell { display: grid; gap: 5px; justify-items: center; }
.feed-journey-mini__cell::before { content: ""; width: 100%; height: 12px; border-radius: 1px; background: var(--surface-3); border: 1px solid var(--line-2); }
.feed-journey-mini__cell.is-on::before { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 10px var(--primary-a60); }
.feed-journey-mini__cell.is-next::before { border-color: var(--secondary); border-style: dashed; animation: gp-blink 1s steps(1) infinite; }
.feed-journey-mini__cell small { font-size: 11px; font-weight: 700; color: var(--muted); }
.feed-journey-mini__cell.is-on small { color: var(--ink); }

/* ----------------------------------------------------------- live panel */
.live {
  position: relative; display: flex; flex-direction: column; gap: 14px; min-height: 0;
  padding: 18px; border-radius: var(--r-6);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line); box-shadow: var(--sh-3);
  overflow: hidden; isolation: isolate;
}
.live::before { /* faint scanlines: a monitor, not a page */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 3px), var(--light-top);
}
.live.is-max { animation: live-max 1.2s var(--ease-out); }
@keyframes live-max { 0% { box-shadow: var(--sh-3), 0 0 0 0 var(--primary-a60); } 40% { box-shadow: var(--sh-3), 0 0 0 6px var(--primary-a32), 0 0 80px rgba(198, 255, 61, .35); } 100% { box-shadow: var(--sh-3); } }

.live__head { display: grid; gap: 6px; }
.live__title-row { display: flex; align-items: center; gap: 10px; }
.live__rec { width: 10px; height: 10px; background: var(--secondary); box-shadow: 0 0 12px var(--secondary-a24); animation: gp-blink 1.2s steps(1) infinite; }
[data-track-mode="live"] .live__rec { background: var(--primary); box-shadow: 0 0 12px var(--primary-a60); }
.live__title { font-size: 1.375rem; font-weight: var(--fw-heavy); letter-spacing: -.02em; flex: 1; }
.live__sub { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--fs-xs); color: var(--muted); }
.live__total { font-size: var(--fs-2xs); color: var(--muted); white-space: nowrap; }
.live__total .gp-num { font-size: var(--fs-num-1); color: var(--ink); }

.live__row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.live__link { font-size: 12px; color: var(--ink-2); background: var(--bg); border: 1px solid var(--line); padding: 3px 7px; border-radius: var(--r-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.live__now { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--r-4); background: var(--bg); border: 1px solid var(--line); }
.live__now-name { font-size: 1.125rem; font-weight: var(--fw-heavy); letter-spacing: -.02em; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live__journey { --gp-h: 20px; gap: 6px; }
.live__journey .gp-gauge__value { font-size: var(--fs-num-2); }
.live__journey .gp-gauge__value small { font-size: var(--fs-num-1); }

.live__funnel { display: grid; gap: 8px; }
.live__rows { display: grid; gap: 4px; }
.live__fr {
  display: grid; grid-template-columns: minmax(150px, 172px) 1fr 40px 46px; align-items: center; gap: 10px;
  padding: 3px 10px; border-radius: var(--r-3); background: rgba(11, 16, 18, .6); border: 1px solid var(--line);
}
.live__fr.is-bump { animation: live-bump 900ms var(--ease-out); }
@keyframes live-bump { from { background-color: var(--primary-a16); border-color: var(--primary-a60); } }
.live__fr[data-name="cta_store"].is-bump { animation-name: live-bump-coral; }
@keyframes live-bump-coral { from { background-color: var(--secondary-a24); border-color: var(--secondary); } }
.live__fr-label { display: flex; align-items: baseline; gap: 8px; min-width: 0; white-space: nowrap; }
.live__fr-label b { font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.live__fr-label code { font-size: 11px; color: var(--muted); }
.live__fr-gauge { --gp-h: 10px; }
.live__fr[data-name="cta_store"] .live__fr-gauge { --gp-color: var(--secondary); }
.live__fr-num { font-size: var(--fs-num-2); line-height: 1; text-align: right; color: var(--ink); }
.live__fr-rate { font-size: var(--fs-2xs); color: var(--muted); text-align: right; white-space: nowrap; }
.live__rule { font-size: var(--fs-2xs); }

.live__log { flex: 1; min-height: 150px; }
.live__log .gp-log__list { --log-h: none; flex: 1; min-height: 0; }
.live__log .gp-log__item { padding-block: 8px; }
.feed-status { display: inline-block; margin-right: 6px; padding: 1px 5px; border-radius: var(--r-1); font-family: var(--font-mono); font-size: 11px; font-weight: 600; border: 1px solid var(--line-2); color: var(--muted); vertical-align: 1px; }
.feed-status[data-tone="ok"] { color: var(--primary); border-color: var(--primary-a60); background: var(--primary-a08); }
.feed-status[data-tone="bad"] { color: var(--secondary); border-color: var(--secondary); background: var(--secondary-a10); }
/* A row /report does not count (input-less round, repeat round, duplicate tap): struck stage name. */
.live__log .gp-log__item.is-uncounted .gp-log__event { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.live__log .gp-log__item.is-uncounted .gp-log__val { color: var(--muted); }
/* Already counted for this session (repeat tap / repeat store move): happened, not tallied again. */
.live__log .gp-log__item.is-repeat .gp-log__event,
.live__log .gp-log__item.is-repeat .gp-log__val { color: var(--muted); }
.live__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.live__foot .gp-btn { margin-bottom: 0; flex: none; }
/* Intro-column notices for widths without the intro column (mobile sheet, 1024-1279 desktop). */
.live__notes { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.live__notes .gp-src { font-size: var(--fs-2xs); }
.live__notes .feed-intro__link { padding-block: 6px; }
@media (min-width: 1280px) { .live__notes { display: none; } }

.feed-badge-live { color: var(--primary); border-color: var(--primary-a60); background: var(--primary-a08); }
.feed-badge-live::before { animation: gp-blink 1.2s steps(1) infinite; }

/* Mobile sheet version of the panel */
.feed-live-sheet .gp-sheet__body { padding-bottom: calc(var(--sp-5) + var(--safe-b)); }
.feed-live-sheet .live { padding: 0; border: 0; box-shadow: none; background: none; overflow: visible; }
.feed-live-sheet .live::before { content: none; }
.feed-live-sheet .live__log .gp-log__list { max-height: 34vh; }
.feed-live-sheet .live__sub { display: none; } /* the sheet title already says it */
.feed-live-sheet .live__fr { grid-template-columns: max-content minmax(56px, 1fr) 34px 52px; }
.feed-live-sheet .live__fr-label code { display: none; }

/* QA3-04: a toast on its way out (e.g. "게이지 MAX" closed because the feed moved to the next card)
   never takes the tap meant for the CTA row underneath it during its exit animation. */
.feed-body .gp-toast.is-leaving { pointer-events: none; }

/* Packet: an event leaving the phone for the stream (desktop) */
.feed-packet {
  position: fixed; left: 0; top: 0; z-index: var(--z-toast);
  padding: 5px 9px; border-radius: var(--r-2);
  font-family: var(--font-mono); font-size: 12px; font-weight: 700; line-height: 1; white-space: nowrap;
  color: var(--on-primary); background: var(--primary); box-shadow: var(--glow-2);
  pointer-events: none; will-change: transform, opacity;
}
.feed-packet[data-kind="impression"] { color: var(--ink); background: var(--surface-3); box-shadow: 0 0 0 1px var(--line-2), 0 8px 24px rgba(0, 0, 0, .6); }
.feed-packet[data-kind="land"] { color: var(--bg); background: var(--ink); box-shadow: 0 0 24px rgba(245, 247, 245, .35); }
.feed-packet[data-kind="store"] { color: var(--on-secondary); background: var(--secondary); box-shadow: var(--glow-coral); }

/* ---------------------------------------------------------------- desktop */
@media (min-width: 1024px) {
  body.feed-body { background: var(--light-top), var(--tex-grid), var(--bg); }
  .feed-nav { display: block; }
  .feed-app {
    --stage-h: calc(var(--app-h) - var(--nav-h));
    height: var(--stage-h);
    display: grid; grid-template-columns: auto minmax(380px, 460px); justify-content: center; align-items: stretch;
    gap: 28px; padding: 18px 28px; max-width: 1480px; margin: 0 auto;
  }
  .feed-stagewrap { align-items: center; gap: 14px; min-height: 0; }
  .feed-device { --phone-w: clamp(300px, calc((var(--stage-h) - 36px) * 9 / 19.5), 400px); }
  .feed-screen { --bar-top: calc(var(--phone-w) * .135); --foot-pad: calc(var(--phone-w) * .07); --bar-h: 48px; }
  .feed-screen .feed-chip { display: none; }
  .feed-pager { display: grid; justify-items: center; gap: 10px; }
  .feed-pager__count { display: grid; justify-items: center; gap: 2px; }
  .feed-pager__count .gp-num { font-size: var(--fs-num-2); line-height: 1; color: var(--primary); }
  .feed-pager__count small { font-family: var(--font-num); font-size: var(--fs-num-1); color: var(--muted); }
  .feed-live { display: flex; flex-direction: column; min-height: 0; }
  /* Short desktops (e.g. 1024x768, 1280x720): the panel scrolls instead of cutting its footer and notices. */
  .feed-live > .live { flex: 1; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
  .feed-device .yt-foot__cta .gp-btn { --btn-fs: 15px; --btn-px: 14px; }
}
@media (min-width: 1280px) {
  .feed-app { grid-template-columns: minmax(250px, 330px) auto minmax(400px, 480px); gap: 36px; }
  .feed-intro {
    display: flex; flex-direction: column; justify-content: center; gap: 18px;
    justify-content: safe center; /* when taller than the column: start at the top and scroll, never cut the top */
    min-height: 0; overflow-y: auto; padding: 8px 4px; scrollbar-width: none;
  }
}
@media (min-width: 1024px) and (max-height: 760px) {
  .live__funnel .live__rule { display: none; }
  .live { gap: 10px; padding: 14px; }
}

/* Intro column */
.feed-intro__title { font-size: clamp(2.25rem, 1.2rem + 1.9vw, 3.125rem); font-weight: var(--fw-heavy); line-height: 1.06; letter-spacing: var(--tr-display); }
.feed-intro__lead { font-size: var(--fs-body); line-height: 1.65; color: var(--muted); }
.feed-intro__steps { display: grid; gap: 2px; border-left: 2px solid var(--line); padding-left: 0; }
.feed-intro__steps li { position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: baseline; padding: 6px 0 6px 16px; }
.feed-intro__steps li i { position: absolute; left: -6px; top: 12px; width: 10px; height: 10px; border-radius: 1px; background: var(--muted); border: 2px solid var(--bg); }
.feed-intro__steps li[data-kind="play"] i { background: var(--primary); }
.feed-intro__steps li[data-kind="store"] i { background: var(--secondary); }
.feed-intro__steps code { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.feed-intro__steps span { font-size: var(--fs-xs); color: var(--muted); word-break: keep-all; }
/* D-A (10/4): how far a store console can follow a link — its own line under the cta_store step. */
.feed-intro__scope { display: block; margin-top: 2px; font-size: var(--fs-2xs); color: var(--faint-text); }
.feed-intro__note { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-xs); line-height: 1.55; color: var(--muted); }
.feed-intro__note .gp-icon { margin-top: 2px; color: var(--primary); }
.feed-intro__link { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; padding-block: 5px; }
@media (hover: hover) { .feed-intro__link:hover { color: var(--primary); } }
.feed-keys { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: var(--fs-2xs); color: var(--muted); }
.feed-keys kbd {
  display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 6px; margin-right: 3px;
  font-family: var(--font-mono); font-size: 11px; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--line-2); border-bottom-width: 3px; border-radius: var(--r-2);
}
/* 1440x900 and other short desktops: the intro (with the paid-placement notice) fits without scrolling.
   After the intro rules on purpose (same specificity, later wins). */
@media (min-width: 1280px) and (max-height: 940px) {
  .feed-intro { gap: 13px; }
  .feed-intro__title { font-size: clamp(2.125rem, 1.1rem + 1.8vw, 2.875rem); }
  .feed-intro__steps li { padding-block: 4px; }
  .feed-intro__lead { line-height: 1.55; }
}

@media (prefers-reduced-motion: reduce) {
  .feed-sheet { transition: none; }
  .feed-chip__dot, .live__rec, .art__hint { animation: none; }
  .is-sound-hint .feed-card.is-active .yt-rail__btn[data-act="sound"] { animation: none; } /* colour stays */
  /* Slot clips never start by themselves here: show the play glyph on the poster. */
  .feed-card--slot.is-active:not(.is-playing) .slot-glyph { opacity: 1; transform: none; transition: none; }
}
