/* TV Mrągowo 2.37.0: zaproszenia do aplikacji na telefon (pas na stronie głównej, karty, stopka, menu, „Na żywo”)
   i okno z instrukcją. W zainstalowanej aplikacji zaproszenia są ukryte. */

.tvm-is-app [data-tvm-app-invite] { display: none !important; }
[data-tvm-app-invite][hidden] { display: none !important; }

/* ---------- Przycisk ---------- */
.tvm-app-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--tvm-brand-sea, #35c9bb);
    color: #042b2d !important;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: transform var(--tvm-fast, .18s) ease, background var(--tvm-fast, .18s) ease, box-shadow var(--tvm-fast, .18s) ease;
}
.tvm-app-btn:hover,
.tvm-app-btn:focus-visible { background: #5ad9cc; color: #042b2d !important; transform: translateY(-1px); }
.tvm-app-btn:focus-visible { outline: 3px solid #bff5ee; outline-offset: 3px; }
.tvm-app-btn span[aria-hidden] { font-weight: 800; }
.tvm-app-btn.is-wanted { box-shadow: 0 0 0 4px rgba(53, 201, 187, .35); animation: tvm-app-pulse 1.6s ease-in-out 3; }
@keyframes tvm-app-pulse { 50% { box-shadow: 0 0 0 10px rgba(53, 201, 187, 0); } }
/* 2.37.2: kliknięcie czeka chwilę na gotowość przeglądarki — strzałka pulsuje, napis „Otwieram instalację…”. */
.tvm-app-btn.is-busy { cursor: progress; }
.tvm-app-btn.is-busy .tvm-app-btn__icon { display: inline-block; animation: tvm-app-busy .9s ease-in-out infinite; }
@keyframes tvm-app-busy { 50% { transform: translateY(3px); opacity: .5; } }
/* Aplikacja już zainstalowana (Chrome to rozpoznaje): obrys zamiast pełnego tła, ptaszek zamiast strzałki. */
.tvm-app-btn.is-installed { border-color: currentColor; background: transparent; color: inherit !important; }
.tvm-app-btn.is-installed .tvm-app-btn__icon { font-size: 0; }
.tvm-app-btn.is-installed .tvm-app-btn__icon::before { content: "✓"; font-size: .95rem; }
@media (prefers-reduced-motion: reduce) {
    .tvm-app-btn { transition: none; }
    .tvm-app-btn.is-wanted,
    .tvm-app-btn.is-busy .tvm-app-btn__icon { animation: none; }
}

/* ---------- Pas i karty ---------- */
.tvm-app-band {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: clamp(24px, 4vw, 56px);
    align-items: center;
}
.tvm-app-band__copy h2 { margin: 6px 0 12px; }
.tvm-app-band__copy > p:not(.tvm-kicker) { margin: 0; max-width: 40ch; color: var(--tvm-muted, inherit); }
.tvm-app-band__more { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 18px !important; }
.tvm-app-band__more a { font-weight: 700; }
.tvm-app-band__later {
    padding: 6px 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-size: .9rem;
    opacity: .75;
    text-decoration: underline;
    cursor: pointer;
}
.tvm-app-band__later:hover,
.tvm-app-band__later:focus-visible { opacity: 1; }

.tvm-app-cards { display: grid; gap: 14px; }
.tvm-app-card {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 18px 20px;
    border: 1px solid rgba(6, 47, 50, .12);
    border-radius: 18px;
    background: #f2f8f7;
}
.tvm-band--dark .tvm-app-card { border-color: rgba(214, 248, 244, .16); background: rgba(255, 255, 255, .06); }
.tvm-app-card__icon { width: 64px; height: 64px; border-radius: 16px; }
.tvm-app-card__copy { display: grid; gap: 4px; min-width: 0; }
.tvm-app-card__copy strong,
.tvm-app-live__copy strong { font-size: 1.05rem; font-weight: 700; line-height: 1.25; }
.tvm-app-card__copy span { font-size: .92rem; line-height: 1.45; opacity: .85; }

/* „Na żywo”: jedna karta playera nad stopką. */
.tvm-app-live__in { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.tvm-app-live__copy { display: grid; gap: 4px; }
.tvm-app-live__copy span { font-size: .92rem; opacity: .85; }

/* Stopka i menu telefonu. */
.tvm-app-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 18px 0 0; }
.tvm-app-footer .tvm-app-btn { min-height: 42px; padding: 0 18px; font-size: .9rem; }
.tvm-app-footer__how { font-size: .88rem; font-weight: 600; }
.tvm-app-menu { margin: 12px 0 4px; }
.tvm-app-btn--menu { width: 100%; }

@media (max-width: 980px) {
    .tvm-app-band { grid-template-columns: minmax(0, 1fr); }
    .tvm-app-band__copy { text-align: center; }
    .tvm-app-band__copy > p:not(.tvm-kicker) { margin-inline: auto; }
    .tvm-app-band__more { justify-content: center; }
}
@media (max-width: 760px) {
    /* Karty wyboru na telefonie: 85 % karta, następna wystaje (wskaźnik przesuwania dokłada swipe-hint.js). */
    .tvm-app-cards {
        grid-auto-flow: column;
        grid-auto-columns: 85%;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 2px;
        padding-bottom: 4px;
    }
    .tvm-app-cards:has(> :only-child) { grid-auto-columns: 100%; }
    .tvm-app-card {
        grid-template-columns: 56px minmax(0, 1fr);
        scroll-snap-align: start;
    }
    .tvm-app-card .tvm-app-btn { grid-column: 1 / -1; width: 100%; }
    .tvm-app-card__icon { width: 56px; height: 56px; border-radius: 14px; }
    .tvm-app-live__in { grid-template-columns: 56px minmax(0, 1fr); }
    .tvm-app-live__in .tvm-app-btn { grid-column: 1 / -1; width: 100%; }
}

/* ---------- Okno z instrukcją ---------- */
.tvm-app-dialog {
    width: min(460px, calc(100vw - 32px));
    padding: 26px 24px 20px;
    border: 0;
    border-radius: 20px;
    background: #062f32;
    color: #f4fbfa;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.tvm-app-dialog::backdrop { background: rgba(2, 20, 22, .6); }
.tvm-app-dialog h2 { margin: 0 0 14px; font-size: 1.3rem; line-height: 1.25; color: #f4fbfa; }
.tvm-app-dialog p { margin: 0 0 12px; line-height: 1.5; }
.tvm-app-dialog__steps { margin: 0 0 14px; padding-left: 22px; line-height: 1.5; }
.tvm-app-dialog__steps li { margin-bottom: 8px; }
.tvm-app-dialog__note { font-size: .9rem; opacity: .8; }
.tvm-app-dialog__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 0 !important; }
.tvm-app-dialog__actions a { color: #bff5ee; font-weight: 700; }
.tvm-app-dialog__actions .tvm-app-btn--primary { min-width: 160px; }
.tvm-app-dialog__close { padding: 10px 6px; border: 0; background: none; color: #cfe9e5; font: inherit; text-decoration: underline; cursor: pointer; }
.tvm-app-dialog__close:hover,
.tvm-app-dialog__close:focus-visible { color: #fff; }
.tvm-app-dialog[data-mode="ready"] .tvm-app-dialog__actions a { margin-right: auto; }
/* „Zainstaluj” = jedna główna czynność: na całą szerokość, nad linkami. */
.tvm-app-dialog[data-mode="ready"] .tvm-app-dialog__actions .tvm-app-btn--primary { order: -1; flex: 1 1 100%; min-height: 52px; font-size: 1.05rem; }
.tvm-app-dialog__icon { display: block; width: 64px; height: 64px; margin: 0 auto 12px; }
.tvm-app-dialog h2 { text-align: center; }
