/* Reset e configurações base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Permitir seleção de texto apenas em inputs e áreas de texto */
input, textarea, .chat-messages {
    -webkit-user-select: text;
    -khtml-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a4d3a 0%, #2d5a3d 50%, #0f2419 100%);
    color: #f0f8f0;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animação de fundo com folhas */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(139, 69, 19, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(34, 139, 34, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(255, 215, 0, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Header */
.game-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.game-header h1 {
    font-size: 3rem;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2rem;
    color: #90ee90;
    font-style: italic;
}

/* Telas do jogo */
.screen {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.screen.active {
    display: block;
}

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

/* Menu Principal */
.menu-content {
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
    padding: 40px;
    border-radius: 20px;
    border: 2px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.menu-content h2 {
    font-size: 2.5rem;
    color: #ffd700;
    margin-bottom: 15px;
}

.menu-content p {
    font-size: 1.3rem;
    color: #b8d4b8;
    margin-bottom: 30px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 300px;
    margin: 0 auto;
}

/* Botões */
.btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn.primary {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #2d5a3d;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.btn.secondary {
    background: linear-gradient(45deg, #228b22, #32cd32);
    color: white;
    box-shadow: 0 4px 15px rgba(34, 139, 34, 0.3);
}

.btn.secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 139, 34, 0.4);
}

.btn.tertiary {
    background: linear-gradient(45deg, #8b4513, #a0522d);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.btn.tertiary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
}

.btn.danger {
    background: linear-gradient(45deg, #dc3545, #c82333);
    color: white;
    font-size: 0.9em;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn.danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.btn.small {
    padding: 8px 12px;
    font-size: 0.8em;
    min-width: auto;
}

.game-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.game-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn:active {
    transform: translateY(1px) scale(0.98);
}

/* Melhorias para toque */
.btn, .player-card, .setting-group button {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 215, 0, 0.3);
}

.player-card:active {
    transform: translateY(-2px) scale(0.98);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

/* Lobby */
.lobby-content {
    background: rgba(0, 0, 0, 0.4);
    padding: 30px;
    border-radius: 20px;
    border: 2px solid rgba(255, 215, 0, 0.2);
}

.lobby-settings {
    margin-bottom: 30px;
}

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

.setting-group label {
    display: block;
    margin-bottom: 8px;
    color: #ffd700;
    font-weight: bold;
}

.setting-group select,
.setting-group input {
    width: 100%;
    max-width: 300px;
    padding: 12px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #f0f8f0;
    font-size: 1rem;
}

.setting-group button {
    margin-left: 10px;
    padding: 12px 20px;
    background: #228b22;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.room-code-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.room-code-controls input {
    flex: 1;
    min-width: 200px;
}

.room-code-controls button {
    margin-left: 0;
    white-space: nowrap;
}

.room-code-controls button:first-of-type {
    background: #ffa500;
}

.room-code-controls button:first-of-type:hover {
    background: #ff8c00;
}

.room-code-controls button:last-of-type {
    background: #228b22;
}

.room-code-controls button:last-of-type:hover {
    background: #32cd32;
}

.players-list {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.players-list h3 {
    color: #ffd700;
    margin-bottom: 15px;
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 8px;
}

.player-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
}

.btn-kick {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 10px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-kick:hover {
    background: #c82333;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

.btn-kick:active {
    transform: scale(0.95);
}

.player-name {
    font-weight: bold;
}

.player-status {
    color: #90ee90;
    font-size: 0.9rem;
}

/* Tela de Entrar em Sala */
.join-content {
    background: rgba(0, 0, 0, 0.4);
    padding: 30px;
    border-radius: 20px;
    border: 2px solid rgba(255, 215, 0, 0.2);
}

.join-content h2 {
    color: #ffd700;
    margin-bottom: 30px;
    text-align: center;
    font-size: 2rem;
}

.join-form {
    margin-bottom: 30px;
}

.join-form label {
    display: block;
    margin-bottom: 8px;
    color: #ffd700;
    font-weight: bold;
}

.join-form input {
    width: 100%;
    max-width: 400px;
    padding: 12px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #f0f8f0;
    font-size: 1rem;
    margin-bottom: 20px;
}

.join-form input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.join-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.join-buttons .btn {
    min-width: 150px;
}

/* Regras */
.rules-content {
    background: rgba(0, 0, 0, 0.4);
    padding: 30px;
    border-radius: 20px;
    border: 2px solid rgba(255, 215, 0, 0.2);
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 215, 0, 0.5) transparent;
}

.rules-content::-webkit-scrollbar {
    width: 6px;
}

.rules-content::-webkit-scrollbar-track {
    background: transparent;
}

.rules-content::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.5);
    border-radius: 3px;
}

.rules-text h3 {
    color: #ffd700;
    margin: 20px 0 10px 0;
    font-size: 1.5rem;
}

.rules-text p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #e0e0e0;
}

.character-list {
    margin: 20px 0;
}

.character {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 4px solid #ffd700;
}

.character strong {
    color: #ffd700;
}

/* Interface do Jogo */
.game-interface {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    border: 2px solid rgba(255, 215, 0, 0.2);
    overflow: hidden;
}

.game-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid rgba(255, 215, 0, 0.2);
}

.phase-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
}

.phase-indicator span {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffd700;
}

.timer {
    background: #8b0000;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.2rem;
}

.role-info {
    font-size: 1.2rem;
    color: #90ee90;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.room-code-info {
    font-size: 1rem;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.room-code-info:hover {
    background: rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.5);
    transform: scale(1.05);
}

.game-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    padding: 20px;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    width: 100%;
    max-width: 100%;
}

.player-card {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 120px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.player-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

.player-card.selected {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.2);
}

.player-card.eliminated {
    opacity: 0.5;
    background: rgba(139, 0, 0, 0.3);
    border-color: #8b0000;
}

.player-card.disabled {
    opacity: 0.5 !important;
    background: rgba(128, 128, 128, 0.2) !important;
    border-color: #666 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

.player-card.disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

.action-used-indicator {
    background: rgba(34, 139, 34, 0.8);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-top: 4px;
    font-weight: bold;
    text-align: center;
}

/* Modal de Histórico do Jogo */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.game-history-modal {
    animation: fadeIn 0.3s ease-out;
}

.game-history-content {
    animation: slideIn 0.4s ease-out;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 215, 0, 0.5) transparent;
}

.game-history-content::-webkit-scrollbar {
    width: 8px;
}

.game-history-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.game-history-content::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.5);
    border-radius: 4px;
}

.game-history-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.7);
}

/* Estilo para teclas no histórico */
kbd {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: monospace;
    font-size: 0.8rem;
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Seção de Contribuição */
.contribution-section {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(26, 77, 58, 0.3), rgba(74, 144, 226, 0.2));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    text-align: center;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.8s ease-out;
}

.beta-notice {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.beta-badge {
    background: linear-gradient(45deg, #ff6b6b, #ffd93d);
    color: #000;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    animation: pulse 2s infinite;
}

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

.beta-notice p {
    margin: 0;
    color: #ffd93d;
    font-weight: 500;
}

.contribution-content h3 {
    color: #90ee90;
    margin: 0 0 10px 0;
    font-size: 1.3rem;
}

.contribution-content p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 20px 0;
    line-height: 1.4;
}

.contribution-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(45deg, #00d4aa, #4a90e2);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
    margin-bottom: 15px;
}

.contribution-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 170, 0.4);
    background: linear-gradient(45deg, #00e6c0, #5ba0f2);
}

.contribution-icon {
    font-size: 1.2rem;
}

.contribution-text {
    font-size: 1rem;
}

.contribution-arrow {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.contribution-link:hover .contribution-arrow {
    transform: translateX(3px);
}

.contribution-content small {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    line-height: 1.3;
    margin-top: 10px;
}

/* Responsividade para a seção de contribuição */
@media (max-width: 768px) {
    .contribution-section {
        margin-top: 20px;
        padding: 15px;
    }
    
    .beta-notice {
        flex-direction: column;
        gap: 5px;
    }
    
    .contribution-content h3 {
        font-size: 1.1rem;
    }
    
    .contribution-link {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .contribution-content small {
        font-size: 0.8rem;
    }
}

/* Funcionalidades em Construção */
.construction-features {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.1), rgba(255, 215, 0, 0.1));
    border: 2px dashed rgba(255, 165, 0, 0.4);
    border-radius: 15px;
    text-align: center;
}

.construction-features h3 {
    color: #ffa500;
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.construction-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn.construction {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.2), rgba(255, 215, 0, 0.2));
    border: 2px solid rgba(255, 165, 0, 0.5);
    color: #ffd700;
    padding: 15px 20px;
    border-radius: 12px;
    min-width: 140px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn.construction:hover {
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.3), rgba(255, 215, 0, 0.3));
    border-color: rgba(255, 165, 0, 0.7);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 165, 0, 0.3);
}

.construction-icon {
    font-size: 1.8rem;
}

.construction-text {
    font-weight: bold;
    font-size: 0.9rem;
}

.construction-badge {
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Telas de Construção */
.construction-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    text-align: left;
}

.construction-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px dashed rgba(255, 165, 0, 0.3);
}

.construction-header h2 {
    color: #90ee90;
    margin-bottom: 15px;
}

.status-badge {
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 3px 8px rgba(255, 107, 107, 0.4);
    animation: pulse 2s infinite;
}

.construction-preview h3 {
    color: #ffd700;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.feature-list {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #ffd700;
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.feature-icon {
    font-size: 1.5rem;
    min-width: 30px;
}

.feature-info strong {
    color: #90ee90;
    display: block;
    margin-bottom: 5px;
}

.feature-info p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Mockups */
.construction-mockup {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 165, 0, 0.3);
    margin-bottom: 30px;
}

.construction-mockup h4 {
    color: #ffa500;
    margin-bottom: 15px;
    text-align: center;
}

.mockup-login {
    display: flex;
    justify-content: center;
}

.mockup-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 300px;
}

.mockup-form input {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    opacity: 0.6;
}

.mockup-form button {
    opacity: 0.6;
    cursor: not-allowed;
}

.mockup-ranking {
    text-align: center;
}

.mockup-podium {
    display: flex;
    justify-content: center;
    align-items: end;
    gap: 10px;
    margin-bottom: 20px;
}

.podium-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 10px;
    border-radius: 10px;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    opacity: 0.7;
}

.podium-item.winner {
    background: rgba(255, 215, 0, 0.2);
    border: 2px solid rgba(255, 215, 0, 0.5);
    transform: scale(1.1);
}

.position {
    font-size: 1.2rem;
    font-weight: bold;
}

.player {
    color: #90ee90;
    font-weight: bold;
}

.score {
    color: #ffd700;
    font-size: 0.9rem;
}

.mockup-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 400px;
    margin: 0 auto;
}

.rank-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-radius: 8px;
    opacity: 0.6;
}

.rank {
    font-weight: bold;
    color: #ffa500;
    min-width: 30px;
}

.name {
    color: #90ee90;
    flex: 1;
    text-align: left;
    margin-left: 15px;
}

.points {
    color: #ffd700;
    font-size: 0.9rem;
}

/* Responsividade para construção */
@media (max-width: 768px) {
    .construction-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn.construction {
        width: 100%;
        max-width: 200px;
    }
    
    .construction-content {
        padding: 15px;
    }
    
    .mockup-podium {
        flex-direction: column;
        align-items: center;
    }
    
    .podium-item.winner {
        transform: none;
        order: -1;
    }
}

/* Modal Customizado para Alertas */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.custom-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.custom-modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a4d3a, #2d5a47);
    border: 2px solid rgba(144, 238, 144, 0.3);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

.custom-modal-header {
    background: linear-gradient(135deg, rgba(144, 238, 144, 0.2), rgba(74, 144, 226, 0.2));
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-modal-header h3 {
    color: #90ee90;
    margin: 0;
    font-size: 1.4rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.custom-modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.custom-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ff6b6b;
    transform: rotate(90deg);
}

.custom-modal-body {
    padding: 25px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    font-size: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.custom-modal-body p {
    margin: 0;
    white-space: pre-line;
}

.custom-modal-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: rgba(0, 0, 0, 0.2);
}

.custom-modal-footer .btn {
    min-width: 80px;
    padding: 10px 20px;
}

/* Tipos específicos de modal */
.custom-modal.error .custom-modal-header {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.2), rgba(255, 165, 0, 0.2));
}

.custom-modal.error .custom-modal-header h3 {
    color: #ff6b6b;
}

.custom-modal.success .custom-modal-header {
    background: linear-gradient(135deg, rgba(144, 238, 144, 0.2), rgba(0, 212, 170, 0.2));
}

.custom-modal.success .custom-modal-header h3 {
    color: #90ee90;
}

.custom-modal.warning .custom-modal-header {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
}

.custom-modal.warning .custom-modal-header h3 {
    color: #ffd700;
}

.custom-modal.info .custom-modal-header {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.2), rgba(116, 185, 255, 0.2));
}

.custom-modal.info .custom-modal-header h3 {
    color: #4a90e2;
}

/* Responsividade do modal */
@media (max-width: 768px) {
    .custom-modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .custom-modal-header {
        padding: 15px;
    }
    
    .custom-modal-header h3 {
        font-size: 1.2rem;
    }
    
    .custom-modal-body {
        padding: 20px;
        font-size: 0.9rem;
    }
    
    .custom-modal-footer {
        padding: 15px;
        flex-direction: column;
    }
    
    .custom-modal-footer .btn {
        width: 100%;
    }
}

/* Google AdSense Containers */
.adsense-banner-top {
    width: 100%;
    max-width: 728px;
    margin: 10px auto;
    text-align: center;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

.adsense-banner-bottom {
    width: 100%;
    max-width: 728px;
    margin: 20px auto;
    text-align: center;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

.adsense-sidebar {
    width: 160px;
    min-height: 600px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 10px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    margin: 0 10px;
    flex-shrink: 0;
}

/* Rodapé */
.game-footer {
    background: linear-gradient(135deg, #1a4d3a, #0d2818);
    border-top: 2px solid rgba(144, 238, 144, 0.3);
    padding: 20px;
    text-align: center;
    margin-top: 30px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 15px 0;
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #90ee90;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    padding: 5px 10px;
    border-radius: 5px;
}

.footer-links a:hover {
    color: #fff;
    background: rgba(144, 238, 144, 0.2);
}

/* Política de Privacidade */
.privacy-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 1px solid rgba(144, 238, 144, 0.3);
}

.privacy-content h2 {
    color: #90ee90;
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.privacy-content h3 {
    color: #ffd700;
    margin: 25px 0 15px 0;
    font-size: 1.2rem;
}

.privacy-text {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 30px;
}

.privacy-text p {
    margin-bottom: 15px;
}

.privacy-text ul {
    margin: 10px 0 15px 20px;
    padding-left: 20px;
}

.privacy-text li {
    margin-bottom: 8px;
}

.privacy-text a {
    color: #4a90e2;
    text-decoration: none;
}

.privacy-text a:hover {
    text-decoration: underline;
}

.privacy-text small {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

/* Responsividade para AdSense */
@media (max-width: 768px) {
    .adsense-banner-top,
    .adsense-banner-bottom {
        max-width: 320px;
        margin: 10px auto;
    }
    
    .adsense-sidebar {
        display: none; /* Ocultar anúncio lateral em mobile */
    }
    
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
    
    .privacy-content {
        padding: 15px;
        margin: 10px;
    }
    
    .privacy-content h2 {
        font-size: 1.5rem;
    }
}

/* Ajuste do layout do jogo para acomodar anúncios */
.game-main {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.players-grid {
    flex: 1;
}

.game-actions {
    flex: 1;
}

@media (max-width: 1024px) {
    .game-main {
        flex-direction: column;
    }
    
    .adsense-sidebar {
        order: -1; /* Colocar anúncio no topo em tablets */
        width: 100%;
        min-height: auto;
        margin: 0 0 20px 0;
    }
}

.player-avatar {
    font-size: 2.8rem;
    margin-bottom: 8px;
    line-height: 1;
}

.player-card-name {
    font-weight: bold;
    color: #f0f8f0;
    margin-bottom: 4px;
    font-size: 0.9rem;
    line-height: 1.2;
    max-width: 100%;
    word-break: break-word;
    hyphens: auto;
}

.player-status {
    font-size: 0.8rem;
    color: #b0b0b0;
    line-height: 1.1;
}

.game-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.action-panel {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    padding: 20px;
    border: 2px solid rgba(255, 215, 0, 0.2);
}

.action-panel h3 {
    color: #ffd700;
    margin-bottom: 15px;
}

.chat-panel {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 2px solid rgba(255, 215, 0, 0.2);
    display: flex;
    flex-direction: column;
    height: 300px;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 215, 0, 0.5) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.5);
    border-radius: 3px;
}

.system-message {
    color: #ffd700;
    font-style: italic;
    margin-bottom: 10px;
    text-align: center;
}

.chat-message {
    margin-bottom: 8px;
    padding: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
}

.chat-input {
    display: flex;
    padding: 15px;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 10px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #f0f8f0;
}

.chat-input button {
    padding: 10px 20px;
    background: #228b22;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* Responsividade */
@media (max-width: 768px) {
    body {
        padding: 0;
        margin: 0;
    }
    
    .game-container {
        padding: 10px;
        max-width: 100%;
    }
    
    .game-header {
        margin-bottom: 20px;
        padding: 15px;
    }
    
    .game-header h1 {
        font-size: 2.5rem;
        margin-bottom: 8px;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .menu-content {
        padding: 20px 15px;
        margin: 0 5px;
    }
    
    .menu-content h2 {
        font-size: 2rem;
    }
    
    .menu-buttons {
        max-width: 100%;
    }
    
    .btn {
        padding: 18px 25px;
        font-size: 1.2rem;
        margin-bottom: 5px;
    }
    
    /* Lobby mobile */
    .lobby-content, .rules-content, .join-content {
        padding: 20px 15px;
        margin: 0 5px;
    }
    
    /* Join screen mobile */
    .join-form input {
        max-width: 100%;
        padding: 15px;
        font-size: 1.1rem;
        border-radius: 10px;
        margin-bottom: 25px;
    }
    
    .join-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .join-buttons .btn {
        width: 100%;
        min-width: auto;
        padding: 18px 25px;
        font-size: 1.2rem;
    }
    
    .setting-group {
        margin-bottom: 25px;
    }
    
    .setting-group label {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    
    .setting-group select,
    .setting-group input {
        max-width: 100%;
        padding: 15px;
        font-size: 1.1rem;
        border-radius: 10px;
    }
    
    .setting-group button {
        margin-left: 0;
        margin-top: 10px;
        padding: 15px 25px;
        width: 100%;
        font-size: 1.1rem;
    }
    
    .room-code-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .room-code-controls input {
        min-width: 100%;
    }
    
    .room-code-controls button {
        width: 100%;
    }
    
    /* Interface do jogo mobile */
    .game-main {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .game-header-info {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
        text-align: center;
    }
    
    .phase-indicator {
        flex-direction: column;
        gap: 10px;
    }
    
    .phase-indicator span {
        font-size: 1.3rem;
    }
    
    .timer {
        padding: 10px 20px;
        font-size: 1.3rem;
    }
    
    .role-info {
        font-size: 1.1rem;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .room-code-info {
        font-size: 0.9rem;
        padding: 6px 10px;
    }
    
    .players-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 20px;
    }
    
    .player-card {
        padding: 10px 6px;
        min-height: 110px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        word-break: break-word;
    }
    
    .player-avatar {
        font-size: 2.5rem;
        margin-bottom: 8px;
    }
    
    .player-card-name {
        font-size: 0.9rem;
        margin-bottom: 3px;
    }
    
    .player-status {
        font-size: 0.8rem;
    }
    
    /* Ações do jogo mobile */
    .action-panel {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .action-panel h3 {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }
    
    .action-panel .btn {
        width: 100%;
        margin-bottom: 10px;
        padding: 15px;
        font-size: 1rem;
    }
    
    /* Chat mobile */
    .chat-panel {
        height: 250px;
    }
    
    .chat-messages {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .chat-input {
        padding: 12px;
    }
    
    .chat-input input {
        padding: 12px;
        font-size: 1rem;
        border-radius: 8px;
    }
    
    .chat-input button {
        padding: 12px 18px;
        font-size: 1rem;
    }
    
    /* Regras mobile */
    .rules-content {
        max-height: 80vh;
    }
    
    .rules-text h3 {
        font-size: 1.3rem;
    }
    
    .rules-text h4 {
        font-size: 1.1rem;
    }
    
    .character {
        padding: 10px;
        margin-bottom: 6px;
        font-size: 0.9rem;
    }
    
    /* Players list mobile */
    .players-list {
        padding: 15px;
    }
    
    .player-item {
        padding: 12px;
        font-size: 1rem;
    }
    
    .btn-kick {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
        margin-left: 8px;
    }
}

/* Mobile muito pequeno (< 480px) */
@media (max-width: 480px) {
    .game-header h1 {
        font-size: 2rem;
    }
    
    .menu-content h2 {
        font-size: 1.7rem;
    }
    
    .btn {
        padding: 16px 20px;
        font-size: 1.1rem;
    }
    
    .players-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    
    .player-card {
        min-height: 95px;
        padding: 8px 4px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
    }
    
    .player-avatar {
        font-size: 1.8rem;
        margin-bottom: 4px;
    }
    
    .player-card-name {
        font-size: 0.75rem;
        line-height: 1.2;
        margin-bottom: 2px;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .player-status {
        font-size: 0.7rem;
    }
    
    .phase-indicator span {
        font-size: 1.1rem;
    }
    
    .timer {
        padding: 8px 15px;
        font-size: 1.1rem;
    }
    
    .chat-panel {
        height: 200px;
    }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .game-header h1 {
        font-size: 1.8rem;
    }
    
    .game-header {
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .game-main {
        grid-template-columns: 2fr 1fr;
        gap: 10px;
    }
    
    .players-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .chat-panel {
        height: 180px;
    }
    
    .game-container {
        padding: 5px;
    }
    
    .menu-content, .lobby-content, .rules-content, .join-content {
        padding: 15px 10px;
    }
}

/* Tablet portrait */
@media (min-width: 769px) and (max-width: 1024px) {
    .game-container {
        padding: 15px;
    }
    
    .players-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .player-card {
        min-height: 140px;
    }
    
    .btn {
        padding: 16px 28px;
        font-size: 1.1rem;
    }
}

/* Tablet landscape */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .players-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    .player-card {
        min-height: 100px;
        padding: 10px;
    }
    
    .player-avatar {
        font-size: 2.2rem;
    }
    
    .game-main {
        grid-template-columns: 2fr 1fr;
    }
}

/* Animações especiais */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Animações para notificações */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes pulse {
    0% { 
        transform: scale(1); 
        color: #ff6b6b; 
    }
    50% { 
        transform: scale(1.1); 
        color: #ff4757; 
    }
    100% { 
        transform: scale(1); 
        color: #ff6b6b; 
    }
}

.notification {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border-left: 4px solid #ffd700;
}
