/* YayCrate Moments 1.2. Brand orange #E8590C for art, #C2410C behind white text (5.2:1). Nothing flashes. */
.yc-ticker { position: relative; display: flex; align-items: center; background: #C2410C; color: #fff; font-size: 14px;
	line-height: 1; height: 36px; overflow: hidden; z-index: 30; }
.yc-ticker__track { display: flex; width: max-content; animation: yc-scroll 38s linear infinite; }
.yc-ticker__row { display: flex; align-items: center; flex-shrink: 0; }
.yc-ticker__item { padding: 0 18px; white-space: nowrap; font-weight: 600; letter-spacing: .01em; }
.yc-ticker__dot { opacity: .7; }
.yc-ticker:hover .yc-ticker__track, .yc-ticker:focus-within .yc-ticker__track, .yc-ticker.is-paused .yc-ticker__track { animation-play-state: paused; }
.yc-ticker__pause { position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; border: 0; border-radius: 12px;
	background: #9A3412; color: #fff; font-size: 10px; cursor: pointer; padding: 0; box-shadow: -16px 0 12px 6px #C2410C; }
.yc-ticker__pause:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@keyframes yc-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* The treasure crate: square layers stacked in one box (tools/brand.py renders them at the same size). */
.yc-scene { position: relative; width: 280px; max-width: 72vw; aspect-ratio: 1; margin: -18px auto -6px; }
.yc-scene img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; }
.yc-scene .yc-l-back, .yc-scene .yc-l-loot, .yc-scene .yc-l-spill, .yc-scene .yc-l-glints { opacity: 0; }
.yc-scene .yc-l-loot { transform: translateY(18%) scale(.92); transform-origin: 50% 60%; }
.yc-scene .yc-l-back { transform: scale(.6); transform-origin: 50% 40%; }
.yc-scene .yc-l-lid { transform-origin: 30% 46%; }
.yc-scene .yc-drop { position: absolute; inset: 0; transform-origin: 50% 92%; }
.yc-scene .yc-seam { position: absolute; left: 20%; right: 12%; top: 44%; height: 3%; border-radius: 99px; opacity: 0;
	background: radial-gradient(closest-side, #FFF7D6, #FCD34D 55%, rgba(252, 211, 77, 0)); filter: blur(3px); }
.yc-scene .yc-dust { position: absolute; bottom: 4%; width: 18%; aspect-ratio: 2; border-radius: 50%; opacity: 0;
	background: radial-gradient(closest-side, rgba(214, 211, 209, .9), rgba(214, 211, 209, 0)); }
.yc-scene .yc-dust--l { left: 10%; } .yc-scene .yc-dust--r { right: 8%; } .yc-scene .yc-dust--m { left: 41%; bottom: 1%; }

/* 1 the drop: it falls in and lands with a squash and a puff of dust */
.yc-scene.is-arriving .yc-drop { animation: yc-fall .75s cubic-bezier(.55, 0, .75, .45) both, yc-squash .4s ease-out .75s both; }
@keyframes yc-fall { from { transform: translateY(-150%) rotate(-5deg); } to { transform: translateY(0) rotate(0); } }
@keyframes yc-squash { 0%, 100% { transform: scale(1, 1); } 40% { transform: scale(1.06, .9); } 75% { transform: scale(.98, 1.03); } }
.yc-scene.is-arriving .yc-dust { animation: yc-dust .9s ease-out .72s both; }
.yc-scene.is-arriving .yc-dust--r { animation-delay: .76s; }
@keyframes yc-dust { 0% { opacity: .9; transform: scale(.4) translateY(0); } 100% { opacity: 0; transform: scale(1.8) translateY(-30%); } }

/* 2 anticipation: it rattles, the lid jumps, gold light leaks from the seam */
.yc-scene.is-ready .yc-drop { animation: yc-rattle 1.25s ease-in-out .15s infinite; }
@keyframes yc-rattle { 0%, 52%, 100% { transform: rotate(0); } 60% { transform: rotate(-3.5deg); } 68% { transform: rotate(3.5deg); }
	76% { transform: rotate(-2.5deg); } 84% { transform: rotate(1.5deg); } }
.yc-scene.is-ready .yc-l-lid { animation: yc-lid-jump 1.25s ease-in-out .15s infinite; }
@keyframes yc-lid-jump { 0%, 55%, 100% { transform: translateY(0) rotate(0); } 63% { transform: translateY(-4%) rotate(-4deg); }
	72% { transform: translateY(0); } 80% { transform: translateY(-2.5%) rotate(-2deg); } }
.yc-scene.is-ready .yc-seam { animation: yc-seam 1.25s ease-in-out .15s infinite; }
@keyframes yc-seam { 0%, 50%, 100% { opacity: .15; } 62%, 84% { opacity: 1; } }

/* 3 the burst: the lid blows off, the treasure rises, the light comes up */
.yc-scene.is-open .yc-l-lid { animation: yc-lid-off .85s cubic-bezier(.2, .7, .35, 1) forwards; }
@keyframes yc-lid-off { 0% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(2%, -12%) rotate(-10deg); }
	100% { transform: translate(55%, -95%) rotate(-60deg); opacity: 0; } }
.yc-scene.is-open .yc-l-loot { animation: yc-rise .6s cubic-bezier(.2, .9, .3, 1.15) .12s forwards; }
@keyframes yc-rise { to { opacity: 1; transform: translateY(0) scale(1); } }
.yc-scene.is-open .yc-l-back { animation: yc-light .7s ease-out .1s forwards, yc-breathe 3s ease-in-out .8s infinite; }
@keyframes yc-light { to { opacity: 1; transform: scale(1); } }
@keyframes yc-breathe { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.04); opacity: .85; } }
.yc-scene.is-open .yc-l-spill { animation: yc-fade .5s ease-out .45s forwards; }
.yc-scene.is-open .yc-l-glints { animation: yc-fade .4s ease-out .6s forwards, yc-twinkle 2.2s ease-in-out 1s infinite; }
@keyframes yc-fade { to { opacity: 1; } }
@keyframes yc-twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.yc-scene.is-open .yc-seam { opacity: 0; transition: opacity .2s; }
.yc-scene.is-open .yc-drop { animation: yc-thump .45s ease-out; }
@keyframes yc-thump { 0%, 100% { transform: scale(1); } 35% { transform: scale(1.05, .95); } }

/* the YAY! stamp */
.yc-scene .yc-stamp { position: absolute; inset: auto; left: 50%; top: 2%; width: 44%; height: auto; opacity: 0; pointer-events: none;
	transform: translateX(-50%) rotate(-8deg) scale(2.2); filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .25)); }
.yc-scene.is-open .yc-stamp { animation: yc-stamp .5s cubic-bezier(.2, .9, .3, 1.4) .35s forwards; }
@keyframes yc-stamp { to { opacity: 1; transform: translateX(-50%) rotate(-8deg) scale(1); } }

/* The welcome crate */
.yc-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 16px; }
.yc-modal[hidden] { display: none; }
.yc-modal__shade { position: absolute; inset: 0; background: rgba(31, 36, 48, .6); }
.yc-modal__box { position: relative; width: min(400px, 100%); color: #1F2430; border-radius: 20px; padding: 10px 24px 22px;
	text-align: center; box-shadow: 0 24px 70px rgba(0, 0, 0, .35); overflow: hidden;
	background: radial-gradient(120% 70% at 50% 18%, #FFF8E6 0%, #FFFFFF 62%); }
.yc-modal__close { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border: 0; background: rgba(255, 255, 255, .7);
	font-size: 22px; line-height: 1; cursor: pointer; color: #1F2430; border-radius: 18px; z-index: 3; }
.yc-modal__close:focus-visible, .yc-btn:focus-visible { outline: 3px solid #C2410C; outline-offset: 2px; }
.yc-modal h2 { position: relative; margin: 2px 0 4px; font-size: 22px; line-height: 1.25; }
.yc-modal p { margin: 4px 0 14px; }
.yc-code { position: relative; overflow: hidden; display: inline-block; font: 800 26px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace;
	letter-spacing: .08em; border: 2px dashed #B7860B; border-radius: 10px; padding: 8px 16px; margin: 2px 0 12px; color: #7C2D12;
	background: linear-gradient(180deg, #FFF9E5, #FDEFC4); }
.yc-code::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .9), transparent); animation: yc-shine 1.1s ease-out .3s 2; }
@keyframes yc-shine { to { left: 130%; } }
.yc-btn { display: inline-block; border: 0; border-radius: 999px; background: #C2410C; color: #fff; font-weight: 700;
	padding: 12px 22px; font-size: 16px; cursor: pointer; margin: 4px; text-decoration: none; }
.yc-btn--ghost { background: #FFF7ED; color: #7C2D12; }
.yc-small { font-size: 13px; color: #5F6B7D; }
.yc-reveal { animation: yc-up .45s cubic-bezier(.2, .8, .3, 1.1) both; }
@keyframes yc-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Phones: a small crate tab instead of a popup */
.yc-tab { position: fixed; left: 12px; bottom: 14px; z-index: 9998; display: flex; align-items: center; gap: 6px;
	background: #1F2430; color: #fff; border: 0; border-radius: 999px; padding: 6px 14px 6px 6px; font-weight: 700;
	font-size: 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); cursor: pointer; }
.yc-tab[hidden] { display: none; }
.yc-tab img { width: 34px; height: 34px; }
.yc-tab.is-new { animation: yc-wiggle 1.2s ease-in-out 2; }
@keyframes yc-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }

/* Bursts: coins that fly up and flip, confetti, soft firework dots; never a flash */
.yc-burst { position: fixed; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 100000; }
.yc-bit { position: absolute; width: 8px; height: 12px; border-radius: 2px; opacity: 0;
	animation: yc-bit 1.4s cubic-bezier(.15, .7, .3, 1) forwards; }
.yc-bit--dot { width: 7px; height: 7px; border-radius: 50%; animation-duration: 1.6s; }
@keyframes yc-bit { 0% { transform: translate(0, 0) rotate(0); opacity: 1; }
	100% { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; } }
.yc-coin { position: absolute; width: 0; height: 0; animation: yc-arc 1.5s cubic-bezier(.2, .6, .4, 1) forwards; }
.yc-coin b { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; box-sizing: border-box;
	border: 1.5px solid #7A4E05; animation: yc-flip .32s linear infinite;
	background: radial-gradient(circle at 35% 30%, #FFFBEB, #FCD34D 38%, #D4A017 78%, #92650A); }
@keyframes yc-arc { 0% { transform: translate(0, 0); opacity: 1; } 45% { transform: translate(calc(var(--x) * .6), var(--up)); opacity: 1; }
	100% { transform: translate(var(--x), var(--down)); opacity: 0; } }
@keyframes yc-flip { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.12); } }

/* Add to cart: the cart icon bounces and a small note pops */
.yc-bounce { animation: yc-bounce .6s ease-out 1; }
@keyframes yc-bounce { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.25) rotate(-6deg); } 70% { transform: scale(.95); } }
.yc-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100001; background: #1F2430;
	color: #fff; border-radius: 999px; padding: 10px 18px; font-weight: 700; font-size: 15px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
	animation: yc-toast 2.4s ease forwards; }
@keyframes yc-toast { 0% { opacity: 0; transform: translate(-50%, 12px); } 12%, 82% { opacity: 1; transform: translate(-50%, 0); }
	100% { opacity: 0; transform: translate(-50%, -6px); } }

/* Order received: the crate opens above the order details */
.yc-celebrate { text-align: center; margin: 8px auto 24px; padding: 4px 16px 10px; max-width: 640px; border-radius: 22px;
	background: radial-gradient(90% 75% at 50% 30%, #FFF8E6 0%, rgba(255, 255, 255, 0) 70%); }
.yc-celebrate .yc-scene { width: 300px; }
.yc-celebrate h2 { margin: 6px 0 4px; font-size: clamp(22px, 4vw, 30px); }
.yc-celebrate p { margin: 0; color: #5F6B7D; }

/* The loader: while the order goes through, the crate hops and light leaks from its lid */
.yc-loader { position: fixed; inset: 0; z-index: 100002; display: flex; flex-direction: column; align-items: center;
	justify-content: center; gap: 10px; background: rgba(255, 248, 230, .9); color: #1F2430; font-weight: 700; font-size: 18px; }
.yc-loader[hidden] { display: none; }
.yc-loader .yc-hop { position: relative; width: 120px; height: 120px; }
.yc-loader .yc-hop img { width: 100%; height: 100%; display: block; animation: yc-hop .9s ease-in-out infinite; transform-origin: 50% 90%; }
.yc-loader .yc-hop::after { content: ""; position: absolute; left: 20%; right: 16%; top: 34%; height: 6%; border-radius: 99px;
	background: radial-gradient(closest-side, #FFF7D6, #FCD34D 55%, rgba(252, 211, 77, 0)); filter: blur(2px);
	animation: yc-seam .9s ease-in-out infinite; }
@keyframes yc-hop { 0%, 100% { transform: translateY(0) scale(1, 1); } 30% { transform: translateY(-14%) scale(.97, 1.04); }
	55% { transform: translateY(0) scale(1.06, .93); } 70% { transform: scale(1, 1); } }

@media (prefers-reduced-motion: reduce) {
	.yc-ticker__track { animation: none; flex-wrap: wrap; }
	.yc-ticker__row[aria-hidden="true"], .yc-ticker__pause { display: none; }
	.yc-ticker { height: auto; padding: 8px 0; justify-content: center; }
	.yc-scene *, .yc-loader *, .yc-loader .yc-hop::after, .yc-tab.is-new, .yc-bounce, .yc-toast, .yc-code::after, .yc-reveal { animation: none !important; }
	.yc-scene.is-open .yc-l-lid { opacity: 0; }
	.yc-scene.is-open .yc-l-loot, .yc-scene.is-open .yc-l-back, .yc-scene.is-open .yc-l-spill, .yc-scene.is-open .yc-l-glints,
	.yc-scene.is-open .yc-stamp { opacity: 1; transform: none; }
	.yc-scene.is-open .yc-stamp { transform: translateX(-50%) rotate(-8deg); }
}
