/* Ad slots, ad break, sponsor lines and the stats ticker. The game's own layout is in app.css. */

/* ---------- banner rows: fixed strips above and below #app, sized by js/ads.js ---------- */
.ad-slot { position: fixed; top: 0; left: 0; width: 100%; z-index: 5; display: flex; align-items: center; justify-content: center; background: #0a0c1c; overflow: hidden;
  padding: 0 var(--sar) 0 var(--sal); font-family: 'VT323', ui-monospace, Menlo, monospace; }
#ad-top { box-shadow: inset 0 -2px 0 0 #20264a; }
#ad-bottom { box-shadow: inset 0 2px 0 0 #20264a; }
.ad-box { position: relative; flex: none; overflow: hidden; background: #161a33; max-width: 100%; }
.ad-box > * { position: absolute; inset: 0; }
.ad-net { display: flex; align-items: center; justify-content: center; pointer-events: none; }
.ad-net[data-filled="1"] { background: #161a33; pointer-events: auto; }
.ad-tag { position: absolute; left: max(3px, var(--sal)); top: 3px; font-family: 'Press Start 2P', monospace; font-size: 6px; letter-spacing: 1px; color: #98a0d2; writing-mode: vertical-rl; }
.ad-x { position: absolute; right: max(2px, var(--sar)); top: 50%; transform: translateY(-50%); border: 0; background: none; color: #6c7399; font-family: 'Press Start 2P', monospace; font-size: 7px; line-height: 1.6; padding: 8px 5px; max-width: calc((100% - 320px) / 2 - 2px); text-align: right; }
.ad-x span { display: none; }
.ad-x:hover { color: #f6f1e4; }
.ad-box.s728 ~ .ad-x { max-width: calc((100% - 728px) / 2 - 8px); right: 8px; }
.ad-box.s728 ~ .ad-x span { display: inline; }

/* ---------- house and sponsor cards ---------- */
.ad-card { display: flex; align-items: center; gap: 8px; padding: 0 8px; color: #f6f1e4; text-decoration: none; background: #161a33; box-shadow: inset 0 0 0 2px #2b3160; }
.ad-card.promo { background: repeating-linear-gradient(135deg, #1b2046 0 10px, #161a33 10px 20px); box-shadow: inset 0 0 0 2px #ffd23f; }
.ad-icon { flex: none; width: 38px; height: 38px; border-radius: 9px; object-fit: contain; }
.ad-icon.px { image-rendering: pixelated; border-radius: 0; }
.ad-icon.wide { width: 96px; border-radius: 0; }
.ad-star { display: flex; align-items: center; justify-content: center; background: #ffd23f; color: #1a1530; font-size: 26px; border-radius: 0; }
.ad-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ad-txt b { font-family: 'Press Start 2P', monospace; font-weight: 400; font-size: 8px; line-height: 1; letter-spacing: 1px; color: #ffd23f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ad-txt i { font-style: normal; font-size: 16px; line-height: 0.9; color: #c9cdf0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ad-cta { flex: none; font-family: 'Press Start 2P', monospace; font-size: 7px; color: #1a1530; background: #6ff2b4; padding: 7px 6px 5px; box-shadow: 0 2px 0 0 #2f9e74; }
.ad-card.promo .ad-cta { background: #ffd23f; box-shadow: 0 2px 0 0 #c9931a; }
.ad-box.s728 .ad-card { gap: 16px; padding: 0 18px; }
.ad-box.s728 .ad-icon { width: 64px; height: 64px; border-radius: 14px; font-size: 40px; }
.ad-box.s728 .ad-icon.wide { width: 192px; }
.ad-box.s728 .ad-txt b { font-size: 16px; }
.ad-box.s728 .ad-txt i { font-size: 26px; -webkit-line-clamp: 1; }
.ad-box.s728 .ad-cta { font-size: 10px; padding: 11px 12px 9px; }

/* ---------- ad break between questions ---------- */
#ad-break { position: absolute; inset: 0; z-index: 50; background: rgba(8, 9, 26, 0.86); display: flex; align-items: center; justify-content: center; padding: 8px; }
.ad-break-panel { width: 100%; max-width: 440px; max-height: calc(100% - 24px); overflow-y: auto; padding: 8px 10px 8px; display: flex; flex-direction: column; align-items: stretch; scrollbar-width: none; }
.ad-break-panel .modal-head .lbl { color: var(--mute); }
#ad-break-body { margin: 8px 0 6px; }
.ad-card.big { position: static; flex-direction: column; text-align: center; gap: 10px; padding: 16px 12px 14px; }
.ad-card.big .ad-icon { width: 84px; height: 84px; border-radius: 18px; font-size: 52px; }
.ad-card.big .ad-txt { align-items: center; gap: 8px; }
.ad-card.big .ad-txt b { font-size: 14px; white-space: normal; line-height: 1.3; }
.ad-card.big .ad-txt i { font-size: 24px; -webkit-line-clamp: 3; }
.ad-card.big .ad-cta { font-size: 10px; padding: 10px 14px 8px; }
#ad-break .btn[disabled] { opacity: 0.6; }
#ad-break .sq[disabled] { opacity: 0.3; }
#ad-break .linkish { font-size: 18px; color: var(--mute); }
/* short screens (keyboard up): the card lies on its side so CONTINUE stays on screen */
#app:not([data-dense="0"]) .ad-card.big { flex-direction: row; text-align: left; padding: 8px 10px; }
#app:not([data-dense="0"]) .ad-card.big .ad-icon { width: 48px; height: 48px; border-radius: 10px; font-size: 30px; }
#app:not([data-dense="0"]) .ad-card.big .ad-txt { align-items: flex-start; gap: 3px; }
#app:not([data-dense="0"]) .ad-card.big .ad-txt b { font-size: 10px; }
#app:not([data-dense="0"]) .ad-card.big .ad-txt i { font-size: 18px; -webkit-line-clamp: 2; }
#app:not([data-dense="0"]) #ad-break-body { margin: 4px 0 2px; }
#app:not([data-micro="0"]) #ad-break-remove, #app:not([data-micro="0"]) .ad-break-panel .modal-head { display: none; }
#ad-preroll:empty { display: none; }
#ad-preroll { position: absolute; inset: 0; z-index: 55; }

/* ---------- our own consent question (only when a network needs it and has no tool of its own) ---------- */
#ad-consent { position: absolute; left: 0; right: 0; bottom: 0; z-index: 45; margin: 10px; padding: 8px 10px 4px; font-size: 19px; color: var(--cream); }
#ad-consent p { margin: 0 0 4px; }

/* ---------- sponsor lines and the stats ticker ---------- */
.sponsor-slot { display: flex; justify-content: center; margin: -4px 6px 6px; }
.sponsor-line { display: inline-flex; align-items: center; gap: 6px; font-family: 'Press Start 2P', monospace; font-size: 7px; letter-spacing: 1px; color: var(--mute); text-decoration: none; text-transform: uppercase; background: rgba(22, 26, 51, 0.85); padding: 4px 7px 3px; }
.sponsor-line b { font-weight: 400; color: var(--amber); }
.sponsor-line img { height: 16px; width: auto; max-width: 64px; object-fit: contain; }
.sponsor-line img.px { image-rendering: pixelated; }
#res-sponsor { margin: 6px 0 0; }
.ticker { display: block; margin: 4px 6px 0; padding: 5px 6px 3px; text-align: center; font-family: 'Press Start 2P', monospace; font-size: 7px; line-height: 1.5; letter-spacing: 1px; color: #c9cdf0; background: rgba(22, 26, 51, 0.85); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker b { font-weight: 400; color: var(--mint); }
.ticker u { color: var(--amber); text-decoration: none; }
.ticker::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 6px; background: #5fe08a; animation: tickblink 1.6s steps(2) infinite; }
@keyframes tickblink { 50% { opacity: 0.25; } }
#app[data-dense="2"] .ticker, #app[data-dense="2"] .sponsor-slot { display: none; }
@media (prefers-reduced-motion: reduce) { .ticker::before { animation: none; } }
