/* ============================================
   PARTICIPANT CARD - NFL-style player card
   ============================================ */

/* --- Modal Overlay --- */
.tpp-pc-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overscroll-behavior: contain;
}

.tpp-pc-modal[aria-hidden="false"] {
    display: flex;
}

.tpp-pc-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.tpp-pc-modal__container {
    position: relative;
    z-index: 1;
    max-width: 440px;
    width: 100%;
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    border-radius: 0 20px 20px 20px;
    scrollbar-width: thin;
    scrollbar-color: #374151 transparent;
}

.tpp-pc-modal__container::-webkit-scrollbar {
    width: 6px;
}

.tpp-pc-modal__container::-webkit-scrollbar-track {
    background: transparent;
}

.tpp-pc-modal__container::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 3px;
}

.tpp-pc-modal__close {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100001;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.tpp-pc-modal__close:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* --- Loader --- */
.tpp-pc-modal__loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 60px 20px;
    color: #9ca3af;
    font-size: 14px;
}

.tpp-pc-modal__loader .tpp-spinner {
    color: #05d38f;
}

/* --- Error State --- */
.tpp-pc-modal__error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 20px;
    color: #9ca3af;
    font-size: 15px;
    text-align: center;
}

/* --- Card Component --- */
.tpp-pc {
    background: #1a1a2e;
    /* Top-left sharp, rest 20px - matches Stars photo layout */
    border-radius: 0 20px 20px 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    color: #e5e7eb;
    font-family: 'Audiowide', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --- Photo Section (matches Stars module layout exactly) --- */
.tpp-pc__photos {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    background: #1a1a2e;
    overflow: visible;
    /* 3 corners rounded, top-left straight - same as Stars */
    border-radius: 0 20px 20px 20px;
}

.tpp-pc__tractor {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0 20px 60px 60px;
}

.tpp-pc__person {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 50%;
    object-fit: cover;
    border-radius: 60px 20px 60px 60px;
    box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

.tpp-pc__number {
    position: absolute;
    top: 0;
    left: 0;
    width: 25%;
    aspect-ratio: 1;
    background-color: rgba(5, 211, 143, 0.8);
    color: #ffffff;
    font-family: 'Audiowide', sans-serif;
    font-weight: 700;
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Top-left sharp, other 3 corners rounded */
    border-radius: 0 50px 50px 50px;
    z-index: 3;
}

.tpp-pc__number:empty {
    display: none;
}

.tpp-pc__badge {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 75%;
    height: auto;
    transform: translateX(-50%) translateY(33.33%);
    z-index: 3;
    pointer-events: none;
}

.tpp-pc__photo-placeholder {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1f2937, #2d3748);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Info Section --- */
.tpp-pc__info {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Account for badge overflow */
.tpp-pc:has(.tpp-pc__badge) .tpp-pc__info {
    padding-top: 40px;
}

/* Fallback for browsers without :has() */
@supports not (selector(:has(*))) {
    .tpp-pc__info {
        padding-top: 40px;
    }
}

/* --- Header: Name & Location --- */
.tpp-pc__header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.tpp-pc__name {
    font-family: 'Audiowide', sans-serif;
    font-size: clamp(1.35rem, 3.75vw, 1.725rem);
    font-weight: 700;
    color: #05d38f;
    margin: 10px 0 0;
    line-height: 1.3;
    text-align: center;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tpp-pc__location-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.tpp-pc__location {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 16px;
    color: #9ca3af;
    white-space: nowrap;
}

.tpp-pc__location svg {
    color: #6b7280;
    flex-shrink: 0;
}

/* --- Divider --- */
.tpp-pc__divider {
    height: 1px;
    background: linear-gradient(to right, #05d38f, transparent);
    margin: 2px 0;
}

/* --- Vehicle Info --- */
.tpp-pc__vehicle {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tpp-pc__vehicle-line {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 12px;
    font-size: 14px;
    color: #d1d5db;
    line-height: 1.4;
}

.tpp-pc__vehicle-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tpp-pc__vehicle-item svg {
    color: #f59e0b;
    flex-shrink: 0;
}

/* --- Category --- */
.tpp-pc__category {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.4;
}

.tpp-pc__category svg {
    color: #6b7280;
    flex-shrink: 0;
}

/* --- Bio --- */
.tpp-pc__bio {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 10px 12px;
    border-left: 3px solid #05d38f;
}

.tpp-pc__bio p {
    margin: 0;
    font-size: 13px;
    color: #d1d5db;
    line-height: 1.5;
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Social Links --- */
.tpp-pc__social {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tpp-pc__social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #9ca3af;
    transition: background 0.2s, color 0.2s;
    text-decoration: none;
}

.tpp-pc__social-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.tpp-pc__social-link--youtube:hover { color: #ff0000; }
.tpp-pc__social-link--facebook:hover { color: #1877f2; }
.tpp-pc__social-link--twitter:hover { color: #fff; }
.tpp-pc__social-link--instagram:hover { color: #e4405f; }
.tpp-pc__social-link--tiktok:hover { color: #fff; }
.tpp-pc__social-link--linkedin:hover { color: #0a66c2; }

/* --- Share Section --- */
.tpp-pc__share {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 12px;
    margin-top: 4px;
}

.tpp-pc__share-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6b7280;
    margin-bottom: 10px;
    text-align: center;
}

.tpp-pc__share-buttons {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.tpp-pc__share-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    color: #fff;
    font-family: inherit;
}

.tpp-pc__share-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tpp-pc__share-btn--facebook {
    background: #1877f2;
}

.tpp-pc__share-btn--facebook:hover:not(:disabled) {
    background: #166fe5;
}

.tpp-pc__share-btn--twitter {
    background: #000;
    border: 1px solid #333;
}

.tpp-pc__share-btn--twitter:hover:not(:disabled) {
    background: #1a1a1a;
}

.tpp-pc__share-btn--copy {
    background: #374151;
}

.tpp-pc__share-btn--copy:hover:not(:disabled) {
    background: #4b5563;
}

.tpp-pc__download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 16px;
    border: 1px solid rgba(5, 211, 143, 0.3);
    border-radius: 8px;
    background: rgba(5, 211, 143, 0.08);
    color: #05d38f;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    font-family: inherit;
}

.tpp-pc__download-btn:hover:not(:disabled) {
    background: rgba(5, 211, 143, 0.15);
    border-color: rgba(5, 211, 143, 0.5);
}

.tpp-pc__download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   START NUMBER MODAL CONTEXT
   Card embedded in the blocking modal
   ============================================ */

.tpp-sn-modal .tpp-pc {
    max-width: 100%;
    box-shadow: none;
    margin-bottom: 16px;
}

/* Share step header */
.tpp-sn-modal__share-header {
    text-align: center;
    margin-bottom: 16px;
}

.tpp-sn-modal__icon--success {
    color: #10b981;
    margin-bottom: 12px;
}

.tpp-sn-modal__share-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px;
}

.tpp-sn-modal__share-header p {
    font-size: 14px;
    color: #9ca3af;
    margin: 0;
    line-height: 1.5;
}

/* Continue button in share step */
.tpp-sn-modal__submit--continue {
    background: #1f2937;
    font-size: 14px;
    padding: 12px 24px;
    border: 1px solid #374151;
    margin-top: 8px;
}

.tpp-sn-modal__submit--continue:hover:not(:disabled) {
    background: #374151;
    border-color: #4b5563;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .tpp-pc-modal {
        padding: 10px;
        padding: env(safe-area-inset-top, 10px) env(safe-area-inset-right, 10px) env(safe-area-inset-bottom, 10px) env(safe-area-inset-left, 10px);
    }

    .tpp-pc-modal__container {
        max-width: 100%;
        max-height: 95vh;
        max-height: 95dvh;
    }

    .tpp-pc-modal__close {
        top: max(16px, env(safe-area-inset-top, 16px));
        right: max(16px, env(safe-area-inset-right, 16px));
    }

    .tpp-pc__share-btn {
        min-height: 44px;
    }

    .tpp-pc__download-btn {
        min-height: 44px;
    }

    .tpp-pc__social-link {
        width: 36px;
        height: 36px;
    }

    /* Karta zawodnika w modalu numeru startowego */
    .tpp-sn-modal .tpp-pc {
        max-width: 100%;
    }

    .tpp-sn-modal .tpp-pc__number {
        font-size: min(7vw, 2.5rem);
    }
}

@media (max-width: 480px) {
    .tpp-pc-modal {
        padding: 0;
        align-items: flex-end;
    }

    .tpp-pc-modal__container {
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0 20px 0 0;
    }

    .tpp-pc__info {
        padding: 12px 14px 16px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }

    .tpp-pc__name {
        font-size: clamp(0.9rem, 4vw, 1.35rem);
    }

    .tpp-pc__share-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .tpp-pc__download-btn {
        padding: 10px 14px;
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .tpp-pc__share-buttons {
        flex-direction: column;
    }

    .tpp-pc__share-btn {
        justify-content: center;
        width: 100%;
    }
}
