/*
 * Game Room: the track, cards, leaderboard and perks. Shared by the
 * Release Notes section (template-parts/release/game-room.php) and the
 * /game-room/ page (template-parts/product-pages/game-room.php).
 */

.vsg {
    --vsg-bg: #1a1030;
    --vsg-card: #241640;
    --vsg-line: rgba(196, 181, 253, .16);
    --vsg-text: #ddd6fe;
    --vsg-muted: #a99bd0;
    --vsg-gold: #fbbf24;
    position: relative;
    padding: 5rem 0 5.5rem;
    overflow: hidden;
    background:
        radial-gradient(60rem 30rem at 85% -10%, rgba(168, 85, 247, .28), transparent 70%),
        radial-gradient(40rem 24rem at 0% 100%, rgba(99, 102, 241, .22), transparent 70%),
        var(--vsg-bg);
    color: #fff;
    scroll-margin-top: 5rem;
}
.vsg::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px); background-size: 22px 22px; pointer-events: none; }
.vsg .vsr-wrap { position: relative; }

.vsg-head { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 1024px) { .vsg-head { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 3.5rem; } }
.vsg-eyebrow { display: inline-flex; align-items: center; gap: .5rem; margin: 0 0 1.125rem; padding: .375rem .875rem; border: 1px solid rgba(251, 191, 36, .35); border-radius: 999px; background: rgba(251, 191, 36, .08); color: #fde68a; font-size: .8125rem; font-weight: 600; }
.vsg-eyebrow__dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--vsg-gold); }
.vsg-eyebrow__dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: rgba(251, 191, 36, .35); animation: vsg-pulse 2.4s ease-out infinite; }
.vsg-title { margin: 0 0 1rem; color: #fff; font-size: clamp(1.875rem, 4vw, 2.75rem); font-weight: 800; line-height: 1.1; letter-spacing: -.03em; }
.vsg-lead { max-width: 36rem; margin: 0 0 .875rem; color: var(--vsg-text); font-size: 1.0625rem; line-height: 1.7; }
.vsg-lead a { color: #fff; text-decoration: underline; text-decoration-color: rgba(251, 191, 36, .6); text-underline-offset: 3px; }
.vsg-lead a:hover { text-decoration-color: var(--vsg-gold); }
.vsg-lead--story { color: #fff; font-weight: 600; }
.vsg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; margin-top: 1.75rem; }
.vsg-btn { display: inline-flex; align-items: center; height: 2.875rem; padding: 0 1.375rem; border-radius: .75rem; background: #6366f1; color: #fff; font-size: .9375rem; font-weight: 600; text-decoration: none; box-shadow: 0 10px 30px -10px rgba(99, 102, 241, .8); transition: background-color .15s, transform .15s; }
.vsg-btn:hover { background: #4f46e5; color: #fff; transform: translateY(-1px); }
.vsg-link { color: var(--vsg-text); font-size: .9375rem; font-weight: 600; text-decoration: none; }
.vsg-link:hover { color: #fff; }

.vsg-hall { position: relative; margin: 0; padding: 10px; border: 1px solid rgba(251, 191, 36, .35); border-radius: 1.25rem; background: linear-gradient(160deg, #3b2160, #1f1238); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .8), 0 0 0 1px rgba(0, 0, 0, .3) inset; }
.vsg-hall figcaption { position: absolute; left: 1.5rem; bottom: 1.5rem; display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .875rem .5rem .5rem; border-radius: 999px; background: rgba(17, 10, 31, .82); color: #fff; font-size: .875rem; font-weight: 600; backdrop-filter: blur(6px); }
.vsg-hall__count { display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--vsg-gold); color: #1a1030; font-weight: 800; }
.vsg-hall img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 3; border-radius: .75rem; object-fit: cover; }

/* Track: the games in order, then what's next. A scroller on small screens. */
.vsg-track { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(15.5rem, 78%); gap: 1rem; margin: 4rem -1rem 0; padding: 0 1rem 1rem; list-style: none; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: rgba(196, 181, 253, .3) transparent; }
@media (min-width: 640px) { .vsg-track { grid-auto-columns: minmax(15.5rem, 42%); margin: 4rem -1.5rem 0; padding: 0 1.5rem 1rem; } }
@media (min-width: 1100px) { .vsg-track { grid-auto-flow: row; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 4rem 0 0; padding: 0; overflow: visible; } }
.vsg-drop { display: flex; flex-direction: column; scroll-snap-align: start; }
.vsg-drop__when { position: relative; display: flex; align-items: center; gap: .625rem; margin: 0 0 1rem; color: #fde68a; font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.vsg-drop__when::after { content: ""; flex: 1; height: 2px; border-radius: 2px; background: linear-gradient(90deg, rgba(251, 191, 36, .7), rgba(251, 191, 36, .15)); transform-origin: left; }
.vsg-drop--next .vsg-drop__when { color: var(--vsg-muted); }
.vsg-drop--next .vsg-drop__when::after { background: repeating-linear-gradient(90deg, rgba(196, 181, 253, .35) 0 6px, transparent 6px 12px); }
.vsg-drop__node { flex: none; width: 12px; height: 12px; border: 2px solid var(--vsg-gold); border-radius: 50%; background: var(--vsg-gold); box-shadow: 0 0 0 4px rgba(251, 191, 36, .15); }
.vsg-drop--next .vsg-drop__node { border-color: var(--vsg-muted); background: transparent; box-shadow: none; }

.vsg-drop__card { display: flex; flex: 1; flex-direction: column; border: 1px solid var(--vsg-line); border-radius: 1.125rem; background: linear-gradient(180deg, #2a1a4a, var(--vsg-card)); overflow: hidden; transition: transform .2s ease, border-color .2s, box-shadow .2s; }
.vsg-drop__card:hover { transform: translateY(-4px); border-color: rgba(251, 191, 36, .45); box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .7); }
.vsg-drop--snakes .vsg-drop__card { border-color: rgba(251, 191, 36, .5); background: linear-gradient(180deg, #3a1f3f, #2a1636); box-shadow: 0 0 0 1px rgba(251, 191, 36, .15), 0 24px 60px -30px rgba(245, 158, 11, .55); }
.vsg-drop--next .vsg-drop__card { border-style: dashed; border-color: rgba(196, 181, 253, .35); background: rgba(36, 22, 64, .45); }

.vsg-art { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; background: radial-gradient(circle at 50% 45%, rgba(168, 85, 247, .35), transparent 65%), #1d1135; overflow: hidden; }
.vsg-drop--snakes .vsg-art { background: radial-gradient(circle at 50% 40%, rgba(251, 191, 36, .32), transparent 62%), #2b1430; }
.vsg-art__board, .vsg-art__ttt { width: 62%; height: auto; aspect-ratio: 1; border-radius: 6px; box-shadow: 0 18px 30px -12px rgba(0, 0, 0, .7); transform: rotate(-4deg); transition: transform .3s ease; }
.vsg-drop__card:hover .vsg-art__board, .vsg-drop__card:hover .vsg-art__ttt { transform: rotate(0) scale(1.03); }
.vsg-art__piece { position: absolute; width: 22%; height: auto; filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .45)); transition: transform .3s ease; }
.vsg-art__piece--a { left: 14%; bottom: 8%; }
.vsg-art__piece--b { right: 13%; top: 8%; }
.vsg-art__token { width: 15%; }
.vsg-art__goti { width: 13%; }
.vsg-drop__card:hover .vsg-art__piece--a { transform: translateY(-8px) rotate(-6deg); }
.vsg-drop__card:hover .vsg-art__piece--b { transform: translateY(-5px) rotate(6deg); }
.vsg-art__win { stroke-dasharray: 1; stroke-dashoffset: 0; opacity: .9; }
.vsg-diya { position: absolute; right: 9%; bottom: 7%; width: 22%; height: auto; filter: drop-shadow(0 0 14px rgba(251, 191, 36, .55)); }
.vsg-diya__flame { transform-origin: 50% 90%; animation: vsg-flicker 1.8s ease-in-out infinite; }
@keyframes vsg-flicker { 0%, 100% { transform: scale(1) rotate(0); } 30% { transform: scale(1.06, .94) rotate(-3deg); } 60% { transform: scale(.95, 1.07) rotate(2deg); } }
.vsg-art--next { color: rgba(196, 181, 253, .55); background: repeating-linear-gradient(135deg, rgba(196, 181, 253, .04) 0 10px, transparent 10px 20px), #1d1135; }
.vsg-bracket { width: 58%; height: auto; }

.vsg-drop__body { flex: 1; padding: 1.125rem 1.125rem .75rem; }
.vsg-drop__game { margin: 0; color: #fff; font-size: 1.1875rem; font-weight: 800; letter-spacing: -.01em; }
.vsg-drop__players { margin: .125rem 0 .625rem; color: var(--vsg-muted); font-size: .8125rem; font-weight: 600; }
.vsg-drop__text { margin: .75rem 0 0; color: var(--vsg-text); font-size: .875rem; line-height: 1.6; }
.vsg-modes { display: flex; flex-wrap: wrap; gap: .375rem; margin: 0; padding: 0; list-style: none; }
.vsg-mode { display: inline-flex; align-items: center; gap: .375rem; padding: .1875rem .5625rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.vsg-mode::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.vsg-mode--human { background: rgba(52, 211, 153, .14); color: #6ee7b7; }
.vsg-mode--ai { background: rgba(129, 140, 248, .18); color: #c7d2fe; }

.vsg-meter { display: flex; align-items: center; gap: .625rem; padding: .875rem 1.125rem 1.125rem; border-top: 1px solid var(--vsg-line); }
.vsg-meter__bars { display: flex; gap: 4px; }
.vsg-meter__bars span { width: 14px; height: 6px; border-radius: 3px; background: rgba(196, 181, 253, .18); }
.vsg-meter__bars .is-on { background: var(--vsg-gold); box-shadow: 0 0 8px rgba(251, 191, 36, .5); }
.vsg-meter__label { color: var(--vsg-muted); font-size: .75rem; font-weight: 600; }
.vsg-soon { display: flex; align-items: center; gap: .5rem; margin: 0; padding: .875rem 1.125rem 1.125rem; border-top: 1px dashed rgba(196, 181, 253, .25); color: #fde68a; font-size: .8125rem; font-weight: 700; }
.vsg-soon__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--vsg-gold); animation: vsg-blink 1.6s ease-in-out infinite; }
@keyframes vsg-blink { 50% { opacity: .25; } }

/* Leaderboard */
.vsg-board { display: grid; gap: 2rem; align-items: center; margin-top: 3.5rem; padding: 2rem; border: 1px solid rgba(251, 191, 36, .3); border-radius: 1.25rem; background: linear-gradient(120deg, rgba(251, 191, 36, .1), rgba(168, 85, 247, .08) 60%, transparent), rgba(36, 22, 64, .6); }
@media (min-width: 900px) { .vsg-board { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); padding: 2.25rem 2.5rem; } }
.vsg-board__title { margin: 0 0 .625rem; color: #fff; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.vsg-board p { max-width: 34rem; margin: 0; color: var(--vsg-text); font-size: 1rem; line-height: 1.7; }
.vsg-podium { display: flex; align-items: flex-end; justify-content: center; gap: .625rem; height: 10rem; }
.vsg-podium__step { position: relative; display: flex; flex-direction: column; align-items: center; gap: .5rem; width: 4.75rem; }
.vsg-podium__avatar { width: 2.5rem; height: 2.5rem; border-radius: .625rem; background: linear-gradient(160deg, #a78bfa, #6366f1); box-shadow: 0 0 0 3px rgba(255, 255, 255, .12); }
.vsg-podium__step--1 .vsg-podium__avatar { width: 3rem; height: 3rem; background: linear-gradient(160deg, #fde68a, #f59e0b); box-shadow: 0 0 0 3px rgba(251, 191, 36, .35), 0 0 24px rgba(251, 191, 36, .45); }
.vsg-podium__crown { position: absolute; top: -1.375rem; width: 1.75rem; height: auto; filter: drop-shadow(0 0 6px rgba(251, 191, 36, .6)); }
.vsg-podium__block { display: flex; align-items: flex-start; justify-content: center; width: 100%; padding-top: .5rem; border-radius: .5rem .5rem .25rem .25rem; background: rgba(196, 181, 253, .16); color: #fff; font-size: 1.125rem; font-weight: 800; }
.vsg-podium__step--1 .vsg-podium__block { height: 5.5rem; background: linear-gradient(180deg, rgba(251, 191, 36, .55), rgba(251, 191, 36, .15)); color: #1a1030; }
.vsg-podium__step--2 .vsg-podium__block { height: 4rem; }
.vsg-podium__step--3 .vsg-podium__block { height: 2.75rem; }

/* In every game */
.vsg-perks { margin-top: 2.5rem; }
.vsg-perks__title { margin: 0 0 1rem; color: var(--vsg-muted); font-size: .8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.vsg-perks ul { display: grid; gap: .75rem; margin: 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .vsg-perks ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .vsg-perks ul { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.vsg-perks li { display: grid; grid-template-columns: auto 1fr; gap: .25rem .875rem; padding: 1.125rem; border: 1px solid var(--vsg-line); border-radius: .875rem; background: rgba(36, 22, 64, .55); }
.vsg-perks__icon { grid-row: span 2; display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; border-radius: .625rem; background: rgba(251, 191, 36, .12); color: #fde68a; }
.vsg-perks__icon svg { width: 1.125rem; height: 1.125rem; }
.vsg-perks__name { margin: 0; color: #fff; font-size: .9375rem; font-weight: 700; }
.vsg-perks li p { margin: 0; color: var(--vsg-muted); font-size: .8125rem; line-height: 1.55; }
.vsg-perks li a { color: #fff; text-decoration: underline; text-decoration-color: rgba(251, 191, 36, .6); text-underline-offset: 2px; }

.vsg-board__champ { display: flex; align-items: center; gap: .5rem; margin: 1.25rem 0 .375rem; color: #fde68a; font-size: 1rem; font-weight: 700; }
.vsg-board__champ svg { width: 1.25rem; height: auto; }
.vsg-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Reveal: the cards appear in turn, only once JS has marked the section,
 * so the content is never hidden without it. */
.vsg.is-armed .vsg-drop { opacity: 0; transform: translateY(18px); }
.vsg.is-armed .vsg-drop__when::after { transform: scaleX(0); }
.vsg.is-armed .vsg-meter__bars .is-on { background: rgba(196, 181, 253, .18); box-shadow: none; }
.vsg.is-in .vsg-drop { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s ease; transition-delay: calc(var(--i) * 160ms); }
.vsg.is-in .vsg-drop__when::after { transform: scaleX(1); transition: transform .6s ease; transition-delay: calc(var(--i) * 160ms + 150ms); }
.vsg.is-in .vsg-meter__bars .is-on { background: var(--vsg-gold); box-shadow: 0 0 8px rgba(251, 191, 36, .5); transition: background-color .3s, box-shadow .3s; transition-delay: calc(var(--i) * 160ms + 350ms); }
.vsg.is-in .vsg-art__win { animation: vsg-draw .7s ease-out both; animation-delay: .6s; }
@keyframes vsg-pulse { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes vsg-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
    .vsg-eyebrow__dot::after, .vsg-diya__flame, .vsg-soon__dot { animation: none; }
    .vsg.is-armed .vsg-drop, .vsg.is-in .vsg-drop { opacity: 1; transform: none; transition: none; }
    .vsg.is-armed .vsg-drop__when::after { transform: none; }
    .vsg.is-armed .vsg-meter__bars .is-on { background: var(--vsg-gold); }
    .vsg-drop__card, .vsg-art__board, .vsg-art__ttt, .vsg-art__piece { transition: none; }
}
