/* ============================================================================
   WODPulse — style.css (LEGACY)
   Mantido para compatibilidade com o fallback via feature flag.
   Novas páginas devem usar css/theme.css como base.
   Variáveis e estilos de tile foram movidos para theme.css.
============================================================================ */

:root {
    --bg-dark: #0a0a0a;
    --tile-bg: #1a1a1a;
    --orange: #FF5722;
    --green: #4CAF50;
    --blue: #00BCD4;
    --red: #FF1744;
    --text-main: #ffffff;
    --text-dim: #aaaaaa;
}

/* ============================================================================
   RESET & BASE
============================================================================ */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

.hidden { display: none !important; }

/* ============================================================================
   TELA DE SETUP / CONFIGURAÇÃO (primeira tela)
============================================================================ */
#app-content {
    padding: 16px;
}

#setup {
    max-width: 1100px;
    margin: 0 auto 60px;
    padding: 0 16px;
}

#setup h1 {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--accent);
    text-align: center;
    margin: 20px 0 30px;
}

#setup .btn-logout {
    background: #E91E63;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
}

#addParticipant {
    /* Grid removido — layout agora é feito pelo .setup-card no theme.css */
    margin: 0;
}

#addParticipant input,
#addParticipant select {
    /* Estilos base mantidos para fallback; .form-grid no theme.css sobrepõe */
    padding: 10px;
    font-size: 0.9rem;
    border-radius: 8px;
    border: 1px solid #444;
    background: #161b22;
    color: #e6edf3;
}

#addParticipant label {
    font-size: 0.9rem;
    align-self: center;
    white-space: nowrap;
    color: #aaa;
}

#addBtn {
    /* Estilos base — sobrepostos pelo .form-column #addBtn no theme.css */
    padding: 10px;
    font-weight: bold;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

#addBtn:hover { background: var(--accent-hover, #1effb2); }

#participantListContainer {
    /* Margem removida — layout gerido pelo .setup-card no theme.css */
    margin: 0;
}

#participantListContainer h2 {
    /* Substituído por h3 no .setup-card */
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 10px;
    text-align: left;
    font-family: var(--font-heading);
}

#participantListContainer p {
    text-align: left;
    color: #888;
    margin: 0 0 10px;
    font-size: 0.8rem;
}

#participantList {
    /* Scroll gerido pelo .scrollable-list-box wrapper */
    max-height: none;
    overflow-y: visible;
    list-style: none;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

#participantList li {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text);
}

#participantList li:last-child { border-bottom: none; }

.participant-actions button {
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    margin-left: 16px;
}

.participant-actions .edit-btn   { color: #4CAF50; }
.participant-actions .delete-btn { color: #E63946; }

#participantList::-webkit-scrollbar {
    width: 10px;
}

#participantList::-webkit-scrollbar-track {
    background: #0d1117;
    border-radius: 0 12px 12px 0;
}

#participantList::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 5px;
    border: 2px solid #0d1117;
}

#participantList::-webkit-scrollbar-thumb:hover {
    background: #777;
}

#startScanBtn {
    display: block;
    width: 100%;
    max-width: 600px;
    margin: 40px auto;
    padding: 20px 40px;
    font-size: 1.9rem;
    font-weight: bold;
    background: #FF5722;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
}

#startScanBtn:hover { background: #E64A19; }

/* ============================================================================
   RESPONSIVIDADE – SETUP
============================================================================ */
@media (max-width: 768px) {
    #addParticipant {
        grid-template-columns: 1fr;
    }
    #setup h1 { font-size: 2.4rem; }
    #startScanBtn { font-size: 1.7rem; padding: 18px 30px; }
}

/* ============================================================================
   DASHBOARD
============================================================================ */
#dashboard { 
    height: 100vh; 
    width: 100vw; 
    display: flex; 
    flex-direction: column; 
    overflow-x: hidden;
}

#main-container {
    display: flex;
    flex: 1;
    height: 100%;
    width: 100vw;
    overflow-x: hidden;
}

#monitor-panel {
    width: 100%;
    padding: 15px 25px;
    overflow-y: auto;
    background: #101010;
}

#header {
    display: grid;
    grid-template-columns: 140px 2fr 1fr 180px;
    align-items: center;
    padding: 12px 20px;
    background: #181818;
    border-radius: 14px;
    margin-bottom: 16px;
    gap: 16px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
}

#logo { width: 120px; height: auto; max-width: 120px; }

.header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#current-class-name { font-size: 1.3rem; font-weight: 900; color: var(--accent); }
#daily-leader        { font-size: 1.1rem; color: var(--accent); }
#daily-calories-leader { font-size: 1.1rem; color: #4CAF50; }
#timer               { font-size: 5.2rem; font-weight: 900; color: #4CAF50; text-align: right; }
#leaderboard-top     { font-size: 1.2rem; color: #FFC107; text-align: right; grid-column: 2 / 4; }

/* Rankings */
#weekly-rankings {
    background: #1e1e1e;
    border-radius: 14px;
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr 280px;
    gap: 20px;
    align-items: start;
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
}

.ranking-block {
    background: #252525;
    border-radius: 12px;
    padding: 18px 22px;
    border-left: 6px solid;
}

.ranking-block.pontos { border-left-color: #FF5722; }
.ranking-block.calorias { border-left-color: #4CAF50; }
.ranking-block.vo2ZoneActive { border-left-color: #FF1744; }

.ranking-block h3 {
    margin: 0 0 10px 0;
    font-size: 1.6rem;
    color: #ddd;
    text-transform: uppercase;
}

.ranking-list {
    font-size: 1.45rem;
    line-height: 1.6;
    color: #eee;
}

.ranking-list .position-1 { color: #FFD700; font-weight: 900; font-size: 1.9rem; }
.ranking-list .position-2 { color: #C0C0C0; font-weight: 800; font-size: 1.7rem; }
.ranking-list .position-3 { color: #CD7F32; font-weight: 800; font-size: 1.6rem; }

.ranking-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
}

#resetWeeklyBtn, #fullRankingBtn, #exportPdfBtn {
    padding: 12px 20px;
    font-size: 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    border: none;
}

#resetWeeklyBtn { background: #d32f2f; color: white; }
#fullRankingBtn { background: #2196F3; color: white; }
#exportPdfBtn { background: #FF9800; color: white; }

#resetWeeklyBtn:hover { background: #b71c1c; }
#fullRankingBtn:hover { background: #1976D2; }
#exportPdfBtn:hover { background: #F57C00; }

/* ============================================================================
   NOVO LAYOUT DOS TILES — GLASSMORPHISM + SVG GAUGE + DOTS BAR
   Mantém compatibilidade com classes legadas para fallback
============================================================================ */

#participants {
    display: grid;
    gap: 16px;
    padding: 12px;
    justify-content: center;
    align-content: center;
    background: var(--bg-deep, #0a0a0a);
    min-height: 0;
}

/* ── Tile base — tamanho default para 5-8 pessoas ─────────────────────── */
.tile {
    background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 20px;
    padding: 18px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    position: relative;
    transition: all 0.4s ease;
}
.tile::after { content: ""; display: table; clear: both; }

/* ── Tile profile section (left side, glass box) ──────────────────────────── */
.tile-profile {
    float: left;
    width: 42%;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 14px 10px;
    text-align: center;
    box-sizing: border-box;
}
.tile-avatar-wrap { position: relative; width: 100px; height: 100px; margin: 0 auto 8px; }
.tile-avatar {
    width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
    border: 3px solid var(--accent, #2DE19C); background: #1a1a1a;
}
.tile-rank {
    position: absolute; bottom: -4px; right: -10px;
    background: var(--accent, #2DE19C); color: #000;
    font-size: 0.8rem; font-weight: 800; padding: 3px 10px;
    border-radius: 10px; border: 3px solid #0a0a0a;
}
.tile-user-info { text-align: center; }
.tile-name {
    font-family: var(--font-heading, 'Bebas Neue', sans-serif);
    font-size: 1.4rem; font-weight: 700; letter-spacing: 1px;
    text-transform: uppercase; line-height: 1.1;
    color: var(--text, #f0f0f0);
}
.tile-device { font-size: 0.7rem; color: var(--text-dim, #888); margin-top: 2px; font-weight: 500; }

.tile-close {
    position: absolute; top: 12px; right: 12px; z-index: 5;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
    color: var(--text-dim, #888); border-radius: 50%;
    width: 28px; height: 28px; font-size: 14px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.tile-close:hover { background: rgba(244,67,54,0.3); color: #fff; border-color: var(--red, #f44336); }

/* ── Gauge SVG ───────────────────────────────────────────────────────────── */
.tile .gauge-container { padding: 0; }
.tile .gauge-svg { width: 180px; height: 180px; display: block; margin: 0 auto; }
.tile .gauge-bg { stroke: rgba(255,255,255,0.05); stroke-width: 8; }
.tile .gauge-arc { stroke-width: 8; stroke-linecap: round; }
.tile .zone-label {
    font-size: 0.85rem; font-weight: 700; text-transform: uppercase;
    text-align: center; margin-top: 6px; letter-spacing: 1px;
    transition: color 0.3s ease;
}

/* ── Dots bar ────────────────────────────────────────────────────────────── */
.tile .dots-bar { justify-content: center; padding: 4px 0; }

/* ── Stats grid ──────────────────────────────────────────────────────────── */
.tile .stats-grid { gap: 10px; }
.tile .stat-card { padding: 12px; }
.tile .stat-card .stat-label { font-size: 0.65rem; color: var(--text-muted, #555); }
.tile .stat-card .stat-value { font-size: 1.3rem; }

/* ── EPOC + VO2 (legacy — mantido para compatibilidade) ────────────────────── */
.tile-epoc {
    clear: both;
    text-align: center; color: var(--accent, #2DE19C); font-weight: 600;
    font-size: 0.8rem; margin-top: 6px;
}
.vo2-badge {
    clear: both;
    background: rgba(45,225,156,0.1); color: var(--accent, #2DE19C);
    padding: 10px; border-radius: 12px; text-align: center; font-weight: 700;
    font-size: 0.85rem; border: 1px solid rgba(45,225,156,0.2);
    margin-top: 6px;
}

/* ── Advanced stats row (TRIMP / FC Média / VO₂ Máx) — apenas layout avançado ── */
.layout-advanced .advanced-stats-row {
    display: flex;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 6px 14px;
    margin: 8px 0;
    box-sizing: border-box;
}
.layout-advanced .adv-stat { text-align: center; }
.layout-advanced .adv-label {
    font-size: 9px;
    color: #718096;
    display: block;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}
.layout-advanced .adv-value {
    font-size: 15px;
    font-weight: bold;
    color: #e2e8f0;
}
.layout-advanced .adv-value small {
    font-size: 10px;
    margin-left: 1px;
    color: #a0aec0;
}
.layout-advanced .font-red {
    color: #ff3b30 !important;
    text-shadow: 0 0 6px rgba(255, 59, 48, 0.4);
}

/* ── Footer bar (dots + EPOC inline + signal) — apenas layout avançado ────── */
.layout-advanced .tile-footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 6px 10px;
    flex-wrap: wrap;
    gap: 4px;
}
.layout-advanced .tile-epoc-inline {
    font-size: 11px;
    color: #a0aec0;
    white-space: nowrap;
}
.layout-advanced .tile-epoc-inline strong { color: #ff9800; }

/* ── Signal status ───────────────────────────────────────────────────────── */
.tile .signal-status { padding-top: 0; }

.tile-no-signal {
    text-align: center; color: #ffeb3b; margin-top: 4px;
    font-size: 0.8rem; font-weight: 700;
}

/* ── Disconnected/inactive ───────────────────────────────────────────────── */
.tile.disconnected, .tile.inactive-alert { opacity: 0.6; }

/* ── Leader (clássico: verde) ─────────────────────────────────────────────── */
.tile.leader {
    border-color: var(--accent, #2DE19C);
    box-shadow: 0 20px 60px rgba(45,225,156,0.2), 0 0 0 1px rgba(45,225,156,0.3);
    transform: scale(1.05);
}
/* Leader avançado: laranja neon */
.layout-advanced .tile.leader {
    border: 1px solid rgba(255, 152, 0, 0.4);
    box-shadow: 0 0 12px rgba(255, 152, 0, 0.15), 0 20px 60px rgba(45,225,156,0.2), 0 0 0 1px rgba(45,225,156,0.3);
}

/* ── Count-based responsive sizing ───────────────────────────────────────── */

/* Grid columns per count */
/* Base grid — Classic, Advanced, Cyber, Neon */
#participants.count-1    { grid-template-columns: 1fr; }
#participants.count-2    { grid-template-columns: repeat(2, 1fr); }
#participants.count-3    { grid-template-columns: repeat(2, 1fr); }
#participants.count-4    { grid-template-columns: repeat(2, 1fr); }
#participants.count-3-4  { grid-template-columns: repeat(2, 1fr); } /* compatibilidade */
#participants.count-5-8  { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
#participants.count-9-15 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
#participants.count-16plus { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

	/* Tiles preenchem largura total em layouts multi-coluna */
	#participants.count-2 .tile,
	#participants.count-3 .tile,
	#participants.count-4 .tile,
	#participants.count-3-4 .tile,
	#participants.count-5-8 .tile,
	#participants.count-9-15 .tile,
	#participants.count-16plus .tile { max-width: none; margin: 0; }

/* Classic, Advanced, Cyber, Neon — auto-fill adaptável (fluxo horizontal, quebra linha) */
#participants.layout-classic.count-2,
#participants.layout-advanced.count-2,
#participants.layout-cyber.count-2,
#participants.layout-neon.count-2 { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
#participants.layout-classic.count-3,
#participants.layout-advanced.count-3,
#participants.layout-cyber.count-3,
#participants.layout-neon.count-3 { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
#participants.layout-classic.count-4,
#participants.layout-advanced.count-4,
#participants.layout-cyber.count-4,
#participants.layout-neon.count-4 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

/* Avatar layout — auto-fill adaptável ao zoom para 2, 3, 4 participantes */
#participants.layout-avatar.count-2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
#participants.layout-avatar.count-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
#participants.layout-avatar.count-4 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* 1 pessoa → GIGANTE (TV cheia) */
#participants.count-1 .tile {
    max-width: 1100px; padding: 48px; border-radius: 28px;
}
#participants.count-1 .tile-avatar-wrap { width: 180px; height: 180px; }
#participants.count-1 .tile-name { font-size: 4rem; }
#participants.count-1 .tile .gauge-svg { width: 380px; height: 380px; }
#participants.count-1 .tile .zone-label { font-size: 1.8rem; }
#participants.count-1 .tile .stat-card .stat-value { font-size: 3rem; }
#participants.count-1 .tile-profile { width: 40%; }

/* 2 pessoas → grande */
#participants.count-2 .tile {
    max-width: 900px; padding: 40px; border-radius: 24px;
}

/* ── Cyber tile responsive sizing ────────────────────────────────────────── */

/* Default cyber: foto 72px, gauge 140px, score grande */
.layout-cyber .cyber-avatar-box { width: 90px; height: 90px; }
.layout-cyber .cyber-gauge-wrapper { width: 140px; height: 140px; }

/* 1 pessoa → GIGANTE */
#participants.count-1.layout-cyber .cyber-tile {
    max-width: 1100px; padding: 48px; border-radius: 28px;
    gap: 20px;
}
#participants.count-1.layout-cyber .cyber-avatar-box { width: 200px; height: 200px; }
#participants.count-1.layout-cyber .cyber-name { font-size: 4rem; }
#participants.count-1.layout-cyber .cyber-gauge-wrapper { width: 380px; height: 380px; }
#participants.count-1.layout-cyber .cyber-score-value { font-size: 6rem; }
#participants.count-1.layout-cyber .cyber-score-label { font-size: 1.5rem; }
#participants.count-1.layout-cyber .cyber-stat-val { font-size: 2rem; }
#participants.count-1.layout-cyber .cyber-stat-lbl { font-size: 1rem; }
#participants.count-1.layout-cyber .cyber-mini-metric { font-size: 1.2rem; }
#participants.count-1.layout-cyber .cyber-device-id { font-size: 1rem; }
#participants.count-1.layout-cyber .cyber-zone-bar { font-size: 1.4rem; padding: 8px; }
#participants.count-1.layout-cyber .cyber-dots-container .dots-bar .dot { width: 14px; height: 36px; border-radius: 7px; }

/* 2 pessoas → grande, foco no score */
#participants.count-2.layout-cyber .cyber-tile {
    max-width: 900px; padding: 40px; border-radius: 24px;
    gap: 18px;
}
#participants.count-2.layout-cyber .cyber-avatar-box { width: 140px; height: 140px; }
#participants.count-2.layout-cyber .cyber-name { font-size: 2.4rem; }
#participants.count-2.layout-cyber .cyber-gauge-wrapper { width: 250px; height: 250px; }
#participants.count-2.layout-cyber .cyber-score-value { font-size: 4.5rem; }
#participants.count-2.layout-cyber .cyber-score-label { font-size: 1.1rem; }
#participants.count-2.layout-cyber .cyber-stat-val { font-size: 1.5rem; }
#participants.count-2.layout-cyber .cyber-stat-lbl { font-size: 0.85rem; }

/* 3-4 pessoas → compacto equilibrado */
#participants.count-3-4.layout-cyber .cyber-tile { gap: 10px; padding: 14px; }
#participants.count-3-4.layout-cyber .cyber-gauge-wrapper { width: 120px; height: 120px; }
#participants.count-3-4.layout-cyber .cyber-score-value { font-size: 2.4rem; }
#participants.count-3-4.layout-cyber .cyber-name { font-size: 1rem; }

/* 16+ → ultra-compacto */
#participants.count-16plus.layout-cyber .cyber-tile { gap: 6px; padding: 8px; }
#participants.count-16plus.layout-cyber .cyber-avatar-box { width: 50px; height: 50px; }
#participants.count-16plus.layout-cyber .cyber-gauge-wrapper { width: 70px; height: 70px; }
#participants.count-16plus.layout-cyber .cyber-score-value { font-size: 1.4rem; }
#participants.count-16plus.layout-cyber .cyber-name { font-size: 0.7rem; }
#participants.count-16plus.layout-cyber .cyber-stats-grid { gap: 2px; padding: 4px; }
#participants.count-16plus.layout-cyber .cyber-stat-val { font-size: 0.7rem; }
#participants.count-16plus.layout-cyber .cyber-dots-container .dots-bar .dot { width: 4px; height: 8px; border-radius: 2px; }
#participants.count-2 .tile-avatar-wrap { width: 140px; height: 140px; }
#participants.count-2 .tile-name { font-size: 2.8rem; }
#participants.count-2 .tile .gauge-svg { width: 300px; height: 300px; }
#participants.count-2 .tile .zone-label { font-size: 1.4rem; }
#participants.count-2 .tile .stat-card .stat-value { font-size: 2.4rem; }

/* 3-4 pessoas → 2x2 */
#participants.count-3-4 .tile {
    max-width: 650px; padding: 28px; border-radius: 22px;
}
#participants.count-3-4 .tile-avatar-wrap { width: 110px; height: 110px; }
#participants.count-3-4 .tile-name { font-size: 2rem; }
#participants.count-3-4 .tile .gauge-svg { width: 220px; height: 220px; }
#participants.count-3-4 .tile .zone-label { font-size: 1.1rem; }
#participants.count-3-4 .tile .stat-card .stat-value { font-size: 1.8rem; }

/* 5-8 pessoas → médio */
#participants.count-5-8 .tile {
    max-width: 420px; padding: 16px; border-radius: 18px;
}
#participants.count-5-8 .tile-avatar-wrap { width: 80px; height: 80px; }
#participants.count-5-8 .tile-name { font-size: 1.2rem; }
#participants.count-5-8 .tile .gauge-svg { width: 140px; height: 140px; }
#participants.count-5-8 .tile .zone-label { font-size: 0.72rem; }
#participants.count-5-8 .tile .stat-card .stat-value { font-size: 1.1rem; }
#participants.count-5-8 .tile .stat-card { padding: 8px; }
#participants.count-5-8 .tile .stat-card .stat-label { font-size: 0.58rem; }
#participants.count-5-8 .tile-epoc { font-size: 0.68rem; }
#participants.count-5-8 .tile-device { font-size: 0.62rem; }

/* 9-15 pessoas → compacto */
#participants.count-9-15 .tile {
    max-width: 320px; padding: 12px; border-radius: 14px;
}
#participants.count-9-15 .tile-profile { width: 44%; padding: 8px 6px; }
#participants.count-9-15 .tile-avatar-wrap { width: 60px; height: 60px; }
#participants.count-9-15 .tile-name { font-size: 1rem; }
#participants.count-9-15 .tile .gauge-svg { width: 110px; height: 110px; }
#participants.count-9-15 .tile .zone-label { font-size: 0.62rem; }
#participants.count-9-15 .tile .stat-card { padding: 6px; border-radius: 10px; }
#participants.count-9-15 .tile .stat-card .stat-label { font-size: 0.52rem; }
#participants.count-9-15 .tile .stat-card .stat-value { font-size: 0.95rem; }
#participants.count-9-15 .tile-epoc { font-size: 0.6rem; }
#participants.count-9-15 .tile-device { font-size: 0.55rem; }
#participants.count-9-15 .tile-rank { font-size: 0.6rem; padding: 1px 6px; }
#participants.count-9-15 .tile-close { width: 22px; height: 22px; font-size: 11px; top: 6px; right: 6px; }

/* 16+ pessoas → ultra compacto (TV com 20 alunos) */
#participants.count-16plus .tile {
    max-width: 280px; padding: 10px; border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
}
#participants.count-16plus .tile.leader { transform: scale(1.03); }
#participants.count-16plus .tile-profile { width: 43%; padding: 6px 4px; border-radius: 10px; }
#participants.count-16plus .tile-avatar-wrap { width: 48px; height: 48px; }
#participants.count-16plus .tile-avatar { border-width: 2px; }
#participants.count-16plus .tile-name { font-size: 0.82rem; letter-spacing: 0; }
#participants.count-16plus .tile .gauge-svg { width: 90px; height: 90px; }
#participants.count-16plus .tile .gauge-svg .gauge-bg,
#participants.count-16plus .tile .gauge-svg .gauge-arc { stroke-width: 6; }
#participants.count-16plus .tile .zone-label { font-size: 0.55rem; margin-bottom: 4px; }
#participants.count-16plus .tile .dots-bar .dot { width: 4px; height: 10px; }
#participants.count-16plus .tile .stat-card { padding: 5px; border-radius: 8px; }
#participants.count-16plus .tile .stat-card .stat-label { font-size: 0.48rem; }
#participants.count-16plus .tile .stat-card .stat-value { font-size: 0.85rem; }
#participants.count-16plus .tile-epoc { font-size: 0.55rem; }
#participants.count-16plus .tile-device { font-size: 0.5rem; }
#participants.count-16plus .tile-rank { font-size: 0.55rem; padding: 1px 5px; bottom: -3px; right: -6px; }
#participants.count-16plus .tile-close { width: 20px; height: 20px; font-size: 10px; top: 5px; right: 5px; }
#participants.count-16plus .tile-footer-bar { padding: 5px 8px; border-radius: 8px; }
#participants.count-16plus .signal-status { font-size: 0.55rem; }

/* ============================================================================
   LEGACY STYLES — mantidos para fallback via feature flag
============================================================================ */
.profile-header { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
.avatar-container { position: relative; width: 80px; height: 80px; transition: all 0.4s; flex-shrink: 0; }
.avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 4px solid var(--orange, #FF5722); background: #333; }
.rank-badge { position: absolute; bottom: -6px; right: -6px; background: var(--orange, #FF5722); color: white; font-size: 0.9rem; font-weight: bold; padding: 4px 10px; border-radius: 14px; border: 3px solid var(--tile-bg, #1a1a1a); }
.user-info { flex: 1; min-width: 0; }
.device { font-size: 0.9rem; color: var(--blue, #00BCD4); margin-top: 4px; font-weight: 500; }
.name { font-size: 1.8rem; font-weight: 800; text-transform: uppercase; line-height: 1.1; color: var(--text-main, #fff); transition: all 0.4s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main-stats { background: rgba(255,255,255,0.05); border-radius: 20px; padding: 15px; text-align: center; margin-bottom: 18px; }
.bpm { font-size: 5rem; font-weight: 900; line-height: 1; letter-spacing: -2px; color: var(--text-main, #fff); transition: all 0.4s; }
.bpm span { font-size: 1.2rem; color: var(--text-dim, #aaa); margin-left: 6px; font-weight: normal; }

.progress-bar { height: 24px; background: #333; border-radius: 12px; overflow: hidden; margin: 30px 0; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--green, #4CAF50), #FF9800, var(--red, #FF1744)); transition: width 0.4s ease; }

.grid-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px; }
.stat-box { background: rgba(255,255,255,0.08); padding: 20px; border-radius: 20px; text-align: center; }
.stat-label { font-size: 1.1rem; color: var(--text-dim, #aaa); text-transform: uppercase; margin-bottom: 6px; letter-spacing: 0.8px; }
.stat-value { font-size: 2.2rem; font-weight: bold; transition: all 0.4s; }

.vo2-badge.legacy { background: rgba(255,23,68,0.25); color: var(--red, #FF1744); }
.epoc { text-align: center; color: var(--orange, #FF9800); font-weight: 700; }

#participants.count-1 .profile-header { gap: 20px; margin-bottom: 24px; }
#participants.count-1 .avatar-container { width: 140px; height: 140px; }
#participants.count-1 .name { font-size: 3.5rem; }
#participants.count-1 .bpm { font-size: 9rem; letter-spacing: -6px; }
#participants.count-1 .main-stats { padding: 24px; }
#participants.count-1 .stat-value { font-size: 3rem; }
#participants.count-2 .profile-header { gap: 18px; }
#participants.count-2 .avatar-container { width: 110px; height: 110px; }
#participants.count-2 .name { font-size: 3rem; }
#participants.count-2 .bpm { font-size: 7rem; }
#participants.count-2 .main-stats { padding: 20px; }
#participants.count-2 .stat-value { font-size: 2.5rem; }
#participants.count-3-4 .avatar-container { width: 90px; height: 90px; }
#participants.count-3-4 .name { font-size: 2.2rem; }
#participants.count-3-4 .bpm { font-size: 5.5rem; }
#participants.count-3-4 .main-stats { padding: 14px; }
#participants.count-3-4 .stat-value { font-size: 2rem; }

/* ============================================================================
   OUTROS ELEMENTOS
============================================================================ */
.compact-mode #header,
.compact-mode #weekly-rankings {
    display: none !important;
}

.compact-mode #monitor-panel {
    padding-top: 10px;
}

#toggleCompactBtn {
    position: fixed;
    top: 20px;
    right: 80px;
    z-index: 999;
    background: #673AB7;
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

#toggleCompactBtn:hover {
    background: #512DA8;
    transform: scale(1.1);
}

#addNewParticipantBtn, #backBtn {
    position: fixed;
    bottom: 25px;
    font-size: 1.2rem;
    padding: 15px 30px;
    border-radius: 40px;
    z-index: 100;
}

#addNewParticipantBtn { left: 25px; background: #4CAF50; }
#backBtn { right: 25px; background: #E63946; }

#full-ranking-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

#full-ranking-modal > div {
    background: #222;
    color: #eee;
    padding: 30px;
    border-radius: 16px;
    max-width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    width: 1000px;
}

#full-ranking-modal span {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 40px;
    cursor: pointer;
    color: #aaa;
}

#full-ranking-modal span:hover {
    color: white;
}

.admin-table th { background: #0d1117; color: #FF5722; }
.admin-table tr:hover { background: #1e1e1e; }
.modal-content h3 { color: #FF9800; margin: 20px 0 10px; }

#monitor-panel, #participants, #weekly-rankings, #header {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CYBER-ATHLETIC TILE — Dark, high-contrast, typography-forward
   Escopado sob .layout-cyber
   ═══════════════════════════════════════════════════════════════════════ */

.layout-cyber .cyber-tile {
    background-color: #1c1c1f;
    border: 2px solid #2c2c2e;
    border-radius: 16px;
    padding: 12px;
    color: #fff;
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}
.layout-cyber .cyber-tile:hover {
    border-color: var(--zone-color, #2c2c2e);
    box-shadow: 0 12px 32px rgba(0,0,0,0.6), 0 0 20px rgba(255,255,255,0.15);
}
.layout-cyber .cyber-leader {
    border-color: #FFD700 !important;
    box-shadow: 0 0 20px rgba(255,215,0,0.2), inset 0 0 12px rgba(255,215,0,0.05);
}
.layout-cyber .cyber-leader .cyber-rank {
    background: #FFD700 !important;
    color: #000 !important;
}
.layout-cyber .cyber-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #2c2c2e;
    padding-bottom: 10px;
}
.layout-cyber .cyber-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}
.layout-cyber .cyber-avatar-box {
    position: relative;
    width: 90px;
    height: 90px;
}
.layout-cyber .cyber-avatar {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid #2c2c2e;
}
.layout-cyber .cyber-rank {
    position: absolute;
    bottom: -6px;
    right: -6px;
    background: #121214;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid #2c2c2e;
}
.layout-cyber .cyber-user-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.layout-cyber .cyber-name {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    word-break: break-word;
}
.layout-cyber .cyber-device-id {
    font-size: 0.68rem;
    color: #8e8e93;
}
.layout-cyber .cyber-top-metrics {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}
.layout-cyber .cyber-mini-metric {
    font-size: 0.75rem;
    color: #8e8e93;
}
.layout-cyber .cyber-mini-metric span {
    color: #fff;
    font-weight: 700;
}
.layout-cyber .cyber-core-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    gap: 12px;
}
.layout-cyber .cyber-gauge-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.layout-cyber .cyber-gauge-wrapper svg {
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
}
.layout-cyber .cyber-gauge-wrapper .gauge-svg {
    width: 100% !important;
    height: 100% !important;
}
.layout-cyber .cyber-percent-badge {
    position: absolute;
    bottom: 2px;
    background: var(--zone-color, #888);
    color: #000;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 1px 5px;
    border-radius: 4px;
}
.layout-cyber .cyber-score-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.layout-cyber .cyber-score-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #8e8e93;
}
.layout-cyber .cyber-score-value {
    font-size: 2.85rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.03em;
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.1);
}
.layout-cyber .cyber-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background: rgba(0,0,0,0.2);
    padding: 8px;
    border-radius: 10px;
}
.layout-cyber .cyber-stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(255,255,255,0.05);
}
.layout-cyber .cyber-stat-box:last-child {
    border-right: none;
}
.layout-cyber .cyber-stat-lbl {
    font-size: 0.58rem;
    font-weight: 600;
    color: #8e8e93;
    margin-bottom: 2px;
}
.layout-cyber .cyber-stat-val {
    font-size: 0.95rem;
    font-weight: 700;
}
.layout-cyber .cyber-stat-val small {
    font-size: 0.6rem;
    color: #8e8e93;
}
.layout-cyber .cyber-footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
}
.layout-cyber .cyber-dots-container {
    width: 100%;
    opacity: 0.8;
}
.layout-cyber .cyber-zone-bar {
    width: 100%;
    background: var(--zone-color, #555);
    color: #000;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 900;
    padding: 4px 0;
    border-radius: 6px;
    letter-spacing: 0.03em;
}
.layout-cyber .cyber-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: #8e8e93;
    font-size: 1rem;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}
.layout-cyber .cyber-close:hover {
    color: #FF1744;
}
.layout-cyber .cyber-disconnected {
    opacity: 0.4;
    filter: grayscale(1);
}
.layout-cyber .cyber-inactive-alert {
    border-color: #FF1744 !important;
    animation: cyber-pulse 1.5s infinite alternate;
}
.layout-cyber .cyber-overlay-alert {
    position: absolute;
    inset: 0;
    background: rgba(23,23,27,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FF1744;
    font-weight: 900;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    z-index: 5;
}
@keyframes cyber-pulse {
    0% { box-shadow: 0 0 8px rgba(255,23,68,0.3); }
    100% { box-shadow: 0 0 20px rgba(255,23,68,0.6); }
}
.layout-cyber .cyber-pulse-red {
    color: #FF1744;
    animation: text-pulse 1s infinite alternate;
}
@keyframes text-pulse {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   NEON TILE — Glow effects, big HR, zone as colored ring, gym signage vibe
   Escopado sob .layout-neon
   ═══════════════════════════════════════════════════════════════════════ */

.layout-neon .neon-tile {
    background: #0a0a0c;
    border: 1px solid #1a1a1e;
    border-radius: 18px;
    padding: 16px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

/* ── Top bar: avatar + name ── */
.layout-neon .neon-top-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}
.layout-neon .neon-avatar-ring {
    width: 85px; height: 85px;
    border-radius: 50%;
    border: 3px solid #555;
    padding: 3px;
    flex-shrink: 0;
    transition: border-color 0.4s;
}
.layout-neon .neon-avatar {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
}
.layout-neon .neon-identity {
    flex: 1;
    min-width: 0;
}
.layout-neon .neon-name {
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    word-break: break-word;
}
.layout-neon .neon-subtitle {
    font-size: 0.65rem;
    color: #777;
    margin-top: 2px;
}
.layout-neon .neon-rank-badge {
    display: inline-block;
    background: #1a1a1e;
    padding: 1px 8px;
    border-radius: 4px;
    font-weight: 700;
    color: #ccc;
}
.layout-neon .neon-leader-star {
    font-size: 1.8rem;
    flex-shrink: 0;
    animation: neon-pulse-star 1.5s infinite alternate;
}
@keyframes neon-pulse-star {
    0% { transform: scale(1); }
    100% { transform: scale(1.2); }
}

/* ── HR section: giant number ── */
.layout-neon .neon-hr-section {
    text-align: center;
    padding: 8px 0;
}
.layout-neon .neon-hr-number {
    font-size: 5rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.04em;
    transition: text-shadow 0.4s;
}
.layout-neon .neon-hr-label {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-top: 2px;
}
.layout-neon .neon-zone-tag {
    display: inline-block;
    padding: 4px 18px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    margin-top: 8px;
    transition: background 0.4s;
}

/* ── Stats row: 4 columns ── */
.layout-neon .neon-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    padding: 10px 6px;
}
.layout-neon .neon-stat {
    text-align: center;
}
.layout-neon .neon-stat-val {
    font-size: 1.05rem;
    font-weight: 800;
}
.layout-neon .neon-val-points {
    color: var(--neon-color, #fff);
    text-shadow: 0 0 12px var(--neon-glow, transparent);
}
.layout-neon .neon-stat-lbl {
    font-size: 0.55rem;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

/* ── Footer ── */
.layout-neon .neon-footer {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.layout-neon .neon-footer-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: #666;
}
.layout-neon .neon-epoc {
    color: var(--neon-color, #777);
}

/* ── Signal ── */
.layout-neon .neon-signal {
    text-align: center;
    font-size: 0.65rem;
    color: #555;
    font-weight: 600;
}
.layout-neon .neon-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #444;
    margin-right: 4px;
}
.layout-neon .neon-dot.neon-live {
    background: #00E676;
    box-shadow: 0 0 8px #00E676;
    animation: neon-pulse-dot 1s infinite alternate;
}
@keyframes neon-pulse-dot {
    0% { box-shadow: 0 0 4px #00E676; }
    100% { box-shadow: 0 0 12px #00E676; }
}

/* ── Close ── */
.layout-neon .neon-close {
    position: absolute;
    top: 10px; right: 10px;
    background: none; border: none;
    color: #444; font-size: 1rem;
    cursor: pointer; z-index: 10;
}
.layout-neon .neon-close:hover { color: #E53935; }

/* ── Disconnected / Inactive ── */
.layout-neon .neon-disconnected { opacity: 0.35; }
.layout-neon .neon-inactive { border-color: #E53935 !important; }
.layout-neon .neon-overlay {
    position: absolute; inset: 0;
    background: rgba(10,10,12,0.9);
    display: flex; align-items: center; justify-content: center;
    color: #E53935; font-weight: 900; font-size: 1rem;
    z-index: 5;
}

/* ── Neon responsive ── */
#participants.count-1.layout-neon .neon-tile { max-width: 1100px; padding: 48px; gap: 24px; }
#participants.count-1.layout-neon .neon-avatar-ring { width: 200px; height: 200px; border-width: 6px; }
#participants.count-1.layout-neon .neon-name { font-size: 4rem; }
#participants.count-1.layout-neon .neon-hr-number { font-size: 14rem; }
#participants.count-1.layout-neon .neon-hr-label { font-size: 2rem; }
#participants.count-1.layout-neon .neon-zone-tag { font-size: 1.8rem; padding: 8px 32px; }
#participants.count-1.layout-neon .neon-stat-val { font-size: 2.5rem; }
#participants.count-1.layout-neon .neon-stat-lbl { font-size: 1rem; }

#participants.count-2.layout-neon .neon-tile { max-width: 900px; padding: 32px; gap: 18px; }
#participants.count-2.layout-neon .neon-avatar-ring { width: 130px; height: 130px; }
#participants.count-2.layout-neon .neon-name { font-size: 2.2rem; }
#participants.count-2.layout-neon .neon-hr-number { font-size: 9rem; }
#participants.count-2.layout-neon .neon-hr-label { font-size: 1.2rem; }

#participants.count-3-4.layout-neon .neon-tile { gap: 10px; padding: 12px; }
#participants.count-3-4.layout-neon .neon-hr-number { font-size: 4rem; }

#participants.count-16plus.layout-neon .neon-tile { gap: 4px; padding: 6px; }
#participants.count-16plus.layout-neon .neon-avatar-ring { width: 45px; height: 45px; border-width: 2px; }
#participants.count-16plus.layout-neon .neon-hr-number { font-size: 2rem; }
#participants.count-16plus.layout-neon .neon-name { font-size: 0.65rem; }
#participants.count-16plus.layout-neon .neon-stats-row { gap: 1px; padding: 4px; }
#participants.count-16plus.layout-neon .neon-stat-val { font-size: 0.7rem; }

/* ============================================================================
   LAYOUT AVATAR — Foto do aluno como fundo com overlay escuro
   ============================================================================ */

.layout-avatar .bg-avatar-tile {
    background-image: var(--avatar-bg);
    background-size: cover;
    background-position: center;
    border: 3px solid var(--zone-color);
    border-radius: 20px;
    height: 340px;
    position: relative;
    overflow: hidden;
    color: #ffffff;
    font-family: 'Montserrat', 'Inter', sans-serif;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 40px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    transition: all 0.25s ease;
}

.layout-avatar .bg-avatar-tile:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7), 0 0 20px var(--zone-color);
    transform: translateY(-2px);
}

.layout-avatar .bg-avatar-leader {
    border-color: #FFD700 !important;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.35);
}
.layout-avatar .bg-avatar-leader .bg-avatar-rank {
    background: #FFD700 !important;
    color: #000000 !important;
}

.layout-avatar .bg-avatar-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.75) 50%, rgba(0, 0, 0, 0.9) 100%);
    z-index: 1;
}

.layout-avatar .bg-avatar-content {
    position: relative;
    z-index: 2;
    padding: 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.layout-avatar .bg-avatar-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.layout-avatar .bg-avatar-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.layout-avatar .bg-avatar-rank {
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.75rem;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 6px;
}

.layout-avatar .bg-avatar-name {
    font-size: 1.15rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    letter-spacing: -0.01em;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.layout-avatar .bg-avatar-device {
    font-size: 0.68rem;
    color: #ccc;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.layout-avatar .bg-avatar-calories {
    font-size: 0.85rem;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.layout-avatar .bg-avatar-fc-section {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 10px 0;
}

.layout-avatar .bg-avatar-bpm-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.layout-avatar .bg-avatar-bpm-value {
    font-size: 4.8rem;
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -0.04em;
    color: #ffffff;
    text-shadow: 0 0 20px var(--zone-color), 0 4px 10px rgba(0,0,0,0.9);
}

.layout-avatar .bg-avatar-bpm-unit {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--zone-color);
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.layout-avatar .bg-avatar-gauge-mini {
    position: absolute;
    width: 110px;
    height: 110px;
    opacity: 0.35;
    pointer-events: none;
}

.layout-avatar .bg-avatar-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    background: rgba(0, 0, 0, 0.4);
    padding: 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(4px);
}

.layout-avatar .bg-avatar-metric-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.layout-avatar .bg-avatar-metric-item.highlight .bg-avatar-val {
    color: #FFCC00;
}

.layout-avatar .bg-avatar-lbl {
    font-size: 0.58rem;
    font-weight: 700;
    color: #aaa;
    margin-bottom: 2px;
}

.layout-avatar .bg-avatar-val {
    font-size: 1.1rem;
    font-weight: 800;
}

.layout-avatar .bg-avatar-footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.layout-avatar .bg-avatar-zone-tag {
    width: 100%;
    color: #000000;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 900;
    padding: 5px 0;
    border-radius: 8px;
    text-shadow: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.layout-avatar .bg-avatar-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}

.layout-avatar .bg-avatar-close:hover {
    color: #FF3333;
    cursor: pointer;
}

.layout-avatar .bg-avatar-disconnected {
    filter: grayscale(1) brightness(0.6);
}

.layout-avatar .bg-avatar-inactive-alert {
    border-color: #FF3333 !important;
}

.layout-avatar .bg-avatar-alert-overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FF3333;
    font-weight: 900;
    font-size: 1.3rem;
    letter-spacing: 0.05em;
    z-index: 5;
    border-radius: 17px;
}

/* Responsividade — 1 pessoa (TV cheia, gigante) */
.layout-avatar.count-1 .bg-avatar-tile {
    height: 700px;
    border-radius: 28px;
    border-width: 4px;
}
.layout-avatar.count-1 .bg-avatar-content {
    padding: 36px;
}
.layout-avatar.count-1 .bg-avatar-name {
    font-size: 2.8rem;
    max-width: 500px;
}
.layout-avatar.count-1 .bg-avatar-rank {
    font-size: 1.5rem;
}
.layout-avatar.count-1 .bg-avatar-device {
    font-size: 1rem;
}
.layout-avatar.count-1 .bg-avatar-calories {
    font-size: 1.3rem;
}
.layout-avatar.count-1 .bg-avatar-bpm-value {
    font-size: 10rem;
}
.layout-avatar.count-1 .bg-avatar-bpm-unit {
    font-size: 1.3rem;
}
.layout-avatar.count-1 .bg-avatar-gauge-mini {
    width: 220px;
    height: 220px;
}
.layout-avatar.count-1 .bg-avatar-metrics-grid {
    gap: 12px;
    padding: 16px;
}
.layout-avatar.count-1 .bg-avatar-lbl {
    font-size: 0.9rem;
}
.layout-avatar.count-1 .bg-avatar-val {
    font-size: 2rem;
}
.layout-avatar.count-1 .bg-avatar-zone-tag {
    font-size: 1.2rem;
    padding: 10px 0;
}
.layout-avatar.count-1 .bg-avatar-close {
    top: 20px;
    right: 20px;
    font-size: 1.5rem;
}

/* Responsividade — 2 pessoas (grande) */
.layout-avatar.count-2 .bg-avatar-tile {
    height: 500px;
    border-radius: 24px;
}
.layout-avatar.count-2 .bg-avatar-content {
    padding: 24px;
}
.layout-avatar.count-2 .bg-avatar-name {
    font-size: 1.8rem;
    max-width: 300px;
}
.layout-avatar.count-2 .bg-avatar-bpm-value {
    font-size: 7rem;
}
.layout-avatar.count-2 .bg-avatar-gauge-mini {
    width: 160px;
    height: 160px;
}
.layout-avatar.count-2 .bg-avatar-val {
    font-size: 1.5rem;
}

/* Responsividade — 3-4 pessoas */
.layout-avatar.count-3-4 .bg-avatar-tile {
    height: 380px;
}
.layout-avatar.count-3-4 .bg-avatar-bpm-value {
    font-size: 5.5rem;
}

/* Responsividade — turmas cheias */
.layout-avatar.count-9-15 .bg-avatar-tile {
    height: 280px;
}
.layout-avatar.count-9-15 .bg-avatar-bpm-value {
    font-size: 3.8rem;
}
.layout-avatar.count-16plus .bg-avatar-tile {
    height: 220px;
}
.layout-avatar.count-16plus .bg-avatar-bpm-value {
    font-size: 2.8rem;
}
.layout-avatar.count-16plus .bg-avatar-metrics-grid {
    padding: 4px;
}

/* ============================================================================
   LIVE+ LAYOUT — Split screen: tiles (linha 1) + emoção IA (linha 2)
   CSS 100% isolado — não afeta nenhum outro layout
============================================================================ */

/* Container principal: flex coluna quando LIVE+ ativo */
#monitor-panel.liveplus-active {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding: 8px 16px;
}

#monitor-panel.liveplus-active #header {
    flex-shrink: 0;
    margin-bottom: 8px;
}

#monitor-panel.liveplus-active #tile-layout-toggle {
    flex-shrink: 0;
}

/* Linha 1: tiles compactos em uma linha, overflow hidden para carrossel */
#participants.layout-liveplus {
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow: hidden;
    flex: 1;
    min-height: 0;
    gap: 8px;
    padding: 6px;
    align-items: stretch;
    background: var(--bg-deep, #0a0a0a);
}

/* Página do carrossel — grupo de tiles visível */
.liveplus-page {
    display: flex;
    flex-direction: row;
    gap: 8px;
    width: 100%;
    flex-shrink: 0;
    align-items: stretch;
    transition: opacity 0.4s ease;
}

.liveplus-page.lp-exiting {
    opacity: 0;
}

/* Tiles dentro do LIVE+ — compactos, altura auto */
#participants.layout-liveplus .tile,
#participants.layout-liveplus .cyber-tile,
#participants.layout-liveplus .neon-tile,
#participants.layout-liveplus .bg-avatar-tile {
    flex: 1;
    min-width: 140px;
    max-width: none;
    font-size: 0.72rem;
    padding: 8px !important;
    margin: 0 !important;
}

#participants.layout-liveplus .bpm { font-size: 1.6rem !important; }
#participants.layout-liveplus .name { font-size: 0.8rem !important; }
#participants.layout-liveplus .avatar { width: 40px !important; height: 40px !important; }
#participants.layout-liveplus .rank-badge { font-size: 0.6rem !important; width: 18px !important; height: 18px !important; }
#participants.layout-liveplus .stat-value { font-size: 0.9rem !important; }
#participants.layout-liveplus .stat-label { font-size: 0.55rem !important; }
#participants.layout-liveplus .zone-label { font-size: 0.65rem !important; }
#participants.layout-liveplus .epoc { font-size: 0.6rem !important; }
#participants.layout-liveplus .vo2-badge { font-size: 0.6rem !important; }
#participants.layout-liveplus .device { font-size: 0.55rem !important; }
#participants.layout-liveplus .progress-bar { height: 4px !important; }
#participants.layout-liveplus .grid-stats { gap: 4px !important; }
#participants.layout-liveplus .profile-header { gap: 6px !important; }

/* Linha 2: strip de emoção ao vivo */
#liveplus-emocao {
    flex-shrink: 0;
    height: 38vh;
    min-height: 160px;
    max-height: 260px;
    background: #0d0d0d;
    border-top: 2px solid #00E5FF;
    border-radius: 12px 12px 0 0;
    display: none;
    align-items: center;
    padding: 0 20px;
    gap: 20px;
    overflow: hidden;
    position: relative;
    z-index: 10;
}

#liveplus-emocao.lp-visible {
    display: flex;
}

/* Foto do aluno no strip */
.lp-photo-frame {
    flex-shrink: 0;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 3px solid #00E5FF;
    overflow: hidden;
    box-shadow: 0 0 24px rgba(0,229,255,0.3);
    animation: lpGlow 3s ease-in-out infinite;
}

@keyframes lpGlow {
    0%, 100% { box-shadow: 0 0 16px rgba(0,229,255,0.2); border-color: #00E5FF; }
    50%       { box-shadow: 0 0 40px rgba(0,229,255,0.5); border-color: #5efff7; }
}

.lp-photo-frame.lp-pumping {
    animation: lpGlow 3s ease-in-out infinite, lpPump 0.6s ease-in-out infinite;
}

@keyframes lpPump {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.06); }
}

.lp-photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lp-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: #1a1a2e;
}

/* Info do aluno */
.lp-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lp-name {
    font-size: 1.4rem;
    font-weight: 900;
    color: #00E5FF;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lp-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.lp-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 4px 10px;
    min-width: 52px;
}

.lp-stat-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
}

.lp-stat-label {
    font-size: 0.55rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lp-stat-value.lp-red    { color: #E53935; }
.lp-stat-value.lp-orange { color: #FF9800; }
.lp-stat-value.lp-green  { color: #2DE19C; }
.lp-stat-value.lp-blue   { color: #00E5FF; }
.lp-stat-value.lp-yellow { color: #FFEB3B; }

/* Balão do comentário da IA */
.lp-comentario {
    background: rgba(0,229,255,0.07);
    border: 1px solid rgba(0,229,255,0.25);
    border-radius: 10px;
    padding: 8px 14px;
    max-width: 520px;
}

.lp-comentario-label {
    font-size: 0.55rem;
    color: #00E5FF;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lp-dot {
    width: 6px;
    height: 6px;
    background: #00E5FF;
    border-radius: 50%;
    animation: lpDotPulse 1.2s ease-in-out infinite;
}

@keyframes lpDotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(0.7); }
}

.lp-comentario-text {
    font-size: 0.9rem;
    color: #eee;
    line-height: 1.4;
}

/* Loading / aguardando */
.lp-aguardando {
    width: 100%;
    text-align: center;
    color: #555;
    font-size: 0.9rem;
}

/* Fade de entrada do strip ao trocar participante */
#liveplus-emocao-content {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    opacity: 1;
    transition: opacity 0.35s ease;
}

#liveplus-emocao-content.lp-fade-out {
    opacity: 0;
}