/* ============================================================
   TV Mode — vista da proiettore, fuori dal ridisegno del sito
   ============================================================
   Questo foglio e' volutamente isolato: TV Mode resta scura e ad alto contrasto
   mentre il resto del sito passa al tema avorio.

   Gli otto token qui sotto sono gli stessi nomi usati globalmente, ridichiarati
   su .tv-overlay con i valori che l'overlay riceve OGGI. Le regole del blocco
   discendono tutte da .tv-overlay, quindi li ereditano dal contenitore invece
   che dal :root: cambiare la palette del sito non tocca piu' questa vista.

   Sono i valori attuali, congelati tali e quali. Alcuni sono pensati per fondo
   chiaro e su nero rendono poco (--text-muted #6b7c8f su #0a0a0a): migliorarli
   e' una modifica deliberata, da fare a parte e da guardare a schermo.
   ============================================================ */

.tv-overlay {
    /* Il sito passa a 15px di corpo; qui la misura resta quella di prima,
       altrimenti ogni testo dell'overlay che non ha una taglia propria si
       rimpicciolisce. */
    font-size: 16px;

    --bg-secondary: #eef1f5;
    --text-secondary: #4a5f73;
    --text-muted: #6b7c8f;
    --accent: #e94560;
    --success: #2e7d5e;
    --danger: #c0392b;
    --warning: #d68910;
    --border: #d1d9e0;
}

/* ---- TV Mode Overlay ---- */

.tv-overlay {
    position: fixed;
    inset: 0;
    background: #0a0a0a;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #e8eaed;
    font-family: inherit;
}

.tv-exit-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #888;
    padding: 6px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    z-index: 5001;
}

.tv-exit-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.tv-layout {
    display: flex;
    flex: 1;
    padding: 44px 40px 18px;
    gap: 40px;
    min-height: 0;
    overflow: hidden;
}

/* Colonna sinistra TV: crediti in alto, Top 11 in basso */
.tv-left-col {
    flex: 0 0 460px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 0;
    min-width: 0;
}

.tv-panel-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.tv-credits {
    flex: 0 0 auto;
    max-height: 34%;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 16px;
}

.tv-credits-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding: 3px 0;
    font-size: 0.92rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.tv-credits-row:last-child { border-bottom: 0; }
.tv-credits-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-credits-nums { flex: 0 0 auto; white-space: nowrap; }
.tv-credits-nums b { color: var(--warning); font-weight: 800; }
.tv-credits-max { color: var(--text-muted); font-size: 0.78rem; margin-left: 8px; }

.tv-top11-left {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: clamp(360px, 52vh, 640px);
    min-width: 0;
}

/* Il campo riempie tutto lo spazio verticale disponibile (niente aspect-ratio
   fisso che lo schiacciava facendo sovrapporre le card). */
.tv-formation-bidder-wrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.tv-formation-bidder-wrap .formation-field {
    /* Campo disegnato in CSS (ereditato da .formation-field): scala a qualsiasi
       altezza senza deformarsi. */
    flex: 1 1 auto;
    aspect-ratio: auto;
    width: 100%;
    height: 100%;
    min-height: clamp(320px, 48vh, 600px);
    padding: 14px 0;
}
.tv-formation-bidder-wrap .formation-line {
    padding: 2px 16px;
    gap: 4px;
}

/* Top 11: immagine piccola + cognome + fantamedia nella stessa card */
.tv-formation-bidder-wrap .top11-player-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    width: 96px;               /* stessa larghezza per ogni giocatore */
    box-sizing: border-box;
    padding: 3px 5px 4px;
    opacity: 1;
}
.tv-formation-bidder-wrap .top11-pl-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top center;
    background: rgba(255, 255, 255, 0.08);
}
.tv-formation-bidder-wrap .top11-player-name {
    font-size: 0.68rem;
    max-width: 100%;
}
.tv-formation-bidder-wrap .top11-player-stats { font-size: 0.8rem; font-weight: 800; color: var(--success); }
.tv-formation-bidder-wrap .top11-player-card--empty { opacity: 0.4; }

/* Sidebar destra TV: acquisti dello stesso ruolo, ordinati.
   Griglia multi-colonna: sfrutta lo spazio orizzontale, niente scroll. */
.tv-role-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px 20px;
    align-content: start;
}
.tv-role-team { break-inside: avoid; }
.tv-role-team-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.tv-role-team-n {
    display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px;
    border-radius: 9px; background: rgba(255, 255, 255, 0.12);
    font-size: 0.72rem; text-align: center; color: var(--text-secondary);
}
.tv-role-players { display: flex; flex-wrap: wrap; gap: 6px; }
.tv-role-pl {
    display: inline-flex; align-items: baseline; gap: 6px;
    background: rgba(255, 255, 255, 0.06); border-radius: 6px;
    padding: 2px 8px; font-size: 0.85rem;
}
.tv-role-pr { color: var(--warning); font-weight: 700; font-size: 0.78rem; }
.tv-role-empty { color: var(--text-muted); font-style: italic; }

.tv-formation-bidder-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tv-main {
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Vista Tabellone: le colonne partono dall'alto (le teste dei presidenti non
   vengono tagliate) e scorrono nel loro box se serve. */
.tv-main--board {
    align-items: stretch;
    justify-content: flex-start;
    min-height: 0;
}
.tv-main--board .tv-board-wrap {
    flex: 1;
    height: 100%;
    max-height: 100%;
    overflow: auto;
}
.tv-main--board .tv-board { padding-top: 2px; }

.tv-sidebar {
    flex: 0 0 auto;
    width: clamp(360px, 36vw, 720px);
    min-height: 0;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 18px;
}

.tv-sidebar-title {
    font-size: 1.6rem;
    margin-bottom: 20px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.tv-sidebar-teams {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tv-team-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    min-width: 0;
    flex: 1 1 140px;
}

.tv-team-box .avatar,
.tv-team-box img.avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
}

.tv-team-box-info {
    min-width: 0;
}

.tv-team-box-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tv-team-box-cr {
    color: var(--success);
    font-size: 0.85rem;
}

.tv-team-box-max {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.formation-field {
    position: relative;
    background:
        radial-gradient(ellipse at 50% 35%, rgba(255, 255, 255, 0.07), transparent 62%),
        repeating-linear-gradient(180deg, var(--pitch-1) 0 46px, var(--pitch-2) 46px 92px);
    box-shadow: inset 0 0 0 2px var(--pitch-line);
    aspect-ratio: 1.55;
    overflow: hidden;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.formation-field.formation-field-inverted {
    flex-direction: column;
}

.formation-field::before {
    content: "";
    position: absolute;
    left: 6%;
    right: 6%;
    top: 50%;
    border-top: 2px solid rgba(255, 255, 255, 0.22);
    pointer-events: none;
}
.formation-field::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(46%, 170px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    pointer-events: none;
}
.tv-pen-area {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 15%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;
}
.tv-pen-area::before {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 45%;
    height: 45%;
    border: 2px solid rgba(255, 255, 255, 0.16);
}
.tv-pen-top { top: 0; border-top: 0; }
.tv-pen-top::before { top: 0; border-top: 0; }
.tv-pen-bottom { bottom: 0; border-bottom: 0; }
.tv-pen-bottom::before { bottom: 0; border-bottom: 0; }

.formation-line {
    flex: 1;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    min-height: 0;
}

.formation-field .player {
    margin: 0;
    padding: 0;
}

.formation-field .player .player-name {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.formation-field .player-image-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 60px;
}

.formation-field .player-image {
    width: 45px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.formation-field .player-image.error {
    display: none;
}

.formation-field .player-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-muted);
}

.formation-field .player:has(.player-image-placeholder):not(:has(.player-image)) .player-image-placeholder {
    font-size: 2.4rem;
}

.formation-field .player span:last-child {
    font-size: 0.75rem;
    margin-top: 2px;
    text-align: center;
    max-width: 52px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Giocatori compatti DENTRO il campetto (TV mode) */
.formation-field .player .player-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    min-width: 0;
    max-width: 56px;
}
.formation-field .player .player-compact-name {
    font-size: 0.65rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
}
.formation-field .player .player-compact-stat {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 1px;
}

.team-lineup {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: center;
}

.team-lineup .player {
    margin: 0;
    padding: 0;
}

.team-lineup .player .player-name {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.team-lineup .player-image-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 60px;
}

.team-lineup .player-image {
    width: 45px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.team-lineup .player-image.error {
    display: none;
}

.team-lineup .player-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.team-lineup .separator {
    flex-basis: 100%;
    height: 0;
    margin: 0;
    padding: 0;
    border: none;
}

.team-lineup .player span:last-child {
    font-size: 0.75rem;
    margin-top: 2px;
    text-align: center;
    max-width: 52px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tv-standing-row {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 1.2rem;
}

.tv-standing-pos {
    color: var(--text-muted);
    min-width: 30px;
}

.tv-standing-name {
    flex: 1;
    font-weight: 600;
}

.tv-standing-budget {
    color: var(--success);
    font-weight: 700;
}

.tv-standing-count {
    color: var(--text-muted);
    min-width: 70px;
    text-align: right;
}

/* TV Player Card */

.tv-player {
    text-align: center;
}

.tv-no-player h2 {
    font-size: 2rem;
    color: var(--text-muted);
}

.tv-player-image {
    width: 240px;
    height: 320px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.tv-player-initials {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.tv-player-info {
    text-align: center;
}

.tv-player-name {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.tv-player-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 24px;
    font-size: 1.4rem;
}

.tv-role-badge {
    padding: 4px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1.1rem;
}

.tv-role-P { background: #3498db; color: #fff; }
.tv-role-D { background: #27ae60; color: #fff; }
.tv-role-C { background: #f39c12; color: #fff; }
.tv-role-A { background: #e74c3c; color: #fff; }

.tv-player-team {
    color: var(--text-secondary);
}

.tv-player-stats {
    display: flex;
    gap: 30px;
    justify-content: center;
}

.tv-stat {
    text-align: center;
}

.tv-stat-val {
    display: block;
    font-size: 2.2rem;
    font-weight: 700;
    color: #fff;
}

.tv-stat-lbl {
    font-size: 0.95rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Scheda giocatore TV: riga "anno scorso" + pannello statistiche che ruota */
.tv-pc-lastseason {
    margin-top: 10px;
    text-align: center;
    font-size: 1rem;
    color: var(--text-secondary);
}
.tv-pc-lastseason b { color: #fff; }

.tv-pc-rotator {
    position: relative;
    width: min(680px, 100%);
    margin: 22px auto 0;
    height: 168px;               /* altezza fissa: non si allunga graficamente */
    overflow: hidden;
}
.tv-pc-slide {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
}
.tv-pc-slide.is-active { opacity: 1; transform: none; }
.tv-pc-slide-title {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.tv-pc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    justify-content: center;
    align-items: center;
}
.tv-pc-chips .stat-chip { font-size: 1.35rem; }
.tv-pc-chips .stat-chip-val { color: #fff; font-weight: 700; }
.tv-pc-chips .stat-chip-lbl { font-size: 0.72em; color: var(--text-muted); }

.tv-pc-l5 { display: flex; gap: 8px; margin-top: 4px; }
.tv-pc-l5-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 46px;
    padding: 3px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 0.7rem;
}
.tv-pc-l5-cell b { font-size: 1rem; }
.tv-pc-l5-cell span { color: var(--text-muted); }
.tv-pc-l5-cell.is-hi b { color: var(--success); }
.tv-pc-l5-cell.is-lo b { color: var(--danger, #e8574a); }

.tv-pc-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2px;
    display: flex;
    gap: 7px;
    justify-content: center;
}
.tv-pc-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    transition: background 0.3s;
}
.tv-pc-dot.is-active { background: var(--warning); }

/* TV Bottom Strip: offerta sopra, ticker sotto */
.tv-bottom-strip {
    /* In flusso come ultimo figlio di .tv-overlay (flex column): prende la sua
       altezza naturale, .tv-layout (overflow:hidden) occupa il resto. Niente
       padding-bottom fittizio -> niente spazio morto. */
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    background: rgba(26, 26, 46, 0.98);
}

.tv-bid-bar {
    padding: 16px 40px;
    background: #1a1a2e;
    text-align: center;
    font-size: 2rem;
    border-top: 2px solid rgba(255, 255, 255, 0.08);
}

.tv-bid-label {
    color: rgba(255, 255, 255, 0.65);
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-right: 16px;
}

.tv-bid-amount {
    color: var(--warning);
    font-weight: 800;
    font-size: 2.4rem;
}

.tv-bid-team-wrap {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.tv-bid-team-wrap .avatar {
    flex-shrink: 0;
}

.tv-bid-team {
    color: #fff;
    font-weight: 700;
}

.tv-bid-waiting .tv-bid-label {
    color: var(--text-muted);
    font-style: italic;
}

.tv-bid-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.tv-timer-display {
    display: inline-block;
    font-family: 'Courier New', monospace;
    font-size: 3rem;
    font-weight: 800;
    min-width: 120px;
    padding: 12px 20px;
    border-radius: 12px;
    text-align: center;
}

.tv-timer-display.timer-green {
    color: var(--success);
    background: rgba(78, 204, 163, 0.2);
}

.tv-timer-display.timer-yellow {
    color: var(--warning);
    background: rgba(241, 196, 15, 0.2);
}

.tv-timer-display.timer-red {
    color: var(--danger);
    background: rgba(192, 57, 43, 0.25);
    animation: timer-pulse 0.3s ease infinite alternate;
}

/* TV Assignment overlay + confetti */

.tv-assignment-overlay {
    position: fixed;
    inset: 0;
    z-index: 5100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    animation: tv-assignment-fadein 0.4s ease;
}

.tv-assignment-overlay.tv-assignment-out {
    opacity: 0;
    transition: opacity 0.4s ease;
}

@keyframes tv-assignment-fadein {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tv-assignment-card {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid var(--accent);
    border-radius: 20px;
    padding: 48px 64px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 5101;
}

.tv-assignment-text {
    font-size: 2.4rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    max-width: 90vw;
}

#tv-confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5099;
    overflow: hidden;
}

.tv-confetti {
    position: absolute;
    top: -20px;
    border-radius: 2px;
    animation: tv-confetti-fall 3s ease-in forwards;
    opacity: 0.9;
}

@keyframes tv-confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.9;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0.3;
    }
}

/* TV Ticker */

.tv-ticker {
    display: flex;
    align-items: center;
    gap: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 9px 40px;
    overflow: hidden;
    white-space: nowrap;
}

.tv-ticker-label {
    flex: 0 0 auto;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Traccia del marquee: due "run" identiche affiancate, animata di -50% in loop. */
.tv-ticker-content {
    flex: 0 0 auto;
    min-width: max-content;
    display: flex;
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.88);
    white-space: nowrap;
    will-change: transform;
}
.tv-ticker-run {
    flex: 0 0 auto;
    white-space: nowrap;
    padding-right: 40px;
}

.tv-ticker-item {
    color: rgba(255, 255, 255, 0.88);
}

.tv-ticker-item b { color: #fff; font-weight: 700; }
.tv-ticker-price { color: var(--warning); font-weight: 700; }
.tv-ticker-sep { margin: 0 18px; color: rgba(255, 255, 255, 0.35); }

@keyframes tv-ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }   /* contenuto duplicato: -50% = un giro esatto, loop senza vuoti */
}

/* Hide main content in TV mode */
body.tv-mode header,
body.tv-mode main,
body.tv-mode #notifications {
    display: none !important;
}

/* ==== C4: stamp AGGIUDICATO ==== */
.tv-assignment-stamp {
    font-size: clamp(2rem, 6vw, 4.5rem);
    font-weight: 900;
    letter-spacing: 3px;
    color: #f1c40f;
    text-shadow: 0 4px 0 rgba(0,0,0,.35);
    transform: rotate(-6deg) scale(0.2);
    opacity: 0;
    animation: tv-stamp-in .45s cubic-bezier(.2,1.4,.4,1) forwards;
    margin-bottom: 10px;
}
@keyframes tv-stamp-in { to { transform: rotate(-6deg) scale(1); opacity: 1; } }

/* ==== C5: TV board (griglia rose live) ==== */
.tv-layout-btn {
    position: absolute; top: 14px; right: 90px; z-index: 20;
    background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.3);
    border-radius: 8px; padding: 6px 12px; font-weight: 600; cursor: pointer;
}
.tv-board-wrap { width: 100%; overflow: auto; }
.tv-board { display: flex; gap: 8px; align-items: flex-start; padding: 8px; }
.tv-board-col {
    flex: 1 1 0; min-width: 120px; background: rgba(255,255,255,.06);
    border-radius: 10px; padding: 6px; display: flex; flex-direction: column; gap: 3px;
}
.tv-board-head { text-align: center; color: #fff; margin-bottom: 4px; }
.tv-board-team { font-weight: 700; font-size: .95rem; }
.tv-board-budget { font-size: .78rem; opacity: .8; }
.tv-board-role {
    display: flex; flex-direction: column; gap: 3px;
    margin-top: 8px; padding: 4px 4px 5px 8px;
    border-left: 4px solid var(--tv-rep, rgba(255,255,255,.4));
    border-radius: 4px; background: rgba(255,255,255,.04);
}
.tv-board-role:first-child { margin-top: 4px; }
.tv-board-role-head {
    display: flex; align-items: baseline; justify-content: space-between;
    font-size: .72rem; font-weight: 800; letter-spacing: .09em;
    text-transform: uppercase; color: var(--tv-rep, rgba(255,255,255,.75));
}
.tv-board-role-count { font-size: .68rem; font-weight: 600; opacity: .7; color: #fff; }
.tv-board-role-P { --tv-rep: #f0a020; }
.tv-board-role-D { --tv-rep: #3f9be0; }
.tv-board-role-C { --tv-rep: #2ecc71; }
.tv-board-role-A { --tv-rep: #e8574a; }
.tv-board-slot {
    display: flex; justify-content: space-between; gap: 6px; align-items: center;
    font-size: .82rem; min-height: 22px; padding: 2px 6px; border-radius: 5px;
}
.tv-board-slot.filled { background: rgba(255,255,255,.12); color: #fff; }
.tv-board-slot.empty { color: rgba(255,255,255,.3); justify-content: center; }
.tv-board-pl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-board-pr { font-weight: 700; }

/* Tile TV: icona sopra la label */
.tv-stat-ico { display: block; font-size: 1.4em; line-height: 1.1; }

/* Le icone di STAT_META portano un tono pensato per fondo chiaro. Qui il fondo
   e' nero: l'icona segue il colore del testo che le sta intorno. */
.tv-overlay .ui-ico {
    color: inherit;
}
