/*
 * ZB Cloud Cafe shared effects: the website and the pages the app embeds.
 * Plain CSS on purpose (the site uses the Tailwind CDN, no build step).
 * Everything stops for visitors who ask for less motion, and in the app
 * while a game is streaming (the app adds .zb-calm to <html>).
 */

/* Backdrop: the glow behind every page. Still (2026-12-03): moving it repainted the whole
   screen every frame (about half the GPU of a small PC with the app open). */
.zb-aurora {
    background:
        radial-gradient(55% 40% at 10% 0%, rgba(99, 102, 241, .28), transparent 70%),
        radial-gradient(45% 35% at 95% 85%, rgba(245, 158, 11, .12), transparent 70%),
        radial-gradient(40% 30% at 70% 10%, rgba(16, 185, 129, .08), transparent 70%);
}

/* Running light around a box. Put the content in a child with its own background
   and a radius 1.5px smaller than the box's. */
.zb-run { position: relative; overflow: hidden; isolation: isolate; padding: 1.5px; }
.zb-run::before {
    content: ""; position: absolute; left: 50%; top: 50%; width: 160%; aspect-ratio: 1;
    translate: -50% -50%; z-index: -1;
    background: conic-gradient(from 0deg, transparent 0deg, transparent 230deg, #6366f1 290deg, #34d399 330deg, #fbbf24 350deg, transparent 360deg);
    animation: zb-spin 5s linear infinite;
}
.zb-run.zb-gold::before {
    background: conic-gradient(from 0deg, transparent 0deg, transparent 240deg, #f59e0b 300deg, #fde68a 340deg, transparent 360deg);
    animation-duration: 4s;
}
.zb-run.zb-indigo::before {
    background: conic-gradient(from 0deg, transparent 0deg, transparent 240deg, #6366f1 300deg, #a5b4fc 340deg, transparent 360deg);
}
@keyframes zb-spin { to { rotate: 360deg; } }
/* Off screen (the page's script sets it): the light waits where it is. */
.zb-run.zb-paused::before { animation-play-state: paused; }

/* Buttons with a soft light behind them and a shine passing over. The light stays still and
   the shine moves by transform only (2026-12-03): a pulsing shadow and a shine moved by
   `left` were repainted every frame. */
.zb-glow {
    position: relative; overflow: hidden; isolation: isolate;
    background: linear-gradient(180deg, #34d399, #10b981); color: #04241a;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 9px 28px -5px rgba(16, 185, 129, .82);
    transition: filter .15s ease, transform .15s ease;
}
.zb-glow:hover { filter: brightness(1.08); color: #04241a; }
.zb-glow:active { transform: translateY(1px); }
.zb-glow.zb-indigo {
    background: linear-gradient(180deg, #818cf8, #6366f1); color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 9px 28px -5px rgba(116, 124, 245, .9);
}
.zb-glow.zb-indigo:hover { color: #fff; }
.zb-glow.zb-gold {
    background: linear-gradient(180deg, #fcd34d, #f59e0b); color: #3a2300;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 9px 28px -5px rgba(248, 175, 24, .88);
}
.zb-glow.zb-gold:hover { color: #3a2300; }
/* Same path as before (button width -60% → 130%): 40% wide, so -150% → 325% of itself. */
.zb-glow::after {
    content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: 0; z-index: -1;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
    transform: translateX(-150%);
    animation: zb-shine 3.6s ease-in-out infinite;
    pointer-events: none;
}
.zb-glow:disabled, .zb-glow[aria-disabled="true"] { filter: grayscale(.8) brightness(.7); animation: none; cursor: not-allowed; }
.zb-glow:disabled::after, .zb-glow[aria-disabled="true"]::after { display: none; }
@keyframes zb-shine { 0%, 55% { transform: translateX(-150%); } 85%, 100% { transform: translateX(325%); } }

/* Cards that rise a little under the mouse. */
.zb-lift { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
@media (hover: hover) {
    .zb-lift:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .8), 0 0 0 1px rgba(129, 140, 248, .35); }
}
.zb-card {
    background: linear-gradient(180deg, rgba(28, 28, 36, .92), rgba(16, 16, 22, .92));
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .85);
}

/* "Live" dot with a ping. */
.zb-live { position: relative; display: inline-block; width: 8px; height: 8px; flex: none; border-radius: 9999px; background: #34d399; }
.zb-live::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: inherit; animation: zb-ping 1.6s ease-out infinite; }
.zb-live.zb-amber { background: #fbbf24; }
.zb-live.zb-rose { background: #fb7185; }
@keyframes zb-ping { from { transform: scale(1); opacity: .7; } to { transform: scale(3); opacity: 0; } }

/* News line: the text is written twice inside .zb-ticker so the loop is seamless. */
.zb-ticker { display: inline-block; white-space: nowrap; animation: zb-tick var(--zb-tick, 40s) linear infinite; }
.zb-ticker:hover { animation-play-state: paused; }
.zb-marquee { display: flex; width: max-content; animation: zb-tick var(--zb-tick, 50s) linear infinite; }
.zb-marquee:hover, .zb-marquee:focus-within { animation-play-state: paused; }
@keyframes zb-tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Slides: a track of full-width panels moved by the script in the page. */
.zb-track { display: flex; height: 100%; transition: transform .7s cubic-bezier(.2, .8, .2, 1); }
.zb-track > * { flex: 0 0 100%; min-width: 0; }

/* Menu button in the top bar: the current page gets a glowing underline. */
.zb-nav-on { position: relative; }
.zb-nav-on::after {
    content: ""; position: absolute; left: 14px; right: 14px; bottom: -13px; height: 3px; border-radius: 3px;
    background: linear-gradient(90deg, #818cf8, #34d399); box-shadow: 0 0 12px #818cf8;
}

/* Medals for the monthly ranking. */
.zb-medal { display: flex; align-items: center; justify-content: center; border-radius: 9999px; font-weight: 700; margin: 0 auto; }
.zb-medal-1 { background: radial-gradient(circle at 35% 30%, #fff7cc, #fbbf24 45%, #b45309); color: #3a2300; box-shadow: 0 0 26px rgba(251, 191, 36, .75); }
.zb-medal-2 { background: radial-gradient(circle at 35% 30%, #fff, #cbd5e1 45%, #64748b); color: #1e293b; box-shadow: 0 0 18px rgba(203, 213, 225, .5); }
.zb-medal-3 { background: radial-gradient(circle at 35% 30%, #ffedd5, #f59e0b 40%, #9a3412); color: #2a1305; box-shadow: 0 0 18px rgba(234, 88, 12, .5); }
.zb-float { animation: zb-float 2.4s ease-in-out infinite; }
@keyframes zb-float { 50% { transform: translateY(-4px); } }

/* Gradient word (brand name, headings). */
.zb-text-brand { background: linear-gradient(90deg, #a5b4fc, #fcd34d); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Less motion: asked for by the visitor, or by the app while a game streams. */
@media (prefers-reduced-motion: reduce) {
    .zb-aurora, .zb-run::before, .zb-glow, .zb-glow::after, .zb-live::after, .zb-ticker, .zb-marquee, .zb-float, .zb-track { animation: none !important; transition: none !important; }
    .zb-glow::after { display: none; }
}
.zb-calm .zb-aurora, .zb-calm .zb-run::before, .zb-calm .zb-glow, .zb-calm .zb-glow::after,
.zb-calm .zb-live::after, .zb-calm .zb-ticker, .zb-calm .zb-marquee, .zb-calm .zb-float,
.zb-calm #festival-decor * { animation: none !important; }
.zb-calm .zb-glow::after { display: none; }
