/* =====================================================
   CARTAS DEICIDA - Estilos Principais
   Atualizado com suporte completo a temas
   ===================================================== */

/* Variaveis de Tema (valores padrao - tema escuro) */
:root {
    --bg-primary: #0f0c29;
    --bg-secondary: #302b63;
    --bg-tertiary: #24243e;
    --bg-card: #1a1a2e;
    --bg-input: #16213e;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #888888;
    --accent-primary: #e94560;
    --accent-secondary: #ff6b6b;
    --accent-success: #4ecdc4;
    --accent-warning: #f39c12;
    --accent-danger: #e74c3c;
    --border-color: rgba(255, 255, 255, 0.1);
    --border-strong: #333333;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --card-white-bg: #f8f8f8;
    --card-white-text: #1a1a2e;
    --card-black-bg: #1a1a2e;
    --card-black-text: #ffffff;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

/* =====================================================
   Utilitarios
   ===================================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

/* =====================================================
   Botoes
   ===================================================== */

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(233, 69, 96, 0.4);
}

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

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

.btn-success {
    background: linear-gradient(135deg, var(--accent-success) 0%, #2d6a4f 100%);
    color: #fff;
}

.btn-danger {
    background: var(--accent-danger);
    color: #fff;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =====================================================
   Formularios
   ===================================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-strong);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 16px;
    transition: border-color 0.3s;
}

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

.form-group input::placeholder {
    color: var(--text-muted);
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-wrapper input {
    width: auto;
}

/* =====================================================
   Cards de Sala
   ===================================================== */

.room-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.room-card {
    background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-input) 100%);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-strong);
    transition: transform 0.3s, box-shadow 0.3s;
}

.room-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow-color);
}

.room-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.room-card-header h3 {
    font-size: 18px;
    color: var(--text-primary);
}

.room-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-open {
    background: rgba(78, 205, 196, 0.2);
    color: var(--accent-success);
}

.badge-playing {
    background: rgba(243, 156, 18, 0.2);
    color: var(--accent-warning);
}

.badge-locked {
    background: rgba(231, 76, 60, 0.2);
    color: var(--accent-danger);
}

.room-info {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    color: var(--text-muted);
    font-size: 14px;
}

.room-info span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* =====================================================
   Modal
   ===================================================== */

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

.modal-overlay.active {
    display: flex;
}

.modal {
    background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-input) 100%);
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-strong);
}

.modal h2 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

/* =====================================================
   Cartas do Jogo
   ===================================================== */

.card {
    border-radius: 12px;
    padding: 20px;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 16px;
    line-height: 1.5;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.card:hover {
    transform: translateY(-5px) scale(1.02);
}

.card-black {
    background: linear-gradient(145deg, var(--card-black-bg) 0%, #2d2d2d 100%);
    color: var(--card-black-text);
    border: 3px solid var(--border-strong);
}

.card-white {
    background: linear-gradient(145deg, var(--card-white-bg) 0%, #e0e0e0 100%);
    color: var(--card-white-text);
    border: 3px solid #ccc;
}

.card-white:hover {
    border-color: var(--accent-primary);
}

.card.selected {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(233, 69, 96, 0.5);
}

.card-pick-count {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: var(--accent-primary);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.hand-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

/* =====================================================
   Area do Jogo
   ===================================================== */

.game-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    min-height: calc(100vh - 100px);
}

@media (max-width: 900px) {
    .game-container {
        grid-template-columns: 1fr;
    }
}

.game-main {
    background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-input) 100%);
    border-radius: 16px;
    padding: 30px;
}

.game-sidebar {
    background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-input) 100%);
    border-radius: 16px;
    padding: 20px;
}

.current-card {
    max-width: 400px;
    margin: 0 auto 30px;
}

.current-card .card-black {
    min-height: 200px;
    font-size: 20px;
}

/* =====================================================
   Lista de Jogadores
   ===================================================== */

.players-list {
    list-style: none;
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--bg-input);
}

.player-item.current-player {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent-primary);
}

.player-item.is-judge {
    background: linear-gradient(90deg, rgba(78, 205, 196, 0.2) 0%, var(--bg-input) 100%);
}

.player-name {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.player-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--accent-primary);
    color: #fff;
}

.player-score {
    font-weight: bold;
    color: var(--accent-primary);
}

/* =====================================================
   Submissoes (para o Juri)
   ===================================================== */

.submissions-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.submission-group {
    background: var(--bg-input);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s;
}

.submission-group:hover {
    border-color: var(--accent-primary);
}

.submission-group.selected {
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.submission-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.submission-card {
    background: var(--card-white-bg);
    color: var(--card-white-text);
    padding: 15px;
    border-radius: 8px;
    font-size: 14px;
}

/* =====================================================
   Status e Alertas
   ===================================================== */

.status-bar {
    background: var(--bg-input);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-text {
    color: var(--text-muted);
}

.status-text strong {
    color: var(--text-primary);
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: rgba(78, 205, 196, 0.2);
    color: var(--accent-success);
    border: 1px solid var(--accent-success);
}

.alert-error {
    background: rgba(231, 76, 60, 0.2);
    color: var(--accent-danger);
    border: 1px solid var(--accent-danger);
}

.alert-info {
    background: rgba(52, 152, 219, 0.2);
    color: #90cdf4;
    border: 1px solid #2c5282;
}

/* =====================================================
   Tela de Espera
   ===================================================== */

.waiting-room {
    text-align: center;
    padding: 40px;
}

.waiting-room h2 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.room-code-display {
    background: var(--bg-input);
    padding: 20px 40px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 30px;
}

.room-code-display .code {
    font-size: 36px;
    font-weight: bold;
    letter-spacing: 8px;
    color: var(--accent-primary);
}

.room-code-display p {
    color: var(--text-muted);
    margin-top: 10px;
}

.share-link {
    background: var(--bg-input);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
}

.share-link input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
}

/* =====================================================
   Resultado da Rodada
   ===================================================== */

.round-result {
    text-align: center;
    padding: 40px;
}

.round-result h2 {
    color: var(--accent-primary);
    font-size: 28px;
    margin-bottom: 10px;
}

.winner-name {
    font-size: 36px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 30px;
}

.winning-cards {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.winning-cards .card-white {
    max-width: 250px;
}

/* =====================================================
   Tela de Vitoria
   ===================================================== */

.game-over {
    text-align: center;
    padding: 60px 20px;
}

.game-over h1 {
    font-size: 48px;
    color: var(--accent-primary);
    margin-bottom: 20px;
}

.game-over .winner-name {
    font-size: 42px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.game-over .final-score {
    font-size: 24px;
    color: var(--text-muted);
    margin-bottom: 40px;
}

/* =====================================================
   Header
   ===================================================== */

.header {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 0;
    margin-bottom: 30px;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-primary);
}

.logo span {
    color: var(--accent-primary);
}

/* =====================================================
   Pagina Inicial
   ===================================================== */

.hero {
    text-align: center;
    padding: 60px 20px;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.hero h1 span {
    color: var(--accent-primary);
}

.hero p {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* =====================================================
   Configuracoes da Sala (Lider)
   ===================================================== */

.room-settings {
    background: var(--bg-input);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.room-settings h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.pack-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.pack-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--bg-card);
    border-radius: 8px;
    cursor: pointer;
}

.pack-option input {
    width: auto;
}

.pack-option label {
    cursor: pointer;
    color: var(--text-secondary);
}

/* =====================================================
   Animacoes
   ===================================================== */

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

.loading {
    animation: pulse 1.5s infinite;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: slideIn 0.3s ease-out;
}

/* =====================================================
   Responsividade
   ===================================================== */

@media (max-width: 768px) {
    .hero h1 {
        font-size: 32px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .hero-actions .btn {
        width: 100%;
        max-width: 300px;
    }

    .hand-container {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }

    .card {
        min-height: 100px;
        padding: 12px;
        font-size: 13px;
    }

    .submissions-container {
        grid-template-columns: 1fr;
    }

    /* Layout responsivo: jogo em cima, sidebar embaixo */
    .game-container {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .game-main {
        order: 1;
        padding: 15px;
        border-radius: 12px;
    }

    .game-sidebar {
        order: 2;
        padding: 15px;
        border-radius: 12px;
    }

    /* Placar mais compacto no mobile */
    .game-sidebar .players-list {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .game-sidebar .player-item {
        flex: 1 1 auto;
        min-width: 100px;
        padding: 8px 12px;
        font-size: 13px;
    }

    /* Chat mais compacto */
    .chat-container {
        height: 200px;
    }

    /* Historico compacto */
    .history-section {
        max-height: 250px;
    }

    /* Carta preta menor */
    .current-card {
        max-width: 100%;
        margin-bottom: 15px;
    }

    .current-card .card-black {
        min-height: 120px;
        font-size: 16px;
        padding: 15px;
    }

    /* Timer compacto */
    .timer-display {
        font-size: 20px;
        padding: 8px 15px;
    }

    /* Botoes menores */
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .btn-small {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* =====================================================
   Scrollbar Personalizada
   ===================================================== */

::-webkit-scrollbar {
    width: 8px;
}

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

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

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

/* =====================================================
   Sistema de Chat
   ===================================================== */

.chat-container {
    display: flex;
    flex-direction: column;
    height: 300px;
    background: var(--bg-input);
    border-radius: 12px;
    margin-top: 20px;
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-strong);
}

.chat-header h4 {
    margin: 0;
    font-size: 14px;
    color: var(--text-primary);
}

.chat-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    line-height: 1;
}

.chat-toggle:hover {
    color: var(--text-primary);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: slideIn 0.2s ease-out;
}

.chat-message.mine {
    align-self: flex-end;
}

.chat-message.other {
    align-self: flex-start;
}

.chat-message.system {
    align-self: center;
    max-width: 100%;
}

.chat-message .sender {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.chat-message.mine .sender {
    text-align: right;
    color: var(--accent-primary);
}

.chat-message .content {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    word-wrap: break-word;
}

.chat-message.mine .content {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-message.other .content {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chat-message.system .content {
    background: transparent;
    color: var(--text-muted);
    font-style: italic;
    font-size: 12px;
    text-align: center;
}

.chat-message .time {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

.chat-message.mine .time {
    text-align: right;
}

.chat-input-container {
    display: flex;
    gap: 8px;
    padding: 10px 15px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-strong);
}

.chat-input {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 20px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-input:focus {
    box-shadow: 0 0 0 2px rgba(233, 69, 96, 0.3);
}

.chat-send-btn {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    transition: transform 0.2s;
}

.chat-send-btn:hover {
    transform: scale(1.1);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Chat colapsado */
.chat-container.collapsed .chat-messages,
.chat-container.collapsed .chat-input-container {
    display: none;
}

.chat-container.collapsed {
    height: auto;
}

/* Badge de novas mensagens */
.chat-badge {
    background: var(--accent-primary);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
}

/* =====================================================
   Sistema de Reacoes
   ===================================================== */

.reactions-container {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.reaction-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid transparent;
    border-radius: 20px;
    padding: 5px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 16px;
    transition: all 0.2s;
}

.reaction-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.reaction-btn.active {
    background: rgba(233, 69, 96, 0.3);
    border-color: var(--accent-primary);
}

.reaction-btn .count {
    font-size: 12px;
    color: var(--text-primary);
    min-width: 16px;
    text-align: center;
}

.reaction-picker {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 8px;
}

.reaction-picker .reaction-btn {
    padding: 8px;
    font-size: 20px;
}

/* Reacoes na submissao */
.submission-reactions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.submission-reactions .reaction-badge {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.submission-reactions .reaction-badge .emoji {
    font-size: 14px;
}

.submission-reactions .reaction-badge .count {
    color: var(--card-white-text);
    font-weight: bold;
}

/* =====================================================
   Modo Espectador
   ===================================================== */

.spectator-badge {
    background: rgba(243, 156, 18, 0.2);
    color: var(--accent-warning);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.spectator-notice {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.3) 0%, rgba(243, 156, 18, 0.1) 100%);
    color: var(--text-primary);
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
    border: 1px solid var(--accent-warning);
}

.spectator-notice h3 {
    margin-bottom: 5px;
    color: var(--accent-warning);
}

.spectator-notice p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* =====================================================
   Favoritos
   ===================================================== */

.favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    opacity: 0.5;
    transition: all 0.2s;
    padding: 5px;
}

.favorite-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

.favorite-btn.active {
    opacity: 1;
    color: var(--accent-primary);
}

.card-white .favorite-btn {
    color: var(--accent-primary);
}

/* =====================================================
   Timer
   ===================================================== */

.timer-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.timer-display {
    font-size: 28px;
    font-weight: bold;
    color: var(--text-primary);
    min-width: 60px;
    text-align: center;
}

.timer-display.warning {
    color: var(--accent-warning);
    animation: pulse 1s infinite;
}

.timer-display.danger {
    color: var(--accent-danger);
    animation: pulse 0.5s infinite;
}

.timer-bar {
    width: 100%;
    height: 4px;
    background: var(--border-strong);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 15px;
}

.timer-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-success), var(--accent-warning), var(--accent-danger));
    transition: width 1s linear;
}

/* =====================================================
   Historico de Rodadas
   ===================================================== */

.history-container {
    margin-top: 20px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.history-header h4 {
    color: var(--text-primary);
    margin: 0;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 15px;
    border-left: 3px solid var(--accent-primary);
}

.history-item .round-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.history-item .black-card-text {
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 10px;
    padding: 10px;
    background: var(--bg-primary);
    border-radius: 6px;
}

.history-item .white-card-text {
    background: var(--card-white-bg);
    color: var(--card-white-text);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 5px;
}

.history-item .winner-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--accent-success);
}

/* =====================================================
   Configuracoes de Timer na Criacao de Sala
   ===================================================== */

.timer-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.timer-option {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.timer-option label {
    font-size: 13px;
    color: var(--text-muted);
}

.timer-option select {
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
}

/* =====================================================
   Ajustes Responsivos para Novas Features
   ===================================================== */

@media (max-width: 768px) {
    .chat-container {
        height: 200px;
    }

    .chat-message .content {
        font-size: 12px;
        padding: 6px 10px;
    }

    .reactions-container {
        gap: 3px;
    }

    .reaction-btn {
        padding: 4px 8px;
        font-size: 14px;
    }

    .timer-display {
        font-size: 20px;
    }

    .history-item {
        padding: 10px;
    }
}

/* Telas muito pequenas (smartphones) */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .header-content {
        padding: 10px 15px;
    }

    .header nav {
        gap: 5px;
    }

    .logo {
        font-size: 18px;
    }

    .game-main, .game-sidebar {
        padding: 12px;
    }

    .hand-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .card {
        min-height: 90px;
        padding: 10px;
        font-size: 12px;
    }

    .current-card .card-black {
        min-height: 100px;
        font-size: 14px;
        padding: 12px;
    }

    .submission-group {
        padding: 10px;
    }

    .submission-group .card {
        min-height: 70px;
        font-size: 11px;
    }

    /* Placar ultra compacto */
    .game-sidebar h3 {
        font-size: 14px;
        margin-bottom: 10px;
        color: var(--text-primary);
    }

    .game-sidebar .players-list {
        gap: 5px;
    }

    .game-sidebar .player-item {
        padding: 6px 10px;
        font-size: 12px;
    }

    .player-score {
        font-size: 14px;
    }

    /* Chat minimo */
    .chat-container {
        height: 150px;
        margin-top: 10px;
    }

    .chat-header {
        padding: 8px 12px;
    }

    .chat-input {
        font-size: 14px;
        padding: 8px 10px;
    }

    /* Timer pequeno */
    .timer-container {
        margin-bottom: 10px;
    }

    .timer-display {
        font-size: 18px;
        padding: 6px 12px;
    }

    /* Historico minimo */
    .history-section {
        max-height: 200px;
    }

    .history-item {
        padding: 8px;
    }

    .history-cards {
        gap: 5px;
    }

    /* Botoes compactos */
    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    /* Modal ajustado */
    .modal {
        padding: 20px;
        margin: 10px;
        max-height: 90vh;
    }

    /* Settings panel */
    .settings-panel {
        width: 95%;
        max-height: 85vh;
    }

    .theme-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .theme-option {
        padding: 10px 5px;
    }

    .theme-icon {
        font-size: 20px;
    }

    .theme-name {
        font-size: 10px;
    }
}

/* =====================================================
   PWA Styles
   ===================================================== */

/* Botao de instalacao */
#installBtn {
    animation: pulse 2s infinite;
    background: linear-gradient(135deg, var(--accent-success) 0%, #00cec9 100%);
}

#installBtn:hover {
    animation: none;
    transform: scale(1.05);
}

/* PWA standalone mode adjustments */
@media (display-mode: standalone) {
    .header {
        padding-top: env(safe-area-inset-top);
    }

    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* iOS specific */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available;
    }
}

/* Offline indicator */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--accent-danger);
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 14px;
    z-index: 10000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.offline-indicator.visible {
    transform: translateY(0);
}

/* Notification permission prompt */
.notification-prompt {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--accent-primary);
    border-radius: 12px;
    padding: 16px 20px;
    max-width: 320px;
    z-index: 9999;
    box-shadow: 0 10px 40px var(--shadow-color);
    animation: slideIn 0.3s ease;
}

.notification-prompt h4 {
    color: var(--accent-primary);
    margin-bottom: 8px;
}

.notification-prompt p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.notification-prompt .btn-group {
    display: flex;
    gap: 10px;
}

.notification-prompt .btn-group .btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 14px;
}

/* =====================================================
   Painel de Configuracoes
   ===================================================== */

.settings-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;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.settings-overlay.active {
    opacity: 1;
    visibility: visible;
}

.settings-panel {
    background: var(--bg-card);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px var(--shadow-color);
}

.settings-overlay.active .settings-panel {
    transform: scale(1);
}

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

.settings-header h2 {
    color: var(--accent-primary);
    margin: 0;
}

.settings-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: color 0.2s;
}

.settings-close:hover {
    color: var(--accent-primary);
}

.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.settings-section {
    margin-bottom: 25px;
}

.settings-section h3 {
    color: var(--text-primary);
    font-size: 16px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.settings-row label {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary);
    border-radius: 26px;
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--text-primary);
    border-radius: 50%;
    transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.volume-control input[type="range"] {
    width: 100px;
    height: 6px;
    -webkit-appearance: none;
    background: var(--bg-secondary);
    border-radius: 3px;
    outline: none;
}

.volume-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
}

.volume-control input[type="range"]:disabled {
    opacity: 0.5;
}

#volumeValue {
    color: var(--text-muted);
    font-size: 13px;
    min-width: 40px;
}

/* Theme Grid */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.theme-option:hover {
    border-color: var(--border-color);
    transform: translateY(-2px);
}

.theme-option.active {
    border-color: var(--accent-primary);
    background: rgba(233, 69, 96, 0.1);
}

.theme-icon {
    font-size: 24px;
    margin-bottom: 5px;
}

.theme-name {
    font-size: 12px;
    color: var(--text-secondary);
}

.theme-option.active .theme-name {
    color: var(--accent-primary);
}

/* Status Badges */
.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-success {
    background: rgba(78, 205, 196, 0.2);
    color: var(--accent-success);
}

.status-error {
    background: rgba(231, 76, 60, 0.2);
    color: var(--accent-danger);
}

/* Settings Footer */
.settings-footer {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

/* No Animations Mode */
.no-animations * {
    animation: none !important;
    transition: none !important;
}

/* Settings Button */
#settingsBtn {
    font-size: 18px;
    padding: 8px 12px;
    min-width: auto;
}

/* =====================================================
   Admin Styles
   ===================================================== */

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-strong);
    flex-wrap: wrap;
    gap: 15px;
}

.admin-header h1 {
    color: var(--accent-primary);
    margin: 0;
}

.nav-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-tabs a {
    padding: 10px 20px;
    background: var(--bg-card);
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
}

.nav-tabs a:hover, .nav-tabs a.active {
    background: var(--accent-primary);
    color: #fff;
}

.panel, .dashboard-panel, .form-section {
    background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-input) 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.panel h3, .dashboard-panel h3, .form-section h2 {
    color: var(--accent-primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-strong);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-strong);
}

.data-table th {
    color: var(--text-muted);
    font-weight: normal;
    font-size: 12px;
    text-transform: uppercase;
}

.data-table td {
    color: var(--text-primary);
}

.data-table tr:hover {
    background: rgba(233, 69, 96, 0.1);
}

/* Badge styles */
.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.badge-success {
    background: rgba(78, 205, 196, 0.2);
    color: var(--accent-success);
}

.badge-warning {
    background: rgba(243, 156, 18, 0.2);
    color: var(--accent-warning);
}

.badge-danger {
    background: rgba(231, 76, 60, 0.2);
    color: var(--accent-danger);
}

.badge-info {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}
