/* Ad cards (ads.js) and the screensaver (saver.js). Cards are 2:1 and size their type to their own width,
   so the same card fills a billboard poster, the full-screen spot and the lower-third chip. */
.ad-card { position: relative; container-type: inline-size; aspect-ratio: 2 / 1; overflow: hidden; box-sizing: border-box;
           background: var(--ad-bg); color: var(--ad-fg); font-family: Manrope, system-ui, sans-serif; }
.ad-motif { position: absolute; inset: 0; opacity: 0.2; }
.ad-motif.dots { background-image: radial-gradient(circle, var(--ad-accent) 0 1.1cqw, transparent 1.2cqw); background-size: 6cqw 6cqw; }
.ad-motif.stripes { background-image: repeating-linear-gradient(-45deg, var(--ad-accent) 0 2cqw, transparent 2cqw 6cqw); }
.ad-motif.rays { background-image: repeating-conic-gradient(from 0deg at 92% 115%, var(--ad-accent) 0 5deg, transparent 5deg 12deg); }
.ad-motif.grid { background-image: linear-gradient(var(--ad-accent) 0.25cqw, transparent 0.25cqw),
                                   linear-gradient(90deg, var(--ad-accent) 0.25cqw, transparent 0.25cqw);
                 background-size: 5cqw 5cqw; }
.ad-motif.wax { opacity: 0.35;
                background-image: radial-gradient(circle at 50% 50%, var(--ad-accent) 0 1.4cqw, transparent 1.5cqw),
                                  radial-gradient(circle at 50% 50%, transparent 0 3cqw, var(--ad-fg) 3.2cqw 3.5cqw, transparent 3.7cqw);
                background-size: 9cqw 9cqw, 9cqw 9cqw; background-position: 0 0, 4.5cqw 4.5cqw; }
/* The motif fades out behind the words. */
.ad-motif { -webkit-mask-image: linear-gradient(90deg, transparent 35%, #000 80%); mask-image: linear-gradient(90deg, transparent 35%, #000 80%); }
.ad-body { position: absolute; inset: 6cqw 7cqw 5.5cqw; display: flex; flex-direction: column; align-items: flex-start; gap: 1.6cqw; }
.ad-kind { font-size: 2.4cqw; font-weight: 800; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ad-accent);
           padding: 0.6cqw 1.4cqw; border: 0.3cqw solid var(--ad-accent); border-radius: 1cqw; }
.ad-brand { font-family: Unbounded, sans-serif; font-weight: 700; font-size: 8cqw; line-height: 0.98; letter-spacing: -0.02em;
            text-transform: uppercase; max-width: 86%; }
.ad-tag { font-size: 4.2cqw; font-weight: 800; line-height: 1.15; max-width: 80%; }
.ad-cta { margin-top: auto; font-family: "Noto Sans", Manrope, sans-serif; font-size: 2.6cqw; font-weight: 700; opacity: 0.85; }

/* Screensaver: over everything but the rotate prompt. In 3D the live city shows through; in 2D a canvas
   paints the lagoon. Any key, click or tap ends it. */
#saver { position: fixed; inset: 0; z-index: 4; overflow: hidden; cursor: none; opacity: 0; transition: opacity 0.8s ease;
         -webkit-user-select: none; user-select: none; }
#saver.on { opacity: 1; }
#saver-2d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#saver.three #saver-2d { display: none; }
#saver-brand { position: absolute; top: calc(20px + var(--safe-t, 0px)); left: calc(24px + var(--safe-l, 0px));
               text-shadow: 0 1px 8px rgba(0,0,0,0.7); }
#saver-hint { position: absolute; top: calc(22px + var(--safe-t, 0px)); right: calc(24px + var(--safe-r, 0px));
              text-shadow: 0 1px 8px rgba(0,0,0,0.7); }
#saver-lower { position: absolute; left: calc(24px + var(--safe-l, 0px)); bottom: calc(24px + var(--safe-b, 0px));
               display: flex; align-items: center; gap: 16px; max-width: calc(100% - 48px); padding: 10px 18px 10px 10px;
               box-sizing: border-box; border-radius: 16px; background: var(--glass); border: 1px solid var(--line);
               -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
               transform: translateY(0); opacity: 1; transition: transform 0.5s ease, opacity 0.5s ease; }
#saver-lower.out { transform: translateY(16px); opacity: 0; }
#saver-lower .ad-card { width: 132px; flex-shrink: 0; border-radius: 8px; }
#saver-lower .text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#saver-lower strong { font-family: Unbounded, sans-serif; font-size: 16px; line-height: 1.2; }
#saver-lower .tag { font-size: 14px; color: var(--haze); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#saver-spot { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 6vmin;
              box-sizing: border-box; background: rgba(7,19,18,0.82); opacity: 0; pointer-events: none; transition: opacity 0.6s ease; }
#saver-spot.on { opacity: 1; }
#saver-spot .ad-card { width: min(100%, 200vh - 24vmin); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,0.5); }
#saver-count { position: absolute; right: calc(24px + var(--safe-r, 0px)); bottom: calc(22px + var(--safe-b, 0px)); }
#saver-spot.on .ad-card { animation: saver-in 8s ease-out both; }
@keyframes saver-in { from { transform: scale(0.96); } to { transform: scale(1.02); } }
@media (prefers-reduced-motion: reduce) { #saver-spot.on .ad-card { animation: none; } }
@media (max-width: 599px), (max-height: 479px) {
  #saver-lower .ad-card { width: 88px; }
  #saver-lower strong { font-size: 13px; }
  #saver-lower .tag { font-size: 12px; }
}
/* While the saver runs, the menu behind it steps aside. */
#menu.saver #stage, #menu.saver #tip, #menu.saver #scrim, #menu.saver .bar, #menu.saver #live-cap { visibility: hidden; }
#menu.saver.in-game { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
