/* ---------------- THE STAR ROAD (js/road.js, js/gift.js, js/scenes/road.js) ---------------- */

/* the stars pill in the top bar: ★ 7 · ●○ 🎁  (tap = the Star Road) */
#topbar #starsPill { margin-left: 0; display: flex; align-items: center; gap: 6px; border: 0; cursor: pointer; font: inherit; font-weight: 800; color: #5a2d4c; background: #fff6d6; }
#topbar #starsPill:active { transform: translateY(2px); }
#starsPill .sp-star { display: block; line-height: 0; }
#starsPill .sp-road { display: inline-flex; align-items: center; gap: 1px; padding-left: 6px; border-left: 2px dashed #ecd28a; }
#starsPill .sp-road .sto { display: block; flex: 0 0 auto; }
#starsPill .st { width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid #e3b84a; box-sizing: border-box; flex: 0 0 auto; }
#starsPill .st.on { background: #ffd23f; border-color: #c98a1a; }
#starsPill .sp-gift, #starsPill .sp-done { display: block; line-height: 0; }
#starsPill .sp-gift { animation: spGift 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
#starsPill.bump { animation: spBump .42s cubic-bezier(.3,1.8,.5,1); }
@keyframes spBump { 40% { transform: scale(1.22); } }
@keyframes spGift { 0%, 78%, 100% { transform: none; } 84% { transform: rotate(-12deg); } 90% { transform: rotate(10deg); } 95% { transform: rotate(-5deg); } }
@media (max-height: 500px) { #starsPill .st { width: 8px; height: 8px; } }

/* a locked thing: an empty star per star still to go, or a wrapped present when far */
.road-lock { display: inline-flex; align-items: center; gap: 1px; padding: 2px 5px; border-radius: 12px; background: #fff; border: 2px solid #5a2d4c; box-shadow: 0 2px 0 rgba(90,45,76,.2); line-height: 0; white-space: nowrap; }
.road-lock svg { display: block; flex: 0 0 auto; }
.road-lock.far { padding: 1px 5px; }

/* stars flying up from a results card into the pill */
.fly-star { position: fixed; z-index: 9500; width: 44px; height: 44px; pointer-events: none; will-change: transform; }
.fly-star svg { display: block; filter: drop-shadow(0 3px 2px rgba(90,45,76,.3)); }

/* the present */
.gift-ov { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(90,45,76,.42); opacity: 0; transition: opacity .25s; }
.gift-ov.in { opacity: 1; }
.gift-ov.out { opacity: 0; }
.gf-card { position: relative; width: min(420px, 100%); max-height: 100%; box-sizing: border-box; padding: 18px 20px 24px; border-radius: 32px; background: radial-gradient(circle at 50% 38%, #ffffff, #ffeef5 72%); border: 5px solid #5a2d4c; box-shadow: 0 10px 0 rgba(90,45,76,.25); text-align: center; color: #5a2d4c; transform: scale(.6); transition: transform .45s cubic-bezier(.3,1.6,.5,1); overflow: hidden; }
.gift-ov.in .gf-card { transform: none; }
.gf-title { position: relative; z-index: 2; font-size: 34px; font-weight: 900; }
.gf-tap { border: 0; background: none; padding: 0; cursor: pointer; display: block; margin: 4px auto 0; }
.gf-tap .gf-box { display: block; overflow: visible; animation: gfShake 1.2s ease-in-out infinite; transform-origin: 50% 90%; }
.gift-ov.open .gf-tap .gf-box { animation: none; }
.gift-ov.open .gf-lid { transform: translate(40px, -170px) rotate(35deg); opacity: 0; transition: transform .45s cubic-bezier(.3,0,.6,1), opacity .35s .1s; }
.gf-hint { font-size: 21px; font-weight: 900; color: #ff4f93; margin-top: 2px; animation: gfPulse 1.2s ease-in-out infinite; }
.gf-prize { position: relative; }
.gf-rays { position: absolute; left: 50%; top: 96px; width: 380px; height: 380px; margin: -190px 0 0 -190px; border-radius: 50%; background: repeating-conic-gradient(rgba(255,210,63,.42) 0deg 10deg, transparent 10deg 30deg); -webkit-mask: radial-gradient(circle, #000 28%, transparent 70%); mask: radial-gradient(circle, #000 28%, transparent 70%); animation: gfSpin 9s linear infinite; }
.gf-art { position: relative; animation: gfPop .55s cubic-bezier(.3,1.7,.5,1) both; }
.gf-art svg { display: block; margin: 0 auto; overflow: visible; }
.gf-name { position: relative; font-size: 32px; font-weight: 900; margin-top: 4px; line-height: 1.1; }
.gf-where { position: relative; font-size: 19px; font-weight: 800; opacity: .78; margin-top: 2px; }
.gf-yay { position: relative; margin-top: 14px; padding: 10px 46px; font-size: 26px; font-weight: 900; color: #fff; background: #ff5fa2; border: 4px solid #5a2d4c; border-radius: 40px; box-shadow: 0 5px 0 #5a2d4c; cursor: pointer; font-family: inherit; }
.gf-yay:active { transform: translateY(3px); box-shadow: 0 2px 0 #5a2d4c; }
@keyframes gfShake { 0%, 55%, 100% { transform: none; } 62% { transform: rotate(-7deg) scale(1.03); } 69% { transform: rotate(7deg) scale(1.03); } 76% { transform: rotate(-4deg); } 83% { transform: rotate(3deg); } }
@keyframes gfPulse { 50% { transform: scale(1.08); } }
@keyframes gfSpin { to { transform: rotate(360deg); } }
@keyframes gfPop { 0% { transform: scale(.2) rotate(-20deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
@media (max-height: 520px) {
  .gf-card { padding: 10px 16px 14px; }
  .gf-title { font-size: 26px; }
  .gf-tap .gf-box { width: 170px; height: 178px; }
  .gf-art svg { width: 130px; height: 130px; }
  .gf-rays { top: 66px; width: 280px; height: 280px; margin: -140px 0 0 -140px; }
  .gf-name { font-size: 26px; }
  .gf-yay { margin-top: 8px; padding: 6px 40px; font-size: 22px; }
}

/* the Star Road page (the page kit: floating top bar, cafe wallpaper) */
body.scene-road { background: #ffeef5; }
body.scene-road #topbar { position: absolute; left: 0; right: 0; top: 0; z-index: 50; background: none; border-bottom: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; pointer-events: none; }
body.scene-road #topbar > * { pointer-events: auto; }
.rd .pk-body { overflow: hidden; background: #c9f0dd; }
.rd .pk-sign { display: none; }
.rd-scroll { position: absolute; inset: 0; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; touch-action: pan-x; }
.rd-scroll::-webkit-scrollbar { display: none; }
.rd-svg { display: block; }
.rd-meter { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); pointer-events: none; filter: drop-shadow(0 2px 0 rgba(90,45,76,.15)); }
.rd-token { transition: transform .38s cubic-bezier(.3,1.3,.5,1); }
.rd-token.hop .rd-bob { animation: rdHop .4s ease-out; }
@keyframes rdHop { 0% { transform: none; } 45% { transform: translateY(-46px); } 100% { transform: none; } }
.rd-prize, .rd-token { cursor: pointer; }
.rd-prize.next .rd-wrap { animation: rdNext 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.rd-prize.wig { animation: rdWig .45s ease-in-out; transform-box: fill-box; transform-origin: 50% 100%; }
.rd-bob { animation: rdBob 1.5s ease-in-out infinite; }
@keyframes rdNext { 0%, 100% { transform: none; } 50% { transform: translateY(-6px) scale(1.05); } }
@keyframes rdWig { 25% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } 75% { transform: rotate(-4deg); } }
@keyframes rdBob { 0%, 100% { transform: none; } 50% { transform: translateY(-8px); } }

/* in the games' pickers the road badge replaces the purple lock pill */
.ch-card .ch-lock.road, .mxs .lock.road { background: none; border: 0; padding: 0; height: auto; box-shadow: none; }

/* "+1 ★" on a Free creation's photo card (it flies up to the top bar) */
.road-plus { display: inline-flex; align-items: center; gap: 2px; margin-left: 10px; font-weight: 900; vertical-align: middle; }
.road-plus svg { display: block; width: 24px; height: 24px; }

/* the Noodles score card's stars */
.reveal .rv-stars { display: flex; justify-content: center; gap: 6px; margin: 2px 0 6px; }
.reveal .rv-stars svg { display: block; }
.gift-ov [hidden] { display: none !important; }

/* ---------------- REWARDS v2: presents wait, surprise boxes, "Use it!" ---------------- */
.gf-why { position: relative; z-index: 2; font-size: 19px; font-weight: 800; color: #7b5ad6; margin-top: -2px; }
.gift-ov.is-box .gf-card { background: radial-gradient(circle at 50% 38%, #ffffff, #efe8ff 72%); }
.gift-ov.is-box .gf-title { color: #6a48c9; }
.gift-ov.is-box .gf-tap .gf-box { animation: gfShakeBig 1s ease-in-out infinite; }
.gift-ov.is-box .gf-rays { background: repeating-conic-gradient(rgba(169,140,240,.4) 0deg 10deg, transparent 10deg 30deg); }
@keyframes gfShakeBig { 0%, 45%, 100% { transform: none; } 52% { transform: rotate(-9deg) translateY(-6px) scale(1.04); } 60% { transform: rotate(9deg) translateY(-8px) scale(1.04); } 68% { transform: rotate(-6deg); } 76% { transform: rotate(4deg); } }
.gf-art .gf-tool { transform: rotate(-14deg); }
.gf-btns { position: relative; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.gf-use { position: relative; margin-top: 14px; padding: 10px 34px; font-size: 26px; font-weight: 900; color: #fff; background: #3fbf8a; border: 4px solid #5a2d4c; border-radius: 40px; box-shadow: 0 5px 0 #5a2d4c; cursor: pointer; font-family: inherit; animation: gfPulse 1.3s ease-in-out infinite; }
.gf-use:active { transform: translateY(3px); box-shadow: 0 2px 0 #5a2d4c; animation: none; }
.gf-yay.alt { padding: 10px 30px; background: #ff8fb8; }
@media (max-height: 520px) {
  .gf-why { font-size: 16px; }
  .gf-art .gf-tool { width: 66px; height: 132px; }
  .gf-use { margin-top: 8px; padding: 6px 26px; font-size: 22px; }
  .gf-yay.alt { padding: 6px 24px; }
}
