/* ==========================================================================
   Hand of Cards Component
   Displays players on a card with fanned bag tags and invite buttons
   ========================================================================== */

/* ============================================
   CSS Variables
   ============================================ */
.hand-of-cards {
    --hoc-radius: 0.5rem;
    --hoc-radius-pill: 2rem;
    --hoc-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* FL!PT Brand Colors */
    --hoc-primary: #00A69C;
    --hoc-primary-hover: #00857A;
    --hoc-secondary: #0068BA;
}

/* ============================================
   Container
   ============================================ */
.hand-of-cards {
    margin-bottom: 1rem;
    text-align: center;
}

.hand-of-cards__label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

[data-bs-theme="dark"] .hand-of-cards__label {
    color: #9ca3af;
}

/* ============================================
   Mini Card Row (Fanned Visual Preview)
   ============================================ */
.hand-of-cards__mini-row {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1rem 0.5rem;
    min-height: 140px;
}

.hand-of-cards__mini-card {
    position: relative;
    width: 72px;
    height: 126px; /* Bag tag aspect ratio ~390:698 */
    margin-left: -18px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, z-index 0.1s;
    background: #374151;
    border: 2px solid rgba(255, 255, 255, 0.12);
}

.hand-of-cards__mini-card:first-child {
    margin-left: 0;
}

/* Fan rotation for mini cards */
.hand-of-cards__mini-row > .hand-of-cards__mini-card:nth-child(1) { transform: rotate(-6deg); z-index: 5; }
.hand-of-cards__mini-row > .hand-of-cards__mini-card:nth-child(2) { transform: rotate(-3deg); z-index: 4; }
.hand-of-cards__mini-row > .hand-of-cards__mini-card:nth-child(3) { transform: rotate(0deg); z-index: 3; }
.hand-of-cards__mini-row > .hand-of-cards__mini-card:nth-child(4) { transform: rotate(3deg); z-index: 2; }
.hand-of-cards__mini-row > .hand-of-cards__mini-card:nth-child(5) { transform: rotate(6deg); z-index: 1; }

.hand-of-cards__mini-card.clickable {
    cursor: pointer;
}

.hand-of-cards__mini-card.clickable:hover {
    transform: translateY(-4px) rotate(0deg) scale(1.1) !important;
    z-index: 10 !important;
    box-shadow: 0 4px 12px rgba(0, 166, 156, 0.4);
}

.hand-of-cards__mini-bagtag {
    width: 100%;
    height: 100%;
}

.hand-of-cards__mini-bagtag .bag-tag-card {
    width: 100%;
    height: 100%;
    border-radius: 6px;
}

.hand-of-cards__mini-photo {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #1f2937;
    border: 2px solid #1f2937;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    z-index: 2;
}

.hand-of-cards__mini-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Handle PlayerAvatar popup button wrapper */
.hand-of-cards__mini-photo .player-avatar-popup-trigger {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: none;
}

.hand-of-cards__mini-photo .player-avatar-popup-trigger::before {
    display: none; /* Hide the animated ring on mini photos */
}

[data-bs-theme="light"] .hand-of-cards__mini-photo {
    background: #fff;
    border-color: #fff;
}

.hand-of-cards__mini-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--hoc-primary), var(--hoc-secondary));
}

.hand-of-cards__mini-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hand-of-cards__mini-card--open {
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hand-of-cards__mini-card--open i {
    color: rgba(255, 255, 255, 0.3);
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

/* Mini card with background image */
.hand-of-cards__mini-card--open.has-bg {
    overflow: hidden;
}

.hand-of-cards__mini-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.25;
    filter: blur(1px);
    z-index: 0;
}

.hand-of-cards__mini-card--open.has-bg i {
    color: rgba(255, 255, 255, 0.6);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="light"] .hand-of-cards__mini-card-bg {
    opacity: 0.3;
}

[data-bs-theme="light"] .hand-of-cards__mini-card--open.has-bg i {
    color: rgba(0, 0, 0, 0.5);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

/* ============================================
   Player Roster (Full Info List)
   ============================================ */
.hand-of-cards__roster {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.hand-of-cards__roster-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.2s ease;
    text-decoration: none;
}

.hand-of-cards__roster-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Light mode roster item */
[data-bs-theme="light"] .hand-of-cards__roster-item {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-bs-theme="light"] .hand-of-cards__roster-item:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

.hand-of-cards__roster-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
}

.hand-of-cards__roster-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Handle PlayerAvatar popup button wrapper in roster */
.hand-of-cards__roster-avatar .player-avatar-popup-trigger {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: none;
}

.hand-of-cards__roster-avatar .player-avatar-popup-trigger::before {
    display: none; /* Hide the animated ring in roster view */
}

.hand-of-cards__roster-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.hand-of-cards__roster-name {
    font-family: 'Karla', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: #e5e7eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.hand-of-cards__roster-name a {
    color: inherit;
    text-decoration: none;
}

.hand-of-cards__roster-name a:hover {
    color: var(--hoc-primary);
    text-decoration: underline;
}

[data-bs-theme="light"] .hand-of-cards__roster-name {
    color: #1f2937;
}

.hand-of-cards__roster-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.hand-of-cards__roster-meta .pdga-link {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.7rem;
}

.hand-of-cards__roster-meta .pdga-link:hover {
    color: var(--hoc-primary);
}

[data-bs-theme="light"] .hand-of-cards__roster-meta .pdga-link {
    color: rgba(0, 0, 0, 0.5);
}

.hand-of-cards__roster-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex-shrink: 0;
}

.hand-of-cards__roster-division {
    font-family: 'Karla', sans-serif;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #ffffff;
    background: rgba(0, 104, 186, 0.8);
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
}

[data-bs-theme="light"] .hand-of-cards__roster-division {
    background: rgba(0, 104, 186, 0.9);
}

.hand-of-cards__roster-rating {
    font-family: 'Karla', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
}

[data-bs-theme="light"] .hand-of-cards__roster-rating {
    color: rgba(0, 0, 0, 0.5);
}

.hand-of-cards__roster-cta {
    flex-shrink: 0;
    font-family: 'Karla', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--hoc-primary);
    transition: color 0.2s ease;
}

.hand-of-cards__roster-item--open:hover .hand-of-cards__roster-cta {
    color: #00857A;
}

/* Open/Invite roster items */
.hand-of-cards__roster-item--open {
    cursor: pointer;
    border-style: dashed;
    background: none;
}

.hand-of-cards__roster-item--open:hover {
    border-color: var(--hoc-primary);
    background: rgba(0, 166, 156, 0.05);
}

button.hand-of-cards__roster-item--open {
    width: 100%;
    text-align: left;
}

.hand-of-cards__roster-avatar--open {
    background: rgba(0, 166, 156, 0.1);
    border: 2px dashed rgba(0, 166, 156, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hand-of-cards__roster-avatar--open i {
    color: var(--hoc-primary);
    font-size: 0.875rem;
}

.hand-of-cards__roster-name--open {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

.hand-of-cards__roster-item--open:hover .hand-of-cards__roster-name--open {
    color: var(--hoc-primary);
}

[data-bs-theme="light"] .hand-of-cards__roster-name--open {
    color: rgba(0, 0, 0, 0.4);
}

/* Empty roster items */
.hand-of-cards__roster-item--empty {
    cursor: default;
    opacity: 0.5;
}

.hand-of-cards__roster-avatar--empty {
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hand-of-cards__roster-avatar--empty i {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.875rem;
}

.hand-of-cards__roster-name--empty {
    color: rgba(255, 255, 255, 0.3);
    font-weight: 400;
    font-style: italic;
}

[data-bs-theme="light"] .hand-of-cards__roster-avatar--empty {
    background: rgba(0, 0, 0, 0.03);
}

[data-bs-theme="light"] .hand-of-cards__roster-avatar--empty i {
    color: rgba(0, 0, 0, 0.15);
}

[data-bs-theme="light"] .hand-of-cards__roster-name--empty {
    color: rgba(0, 0, 0, 0.25);
}

/* ============================================
   Legacy Card Row (Fanned Layout) - kept for backwards compatibility
   ============================================ */
.hand-of-cards__row {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0.5rem 0 1rem;
    min-height: 100px;
}

/* ============================================
   Individual Card
   ============================================ */
.hand-of-cards__card {
    position: relative;
    margin-left: -20px;
    transition: transform 0.3s ease, z-index 0.1s;
    cursor: default;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hand-of-cards__card:first-child {
    margin-left: 0;
}

/* Fan rotation effect - each card rotates slightly (scoped to hand-of-cards__row) */
.hand-of-cards__row > .hand-of-cards__card:nth-child(1) { transform: rotate(-8deg); z-index: 5; }
.hand-of-cards__row > .hand-of-cards__card:nth-child(2) { transform: rotate(-4deg); z-index: 4; }
.hand-of-cards__row > .hand-of-cards__card:nth-child(3) { transform: rotate(0deg); z-index: 3; }
.hand-of-cards__row > .hand-of-cards__card:nth-child(4) { transform: rotate(4deg); z-index: 2; }
.hand-of-cards__row > .hand-of-cards__card:nth-child(5) { transform: rotate(8deg); z-index: 1; }

/* Hover: lift and straighten (scoped to hand-of-cards__row) */
.hand-of-cards__row > .hand-of-cards__card:hover {
    transform: translateY(-8px) rotate(0deg) !important;
    z-index: 10 !important;
}

/* ============================================
   Card Inner (Bag Tag Container)
   ============================================ */
.hand-of-cards__card-inner {
    position: relative;
    width: 88px;
    height: 124px;
    border-radius: 6px;
    background: white;
    border: 3px solid white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--hoc-transition);
}

.hand-of-cards__row > .hand-of-cards__card:hover .hand-of-cards__card-inner {
    transform: scale(1.05);
}

[data-bs-theme="dark"] .hand-of-cards__card-inner {
    border-color: #374151;
    background: #374151;
}

/* ============================================
   Bag Tag Display
   ============================================ */
.hand-of-cards__bagtag {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 4px;
}

/* Override bag tag partial sizing */
.hand-of-cards__bagtag .bag-tag-card {
    width: 100%;
    height: 100%;
    border-radius: 6px;
}

.hand-of-cards__bagtag .bag-tag-card-frame {
    border-radius: 6px;
}

.hand-of-cards__bagtag .bag-tag-card-image {
    border-radius: 4px;
}

.hand-of-cards__bagtag .bag-tag-card-shine {
    border-radius: 6px;
}

/* Hide default hover effects on bag tags in hand */
.hand-of-cards__bagtag .bag-tag-card:hover {
    transform: none;
    box-shadow: none;
}

/* ============================================
   Player Photo Overlay
   ============================================ */
.hand-of-cards__photo-overlay {
    position: absolute;
    bottom: -6px;
    right: -6px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.hand-of-cards__photo-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

[data-bs-theme="dark"] .hand-of-cards__photo-overlay {
    background: #374151;
    border-color: #374151;
}

/* ============================================
   Avatar Fallback (No Bag Tag)
   ============================================ */
.hand-of-cards__avatar-card {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--hoc-primary), var(--hoc-secondary));
}

.hand-of-cards__avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hand-of-cards__initials {
    font-family: 'Karla', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ============================================
   Player Info (Name + Division)
   ============================================ */
.hand-of-cards__info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    margin-top: 0.5rem;
    text-align: center;
    max-width: 100px;
}

.hand-of-cards__name {
    font-family: 'Karla', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

[data-bs-theme="dark"] .hand-of-cards__name {
    color: #e5e7eb;
}

.hand-of-cards__division {
    font-family: 'Karla', sans-serif;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #6b7280;
    background: #f1f5f9;
    padding: 0.0625rem 0.375rem;
    border-radius: 0.25rem;
}

[data-bs-theme="dark"] .hand-of-cards__division {
    color: #9ca3af;
    background: #374151;
}

/* ============================================
   Open Spot / Invite Button
   ============================================ */
.hand-of-cards__card--open {
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    text-decoration: none;
}

.hand-of-cards__card--open .hand-of-cards__card-inner {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    box-shadow: none;
}

.hand-of-cards__card--open:hover .hand-of-cards__card-inner {
    border-color: var(--hoc-primary);
    transform: scale(1.02);
}

[data-bs-theme="dark"] .hand-of-cards__card--open .hand-of-cards__card-inner {
    background: #1f2937;
    border-color: #4b5563;
}

[data-bs-theme="dark"] .hand-of-cards__card--open:hover .hand-of-cards__card-inner {
    border-color: var(--hoc-primary);
}

.hand-of-cards__open-slot {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hand-of-cards__open-slot i {
    color: var(--hoc-primary);
    font-size: 1.5rem;
    background: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    transition: var(--hoc-transition);
}

.hand-of-cards__card--open:hover .hand-of-cards__open-slot i {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .hand-of-cards__open-slot i {
    background: #374151;
    color: var(--hoc-primary);
}

.hand-of-cards__card--open .hand-of-cards__name {
    color: #94a3b8;
}

.hand-of-cards__card--open:hover .hand-of-cards__name {
    color: var(--hoc-primary);
}

/* Open slot with background image (TeaseCard variant) */
.hand-of-cards__open-slot--with-bg {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.hand-of-cards__open-slot-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
    filter: blur(1px);
}

.hand-of-cards__open-slot--with-bg i {
    position: relative;
    z-index: 1;
}

/* Empty spot (non-interactive) */
.hand-of-cards__card--empty .hand-of-cards__card-inner {
    background: #f8fafc;
    border: 2px dashed #e2e8f0;
    box-shadow: none;
}

[data-bs-theme="dark"] .hand-of-cards__card--empty .hand-of-cards__card-inner {
    background: #1f2937;
    border-color: #374151;
}

.hand-of-cards__card--empty .hand-of-cards__open-slot i {
    color: #cbd5e1;
    background: transparent;
    box-shadow: none;
}

[data-bs-theme="dark"] .hand-of-cards__card--empty .hand-of-cards__open-slot i {
    color: #4b5563;
}

/* ============================================
   Clickable Variant (for card modals)
   ============================================ */
.hand-of-cards--clickable .hand-of-cards__card.clickable {
    cursor: pointer;
}

.hand-of-cards--clickable .hand-of-cards__card.clickable:hover .hand-of-cards__card-inner {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Compact Variant
   ============================================ */
.hand-of-cards--compact .hand-of-cards__card {
    margin-left: -15px;
}

.hand-of-cards--compact .hand-of-cards__card-inner {
    width: 68px;
    height: 96px;
}

.hand-of-cards--compact .hand-of-cards__photo-overlay {
    width: 32px;
    height: 32px;
    bottom: -4px;
    right: -4px;
}

.hand-of-cards--compact .hand-of-cards__info {
    max-width: 75px;
}

.hand-of-cards--compact .hand-of-cards__name {
    font-size: 0.7rem;
}

.hand-of-cards--compact .hand-of-cards__division {
    font-size: 0.5625rem;
    padding: 0.0625rem 0.25rem;
}

.hand-of-cards--compact .hand-of-cards__initials {
    font-size: 1rem;
}

.hand-of-cards--compact .hand-of-cards__open-slot i {
    width: 36px;
    height: 36px;
    font-size: 1.25rem;
}

/* ============================================
   Responsive: Mobile
   ============================================ */
@media (max-width: 480px) {
    .hand-of-cards__card {
        margin-left: -18px;
    }

    .hand-of-cards__card-inner {
        width: 68px;
        height: 96px;
    }

    .hand-of-cards__photo-overlay {
        width: 32px;
        height: 32px;
        bottom: -4px;
        right: -4px;
    }

    .hand-of-cards__info {
        max-width: 72px;
    }

    .hand-of-cards__name {
        font-size: 0.7rem;
    }

    .hand-of-cards__division {
        font-size: 0.5625rem;
        padding: 0 0.25rem;
    }

    .hand-of-cards__initials {
        font-size: 1rem;
    }

    .hand-of-cards__open-slot i {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }
}

/* ============================================
   Hand of Cards Modal - Premium Card Viewer
   A Tinder-like swipe experience with physics
   ============================================ */

/* CSS Custom Properties for the modal */
.hoc-modal-overlay {
    --hoc-modal-glow: rgba(0, 166, 156, 0.4);
    --hoc-modal-glow-secondary: rgba(0, 104, 186, 0.3);
    --hoc-modal-accent: #00A69C;
}

/* Backdrop Layer */
.hoc-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(10, 15, 20, 0.95) 0%, rgba(0, 0, 0, 0.98) 100%);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
}

/* Contextual Background - League/Event Image */
.hoc-modal-context-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 0;
}

.hoc-modal-context-bg--visible {
    opacity: 0.12;
}

/* Vignette overlay on context bg for better card focus */
.hoc-modal-context-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        ellipse 80% 60% at center,
        transparent 0%,
        rgba(0, 0, 0, 0.6) 70%,
        rgba(0, 0, 0, 0.9) 100%
    );
}

/* Subtle animation for context bg */
.hoc-modal-context-bg--visible {
    animation: hocContextFloat 20s ease-in-out infinite;
}

@keyframes hocContextFloat {
    0%, 100% {
        transform: scale(1.05) translate(0, 0);
    }
    25% {
        transform: scale(1.08) translate(-1%, -1%);
    }
    50% {
        transform: scale(1.1) translate(0, -2%);
    }
    75% {
        transform: scale(1.08) translate(1%, -1%);
    }
}

/* Main Overlay */
.hoc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hoc-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Content Container */
.hoc-modal-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1;
}

/* Close Button */
.hoc-modal-close {
    position: absolute;
    top: -3.5rem;
    right: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.hoc-modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: rotate(90deg);
}

.hoc-modal-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* Navigation Buttons */
.hoc-modal-nav {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.hoc-modal-nav:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    transform: scale(1.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.hoc-modal-nav:active {
    transform: scale(0.95);
}

.hoc-modal-prev:hover {
    transform: scale(1.08) translateX(-2px);
}

.hoc-modal-next:hover {
    transform: scale(1.08) translateX(2px);
}

/* Card Container with Glow */
.hoc-modal-card-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    opacity: 0;
    transform: scale(0.85) translateY(30px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hoc-modal-card-container--visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.hoc-modal-card-container--closing {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 1, 1);
}

/* Ambient Glow Behind Card */
.hoc-modal-card-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    height: 540px;
    background: radial-gradient(
        ellipse at center,
        var(--hoc-modal-glow) 0%,
        var(--hoc-modal-glow-secondary) 40%,
        transparent 70%
    );
    filter: blur(60px);
    opacity: 0.6;
    pointer-events: none;
    animation: hocGlowPulse 4s ease-in-out infinite;
}

@keyframes hocGlowPulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.7; transform: translate(-50%, -50%) scale(1.05); }
}

/* The Card - matches bag tag aspect ratio 390:698 */
.hoc-modal-card {
    position: relative;
    width: 280px;
    height: 501px;
    aspect-ratio: 390 / 698;
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 10px 30px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform-origin: center bottom;
    will-change: transform;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;

    /* CSS variables for swipe hints */
    --swipe-left-opacity: 0;
    --swipe-right-opacity: 0;
}

.hoc-modal-card--dragging {
    cursor: grabbing;
}

/* Card Shine Effect */
.hoc-modal-card-shine {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.15) 0%,
        transparent 40%,
        transparent 60%,
        rgba(255, 255, 255, 0.05) 100%
    );
    pointer-events: none;
    z-index: 2;
    border-radius: 16px;
}

/* Card Image */
.hoc-modal-card .hoc-modal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* Swipe Direction Hints */
.hoc-modal-swipe-hint {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 3;
    transition: opacity 0.15s ease;
}

.hoc-modal-swipe-hint--left {
    left: 12px;
    background: rgba(255, 100, 100, 0.9);
    opacity: var(--swipe-left-opacity);
}

.hoc-modal-swipe-hint--right {
    right: 12px;
    background: rgba(100, 220, 100, 0.9);
    opacity: var(--swipe-right-opacity);
}

.hoc-modal-swipe-hint svg {
    color: white;
}

/* Card Exit Animations */
.hoc-modal-card--exit-left {
    animation: hocCardExitLeft 0.2s ease-in forwards;
}

.hoc-modal-card--exit-right {
    animation: hocCardExitRight 0.2s ease-in forwards;
}

@keyframes hocCardExitLeft {
    to {
        transform: translateX(-120%) rotate(-15deg);
        opacity: 0;
    }
}

@keyframes hocCardExitRight {
    to {
        transform: translateX(120%) rotate(15deg);
        opacity: 0;
    }
}

/* Card Enter Animations */
.hoc-modal-card--enter-left {
    transform: translateX(-100%) rotate(-10deg);
    opacity: 0;
}

.hoc-modal-card--enter-right {
    transform: translateX(100%) rotate(10deg);
    opacity: 0;
}

.hoc-modal-card--entering {
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.25s ease;
    transform: translateX(0) rotate(0) !important;
    opacity: 1 !important;
}

/* Fade Transitions (for dot navigation) */
.hoc-modal-card--fade-out {
    animation: hocCardFadeOut 0.15s ease-out forwards;
}

.hoc-modal-card--fade-in {
    animation: hocCardFadeIn 0.25s ease-out forwards;
}

@keyframes hocCardFadeOut {
    to { opacity: 0; transform: scale(0.95); }
}

@keyframes hocCardFadeIn {
    from { opacity: 0; transform: scale(1.03); }
    to { opacity: 1; transform: scale(1); }
}

/* Player Info Section */
.hoc-modal-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.hoc-modal-player-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.4),
        0 0 0 4px rgba(0, 166, 156, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hoc-modal-player-avatar:hover {
    transform: scale(1.05);
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.5),
        0 0 0 4px rgba(0, 166, 156, 0.4);
}

.hoc-modal-player-name {
    font-family: 'Bebas Neue', 'Karla', system-ui, sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    text-decoration: none;
    cursor: pointer;
    transition: color 150ms ease, text-shadow 150ms ease;
}

.hoc-modal-player-name:hover {
    color: var(--hoc-modal-accent, #14b8a6);
    text-shadow: 0 2px 12px rgba(0, 166, 156, 0.6);
}

/* Override player-name-trigger underline animation in modal context */
.hoc-modal-player-name.player-name-trigger::after {
    display: none;
}

.hoc-modal-tag-number {
    font-family: 'Karla', system-ui, sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--hoc-modal-accent);
    background: rgba(0, 166, 156, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    border: 1px solid rgba(0, 166, 156, 0.3);
}

/* High Concept - The character tagline */
.hoc-modal-high-concept {
    font-family: 'Crimson Text', 'Georgia', serif;
    font-size: 1rem;
    font-style: italic;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.75);
    text-align: center;
    max-width: 300px;
    line-height: 1.4;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    border-radius: 0.5rem;
    border-left: 2px solid var(--hoc-modal-accent);
}

/* View Details Link */
.hoc-modal-detail-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--hoc-modal-accent), #0891b2);
    border-radius: 2rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 12px rgba(0, 166, 156, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.hoc-modal-detail-link:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(0, 166, 156, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    color: white;
    text-decoration: none;
}

.hoc-modal-detail-link:active {
    transform: translateY(0);
}

.hoc-modal-detail-link svg {
    flex-shrink: 0;
}

/* Pill-Style Dot Indicators */
.hoc-modal-dots {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.hoc-modal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.hoc-modal-dot::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--hoc-modal-accent);
    opacity: 0;
    transition: all 0.3s ease;
}

.hoc-modal-dot:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.2);
}

.hoc-modal-dot.active {
    width: 24px;
    border-radius: 1rem;
    background: var(--hoc-modal-accent);
    box-shadow: 0 0 12px rgba(0, 166, 156, 0.5);
}

.hoc-modal-dot:focus-visible {
    outline: 2px solid var(--hoc-modal-accent);
    outline-offset: 2px;
}

/* ============================================
   Modal: Mobile Responsive
   ============================================ */
@media (max-width: 520px) {
    .hoc-modal-content {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .hoc-modal-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
        width: 44px;
        height: 44px;
        background: rgba(0, 0, 0, 0.5);
        border-color: rgba(255, 255, 255, 0.15);
    }

    .hoc-modal-prev {
        left: 0.75rem;
    }

    .hoc-modal-next {
        right: 0.75rem;
    }

    .hoc-modal-prev:hover,
    .hoc-modal-next:hover {
        transform: translateY(-50%) scale(1.05);
    }

    .hoc-modal-card {
        width: 240px;
        height: auto;
        aspect-ratio: 390 / 698;
    }

    .hoc-modal-card-glow {
        width: 270px;
        height: 480px;
    }

    .hoc-modal-close {
        top: -3rem;
        right: 0.5rem;
        width: 40px;
        height: 40px;
    }

    .hoc-modal-player-name {
        font-size: 1.25rem;
    }

    .hoc-modal-high-concept {
        font-size: 0.9rem;
        max-width: 260px;
        padding: 0.375rem 0.75rem;
    }

    .hoc-modal-dots {
        padding: 0.375rem 0.75rem;
    }

    .hoc-modal-dot {
        width: 6px;
        height: 6px;
    }

    .hoc-modal-dot.active {
        width: 20px;
    }
}

/* Extra small screens */
@media (max-width: 380px) {
    .hoc-modal-card {
        width: 200px;
        height: auto;
        aspect-ratio: 390 / 698;
    }

    .hoc-modal-card-glow {
        width: 230px;
        height: 400px;
    }

    .hoc-modal-player-avatar {
        width: 52px;
        height: 52px;
    }
}

/* ==========================================================================
   Top Bag Tags Hand - Compact leaderboard preview
   ========================================================================== */

.top-bagtags-hand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--theme-bg-secondary, rgba(0, 0, 0, 0.2));
    border-radius: 1rem;
    border: 1px solid var(--theme-border, rgba(255, 255, 255, 0.1));
}

.top-bagtags-hand__label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--theme-text-muted, rgba(255, 255, 255, 0.7));
}

.top-bagtags-hand__label i {
    color: var(--theme-warning, #f59e0b);
}

.top-bagtags-hand__row {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    min-height: 420px;
}

.top-bagtags-hand__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fan effect - cards spread out from center */
.top-bagtags-hand__card:nth-child(1) { transform: rotate(-8deg) translateY(4px); z-index: 1; }
.top-bagtags-hand__card:nth-child(2) { transform: rotate(-4deg) translateY(2px); z-index: 2; }
.top-bagtags-hand__card:nth-child(3) { transform: rotate(0deg); z-index: 3; }
.top-bagtags-hand__card:nth-child(4) { transform: rotate(4deg) translateY(2px); z-index: 2; }
.top-bagtags-hand__card:nth-child(5) { transform: rotate(8deg) translateY(4px); z-index: 1; }

.top-bagtags-hand__card:hover {
    transform: translateY(-8px) scale(1.1) rotate(0deg) !important;
    z-index: 10 !important;
}

.top-bagtags-hand__card-inner {
    position: relative;
    width: 180px;
    height: 324px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: box-shadow 0.3s ease;
}

.top-bagtags-hand__card:hover .top-bagtags-hand__card-inner {
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(0, 166, 156, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.top-bagtags-hand__card-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.top-bagtags-hand__rank {
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    background: rgba(0, 0, 0, 0.75);
    padding: 6px 14px;
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

.top-bagtags-hand__name {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--theme-text-muted, rgba(255, 255, 255, 0.7));
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.top-bagtags-hand__link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--theme-primary, #00A69C);
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    border-radius: 1rem;
    transition: all 0.2s ease;
}

.top-bagtags-hand__link:hover {
    background: rgba(0, 166, 156, 0.1);
    color: var(--theme-primary, #00A69C);
    text-decoration: none;
}

.top-bagtags-hand__link i {
    font-size: 0.625rem;
    transition: transform 0.2s ease;
}

.top-bagtags-hand__link:hover i {
    transform: translateX(3px);
}

/* Responsive - Tablet */
@media (max-width: 992px) {
    .top-bagtags-hand__card-inner {
        width: 96px;
        height: 173px;
    }

    .top-bagtags-hand__row {
        min-height: 190px;
        gap: 0.75rem;
    }

    .top-bagtags-hand__rank {
        font-size: 0.875rem;
        padding: 3px 8px;
        bottom: 6px;
        right: 6px;
    }

    .top-bagtags-hand__name {
        font-size: 0.85rem;
        max-width: 100px;
    }
}

/* Responsive - Mobile */
@media (max-width: 576px) {
    .top-bagtags-hand__card-inner {
        width: 64px;
        height: 115px;
    }

    .top-bagtags-hand__row {
        min-height: 130px;
        gap: 0.35rem;
    }

    .top-bagtags-hand__name {
        font-size: 0.7rem;
        max-width: 72px;
    }

    .top-bagtags-hand__rank {
        font-size: 0.7rem;
        padding: 2px 6px;
        bottom: 4px;
        right: 4px;
    }

    .top-bagtags-hand__label {
        font-size: 0.85rem;
    }
}

@media (max-width: 380px) {
    .top-bagtags-hand__card-inner {
        width: 52px;
        height: 94px;
    }

    .top-bagtags-hand__row {
        min-height: 105px;
        gap: 0.25rem;
    }

    .top-bagtags-hand__name {
        font-size: 0.6rem;
        max-width: 60px;
    }

    .top-bagtags-hand__rank {
        font-size: 0.6rem;
        padding: 1px 4px;
    }
}
