/* Общий блок «Поделиться» (списки и карточки материалов/турниров) */
.btn-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    flex-shrink: 0;
    padding: 0.5rem 0.85rem;
    border-radius: 0.75rem;
    border: 1px solid #d1fae5;
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    color: #166534;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    text-decoration: none;
}
.btn-share:hover {
    background: #dcfce7;
    border-color: #86efac;
}
.btn-share i { font-size: 0.95rem; }
@media (max-width: 480px) {
    .btn-share span.btn-share-label { display: none; }
    .btn-share {
        width: 2.5rem;
        height: 2.5rem;
        padding: 0;
        border-radius: 0.75rem;
    }
}

.share-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 23, 42, 0.45);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.share-modal.active { display: flex; }
.share-modal-card {
    background: #fff;
    border-radius: 1.25rem;
    width: 100%;
    max-width: 400px;
    padding: 1.35rem 1.35rem 1.2rem;
    box-shadow: 0 20px 40px rgba(0,0,0,.18);
    animation: pageShareIn .2s ease;
}
@keyframes pageShareIn {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to { opacity: 1; transform: none; }
}
.share-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.share-modal-head h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #14532d;
}
.share-close {
    border: none;
    background: #f1f5f9;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
}
.share-qr-wrap {
    display: flex;
    justify-content: center;
    margin: 0.25rem 0 1rem;
}
.share-qr-wrap img {
    width: 200px;
    height: 200px;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    background: #fff;
}
.share-url-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.share-url-row input {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 0.8rem;
    color: #475569;
    background: #f8fafc;
}
.share-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}
.share-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.7rem 0.75rem;
    border-radius: 0.85rem;
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform .12s, filter .12s;
    color: inherit;
}
.share-action:hover { transform: translateY(-1px); filter: brightness(0.98); }
.share-action.copy { background: #ecfdf5; color: #166534; grid-column: 1 / -1; }
.share-action.wa { background: #25D366; color: #fff; }
.share-action.tg { background: #2AABEE; color: #fff; }
.share-action.max { background: #4B55EE; color: #fff; grid-column: 1 / -1; }
.share-toast {
    position: fixed;
    left: 50%;
    bottom: 6.5rem;
    transform: translateX(-50%) translateY(12px);
    background: #14532d;
    color: #fff;
    padding: 0.65rem 1.1rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 3000;
    box-shadow: 0 8px 20px rgba(0,0,0,.2);
}
.share-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Кнопка в topbar турниров (рядом с ghost) */
.td-page .actions .btn-share {
    height: auto;
    min-height: 2.4rem;
}
@media (max-width: 480px) {
    .td-page .actions .btn-share span.btn-share-label { display: none; }
}
