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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

h1 {
    color: white;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.warning-banner {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    display: none;
}

.warning-banner.show {
    display: block;
}

.warning-text {
    color: #92400e;
    font-size: 14px;
}

.status-bar {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ef4444;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: #10b981;
}

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

.my-client-section {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    border: 3px solid #667eea;
}

.my-client-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.connect-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

@media (max-width: 768px) {
    .connect-form {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    color: #555;
    font-weight: 600;
    font-size: 14px;
}

input, select {
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus, select:focus {
    outline: none;
    border-color: #667eea;
}

button {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

button:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-1px);
}

button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

button.btn-success {
    background: #10b981;
}

button.btn-success:hover:not(:disabled) {
    background: #059669;
}

button.btn-danger {
    background: #ef4444;
}

button.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.my-client-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    display: none;
}

.my-client-card.active {
    display: block;
}

.my-client-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-label {
    font-size: 12px;
    opacity: 0.9;
}

.info-value {
    font-size: 16px;
    font-weight: 600;
}

.my-client-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

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

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 1200px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.card h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.room-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 500px;
    overflow-y: auto;
}

.room-item {
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.room-item.playing {
    border-left-color: #10b981;
    background: #ecfdf5;
}

.room-item.waiting {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.room-item.my-room {
    border: 3px solid #667eea;
    background: #e0e7ff;
}

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

.room-name {
    font-weight: 600;
    color: #333;
    font-size: 1.1em;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-waiting {
    background: #fef3c7;
    color: #92400e;
}

.badge-playing {
    background: #d1fae5;
    color: #065f46;
}

.badge-my-room {
    background: #667eea;
    color: white;
}

.room-details {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.player-info {
    display: flex;
    gap: 10px;
    margin: 8px 0;
    flex-wrap: wrap;
}

.player-badge {
    background: #e0e7ff;
    color: #3730a3;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    animation: slideIn 0.3s;
}

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

.modal-header {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.console {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 15px;
    border-radius: 5px;
    height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    margin-bottom: 10px;
}

.console-line {
    margin-bottom: 5px;
    word-wrap: break-word;
}

.console-line.relay {
    color: #60a5fa;
}

.console-line.room {
    color: #a78bfa;
}

.console-line.info {
    color: #fbbf24;
}

.console-line.error {
    color: #f87171;
}

.console-line.success {
    color: #4ade80;
}

.timestamp {
    color: #9ca3af;
    margin-right: 10px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
}

.lock-icon {
    color: #f59e0b;
    margin-left: 5px;
}

.session-badge {
    background: #10b981;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 10px;
}
