/*
 * Stile comune di magicdeck: colori del marchio (blu notte e oro del logo)
 * sopra Bootstrap 5.3. Le pagine aggiungono solo i propri componenti.
 *
 * Bootstrap si ritocca con le sue variabili CSS (--bs-btn-*, --bs-link-*):
 * così stati hover, focus e disabilitato restano coerenti senza riscriverli.
 */

:root {
    --brand-ink: #1d2330;
    --brand-ink-2: #2b3348;
    --brand-ink-3: #11151d;
    --brand-gold: #f2b340;
    --brand-gold-2: #f6c665;
    --brand-gold-3: #d9982a;
    --brand-gold-text: #8a5a00;
    --brand-gold-soft: rgba(242, 179, 64, .18);
    --page-bg: #f5f6fa;
    --panel-shadow-soft: 0 .25rem 1.25rem rgba(22, 30, 50, .08);

    --bs-link-color: #2d5a9e;
    --bs-link-color-rgb: 45, 90, 158;
    --bs-link-hover-color: var(--brand-ink);
    --bs-link-hover-color-rgb: 29, 35, 48;
    --bs-focus-ring-color: rgba(242, 179, 64, .35);
}

/* ---------- Pagina ---------- */

html { background: var(--page-bg); }
body { background: linear-gradient(180deg, #e9edf5 0, var(--page-bg) 24rem, var(--page-bg) 100%); min-height: 100vh; }
/* .h1….h6 di Bootstrap hanno peso 500: i titoli di pagina restano in grassetto comunque */
h1, h1[class^="h"] { font-weight: 700; letter-spacing: -.01em; }
::selection { background: var(--brand-gold-soft); }

/* ---------- Barra principale ---------- */

.topbar {
    background: var(--brand-ink);
    color: #fff;
    box-shadow: inset 0 -2px 0 rgba(242, 179, 64, .35), 0 .3rem 1rem rgba(10, 14, 22, .12);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.75rem; }
/* Computer: tre colonne, così le sezioni stanno esattamente al centro */
@media (min-width: 992px) {
    .topbar-inner { display: grid; grid-template-columns: 1fr auto 1fr; }
    .topbar-actions { justify-self: end; }
}
.topbar .brand { color: #fff; text-decoration: none; font-size: 1.2rem; }
.topbar .brand:hover { color: #fff; }

/* Sezioni al centro: pillole con icona, quella aperta in oro */
.topnav { gap: .35rem; background: rgba(255, 255, 255, .05); border-radius: 999px; padding: .3rem; }
.topnav a {
    display: inline-flex; align-items: center; gap: .45rem; padding: .42rem 1rem; border-radius: 999px;
    color: rgba(255, 255, 255, .72); text-decoration: none; font-weight: 600; font-size: .95rem;
    transition: background .15s ease, color .15s ease;
}
.topnav a .bi { font-size: 1.05rem; }
.topnav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.topnav a[aria-current="page"] { background: var(--brand-gold); color: var(--brand-ink); }
.topnav a[aria-current="page"] .bi { color: var(--brand-ink); }

/* Azioni a destra: icone rotonde e chip del profilo */
.topbar-actions { display: flex; align-items: center; gap: .4rem; }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border-radius: 50%;
    color: rgba(255, 255, 255, .78); font-size: 1.15rem; text-decoration: none; transition: background .15s ease, color .15s ease;
}
.icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
/* "Esci" è un pulsante dentro un modulo: stesso aspetto dei link della barra */
.logout-form { display: contents; }
button.icon-btn { border: 0; background: transparent; padding: 0; }
.icon-btn[aria-current="page"] { color: var(--brand-gold); background: rgba(242, 179, 64, .14); }
/* Numero sull'icona (richieste di amicizia) */
/* Flex e griglie: un figlio può stringersi sotto la larghezza del suo contenuto (nomi lunghi troncati, non pagina larga) */
.min-w-0 { min-width: 0; }
/* Telefoni stretti: con Guida, Amici, Amministrazione ed Esci la barra non deve sbordare */
@media (max-width: 379.98px) {
    .topbar-actions { gap: .1rem; }
    .topbar .icon-btn { width: 2.1rem; }
    .topbar .brand img { width: 34px; height: auto; }
}
.icon-btn-badge { position: relative; }
.icon-badge { position: absolute; top: .1rem; right: .05rem; min-width: 1.05rem; height: 1.05rem; padding: 0 .25rem; border-radius: 999px;
    background: var(--brand-gold); color: var(--brand-ink); font-size: .65rem; font-weight: 800; line-height: 1.05rem; text-align: center; }
.user-chip {
    align-items: center; gap: .5rem; padding: .22rem .8rem .22rem .25rem; border-radius: 999px;
    color: #fff; text-decoration: none; font-weight: 600; font-size: .9rem; background: rgba(255, 255, 255, .06);
    transition: background .15s ease;
}
.user-chip:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.user-chip[aria-current="page"] { box-shadow: inset 0 0 0 1.5px var(--brand-gold); }
.user-chip .avatar {
    display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; border-radius: 50%;
    background: var(--brand-gold); color: var(--brand-ink); font-weight: 800; font-size: .9rem; overflow: hidden;
}

/* Token del profilo (avatar.js, AvatarRepository): l'immagine riempie il riquadro che la contiene
   (cerchio, rettangolo del torneo), tagliata attorno al punto scelto (object-position in linea) */
.avatar img, .nav-avatar img, .friend-avatar img, .tn-avatar img, .av-img {
    width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit;
}
.nav-avatar { display: block; width: 1.5rem; height: 1.5rem; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .35); }
.bottom-nav a[aria-current="page"] .nav-avatar { box-shadow: 0 0 0 2px var(--brand-gold); }

/* Sottopagine dell'amministrazione: ritorno alla pagina principale */
.back-link { display: inline-flex; align-items: center; gap: .25rem; font-size: .85rem; font-weight: 600; color: var(--bs-secondary-color); text-decoration: none; margin-bottom: .5rem; }
.back-link:hover { color: var(--brand-ink); }

/* ---------- Pulsanti ---------- */

/* Azioni principali: blu notte */
.btn-dark {
    --bs-btn-bg: var(--brand-ink);
    --bs-btn-border-color: var(--brand-ink);
    --bs-btn-hover-bg: var(--brand-ink-2);
    --bs-btn-hover-border-color: var(--brand-ink-2);
    --bs-btn-active-bg: var(--brand-ink-3);
    --bs-btn-active-border-color: var(--brand-ink-3);
    --bs-btn-disabled-bg: var(--brand-ink);
    --bs-btn-disabled-border-color: var(--brand-ink);
}
.btn-outline-dark {
    --bs-btn-color: var(--brand-ink);
    --bs-btn-border-color: rgba(29, 35, 48, .35);
    --bs-btn-hover-bg: var(--brand-ink);
    --bs-btn-hover-border-color: var(--brand-ink);
    --bs-btn-active-bg: var(--brand-ink-3);
    --bs-btn-active-border-color: var(--brand-ink-3);
}

/* Azioni in evidenza (conferme, "è arrivato tutto"): oro con testo scuro */
.btn-primary {
    --bs-btn-color: var(--brand-ink);
    --bs-btn-bg: var(--brand-gold);
    --bs-btn-border-color: var(--brand-gold);
    --bs-btn-hover-color: var(--brand-ink);
    --bs-btn-hover-bg: var(--brand-gold-2);
    --bs-btn-hover-border-color: var(--brand-gold-2);
    --bs-btn-active-color: var(--brand-ink);
    --bs-btn-active-bg: var(--brand-gold-3);
    --bs-btn-active-border-color: var(--brand-gold-3);
    --bs-btn-disabled-color: var(--brand-ink);
    --bs-btn-disabled-bg: var(--brand-gold);
    --bs-btn-disabled-border-color: var(--brand-gold);
    --bs-btn-focus-shadow-rgb: 242, 179, 64;
    font-weight: 600;
}
.btn-outline-primary {
    --bs-btn-color: var(--brand-gold-text);
    --bs-btn-border-color: var(--brand-gold);
    --bs-btn-hover-color: var(--brand-ink);
    --bs-btn-hover-bg: var(--brand-gold);
    --bs-btn-hover-border-color: var(--brand-gold);
    --bs-btn-active-color: var(--brand-ink);
    --bs-btn-active-bg: var(--brand-gold-3);
    --bs-btn-active-border-color: var(--brand-gold-3);
    --bs-btn-focus-shadow-rgb: 242, 179, 64;
}
.btn { --bs-btn-focus-shadow-rgb: 242, 179, 64; }

/* Pulsanti a scelta (griglia/elenco, viste): quello attivo in blu notte */
.btn-outline-secondary.active,
.btn-check:checked + .btn-outline-secondary {
    --bs-btn-active-bg: var(--brand-ink);
    --bs-btn-active-border-color: var(--brand-ink);
    --bs-btn-active-color: #fff;
}

.text-bg-primary { background-color: var(--brand-gold) !important; color: var(--brand-ink) !important; }
.text-primary { color: #2d5a9e !important; }

/* ---------- Moduli ---------- */

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--brand-gold-3);
    box-shadow: 0 0 0 .2rem rgba(242, 179, 64, .28);
}
.form-check-input:checked { background-color: var(--brand-ink); border-color: var(--brand-ink); }
/* Radio e caselle non spuntate: bordo visibile (il grigio di base quasi sparisce sul bianco) */
.form-check-input:not(:checked) { border-color: #adb5bd; }
.form-switch .form-check-input:focus:not(:checked) {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23d9982a'/%3e%3c/svg%3e");
}

.pagination {
    --bs-pagination-active-bg: var(--brand-ink);
    --bs-pagination-active-border-color: var(--brand-ink);
    --bs-pagination-color: var(--brand-ink);
    --bs-pagination-hover-color: var(--brand-ink);
    --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgba(242, 179, 64, .28);
}

/* ---------- Riquadri ---------- */

/* Le card di Bootstrap (account, amministrazione) come i pannelli delle altre pagine */
.card { --bs-card-border-width: 0; --bs-card-border-radius: 1.1rem; --bs-card-inner-border-radius: 1.1rem; box-shadow: var(--panel-shadow-soft); }
.alert { border-radius: .9rem; }
.modal-content { border-radius: 1.1rem; }
.table { --bs-table-hover-bg: rgba(242, 179, 64, .08); }

/* Schede e interruttori attivi: blu notte con l'icona in oro */
.nav-link.active .bi,
.trade-nav button.active .bi,
.btn-group > .active .bi { color: var(--brand-gold); }

/* ---------- Dentro l'app nativa (user agent magicdeck-app/): le barre sono quelle dell'app ---------- */
body.in-app .topbar, body.in-app .bottom-nav { display: none !important; }
body.in-app { padding-top: .75rem; }
body.in-app.has-bottom-nav { padding-bottom: 1rem; }

/* ---------- Telefono: barra delle sezioni in basso ---------- */

.bottom-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    display: flex; background: var(--brand-ink);
    border-top: 2px solid rgba(242, 179, 64, .35);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -.4rem 1.2rem rgba(10, 14, 22, .25);
}
.bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem;
    padding: .5rem 0 .55rem; color: rgba(255, 255, 255, .62); text-decoration: none;
    font-size: .72rem; font-weight: 600; letter-spacing: .01em;
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav a .bi { font-size: 1.35rem; line-height: 1; }
.bottom-nav a[aria-current="page"] { color: var(--brand-gold); }
.bottom-nav a:active { background: rgba(255, 255, 255, .06); }
@media (max-width: 991.98px) {
    body.has-bottom-nav { padding-bottom: calc(4.3rem + env(safe-area-inset-bottom)); }
    .topbar.mb-4 { margin-bottom: 1rem !important; }
    .topbar-inner { min-height: 3.4rem; }
}

/* ---------- Filtri richiudibili (app.js) ---------- */

.is-collapsed-filter { display: none !important; }
.filters-toggle .filters-count { background: var(--brand-gold); color: var(--brand-ink); margin-left: .15rem; }
.filters-toggle.active { --bs-btn-active-bg: var(--brand-ink); --bs-btn-active-color: #fff; --bs-btn-active-border-color: var(--brand-ink); }

/* ---------- Telefono: modali e tastiera ---------- */

@media (max-width: 575.98px) {
    /* Immagine della carta nei dettagli: più piccola, così numeri e azioni si vedono
       senza scorrere (un tocco sull'immagine la apre a tutta larghezza) */
    .modal .card-image { display: block; max-height: 42vh; width: auto; max-width: 100%; margin-left: auto; margin-right: auto; cursor: zoom-in; }
    .modal .card-image.is-zoomed { max-height: none; width: 100%; cursor: zoom-out; }
    /* Editor: senza i pulsanti − e + il menu della riga resta un bottone arrotondato */
    .row-actions .dropdown-toggle-split { border-radius: var(--bs-border-radius-sm) !important; padding-left: .6rem; padding-right: .6rem; }
    /* In alto invece che al centro: la tastiera occupa la metà bassa dello schermo */
    .modal-dialog-centered { align-items: flex-start; min-height: 0; }
    /* Altezza sullo spazio visibile vero (dvh esclude le barre del browser e, con
       resizes-content, anche la tastiera): il corpo del modale scorre dentro */
    .modal-dialog-scrollable { height: auto; max-height: calc(100dvh - 1rem); }
    .modal-dialog-scrollable .modal-content { max-height: calc(100dvh - 1rem); }
    /* Il gesto "trascina giù per chiudere" (app.js) non deve diventare il "tira per aggiornare" del browser */
    .modal { overscroll-behavior-y: contain; }
}
/* Maniglia delle finestre che si chiudono trascinandole giù (solo schermi touch del telefono) */
@media (max-width: 575.98px) and (pointer: coarse) {
    .modal:not([data-bs-backdrop="static"]):not([data-no-swipe]) .modal-content::before {
        content: ""; position: absolute; top: .35rem; left: 50%; z-index: 2;
        width: 2.4rem; height: .25rem; margin-left: -1.2rem; border-radius: 1rem;
        background: var(--sheet-handle, rgba(29, 35, 48, .2)); pointer-events: none;
    }
    .modal[data-bs-theme="dark"], .hub-modal { --sheet-handle: rgba(255, 255, 255, .3); }
}

/* ---------- Icona ⓘ con spiegazione (hint() / window.hint) ---------- */

.hint { border: 0; background: none; padding: 0 .15rem; color: var(--bs-secondary-color); line-height: 1; vertical-align: baseline; font-size: .95em; }
.hint:hover, .hint:focus-visible { color: var(--brand-gold-3); }
.hint-popover { --bs-popover-max-width: 20rem; --bs-popover-font-size: .85rem; --bs-popover-border-color: var(--bs-border-color); }

/* ---------- Finestre scure delle schermate di gioco (Tools, Tornei) ---------- */
/* .hub-modal + data-bs-theme="dark": blu notte, icone e azione principale in oro */

.hub-modal { --bs-body-bg: #262e41; --bs-border-color: rgba(255, 255, 255, .14); --bs-secondary-color: rgba(255, 255, 255, .6); --bs-tertiary-bg: rgba(255, 255, 255, .06); }
.hub-modal .modal-content { background: var(--brand-ink); color: #fff; box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, .5), inset 0 1px 0 rgba(242, 179, 64, .25); }
.hub-modal .modal-header { border-bottom-color: rgba(255, 255, 255, .08); }
.hub-modal .modal-footer { border-top-color: rgba(255, 255, 255, .08); }
.hub-modal .modal-title { font-weight: 700; }
.hub-modal .text-muted { color: rgba(255, 255, 255, .55) !important; }
.hub-modal .btn-primary .text-muted { color: rgba(29, 35, 48, .6) !important; }
.hub-modal .form-control:focus, .hub-modal .form-select:focus { border-color: var(--brand-gold); box-shadow: 0 0 0 .2rem rgba(242, 179, 64, .25); }
.hub-modal .btn-outline-dark { --bs-btn-color: #fff; --bs-btn-border-color: rgba(255, 255, 255, .35); --bs-btn-hover-bg: rgba(255, 255, 255, .12); --bs-btn-hover-border-color: #fff; }
.hub-modal .btn-outline-secondary { --bs-btn-color: rgba(255, 255, 255, .75); --bs-btn-border-color: rgba(255, 255, 255, .25); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: rgba(255, 255, 255, .1); --bs-btn-hover-border-color: rgba(255, 255, 255, .45); }
/* Pulsanti secondari e distruttivi su fondo scuro */
.btn-ghost-light {
    --bs-btn-color: #fff; --bs-btn-border-color: rgba(255, 255, 255, .25); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: rgba(255, 255, 255, .1);
    --bs-btn-hover-border-color: rgba(255, 255, 255, .45); --bs-btn-active-color: #fff; --bs-btn-active-bg: rgba(255, 255, 255, .16); --bs-btn-active-border-color: rgba(255, 255, 255, .45);
}
.btn-danger-soft {
    --bs-btn-color: #ff9b8f; --bs-btn-border-color: rgba(255, 155, 143, .4); --bs-btn-hover-color: #ff9b8f; --bs-btn-hover-bg: rgba(255, 155, 143, .12);
    --bs-btn-hover-border-color: #ff9b8f; --bs-btn-active-color: #ff9b8f; --bs-btn-active-bg: rgba(255, 155, 143, .2); --bs-btn-active-border-color: #ff9b8f;
}

/* ---------- Piè di pagina ---------- */

footer.container { color: #7a8294 !important; }

/* ---------- Pastiglie delle carte (card-badges.js) ---------- */
.card-badges { display: inline-flex; flex-wrap: wrap; gap: .2rem; vertical-align: middle; }
.cbadge { display: inline-block; font-size: .64rem; font-weight: 700; line-height: 1.45; padding: 0 .4rem; border-radius: 999px;
    white-space: nowrap; background: rgba(29, 35, 48, .08); color: var(--brand-ink); letter-spacing: .01em; }
.cbadge-gc { background: var(--brand-gold); color: var(--brand-ink); }
.cbadge-banned { background: rgba(210, 63, 63, .14); color: #b0282a; }
.cbadge-restricted { background: rgba(211, 139, 18, .18); color: #8a5a07; }
.cbadge-reserved { background: rgba(142, 76, 196, .14); color: #6a2f9e; }
.cbadge-owned { background: rgba(47, 127, 209, .13); color: #1f5fa3; }
.cbadge-fn { background: rgba(29, 35, 48, .07); color: #3d4657; }
.card-badges-lg { gap: .3rem; }
.card-badges-lg .cbadge { font-size: .74rem; padding: .05rem .55rem; }
.card-tile-badges { margin-top: .3rem; line-height: 1; }

/* ---------- Dettaglio carta: prezzo nel tempo e rulings (card-extras.js) ---------- */
.card-extras { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--bs-border-color); }
.card-extras .ce-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--bs-secondary-color); }
.card-extras .ce-change { font-size: .82rem; color: var(--bs-body-color); }
.card-extras .ce-legend { display: flex; gap: .9rem; font-size: .78rem; color: var(--bs-secondary-color); margin: .3rem 0 .1rem; }
.card-extras .ce-legend i, .card-extras .ce-tip i { display: inline-block; width: .9rem; height: 2px; margin-right: .35rem; vertical-align: middle; border-radius: 2px; }
.card-extras .ce-chart { position: relative; width: 100%; margin-top: .3rem; touch-action: pan-y; }
.card-extras .ce-chart svg { display: block; overflow: visible; }
.card-extras .ce-grid { stroke: #e6e8ee; stroke-width: 1; }
.card-extras .ce-axis { fill: var(--bs-secondary-color); font-size: 10px; }
.card-extras .ce-end { fill: var(--bs-body-color); font-size: 11px; font-weight: 600; }
.card-extras .ce-cross { stroke: #9aa1af; stroke-width: 1; }
.card-extras .ce-tip { position: absolute; top: 0; z-index: 2; pointer-events: none; padding: .35rem .55rem; border-radius: .5rem; background: #fff;
    box-shadow: 0 .3rem 1rem rgba(22, 30, 50, .18); font-size: .78rem; white-space: nowrap; }
.card-extras .ce-table summary, .card-extras .ce-rulings-box summary { cursor: pointer; font-size: .8rem; color: var(--bs-secondary-color); }
.card-extras .ce-table-scroll { max-height: 12rem; overflow-y: auto; margin-top: .3rem; }
.card-extras .ce-rulings-box summary { list-style-position: outside; }
.card-extras .ce-rulings-list { margin: .5rem 0 0; padding-left: 1.1rem; font-size: .88rem; }
.card-extras .ce-rulings-list li { margin-bottom: .45rem; }
.card-extras .ce-date { display: block; font-size: .72rem; color: var(--bs-secondary-color); }

/* ---------- Grafici piccoli (mini-charts.js) ---------- */
.mc-wrap { position: relative; }
.mc-wrap svg { display: block; max-width: 100%; overflow: visible; touch-action: pan-y; }
.mc-grid { stroke: #e3e7ef; stroke-width: 1; }
.mc-base { stroke: #9aa3b5; stroke-width: 1; stroke-dasharray: 4 4; }
.mc-axis { font-size: 11px; fill: #6b7384; }
.mc-cross { stroke: #6b7384; stroke-width: 1; }
.mc-tip {
    position: absolute; pointer-events: none; background: var(--brand-ink); color: #fff; font-size: .78rem;
    border-radius: .5rem; padding: .35rem .6rem; white-space: nowrap; transform: translate(-50%, -115%); display: none; z-index: 2;
}
.mc-legend { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .78rem; color: var(--bs-secondary-color); margin-bottom: .4rem; }
.mc-legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .3rem; vertical-align: -.05rem; }
.mc-cols { display: flex; align-items: stretch; gap: 4px; }
.mc-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: stretch; }
.mc-val { font-size: .7rem; text-align: center; color: var(--bs-secondary-color); font-variant-numeric: tabular-nums; min-height: 1rem; }
.mc-stack { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.mc-stack span { display: block; width: 100%; min-height: 2px; }
.mc-stack span:first-child { border-radius: 4px 4px 0 0; }
.mc-lab { font-size: .7rem; text-align: center; color: var(--bs-secondary-color); margin-top: .25rem; white-space: nowrap; overflow: hidden; }

/* Finestre scorrevoli con un <form> fra .modal-content e il corpo: il form deve essere
   una colonna flessibile, altrimenti il corpo non scorre e il fondo con «Salva» esce
   dal riquadro (al telefono irraggiungibile) */
.modal-dialog-scrollable .modal-content > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; max-height: 100%; overflow: hidden; }
.modal-dialog-scrollable .modal-content > form > .modal-body { overflow-y: auto; }

/* Avviso breve (window.toast in app.js) */
.app-toast {
    position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom)); z-index: 1090;
    transform: translate(-50%, 1rem); opacity: 0; transition: opacity .2s ease, transform .2s ease;
    display: flex; align-items: center; gap: .9rem; max-width: calc(100vw - 2rem);
    background: var(--brand-ink); color: #fff; border-radius: 999px; padding: .6rem 1.1rem; font-size: .9rem;
    box-shadow: 0 .6rem 1.6rem rgba(0, 0, 0, .3);
}
.app-toast.show { opacity: 1; transform: translate(-50%, 0); }
.app-toast a { color: var(--brand-gold); font-weight: 700; text-decoration: none; white-space: nowrap; }
body.has-bottom-nav .app-toast { bottom: calc(4.8rem + env(safe-area-inset-bottom)); }
@media (min-width: 992px) { body.has-bottom-nav .app-toast { bottom: 1.5rem; } }

/* Dita, non mouse: aree di tocco più grandi senza spostare nulla (il margine negativo
   compensa il padding in più) */
@media (pointer: coarse) {
    .hint { padding: .45rem .4rem; margin: -.45rem -.25rem; }
    .back-link { padding: .45rem 0; margin-top: -.45rem; }
    .page-link { min-width: 2.25rem; text-align: center; }
    .deck-hero button.hero-chip { min-height: 2rem; }
}

/* Barre a schede che scorrono di lato al telefono: una sfumatura a destra dice che c'è altro */
@media (max-width: 575.98px) {
    /* Il margine a destra fa uscire dalla sfumatura l'ultima scheda, a fine scorrimento */
    .analysis-tabs, .table-tabs, .trade-nav {
        -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 1.5rem), transparent);
        mask-image: linear-gradient(90deg, #000 calc(100% - 1.5rem), transparent);
        padding-right: 1.5rem !important;
    }
}
/* Mesi dei grafici a colonne: al telefono solo l'iniziale se non c'è posto */
@media (max-width: 399.98px) {
    .mc-lab { font-size: .62rem; letter-spacing: -.02em; }
}

/* ---------- Finestra del token (avatar.js): chiara nel profilo, scura (.hub-modal) nel torneo ---------- */
.av-stage { text-align: center; }
/* touch-action: none = trascinando il punto la finestra non scorre */
.av-frame { position: relative; display: inline-block; max-width: 100%; line-height: 0; border-radius: .6rem; overflow: hidden; cursor: crosshair; touch-action: none; }
.av-frame img { display: block; max-width: 100%; max-height: 15rem; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.av-mark { position: absolute; width: 1.6rem; height: 1.6rem; margin: -.8rem 0 0 -.8rem; border-radius: 50%; border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--brand-ink), 0 0 .6rem rgba(0, 0, 0, .5); pointer-events: none; }
.av-mark::after { content: ''; position: absolute; left: 50%; top: 50%; width: .35rem; height: .35rem; margin: -.175rem 0 0 -.175rem; border-radius: 50%; background: var(--brand-gold); }
.av-tip { color: var(--bs-secondary-color); margin-top: .35rem; }
.av-empty { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 1.6rem 1rem; border: 1px dashed var(--bs-border-color); border-radius: .8rem; color: var(--bs-secondary-color); font-size: .9rem; }
.av-empty .bi { font-size: 2rem; color: var(--brand-gold); }
.av-previews { display: flex; justify-content: center; align-items: flex-end; gap: .9rem; margin-top: .8rem; text-align: center; }
.av-previews small { display: block; color: var(--bs-secondary-color); font-size: .7rem; margin-top: .2rem; }
.av-prev-rect { width: 5.4rem; height: 3.6rem; border-radius: .6rem; overflow: hidden; background: rgba(242, 179, 64, .14); }
/* Metà della schermata «versus» dei tornei a una colonna (2,2:1) */
.av-prev-wide { width: 8rem; height: 3.64rem; border-radius: .6rem; overflow: hidden; background: rgba(242, 179, 64, .14); }
.av-prev-circle { width: 3rem; height: 3rem; border-radius: 50%; overflow: hidden; margin: 0 auto; background: rgba(242, 179, 64, .14); }
.av-results { max-height: 15rem; overflow-y: auto; }
.av-results .list-group-item { display: flex; align-items: center; gap: .6rem; font-size: .9rem; text-align: left; }
.av-results img { width: 3rem; height: 2.2rem; object-fit: cover; border-radius: .3rem; flex-shrink: 0; }
.av-print-strip { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .3rem; }
.av-print { flex: none; padding: 0; border: 2px solid transparent; border-radius: .45rem; background: none; line-height: 0; }
.av-print img { width: 4.2rem; height: 3.1rem; object-fit: cover; border-radius: .3rem; }
.av-print.active { border-color: var(--brand-gold); }
.av-remove { color: #b3261e; text-decoration: none; padding-left: 0; }
.hub-modal .av-remove { color: #ff9b8f; }

/* Token nella pagina del profilo */
.profile-token { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.profile-token-rect { width: 7.5rem; height: 5rem; border-radius: .8rem; overflow: hidden; flex: none;
    background: var(--brand-ink); color: var(--brand-gold); font-weight: 800; font-size: 1.8rem; display: flex; align-items: center; justify-content: center; }
.profile-token-circle { width: 3.2rem; height: 3.2rem; border-radius: 50%; overflow: hidden; flex: none;
    background: var(--brand-gold); color: var(--brand-ink); font-weight: 800; font-size: 1.3rem; display: flex; align-items: center; justify-content: center; }

/* ---------- Carte a due facce (card-faces.js): «Gira la carta» e anteprime con il retro ---------- */
.card-flip { position: relative; }
.card-flip > img { display: block; transition: transform .18s ease-in; }
.card-flip.is-turning > img { transform: perspective(900px) rotateY(90deg); }
.card-flip-btn {
    display: flex; align-items: center; justify-content: center; gap: .35rem; margin: .5rem auto 0; padding: .35rem .95rem;
    border-radius: 999px; border: 1px solid rgba(242, 179, 64, .7); background: var(--brand-ink); color: var(--brand-gold);
    font-weight: 700; font-size: .82rem; line-height: 1.3;
}
.card-flip-btn:hover { background: var(--brand-ink-2); color: var(--brand-gold); }
.card-flip.is-back .card-flip-btn .bi { transform: scaleX(-1); }
/* Carte impilate (CardFaces.stack: griglie e dettagli, richiesta dell'utente del 2026-11-18): il retro
   spunta dietro in alto a sinistra. Il riquadro ha le proporzioni di una carta, così le griglie restano
   allineate; ogni faccia è al 90%. Col mouse il retro passa davanti al passaggio; al tocco le facce si
   scambiano toccando quella che sta dietro (.is-swapped, card-faces.js). */
/* isolation: i livelli delle facce restano dentro la carta, così quantità e pulsanti della tessera stanno sopra */
.card-stack { position: relative; display: block; width: 100%; aspect-ratio: 488 / 680; line-height: 0; isolation: isolate; }
.card-stack > .cs-face { position: absolute; width: 90%; height: 90%; border-radius: 4.75% / 3.5%; box-shadow: 0 .1rem .45rem rgba(29, 35, 48, .32); }
.card-stack > .cs-back { left: 0; top: 0; z-index: 1; }
.card-stack > .cs-front { right: 0; bottom: 0; z-index: 2; }
.card-stack > .cs-face img { display: block; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; border-radius: 4.75% / 3.5%; box-shadow: none; }
.card-stack > .cs-face > .foil-shine { height: 100%; box-shadow: none; }
.card-stack.is-swapped > .cs-back { z-index: 3; }
/* Angolo da toccare: più grande della striscia che spunta; scambiate le facce, va dove spunta il fronte */
.card-stack > .cs-swap { position: absolute; left: 0; top: 0; z-index: 4; width: clamp(2.25rem, 30%, 3.5rem); height: clamp(2.25rem, 22%, 3.5rem); }
.card-stack.is-swapped > .cs-swap { left: auto; top: auto; right: 0; bottom: 0; }
@media (hover: hover) and (pointer: fine) {
    .card-stack:hover > .cs-back { z-index: 3; }
    .card-stack > .cs-swap { display: none; }
}
/* Edizioni: la carta mancante sbiadisce tutta insieme (sbiadite una per una, le facce si vedrebbero l'una attraverso l'altra) */
.set-grid .slot.is-missing .card-stack { filter: grayscale(1); opacity: .35; }
.set-grid .slot.is-missing .card-stack img { filter: none; opacity: 1; }
/* Le capsule delle copie sopra l'immagine non prendono il tocco: l'angolo del retro resta raggiungibile */
.set-grid .slot .slot-chips { pointer-events: none; }
@media (max-width: 575.98px) {
    /* Nei dettagli al telefono la carta impilata resta alta al massimo il 42% dello schermo, come l'immagine semplice */
    .modal .card-stack.card-image:not(.is-zoomed) { width: min(100%, calc(42vh * 488 / 680)); max-height: none; }
    .modal .card-stack.card-image.is-zoomed { width: 100%; max-height: none; }
}
/* Anteprime al passaggio del mouse (#card-preview, #cmp-preview…): fronte e retro affiancati */
[id$="-preview"].has-back { width: 496px !important; }
[id$="-preview"].has-back img { display: inline-block; width: calc(50% - 4px) !important; vertical-align: top; }
[id$="-preview"].has-back img + img { margin-left: 8px; }
[id$="-preview"]:not(.has-back) img.is-back { display: none; }

/* ---------- Copie foil: riflesso arcobaleno fermo sull'immagine, come nell'app (CardImage foil = true) ----------
   Avvolge solo l'<img>. Arcobaleno in color-dodge e bagliore bianco in overlay, tutti e due al 40%
   (richiesta dell'utente del 2026-11-17); i veli non prendono i clic (lo zoom resta sull'<img>). */
.foil-shine { position: relative; display: block; isolation: isolate; overflow: hidden; border-radius: 4.75% / 3.5%; line-height: 0; }
.foil-shine::before, .foil-shine::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; transition: opacity .18s; }
.foil-shine::before {
    mix-blend-mode: color-dodge; opacity: .4;
    background: linear-gradient(115deg, rgba(255, 255, 255, 0) 16%, rgba(255, 60, 160, .6) 30%, rgba(255, 220, 60, .6) 40%,
        rgba(60, 255, 190, .6) 50%, rgba(70, 140, 255, .6) 60%, rgba(190, 80, 255, .55) 70%, rgba(255, 255, 255, 0) 84%) 50% 50% / 260% 260%;
}
.foil-shine::after { mix-blend-mode: overlay; background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .4), rgba(255, 255, 255, 0) 48%); }
/* Durante «Gira la carta» l'immagine è di taglio: niente velo sul vuoto */
.is-turning .foil-shine::before, .is-turning .foil-shine::after { opacity: 0; }

/* ---------- Fondamenta P01a, solo nei contenitori convertiti ----------
 * La pagina carica archivio.css con $archivioUi = true e applica .ar al
 * contenuto e ai singoli dialoghi. Nessun token del sito precedente cambia.
 */
.ar {
    --ar-ink: var(--brand-ink);
    --ar-ink-2: var(--brand-ink-2);
    --ar-gold: var(--brand-gold);
    --ar-accent: var(--brand-gold-text);
    --ar-bg: #f5f3ed;
    --ar-paper: #fffefa;
    --ar-text: var(--brand-ink);
    --ar-muted: #69716f;
    --ar-line: #deddd4;
    --ar-border: #7b858a;
    --ar-error: #a52a2a;
    --ar-success: #246445;
    --ar-selected: #faedcf;
    --ar-sans: 'Magicdeck Nunito Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    /* Titoli: dal 2026-11-08 senza grazie, stesso font del testo in grassetto (il nome è rimasto) */
    --ar-serif: var(--ar-sans);
    --ar-numeric: system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    --ar-space-1: .25rem;
    --ar-space-2: .5rem;
    --ar-space-3: .75rem;
    --ar-space-4: 1rem;
    --ar-space-6: 1.5rem;
    --ar-space-8: 2rem;
    --ar-space-12: 3rem;
    --ar-radius-control: .375rem;
    --ar-radius-panel: .625rem;
    --ar-radius-dialog: 1rem;
    background: var(--ar-bg);
    color: var(--ar-text);
    font-family: var(--ar-sans);
    font-size: 1rem;
    line-height: 1.5;
}
.ar .ar-title, .ar .ar-section-title {
    margin: 0;
    font-family: var(--ar-serif);
    font-weight: 700;
    font-synthesis: none;
    letter-spacing: -.01em;
    overflow-wrap: anywhere;
}
.ar .ar-title { font-size: 2rem; line-height: 1.125; }
.ar .ar-section-title { font-size: 1.75rem; line-height: 1.215; }
.ar .ar-section-title-small { font-size: 1.5rem; line-height: 1.25; }
.ar .ar-compact-title { margin: 0; font: 600 1.25rem/1.3 var(--ar-sans); }
.ar .ar-muted { color: var(--ar-muted); }
.ar .ar-meta { font-size: .8125rem; line-height: 1.385; }
.ar .ar-money, .ar .money, .ar .tx-num {
    font-family: var(--ar-numeric);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.ar .ar-money { font-size: 1rem; }
.ar ::selection { background: var(--ar-gold); color: var(--ar-ink); }
@media (min-width: 768px) {
    .ar .ar-title { font-size: 2.5rem; line-height: 1.1; }
}
@media (min-width: 1200px) {
    .ar .ar-title { font-size: 3rem; line-height: 1.084; }
}

/* ---------- P01b: navigazione comune, contenuti delle pagine non convertiti ---------- */
/* Gli stessi file locali di P01a, usati qui soltanto dalla navigazione. */
@font-face {
    font-family: 'Magicdeck Nunito Sans';
    src: url('../fonts/nunito-sans-400.woff2') format('woff2');
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: 'Magicdeck Nunito Sans';
    src: url('../fonts/nunito-sans-500.woff2') format('woff2');
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: 'Magicdeck Nunito Sans';
    src: url('../fonts/nunito-sans-600.woff2') format('woff2');
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}
@font-face {
    font-family: 'Magicdeck Nunito Sans';
    src: url('../fonts/nunito-sans-700.woff2') format('woff2');
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}
.ar-navigation {
    font-family: 'Magicdeck Nunito Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    font-size: .8125rem;
    font-weight: 500;
    line-height: 1.384615;
}
.ar-shell-inner { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .5rem 1rem; }
.ar-shell-header .brand { margin-right: auto; min-height: 44px; }
.ar-shell-header .brand img { flex-shrink: 0; }
.ar-navigation .ar-nav-link {
    display: flex; align-items: center; gap: .625rem; min-width: 44px; min-height: 44px;
    padding: .5rem .625rem; border: 0; border-radius: .375rem;
    color: #fffefa; background: transparent; text-decoration: none;
    font: inherit; text-align: left; overflow-wrap: anywhere;
}
.ar-navigation .ar-nav-link .bi { flex-shrink: 0; font-size: 1.25rem; line-height: 1; }
.ar-navigation .ar-nav-link:hover { background: var(--brand-ink-2); }
.ar-navigation .ar-nav-link[aria-current="page"] { background: var(--brand-ink-2); color: var(--brand-gold); box-shadow: inset 3px 0 var(--brand-gold); }
.ar-navigation :is(a, button):focus-visible { outline: 3px solid var(--brand-gold); outline-offset: -3px; }
.ar-main-nav, .ar-nav-heading { display: none; }
.ar-support-nav, .ar-account-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .125rem; }
.ar-shell-header .ar-support-label, .ar-shell-header .ar-profile-link { display: none; }
.ar-support-guide { order: -1; }
.ar-nav-icon { position: relative; display: inline-flex; justify-content: center; align-items: center; }
.ar-navigation .ar-nav-badge, .ar-navigation .ar-nav-count {
    display: inline-flex; align-items: center; justify-content: center; min-width: 1rem;
    padding: .125rem .25rem; background: var(--brand-gold); color: var(--brand-ink);
    border-radius: 999px; font-size: .6875rem; line-height: 1; font-weight: 500;
}
.ar-nav-badge { position: absolute; top: -.375rem; left: 70%; }
.ar-nav-count { margin-left: auto; }
.ar-profile-link .nav-avatar { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--brand-ink-2); color: #fffefa; }

/* Base senza JS: due colonne sicure. La misura delle etichette abilita la riga unica. */
.ar-mobile-dock.bottom-nav { display: flex; flex-direction: column; padding: .25rem max(.25rem, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(.25rem, env(safe-area-inset-left)); }
.ar-bottom-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .125rem; }
.ar-bottom-links.ar-one-row { display: flex; gap: 0; }
.ar-mobile-dock .ar-bottom-item {
    display: flex; flex: 1 0 auto; flex-direction: column; align-items: center; justify-content: center;
    gap: .25rem; min-width: 44px; min-height: 44px; padding: .375rem .25rem;
    border: 0; border-radius: .375rem; background: transparent; color: #fffefa;
    font: inherit; text-decoration: none; text-align: center; letter-spacing: normal;
}
.ar-mobile-dock .ar-bottom-item .bi { font-size: 1.25rem; line-height: 1; }
.ar-nav-label { white-space: normal; overflow-wrap: anywhere; }
.ar-one-row .ar-nav-label { white-space: nowrap; }
.ar-mobile-dock .ar-bottom-item[aria-current="page"] { color: var(--brand-gold); background: var(--brand-ink-2); box-shadow: inset 0 3px var(--brand-gold); }
.ar-mobile-dock .ar-bottom-item:hover { background: var(--brand-ink-2); }
.ar-mobile-dock .ar-game-resume { display: flex; flex: none; flex-direction: row; justify-content: center; align-items: center; gap: .75rem; min-height: 44px; padding: .5rem; color: #fffefa; font: inherit; background: var(--brand-ink-2); border-radius: .375rem; }
.ar-mobile-dock .ar-game-resume[hidden] { display: none; }
@media (max-width: 991.98px) {
    body.has-site-nav:not(.in-app) { padding-bottom: calc(var(--ar-dock-height, 12rem) + 1rem); }
    body.has-site-nav:not(.in-app) .app-toast { bottom: calc(var(--ar-dock-height, 12rem) + .5rem); }
}

/* Altro usa il dialogo Bootstrap: focus confinato, Escape e ritorno al pulsante. */
.ar-more .modal-dialog { margin: .5rem auto; max-width: 32rem; width: calc(100% - 1rem); }
.ar-more .modal-content { color: var(--brand-ink); background: #fffefa; border: 1px solid #7b858a; border-radius: 1rem; }
.ar-more .modal-header { gap: .5rem; padding: .5rem 1rem; border-color: #deddd4; }
.ar-more .modal-title { font-family: inherit; font-size: 1.25rem; line-height: 1.3; font-weight: 600; }
.ar-more .modal-body { padding: .5rem; }
.ar-more-links { display: flex; flex-direction: column; gap: .25rem; }
.ar-more .ar-nav-link { color: var(--brand-ink); font-size: 1rem; }
.ar-more .ar-nav-link:hover { background: #f5f3ed; }
.ar-more .ar-nav-link[aria-current="page"] { color: #8a5a00; background: #faedcf; box-shadow: inset 3px 0 #8a5a00; }
.ar-more :is(a, button):focus-visible { outline-color: #8a5a00; }
.ar-more-close { border: 0; border-radius: .375rem; color: inherit; background: transparent; min-width: 44px; min-height: 44px; margin-left: auto; }
@media (max-width: 991.98px) {
    .ar-more .modal-dialog { display: flex; align-items: flex-end; min-height: calc(100% - 1rem); }
    .ar-more .modal-content { max-height: calc(100dvh - 1rem); }
}

/* Fascia B01: navigazione su una riga propria, comandi liberi di andare a capo. */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .ar-shell-inner { padding-inline: 1.5rem; }
    .ar-shell-header .ar-profile-link { display: flex; }
    .ar-main-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; order: 3; flex-basis: 100%; }
    .ar-nav-group { display: flex; flex-wrap: wrap; gap: .25rem; }
}
@media (min-width: 992px) { .ar-mobile-dock.bottom-nav { display: none; } }
/* Barra stretta: icona e nome sotto, dappertutto (Collezione ripensata, 2026-11-25) */
@media (min-width: 1200px) {
    body.has-site-nav:not(.in-app) { padding-left: 88px; }
    body.has-site-nav:not(.in-app) .ar-page-shell { width: 100%; max-width: 1320px; }
    body.has-site-nav:not(.in-app) > div.ar-page-shell { padding-top: 1.5rem; }
    .has-site-nav .ar-shell-header {
        position: fixed; inset: 0 auto 0 0; width: 88px; z-index: 1025; overflow-y: auto; scrollbar-width: none;
        margin: 0 !important; box-shadow: inset -1px 0 rgba(242, 179, 64, .35);
    }
    .has-site-nav .ar-shell-inner { min-height: 100%; flex-direction: column; flex-wrap: nowrap; align-items: stretch; padding: .75rem .375rem; gap: .5rem; }
    .has-site-nav .ar-shell-header .brand { justify-content: center; margin: 0; min-height: 40px; }
    .has-site-nav .ar-shell-header .brand span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .has-site-nav .ar-main-nav, .has-site-nav .ar-nav-group, .has-site-nav .ar-support-nav, .has-site-nav .ar-account-nav { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: .125rem; }
    .has-site-nav .ar-nav-group:not(:has(a)) { display: none; }
    /* Un filetto al posto dei titoli dei gruppi */
    .has-site-nav .ar-nav-group + .ar-nav-group, .has-site-nav .ar-support-nav { margin-top: .375rem; padding-top: .5rem; border-top: 1px solid rgba(255, 255, 255, .14); }
    .has-site-nav .ar-shell-header .ar-nav-link { flex-direction: column; justify-content: center; gap: .2rem; width: 100%; min-height: 50px; padding: .35rem .125rem; font-size: .6875rem; line-height: 1.2; text-align: center; }
    .has-site-nav .ar-shell-header .ar-nav-link > span:last-child { max-width: 100%; overflow-wrap: anywhere; }
    .has-site-nav .ar-shell-header .ar-support-label, .has-site-nav .ar-shell-header .ar-profile-link { display: flex; }
    .has-site-nav .ar-support-label { justify-content: center; }
    .has-site-nav .ar-support-guide { order: 0; }
    .has-site-nav .ar-account-nav { margin-top: auto; }
    .has-site-nav .ar-account-nav .logout-form { display: block; width: 100%; }
}
/* La password obbligata non riserva spazio per sidebar o barra inferiore. */
body:not(.has-site-nav) .ar-shell-header .ar-profile-link { display: flex; }
body.in-app .ar-navigation { display: none !important; }
@media print {
    body.has-site-nav:not(.in-app) { padding-left: 0; padding-bottom: 0; }
    .ar-navigation { display: none !important; }
}
/* Bootstrap .nav dichiara display:flex: hidden deve togliere davvero le schede in Mercato. */
.ar-page-shell .coll-tabs[hidden] { display: none; }

@media (max-width: 379.98px) {
    .ar-shell-inner { gap: .25rem; padding-inline: .5rem; }
}

/* Mazzo bloccato col lucchetto (deck.php): spariscono i comandi di modifica come per chi
   non ha decks.edit. Solo estetica: il server rifiuta comunque ogni scrittura. */
body.deck-locked .needs-decks-edit { display: none !important; }
/* Pagina del mazzo da guardare e usare (deck.php): le modifiche alle carte stanno nella Forgia */
body.deck-view-only .needs-decks-edit, body.deck-view-only .js-view { display: none !important; }
body.deck-view-only .deck-forge-open { font-weight: 800; }
.deck-forge-locked { display: none; align-items: center; gap: .25rem; }
body.deck-locked .deck-forge-open { display: none; }
body.deck-locked .deck-forge-locked { display: inline-flex; }
/* Letture del proprietario che restano anche da bloccato (Cronologia, senza «Ripristina»):
   spariscono solo per chi non ha decks.edit e nei mazzi degli amici */
body.cannot-decks-edit .deck-owner-read { display: none !important; }
.ar.ar-editor-head .deck-lock.is-locked {
    --bs-btn-color: var(--brand-gold);
    --bs-btn-bg: var(--brand-ink-2);
    --bs-btn-border-color: var(--brand-gold);
    --bs-btn-hover-color: var(--brand-gold-2);
    --bs-btn-hover-bg: var(--brand-ink-3);
    --bs-btn-hover-border-color: var(--brand-gold-2);
    --bs-btn-active-color: var(--brand-gold);
    --bs-btn-active-bg: var(--brand-ink-3);
}
.deck-lock-chip { color: var(--brand-gold-text); }
/* Nell'elenco dei mazzi il lucchetto si tocca per sbloccare: zona di tocco più grande senza cambiare la riga */
.ar .ar-tag.js-unlock { position: relative; cursor: pointer; }
.ar .ar-tag.js-unlock::after { content: ""; position: absolute; inset: -.5rem -.25rem; }
.ar .ar-tag.js-unlock:hover { border-color: var(--brand-gold-text); }
.ar .ar-tag.js-unlock:focus-visible { outline: 3px solid var(--brand-gold-text); outline-offset: 2px; }
.ar .ar-tag.js-unlock:disabled { opacity: .6; cursor: default; }

/* Avvisi del superuser (popup di app.js): il testo tiene gli a capo */
.site-notice-body {
    white-space: pre-line;
    overflow-wrap: anywhere;
}
