/*@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');*/

/* Legenda */

.asta-legenda-title {
    font-size: 20px;
}

.asta-legenda-items p {
    font-size: 16px;
}

/* Aste in chiusura section */
.asta-chiusura-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ═══════════════════════════════════════
   CARD ASTE IN CHIUSURA (componente)
   ═══════════════════════════════════════ */

.card-chiusura {
    border: 1px solid rgba(250, 250, 249, 0.25);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: row;
    gap: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    justify-content: space-between;
}

    .card-chiusura:hover {
        background: rgba(250, 250, 249, 0.05);
    }

.card-chiusura-top {
    display: flex;
    gap: 16px;
    align-items: center;
}

.card-chiusura-player-icon {
    width: 38px;
    height: 42px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .card-chiusura-player-icon img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .card-chiusura-player-icon img.shirt-fallback {
        filter: invert(1) brightness(0.8);
    }

    .card-chiusura-player-icon.shirt-dark img {
        filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.35));
    }

.card-chiusura-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.card-chiusura-role {
    font-size: 1.5rem;
    font-weight: 700;
    color: #FAFAF9;
    line-height: 1;
}

.card-chiusura-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 1rem;
    color: #FAFAF9;
}

.card-chiusura-team {
    font-weight: 500;
}

.card-chiusura-sep {
    font-weight: 400;
}

.card-chiusura-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

/* CTA Vai */
.card-chiusura-cta {
    display: flex;
    gap: 12px;
    align-items: center;
    color: #C5AF6C;
    font-size: 1.125rem;
    font-weight: 500;
}

.card-chiusura-arrow {
    font-size: 1rem;
}

/* Variante "Stai vincendo" */
.card-chiusura.winning .card-chiusura-cta {
    color: var(--mud-palette-success);
}


/* ═══════════════════════════════════════
   CANVAS 3D / CAMPO 2D MOBILE
   ═══════════════════════════════════════ */

#canvas-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: block;
    z-index: 1;
}

#canvas-container canvas {
    display: block;
}

/* ── Campo 2D mobile (fallback zero-WebGL) ──
   Orientamento VERTICALE: asse lungo del campo = top↔bottom
   Porta home in alto, porta away in basso */

.field-2d {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #111111;
    overflow: hidden;
}

.field-2d-pitch {
    position: absolute;
    /* Centrato con margini proporzionali */
    top: 4%;
    left: 8%;
    width: 84%;
    height: 92%;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
}

/* Linea di centrocampo — ORIZZONTALE */
.field-2d-center-line {
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1.5px;
    background: rgba(255, 255, 255, 0.3);
}

/* Cerchio di centrocampo */
.field-2d-center-circle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 26%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

/* Aree di rigore — in alto e in basso */
.field-2d-penalty-area {
    position: absolute;
    left: 19%;
    width: 62%;
    height: 16%;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
}

.field-2d-penalty-top {
    top: 0;
    border-top: none;
}

.field-2d-penalty-bottom {
    bottom: 0;
    border-bottom: none;
}

/* Aree piccole — in alto e in basso */
.field-2d-goal-area {
    position: absolute;
    left: 33%;
    width: 34%;
    height: 6%;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
}

.field-2d-goal-top {
    top: 0;
    border-top: none;
}

.field-2d-goal-bottom {
    bottom: 0;
    border-bottom: none;
}

/* Giocatori */
.field-2d-player {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    cursor: pointer;
    z-index: 5;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.3s ease, transform 0.15s ease;
}

    .field-2d-player:active {
        transform: translate(-50%, -50%) scale(1.15);
    }

/* Wrapper maglia + badge stato */
.field-2d-shirt-wrap {
    position: relative;
    width: 48px;
    height: 54px;
    pointer-events: none;
}

.field-2d-shirt {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Badge stato asta — angolo in basso a destra della maglia */
.field-2d-status {
    position: absolute;
    bottom: -4px;
    right: -8px;
    width: 24px;
    height: 24px;
}

.field-2d-label {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

/* Glow bianco sulle maglie scure (poco visibili su sfondo scuro) */
.field-2d-shirt-dark .field-2d-shirt {
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.35));
}

.field-2d-closed {
    opacity: 0.45;
}

/* Margine sotto il campo 2D per separarlo dal contenuto successivo */
@media (max-width: 767px) {
    #canvas-container {
        margin-bottom: 32px;
    }
}

/* Overlay caricamento campo 3D */
#canvas-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: transparent;
    transition: transform 0.5s ease-in, opacity 0.5s ease-in;
}

#canvas-loading-overlay.hide {
    transform: translateY(-60px);
    opacity: 0;
    pointer-events: none;
}

.canvas-loading-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.canvas-loading-bar-track {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.canvas-loading-bar-fill {
    width: 0%;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 3px;
    transition: width 0.1s linear;
}

/* Legenda desktop sovrapposta al campo 3D */
.canvas-legenda {
    position: absolute;
    top: 100px;
    left: 20px;
    z-index: 10;
    backdrop-filter: blur(5px);
    background: rgba(0, 0, 0, 0.3);
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    pointer-events: none;
    transition: opacity 0.5s ease;
}

    .canvas-legenda .asta-legenda-title {
        color: rgba(255, 255, 255, 0.6);
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-size: 0.85rem;
    }

    .canvas-legenda hr {
        border-color: rgba(255, 255, 255, 0.15);
    }

    .canvas-legenda .mud-typography-body2 {
        color: rgba(255, 255, 255, 0.8);
        font-size: 0.9rem;
    }

/* Reset Button */
.reset-btn {
    position: absolute;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    z-index: 10;
}

    .reset-btn:hover {
        background: rgba(255, 255, 255, 0.25);
        transform: rotate(-45deg);
    }

/* Team Switch Toggle */
.team-switch-container {
    position: absolute;
    bottom: 30px;
    left: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10;
    cursor: pointer;
    user-select: none;
    backdrop-filter: blur(5px);
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.team-switch-label {
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
    white-space: nowrap;
}

    .team-switch-label.active {
        color: #fff;
    }

.team-switch-track {
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    position: relative;
    flex-shrink: 0;
}

.team-switch-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

    .team-switch-thumb.away {
        left: 22px;
    }

.team-switch-container:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.25);
}


::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.3);
    }

/* ═══════════════════════════════════════
   DRAWER ASTA
   ═══════════════════════════════════════ */

/* Header asta */
.stato-asta-chip {
    border-radius: 8px !important;
    padding-inline: 24px;
    margin: 0;
}

.mud-chip-color-success {
    border-top: 1px solid rgba(87, 158, 91, 0.80) !important;
    border-right: 0.5px solid rgba(87, 158, 91, 0.80) !important;
    border-bottom: 0.5px solid rgba(87, 158, 91, 0.80) !important;
    border-left: 1px solid rgba(87, 158, 91, 0.80) !important;
    background: rgba(87, 158, 91, 0.50) !important;
}

.mud-chip-color-dark {
    border-top: 1px solid rgba(250, 250, 249, 0.25) !important;
    border-right: 0.5px solid rgba(250, 250, 249, 0.25) !important;
    border-bottom: 0.5px solid rgba(250, 250, 249, 0.25) !important;
    border-left: 1px solid rgba(250, 250, 249, 0.25) !important;
    background: rgba(250, 250, 249, 0.15) !important;
}

.mud-chip-color-warning {
    border-top: 1px solid rgba(197, 175, 108, 0.60) !important;
    border-right: 0.5px solid rgba(197, 175, 108, 0.60) !important;
    border-bottom: 0.5px solid rgba(197, 175, 108, 0.60) !important;
    border-left: 1px solid rgba(197, 175, 108, 0.60) !important;
    background: rgba(197, 175, 108, 0.40) !important;
}

/* MudTabs override — stile pill */
.mud-tabs-tabbar {
    border-radius: 12px;
}

.mud-tabs-tabbar-content {
    display: flex;
    justify-content: center;
    padding: 8px;
    border-radius: 12px;
    border-top: 1px solid rgba(250, 250, 249, 0.15);
    border-right: 0.5px solid rgba(250, 250, 249, 0.15);
    border-bottom: 0.5px solid rgba(250, 250, 249, 0.15);
    border-left: 1px solid rgba(250, 250, 249, 0.15);
    backdrop-filter: blur(15px);
}

/* Tab full-width dentro il drawer */
.drawer-tabs .mud-tabs-tabbar-wrapper {
    width: 100% !important;
    display: flex !important;
}

.drawer-tabs .mud-tabs-tabbar-wrapper > .mud-tooltip-root {
    flex: 1;
}

.drawer-tabs .mud-tabs-tabbar-wrapper > .mud-tooltip-root > .mud-tab {
    width: 100% !important;
    min-width: 0 !important;
    line-height: 1.4;
}

.drawer-tabs .mud-tab-slider {
    display: none !important;
}

.drawer-tabs .mud-tab {
    min-height: 0 !important;
    border-radius: 10px;
    padding: 8px 24px;
    transition: all 0.25s ease;
    text-transform: none !important;
}

    .drawer-tabs .mud-tab:hover {
        color: rgba(255,255,255,0.7) !important;
    }

    .drawer-tabs .mud-tab.mud-tab-active {
        border-radius: 8px;
        border-top: 1px solid rgba(250, 250, 249, 0.25);
        border-left: 1px solid rgba(250, 250, 249, 0.25);
        background: rgba(250, 250, 249, 0.15);
        backdrop-filter: blur(15px);
    }


/* Info table trasparente */
.drawer-info-table,
.drawer-info-table .mud-table-container {
    background: transparent !important;
}

    .drawer-info-table td {
        border-bottom: none !important;
        padding: 6px 16px 6px 0 !important;
        color: #fff;
        font-size: 0.95rem;
        font-weight: 500;
    }

.drawer-info-label {
    font-size: 0.8rem !important;
    color: rgba(255,255,255,0.45) !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600 !important;
    white-space: nowrap;
}

/* MudDrawer override per sfondo scuro */
.mud-drawer {
    background-color: rgba(20, 20, 20, 0.97) !important;
}

    /* Forza il contenuto del drawer a rispettare l'altezza e scrollare */
    .mud-drawer .mud-drawer-content {
        height: 100%;
        overflow-y: auto;
    }

/* Mobile small */
@media (max-width: 599px) {
    .drawer-open-hide {
        display: none !important;
    }
}

/* ═══════════════════════════════════════
   DESKTOP: TABLET (960px+)
   ═══════════════════════════════════════ */
@media (min-width: 960px) {

    /* Aste in chiusura: cards in riga orizzontale */
    .asta-chiusura-cards {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 20px;
    }

        .asta-chiusura-cards > .card-chiusura {
            flex: 1 1 280px;
            max-width: fit-content;
        }
}

/* ═══════════════════════════════════════
   DESKTOP: LARGE (1280px+)
   ═══════════════════════════════════════ */
@media (min-width: 1280px) {

    .asta-chiusura-title {
        font-size: 1.75rem;
    }

    /* Card chiusura: testo più grande */
    .card-chiusura {
        padding: 20px 24px;
    }

    .card-chiusura-role {
        font-size: 1.75rem;
    }

    /* 3 card in riga su large desktop */
    .asta-chiusura-cards > .card-chiusura {
        flex: 1 1 0;
    }
}

@media (max-width: 959px) {
    .card-chiusura {
        flex-direction: column;
    }
}

/* ═══════════════════════════════════════
   BID INPUT CONTROLS
   ═══════════════════════════════════════ */


.bid-step-btn, .bid-amount-display {
    border-radius: 8px;
    border-top: 1px solid rgba(250, 250, 249, 0.25);
    border-right: 0.5px solid rgba(250, 250, 249, 0.25);
    border-bottom: 0.5px solid rgba(250, 250, 249, 0.25);
    border-left: 1px solid rgba(250, 250, 249, 0.25);
    background: rgba(250, 250, 249, 0.15);
    backdrop-filter: blur(15px);
    padding: 12px !important;
}


    .bid-step-btn:disabled {
        opacity: 0.3 !important;
    }

.bid-amount-display {
    font-weight: 500;
    letter-spacing: 0.5px;
    user-select: none;
    min-width: 120px;
    text-align: center;
}


.bid-quick-btn, .storico-expand-btn {
    border-radius: 8px;
    border-top: 1px solid rgba(250, 250, 249, 0.15);
    border-right: 0.5px solid rgba(250, 250, 249, 0.15);
    border-bottom: 0.5px solid rgba(250, 250, 249, 0.15);
    border-left: 1px solid rgba(250, 250, 249, 0.15);
    background: rgba(13, 13, 13, 0.15);
    backdrop-filter: blur(15px);
}

.bid-quick-btn {
    padding: 12px;
}

    .bid-quick-btn:hover {
        border-color: #C5AF6C !important;
        color: #C5AF6C !important;
        background: rgba(197, 175, 108, 0.08) !important;
    }


.bid-rilancia-btn:disabled {
    opacity: 0.4 !important;
}

/* ── Overlay caricamento da deep link ── */
.pending-overlay {
    pointer-events: none;
}
.pending-overlay .mud-overlay-content {
    display: flex;
    align-items: center;
    justify-content: center;
}
.pending-overlay > .mud-overlay-scrim {
    opacity: 0.35 !important;
}
