* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: #000;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    cursor: default;
}

#player-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Elementos de Mídia em Tela Cheia */
.media-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.25s ease-in-out;
    pointer-events: none;
}

.media-element.active {
    opacity: 1;
    z-index: 10;
}

/* Telas de Overlay (Pareamento e Fallback) */
.screen-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #1e1b4b 0%, #09090b 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    z-index: 20;
    display: none;
}

.screen-overlay.visible {
    display: flex;
}

/* Caixa de Pareamento Plug & Play */
.pairing-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 3rem 4rem;
    max-width: 600px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.logo-badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    background: #6366f1;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    border-radius: 9999px;
    margin-bottom: 1.5rem;
}

.pairing-box h2 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.pairing-box p {
    color: #94a3b8;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.code-display {
    background: #0f172a;
    border: 2px dashed #6366f1;
    color: #38bdf8;
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    padding: 1rem 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.pairing-status {
    color: #cbd5e1;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Fallback Screen */
#fallback-screen .logo {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: #6366f1;
    margin-bottom: 1rem;
}

#fallback-screen p {
    color: #64748b;
    font-size: 1.2rem;
}

/* Barra de Depuração no Topo (Discreta) */
.debug-bar {
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: #94a3b8;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#player-container:hover .debug-bar {
    opacity: 1;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444; /* Vermelho offline */
}

.status-dot.online {
    background: #10b981; /* Verde online */
}

.debug-bar button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px 6px;
    font-size: 0.85rem;
}

.debug-bar button:hover {
    background: rgba(255, 255, 255, 0.1);
}
