/* ============================================================
   Cutscenes (rp/js/cutscene.js) and shared motion.
   Loaded by the NCAA RP and the Draft RP. Colours come from the page's
   accent: blue in the NCAA RP, red in the Draft RP, gold for champions.
   ============================================================ */

body.cs-open { overflow: hidden; }

.cs-show {
  --cs-a: #4FAEF5; --cs-a2: #9fd3ff; --cs-deep: #12305a; --cs-soft: rgba(79, 174, 245, 0.18);
  position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center;
  color: #fff; overflow: hidden; font-family: 'Asap Condensed', sans-serif;
  animation: csFade 0.35s ease both;
}
.cs-show.cs-draft { --cs-a: #F0566F; --cs-a2: #ffb3c0; --cs-deep: #4a1020; --cs-soft: rgba(240, 86, 111, 0.18); }
.cs-show.cs-gold  { --cs-a: #e8c35a; --cs-a2: #fff1c2; --cs-deep: #3d2e08; --cs-soft: rgba(232, 195, 90, 0.18); }
@keyframes csFade { from { opacity: 0; } to { opacity: 1; } }

.cs-bg {
  position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 8%, var(--cs-deep) 0%, #070b16 58%, #02040a 100%);
}
.cs-bg::after {
  content: ''; position: absolute; inset: -20%;
  background: repeating-linear-gradient(115deg, color-mix(in srgb, var(--cs-a) 7%, transparent) 0 2px, transparent 2px 38px);
  animation: csSweep 9s linear infinite;
}
.cs-orb { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(60px); opacity: 0.35; }
.cs-orb.a { background: var(--cs-a); left: -25vmax; top: -30vmax; animation: csDrift 14s ease-in-out infinite alternate; }
.cs-orb.b { background: color-mix(in srgb, var(--cs-a) 40%, #6a3df0); right: -30vmax; bottom: -35vmax; animation: csDrift 17s ease-in-out infinite alternate-reverse; opacity: 0.22; }
@keyframes csSweep { from { transform: translateX(-6%); } to { transform: translateX(6%); } }
@keyframes csDrift { from { transform: translate(0, 0) scale(1); } to { transform: translate(8vmax, 6vmax) scale(1.15); } }

.cs-skip {
  position: absolute; top: 18px; right: 20px; z-index: 3; background: rgba(255,255,255,0.08); color: #fff;
  border: 1px solid rgba(255,255,255,0.35); border-radius: 999px; padding: 0.45rem 1.1rem; font: inherit; font-weight: 700; cursor: pointer;
  letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.8rem; transition: background 0.2s ease, transform 0.2s ease;
}
.cs-skip:hover { background: rgba(255,255,255,0.18); transform: translateY(-1px); }
.cs-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,0.08); z-index: 2; }
.cs-progress span { display: block; height: 100%; width: 0; background: var(--cs-a); transition: width 0.6s ease; box-shadow: 0 0 12px var(--cs-a); }
.cs-nav { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; z-index: 3; }
.cs-nav-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.08); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: background 0.2s ease, opacity 0.2s ease; }
.cs-nav-btn.cs-pause { font-size: 10px; letter-spacing: -1px; }
.cs-nav-btn:hover:not(:disabled) { background: rgba(255,255,255,0.2); }
.cs-nav-btn:disabled { opacity: 0.25; cursor: default; }
.cs-nav-btn[hidden] { display: none; }
.cs-dots { display: flex; gap: 6px; }
.cs-dots i { width: 8px; height: 8px; border-radius: 50%; cursor: pointer; background: rgba(255,255,255,0.22); transition: background 0.3s ease, transform 0.3s ease; }
.cs-dots i.cur { box-shadow: 0 0 0 2px rgba(255,255,255,0.35); }
.cs-paused .cs-progress span { animation: none; opacity: 0.5; }
.cs-dots i.on { background: var(--cs-a); transform: scale(1.25); }

.cs-stage { position: relative; z-index: 1; width: min(1100px, 92vw); max-height: 86vh; overflow: auto; text-align: center; padding: 1rem 6px 2.5rem; scrollbar-width: none; }
.cs-scene { animation: csIn 0.7s cubic-bezier(.2,.8,.2,1) both; }
@keyframes csIn { from { opacity: 0; transform: translateY(24px) scale(0.97); } to { opacity: 1; transform: none; } }

.cs-kicker { font-family: 'Oswald', sans-serif; letter-spacing: 0.3em; text-transform: uppercase; color: var(--cs-a2); font-size: 0.95rem; animation: csIn 0.6s both; }
.cs-title {
  font-family: 'Oswald', sans-serif; font-weight: 700; text-transform: uppercase; line-height: 0.92;
  font-size: clamp(3rem, 10.5vw, 7.6rem); letter-spacing: 0.02em; margin: 0.6rem 0;
  background: linear-gradient(180deg, #fff 30%, var(--cs-a2)); -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: csPop 1.1s cubic-bezier(.2,1.4,.3,1) both;
}
.cs-title.small, .cs-title .small { display: block; font-size: clamp(2.1rem, 6.5vw, 4.4rem); }
@keyframes csPop { from { opacity: 0; transform: scale(1.35); letter-spacing: 0.3em; } to { opacity: 1; transform: none; } }
.cs-sub { font-size: 1.2rem; color: #c9d6e6; animation: csIn 0.8s 0.5s both; }
.cs-h { font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.08em; font-size: clamp(1.6rem, 4vw, 2.6rem); margin-bottom: 0.4rem; color: #fff; }
.cs-lede { color: #b8c4d4; font-size: 1.05rem; margin: 0 auto 1.3rem; max-width: 640px; }
.cs-h + .cs-grid, .cs-h + .cs-list, .cs-h + .cs-cards { margin-top: 1rem; }

.cs-item { opacity: 0; animation: csItem 0.55s cubic-bezier(.2,.9,.3,1.2) forwards; animation-delay: var(--d, 0ms); }
@keyframes csItem { from { opacity: 0; transform: translateY(16px) scale(0.92); } to { opacity: 1; transform: none; } }

.cs-logo { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; }
.cs-logo.big { width: 150px; height: 150px; filter: drop-shadow(0 12px 30px color-mix(in srgb, var(--cs-a) 45%, transparent)); animation: csLogo 1.2s cubic-bezier(.2,1.3,.3,1) both; }
.cs-logo.mid { width: 80px; height: 80px; }
@keyframes csLogo { from { opacity: 0; transform: scale(0.4) rotate(-12deg); } to { opacity: 1; transform: none; } }

/* Cards: a grid of team/player tiles */
.cs-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.9rem; }
.cs-card {
  background: linear-gradient(180deg, var(--cs-soft), rgba(255,255,255,0.03)); border: 1px solid color-mix(in srgb, var(--cs-a) 45%, transparent);
  border-radius: 16px; padding: 1.1rem 0.8rem; display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
}
.cs-card .cs-logo { width: 64px; height: 64px; margin: 0.2rem 0 0.3rem; }
.cs-card-kicker { font-family: 'Oswald', sans-serif; letter-spacing: 0.18em; text-transform: uppercase; color: var(--cs-a2); font-size: 0.78rem; }
.cs-card-name { font-family: 'Oswald', sans-serif; font-size: 1.2rem; text-transform: uppercase; line-height: 1.1; }
.cs-card-meta { color: #aab7c8; font-size: 0.85rem; }
.cs-card-big { font-family: 'Oswald', sans-serif; font-size: 2rem; font-weight: 700; color: var(--cs-a2); line-height: 1; }

/* Rows: a ranked list */
.cs-list { display: grid; gap: 6px; text-align: left; max-width: 760px; margin: 0 auto; }
.cs-list.two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; column-gap: 18px; }
.cs-row { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 10px; padding: 6px 12px; min-width: 0; }
.cs-row .cs-logo { width: 26px; height: 26px; }
.cs-rank { font-family: 'Oswald', sans-serif; font-weight: 700; color: var(--cs-a2); min-width: 24px; text-align: right; }
.cs-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-meta { color: #9fb0c4; font-size: 0.85rem; margin-left: auto; white-space: nowrap; }
.cs-row.good { border-color: rgba(61,220,132,0.6); }
.cs-row.bad { border-color: rgba(229,72,77,0.6); }
.cs-arrow { color: var(--cs-a2); font-weight: 700; margin: 0 2px; }

/* Big numbers */
.cs-stats { display: flex; justify-content: center; gap: 2.2rem; flex-wrap: wrap; margin-top: 1.4rem; }
.cs-stat b { display: block; font-family: 'Oswald', sans-serif; font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1; color: #fff; }
.cs-stat span { color: #9fb0c4; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; }

.cs-actions { display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; margin-top: 1.8rem; animation: csIn 0.6s 0.4s both; }
.cs-btn {
  font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.06em; font-size: 1rem;
  padding: 0.75rem 1.6rem; border-radius: 999px; cursor: pointer; border: 1px solid rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.06); color: #fff; transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.cs-btn:hover { transform: translateY(-2px); background: rgba(255,255,255,0.14); }
.cs-btn.primary { background: var(--cs-a); border-color: var(--cs-a); color: #07101c; font-weight: 700; box-shadow: 0 10px 30px color-mix(in srgb, var(--cs-a) 40%, transparent); }
.cs-btn.primary:hover { box-shadow: 0 14px 38px color-mix(in srgb, var(--cs-a) 55%, transparent); }

/* Confetti for champions */
.cs-confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.cs-confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; opacity: 0.9;
  animation: csConfetti var(--dur) linear var(--delay) infinite; transform: rotate(var(--rot)); }
@keyframes csConfetti { to { transform: translateY(110vh) rotate(calc(var(--rot) + 720deg)); } }

/* Selection Sunday specifics */
.sel-autos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.5rem; }
.sel-auto { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; padding: 6px 8px; }
.sel-auto .cs-logo { grid-row: span 2; }
.sel-auto span { font-weight: 700; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-auto small { color: #9fb3c8; font-size: 0.72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-region { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: column; grid-template-rows: repeat(8, auto); gap: 6px 18px; text-align: left; }
.sel-ff { display: inline-grid; place-items: center; font-size: 0.7rem; font-weight: 700; border: 1px solid rgba(255,255,255,0.4); border-radius: 50%; width: 26px; height: 26px; }
.cs-bubble { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; text-align: left; }
.cs-bubble h3 { font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.6rem; }
.cs-bubble > div { display: grid; gap: 6px; align-content: start; }

/* Draft night: one pick on the stage at a time */
.cs-pick { display: grid; justify-items: center; gap: 0.5rem; }
.cs-pick-no { font-family: 'Oswald', sans-serif; font-size: clamp(3rem, 9vw, 6rem); line-height: 1; color: var(--cs-a2); animation: csPop 0.8s cubic-bezier(.2,1.4,.3,1) both; }
.cs-pick-team { display: flex; align-items: center; gap: 0.7rem; font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.06em; font-size: 1.2rem; animation: csIn 0.6s 0.2s both; }
.cs-pick-team img { width: 54px; height: 54px; object-fit: contain; }
.cs-pick-select { color: #b8c4d4; letter-spacing: 0.2em; text-transform: uppercase; font-size: 0.85rem; animation: csIn 0.6s 0.6s both; }
.cs-pick-name { font-family: 'Oswald', sans-serif; font-weight: 700; text-transform: uppercase; font-size: clamp(2.2rem, 7vw, 4.6rem); line-height: 1; animation: csPop 0.9s 0.9s cubic-bezier(.2,1.4,.3,1) both; }
.cs-pick-meta { color: #c9d6e6; font-size: 1.05rem; animation: csIn 0.6s 1.3s both; }

@media (max-width: 700px) {
  .cs-list.two { grid-template-columns: 1fr; }
  .sel-region { grid-template-columns: 1fr; grid-auto-flow: row; grid-template-rows: none; }
  .cs-bubble { grid-template-columns: 1fr; }
  .cs-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-logo.big { width: 110px; height: 110px; }
}
@media (prefers-reduced-motion: reduce) {
  .cs-bg::after, .cs-orb, .cs-title, .cs-sub, .cs-scene, .cs-item, .cs-kicker, .cs-logo.big, .cs-actions,
  .cs-pick-no, .cs-pick-team, .cs-pick-select, .cs-pick-name, .cs-pick-meta { animation: none !important; opacity: 1 !important; }
  .cs-confetti { display: none; }
}

/* ============================================================
   Shared motion for the RP apps
   ============================================================ */
@keyframes rpRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rpPop { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes rpShine { from { background-position: -200% 0; } to { background-position: 200% 0; } }
.rp-rise { animation: rpRise 0.45s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--d, 0ms); }
.rp-stagger > * { animation: rpRise 0.45s cubic-bezier(.2,.8,.2,1) both; }
.rp-stagger > *:nth-child(1) { animation-delay: 20ms; } .rp-stagger > *:nth-child(2) { animation-delay: 60ms; }
.rp-stagger > *:nth-child(3) { animation-delay: 100ms; } .rp-stagger > *:nth-child(4) { animation-delay: 140ms; }
.rp-stagger > *:nth-child(5) { animation-delay: 180ms; } .rp-stagger > *:nth-child(6) { animation-delay: 220ms; }
.rp-stagger > *:nth-child(7) { animation-delay: 260ms; } .rp-stagger > *:nth-child(8) { animation-delay: 300ms; }
.rp-stagger > *:nth-child(n+9) { animation-delay: 340ms; }

/* A small toast for "week simulated" style news */
.rp-toast-wrap { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 350; display: grid; gap: 8px; pointer-events: none; width: min(560px, calc(100vw - 32px)); }
.rp-toast {
  pointer-events: auto; background: var(--card-bg, #101319); color: var(--text-main, #fff); border: 1px solid var(--border, #222833);
  border-left: 4px solid var(--accent, #4FAEF5); border-radius: 12px; padding: 0.7rem 1rem; box-shadow: 0 16px 40px rgba(0,0,0,0.45);
  display: flex; gap: 0.75rem; align-items: center; animation: rpToastIn 0.45s cubic-bezier(.2,1.2,.3,1) both;
}
.rp-toast.out { animation: rpToastOut 0.35s ease forwards; }
.rp-toast b { font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.04em; }
.rp-toast small { display: block; color: var(--text-muted, #98a2b3); font-size: 0.85rem; }
@keyframes rpToastIn { from { opacity: 0; transform: translateY(20px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes rpToastOut { to { opacity: 0; transform: translateY(12px); } }

@media (prefers-reduced-motion: reduce) {
  .rp-rise, .rp-stagger > *, .rp-toast { animation: none !important; }
}
