body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #000;
}

#gameCanvas {
    border: 2px solid #333;
    background: #fff;
}

/* Modal de Login */
.modal {
    display: block;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 300px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.modal-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab-button {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    cursor: pointer;
}

.tab-button.active {
    border-bottom: 2px solid #4CAF50;
    color: #4CAF50;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

button {
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background-color: #45a049;
}

.error-message {
    color: #ff4444;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
    min-height: 20px;
}

.form-group {
    margin-bottom: 15px;
}

input:invalid {
    border-color: #ff4444;
}

input:valid {
    border-color: #4CAF50;
}

.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading button {
    background-color: #666;
}

/* Animação de loading */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading button::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 10px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

/* Painel de Comunicação */
.draggable-panel {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 320px;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    min-width: 300px;
    min-height: 400px;
    backdrop-filter: blur(5px);
    display: none;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    cursor: move;
    user-select: none;
}

.panel-title {
    color: white;
    font-weight: bold;
}

.panel-controls button {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    margin-left: 5px;
}

.panel-controls button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.panel-content {
    display: flex;
    flex-direction: column;
    height: calc(100% - 44px);
    background: rgba(0, 0, 0, 0.85);
}

/* Área de Vídeo */
#videoArea {
    position: relative;
    width: 100%;
    height: 200px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#hostVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    z-index: 1;
}

.video-controls {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 5px;
    background: rgba(0, 0, 0, 0.5);
}

.control-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
}

.control-btn:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.control-btn:active:not(.disabled) {
    transform: scale(0.95);
}

.control-btn.disabled {
    background: rgba(255, 0, 0, 0.2);
    cursor: not-allowed;
    opacity: 0.7;
}

.control-btn.disabled::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -2px;
    right: -2px;
    height: 2px;
    background: red;
    transform: rotate(-45deg);
}

/* Área de Chat */
#chatArea {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header {
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.3);
}

#chatMessages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-message {
    padding: 8px 12px;
    border-radius: 15px;
    max-width: 85%;
    word-break: break-word;
}

.chat-message.self {
    background: rgba(76, 175, 80, 0.3);
    align-self: flex-end;
    margin-right: 5px;
}

.chat-message.other {
    background: rgba(255, 255, 255, 0.1);
    align-self: flex-start;
    margin-left: 5px;
}

.chat-input {
    display: flex;
    padding: 10px;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
}

#messageInput {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
}

#messageInput::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#sendMessage {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #4CAF50;
    color: white;
    cursor: pointer;
    font-size: 18px;
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.chat-message {
    animation: fadeIn 0.3s ease;
}

/* Scrollbar personalizada */
#chatMessages::-webkit-scrollbar {
    width: 6px;
}

#chatMessages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

#chatMessages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.host-option {
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.host-option input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.host-option label {
    color: #333;
    font-size: 14px;
} 