/* ==========================================================================
   Internet Legends (/internet-legends/) and the franchise / console buttons
   (Videos, Internet Legends, The Retro Report). Colours follow the active console theme.
   ========================================================================== */

.lg-page { max-width: 1320px; margin: 0 auto; padding: 0 0 40px; --lg-head: var(--t-head, #14245e); --lg-ring: var(--t-card-ring, #3b7bff); --lg-glow: var(--t-card-glow, rgba(70,150,255,.5)); --lg-on: var(--t-primary, #6ccc12); --lg-on-text: var(--t-primary-text, #102000); }
.lg-page .hp-sec:first-child { margin-top: clamp(16px, 2.5vw, 34px); }
.lg-page .hp-sec + .hp-sec { margin-top: clamp(18px, 2.4vw, 32px); }

/* masthead: the title is set big and tilted like a forum signature banner */
.lg-mast { margin-bottom: clamp(12px, 1.6vw, 22px); }
.lg-mast__title { display: flex; align-items: center; gap: 12px; margin: 0; font-size: clamp(30px, 4.4vw, 58px); line-height: 1; font-weight: 1000; letter-spacing: -.035em; color: var(--lg-head); }
.lg-mast__title .xp-i { width: .8em; height: .8em; color: #ffb400; filter: drop-shadow(0 2px 0 rgba(120,60,0,.35)); transform: rotate(-12deg); }
.lg-mast__tag { margin: 8px 0 0; font-size: clamp(14px, 1.25vw, 18px); font-weight: 800; color: var(--lg-head); opacity: .72; }

/* cards */
.lg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lg-cell[hidden] { display: none; }
.lg-card__img > video.lg-card__frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.lg-card__year, .lg-card__len { position: absolute; bottom: 8px; padding: 2px 8px; border-radius: 6px; font-size: 12.5px; font-weight: 900; color: #fff; background: rgba(8,12,34,.78); }
.lg-card__year { left: 8px; background: #ffb400; color: #3a2200; }
.lg-card__len { right: 8px; font-variant-numeric: tabular-nums; }

/* buttons */
.lg-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 24px; border: 0; border-radius: 999px; font: inherit; font-size: 15px; font-weight: 900; cursor: pointer;
	color: var(--lg-on-text); background: var(--lg-on); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 0 0 2px rgba(255,255,255,.7); }
.lg-btn:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 0 0 2px #fff, 0 0 14px var(--lg-glow); }
.lg-btn[hidden] { display: none; }
.lg-more-wrap { display: flex; justify-content: center; margin-top: clamp(16px, 2vw, 26px); }

/* one clip */
.lg-back { margin: 0 0 10px; font-weight: 900; }
.lg-back a { color: var(--lg-head); opacity: .75; } .lg-back a:hover { opacity: 1; text-decoration: underline; }
.lg-player { position: relative; width: 100%; max-width: min(100%, calc(72vh * var(--arn, 1.7778))); margin: 0 auto; aspect-ratio: var(--ar, 16 / 9); overflow: hidden; border-radius: 16px; background: #000; box-shadow: 0 0 0 3px #fff, 0 10px 26px rgba(0,20,80,.3); }
.lg-player video, .lg-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: contain; }
.lg-player--embed { aspect-ratio: auto; background: none; box-shadow: none; overflow: visible; }
.lg-player--embed iframe { position: static; width: 100%; aspect-ratio: 16 / 9; height: auto; }
.lg-player--none, .lg-player--link { display: grid; place-items: center; aspect-ratio: auto; padding: 40px 16px; text-align: center; font-weight: 800; color: #fff; background: linear-gradient(160deg, #3b4fb8, #0d1440); }
.lg-one__title { margin: 18px 0 6px; font-size: clamp(26px, 3.2vw, 44px); line-height: 1.05; font-weight: 1000; letter-spacing: -.03em; color: var(--lg-head); }
.lg-one__facts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-weight: 900; color: var(--lg-head); }
.lg-one__facts > span + span::before { content: "/"; margin-right: 8px; opacity: .4; }
.lg-one__credit { margin: 12px 0 0; font-weight: 700; color: #3c4670; }
.lg-one__credit a { font-weight: 900; color: #1f4fe0; text-decoration: underline; }
.lg-one__story { max-width: 70ch; margin-top: 14px; font-size: 17px; line-height: 1.6; color: #1d2547; }
.lg-one__story p { margin: 0 0 1em; }

/* ---- filter buttons (Videos, Retro Report: game + platform; Internet Legends: categories) ---- */
.sg-topics { display: grid; gap: 10px; margin: 0 0 clamp(16px, 1.8vw, 24px); padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.55); box-shadow: inset 0 0 0 1px rgba(30,50,110,.10); }
.sg-topics__row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.sg-topics__label { flex: 0 0 72px; font-size: 12.5px; font-weight: 900; letter-spacing: .02em; color: var(--t-head, #14245e); opacity: .62; }
.sg-topic { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 13px; border: 0; border-radius: 999px; font: inherit; font-size: 13.5px; font-weight: 800; white-space: nowrap; text-decoration: none; cursor: pointer;
	color: var(--t-head, #14245e); background: #fff; box-shadow: 0 1px 0 rgba(20,40,100,.08), inset 0 0 0 1px rgba(30,50,110,.16); transition: box-shadow .15s ease, background .15s ease, transform .15s ease; }
.sg-topic:hover { box-shadow: inset 0 0 0 2px var(--t-card-ring, #3b7bff); }
.sg-topic:active { transform: translateY(1px); }
.sg-topic.is-on { color: var(--t-primary-text, #102000); background: var(--t-primary, #6ccc12); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 0 0 2px rgba(255,255,255,.8), 0 0 10px var(--t-card-glow, rgba(70,150,255,.45)); }
.sg-topic__n { min-width: 18px; padding: 1px 5px; border-radius: 999px; font-size: 11px; font-weight: 900; text-align: center; font-variant-numeric: tabular-nums; background: rgba(20,36,94,.08); }
.sg-topic.is-on .sg-topic__n { background: rgba(0,0,0,.12); }
.sg-topic--more { display: none; }
.sg-topics__row.is-open .sg-topic--more { display: inline-flex; }
.sg-topic--toggle { background: transparent; box-shadow: inset 0 0 0 1px rgba(30,50,110,.16); opacity: .8; }
.sg-topic:focus-visible { outline: 3px solid var(--t-card-ring, #3b7bff); outline-offset: 2px; }
.sg-topics__now { margin: -8px 0 14px; font-weight: 800; color: var(--t-head, #14245e); }
.sg-topics__now a { margin-left: 6px; text-decoration: underline; }
.rr-topics { padding-bottom: 4px !important; }
.rr-topics .sg-topics { margin-bottom: 8px; }
/* Internet Legends has one row of categories: no label column, no panel */
.lg-page .sg-topics { padding: 0; background: none; box-shadow: none; }

@media (max-width: 1100px) { .lg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 699.98px) {
	/* phones: one swipeable line per row, label above it */
	.sg-topics { padding: 10px 0 8px; gap: 8px; }
	.sg-topics__row { flex-wrap: nowrap; overflow-x: auto; padding: 2px 12px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
	.sg-topics__row::-webkit-scrollbar { display: none; }
	.sg-topics__label { flex: 0 0 auto; margin-right: 2px; }
	.sg-topic { scroll-snap-align: start; }
	.sg-topic--more { display: inline-flex; } /* swiping is cheap on a phone: show everything, drop the toggle */
	.sg-topic--toggle { display: none; }
	.lg-page .sg-topics { margin-left: -14px; margin-right: -14px; }
	/* seven menu items: the last one spans the row */
	.hp-nav li:last-child:nth-child(3n+1) { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { .sg-topic { transition: none; } }

/* ---- clip page: random button, up next, sound ---- */
.lg-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.lg-bar .lg-back { margin: 0; }
.lg-rand { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 18px 0 14px; border-radius: 999px; font-size: 14.5px; font-weight: 900; text-decoration: none; white-space: nowrap;
	color: #3a2200; background: linear-gradient(180deg, #ffd34d, #ffb400); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 0 0 2px #fff, 0 3px 0 #c98400; transition: transform .15s ease, box-shadow .15s ease; }
.lg-rand svg { width: 20px; height: 20px; fill: #fff; stroke: #3a2200; stroke-width: 1.6; }
.lg-rand svg circle { fill: #3a2200; stroke: none; }
.lg-rand:hover { transform: translateY(-1px) rotate(-1deg); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 0 0 2px #fff, 0 4px 0 #c98400, 0 0 16px rgba(255,180,0,.55); }
.lg-rand:hover svg { transform: rotate(-14deg); }
.lg-rand svg { transition: transform .2s ease; }
.lg-rand:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 0 0 2px #fff, 0 1px 0 #c98400; }
.lg-rand:focus-visible { outline: 3px solid var(--lg-ring); outline-offset: 3px; }
.lg-mast { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: 16px; }
.lg-mast > :not(.lg-rand) { grid-column: 1; }
.lg-rand--mast { grid-column: 2; grid-row: 1 / span 2; align-self: center; min-height: 46px; font-size: 16px; }

.lg-stage { position: relative; }
.lg-next { position: absolute; inset: 0; z-index: 3; max-width: min(100%, calc(72vh * var(--arn, 1.7778))); margin: 0 auto; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 20px; border-radius: 16px; text-align: center; color: #fff;
	background: radial-gradient(120% 100% at 50% 0%, rgba(40,60,170,.92), rgba(6,10,40,.95)); }
.lg-next[hidden] { display: none; }
.lg-next.is-on { animation: lg-in .25s ease-out; }
.lg-next__k { margin: 0; font-size: 13px; font-weight: 900; color: #ffd34d; }
.lg-next__t { margin: 0 0 6px; max-width: 30ch; font-size: clamp(18px, 2.4vw, 28px); line-height: 1.15; font-weight: 1000; letter-spacing: -.02em; }
.lg-next__ring { position: relative; width: 56px; height: 56px; margin: 4px 0 8px; }
.lg-next__ring svg { width: 100%; height: 100%; transform: rotate(-90deg); fill: none; stroke-width: 4; }
.lg-next__ring circle { stroke: rgba(255,255,255,.2); }
.lg-next__ring .lg-next__arc { stroke: #ffd34d; stroke-linecap: round; stroke-dasharray: 119.4; stroke-dashoffset: 0; }
.lg-next.is-on .lg-next__arc { animation: lg-count 5s linear forwards; }
.lg-next__ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; font-weight: 1000; }
.lg-next__btns { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin: 0; }
.lg-next__stay { min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 800; color: #fff; background: rgba(255,255,255,.14); cursor: pointer; }
.lg-next__stay:hover { background: rgba(255,255,255,.24); }
.lg-sound { position: absolute; z-index: 2; left: 50%; top: 14px; transform: translateX(-50%); min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 900; color: #3a2200; background: #ffd34d; box-shadow: 0 0 0 2px #fff, 0 6px 16px rgba(0,0,0,.35); cursor: pointer; }
.lg-sound[hidden] { display: none; }
@keyframes lg-count { to { stroke-dashoffset: 119.4; } }
@keyframes lg-in { from { opacity: 0; transform: scale(.97); } }
@media (max-width: 699.98px) {
	.lg-mast { grid-template-columns: minmax(0, 1fr); }
	.lg-rand--mast { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 12px; }
	.lg-next__ring { width: 44px; height: 44px; margin: 0 0 4px; }
	.lg-next__k, .lg-next__t { margin: 0; }
}
@media (prefers-reduced-motion: reduce) { .lg-rand, .lg-rand svg { transition: none; } .lg-next.is-on { animation: none; } }
