/* --------------------------------------------------------------------------
   NextBall - Ads (ads.js). Everything here only applies to elements ads.js
   creates, so an unconfigured server renders nothing at all.
   -------------------------------------------------------------------------- */

/* ---- Framed display container ---- */
.nb-ad {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 22px 9px 9px; box-sizing: border-box; min-width: 0;
    background: linear-gradient(180deg, rgba(14, 18, 48, .92), rgba(8, 11, 28, .92));
    border: 1px solid var(--line, rgba(122, 140, 255, .14)); border-top: 2px solid var(--line-strong, rgba(140, 160, 255, .34));
    border-radius: 3px;
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}
.nb-ad[hidden] { display: none !important; }
.nb-ad-cap {
    position: absolute; top: 6px; left: 14px;
    font: 700 9px/1 var(--f-body, system-ui, sans-serif); letter-spacing: .22em; text-transform: uppercase; color: var(--fg-3, #5B6497);
}
.nb-ad-ph {
    width: min(100%, var(--w)); height: var(--h); box-sizing: border-box;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    border: 2px dashed rgba(255, 200, 61, .55); border-radius: 2px;
    background: repeating-linear-gradient(-45deg, rgba(255, 200, 61, .05) 0 10px, transparent 10px 20px);
    color: var(--gold, #FFC83D); font: italic 800 20px/1 var(--f-display, sans-serif); letter-spacing: .06em;
}
.nb-ad-ph small { font: 600 10px/1 var(--f-body, sans-serif); letter-spacing: .14em; text-transform: uppercase; color: var(--fg-2, #8E97C9); }
.nb-ad-ins { width: 100%; max-width: var(--w); min-height: var(--h); }

/* ---- Main menu: 3rd column of the TOP PLAYERS / MY STATS row (under the mode grid) ---- */
.bottom-row.has-ad { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 320px; align-items: stretch; }
.nb-ad-home.nb-ad { justify-content: center; }
@media (max-width: 1180px) {
    .bottom-row.has-ad { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .bottom-row.has-ad .nb-ad-home { grid-column: 1 / -1; justify-self: center; width: min(100%, 340px); }
}
@media (max-width: 900px) {
    .bottom-row.has-ad { grid-template-columns: 1fr; }
}

/* ---- About / Updates pages ---- */
.nb-ad-page--banner.nb-ad { margin: 22px auto; width: min(100%, 760px); }
@media (min-width: 1280px) {
    .ar-page.ads-rail {
        width: min(100% - 2 * clamp(16px, 3vw, 48px), 1404px);
        display: grid; grid-template-columns: minmax(0, 1fr) 320px; column-gap: 24px; align-items: start;
    }
    .ar-page.ads-rail > * { grid-column: 1; min-width: 0; }
    .ar-page.ads-rail > .ar-nav { grid-column: 1 / -1; }
    .ar-page.ads-rail > .nb-ad-page--rail { grid-column: 2; grid-row: 2 / span 60; align-self: start; position: sticky; top: 24px; margin-top: 22px; }
}

/* ---- Daily reward button (player plate, next to the coin balance) ---- */
.btn-daily-reward {
    display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 2px; cursor: pointer; white-space: nowrap;
    font: italic 700 12px/1 var(--f-display, sans-serif); letter-spacing: .06em; text-transform: uppercase;
    color: var(--gold-ink, #2A1A00); border: 1px solid var(--gold-hi, #FFE28A);
    background: linear-gradient(180deg, var(--gold-hi, #FFE28A), var(--gold, #FFC83D) 60%, #C8921A);
    box-shadow: 0 2px 0 rgba(0, 0, 0, .5), 0 0 14px rgba(255, 200, 61, .35);
    transition: filter var(--t-fast, 140ms), box-shadow var(--t-fast, 140ms);
}
.btn-daily-reward[hidden] { display: none !important; }
.btn-daily-reward:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 2px 0 rgba(0, 0, 0, .5), 0 0 22px rgba(255, 200, 61, .6); }
.btn-daily-reward b { font-weight: 800; }
.btn-daily-reward.is-claimed, .btn-daily-reward:disabled {
    cursor: default; color: var(--fg-2, #8E97C9); background: rgba(4, 5, 13, .6); border-color: var(--line, rgba(122, 140, 255, .14)); box-shadow: none; font-style: normal; text-transform: none; letter-spacing: .02em;
}
.btn-daily-reward.is-claimed b { color: var(--fg-1, #D8DDFF); font-variant-numeric: tabular-nums; }

/* ---- Shop: insufficient coins -> watch offer ---- */
.shop-ad-offer { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin: 0 0 10px; border: 1px solid rgba(255, 200, 61, .35); border-left: 3px solid var(--gold, #FFC83D); background: rgba(255, 200, 61, .06); border-radius: 2px; }
.shop-ad-offer[hidden] { display: none !important; }
.shop-ad-offer-text { flex: 1; min-width: 180px; font-size: 13px; color: var(--fg-1, #D8DDFF); }
.shop-ad-offer-text b { color: var(--gold, #FFC83D); }
.shop-ad-offer .btn-daily-reward { height: 34px; padding: 0 14px; font-size: 13px; }

/* ---- Consent bar ---- */
.nb-consent {
    position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 9000;
    width: min(100% - 24px, 860px); box-sizing: border-box;
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px 12px 18px;
    background: rgba(8, 11, 28, .97); border: 1px solid var(--line-strong, rgba(140, 160, 255, .34)); border-left: 3px solid var(--cyan, #22E5FF); border-radius: 3px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .6); color: var(--fg-1, #D8DDFF); font: 500 13px/1.45 var(--f-body, system-ui, sans-serif);
    transition: opacity .25s, transform .25s;
}
.nb-consent.is-leaving { opacity: 0; transform: translateX(-50%) translateY(10px); }
.nb-consent-text { flex: 1; min-width: 220px; margin: 0; }
.nb-consent-text a { color: var(--cyan, #22E5FF); font-weight: 700; }
.nb-consent-actions { display: flex; gap: 8px; }
.nb-consent-btn {
    height: 34px; padding: 0 14px; cursor: pointer; transform: skewX(-10deg); border-radius: 2px;
    font: italic 700 13px/1 var(--f-display, sans-serif); letter-spacing: .04em; text-transform: uppercase;
    background: rgba(14, 18, 48, .9); color: var(--fg-1, #D8DDFF); border: 1px solid var(--line-strong, rgba(140, 160, 255, .34));
}
.nb-consent-btn > span { display: inline-block; transform: skewX(10deg); }
.nb-consent-btn:hover { border-color: var(--cyan, #22E5FF); color: #fff; }
.nb-consent-btn--accept { background: linear-gradient(180deg, var(--orange-hi, #FFA24D), var(--orange, #FF7A1A) 55%, var(--orange-lo, #C24F00)); color: var(--orange-ink, #1A0900); border-color: var(--orange-hi, #FFA24D); }
.nb-consent-btn--accept:hover { color: var(--orange-ink, #1A0900); border-color: #FFD9B0; }
body:has(#game-screen:not(.hidden)) .nb-consent { display: none; }

/* ---- Toast ---- */
.nb-ad-toast {
    position: fixed; top: 18px; left: 50%; transform: translate(-50%, -12px); opacity: 0; z-index: 9600;
    padding: 10px 16px; border-radius: 3px; background: rgba(8, 11, 28, .97); border: 1px solid var(--line-strong, rgba(140, 160, 255, .34));
    color: #fff; font: 600 13px/1.3 var(--f-body, sans-serif); transition: opacity .25s, transform .25s; pointer-events: none;
}
.nb-ad-toast.show { opacity: 1; transform: translate(-50%, 0); }
.nb-ad-toast.is-ok { border-left: 3px solid var(--ok, #3DFF9B); }
.nb-ad-toast.is-error { border-left: 3px solid var(--red, #FF4655); }
.nb-ad-toast.is-info { border-left: 3px solid var(--cyan, #22E5FF); }

/* ---- Fake H5 ad breaks (ADS_TEST=1) ---- */
.nb-adbreak { position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center; background: rgba(2, 3, 9, .88); }
.nb-adbreak-box {
    display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(100% - 32px, 420px); padding: 28px 24px; box-sizing: border-box;
    border: 2px dashed rgba(255, 200, 61, .6); background: rgba(14, 18, 48, .95); color: #fff; text-align: center;
}
.nb-adbreak-box b { font: italic 800 26px/1.1 var(--f-display, sans-serif); text-transform: uppercase; }
.nb-adbreak-kicker { font: 700 10px/1 var(--f-body, sans-serif); letter-spacing: .22em; text-transform: uppercase; color: var(--gold, #FFC83D); }
.nb-adbreak-bar { width: 100%; height: 6px; background: rgba(255, 255, 255, .1); border-radius: 3px; overflow: hidden; }
.nb-adbreak-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold, #FFC83D), var(--orange, #FF7A1A)); transition-property: width; transition-timing-function: linear; }
.nb-adbreak-skip { margin-top: 4px; background: none; border: 1px solid var(--line-strong, rgba(140, 160, 255, .34)); color: var(--fg-2, #8E97C9); padding: 6px 14px; cursor: pointer; font: 600 12px/1 var(--f-body, sans-serif); }

/* ---- Match result actions (Back / Play again) ---- */
.match-result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.match-result-invite { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 12px auto 0; padding: 8px 14px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; background: transparent; color: var(--fg-2, #8E97C9); font: 600 13px/1.2 var(--f-body, sans-serif); cursor: pointer; }
.match-result-invite:hover, .match-result-invite:focus-visible { color: #fff; border-color: rgba(255,255,255,.3); }
.match-result-invite span { color: #fbbf24; }
.match-result-invite.hidden { display: none; }

@media (prefers-reduced-motion: reduce) { .nb-adbreak-bar i { transition: none; } }

/* ---- Main menu footer links (privacy policy must stay reachable) ---- */
.menu-footer { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 18px 0 26px; font: 600 12px/1 var(--f-body, sans-serif); letter-spacing: .06em; color: var(--fg-3, #5B6497); }
.menu-footer a { color: var(--fg-2, #8E97C9); text-decoration: none; }
.menu-footer a:hover { color: var(--cyan, #22E5FF); }
.banner-actions .btn-buy.disabled { opacity: .45; cursor: pointer; }

/* Home: crawlable intro above the footer (index.html .menu-seo) */
.menu-seo { max-width: 760px; margin: 28px auto 0; padding: 0 16px; text-align: center; color: var(--fg-2, #8E97C9); font: 400 13px/1.6 var(--f-body, sans-serif); }
.menu-seo h2 { margin: 0 0 8px; font: 700 15px/1.3 var(--f-display, sans-serif); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-1, #C9CFF0); text-shadow: none; }
.menu-seo p { margin: 0 0 8px; }
.menu-seo-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 10px; font-weight: 700; }
.menu-seo-links a { color: var(--orange, #FF6A13); text-decoration: none; }
.menu-seo-links a:hover { text-decoration: underline; }
