* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #ff0050;
    --primary-dark: #e6004a;
    --secondary: #161823;
    --bg: #0f0f23;
    --bg-light: #1a1a2e;
    --bg-card: #16213e;
    --text: #ffffff;
    --text-muted: #a0a0a0;
    --border: #2a2a3e;
    --success: #00d4aa;
    --warning: #ffa500;
    --danger: #ff4444;
    --shadow: rgba(0, 0, 0, 0.3);
}

/* Light theme */
[data-theme="light"] {
    --bg: #f0f2f5;
    --bg-light: #ffffff;
    --bg-card: #ffffff;
    --text: #1a1a2e;
    --text-muted: #5a5a6e;
    --border: #e0e0e8;
    --shadow: rgba(0, 0, 0, 0.08);
}

.btn-icon {
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
}
.btn-icon:hover {
    background: var(--bg-light);
    border-color: var(--primary);
}

/* Command palette */
.command-palette-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    animation: fadeIn 0.15s ease-out;
}
.command-palette-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 40px var(--shadow);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}
.command-palette-box input {
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: 1rem;
    border: none;
    background: var(--bg-light);
    color: var(--text);
    outline: none;
}
.command-palette-box input::placeholder {
    color: var(--text-muted);
}
.command-palette-list {
    max-height: 280px;
    overflow-y: auto;
}
.command-palette-item {
    padding: 0.65rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.command-palette-item:hover,
.command-palette-item.selected {
    background: var(--bg-light);
}
.command-palette-item-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.command-palette-item-main {
    font-weight: 500;
}
.command-palette-item-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: normal;
}
.command-palette-item .kbd {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: auto;
    flex-shrink: 0;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

header {
    background: var(--bg-light);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 10px var(--shadow);
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    animation: pulse 2s infinite;
}

.dot.connected {
    background: var(--success);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    margin-top: 1rem;
    color: var(--text);
    font-size: 1rem;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-light) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1em;
    margin: 0.5rem 0;
}

.skeleton-title {
    height: 1.5em;
    width: 60%;
    margin-bottom: 1rem;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    min-width: 250px;
    background: var(--bg-light);
    border-right: 1px solid var(--border);
    padding: 1rem 0;
    overflow-y: auto;
    max-height: 100vh;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text);
}

.nav-item.active {
    background: var(--bg-card);
    color: var(--text);
    border-left-color: var(--primary);
}

.content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.view h2 {
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-light);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; text-decoration: underline; padding: 0; font-size: inherit; }
.btn-link:hover { color: var(--text); }

.btn-danger:hover {
    background: #cc3333;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.section {
    margin-top: 2rem;
}

.lives-list, .lives-grid {
    display: grid;
    gap: 1rem;
}

.lives-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.live-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.2s;
}

.live-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--shadow);
}

.live-card.active {
    border-color: var(--success);
}

.live-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.live-username {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
}

.live-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.live-status.active {
    background: var(--success);
    color: white;
}

.live-status.inactive {
    background: var(--bg-light);
    color: var(--text-muted);
}

.live-stats {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* BigBrother Columns Layout */
.columns-container {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    height: calc(100vh - 200px);
    align-items: flex-start;
}

.column {
    flex: 0 0 350px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: calc(100vh - 200px);
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow);
}

.column--no-activity {
    display: none;
}

.column-header {
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.column-header-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.column-username {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.column-stats {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.5rem;
}

.column-actions {
    display: flex;
    gap: 0.25rem;
}

.column-actions button {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.column-actions button:hover {
    background: var(--bg);
    color: var(--text);
}

.column-comments {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.column-comment {
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: 6px;
    border-left: 3px solid var(--primary);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Só o comentário mais recente (no topo) anima ao aparecer */
.column-comment--new {
    animation: columnCommentIn 0.35s ease-out;
}

@keyframes columnCommentIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.column-comment-user {
    font-weight: 600;
    color: var(--primary);
    margin-right: 0.5rem;
}

.column-comment-text {
    color: var(--text);
    word-wrap: break-word;
}

.column-comment-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.column-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 2rem;
}

.column-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.column-status-indicator.active {
    background: var(--success);
    box-shadow: 0 0 4px var(--success);
}

.column-status-indicator.inactive {
    background: var(--text-muted);
}

.comments-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    max-height: 600px;
    overflow-y: auto;
}

.comment-item {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 1rem;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-user {
    font-weight: 600;
    color: var(--primary);
    min-width: 120px;
}

.comment-text {
    flex: 1;
    color: var(--text);
}

.comment-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 80px;
    text-align: right;
}

.filter-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.select, .input, .textarea {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.6rem;
    color: var(--text);
    font-size: 0.9rem;
}

.select:focus, .input:focus, .textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.textarea {
    width: 100%;
    resize: vertical;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.sessions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.session-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.session-info {
    flex: 1;
}

.session-username {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.session-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.settings-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    border: 1px solid var(--border);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.2rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.modal-import-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}
.import-monitored-textarea {
    width: 100%;
    min-height: 200px;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}

/* Quiz Milionário – estilo TV (opcional) */
.quiz-milionario {
    --quiz-option-pad: 0.75rem 1rem;
    --quiz-option-radius: 8px;
}
.quiz-milionario .quiz-question-block {
    margin-bottom: 1rem;
}
.quiz-milionario .quiz-question-text {
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}
.quiz-milionario .quiz-options {
    display: grid;
    gap: 0.5rem;
}
.quiz-milionario .quiz-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: var(--quiz-option-pad);
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--quiz-option-radius);
    transition: border-color 0.25s ease, background 0.25s ease, transform 0.2s ease;
}
.quiz-milionario .quiz-option .quiz-option-letter {
    font-weight: 700;
    min-width: 1.5rem;
    color: var(--primary);
}
.quiz-milionario .quiz-option.reveal-correct {
    border-color: var(--success);
    background: rgba(0, 212, 170, 0.15);
    animation: quizCorrect 0.6s ease-out;
}
.quiz-milionario .quiz-option.reveal-wrong {
    border-color: var(--danger);
    background: rgba(255, 68, 68, 0.1);
    animation: quizWrong 0.4s ease-out;
}
@keyframes quizCorrect {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(0, 212, 170, 0.4); }
    50% { transform: scale(1.02); box-shadow: 0 0 0 8px rgba(0, 212, 170, 0); }
    100% { transform: scale(1); }
}
@keyframes quizWrong {
    0% { transform: scale(1); }
    25% { transform: scale(1.02); }
    100% { transform: scale(1); }
}
.quiz-milionario .quiz-option.anim-enter {
    opacity: 0;
    transform: translateX(-20px);
    animation: quizOptionEnter 0.4s ease-out forwards;
}
.quiz-milionario .quiz-option.anim-enter-all {
    opacity: 0;
    animation: quizFadeIn 0.4s ease-out forwards;
}
@keyframes quizOptionEnter {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
@keyframes quizFadeIn {
    to { opacity: 1; }
}
.quiz-milionario .quiz-question-block.anim-enter {
    opacity: 0;
    transform: translateY(10px);
    animation: quizQuestionEnter 0.5s ease-out forwards;
}
@keyframes quizQuestionEnter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.quiz-milionario .quiz-transition-next {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1rem;
    animation: quizFadeIn 0.3s ease-out;
}

/* ========== Centralized layout & components (no inline styles) ========== */

.view-header-wrap { flex-wrap: wrap; gap: 1rem; }
.filter-comment-input {
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    max-width: 200px;
}
.send-comment-section {
    display: none;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 8px;
}
.send-comment-section.is-visible { display: block; }
.send-comment-username-custom { display: block; width: 100%; max-width: 20rem; margin-top: 0.35rem; padding: 0.4rem 0.5rem; font-size: 0.95rem; }
.send-comment-row { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.send-comment-text { flex: 1; padding: 0.5rem; }
.send-comment-hint { font-size: 0.8rem; color: var(--text-muted); margin: 0.5rem 0 0; }
.comments-container { max-height: 60vh; overflow-y: auto; }

.stats-grid-mb { margin-bottom: 1rem; }
.text-muted-mb { color: var(--text-muted); margin-bottom: 1rem; }
.text-muted-sm { color: var(--text-muted); font-size: 0.9rem; }
.spotify-intro { color: var(--text-muted); margin-bottom: 1rem; }
.spotify-controls {
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}
.spotify-username-input { padding: 0.5rem; width: 140px; }
.spotify-playlist-input { padding: 0.5rem; width: 220px; }
.btn-spotify-stop { display: none; }
.btn-spotify-stop.is-visible { display: inline-block; }
.is-hidden { display: none !important; }
.spotify-status { color: var(--text-muted); margin-bottom: 1rem; }
.spotify-now-playing {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.spotify-countdown { margin-top: 1rem; font-size: 1.2rem; }

.quiz-intro { color: var(--text-muted); margin-bottom: 1rem; }
.quiz-game-panel {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.quiz-game-panel h3 { margin-top: 0; font-size: 1rem; }
.quiz-game-panel .row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}
.quiz-session-display { font-family: monospace; font-size: 0.9rem; }
.quiz-timer-label { display: flex; align-items: center; gap: 0.35rem; }
.quiz-timer-input { width: 3.5rem; padding: 0.25rem; }
.quiz-timer-display { font-weight: 600; color: var(--primary); }
.quiz-next-question, .quiz-end-game { display: none; }
.quiz-next-question.is-visible, .quiz-end-game.is-visible { display: inline-block; }
.quiz-current-question { margin-bottom: 1rem; }
.quiz-ranking { margin-bottom: 0.5rem; }
.quiz-answers-log {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-height: 120px;
    overflow-y: auto;
}
.quiz-presentation-details {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.quiz-presentation-details summary { cursor: pointer; font-weight: 600; }
.quiz-presentation-grid {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.75rem;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.quiz-presentation-grid select { display: block; margin-top: 0.25rem; padding: 0.35rem; }
.quiz-presentation-grid input[type="number"] { width: 5rem; margin-top: 0.25rem; padding: 0.35rem; }
.quiz-reveal-duration-input { width: 4rem; }
.quiz-pause-between-input { width: 4rem; }

.quiz-forward-panel {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.quiz-forward-panel h3 { margin-top: 0; font-size: 1rem; }
.quiz-forward-intro { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.75rem; }
.quiz-forward-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.quiz-forward-live { min-width: 140px; }
.quiz-forward-session { min-width: 140px; }
.quiz-forward-status { margin-top: 0.5rem; font-size: 0.9rem; }

.settings-max { max-width: 600px; }
.settings-textarea {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
}
.settings-number { margin: 0.5rem 0 1rem; display: block; padding: 0.5rem; }
.settings-actions { margin: 1rem 0; }
.btn-request-notifications { margin-left: 0.5rem; padding: 0.3rem 0.6rem; }

.modal-monitored-alias-label { display: block; margin-top: 0.75rem; }
.input-monitored-full { width: 100%; margin-bottom: 0.5rem; }
.modal-monitored-checkbox-label { display: block; margin-top: 1rem; }
.modal-monitored-min-label { display: block; margin-top: 0.5rem; }
.modal-monitored-number { margin-bottom: 0.5rem; }

.empty-state-card {
    grid-column: 1 / -1;
    padding: 2rem;
    text-align: center;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: 12px;
}
.empty-state-title { font-size: 1.1rem; color: var(--text); margin-bottom: 0.5rem; }
.empty-state-desc {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.error-box {
    padding: 2rem;
    text-align: center;
    color: var(--danger);
}
.error-box p { margin-bottom: 0.5rem; }
.error-box .text-muted { color: var(--text-muted); font-size: 0.9rem; }
.error-box .btn { margin-top: 1rem; }

.msg-empty { color: var(--text-muted); padding: 2rem; text-align: center; }
.msg-empty-sm { color: var(--text-muted); text-align: center; padding: 2rem; }

.skeleton-width-80 { width: 80%; }
.loading-text-center { text-align: center; }

.live-card--enabled { border-left: 4px solid var(--success); }
.live-card--disabled { border-left: 4px solid var(--border); }
.live-status--enabled { background: var(--success); }
.live-status--disabled { background: var(--border); }
.live-username-muted { opacity: 0.8; }
.live-stats-sm { margin-top: 0.5rem; font-size: 0.85rem; color: var(--text-muted); }
.live-notes-box {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-light);
    border-radius: 4px;
    font-size: 0.8rem;
}
.card-actions { margin-top: 1rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.btn-sm { font-size: 0.85rem; }

.modal-content-sm { max-width: 400px; }
.modal-add-column-intro { margin-bottom: 1rem; color: var(--text-muted); }
.modal-add-column-list { display: flex; flex-direction: column; gap: 0.5rem; }
.modal-add-column-btn { justify-content: flex-start; }

.spotify-option-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}
.spotify-option-label { font-weight: 700; color: var(--primary); }
.spotify-option-body { flex: 1; }
.spotify-option-artist { font-size: 0.85rem; color: var(--text-muted); }

.transcription-comment-item {
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: var(--bg-light);
    border-radius: 6px;
}
.transcription-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}
.transcription-comment-user { color: var(--primary); font-weight: 600; }
.transcription-comment-meta { color: var(--text-muted); font-size: 0.85rem; margin-left: 0.5rem; }
.transcription-comment-text { color: var(--text); line-height: 1.5; }

.status-pre-wrap {
    white-space: pre-wrap;
    background: var(--bg-light);
    padding: 0.75rem;
    border-radius: 4px;
    margin-top: 0.5rem;
}
.status-primary { color: var(--text); }
.status-muted { color: var(--text-muted); }
.status-success { color: var(--success); }
.status-danger { color: var(--danger); }

.quiz-ranking-title { font-weight: 600; font-size: 0.9rem; }
.quiz-ranking-list { margin: 0; padding-left: 1.2rem; }
.quiz-answers-label { color: var(--text-muted); }
.quiz-question-title { font-weight: 600; margin-bottom: 0.5rem; }
.quiz-milionario .quiz-option.anim-enter,
.quiz-milionario .quiz-option.anim-enter-all { animation-delay: var(--quiz-option-delay, 0); }
.loading-overlay-inner { text-align: center; }

.msg-danger { color: var(--danger); padding: 1rem; }
.comment-live-origin { font-size: 0.75rem; color: var(--primary); margin-bottom: 0.25rem; }
.comments-session-header {
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 6px;
    margin-bottom: 1rem;
}
.btn-back { margin-left: 1rem; padding: 0.4rem 0.8rem; }
.hidden-by-filter { display: none !important; }

/* Toast (centralized, no inline) */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-card);
    color: var(--text);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
    z-index: 10001;
    animation: toastSlideIn 0.3s ease-out;
}
.toast.toast-out { animation: toastSlideOut 0.3s ease-out forwards; }
.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-info { border-left: 4px solid var(--primary); }
@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes toastSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Menu button: hidden on desktop */
.btn-menu {
    display: none;
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
    .btn-menu {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        flex-shrink: 0;
    }

    header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    header h1 {
        font-size: 1.2rem;
        flex: 1;
        min-width: 0;
    }
    .header-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: flex-end;
    }
    .status-indicator {
        font-size: 0.8rem;
    }
    .status-indicator #status-text {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .btn-primary {
        min-height: 44px;
        padding: 0.65rem 1rem;
    }
    .btn-icon {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
    }

    /* Sidebar: drawer off-canvas */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        animation: fadeIn 0.2s ease-out;
    }
    body.sidebar-open .sidebar-overlay {
        display: block;
    }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        min-width: 0;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.25s ease-out;
        box-shadow: 4px 0 20px var(--shadow);
    }
    body.sidebar-open .sidebar {
        transform: translateX(0);
    }
    .nav-item {
        padding: 1rem 1.25rem;
        min-height: 48px;
        font-size: 1rem;
    }

    .content {
        padding: 1rem;
        width: 100%;
    }
    .view h2 {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }
    .view-header {
        flex-wrap: wrap;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    .view-header .btn {
        min-height: 44px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }
    .stat-card {
        padding: 1.25rem;
    }
    .stat-value {
        font-size: 2rem;
    }
    .lives-grid {
        grid-template-columns: 1fr;
    }
    .live-card {
        padding: 1.25rem;
    }
    .live-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .live-username {
        font-size: 1.1rem;
    }
    .card-actions {
        flex-direction: column;
    }
    .card-actions .btn {
        width: 100%;
        min-height: 44px;
    }

    /* Forms */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px !important; /* evita zoom no iOS */
        min-height: 44px;
        padding: 0.65rem 0.75rem;
    }
    textarea {
        min-height: 80px;
    }
    select {
        width: 100%;
        max-width: 100%;
    }

    /* Modals */
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
    .modal-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .modal-footer {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .modal-footer .btn {
        min-height: 44px;
        flex: 1;
        min-width: 120px;
    }

    /* Toast: bottom on mobile para não tapar header */
    .toast {
        top: auto;
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        max-width: none;
    }

    /* Comment send area */
    .send-comment-row {
        flex-direction: column;
        align-items: stretch;
    }
    .send-comment-row select,
    .send-comment-row input,
    .send-comment-row .btn {
        width: 100%;
        max-width: none;
    }

    /* BigBrother / columns */
    .columns-grid {
        grid-template-columns: 1fr !important;
    }
    .column-card {
        min-width: 0;
    }

    /* Quiz / Spotify */
    .quiz-milionario .quiz-option,
    .spotify-option-row {
        min-height: 48px;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1rem;
    }
    #status-text {
        display: none; /* só ícone no muito pequeno */
    }
    .stat-value {
        font-size: 1.75rem;
    }
    .command-palette-box {
        max-width: 100%;
        margin: 0 1rem;
    }
}


